mirror of
https://github.com/kiwix/kiwix-js.git
synced 2025-09-23 12:36:21 -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
|
// Evopedia javascript dependencies
|
||||||
var evopediaTitle = require('title');
|
var evopediaTitle = require('title');
|
||||||
var evopediaArchive = require('localArchive');
|
var evopediaArchive = require('archive');
|
||||||
var util = require('util');
|
var util = require('util');
|
||||||
|
|
||||||
|
|
||||||
@ -131,11 +131,7 @@ define(function(require) {
|
|||||||
function setLocalArchiveFromArchiveList() {
|
function setLocalArchiveFromArchiveList() {
|
||||||
var archiveDirectory = $('#archiveList').val();
|
var archiveDirectory = $('#archiveList').val();
|
||||||
localArchive = new evopediaArchive.LocalArchive();
|
localArchive = new evopediaArchive.LocalArchive();
|
||||||
localArchive.readTitleFilesFromStorage(storage, archiveDirectory);
|
localArchive.initializeFromDeviceStorage(storage, archiveDirectory);
|
||||||
localArchive.readDataFilesFromStorage(storage, archiveDirectory, 0);
|
|
||||||
localArchive.readMathFilesFromStorage(storage, archiveDirectory);
|
|
||||||
localArchive.readMetadataFileFromStorage(storage, archiveDirectory);
|
|
||||||
localArchive.readCoordinateFilesFromStorage(storage, archiveDirectory, 0);
|
|
||||||
// The archive is set : go back to home page to start searching
|
// The archive is set : go back to home page to start searching
|
||||||
$("#btnHome").click();
|
$("#btnHome").click();
|
||||||
}
|
}
|
||||||
@ -269,8 +265,8 @@ define(function(require) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
localArchive.readArticle(title, displayArticleInForm);
|
localArchive.readArticle(title, displayArticleInForm);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display the the given HTML article in the web page,
|
* Display the the given HTML article in the web page,
|
||||||
|
@ -4,8 +4,8 @@ require.config({
|
|||||||
'zepto': 'zepto',
|
'zepto': 'zepto',
|
||||||
'jquery': 'jquery-2.0.3',
|
'jquery': 'jquery-2.0.3',
|
||||||
'bootstrap': 'bootstrap',
|
'bootstrap': 'bootstrap',
|
||||||
'title': 'evopedia/title',
|
'title': 'title',
|
||||||
'localArchive': 'evopedia/localArchive'
|
'archive': 'archive'
|
||||||
},
|
},
|
||||||
shim: {
|
shim: {
|
||||||
'zepto' : {
|
'zepto' : {
|
||||||
|
@ -159,7 +159,6 @@ define(function(require) {
|
|||||||
/**
|
/**
|
||||||
* Initialize the localArchive from given archive files
|
* Initialize the localArchive from given archive files
|
||||||
* @param {type} archiveFiles
|
* @param {type} archiveFiles
|
||||||
* @returns {undefined}
|
|
||||||
*/
|
*/
|
||||||
LocalArchive.prototype.initializeFromArchiveFiles = function(archiveFiles) {
|
LocalArchive.prototype.initializeFromArchiveFiles = function(archiveFiles) {
|
||||||
var dataFileRegex = /^wikipedia_(\d\d).dat$/;
|
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
|
* 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: {
|
paths: {
|
||||||
'zepto': 'zepto',
|
'zepto': 'zepto',
|
||||||
'jquery': 'jquery-2.0.3',
|
'jquery': 'jquery-2.0.3',
|
||||||
'title': 'evopedia/title',
|
'title': 'title',
|
||||||
'localArchive': 'evopedia/localArchive'
|
'archive': 'archive'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ define(function(require) {
|
|||||||
|
|
||||||
var $ = require('jquery');
|
var $ = require('jquery');
|
||||||
var evopediaTitle = require('title');
|
var evopediaTitle = require('title');
|
||||||
var evopediaArchive = require('localArchive');
|
var evopediaArchive = require('archive');
|
||||||
|
|
||||||
// Due to security restrictions in the browsers,
|
// Due to security restrictions in the browsers,
|
||||||
// we can not read directly the files and run the unit tests
|
// we can not read directly the files and run the unit tests
|
||||||
|
Loading…
x
Reference in New Issue
Block a user