summaryrefslogtreecommitdiff
path: root/searx/static/themes/simple/src/js/head/00_init.js
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarIT.de>2021-12-14 08:07:22 +0100
committerGitHub <noreply@github.com>2021-12-14 08:07:22 +0100
commit4f22615259fc4a9fb80b47ad5b4bcd17f994bc68 (patch)
tree15bcc625b749b3434576837414c66e7cab9d31b8 /searx/static/themes/simple/src/js/head/00_init.js
parent5c7167cd5af2c18826595bfff877766dab4b44ca (diff)
parentf287787c44956a6584f78fdd9d6bf423384d1643 (diff)
Merge pull request #538 from return42/eslint
SearXNG JavaScript Style Guide
Diffstat (limited to 'searx/static/themes/simple/src/js/head/00_init.js')
-rw-r--r--searx/static/themes/simple/src/js/head/00_init.js58
1 files changed, 29 insertions, 29 deletions
diff --git a/searx/static/themes/simple/src/js/head/00_init.js b/searx/static/themes/simple/src/js/head/00_init.js
index dab0e368a..073371ce6 100644
--- a/searx/static/themes/simple/src/js/head/00_init.js
+++ b/searx/static/themes/simple/src/js/head/00_init.js
@@ -5,36 +5,36 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/* global DocumentTouch:readonly */
-(function(w, d) {
- 'use strict';
+(function (w, d) {
+ 'use strict';
- // add data- properties
- var script = d.currentScript || (function() {
- var scripts = d.getElementsByTagName('script');
- return scripts[scripts.length - 1];
- })();
+ // add data- properties
+ var script = d.currentScript || (function () {
+ var scripts = d.getElementsByTagName('script');
+ return scripts[scripts.length - 1];
+ })();
- // try to detect touch screen
- w.searxng = {
- touch: (("ontouchstart" in w) || w.DocumentTouch && document instanceof DocumentTouch) || false,
- method: script.getAttribute('data-method'),
- autocompleter: script.getAttribute('data-autocompleter') === 'true',
- search_on_category_select: script.getAttribute('data-search-on-category-select') === 'true',
- infinite_scroll: script.getAttribute('data-infinite-scroll') === 'true',
- hotkeys: script.getAttribute('data-hotkeys') === 'true',
- static_path: script.getAttribute('data-static-path'),
- translations: JSON.parse(script.getAttribute('data-translations')),
- theme : {
- // image that is displayed if load of <img src='...'> failed
- img_load_error: 'img/img_load_error.svg'
- }
- };
-
- // update the css
- var hmtlElement = d.getElementsByTagName("html")[0];
- hmtlElement.classList.remove('no-js');
- hmtlElement.classList.add('js');
- if (w.searxng.touch) {
- hmtlElement.classList.add('touch');
+ // try to detect touch screen
+ w.searxng = {
+ touch: (("ontouchstart" in w) || w.DocumentTouch && document instanceof DocumentTouch) || false,
+ method: script.getAttribute('data-method'),
+ autocompleter: script.getAttribute('data-autocompleter') === 'true',
+ search_on_category_select: script.getAttribute('data-search-on-category-select') === 'true',
+ infinite_scroll: script.getAttribute('data-infinite-scroll') === 'true',
+ hotkeys: script.getAttribute('data-hotkeys') === 'true',
+ static_path: script.getAttribute('data-static-path'),
+ translations: JSON.parse(script.getAttribute('data-translations')),
+ theme: {
+ // image that is displayed if load of <img src='...'> failed
+ img_load_error: 'img/img_load_error.svg'
}
+ };
+
+ // update the css
+ var hmtlElement = d.getElementsByTagName("html")[0];
+ hmtlElement.classList.remove('no-js');
+ hmtlElement.classList.add('js');
+ if (w.searxng.touch) {
+ hmtlElement.classList.add('touch');
+ }
})(window, document); \ No newline at end of file