diff --git a/www/js/app.js b/www/js/app.js index 3642e445..2221f954 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -223,8 +223,6 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'utf8', 'images', 'cooki document.getElementById('prefix').addEventListener('blur', function () { if (!searchArticlesFocused) { global.search.state = 'cancelled'; - $("#searchingArticles").hide(); - $('#articleListWithHeader').hide(); } // We need to wait one tick for the activeElement to receive focus setTimeout(function () { @@ -2220,7 +2218,7 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'utf8', 'images', 'cooki if (global.selectedArchive !== null && global.selectedArchive.isReady()) { // Cancel any previous search that may still be running before creating new search global.search.state = 'cancelled'; - // Store the new search term in the state.search global object and initialize + // Store the new search term in the global.search object and initialize global.search = {'prefix': prefix, 'state': 'init', 'type': ''}; $('#activeContent').hide(); if (!prefix || /^\s/.test(prefix)) { @@ -2570,7 +2568,7 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'utf8', 'images', 'cooki cookies.removeItem('lastPageLoad'); // if (!~decodeURIComponent(params.lastPageVisit).indexOf(dirEntry.url)) { // params.lastPageVisit = encodeURIComponent(dirEntry.namespace + "/" + dirEntry.url) + - // "@kiwixKey@" + state.selectedArchive._file._files[0].name; + // "@kiwixKey@" + global.selectedArchive._file._files[0].name; // if (params.rememberLastPage) { // cookies.setItem('lastPageVisit', params.lastPageVisit, Infinity); // } diff --git a/www/js/lib/images.js b/www/js/lib/images.js index 5b690a03..99328c24 100644 --- a/www/js/lib/images.js +++ b/www/js/lib/images.js @@ -84,8 +84,8 @@ define(['uiUtil'], function (uiUtil) { }); return; } - state.selectedArchive.getDirEntryByTitle(title).then(function (dirEntry) { - return state.selectedArchive.readBinaryFile(dirEntry, function (fileDirEntry, content) { + global.selectedArchive.getDirEntryByTitle(title).then(function (dirEntry) { + return global.selectedArchive.readBinaryFile(dirEntry, function (fileDirEntry, content) { image.style.background = ''; var mimetype = dirEntry.getMimetype(); uiUtil.feedNodeWithBlob(image, 'src', content, mimetype, params.allowHTMLExtraction, function () { diff --git a/www/js/lib/zimArchive.js b/www/js/lib/zimArchive.js index 23fd0186..87b5d1fc 100644 --- a/www/js/lib/zimArchive.js +++ b/www/js/lib/zimArchive.js @@ -148,7 +148,7 @@ define(['zimfile', 'zimDirEntry', 'util', 'utf8'], * This should be enhanced when the ZIM format will be modified to store normalized titles * See https://phabricator.wikimedia.org/T108536 * - * @param {Object} search The current state.search object + * @param {Object} search The current global.search object * @param {Integer} resultSize The number of dirEntries to find * @param {callbackDirEntryList} callback The function to call with the result * @param {Boolean} noInterim A flag to prevent callback until all results are ready (used in testing) @@ -216,7 +216,7 @@ define(['zimfile', 'zimDirEntry', 'util', 'utf8'], * * @param {String} prefix The case-sensitive value against which dirEntry titles (or url) will be compared * @param {Integer} resultSize The maximum number of results to return - * @param {Object} search The original state.search object (so that we can cancel long binary searches) + * @param {Object} search The original global.search object (so that we can cancel long binary searches) * @param {Function} callback The function to call with the array of dirEntries with titles that begin with prefix * @param {Integer} startIndex The index number with which to commence the search, or null */