Former-commit-id: 9f827ea900697c11ec3b530e0cf729df2055e961 [formerly 8dbf0650c653c56aad94d80d695ace366c26f1a7]
Former-commit-id: 2dce6de4882c80d0a7af471576bc44d2e40d1bde
This commit is contained in:
Jaifroid 2017-09-13 15:22:29 +01:00
parent d83d69f61a
commit 19d7dcb1ec
2 changed files with 21 additions and 2 deletions

View File

@ -275,12 +275,18 @@
<p>This application needs a ZIM archive to work. You can get one from the <a href="#downloads">download links panel</a>.</p>
</div>
<div id="openLocalFiles" style="display: none;">
<div class="row">
<div id="UWPInstructions" class="row">
<p>
If you have a single (unsplit) ZIM archive, use the <b>first</b> button.<br />
For a split archive (.zimaa, .zimab, etc.) or multiple archives, use the <b>second</b> button.
</p>
</div>
<div id="instructions" class="row" style="display:none;">
<p>
Please choose the location of your ZIM archive.<br />
For a split archive (.zimaa, .zimab, etc.) you must select <b>all</b> the split parts.
</p>
</div>
<div class="row">
<div class="col-xs-6">
<input type="button" class="btn btn-primary" value="Select single archive" id="archiveFile" accept=".zim" />

View File

@ -429,6 +429,15 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'abstractFile
if (params.localStorage && !params.pickedFolder && !params.pickedFile) {
params.pickedFolder = params.localStorage;
}
if (typeof Windows === 'undefined') {
//If not UWP, display legacy File Select
document.getElementById('archiveFile').style.display = "none";
document.getElementById('archiveFiles').style.display = "none";
document.getElementById('UWPInstructions').style.display = "none";
document.getElementById('instructions').style.display = "inline";
document.getElementById('archiveFilesLegacy').style.display = "inline";
$('#archiveFilesLegacy').on('change', setLocalArchiveFromFileSelect)
}
return false;
});
$('#btnAbout').on('click', function (e) {
@ -1124,6 +1133,10 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'abstractFile
*/
function displayFileSelect() {
$('#openLocalFiles').show();
if (typeof Windows === 'undefined') {
//If not UWP, display legacy File Select
$('#btnConfigure').click();
}
//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
//var comboArchiveList = document.getElementById('archiveList');
@ -1221,7 +1234,7 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'abstractFile
* Sets the localArchive from the File selects populated by user
*/
function setLocalArchiveFromFileSelect() {
setLocalArchiveFromFileList(document.getElementById('archiveFiles').files);
setLocalArchiveFromFileList(document.getElementById('archiveFilesLegacy').files);
}
/**