mirror of
https://github.com/kiwix/kiwix-js-pwa.git
synced 2025-09-08 19:57:46 -04:00
Imported code cleanup
Former-commit-id: 3ad0ddbc60cc205157f0a1673cc1e1260da49fca [formerly 7d8398d94a0571af04cdcf7edb122b1355817f62] Former-commit-id: 12648c19a38487d8e217dcdfaf48dde6db6559ae
This commit is contained in:
parent
0106c62556
commit
c0d77a1c0f
@ -2433,19 +2433,19 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'utf8', 'images', 'cooki
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether the given URL from given dirEntry equals the expectedArticleURLToBeDisplayed
|
||||
* @param {DirEntry} dirEntry The directory entry of the article to read
|
||||
*/
|
||||
function isDirEntryExpectedToBeDisplayed(dirEntry) {
|
||||
var curArticleURL = dirEntry.namespace + "/" + dirEntry.url;
|
||||
|
||||
if (expectedArticleURLToBeDisplayed !== curArticleURL) {
|
||||
console.debug("url of current article :" + curArticleURL + ", does not match the expected url :" +
|
||||
expectedArticleURLToBeDisplayed);
|
||||
return false;
|
||||
/**
|
||||
* Check whether the given URL from given dirEntry equals the expectedArticleURLToBeDisplayed
|
||||
* @param {DirEntry} dirEntry The directory entry of the article to read
|
||||
* @returns {Boolean} Returns false if the current article does not match the expected article
|
||||
*/
|
||||
function isDirEntryExpectedToBeDisplayed(dirEntry) {
|
||||
var curArticleURL = dirEntry.namespace + "/" + dirEntry.url;
|
||||
if (expectedArticleURLToBeDisplayed !== curArticleURL) {
|
||||
console.debug("url of current article :" + curArticleURL + ", does not match the expected url :" +
|
||||
expectedArticleURLToBeDisplayed);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2581,9 +2581,9 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'utf8', 'images', 'cooki
|
||||
|
||||
};
|
||||
|
||||
if(! isDirEntryExpectedToBeDisplayed(dirEntry)){
|
||||
return;
|
||||
}
|
||||
//if (! isDirEntryExpectedToBeDisplayed(dirEntry)) {
|
||||
// return;
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2737,9 +2737,9 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'utf8', 'images', 'cooki
|
||||
* @param {String} htmlArticle
|
||||
*/
|
||||
function displayArticleInForm(dirEntry, htmlArticle) {
|
||||
if(! isDirEntryExpectedToBeDisplayed(dirEntry)){
|
||||
return;
|
||||
}
|
||||
//if (! isDirEntryExpectedToBeDisplayed(dirEntry)) {
|
||||
// return;
|
||||
//}
|
||||
|
||||
//TESTING
|
||||
console.log("** HTML received **");
|
||||
|
Loading…
x
Reference in New Issue
Block a user