From 485f9077f5cb1cfeec3bf79678ffdd9cc6ee2214 Mon Sep 17 00:00:00 2001 From: Mahdi Dibaiee Date: Sun, 9 Feb 2014 19:32:07 +0330 Subject: [PATCH] Update check --- Web/js/desktop.js | 12 ++++++++++++ Web/js/main.js | 13 +++++++++---- Web/js/mobile.js | 12 ++++++++++++ 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/Web/js/desktop.js b/Web/js/desktop.js index 6b975e0..527f66f 100644 --- a/Web/js/desktop.js +++ b/Web/js/desktop.js @@ -25,6 +25,18 @@ $(window).resize(sizeAndPos); $(this).parent().find('li[aria-selected]').removeAttr('aria-selected'); $(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() { $('#save ol:nth-of-type(2) li').each(function() { diff --git a/Web/js/main.js b/Web/js/main.js index 5671280..3a00212 100644 --- a/Web/js/main.js +++ b/Web/js/main.js @@ -89,11 +89,16 @@ $(document).ready(function() { // Check for Update - var request = navigator.mozApps.getSelf(); - + var request = navigator.mozApps.checkInstalled('mdibaiee.github.io/Sketchy/Web/manifest-web.webapp'); 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'); } + + }) diff --git a/Web/js/mobile.js b/Web/js/mobile.js index 12b5ea9..ff0bc10 100644 --- a/Web/js/mobile.js +++ b/Web/js/mobile.js @@ -25,6 +25,18 @@ $('.load').tap(function() { $(this).parent().find('li[aria-selected]').removeAttr('aria-selected'); $(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() { $('#save ol:nth-of-type(2) li').each(function() {