From c715a1febb42a2bb8586cca6a11d3223456f712d Mon Sep 17 00:00:00 2001 From: Mossroy Date: Sat, 22 Sep 2018 10:43:44 +0200 Subject: [PATCH] Update README, CHANGELOG, and reword warnings on ServiceWorker mode. Fixes #421 --- CHANGELOG.md | 9 ++++++++- README.md | 2 +- www/index.html | 12 ++++++------ www/js/app.js | 39 +++------------------------------------ 4 files changed, 18 insertions(+), 44 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19baacf2..f86a4b42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,18 @@ Please note that this application has changed its name over time. It was first called Evopedia (and was using the file format of Evopedia) Then it was renamed Kiwix-html5 (and uses ZIM files), then was renamed Kiwix-JS. -## Kiwix-JS v2.4.0 +## Kiwix-JS v2.5.0 Released on TODO TODO +## Kiwix-JS v2.4.0 +Released on 2018-09-22 + +Performance improvement on decompression of content (now twice faster) + +Stability improvement for the ServiceWorker mode + ## Kiwix-JS v2.3.1 Released on 2018-09-08 diff --git a/README.md b/README.md index bf09e834..ac609c64 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ It is unfortunately not technically possible to "remember" the selected ZIM file ## Some technical details Technically, after reading an article from a ZIM file, there is a need to "inject" the dependencies (images, css etc). For compatibility reasons, there are several ways to do it : -- the "jQuery" mode parses the DOM to find the HTML tags of these dependencies, and modifies them to put the Base64 content in it. It is compatible with any browser, but is slow and can use a lot of memory. It works well on Mediawiki-based content, but can miss some dependencies on some contents +- the "jQuery" mode parses the DOM to find the HTML tags of these dependencies, and modifies them to put the Base64 content in it. It is compatible with any browser. It works well on Mediawiki-based content, but can miss some dependencies on some contents - the "ServiceWorker" mode uses a Service Worker to catch any HTTP request the page would send, and reply with content read from the ZIM file. It is a generic and much cleaner way than jQuery mode, but it does not work on all browsers. And ServiceWorkers are currently disabled by Mozilla in Firefox extensions ## Compatibility diff --git a/www/index.html b/www/index.html index fabd0b6d..6858465d 100644 --- a/www/index.html +++ b/www/index.html @@ -11,10 +11,11 @@ Home page : http://www.kiwix.org Main authors of this application : - Mossroy - mossroy@mossroy.fr + Mossroy - https://github.com/mossroy - mossroy@mossroy.fr Peter-x - https://github.com/peter-x + Jaifroid - https://github.com/Jaifroid - Copyright 2013-2017 Mossroy, Peter-x and contributors + Copyright 2013-2018 Mossroy, Peter-x, Jaifroid, sharun-s and contributors License GPL v3: This file is part of Kiwix. @@ -145,7 +146,7 @@

Credits

We have to distribute some thanks to : @@ -217,17 +218,16 @@
Content injection mode
- Don't touch unless you know what you're doing!
diff --git a/www/js/app.js b/www/js/app.js index 6a36fa66..c674a4c9 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -193,13 +193,8 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies','abstractFiles return false; }); $('input:radio[name=contentInjectionMode]').on('change', function(e) { - if (checkWarnServiceWorkerMode(this.value)) { - // Do the necessary to enable or disable the Service Worker - setContentInjectionMode(this.value); - } - else { - setContentInjectionMode('jquery'); - } + // Do the necessary to enable or disable the Service Worker + setContentInjectionMode(this.value); }); /** @@ -325,35 +320,7 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies','abstractFiles // Save the value in a cookie, so that to be able to keep it after a reload/restart cookies.setItem('lastContentInjectionMode', value, Infinity); } - - /** - * If the ServiceWorker mode is selected, warn the user before activating it - * @param chosenContentInjectionMode The mode that the user has chosen - */ - function checkWarnServiceWorkerMode(chosenContentInjectionMode) { - if (chosenContentInjectionMode === 'serviceworker' && !cookies.hasItem("warnedServiceWorkerMode")) { - // The user selected the "serviceworker" mode, which is still unstable - // So let's display a warning to the user - - // If the focus is on the search field, we have to move it, - // else the keyboard hides the message - if ($("#prefix").is(":focus")) { - $("searchArticles").focus(); - } - if (confirm("The 'Service Worker' mode is still UNSTABLE for now." - + " It happens that the application needs to be reinstalled (or the ServiceWorker manually removed)." - + " Please confirm with OK that you're ready to face this kind of bugs, or click Cancel to stay in 'jQuery' mode.")) { - // We will not display this warning again for one day - cookies.setItem("warnedServiceWorkerMode", true, 86400); - return true; - } - else { - return false; - } - } - return true; - } - + // At launch, we try to set the last content injection mode (stored in a cookie) var lastContentInjectionMode = cookies.getItem('lastContentInjectionMode'); if (lastContentInjectionMode) {