mirror of
https://github.com/kiwix/kiwix-js-pwa.git
synced 2025-09-09 12:19:46 -04:00
Updates from Kiwix JS
Former-commit-id: c782a998f6cb60785b590d5b65ac77d22b03a126 [formerly 2b27b93e05fe72760e97eae83808c8517de1cd13 [formerly b081098996accb5e5d076d1cc4193142b06830e9]] Former-commit-id: a7e376811f1a71e85a64b746c2a58d608bec988b Former-commit-id: 1b62e0abf09d742a88311aeea1545c0b53c2adea
This commit is contained in:
parent
ffd6317b38
commit
9534cbfcd1
@ -54,8 +54,6 @@ define(rqDefXZ, function(uiUtil) {
|
||||
var xzdec;
|
||||
|
||||
XZ().then(function (instance) {
|
||||
// TEST ERROR CODE: UNCOMMENT TO TEST AND REMOVE BEFORE MERGE
|
||||
// throw params.decompressorAPI.assemblerMachineType + ' broken!';
|
||||
xzdec = instance;
|
||||
}).catch(function (err) {
|
||||
if (params.decompressorAPI.assemblerMachineType === 'ASM') {
|
||||
@ -67,8 +65,6 @@ define(rqDefXZ, function(uiUtil) {
|
||||
XZ = null;
|
||||
require(['xzdec-asm'], function () {
|
||||
XZ().then(function (instance) {
|
||||
// TEST ERROR CODE: UNCOMMENT TO TEST AND REMOVE BEFORE MERGE
|
||||
// throw params.decompressorAPI.assemblerMachineType + ' broken!';
|
||||
xzdec = instance;
|
||||
}).catch(function (err) {
|
||||
uiUtil.reportAssemblerErrorToAPIStatusPanel('XZ', err);
|
||||
|
@ -211,8 +211,8 @@ define(['zimfile', 'zimDirEntry', 'util', 'utf8'],
|
||||
}));
|
||||
// Get the full array of combinations to check number of combinations
|
||||
var fullCombos = util.removeDuplicateStringsInSmallArray(util.allCaseFirstLetters(prefix, 'full'));
|
||||
// Put cap on exponential number of combinations (five words = 3^6 = 243 combinations)
|
||||
search.type = fullCombos.length < 250 ? 'full' : 'basic';
|
||||
// Put cap on exponential number of combinations (five words = 3^5 = 243 combinations)
|
||||
search.type = fullCombos.length < 300 ? 'full' : 'basic';
|
||||
// We have to remove duplicate string combinations because util.allCaseFirstLetters() can return some combinations
|
||||
// where uppercase and lowercase combinations are exactly the same, e.g. where prefix begins with punctuation
|
||||
// or currency signs, for languages without case, or where user-entered case duplicates calculated case
|
||||
@ -288,7 +288,7 @@ define(['zimfile', 'zimDirEntry', 'util', 'utf8'],
|
||||
*
|
||||
* @param {String} prefix The case-sensitive value against which dirEntry titles (or url) will be compared
|
||||
* @param {Object} search The appstate.search object (for comparison, 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 {callbackDirEntryList} 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
|
||||
*/
|
||||
ZIMArchive.prototype.findDirEntriesWithPrefixCaseSensitive = function(prefix, search, callback, startIndex) {
|
||||
|
@ -40,6 +40,9 @@
|
||||
* A global variable to track the assembler machine type and the last used decompressor (for reporting to the API panel)
|
||||
* This is populated in the Emscripten wrappers
|
||||
* @type {Object}
|
||||
* @property {String} assemblerMachineType The assembler machine type supported and/or loaded by this app: 'ASM' or 'WASM'
|
||||
* @property {String} decompressorLastUsed The decompressor that was last used to decode a compressed cluster (currently 'XZ' or 'ZSTD')
|
||||
* @property {String} errorStatus A description of any detected error in loading a decompressor
|
||||
*/
|
||||
params.decompressorAPI = {
|
||||
assemblerMachineType: null,
|
||||
|
@ -102,8 +102,6 @@ define(rqDefZD, function(uiUtil) {
|
||||
};
|
||||
|
||||
ZD().then(function (inst) {
|
||||
// TEST ERROR CODE: UNCOMMENT TO TEST AND REMOVE BEFORE MERGE
|
||||
// throw params.decompressorAPI.assemblerMachineType + ' broken!';
|
||||
instantiateDecoder(inst);
|
||||
}).catch(function (err) {
|
||||
if (params.decompressorAPI.assemblerMachineType === 'ASM') {
|
||||
@ -115,8 +113,6 @@ define(rqDefZD, function(uiUtil) {
|
||||
ZD = null;
|
||||
require(['zstddec-asm'], function () {
|
||||
ZD().then(function (inst) {
|
||||
// TEST ERROR CODE: UNCOMMENT TO TEST AND REMOVE BEFORE MERGE
|
||||
// throw params.decompressorAPI.assemblerMachineType + ' broken!';
|
||||
instantiateDecoder(inst);
|
||||
}).catch(function (err) {
|
||||
uiUtil.reportAssemblerErrorToAPIStatusPanel('ZSTD', err);
|
||||
|
Loading…
x
Reference in New Issue
Block a user