diff --git a/www/js/app.js b/www/js/app.js
index c1408888..22d23c16 100644
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -1337,8 +1337,8 @@ archiveFilesLegacy.addEventListener('change', function (files) {
'Add to OPFS', true, null, 'Add to OPFS').then(function (confirmed) {
if (!confirmed) return;
// User has chosen a file or files to store in the Origin Private File System
- // This operation can take a long time, so show the spinner
- uiUtil.pollSpinner('Please wait
Importing files to OPFS...', true);
+ // This operation can take a long time, so show opsPanel
+ uiUtil.pollOpsPanel('Please wait: Importing files to OPFS...', true);
return cache.importOPFSEntries(filesArray).then(function () {
uiUtil.systemAlert('
The selected files were successfully added to the OPFS!
We will now reload the app, so that the file(s) can be accessed at full speed.
') .then(function () { @@ -1346,7 +1346,7 @@ archiveFilesLegacy.addEventListener('change', function (files) { settingsStore.setItem('lastSelectedArchive', filesArray[0].name, Infinity); window.location.reload(); }); - uiUtil.clearSpinner(); + uiUtil.pollOpsPanel(); processNativeDirHandle(params.pickedFolder); cache.populateOPFSStorageQuota(); }).catch(function (err) { @@ -1354,7 +1354,7 @@ archiveFilesLegacy.addEventListener('change', function (files) { var message = 'We could not import the selected files to the OPFS!
Reason: ' + err.message + '
'; if (/iOS/.test(params.appType)) message = 'Unfortunately, iOS does not currently support importing files into the OPFS. Please disable the OPFS and use other file selection options.
Error message: ' + err.message + '
'; uiUtil.systemAlert(message, 'OPFS import error'); - uiUtil.clearSpinner(); + uiUtil.pollOpsPanel(); }); }); } diff --git a/www/js/lib/cache.js b/www/js/lib/cache.js index ba620da1..a832507a 100644 --- a/www/js/lib/cache.js +++ b/www/js/lib/cache.js @@ -795,9 +795,9 @@ function importOPFSEntries (files) { return Promise.all(files.map(function (file) { return params.pickedFolder.getFileHandle(file.name, { create: true }).then(function (fileHandle) { return fileHandle.createWritable().then(function (writer) { - uiUtil.pollSpinner('Please waitThe archive ' + archiveName + ' has been downloaded to your device.
' + (params.useOPFS ? 'Reloading to activate new ZIM...
' : ''), 'Download complete').then(function () { if (params.useOPFS) { @@ -634,21 +634,14 @@ function requestXhttpData (URL, lang, subj, kiwixDate) { }); } if (megabytes > 1000) { - if (params.useOPFS) { - uiUtil.systemAlert('Do you wish to download the large archive ' + archiveName + ' (' + megabytes$ + ' MB) directly into the Origin Private File System?
' + - 'If you proceed, do not close the app during the download.
' + - '
If you prefer to download in the background, use a browser-managed download link instead, and afterwards import the file into the OPFS using the "Add file(s)" button.
', - 'Download large archive to OPFS?', true).then(function (result) { - if (result) downloadArchiveWithFSA(); - }); - } else { - uiUtil.systemAlert('Do you wish to download the large archive ' + archiveName + ' (' + megabytes$ + ' MB) to the current ZIM folder?
' + - 'If you proceed, do not close the app during the download.
' + - 'If you prefer to download in the background, use a browser-managed download link instead, and then move the file manually into your ZIM folder.
', - 'Download large archive to folder?', true).then(function (result) { - if (result) downloadArchiveWithFSA(); - }); - } + var message = 'Do you wish to download the following large archive ' + (params.useOPFS ? 'directly into the Origin Private File System' : 'to the current ZIM folder') + + '?
If you proceed, do not close the app during the download.
' + + '
If you prefer to download in the background, use a browser-managed download link instead, and ' + (params.useOPFS + ? 'afterwards import the file into the OPFS using the "Add file(s)" button' : 'then move the file manually into your ZIM folder') + '.
'; + var messageTitle = 'Download large archive to ' + (params.useOPFS ? 'OPFS?' : 'folder?'); + uiUtil.systemAlert(message, messageTitle, true, 'Cancel', 'Download').then(function (result) { + if (result) downloadArchiveWithFSA(); + }); } else { downloadArchiveWithFSA(); } @@ -1057,19 +1050,19 @@ function reportDownloadProgress (data) { } else { var dataMB = (data / 1024 / 1024).toFixed(2); // console.debug('dataMB: ' + dataMB + '; data: ' + data); - if (downloadSize > 0) { - var percentageData = Math.floor(dataMB / downloadSize * 100); - if (percentageData > percentageComplete) { - percentageComplete = percentageData; - uiUtil.pollSpinner('Please wait