kiwix-js-pwa/www/js/init.js
Jaifroid 3a2b534399 Added experimental support for typesetting equations with MathJax
For now, only mathematical equations are typeset. Chemical equations are not yet detected or supported.


Former-commit-id: 12924d51ad73d0cdc61d7665abe5fdf59f186c05 [formerly 02d0a4875fefdb169002e9b0558818cbee99330c]
Former-commit-id: f38d1b37e38b0d3ab3f8a4827fce2f81021723d9
2017-08-07 07:11:58 +01:00

52 lines
2.1 KiB
JavaScript

/**
* init.js : Configuration for the library require.js
* This file handles the dependencies between javascript libraries
*
* Copyright 2013-2014 Mossroy and contributors
* License GPL v3:
*
* This file is part of Kiwix.
*
* Kiwix is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Kiwix is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Kiwix (file LICENSE-GPLv3.txt). If not, see <http://www.gnu.org/licenses/>
*/
'use strict';
var params = {};
var results = params['results'] || 15; //Number of search results to display
params['cssSource'] = params['cssSource'] || "auto"; //Set default to "auto", "desktop" or "mobile"
params['cssCache'] = params['cssCache'] || true; //Set default to true to use cached CSS, false to use Zim only
params['cssTheme'] = params['cssTheme'] || 'light'; //Set default to 'light' or 'dark' to use respective themes for Wiki articles
params['cssUITheme'] = params['cssUITheme'] || 'light'; //Set default to 'light' or 'dark' to use respective themes for UI
params['imageDisplay'] = params['imageDisplay'] || true; //Set default to display images from Zim
params['useMathJax'] = params['useMathJax'] || true; //Set default to true to display math formulae with MathJax, false to use fallback SVG images
require.config({
baseUrl: 'js/lib',
config: { '../app': { results: results, params: params } },
paths: {
'jquery': 'jquery-3.2.1.slim',
//'bootstrap': 'bootstrap'
'bootstrap': 'bootstrap.min' //GK testing
},
shim: {
'jquery' : {
exports : '$'
},
'bootstrap': {
deps: ['jquery']
}
}
});
requirejs(['bootstrap', '../app']);