summaryrefslogtreecommitdiff
path: root/searx/static/themes/simple/js/searx_src/searx_results.js
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2021-06-16 09:28:45 +0200
committerAlexandre Flament <alex@al-f.net>2021-06-16 12:38:06 +0200
commit6b80c57a3c04d6be37ae3c880f7e269fc362b107 (patch)
treeec3009353dfd713f9d91cf074b10f5d7a6bdcd5a /searx/static/themes/simple/js/searx_src/searx_results.js
parent49ea5b764454b4cd00eef67898b1c73ce3c28f31 (diff)
[mod] simple theme: move source files to the src directory
Diffstat (limited to 'searx/static/themes/simple/js/searx_src/searx_results.js')
-rw-r--r--searx/static/themes/simple/js/searx_src/searx_results.js63
1 files changed, 0 insertions, 63 deletions
diff --git a/searx/static/themes/simple/js/searx_src/searx_results.js b/searx/static/themes/simple/js/searx_src/searx_results.js
deleted file mode 100644
index fe00efc90..000000000
--- a/searx/static/themes/simple/js/searx_src/searx_results.js
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
-* 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) 2017 by Alexandre Flament, <alex@al-f.net>
-*/
-(function(w, d, searx) {
- 'use strict';
-
- searx.ready(function() {
- searx.image_thumbnail_layout = new searx.ImageLayout('#urls', '#urls .result-images', 'img.image_thumbnail', 10, 200);
- searx.image_thumbnail_layout.watch();
-
- searx.on('.btn-collapse', 'click', function(event) {
- var btnLabelCollapsed = this.getAttribute('data-btn-text-collapsed');
- var btnLabelNotCollapsed = this.getAttribute('data-btn-text-not-collapsed');
- var target = this.getAttribute('data-target');
- var targetElement = d.querySelector(target);
- var html = this.innerHTML;
- if (this.classList.contains('collapsed')) {
- html = html.replace(btnLabelCollapsed, btnLabelNotCollapsed);
- } else {
- html = html.replace(btnLabelNotCollapsed, btnLabelCollapsed);
- }
- this.innerHTML = html;
- this.classList.toggle('collapsed');
- targetElement.classList.toggle('invisible');
- });
-
- searx.on('.media-loader', 'click', function(event) {
- var target = this.getAttribute('data-target');
- var iframe_load = d.querySelector(target + ' > iframe');
- var srctest = iframe_load.getAttribute('src');
- if (srctest === null || srctest === undefined || srctest === false) {
- iframe_load.setAttribute('src', iframe_load.getAttribute('data-src'));
- }
- });
-
- w.addEventListener('scroll', function() {
- var e = d.getElementById('backToTop'),
- scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
- if (e !== null) {
- if (scrollTop >= 200) {
- e.style.opacity = 1;
- } else {
- e.style.opacity = 0;
- }
- }
- });
-
- });
-
-})(window, document, window.searx);