define("client",[],function(){var e=codebox.require("jQuery"),t=codebox.require("q"),n=codebox.require("core/app"),r=codebox.require("core/box"),i=codebox.require("core/commands/menu"),s=codebox.require("core/commands/toolbar"),o=codebox.require("core/operations"),u=codebox.require("hr/hr"),a=codebox.require("models/command"),f=codebox.require("core/localfs"),l=codebox.require("utils/dialogs"),c=new a({},{title:"Changes",type:"menu",flags:"disabled"}),h=i.register("offline.changes",{title:"Changes",position:95,offline:!1}).menuSection([{title:"Recalcul Changes",offline:!1,action:function(){return f.sync()}},{id:"changes.apply",title:"Apply All Changes",offline:!1,action:function(){var e=f.changes.size();if(e==0)return;l.confirm("Do you really want to apply "+e+" changes?").then(function(e){if(!e)return;return f.changes.applyAll()})}}]).menuSection([c]);f.changes.on("add remove reset",function(){c.toggleFlag("disabled",f.changes.size()==0),c.menu.reset(f.changes.map(function(e){return e.command()}))});var p=s.register("offline.check",{title:"Check Connexion",offline:!0,icon:"bolt"},function(){u.Offline.check()}),d=a.register("offline.sync.menu",{type:"menu",title:"Synchronize"});d.menuSection(p),d.menuSection([{id:"changes.calcul",title:"Calcul Changes",offline:!1,action:function(){return f.sync()}},{id:"changes.reset",title:"Reset Offline Cache",offline:!1,action:function(){return f.reset()}}]);var v=o.start("offline.update",null,{title:"Downloading new version",icon:"fa-download",state:window.applicationCache.status==window.applicationCache.IDLE?"idle":"running",progress:0});e(window.applicationCache).bind("downloading progress",function(e){console.log("!!! cache progress",e);var t=0;e&&e.originalEvent&&e.originalEvent.lengthComputable&&(t=Math.round(100*e.originalEvent.loaded/e.originalEvent.total)),v.state("running"),v.progress(t)}),e(window.applicationCache).bind("checking",function(e){v.state("running"),v.progress(0),alert("checking cache")}),e(window.applicationCache).bind("noupdate cached obsolete error",function(e){v.state("idle"),alert("cache end")}),i.getById("file").menuSection([d],{position:10}),i.register("offline",{title:"Offline",position:90,offline:!0}).menuSection([p]),f.enableSync(),setInterval(function(){f.autoSync()},6e5),r.on("box:watch",function(){f.autoSync()}),setTimeout(function(){f.sync()},5e3)})
define("client",[],function(){var e=codebox.require("jQuery"),t=codebox.require("q"),n=codebox.require("core/app"),r=codebox.require("core/box"),i=codebox.require("core/commands/menu"),s=codebox.require("core/commands/toolbar"),o=codebox.require("core/operations"),u=codebox.require("hr/hr"),a=codebox.require("models/command"),f=codebox.require("core/localfs"),l=codebox.require("utils/dialogs"),c=new a({},{title:"Changes",type:"menu",flags:"disabled"}),h=i.register("offline.changes",{title:"Changes",position:95,offline:!1}).menuSection([{title:"Recalcul Changes",offline:!1,action:function(){return f.sync()}},{id:"changes.apply",title:"Apply All Changes",offline:!1,action:function(){var e=f.changes.size();if(e==0)return;l.confirm("Do you really want to apply "+e+" changes?").then(function(e){if(!e)return;return f.changes.applyAll()})}}]).menuSection([c]);f.changes.on("add remove reset",function(){c.toggleFlag("disabled",f.changes.size()==0),c.menu.reset(f.changes.map(function(e){return e.command()}))});var p=s.register("offline.check",{title:"Check Connexion",offline:!0,icon:"bolt"},function(){u.Offline.check()}),d=a.register("offline.sync.menu",{type:"menu",title:"Synchronize"});d.menuSection(p),d.menuSection([{id:"changes.calcul",title:"Calcul Changes",offline:!1,action:function(){return f.sync()}},{id:"changes.reset",title:"Reset Offline Cache",offline:!1,action:function(){return f.reset()}}]);var v=o.start("offline.update",null,{title:"Downloading new version",icon:"fa-download",state:window.applicationCache.status==window.applicationCache.IDLE?"idle":"running",progress:0});e(window.applicationCache).bind("downloading progress",function(e){var t=0;e&&e.originalEvent&&e.originalEvent.lengthComputable&&(t=Math.round(100*e.originalEvent.loaded/e.originalEvent.total)),v.state("running"),v.progress(t)}),e(window.applicationCache).bind("checking",function(e){v.state("running"),v.progress(0)}),e(window.applicationCache).bind("noupdate cached obsolete error",function(e){v.state("idle")}),i.getById("file").menuSection([d],{position:10}),i.register("offline",{title:"Offline",position:90,offline:!0}).menuSection([p]),f.enableSync(),setInterval(function(){f.autoSync()},6e5),r.on("box:watch",function(){f.autoSync()}),setTimeout(function(){f.sync()},5e3)})
Remove alert in cb.offline