summaryrefslogtreecommitdiff
path: root/searx/static/themes/oscar/src/js
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2021-10-01 09:15:46 +0200
committerGitHub <noreply@github.com>2021-10-01 09:15:46 +0200
commit458575c221abcdbe3c0ffb633dd06f5f6d05bf2e (patch)
tree2e50ad12c760db799bf3ed69e5ed13834d3ccfdf /searx/static/themes/oscar/src/js
parentc74f45b1dfbc314db3cb41749111bc33d7243622 (diff)
parent1dfac73a64ba15034a16fc0639618bf85594b98b (diff)
Merge pull request #361 from dalf/searxng-theme-oscar
SearXNG theme oscar
Diffstat (limited to 'searx/static/themes/oscar/src/js')
-rw-r--r--searx/static/themes/oscar/src/js/01_init.js23
-rw-r--r--searx/static/themes/oscar/src/js/autocompleter.js19
-rw-r--r--searx/static/themes/oscar/src/js/element_modifiers.js21
-rw-r--r--searx/static/themes/oscar/src/js/infobox.js7
-rw-r--r--searx/static/themes/oscar/src/js/leaflet_map.js19
-rw-r--r--searx/static/themes/oscar/src/js/preferences.js9
-rw-r--r--searx/static/themes/oscar/src/js/toggleall.js7
7 files changed, 46 insertions, 59 deletions
diff --git a/searx/static/themes/oscar/src/js/01_init.js b/searx/static/themes/oscar/src/js/01_init.js
index e361d87ca..3066caad0 100644
--- a/searx/static/themes/oscar/src/js/01_init.js
+++ b/searx/static/themes/oscar/src/js/01_init.js
@@ -1,20 +1,11 @@
/**
- * searx is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * searx 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with searx. If not, see < http://www.gnu.org/licenses/ >.
- *
- * (C) 2019 by Alexandre Flament
+ * @license
+ * (C) Copyright Contributors to the SearXNG project.
+ * (C) Copyright Contributors to the searx project (2014 - 2021).
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
-window.searx = (function(d) {
+
+window.searxng = (function(d) {
'use strict';
//
@@ -32,3 +23,5 @@ window.searx = (function(d) {
translations: JSON.parse(script.getAttribute('data-translations'))
};
})(document);
+
+window.searx = {};
diff --git a/searx/static/themes/oscar/src/js/autocompleter.js b/searx/static/themes/oscar/src/js/autocompleter.js
index 56293f4f3..97c6d3c4e 100644
--- a/searx/static/themes/oscar/src/js/autocompleter.js
+++ b/searx/static/themes/oscar/src/js/autocompleter.js
@@ -1,23 +1,14 @@
/**
- * searx is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * searx 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with searx. If not, see < http://www.gnu.org/licenses/ >.
- *
+ * @license
+ * (C) Copyright Contributors to the SearXNG project.
+ * (C) Copyright Contributors to the searx project (2014 - 2021).
* (C) 2014 by Thomas Pointhuber, <thomas.pointhuber@gmx.at>
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
$(document).ready(function(){
var original_search_value = '';
- if(searx.autocompleter) {
+ if(searxng.autocompleter) {
var searchResults = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
queryTokenizer: Bloodhound.tokenizers.whitespace,
diff --git a/searx/static/themes/oscar/src/js/element_modifiers.js b/searx/static/themes/oscar/src/js/element_modifiers.js
index 087f7d479..58e87f0f2 100644
--- a/searx/static/themes/oscar/src/js/element_modifiers.js
+++ b/searx/static/themes/oscar/src/js/element_modifiers.js
@@ -1,18 +1,9 @@
/**
- * searx is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * searx 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with searx. If not, see < http://www.gnu.org/licenses/ >.
- *
+ * @license
+ * (C) Copyright Contributors to the SearXNG project.
+ * (C) Copyright Contributors to the searx project (2014 - 2021).
* (C) 2014 by Thomas Pointhuber, <thomas.pointhuber@gmx.at>
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
$(document).ready(function(){
@@ -112,6 +103,6 @@ $(document).ready(function(){
/**
* Layout images according to their sizes
*/
- searx.image_thumbnail_layout = new searx.ImageLayout('#main_results', '#main_results .result-images', 'img.img-thumbnail', 15, 200);
- searx.image_thumbnail_layout.watch();
+ searxng.image_thumbnail_layout = new searx.ImageLayout('#main_results', '#main_results .result-images', 'img.img-thumbnail', 15, 200);
+ searxng.image_thumbnail_layout.watch();
});
diff --git a/searx/static/themes/oscar/src/js/infobox.js b/searx/static/themes/oscar/src/js/infobox.js
index cb7f1eec5..f3d0c04b9 100644
--- a/searx/static/themes/oscar/src/js/infobox.js
+++ b/searx/static/themes/oscar/src/js/infobox.js
@@ -1,3 +1,10 @@
+/**
+ * @license
+ * (C) Copyright Contributors to the SearXNG project.
+ * (C) Copyright Contributors to the searx project (2014 - 2021).
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
window.addEventListener('load', function() {
// Hide infobox toggle if shrunk size already fits all content.
$('.infobox').each(function() {
diff --git a/searx/static/themes/oscar/src/js/leaflet_map.js b/searx/static/themes/oscar/src/js/leaflet_map.js
index 08233c42b..5c9703cc7 100644
--- a/searx/static/themes/oscar/src/js/leaflet_map.js
+++ b/searx/static/themes/oscar/src/js/leaflet_map.js
@@ -1,22 +1,13 @@
/**
- * searx is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * searx 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with searx. If not, see < http://www.gnu.org/licenses/ >.
- *
+ * @license
+ * (C) Copyright Contributors to the SearXNG project.
+ * (C) Copyright Contributors to the searx project (2014 - 2021).
* (C) 2014 by Thomas Pointhuber, <thomas.pointhuber@gmx.at>
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
$(document).ready(function(){
- $(".searx_init_map").on( "click", function( event ) {
+ $(".searxng_init_map").on( "click", function( event ) {
var leaflet_target = $(this).data('leaflet-target');
var map_lon = $(this).data('map-lon');
var map_lat = $(this).data('map-lat');
diff --git a/searx/static/themes/oscar/src/js/preferences.js b/searx/static/themes/oscar/src/js/preferences.js
index 25aac052f..d3a3a7d76 100644
--- a/searx/static/themes/oscar/src/js/preferences.js
+++ b/searx/static/themes/oscar/src/js/preferences.js
@@ -1,3 +1,10 @@
+/**
+ * @license
+ * (C) Copyright Contributors to the SearXNG project.
+ * (C) Copyright Contributors to the searx project (2014 - 2021).
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
$(document).ready(function(){
let engine_descriptions = null;
function load_engine_descriptions() {
@@ -7,7 +14,7 @@ $(document).ready(function(){
for (const [engine_name, description] of Object.entries(data)) {
let elements = $('[data-engine-name="' + engine_name + '"] .description');
for(const element of elements) {
- let source = ' (<i>' + searx.translations['Source'] + ':&nbsp;' + description[1] + '</i>)';
+ let source = ' (<i>' + searxng.translations.Source + ':&nbsp;' + description[1] + '</i>)';
element.innerHTML = description[0] + source;
}
}
diff --git a/searx/static/themes/oscar/src/js/toggleall.js b/searx/static/themes/oscar/src/js/toggleall.js
index b6c484e3e..69acb9d72 100644
--- a/searx/static/themes/oscar/src/js/toggleall.js
+++ b/searx/static/themes/oscar/src/js/toggleall.js
@@ -1,3 +1,10 @@
+/**
+ * @license
+ * (C) Copyright Contributors to the SearXNG project.
+ * (C) Copyright Contributors to the searx project (2014 - 2021).
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
$(document).ready(function(){
$("#allow-all-engines").click(function() {
$(".onoffswitch-checkbox").each(function() { this.checked = false;});