Update check

This commit is contained in:
Mahdi Dibaiee 2014-02-09 19:32:07 +03:30
parent dda48b1b97
commit 485f9077f5
3 changed files with 33 additions and 4 deletions

View File

@ -25,6 +25,18 @@ $(window).resize(sizeAndPos);
$(this).parent().find('li[aria-selected]').removeAttr('aria-selected'); $(this).parent().find('li[aria-selected]').removeAttr('aria-selected');
$(this).attr('aria-selected', 'true'); $(this).attr('aria-selected', 'true');
}) })
$('#pro').click(function() {
$('#save ol:nth-of-type(2) li').each(function() {
if( $(this).find('span').html() !== 'Transparent' ) {
$(this).addClass('hidden');
$(this).removeAttr('aria-selected');
}
else $(this).attr('aria-selected', 'true');
})
})
$('#exp').click(function() {
$('#save ol:nth-of-type(2) li').removeClass('hidden');
})
}) })
$('#pro').click(function() { $('#pro').click(function() {
$('#save ol:nth-of-type(2) li').each(function() { $('#save ol:nth-of-type(2) li').each(function() {

View File

@ -89,11 +89,16 @@ $(document).ready(function() {
// Check for Update // Check for Update
var request = navigator.mozApps.getSelf(); var request = navigator.mozApps.checkInstalled('mdibaiee.github.io/Sketchy/Web/manifest-web.webapp');
request.onsuccess = function() { request.onsuccess = function() {
var manifest = this.manifest; if( !this.result && confirm('A new version is available, do you want to update?') ) {
navigator.mozApps.install('mdibaiee.github.io/Sketchy/Web/manifest-web.webapp');
}
}
request.onerror = function() {
alert('An error occured while trying to check for updates');
} }
}) })

View File

@ -25,6 +25,18 @@ $('.load').tap(function() {
$(this).parent().find('li[aria-selected]').removeAttr('aria-selected'); $(this).parent().find('li[aria-selected]').removeAttr('aria-selected');
$(this).attr('aria-selected', 'true'); $(this).attr('aria-selected', 'true');
}) })
$('#pro').click(function() {
$('#save ol:nth-of-type(2) li').each(function() {
if( $(this).find('span').html() !== 'Transparent' ) {
$(this).addClass('hidden');
$(this).removeAttr('aria-selected');
}
else $(this).attr('aria-selected', 'true');
})
})
$('#exp').click(function() {
$('#save ol:nth-of-type(2) li').removeClass('hidden');
})
}) })
$('#pro').click(function() { $('#pro').click(function() {
$('#save ol:nth-of-type(2) li').each(function() { $('#save ol:nth-of-type(2) li').each(function() {