mirror of
https://github.com/kiwix/kiwix-js.git
synced 2025-09-23 04:28:30 -04:00
Move/rename javascript files to ease the introduction of web workers
Upgrade jQuery library, and use its development version to ease debugging
This commit is contained in:
parent
bd6059043f
commit
8273226aec
12
js/app.js
12
js/app.js
@ -8,7 +8,7 @@ define(function(require) {
|
||||
|
||||
// Evopedia javascript dependencies
|
||||
var evopediaTitle = require('title');
|
||||
var evopediaArchive = require('localArchive');
|
||||
var evopediaArchive = require('archive');
|
||||
var util = require('util');
|
||||
|
||||
|
||||
@ -131,11 +131,7 @@ define(function(require) {
|
||||
function setLocalArchiveFromArchiveList() {
|
||||
var archiveDirectory = $('#archiveList').val();
|
||||
localArchive = new evopediaArchive.LocalArchive();
|
||||
localArchive.readTitleFilesFromStorage(storage, archiveDirectory);
|
||||
localArchive.readDataFilesFromStorage(storage, archiveDirectory, 0);
|
||||
localArchive.readMathFilesFromStorage(storage, archiveDirectory);
|
||||
localArchive.readMetadataFileFromStorage(storage, archiveDirectory);
|
||||
localArchive.readCoordinateFilesFromStorage(storage, archiveDirectory, 0);
|
||||
localArchive.initializeFromDeviceStorage(storage, archiveDirectory);
|
||||
// The archive is set : go back to home page to start searching
|
||||
$("#btnHome").click();
|
||||
}
|
||||
@ -269,8 +265,8 @@ define(function(require) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
localArchive.readArticle(title, displayArticleInForm);
|
||||
}
|
||||
localArchive.readArticle(title, displayArticleInForm);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the the given HTML article in the web page,
|
||||
|
@ -4,8 +4,8 @@ require.config({
|
||||
'zepto': 'zepto',
|
||||
'jquery': 'jquery-2.0.3',
|
||||
'bootstrap': 'bootstrap',
|
||||
'title': 'evopedia/title',
|
||||
'localArchive': 'evopedia/localArchive'
|
||||
'title': 'title',
|
||||
'archive': 'archive'
|
||||
},
|
||||
shim: {
|
||||
'zepto' : {
|
||||
|
@ -159,7 +159,6 @@ define(function(require) {
|
||||
/**
|
||||
* Initialize the localArchive from given archive files
|
||||
* @param {type} archiveFiles
|
||||
* @returns {undefined}
|
||||
*/
|
||||
LocalArchive.prototype.initializeFromArchiveFiles = function(archiveFiles) {
|
||||
var dataFileRegex = /^wikipedia_(\d\d).dat$/;
|
||||
@ -202,6 +201,19 @@ define(function(require) {
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Initialize the localArchive from given directory, using DeviceStorage
|
||||
* @param {type} storage
|
||||
* @param {type} archiveDirectory
|
||||
*/
|
||||
LocalArchive.prototype.initializeFromDeviceStorage = function(storage, archiveDirectory) {
|
||||
this.readTitleFilesFromStorage(storage, archiveDirectory);
|
||||
this.readDataFilesFromStorage(storage, archiveDirectory, 0);
|
||||
this.readMathFilesFromStorage(storage, archiveDirectory);
|
||||
this.readMetadataFileFromStorage(storage, archiveDirectory);
|
||||
this.readCoordinateFilesFromStorage(storage, archiveDirectory, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* Read the math files (math.idx and math.dat) in the given directory, and assign it to the
|
2087
js/lib/require.js
2087
js/lib/require.js
File diff suppressed because it is too large
Load Diff
@ -3,8 +3,8 @@ require.config({
|
||||
paths: {
|
||||
'zepto': 'zepto',
|
||||
'jquery': 'jquery-2.0.3',
|
||||
'title': 'evopedia/title',
|
||||
'localArchive': 'evopedia/localArchive'
|
||||
'title': 'title',
|
||||
'archive': 'archive'
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -2,7 +2,7 @@ define(function(require) {
|
||||
|
||||
var $ = require('jquery');
|
||||
var evopediaTitle = require('title');
|
||||
var evopediaArchive = require('localArchive');
|
||||
var evopediaArchive = require('archive');
|
||||
|
||||
// Due to security restrictions in the browsers,
|
||||
// we can not read directly the files and run the unit tests
|
||||
|
Loading…
x
Reference in New Issue
Block a user