mirror of
https://github.com/kiwix/kiwix-js-pwa.git
synced 2025-09-09 12:19:46 -04:00
Allow the app to run in non-UWP context
Former-commit-id: a96b6de387c8eb52eb90b409caf2fae518377951 [formerly 337a249b7387c826a2085e3274f2f6afd1f34c99] Former-commit-id: b0e90e46bceed3cbfd4cfc6671af7aecbe2c6bf9
This commit is contained in:
parent
f26cab370d
commit
0562e1762a
@ -306,7 +306,7 @@
|
|||||||
<br /> Scanning for archives... Please wait <img src="img/spinner.gif" alt="Please wait..." />
|
<br /> Scanning for archives... Please wait <img src="img/spinner.gif" alt="Please wait..." />
|
||||||
</div>
|
</div>
|
||||||
<div id="chooseArchiveFromLocalStorage" style="display: none;">
|
<div id="chooseArchiveFromLocalStorage" style="display: none;">
|
||||||
<div class="row">
|
<div id="archivesFound" class="row">
|
||||||
<p><span id="archiveNumber">Archives found on this device (tap "Select storage" to rescan)</span>:</p>
|
<p><span id="archiveNumber">Archives found on this device (tap "Select storage" to rescan)</span>:</p>
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<select id="archiveList" class="form-control" multiple></select><br />
|
<select id="archiveList" class="form-control" multiple></select><br />
|
||||||
@ -315,7 +315,7 @@
|
|||||||
<div id="noZIMFound" style="display: none;">
|
<div id="noZIMFound" style="display: none;">
|
||||||
<p style="color: red;">There were no ZIM file(s) found in the selected location! Please choose a different folder.</p>
|
<p style="color: red;">There were no ZIM file(s) found in the selected location! Please choose a different folder.</p>
|
||||||
</div>
|
</div>
|
||||||
<div id="openLocalFiles" style="display: none;">
|
<div id="openLocalFiles" style="display: block;">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-6">
|
<div class="col-xs-6">
|
||||||
<input type="button" class="btn btn-primary" value="Select archive" id="archiveFile" accept=".zim" />
|
<input type="button" class="btn btn-primary" value="Select archive" id="archiveFile" accept=".zim" />
|
||||||
@ -347,7 +347,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="rescanStorage"class="row">
|
<div id="rescanStorage" style="display:none;" class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -385,7 +385,12 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'q', 'module'
|
|||||||
document.getElementById('findInArticle').classList.remove("dark");
|
document.getElementById('findInArticle').classList.remove("dark");
|
||||||
document.getElementById('prefix').classList.remove("dark");
|
document.getElementById('prefix').classList.remove("dark");
|
||||||
}
|
}
|
||||||
document.getElementById('openLocalFiles').style.display = params.rescan ? "block" : "none";
|
if (typeof Windows !== 'undefined') {
|
||||||
|
document.getElementById('openLocalFiles').style.display = params.rescan ? "block" : "none";
|
||||||
|
}
|
||||||
|
//else {
|
||||||
|
// document.getElementById('rescanStorage').style.display = "none";
|
||||||
|
//}
|
||||||
// Show the selected content in the page
|
// Show the selected content in the page
|
||||||
$('#about').hide();
|
$('#about').hide();
|
||||||
$('#configuration').hide();
|
$('#configuration').hide();
|
||||||
@ -465,7 +470,9 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'q', 'module'
|
|||||||
document.getElementById('archiveFile').style.display = "none";
|
document.getElementById('archiveFile').style.display = "none";
|
||||||
document.getElementById('archiveFiles').style.display = "none";
|
document.getElementById('archiveFiles').style.display = "none";
|
||||||
document.getElementById('UWPInstructions').style.display = "none";
|
document.getElementById('UWPInstructions').style.display = "none";
|
||||||
document.getElementById('instructions').style.display = "inline";
|
document.getElementById('archivesFound').style.display = "none";
|
||||||
|
document.getElementById('chooseArchiveFromLocalStorage').style.display = "block";
|
||||||
|
document.getElementById('instructions').style.display = "block";
|
||||||
document.getElementById('archiveFilesLegacy').style.display = "inline";
|
document.getElementById('archiveFilesLegacy').style.display = "inline";
|
||||||
$('#archiveFilesLegacy').on('change', setLocalArchiveFromFileSelect)
|
$('#archiveFilesLegacy').on('change', setLocalArchiveFromFileSelect)
|
||||||
}
|
}
|
||||||
@ -1230,10 +1237,10 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'q', 'module'
|
|||||||
*/
|
*/
|
||||||
function displayFileSelect() {
|
function displayFileSelect() {
|
||||||
$('#openLocalFiles').show();
|
$('#openLocalFiles').show();
|
||||||
if (typeof Windows === 'undefined') {
|
//if (typeof Windows === 'undefined') {
|
||||||
//If not UWP, display legacy File Select
|
// //If not UWP, display legacy File Select
|
||||||
$('#btnConfigure').click();
|
// $('#btnConfigure').click();
|
||||||
}
|
//}
|
||||||
//TODO - check if this is necessary or if it causes the archiveList change event to fire
|
//TODO - check if this is necessary or if it causes the archiveList change event to fire
|
||||||
//Make archive list combo box fit the number of files
|
//Make archive list combo box fit the number of files
|
||||||
//var comboArchiveList = document.getElementById('archiveList');
|
//var comboArchiveList = document.getElementById('archiveList');
|
||||||
@ -1548,7 +1555,7 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'q', 'module'
|
|||||||
console.log("Initiating Document Ready timer...");
|
console.log("Initiating Document Ready timer...");
|
||||||
console.time("Time to Document Ready");
|
console.time("Time to Document Ready");
|
||||||
|
|
||||||
//Destroy the iframe
|
//Void the iframe
|
||||||
console.log("# Clearing the iframe...");
|
console.log("# Clearing the iframe...");
|
||||||
document.getElementById("articleContent").src = "about:blank";
|
document.getElementById("articleContent").src = "about:blank";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user