diff --git a/www/index.html b/www/index.html index 6fd84960..9f203872 100644 --- a/www/index.html +++ b/www/index.html @@ -657,13 +657,14 @@

Configuration

For instructions and usage guide, please see the About tab (top right).

+

App version: [check for updates]

- Download more archives from the Archive Library. + Download more archives from the Archive Library.

@@ -739,7 +740,7 @@ diff --git a/www/js/app.js b/www/js/app.js index 6a4a2563..2590e737 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -837,7 +837,7 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'utf8', 'cache', 'images } } // Check for upgrade of PWA - if (!params.upgradeNeeded && /PWA/.test(params.appType) && activeBtn === 'btnConfigure') { + if (!params.upgradeNeeded && /^(?!.*Electron).*PWA/.test(params.appType) && activeBtn === 'btnConfigure') { caches.keys().then(function (keyList) { var cachePrefix = cache.APPCACHE.replace(/^([^\d]+).+/, '$1'); document.getElementById('alertBoxPersistent').innerHTML = ''; @@ -867,6 +867,8 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'utf8', 'cache', 'images } // Check for GitHub and Electron updates + var updateCheck = document.getElementById('updateCheck'); + if (params.allowInternetAccess) updateCheck.style.display = 'none'; function checkUpdateServer() { if (!params.allowInternetAccess) { console.log("The update check was blocked because the user has not allowed Internet access.") @@ -882,7 +884,10 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'utf8', 'cache', 'images updater.getLatestUpdates(function (tag, url, releases) { var updateSpan = document.getElementById('updateStatus'); if (!tag) { - updateSpan.innerHTML = '[ App is up to date ]'; + var upToDate = '[ Latest version ]'; + updateCheck.style.display = 'inline'; + updateCheck.innerHTML = upToDate; + updateSpan.innerHTML = upToDate; console.log('No new update was found.'); return; } @@ -1233,6 +1238,8 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'utf8', 'cache', 'images checkUpdateServer(); } settingsStore.setItem('allowInternetAccess', params.allowInternetAccess, Infinity); + library.style.borderColor = ''; + library.style.borderStyle = ''; }); $('input:checkbox[name=cssCacheMode]').on('change', function (e) { params.cssCache = this.checked ? true : false; @@ -1806,16 +1813,20 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'utf8', 'cache', 'images settingsStore.setItem('useMathJax', params.useMathJax, Infinity); params.themeChanged = true; }); - document.getElementById('otherLangs').addEventListener('click', function () { - if (!params.showFileSelectors) document.getElementById('displayFileSelectorsCheck').click(); - var library = document.getElementById('libraryArea'); - library.style.borderColor = 'red'; - library.style.borderStyle = 'solid'; - document.getElementById('downloadTrigger').addEventListener('mousedown', function () { - library.style.borderColor = ''; - library.style.borderStyle = ''; + var library = document.getElementById('libraryArea'); + var unhideArchiveLibraryAnchors = document.getElementsByClassName("unhideLibrary"); + for (var i = 0; i < unhideArchiveLibraryAnchors.length; i++) { + unhideArchiveLibraryAnchors[i].addEventListener('click', function () { + if (!params.showFileSelectors) document.getElementById('displayFileSelectorsCheck').click(); + library.style.borderColor = 'red'; + library.style.borderStyle = 'solid'; }); + } + document.getElementById('downloadTrigger').addEventListener('mousedown', function () { + library.style.borderColor = ''; + library.style.borderStyle = ''; }); + $('input:checkbox[name=displayFileSelectors]').on('change', function (e) { params.showFileSelectors = this.checked ? true : false; document.getElementById('rescanStorage').style.display = "block";