mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-19 17:35:34 +00:00
feature(listeners) appCache: add getConfig
This commit is contained in:
parent
c817e34630
commit
02b10d68c6
1 changed files with 15 additions and 9 deletions
|
|
@ -7,10 +7,11 @@ var Util, DOM, CloudCmd;
|
|||
|
||||
function ListenersProto(CloudCmd, Util, DOM){
|
||||
var Cache = DOM.Cache,
|
||||
Events = DOM.Events;
|
||||
Events = DOM.Events,
|
||||
getConfig = CloudCmd.getConfig;
|
||||
|
||||
this.analytics = function() {
|
||||
CloudCmd.getConfig(function(config) {
|
||||
getConfig(function(config) {
|
||||
if (config.analytics) {
|
||||
Events.addOneTime('mousemove', function(){
|
||||
var FIVE_SECONDS = 5000,
|
||||
|
|
@ -186,14 +187,19 @@ var Util, DOM, CloudCmd;
|
|||
};
|
||||
|
||||
function appCache() {
|
||||
if (window.applicationCache)
|
||||
Events.add('updateready', function() {
|
||||
var ret = confirm('An update is available. Reload now?');
|
||||
|
||||
if (ret)
|
||||
location.reload();
|
||||
getConfig(function(config) {
|
||||
var isAppCache = config.appcache,
|
||||
appCache = window.applicationCache;
|
||||
|
||||
}, applicationCache);
|
||||
if (isAppCache && appCache)
|
||||
Events.add('updateready', function() {
|
||||
var ret = confirm('An update is available. Reload now?');
|
||||
|
||||
if (ret)
|
||||
location.reload();
|
||||
|
||||
}, appCache);
|
||||
});
|
||||
}
|
||||
|
||||
function contextMenu() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue