mirror of
https://github.com/kiwix/kiwix-js-pwa.git
synced 2025-09-17 08:20:10 -04:00
parent
064fbba998
commit
16ef2ee94d
@ -1086,6 +1086,13 @@
|
|||||||
<span class="checkmark"></span>
|
<span class="checkmark"></span>
|
||||||
<b>Permanently hide active content warning</b> (for experienced users)
|
<b>Permanently hide active content warning</b> (for experienced users)
|
||||||
</label>
|
</label>
|
||||||
|
<b>Force use of libzim W/ASM for reading full-text index:</b>
|
||||||
|
<select name="debugLibzimASM" id="debugLibzimASMDrop">
|
||||||
|
<option value="">Default</option>
|
||||||
|
<option value="wasm">WASM</option>
|
||||||
|
<option value="asm">ASM</option>
|
||||||
|
</select>
|
||||||
|
<p><i>Warning! Disables OS checks and may stop app from working!</i></p>
|
||||||
<label id="bypassAppCacheDiv" class="checkbox" title="WARNING: Leaving this checked will prevent offline usage of the PWA. Setting will clear all existing Cache API caches, but assetsCache will be used unless also disabled above. For testing new code with the PWA.">
|
<label id="bypassAppCacheDiv" class="checkbox" title="WARNING: Leaving this checked will prevent offline usage of the PWA. Setting will clear all existing Cache API caches, but assetsCache will be used unless also disabled above. For testing new code with the PWA.">
|
||||||
<input type="checkbox" name="bypassAppCache" id="bypassAppCacheCheck">
|
<input type="checkbox" name="bypassAppCache" id="bypassAppCacheCheck">
|
||||||
<span class="checkmark"></span>
|
<span class="checkmark"></span>
|
||||||
|
@ -1329,6 +1329,10 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'utf8', 'cache', 'images
|
|||||||
params.hideActiveContentWarning = this.checked ? true : false;
|
params.hideActiveContentWarning = this.checked ? true : false;
|
||||||
settingsStore.setItem('hideActiveContentWarning', params.hideActiveContentWarning, Infinity);
|
settingsStore.setItem('hideActiveContentWarning', params.hideActiveContentWarning, Infinity);
|
||||||
});
|
});
|
||||||
|
document.getElementById('debugLibzimASMDrop').addEventListener('change', function (event) {
|
||||||
|
params.debugLibzimASM = event.target.value || false;
|
||||||
|
settingsStore.setItem('debugLibzimASM', params.debugLibzimASM, Infinity);
|
||||||
|
})
|
||||||
$('input:checkbox[name=openExternalLinksInNewTabs]').on('change', function () {
|
$('input:checkbox[name=openExternalLinksInNewTabs]').on('change', function () {
|
||||||
params.openExternalLinksInNewTabs = this.checked ? true : false;
|
params.openExternalLinksInNewTabs = this.checked ? true : false;
|
||||||
settingsStore.setItem('openExternalLinksInNewTabs', params.openExternalLinksInNewTabs, Infinity);
|
settingsStore.setItem('openExternalLinksInNewTabs', params.openExternalLinksInNewTabs, Infinity);
|
||||||
@ -3382,6 +3386,11 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'utf8', 'cache', 'images
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!selectedFileSet.length) {
|
||||||
|
reject('The requested archive is not in the archive folder ' + folder + '!');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
reject('The requested archive does not appear to be a ZIM file!');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Folder was empty...
|
// Folder was empty...
|
||||||
|
@ -129,7 +129,7 @@ params.pagesLoaded = 0; // Page counter used to show PWA Install Prompt only aft
|
|||||||
params.localUWPSettings = /UWP/.test(params.appType) ? Windows.Storage.ApplicationData.current.localSettings.values : null;
|
params.localUWPSettings = /UWP/.test(params.appType) ? Windows.Storage.ApplicationData.current.localSettings.values : null;
|
||||||
appstate['target'] = 'iframe'; // The target for article loads (this should always be 'iframe' initially, and will only be changed as a result of user action)
|
appstate['target'] = 'iframe'; // The target for article loads (this should always be 'iframe' initially, and will only be changed as a result of user action)
|
||||||
params['mapsURI'] = getSetting('mapsURI') || (/UWP|Windows/.test(params.appType) ? 'bingmaps:' : 'https://www.openstreetmap.org/'); // Protocol with colon ('bingmaps:') or URL with final slash ('https://www.openstreetmap.org/')
|
params['mapsURI'] = getSetting('mapsURI') || (/UWP|Windows/.test(params.appType) ? 'bingmaps:' : 'https://www.openstreetmap.org/'); // Protocol with colon ('bingmaps:') or URL with final slash ('https://www.openstreetmap.org/')
|
||||||
params['debugLibzimASM'] = null; // 'wasm|asm' Forces use of wasm or asm for libzim decoder. You can also set this as an override URL querystring e.g. ?debugLibzimASM=wasm;
|
params['debugLibzimASM'] = getSetting('degugLibzimASM'); // 'wasm|asm' Forces use of wasm or asm for libzim decoder. You can also set this as an override URL querystring e.g. ?debugLibzimASM=wasm;
|
||||||
|
|
||||||
// Apply any override parameters in querystring (done as a self-calling function to avoid creating global variables)
|
// Apply any override parameters in querystring (done as a self-calling function to avoid creating global variables)
|
||||||
(function overrideParams() {
|
(function overrideParams() {
|
||||||
@ -246,6 +246,7 @@ document.getElementById('hideToolbarsCheck').indeterminate = params.hideToolbars
|
|||||||
document.getElementById('hideToolbarsCheck').readOnly = params.hideToolbars === "top";
|
document.getElementById('hideToolbarsCheck').readOnly = params.hideToolbars === "top";
|
||||||
document.getElementById('hideToolbarsState').innerHTML = (params.hideToolbars === "top" ? "top" : params.hideToolbars ? "both" : "never");
|
document.getElementById('hideToolbarsState').innerHTML = (params.hideToolbars === "top" ? "top" : params.hideToolbars ? "both" : "never");
|
||||||
document.getElementById('openExternalLinksInNewTabsCheck').checked = params.openExternalLinksInNewTabs;
|
document.getElementById('openExternalLinksInNewTabsCheck').checked = params.openExternalLinksInNewTabs;
|
||||||
|
document.getElementById('debugLibzimASMDrop').value = params.debugLibzimASM || '';
|
||||||
if (params.windowOpener === null) { // Setting has never been activated, so determine a sensible default
|
if (params.windowOpener === null) { // Setting has never been activated, so determine a sensible default
|
||||||
params.windowOpener = /UWP/.test(params.appType) && params.contentInjectionMode === 'jquery' ? false :
|
params.windowOpener = /UWP/.test(params.appType) && params.contentInjectionMode === 'jquery' ? false :
|
||||||
'MSBlobBuilder' in window ? 'window' : // IE11/Edge/UWP work best in window mode, not in tab mode!
|
'MSBlobBuilder' in window ? 'window' : // IE11/Edge/UWP work best in window mode, not in tab mode!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user