document.addEventListener('deviceready', onDeviceReady, false);
document.addEventListener("resume", onAppResume, false);
- if (!OFFLINEAPP) {
- document.addEventListener("offline", onDeviceOffline, false);
- }
+
loadJSLibrary(
cordova
return;
}
- if (!FINISHLOADING) {
- navigator.notification.alert(__('This publication is not available offline. To read it, an internet connection is required'),
- function() {
- window.location = window.sessionStorage.getItem('apphome');
- }, __('An internet connection is required'));
+ if (FINISHLOADING) {
+ return;
}
+
+ navigator.notification.alert(__('This publication is not available offline. To read it, an internet connection is required'),
+ function() {
+ window.location = window.sessionStorage.getItem('apphome');
+ }, __('An internet connection is required'));
}
function onAppResume() {
}
function onDeviceReady() {
+
+
+ document.addEventListener("offline", onDeviceOffline, false);
+
+
var manifest = window.localStorage.getItem('manifest.' + DATAS.id);
var fsprefix = window.sessionStorage.getItem('galfsprefix');
gal.check('extras', function(info) {
if (info.success) {
fb('set offline flag');
+ FINISHLOADING = true;
window.localStorage.setItem('offline.' + DATAS.id, '1');
}
})
}
if (info.bundleName == 'extras') {
fb('set offline flag');
+ FINISHLOADING = true;
window.localStorage.setItem('offline.' + DATAS.id, '1');
}
try {
}
}
+function __(str) {
+ return fluidbook.l10n.__(str);
+}
+
function cacheUpdated(e) {
applicationCache.swapCache();
if (window.confirm(fluidbook.l10n.__('An update of the publication is available. Do you want to load it ?'))) {