Document PWA mode and fix TED talks in jQuery mode

Former-commit-id: d5b38843be4525619232bc6e161cd160d01afcd6 [formerly ae597078ee57df6e009c87075d4a6909594215ce [formerly fff7fed9230a08aa316adedd0103b72067b3ceaa]]
Former-commit-id: a45ba40ac126f9484cb084ffe7f0d56e82eda11f
Former-commit-id: 4bd54dc2ad27dfaddb67aee9c7ef3ac8de12d501
This commit is contained in:
Jaifroid 2021-01-31 12:15:48 +00:00
parent eb140198b0
commit 13ca30366a
2 changed files with 31 additions and 19 deletions

View File

@ -91,11 +91,9 @@
<h3>Please read this important information</h3> <h3>Please read this important information</h3>
<div class="disclaimer"> <div class="disclaimer">
<p> <p>
<b>DISCLAIMER:</b> Please be aware that Kiwix works with offline archives, so information in any archive (ZIM <b>DISCLAIMER:</b> Please be aware that Kiwix works with offline archives. To get updated info, you will need to
file) you download will only be as up-to-date as the archive itself. To get updated info, you will need to download a new archive periodically. Information in archives is free, open source and provided by volunteers.<br>
download a new archive. Information in archives is free, open source and provided by volunteers.<br> <strong>Kiwix gives no guarantee as to the accuracy of information in the archives you access with this app.</strong>
<strong>Kiwix gives no guarantee as to the accuracy of information contained in archives you access with this
app.</strong> You should not rely on it as your only source of information for making important decisions.
</p> </p>
</div> </div>
<p style="padding-top:10px;"> <p style="padding-top:10px;">
@ -283,11 +281,9 @@
</ul> </ul>
<div class="disclaimer"> <div class="disclaimer">
<p> <p>
<b>DISCLAIMER:</b> Please be aware that Kiwix works entirely offline, so information in any archive (ZIM <b>DISCLAIMER:</b> Please be aware that Kiwix works with offline archives. To get updated info, you will need to
file) you download will only be as up-to-date as the archive itself. To get updated info, you will need to download a new archive periodically. Information in archives is free, open source and provided by volunteers.<br>
download a new archive. Information in archives is free, open source and provided by volunteers.<br> <strong>Kiwix gives no guarantee as to the accuracy of information in the archives you access with this app.</strong>
<strong>Kiwix gives no guarantee as to the accuracy of information contained in archives you access with this
app.</strong> You should not rely on it as your only source of information for making important decisions.
</p> </p>
</div> </div>
<br> <br>
@ -324,6 +320,7 @@
Alternatively, visit <a href="https://download.kiwix.org/zim" target="_blank">https://download.kiwix.org/zim/</a> using a regular computer. Alternatively, visit <a href="https://download.kiwix.org/zim" target="_blank">https://download.kiwix.org/zim/</a> using a regular computer.
<strong>Currently only Wikimedia contents (ZIM files in wiki* subdirectories) and Stackexchange have been tested fully</strong>. <strong>Currently only Wikimedia contents (ZIM files in wiki* subdirectories) and Stackexchange have been tested fully</strong>.
There are known bugs when reading some other content, and dynamic content is not supported in jQuery mode. There are known bugs when reading some other content, and dynamic content is not supported in jQuery mode.
You may need to switch the app to the experimental PWA mode (see Expert Settings in configuration) to access dynamic content.
</p> </p>
<p> <p>
If you have enough space, you can put several archives on your device storage. If you download the content If you have enough space, you can put several archives on your device storage. If you download the content
@ -339,12 +336,20 @@
cable to copy the ZIM archive(s) to an accessible location on your device, such as the SD card or the main storage area if there is enough cable to copy the ZIM archive(s) to an accessible location on your device, such as the SD card or the main storage area if there is enough
space there. space there.
</p> </p>
<h4>Step 3: open this app, go to the "Configure" menu and select your ZIM file</h4> <h4>Step 3: go to the "Configure" menu and select your ZIM file (or double-click / drag-and-drop your file into the app)</h4>
<p> <p>
On the Configuration page, tap the "Select storage" button. If you have downloaded more than one archive, or you have a split ZIM archive On the Configuration page, tap the "Select storage" button. If you have downloaded more than one archive, or you have a
consisting of several 2GB files, then you will need to pick the <b>folder</b> that contains these files. If you have just one unsplit ZIM split ZIM archive consisting of several 2GB files, then you will need to pick the <b>folder</b> that contains these files
archive, you can instead pick the <b>file</b> directly, using the respective buttons on the or else (in older browsers) you will need to select all the split parts. If you have just one unsplit ZIM archive, you
<a href="#" onclick="$('#btnConfigure').click();">Configuration</a> page (note that these buttons only appear after you tap "Select Storage"). can instead pick the <b>file</b> directly, using the respective buttons on the
<a href="#" onclick="document.getElementById('btnConfigure').click();">Configuration</a> page (note that these buttons
only appear after you tap "Select Storage"). In most modern contexts the archive will be remembered on next launch
(Firefox and IE11 are exceptions).
</p>
<p>
Alternatively, in the UWP app you can simply <b>double-click</b> the ZIM file to launch it in the app, even if the app
is closed (your choice will be remembered on next launch). You can also <b>drag-and-drop</b> your ZIM file into the app,
but it may not be remembered on next launch in all contexts (try it if this method interests you!).
</p> </p>
<h4>Step 4: enjoy your content offline!</h4> <h4>Step 4: enjoy your content offline!</h4>
<h3 id="changelog">Changes in <span class="version">0.9</span></h3> <h3 id="changelog">Changes in <span class="version">0.9</span></h3>

View File

@ -1564,9 +1564,13 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'cache', 'images', 'sett
} else if (protocol === 'file:') { } else if (protocol === 'file:') {
message += "\n\nYou seem to be opening kiwix-js with the file:// protocol. You should open it through a web server : either through a local one (http://localhost/...) or through a remote one (but you need SSL : https://webserver/...)"; message += "\n\nYou seem to be opening kiwix-js with the file:// protocol. You should open it through a web server : either through a local one (http://localhost/...) or through a remote one (but you need SSL : https://webserver/...)";
} else if (protocol === 'ms-appx-web:') { } else if (protocol === 'ms-appx-web:') {
message = 'This UWP app uses locally packaged code by default.\n' + message = 'This UWP app uses locally packaged code by default. ' +
'To enable the Service Worker we need to switch to PWA mode.\n\n' + 'To enable the Service Worker we need to switch to PWA mode, ' +
'WARNING: This will attempt to access the server: ' + params.PWAServer; 'which requires one-time access to our secure server to cache the PWA code.\n\n' +
'The app will be able to run offline in PWA mode, but will auto-update ' +
'periodically when online as per the Service Worker spec.\n\n' +
'You can switch back any time by toggling "Allow Internet access?" off.\n\n' +
'WARNING: This will attempt to access the following server: \n' + params.PWAServer;
goPWA = true; goPWA = true;
} }
if (goPWA) { if (goPWA) {
@ -3680,6 +3684,9 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'cache', 'images', 'sett
}); });
}); });
}); });
// For TED ZIMs, the initial video div height is set incorectly, so we correct it
var videoWrapper = iframe.getElementById('video-wrapper');
if (videoWrapper) videoWrapper.style.height = 'auto';
} }
/** /**
@ -3712,7 +3719,7 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'cache', 'images', 'sett
// Create the new container and menu // Create the new container and menu
var d = doc.createElement('DIV'); var d = doc.createElement('DIV');
d.id = 'kiwixCCMenu'; d.id = 'kiwixCCMenu';
d.setAttribute('style', 'margin-top: 1em; text-align: left;'); d.setAttribute('style', 'margin-top: 1em; text-align: left; position: relative;');
d.innerHTML = 'Please select subtitle language: ' + newKiwixCCMenu; d.innerHTML = 'Please select subtitle language: ' + newKiwixCCMenu;
mediaElement.parentElement.insertBefore(d, mediaElement.nextSibling); mediaElement.parentElement.insertBefore(d, mediaElement.nextSibling);
// Add event listener to extract the text track from the ZIM and insert it into the media element when the user selects it // Add event listener to extract the text track from the ZIM and insert it into the media element when the user selects it