Update check

This commit is contained in:
Mahdi Dibaiee 2014-02-09 22:00:35 +03:30
parent 483f681400
commit 67cb7f996d
2 changed files with 2 additions and 4 deletions

View File

@ -99,10 +99,8 @@ $(document).ready(function() {
latest.onload = function() { latest.onload = function() {
if( this.response ) { if( this.response ) {
var lapp = JSON.parse(this.response); var lapp = JSON.parse(this.response);
alert(lapp.version);
alert(app.manifest.version);
if( lapp.version != app.manifest.version && if( lapp.version != app.manifest.version &&
confirm('A new version of this app is available, do you want to update? ' + app.manifest.version + ' to ' + lapp.version )) { confirm('A new version of this app is available, do you want to update?')) {
var ins = navigator.mozApps.install('http://mdibaiee.github.io/Sketchy/Web/manifest-web.webapp'); var ins = navigator.mozApps.install('http://mdibaiee.github.io/Sketchy/Web/manifest-web.webapp');
ins.onsuccess = function() { ins.onsuccess = function() {
alert('The app was installed successfuly'); alert('The app was installed successfuly');

View File

@ -1,7 +1,7 @@
{ {
"name": "Sketchy Web", "name": "Sketchy Web",
"description": "Free Sketch/Paint app", "description": "Free Sketch/Paint app",
"version": "1.2", "version": "1.3",
"default_locale": "en", "default_locale": "en",
"launch_path": "/Sketchy/Web/index.html", "launch_path": "/Sketchy/Web/index.html",
"icons": { "icons": {