mirror of
https://github.com/kiwix/kiwix-js.git
synced 2025-09-24 04:54:51 -04:00
commit
6fbfb7254c
@ -68,9 +68,9 @@ self.addEventListener('activate', function(event) {
|
||||
require({
|
||||
baseUrl: "./www/js/lib/"
|
||||
},
|
||||
["util", "utf8"],
|
||||
["util"],
|
||||
|
||||
function(util, utf8) {
|
||||
function(util) {
|
||||
|
||||
console.log("ServiceWorker startup");
|
||||
|
||||
|
@ -777,11 +777,11 @@ define(['jquery', 'abstractBackend', 'util', 'cookies','geometry','osabstraction
|
||||
console.log("Reading binary file...");
|
||||
selectedArchive.readBinaryFile(title, function(readableTitleName, content) {
|
||||
messagePort.postMessage({'action': 'giveContent', 'titleName' : titleName, 'content': content});
|
||||
console.log("content sent to ServiceWorker)");
|
||||
console.log("content sent to ServiceWorker");
|
||||
});
|
||||
}
|
||||
}
|
||||
console.log("Fetching tile " + titleName);
|
||||
console.log("Fetching title " + titleName);
|
||||
selectedArchive.getTitleByName(titleName).then(readFile).fail(function() {
|
||||
console.log("could not find title:" + arguments);
|
||||
messagePort.postMessage({'action': 'giveContent', 'titleName' : titleName, 'content': new UInt8Array()});
|
||||
|
@ -338,6 +338,7 @@ define(['normalize_string', 'geometry', 'title', 'util', 'titleIterators', 'q'],
|
||||
* Look for a title by its name, and call the callbackFunction with this Title
|
||||
* If the title is not found, the callbackFunction is called with parameter null
|
||||
* @param {String} titleName
|
||||
* @return {Promise} resolving to the title object or null if not found.
|
||||
*/
|
||||
LocalArchive.prototype.getTitleByName = function(titleName) {
|
||||
var that = this;
|
||||
|
@ -198,8 +198,9 @@ define(['zimfile', 'zimDirEntry', 'util', 'utf8'],
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* Searches a title (article / page) by name.
|
||||
* @param {String} titleName
|
||||
* @return {Promise} resolving to the title object or null if not found.
|
||||
*/
|
||||
ZIMArchive.prototype.getTitleByName = function(titleName) {
|
||||
var that = this;
|
||||
|
Loading…
x
Reference in New Issue
Block a user