Skip to content

Commit

Permalink
Update test libzim version
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaifroid committed Oct 12, 2023
1 parent d59384f commit c5afd2e
Show file tree
Hide file tree
Showing 7 changed files with 155,114 additions and 52,046 deletions.
35 changes: 3 additions & 32 deletions www/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1655,10 +1655,10 @@ document.getElementById('libraryBtn').addEventListener('click', function (e) {
}
};

if(! isDirEntryExpectedToBeDisplayed(dirEntry)){
if (! isDirEntryExpectedToBeDisplayed(dirEntry)) {
return;
}

// We put the ZIM filename as a prefix in the URL, so that browser caches are separate for each ZIM file
iframeArticleContent.src = '../' + selectedArchive._file.name + '/' + dirEntry.namespace + '/' + encodedUrl;
} else {
Expand All @@ -1673,36 +1673,7 @@ document.getElementById('libraryBtn').addEventListener('click', function (e) {
}
}
}

// var libzimWebWorker = new Worker("a.out.js");

// /**
// * Calls the libzim WebWorker with the given parameters, and returns a Promise with its response
// *
// * @param {Object} parameters
// * @returns {Promise}
// */
// function callLibzimWebWorker(parameters) {
// return new Promise(function (resolve, reject) {
// console.debug("Calling libzim WebWorker with parameters", parameters);
// var tmpMessageChannel = new MessageChannel();
// var t0 = performance.now();
// tmpMessageChannel.port1.onmessage = function (event) {
// var t1 = performance.now();
// var readTime = Math.round(t1 - t0);
// console.debug("Response given by the WebWorker in " + readTime + " ms", event.data);
// resolve(event.data);
// };
// tmpMessageChannel.port1.onerror = function (event) {
// var t1 = performance.now();
// var readTime = Math.round(t1 - t0);
// console.error("Error sent by the WebWorker in " + readTime + " ms", event.data);
// reject(event.data);
// };
// libzimWebWorker.postMessage(parameters, [tmpMessageChannel.port2]);
// });
// }


/**
* Function that handles a message of the messageChannel.
* It tries to read the content in the backend, and sends it back to the ServiceWorker
Expand Down
Loading

0 comments on commit c5afd2e

Please sign in to comment.