Correct selector display logic

Former-commit-id: 7ac882f8e997ad6db11bb0e90292de905d0e6a03 [formerly 2ad0a83fbaa1d1e0c348f25ccb1e65a6cfb1cdd3]
Former-commit-id: 7b601b680ee840dab75946af634e8b2ecc1bbb83
This commit is contained in:
Jaifroid 2019-03-06 21:55:35 +00:00
parent d00031d21e
commit 829e67568a
3 changed files with 15 additions and 11 deletions

View File

@ -253,7 +253,7 @@
in the Windows Settings for <b>Offline Maps</b>. in the Windows Settings for <b>Offline Maps</b>.
</p> </p>
<h3>Usage</h3> <h3 id="addingArchives">Usage</h3>
<h4>Step 1: download some content</h4> <h4>Step 1: download some content</h4>
<p> <p>
You can browse the Kiwix repository on the <a href="#downloads" onclick="document.getElementById('btnConfigure').click();">Configuration</a> page, and it will provide instructions according to the type of file you download. You can browse the Kiwix repository on the <a href="#downloads" onclick="document.getElementById('btnConfigure').click();">Configuration</a> page, and it will provide instructions according to the type of file you download.
@ -386,9 +386,8 @@
<div id="returntoArticle" class="returntoArticle" style="text-align:center;padding-top:20px;"></div> <div id="returntoArticle" class="returntoArticle" style="text-align:center;padding-top:20px;"></div>
<div class="row"> <div class="row">
<h2 style="margin-top:0;">Configuration</h2> <h2 style="margin-top:0;">Configuration</h2>
<p>This application needs a ZIM archive to work.<span id="downloadLinksText"> You can get one from the <a href="#downloads">download links panel</a>.</span></p>
<p id="currentArchive" style="display: none;"></p> <p id="currentArchive" style="display: none;"></p>
<p id="downloadLinksText"><a id="otherLangs" href="#btnRescanDeviceStorage">Get more archives (in other languages)</a></p><p></p> <p id="downloadLinksText">This application needs a ZIM archive to work. Download one from the <a id="otherLangs" href="#btnRescanDeviceStorage">Archive Library</a>.</p><p></p>
<p id="moreInfo">For more information see <a href="#" onclick="document.getElementById('btnAbout').click();">About tab <span class="glyphicon glyphicon-info-sign"></span></a> (top right)</p> <p id="moreInfo">For more information see <a href="#" onclick="document.getElementById('btnAbout').click();">About tab <span class="glyphicon glyphicon-info-sign"></span></a> (top right)</p>
</div> </div>
<div id="hideFileSelectors"> <div id="hideFileSelectors">

View File

@ -525,6 +525,17 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'q', 'module'
} }
document.getElementById('libraryArea').style.borderColor = ''; document.getElementById('libraryArea').style.borderColor = '';
document.getElementById('libraryArea').style.borderStyle = ''; document.getElementById('libraryArea').style.borderStyle = '';
var currentArchive = document.getElementById('currentArchive');
if (params.packagedFile && params.storedFile && params.storedFile != params.packagedFile) {
currentArchive.innerHTML = "Currently loaded archive: <b>" + params.storedFile.replace(/\.zim$/i, "") + "</b>";
currentArchive.style.display = "block";
document.getElementById('downloadLinksText').style.display = "none";
document.getElementById('moreInfo').style.display = "none";
}
if (params.storedFile && params.storedFile == params.packagedFile) {
document.getElementById('downloadLinksText').style.display = "block";
currentArchive.style.display = "none";
}
//else { //else {
// document.getElementById('rescanStorage').style.display = "none"; // document.getElementById('rescanStorage').style.display = "none";
//} //}
@ -891,6 +902,7 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'q', 'module'
var currentArchive = document.getElementById('currentArchive'); var currentArchive = document.getElementById('currentArchive');
currentArchive.innerHTML = "Currently loaded archive: <b>" + params.storedFile.replace(/\.zim$/i, "") + "</b>"; currentArchive.innerHTML = "Currently loaded archive: <b>" + params.storedFile.replace(/\.zim$/i, "") + "</b>";
currentArchive.style.display = params.showFileSelectors ? "none" : "block"; currentArchive.style.display = params.showFileSelectors ? "none" : "block";
document.getElementById('downloadLinksText').style.display = params.showFileSelectors ? "none" : "block";
} }
cookies.setItem('showFileSelectors', params.showFileSelectors, Infinity); cookies.setItem('showFileSelectors', params.showFileSelectors, Infinity);
if (params.showFileSelectors) document.getElementById('configuration').scrollIntoView(); if (params.showFileSelectors) document.getElementById('configuration').scrollIntoView();

View File

@ -50,7 +50,7 @@ params['hideToolbar'] = getCookie('hideToolbar') != null ? getCookie('hideToolba
params['rememberLastPage'] = getCookie('rememberLastPage') != null ? getCookie('rememberLastPage') : true; //Set default option to remember the last visited page between sessions params['rememberLastPage'] = getCookie('rememberLastPage') != null ? getCookie('rememberLastPage') : true; //Set default option to remember the last visited page between sessions
params['useMathJax'] = getCookie('useMathJax') != null ? getCookie('useMathJax') : true; //Set default to true to display math formulae with MathJax, false to use fallback SVG images only params['useMathJax'] = getCookie('useMathJax') != null ? getCookie('useMathJax') : true; //Set default to true to display math formulae with MathJax, false to use fallback SVG images only
//params['showFileSelectors'] = getCookie('showFileSelectors') != null ? getCookie('showFileSelectors') : false; //Set to true to display hidden file selectors in packaged apps //params['showFileSelectors'] = getCookie('showFileSelectors') != null ? getCookie('showFileSelectors') : false; //Set to true to display hidden file selectors in packaged apps
params['showFileSelectors'] = false; //This will cause file selectors to be hidden on each load of the app (by ignoring cookie) params['showFileSelectors'] = true; //False will cause file selectors to be hidden on each load of the app (by ignoring cookie)
params['hideActiveContentWarning'] = getCookie('hideActiveContentWarning') != null ? getCookie('hideActiveContentWarning') : false; params['hideActiveContentWarning'] = getCookie('hideActiveContentWarning') != null ? getCookie('hideActiveContentWarning') : false;
params['alphaChar'] = getCookie('alphaChar') || 'A'; //Set default start of alphabet string (used by the Archive Index) params['alphaChar'] = getCookie('alphaChar') || 'A'; //Set default start of alphabet string (used by the Archive Index)
params['omegaChar'] = getCookie('omegaChar') || 'Z'; //Set default end of alphabet string params['omegaChar'] = getCookie('omegaChar') || 'Z'; //Set default end of alphabet string
@ -104,13 +104,6 @@ var fileVersionDivs = document.getElementsByClassName('fileVersion');
for (i = 0; i < fileVersionDivs.length; i++) { for (i = 0; i < fileVersionDivs.length; i++) {
fileVersionDivs[i].innerHTML = i ? params.fileVersion.replace(/\s+.+$/, "") : params.fileVersion; fileVersionDivs[i].innerHTML = i ? params.fileVersion.replace(/\s+.+$/, "") : params.fileVersion;
} }
if (!params.showFileSelectors && params.packagedFile && params.storedFile && params.storedFile != params.packagedFile) {
var currentArchive = document.getElementById('currentArchive');
if (currentArchive) {
currentArchive.innerHTML = "Currently loaded archive: <b>" + params.storedFile.replace(/\.zim$/i, "") + "</b>";
currentArchive.style.display = "block";
}
}
document.getElementById('logUpdate').innerHTML = document.getElementById('update').innerHTML.match(/<ul[^>]*>[\s\S]+/i); document.getElementById('logUpdate').innerHTML = document.getElementById('update').innerHTML.match(/<ul[^>]*>[\s\S]+/i);
document.getElementById('logFeatures').innerHTML = document.getElementById('features').innerHTML; document.getElementById('logFeatures').innerHTML = document.getElementById('features').innerHTML;