From 671cd9a132932e8c1064e7d4ac48e65d16924010 Mon Sep 17 00:00:00 2001 From: Rishabh Gautam <47270636+Rishabhg71@users.noreply.github.com> Date: Tue, 10 Oct 2023 00:45:17 +0530 Subject: [PATCH] Zim browser integration #1127 (#846) Added in-app support to download/browse Zim files --- i18n/en.jsonp.js | 1 + i18n/es.jsonp.js | 1 + i18n/fr.jsonp.js | 1 + service-worker.js | 1 + www/css/app.css | 4 ++++ www/index.html | 19 ++++++++++----- www/js/app.js | 55 +++++++++++++++++++++++++++++++------------ www/js/init.js | 37 ++++++++++++++++++++++++++++- www/js/lib/uiUtil.js | 29 +++++++++++++++++++---- www/js/lib/zimfile.js | 9 +------ www/library.html | 14 +++++++++++ 11 files changed, 137 insertions(+), 34 deletions(-) create mode 100644 www/library.html diff --git a/i18n/en.jsonp.js b/i18n/en.jsonp.js index 2baba11d4..f4233a670 100644 --- a/i18n/en.jsonp.js +++ b/i18n/en.jsonp.js @@ -18,6 +18,7 @@ document.localeJson = { "configure": "Configure", "configure-title": "Configuration", "configure-about-usage-link": "About (Usage)", + "configure-btn-library": "Browse ZIM Library", "configure-download-instructions": "This application needs a ZIM archive to work.
For full instructions, please see the section", "configure-select-instructions": "Please select or drag and drop a .zim file (or all the .zimaa, .zimab etc in case of a split ZIM file):", "configure-selectordisplay": "Drag and drop a new ZIM file, or", diff --git a/i18n/es.jsonp.js b/i18n/es.jsonp.js index 5bd090314..623981f3e 100644 --- a/i18n/es.jsonp.js +++ b/i18n/es.jsonp.js @@ -18,6 +18,7 @@ document.localeJson = { "configure": "Configurar", "configure-title": "Configuración", "configure-about-usage-link": "Información (Uso)", + "configure-btn-library": "Biblioteca ZIM", "configure-download-instructions": "Esta aplicación necesita un archivo ZIM para funcionar.
Para instrucciones completas, vea la sección", "configure-select-instructions": "Seleccione o arrastre y suelte un archivo .zim (o todos los .zimaa, .zimab etc en caso de un archivo dividido):", "configure-selectordisplay": "Arrastre y suelte un nuevo archivo ZIM, o", diff --git a/i18n/fr.jsonp.js b/i18n/fr.jsonp.js index 0b811fdb5..2d0c0dff3 100644 --- a/i18n/fr.jsonp.js +++ b/i18n/fr.jsonp.js @@ -18,6 +18,7 @@ document.localeJson = { "configure": "Configuration", "configure-title": "Configuration", "configure-about-usage-link": "Informations (Utilisation)", + "configure-btn-library": "Bibliothèque ZIM", "configure-download-instructions": "Cette application a besoin d'un fichier ZIM pour fonctionner.
Pour des instructions complètes, veuillez consulter la section", "configure-select-instructions": "Veuillez sélectionner ou glisser-déposer un fichier .zim (ou tous les .zimaa, .zimab etc. dans le cas d'un fichier ZIM découpé) :", "configure-selectordisplay": "Glisser-déposer un nouveau fichier ZIM, ou", diff --git a/service-worker.js b/service-worker.js index 4b7edb008..7c7fa5de5 100644 --- a/service-worker.js +++ b/service-worker.js @@ -118,6 +118,7 @@ const precacheFiles = [ 'www/img/Icon_External_Link.png', 'www/index.html', 'www/article.html', + 'www/library.html', 'www/main.html', 'www/js/app.js', 'www/js/init.js', diff --git a/www/css/app.css b/www/css/app.css index c705a0f2d..d9d5586ae 100644 --- a/www/css/app.css +++ b/www/css/app.css @@ -100,6 +100,10 @@ input[type="file"] { display: none; } +iframe { + border: 0; +} + .custom-file-upload { border: 2px solid darkgray; display: inline-block; diff --git a/www/index.html b/www/index.html index a5e5b7e19..e1dc67f55 100644 --- a/www/index.html +++ b/www/index.html @@ -440,7 +440,9 @@

Other platforms/versions



- +