Update check

This commit is contained in:
Mahdi Dibaiee 2014-02-09 21:58:45 +03:30
parent ef8ddaf380
commit 483f681400

View File

@ -93,6 +93,9 @@ $(document).ready(function() {
request.onsuccess = function() {
var app = this.result[0];
var latest = $.ajax({url:'manifest-web.webapp'});
var selfApp = navigator.mozApps.getSelf();
selfApp.onsuccess = function() {
if(this.result) {
latest.onload = function() {
if( this.response ) {
var lapp = JSON.parse(this.response);
@ -111,6 +114,8 @@ $(document).ready(function() {
}
}
}
}
}
if( !app && confirm('Do you want to Install this app?') ) {
var ins = navigator.mozApps.install('http://mdibaiee.github.io/Sketchy/Web/manifest-web.webapp');
ins.onsuccess = function() {