12 changed files with 148 additions and 198 deletions
File diff suppressed because one or more lines are too long
@ -1,63 +1 @@
|
||||
<!doctype html><html lang=en ng-app=myApp manifest=app.manifest><head><meta charset=utf-8><meta name=viewport content="width=device-width, user-scalable=no"><title>Webogram</title><link rel=stylesheet href=css/app.css><link rel=icon href=favicon.ico type=image/x-icon><meta property=og:title content=Webogram><meta property=og:url content="http://zhukov.github.io/webogram/"><meta property=og:image content=http://zhukov.github.io/webogram/img/logo_share.png><meta property=og:site_name content=Webogram><meta property=og:description content="Welcome to an experimental web-client of Telegram messenger. See https://github.com/zhukov/webogram for more info."><script type=text/javascript>(function () { |
||||
|
||||
// Prevent click-jacking |
||||
try { |
||||
if (self == top) { |
||||
document.documentElement.style.display = 'block'; |
||||
} else { |
||||
top.location = self.location; |
||||
} |
||||
} catch (e) {console.error('CJ protection', e)}; |
||||
|
||||
window.safeConfirm = function (params, callback) { |
||||
if (typeof params === 'string') { |
||||
params = {message: params}; |
||||
} |
||||
var result = false |
||||
try { |
||||
result = confirm(params.message); |
||||
} catch (e) { |
||||
result = true; |
||||
} |
||||
setTimeout(function () {callback(result)}, 10); |
||||
}; |
||||
|
||||
if (!window.applicationCache || !window.addEventListener) { |
||||
return; |
||||
} |
||||
|
||||
var appCache = window.applicationCache, |
||||
declined = false, |
||||
updateTimeout = false, |
||||
scheduleUpdate = function (delay) { |
||||
clearTimeout(updateTimeout); |
||||
updateTimeout = setTimeout(function () { |
||||
try { |
||||
appCache.update(); |
||||
} catch (ex) { |
||||
console.log('appCache.update: ' + ex); |
||||
} |
||||
}, delay || 300000); |
||||
}, |
||||
attach = function () { |
||||
appCache.addEventListener('updateready', function(e) { |
||||
if (appCache.status == appCache.UPDATEREADY) { |
||||
if (!declined) { |
||||
safeConfirm({type: 'WEBOGRAM_UPDATED_RELOAD', message: 'A new version of Webogram is available. Load it?'}, function (result) { |
||||
if (result) { |
||||
window.location.reload(); |
||||
} else { |
||||
declined = true; |
||||
} |
||||
}); |
||||
scheduleUpdate(); |
||||
} |
||||
} |
||||
}, false); |
||||
appCache.addEventListener('noupdate', function () {scheduleUpdate()}, false); |
||||
appCache.addEventListener('error', function () {scheduleUpdate()}, false); |
||||
}; |
||||
|
||||
scheduleUpdate(3000); |
||||
window.addEventListener('load', attach); |
||||
})();</script></head><body><div ng-view=""></div><script src=js/app.js></script></body></html> |
||||
<!doctype html><html lang=en ng-app=myApp manifest=app.manifest><head><meta charset=utf-8><meta name=viewport content="width=device-width, user-scalable=no"><title>Webogram</title><link rel=stylesheet href=css/app.css><link rel=icon href=favicon.ico type=image/x-icon><meta property=og:title content=Webogram><meta property=og:url content="http://zhukov.github.io/webogram/"><meta property=og:image content=http://zhukov.github.io/webogram/img/logo_share.png><meta property=og:site_name content=Webogram><meta property=og:description content="Welcome to an experimental web-client of Telegram messenger. See https://github.com/zhukov/webogram for more info."></head><body><div ng-view=""></div><script src=js/app.js></script></body></html> |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue