aboutsummaryrefslogtreecommitdiff
path: root/web/load.js
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-11-10 12:08:25 +0500
committerAbyss777 <abyss@fox5.ru>2016-11-10 12:08:25 +0500
commit185a6e4b3518ea7cebac33430751507b1bb94994 (patch)
tree808c8c1c454a5e21eff261d448d700a1d5cb2afe /web/load.js
parent26ecb43bc27087ae1f7aac8a8b0ffa8421b846d9 (diff)
downloadetbsa-traccar-web-185a6e4b3518ea7cebac33430751507b1bb94994.tar.gz
etbsa-traccar-web-185a6e4b3518ea7cebac33430751507b1bb94994.tar.bz2
etbsa-traccar-web-185a6e4b3518ea7cebac33430751507b1bb94994.zip
- Implement category selector for DeviceDialog
- Fix jscs and jshint issues
Diffstat (limited to 'web/load.js')
-rw-r--r--web/load.js30
1 files changed, 15 insertions, 15 deletions
diff --git a/web/load.js b/web/load.js
index 6257fe0..0d13b2c 100644
--- a/web/load.js
+++ b/web/load.js
@@ -1,33 +1,34 @@
(function () {
+ var debugMode, touchMode, locale, localeParameter, extjsVersion, fontAwesomeVersion, olVersion;
function addStyleFile(file) {
var link = document.createElement('link');
link.setAttribute('rel', 'stylesheet');
link.setAttribute('type', 'text/css');
link.setAttribute('href', file);
- document.head.appendChild(link)
+ document.head.appendChild(link);
}
function addScriptFile(file) {
var script = document.createElement('script');
script.setAttribute('src', file);
- script.async = false
+ script.async = false;
document.head.appendChild(script);
}
-
+
function addSvgFile(file, id) {
var svg = document.createElement('object');
svg.setAttribute('id', id);
svg.setAttribute('data', file);
svg.setAttribute('type', 'image/svg+xml');
- svg.setAttribute('style','visibility:hidden')
+ svg.setAttribute('style', 'visibility:hidden');
document.body.appendChild(svg);
}
- var debugMode = document.getElementById('loadScript').getAttribute('mode') === 'debug';
- var touchMode = 'ontouchstart' in window || navigator.maxTouchPoints;
+ debugMode = document.getElementById('loadScript').getAttribute('mode') === 'debug';
+ touchMode = 'ontouchstart' in window || navigator.maxTouchPoints;
- var locale = {};
+ locale = {};
window.Locale = locale;
locale.languages = {
@@ -74,7 +75,7 @@
'zh': { name: '中文', code: 'zh_CN' }
};
- var localeParameter = window.location.search.match(/locale=([^&#]+)/);
+ localeParameter = window.location.search.match(/locale=([^&#]+)/);
locale.language = localeParameter && localeParameter[1];
if (locale.language === undefined) {
locale.language = window.navigator.userLanguage || window.navigator.language;
@@ -85,7 +86,7 @@
locale.language = 'en'; // default
}
- window.addEventListener("load", function (event) {
+ window.addEventListener('load', function (event) {
if (debugMode) {
Ext.Loader.setConfig({
@@ -108,9 +109,9 @@
});
- var extjsVersion = '6.0.1';
- var fontAwesomeVersion = '4.6.3';
- var olVersion = '3.18.2';
+ extjsVersion = '6.0.1';
+ fontAwesomeVersion = '4.6.3';
+ olVersion = '3.18.2';
if (debugMode) {
addScriptFile('//cdnjs.cloudflare.com/ajax/libs/extjs/' + extjsVersion + '/ext-all-debug.js');
@@ -128,10 +129,9 @@
addScriptFile('//cdnjs.cloudflare.com/ajax/libs/ol3/' + olVersion + '/ol-debug.js');
addStyleFile('app.css');
- //addScriptFile('arrow.js');
-
+
addSvgFile('images/default.svg', 'defaultSvg');
- addSvgFile('images/route.svg', 'routeSvg');
+ addSvgFile('images/arrow.svg', 'arrowSvg');
addSvgFile('images/car.svg', 'carSvg');
addSvgFile('images/bus.svg', 'busSvg');
addSvgFile('images/truck.svg', 'truckSvg');