Browse Source

Merge pull request #371 from dalf/searxng-theme-simple

Searxng theme simple
Alexandre Flament 3 years ago
parent
commit
8bd7358c06
42 changed files with 191 additions and 316 deletions
  1. 1 1
      searx/static/themes/__common__/js/image_layout.js
  2. 0 0
      searx/static/themes/oscar/css/logicodev-dark.min.css.map
  3. 0 0
      searx/static/themes/oscar/css/logicodev.min.css.map
  4. 2 4
      searx/static/themes/oscar/js/searxng.js
  5. 3 3
      searx/static/themes/oscar/js/searxng.min.js
  6. 0 0
      searx/static/themes/oscar/js/searxng.min.js.map
  7. 0 2
      searx/static/themes/oscar/src/js/01_init.js
  8. 1 1
      searx/static/themes/oscar/src/js/element_modifiers.js
  9. 0 1
      searx/static/themes/simple/.jshintignore
  10. 4 4
      searx/static/themes/simple/css/searxng-rtl.css
  11. 0 0
      searx/static/themes/simple/css/searxng-rtl.min.css
  12. 0 0
      searx/static/themes/simple/css/searxng-rtl.min.css.map
  13. 4 4
      searx/static/themes/simple/css/searxng.css
  14. 0 0
      searx/static/themes/simple/css/searxng.min.css
  15. 0 0
      searx/static/themes/simple/css/searxng.min.css.map
  16. 8 8
      searx/static/themes/simple/gruntfile.js
  17. 0 2
      searx/static/themes/simple/js/searx.head.min.js
  18. 0 1
      searx/static/themes/simple/js/searx.head.min.js.map
  19. 0 0
      searx/static/themes/simple/js/searx.min.js
  20. 0 0
      searx/static/themes/simple/js/searx.min.js.map
  21. 7 18
      searx/static/themes/simple/js/searxng.head.js
  22. 8 0
      searx/static/themes/simple/js/searxng.head.min.js
  23. 1 0
      searx/static/themes/simple/js/searxng.head.min.js.map
  24. 60 115
      searx/static/themes/simple/js/searxng.js
  25. 6 0
      searx/static/themes/simple/js/searxng.min.js
  26. 0 0
      searx/static/themes/simple/js/searxng.min.js.map
  27. 7 18
      searx/static/themes/simple/src/js/head/00_init.js
  28. 18 29
      searx/static/themes/simple/src/js/main/00_searx_toolkit.js
  29. 6 5
      searx/static/themes/simple/src/js/main/searx_keyboard.js
  30. 8 24
      searx/static/themes/simple/src/js/main/searx_mapresult.js
  31. 7 6
      searx/static/themes/simple/src/js/main/searx_preferences.js
  32. 8 23
      searx/static/themes/simple/src/js/main/searx_results.js
  33. 12 27
      searx/static/themes/simple/src/js/main/searx_search.js
  34. 1 1
      searx/static/themes/simple/src/less/definitions.less
  35. 1 1
      searx/static/themes/simple/src/less/mixins.less
  36. 1 1
      searx/static/themes/simple/src/less/search.less
  37. 1 1
      searx/static/themes/simple/src/less/style.less
  38. 7 7
      searx/templates/simple/base.html
  39. 1 1
      searx/templates/simple/messages/no_results.html
  40. 6 6
      searx/templates/simple/preferences.html
  41. 1 1
      searx/templates/simple/result_templates/map.html
  42. 1 1
      searx/templates/simple/stats.html

+ 1 - 1
searx/static/themes/__common__/js/image_layout.js

@@ -158,6 +158,6 @@
     }
   };
 
-  w.searx.ImageLayout = ImageLayout;
+  w.searxng.ImageLayout = ImageLayout;
 
 }(window, document));

File diff suppressed because it is too large
+ 0 - 0
searx/static/themes/oscar/css/logicodev-dark.min.css.map


File diff suppressed because it is too large
+ 0 - 0
searx/static/themes/oscar/css/logicodev.min.css.map


+ 2 - 4
searx/static/themes/oscar/js/searxng.js

@@ -23,8 +23,6 @@ window.searxng = (function(d) {
         translations: JSON.parse(script.getAttribute('data-translations'))
     };
 })(document);
-
-window.searx = {};
 ;/**
  * @license
  * (C) Copyright Contributors to the SearXNG project.
@@ -181,7 +179,7 @@ $(document).ready(function(){
     /**
      * Layout images according to their sizes
      */
-    searxng.image_thumbnail_layout = new searx.ImageLayout('#main_results', '#main_results .result-images', 'img.img-thumbnail', 15, 200);
+    searxng.image_thumbnail_layout = new searxng.ImageLayout('#main_results', '#main_results .result-images', 'img.img-thumbnail', 15, 200);
     searxng.image_thumbnail_layout.watch();
 });
 ;/**
@@ -479,6 +477,6 @@ $(document).ready(function(){
     }
   };
 
-  w.searx.ImageLayout = ImageLayout;
+  w.searxng.ImageLayout = ImageLayout;
 
 }(window, document));

+ 3 - 3
searx/static/themes/oscar/js/searxng.min.js

@@ -4,7 +4,7 @@
  * (C) Copyright Contributors to the searx project (2014 - 2021).
  * SPDX-License-Identifier: AGPL-3.0-or-later
  */
-window.searxng=function(t){"use strict";t.getElementsByTagName("html")[0].className="js";var e,e=t.currentScript||(e=t.getElementsByTagName("script"))[e.length-1];return{autocompleter:"true"===e.getAttribute("data-autocompleter"),method:e.getAttribute("data-method"),translations:JSON.parse(e.getAttribute("data-translations"))}}(document),window.searx={},
+window.searxng=function(t){"use strict";t.getElementsByTagName("html")[0].className="js";var e,e=t.currentScript||(e=t.getElementsByTagName("script"))[e.length-1];return{autocompleter:"true"===e.getAttribute("data-autocompleter"),method:e.getAttribute("data-method"),translations:JSON.parse(e.getAttribute("data-translations"))}}(document),
 /**
  * @license
  * (C) Copyright Contributors to the SearXNG project.
@@ -20,7 +20,7 @@ $(document).ready(function(){var t,a="";searxng.autocompleter&&((t=new Bloodhoun
  * (C) 2014 by Thomas Pointhuber, <thomas.pointhuber@gmx.at>
  * SPDX-License-Identifier: AGPL-3.0-or-later
  */
-$(document).ready(function(){$("#q.autofocus").focus(),$("#clear_search").click(function(){document.getElementById("q").value=""}),$(".select-all-on-click").click(function(){$(this).select()}),$(".btn-collapse").click(function(){var t=$(this).data("btn-text-collapsed"),e=$(this).data("btn-text-not-collapsed");""!==t&&""!==e&&(new_html=$(this).hasClass("collapsed")?$(this).html().replace(t,e):$(this).html().replace(e,t),$(this).html(new_html))}),$(".btn-toggle .btn").click(function(){var t="btn-"+$(this).data("btn-class"),e=$(this).data("btn-label-default"),a=$(this).data("btn-label-toggled");""!==a&&(new_html=$(this).hasClass("btn-default")?$(this).html().replace(e,a):$(this).html().replace(a,e),$(this).html(new_html)),$(this).toggleClass(t),$(this).toggleClass("btn-default")}),$(".media-loader").click(function(){var t=$(this).data("target"),e=$(t+" > iframe"),t=e.attr("src");void 0!==t&&!1!==t||e.attr("src",e.data("src"))}),$(".btn-sm").dblclick(function(){var t="btn-"+$(this).data("btn-class");$(this).hasClass("btn-default")?($(".btn-sm > input").attr("checked","checked"),$(".btn-sm > input").prop("checked",!0),$(".btn-sm").addClass(t),$(".btn-sm").addClass("active"),$(".btn-sm").removeClass("btn-default")):($(".btn-sm > input").attr("checked",""),$(".btn-sm > input").removeAttr("checked"),$(".btn-sm > input").checked=!1,$(".btn-sm").removeClass(t),$(".btn-sm").removeClass("active"),$(".btn-sm").addClass("btn-default"))}),$(".nav-tabs").click(function(t){$(t.target).parents("ul").children().attr("aria-selected","false"),$(t.target).parent().attr("aria-selected","true")}),searxng.image_thumbnail_layout=new searx.ImageLayout("#main_results","#main_results .result-images","img.img-thumbnail",15,200),searxng.image_thumbnail_layout.watch()}),
+$(document).ready(function(){$("#q.autofocus").focus(),$("#clear_search").click(function(){document.getElementById("q").value=""}),$(".select-all-on-click").click(function(){$(this).select()}),$(".btn-collapse").click(function(){var t=$(this).data("btn-text-collapsed"),e=$(this).data("btn-text-not-collapsed");""!==t&&""!==e&&(new_html=$(this).hasClass("collapsed")?$(this).html().replace(t,e):$(this).html().replace(e,t),$(this).html(new_html))}),$(".btn-toggle .btn").click(function(){var t="btn-"+$(this).data("btn-class"),e=$(this).data("btn-label-default"),a=$(this).data("btn-label-toggled");""!==a&&(new_html=$(this).hasClass("btn-default")?$(this).html().replace(e,a):$(this).html().replace(a,e),$(this).html(new_html)),$(this).toggleClass(t),$(this).toggleClass("btn-default")}),$(".media-loader").click(function(){var t=$(this).data("target"),e=$(t+" > iframe"),t=e.attr("src");void 0!==t&&!1!==t||e.attr("src",e.data("src"))}),$(".btn-sm").dblclick(function(){var t="btn-"+$(this).data("btn-class");$(this).hasClass("btn-default")?($(".btn-sm > input").attr("checked","checked"),$(".btn-sm > input").prop("checked",!0),$(".btn-sm").addClass(t),$(".btn-sm").addClass("active"),$(".btn-sm").removeClass("btn-default")):($(".btn-sm > input").attr("checked",""),$(".btn-sm > input").removeAttr("checked"),$(".btn-sm > input").checked=!1,$(".btn-sm").removeClass(t),$(".btn-sm").removeClass("active"),$(".btn-sm").addClass("btn-default"))}),$(".nav-tabs").click(function(t){$(t.target).parents("ul").children().attr("aria-selected","false"),$(t.target).parent().attr("aria-selected","true")}),searxng.image_thumbnail_layout=new searxng.ImageLayout("#main_results","#main_results .result-images","img.img-thumbnail",15,200),searxng.image_thumbnail_layout.watch()}),
 /**
  * @license
  * (C) Copyright Contributors to the SearXNG project.
@@ -61,5 +61,5 @@ $(document).ready(function(){$("#allow-all-engines").click(function(){$(".onoffs
 * @license Free to use under the MIT License.
 *
 */
-function(o,c){function t(t,e,a,n,i){this.container_selector=t,this.results_selector=e,this.img_selector=a,this.margin=n,this.maxHeight=i,this.isAlignDone=!0}t.prototype._getHeigth=function(t,e){for(var a,n=0,i=0;i<t.length;i++)0<(a=t[i]).naturalWidth&&0<a.naturalHeight?n+=a.naturalWidth/a.naturalHeight:n+=1;return(e-t.length*this.margin)/n},t.prototype._setSize=function(t,e){for(var a,n,i=t.length,s=0;s<i;s++)a=0<(n=t[s]).naturalWidth&&0<n.naturalHeight?e*n.naturalWidth/n.naturalHeight:e,n.style.width=a+"px",n.style.height=e+"px",n.style.marginLeft="3px",n.style.marginTop="3px",n.style.marginRight=this.margin-7+"px",n.style.marginBottom=this.margin-7+"px",(n=n.parentNode.parentNode).classList.contains("js")||n.classList.add("js")},t.prototype._alignImgs=function(t){for(var e,a,n,i,s=c.querySelector(this.container_selector),o=window.getComputedStyle(s),r=parseInt(o.getPropertyValue("padding-left"),10),o=parseInt(o.getPropertyValue("padding-right"),10),l=s.clientWidth-r-o;0<t.length;){for(e=!0,n=1;n<=t.length&&e;n++)a=t.slice(0,n),(i=this._getHeigth(a,l))<this.maxHeight&&(this._setSize(a,i),t=t.slice(n),e=!1);if(e){this._setSize(a,Math.min(this.maxHeight,i));break}}},t.prototype.align=function(){for(var t=c.querySelectorAll(this.results_selector),e=t.length,a=null,n=null,i=[],s=0;s<e;s++)(n=t[s]).previousElementSibling!==a&&0<i.length&&(this._alignImgs(i),i=[]),i.push(n.querySelector(this.img_selector)),a=n;0<i.length&&this._alignImgs(i)},t.prototype.watch=function(){var t,e,a=this,n=c.querySelectorAll(this.results_selector),i=n.length;function s(){a.isAlignDone&&(a.isAlignDone=!1,setTimeout(function(){a.align(),a.isAlignDone=!0},100))}for(o.addEventListener("pageshow",s),o.addEventListener("load",s),o.addEventListener("resize",s),t=0;t<i;t++)null!=(e=n[t].querySelector(this.img_selector))&&(e.addEventListener("load",s),e.addEventListener("error",s))},o.searx.ImageLayout=t}(window,document);
+function(o,c){function t(t,e,a,n,i){this.container_selector=t,this.results_selector=e,this.img_selector=a,this.margin=n,this.maxHeight=i,this.isAlignDone=!0}t.prototype._getHeigth=function(t,e){for(var a,n=0,i=0;i<t.length;i++)0<(a=t[i]).naturalWidth&&0<a.naturalHeight?n+=a.naturalWidth/a.naturalHeight:n+=1;return(e-t.length*this.margin)/n},t.prototype._setSize=function(t,e){for(var a,n,i=t.length,s=0;s<i;s++)a=0<(n=t[s]).naturalWidth&&0<n.naturalHeight?e*n.naturalWidth/n.naturalHeight:e,n.style.width=a+"px",n.style.height=e+"px",n.style.marginLeft="3px",n.style.marginTop="3px",n.style.marginRight=this.margin-7+"px",n.style.marginBottom=this.margin-7+"px",(n=n.parentNode.parentNode).classList.contains("js")||n.classList.add("js")},t.prototype._alignImgs=function(t){for(var e,a,n,i,s=c.querySelector(this.container_selector),o=window.getComputedStyle(s),r=parseInt(o.getPropertyValue("padding-left"),10),o=parseInt(o.getPropertyValue("padding-right"),10),l=s.clientWidth-r-o;0<t.length;){for(e=!0,n=1;n<=t.length&&e;n++)a=t.slice(0,n),(i=this._getHeigth(a,l))<this.maxHeight&&(this._setSize(a,i),t=t.slice(n),e=!1);if(e){this._setSize(a,Math.min(this.maxHeight,i));break}}},t.prototype.align=function(){for(var t=c.querySelectorAll(this.results_selector),e=t.length,a=null,n=null,i=[],s=0;s<e;s++)(n=t[s]).previousElementSibling!==a&&0<i.length&&(this._alignImgs(i),i=[]),i.push(n.querySelector(this.img_selector)),a=n;0<i.length&&this._alignImgs(i)},t.prototype.watch=function(){var t,e,a=this,n=c.querySelectorAll(this.results_selector),i=n.length;function s(){a.isAlignDone&&(a.isAlignDone=!1,setTimeout(function(){a.align(),a.isAlignDone=!0},100))}for(o.addEventListener("pageshow",s),o.addEventListener("load",s),o.addEventListener("resize",s),t=0;t<i;t++)null!=(e=n[t].querySelector(this.img_selector))&&(e.addEventListener("load",s),e.addEventListener("error",s))},o.searxng.ImageLayout=t}(window,document);
 //# sourceMappingURL=searxng.min.js.map

File diff suppressed because it is too large
+ 0 - 0
searx/static/themes/oscar/js/searxng.min.js.map


+ 0 - 2
searx/static/themes/oscar/src/js/01_init.js

@@ -23,5 +23,3 @@ window.searxng = (function(d) {
         translations: JSON.parse(script.getAttribute('data-translations'))
     };
 })(document);
-
-window.searx = {};

+ 1 - 1
searx/static/themes/oscar/src/js/element_modifiers.js

@@ -103,6 +103,6 @@ $(document).ready(function(){
     /**
      * Layout images according to their sizes
      */
-    searxng.image_thumbnail_layout = new searx.ImageLayout('#main_results', '#main_results .result-images', 'img.img-thumbnail', 15, 200);
+    searxng.image_thumbnail_layout = new searxng.ImageLayout('#main_results', '#main_results .result-images', 'img.img-thumbnail', 15, 200);
     searxng.image_thumbnail_layout.watch();
 });

+ 0 - 1
searx/static/themes/simple/.jshintignore

@@ -1 +0,0 @@
-js/searx_src/autocomplete.js

+ 4 - 4
searx/static/themes/simple/css/searx-rtl.css → searx/static/themes/simple/css/searxng-rtl.css

@@ -1,5 +1,5 @@
 /*
-* searx, A privacy-respecting, hackable metasearch engine
+* SearXNG, A privacy-respecting, hackable metasearch engine
 *
 * To convert "style.less" to "style.css" run: $make styles
 */
@@ -815,12 +815,12 @@ template {
   content: "\f115";
 }
 /*
- * searx, A privacy-respecting, hackable metasearch engine
+ * SearXNG, A privacy-respecting, hackable metasearch engine
  *
  * To change the colors of the site, simple edit this variables
  */
 /*
-* searx, A privacy-respecting, hackable metasearch engine
+* SearXNG, A privacy-respecting, hackable metasearch engine
 */
 .code-highlight pre {
   overflow: auto;
@@ -1952,7 +1952,7 @@ td:hover .engine-tooltip,
   }
 }
 /*
-* searx, A privacy-respecting, hackable metasearch engine
+* SearXNG, A privacy-respecting, hackable metasearch engine
 */
 #search {
   padding: 0 2em 0 10rem;

File diff suppressed because it is too large
+ 0 - 0
searx/static/themes/simple/css/searxng-rtl.min.css


+ 0 - 0
searx/static/themes/simple/css/searx-rtl.min.css.map → searx/static/themes/simple/css/searxng-rtl.min.css.map


+ 4 - 4
searx/static/themes/simple/css/searx.css → searx/static/themes/simple/css/searxng.css

@@ -1,5 +1,5 @@
 /*
-* searx, A privacy-respecting, hackable metasearch engine
+* SearXNG, A privacy-respecting, hackable metasearch engine
 *
 * To convert "style.less" to "style.css" run: $make styles
 */
@@ -815,12 +815,12 @@ template {
   content: "\f115";
 }
 /*
- * searx, A privacy-respecting, hackable metasearch engine
+ * SearXNG, A privacy-respecting, hackable metasearch engine
  *
  * To change the colors of the site, simple edit this variables
  */
 /*
-* searx, A privacy-respecting, hackable metasearch engine
+* SearXNG, A privacy-respecting, hackable metasearch engine
 */
 .code-highlight pre {
   overflow: auto;
@@ -1952,7 +1952,7 @@ td:hover .engine-tooltip,
   }
 }
 /*
-* searx, A privacy-respecting, hackable metasearch engine
+* SearXNG, A privacy-respecting, hackable metasearch engine
 */
 #search {
   padding: 0 2em 0 10rem;

File diff suppressed because it is too large
+ 0 - 0
searx/static/themes/simple/css/searxng.min.css


+ 0 - 0
searx/static/themes/simple/css/searx.min.css.map → searx/static/themes/simple/css/searxng.min.css.map


+ 8 - 8
searx/static/themes/simple/gruntfile.js

@@ -72,8 +72,8 @@ module.exports = function(grunt) {
           separator: ';'
         },
         files: {
-          'js/searx.head.js': ['src/js/head/*.js'],
-          'js/searx.js': ['src/js/main/*.js', '../__common__/js/*.js', './node_modules/autocomplete-js/dist/autocomplete.js']
+          'js/searxng.head.js': ['src/js/head/*.js'],
+          'js/searxng.js': ['src/js/main/*.js', '../__common__/js/*.js', './node_modules/autocomplete-js/dist/autocomplete.js']
         }
       }
     },
@@ -90,8 +90,8 @@ module.exports = function(grunt) {
       },
       dist: {
         files: {
-          'js/searx.head.min.js': ['js/searx.head.js'],
-          'js/searx.min.js': ['js/searx.js']
+          'js/searxng.head.min.js': ['js/searxng.head.js'],
+          'js/searxng.min.js': ['js/searxng.js']
         }
       }
     },
@@ -165,8 +165,8 @@ module.exports = function(grunt) {
           paths: ["less"],
         },
         files: {
-          "css/searx.css": "src/less/style.less",
-          "css/searx-rtl.css": "src/less/style-rtl.less"
+          "css/searxng.css": "src/less/style.less",
+          "css/searxng-rtl.css": "src/less/style-rtl.less"
         }
       },
       production: {
@@ -181,8 +181,8 @@ module.exports = function(grunt) {
           sourceMapRootpath: '../',
         },
         files: {
-          "css/searx.min.css": "src/less/style.less",
-          "css/searx-rtl.min.css": "src/less/style-rtl.less"
+          "css/searxng.min.css": "src/less/style.less",
+          "css/searxng-rtl.min.css": "src/less/style-rtl.less"
         }
       },
     },

+ 0 - 2
searx/static/themes/simple/js/searx.head.min.js

@@ -1,2 +0,0 @@
-(function(t,e){"use strict";var a=e.currentScript||function(){var t=e.getElementsByTagName("script");return t[t.length-1]}();t.searx={touch:"ontouchstart"in t||t.DocumentTouch&&document instanceof DocumentTouch||false,method:a.getAttribute("data-method"),autocompleter:a.getAttribute("data-autocompleter")==="true",search_on_category_select:a.getAttribute("data-search-on-category-select")==="true",infinite_scroll:a.getAttribute("data-infinite-scroll")==="true",static_path:a.getAttribute("data-static-path"),translations:JSON.parse(a.getAttribute("data-translations"))};e.getElementsByTagName("html")[0].className=t.searx.touch?"js touch":"js"})(window,document);
-//# sourceMappingURL=searx.head.min.js.map

+ 0 - 1
searx/static/themes/simple/js/searx.head.min.js.map

@@ -1 +0,0 @@
-{"version":3,"file":"searx.head.min.js","sources":["searx.head.js"],"names":["w","d","script","currentScript","scripts","getElementsByTagName","length","searx","touch","DocumentTouch","document","method","getAttribute","autocompleter","search_on_category_select","infinite_scroll","static_path","translations","JSON","parse","className","window"],"mappings":"CAkBA,SAAUA,EAAGC,gBAIT,IAAIC,EAASD,EAAEE,eAAkB,WAC7B,IAAIC,EAAUH,EAAEI,qBAAqB,UACrC,OAAOD,EAAQA,EAAQE,OAAS,GAFH,GAMjCN,EAAEO,MAAQ,CACNC,MAAS,iBAAkBR,GAAMA,EAAES,eAAiBC,oBAAoBD,eAAkB,MAC1FE,OAAQT,EAAOU,aAAa,eAC5BC,cAAeX,EAAOU,aAAa,wBAA0B,OAC7DE,0BAA2BZ,EAAOU,aAAa,oCAAsC,OACrFG,gBAAiBb,EAAOU,aAAa,0BAA4B,OACjEI,YAAad,EAAOU,aAAa,oBACjCK,aAAcC,KAAKC,MAAMjB,EAAOU,aAAa,uBAIjDX,EAAEI,qBAAqB,QAAQ,GAAGe,UAAapB,EAAEO,MAAW,MAAE,WAAW,MArB7E,CAsBGc,OAAQX"}

File diff suppressed because it is too large
+ 0 - 0
searx/static/themes/simple/js/searx.min.js


File diff suppressed because it is too large
+ 0 - 0
searx/static/themes/simple/js/searx.min.js.map


+ 7 - 18
searx/static/themes/simple/js/searx.head.js → searx/static/themes/simple/js/searxng.head.js

@@ -1,20 +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/ >.
-*
-* (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
+ */
 /* global DocumentTouch:readonly */
 (function(w, d) {
     'use strict';
@@ -26,7 +15,7 @@
     })();
 
     // try to detect touch screen
-    w.searx = {
+    w.searxng = {
         touch: (("ontouchstart" in w) || w.DocumentTouch && document instanceof DocumentTouch) || false,
         method: script.getAttribute('data-method'),
         autocompleter: script.getAttribute('data-autocompleter') === 'true',
@@ -37,5 +26,5 @@
     };
 
     // update the css
-    d.getElementsByTagName("html")[0].className = (w.searx.touch)?"js touch":"js";
+    d.getElementsByTagName("html")[0].className = (w.searxng.touch)?"js touch":"js";
 })(window, document);

+ 8 - 0
searx/static/themes/simple/js/searxng.head.min.js

@@ -0,0 +1,8 @@
+/**
+ * @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
+ */
+(function(t,e){"use strict";var a=e.currentScript||function(){var t=e.getElementsByTagName("script");return t[t.length-1]}();t.searxng={touch:"ontouchstart"in t||t.DocumentTouch&&document instanceof DocumentTouch||false,method:a.getAttribute("data-method"),autocompleter:a.getAttribute("data-autocompleter")==="true",search_on_category_select:a.getAttribute("data-search-on-category-select")==="true",infinite_scroll:a.getAttribute("data-infinite-scroll")==="true",static_path:a.getAttribute("data-static-path"),translations:JSON.parse(a.getAttribute("data-translations"))};e.getElementsByTagName("html")[0].className=t.searxng.touch?"js touch":"js"})(window,document);
+//# sourceMappingURL=searxng.head.min.js.map

+ 1 - 0
searx/static/themes/simple/js/searxng.head.min.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"searxng.head.min.js","sources":["searxng.head.js"],"names":["w","d","script","currentScript","scripts","getElementsByTagName","length","searxng","touch","DocumentTouch","document","method","getAttribute","autocompleter","search_on_category_select","infinite_scroll","static_path","translations","JSON","parse","className","window"],"mappings":";;;;;;CAOA,SAAUA,EAAGC,gBAIT,IAAIC,EAASD,EAAEE,eAAkB,WAC7B,IAAIC,EAAUH,EAAEI,qBAAqB,UACrC,OAAOD,EAAQA,EAAQE,OAAS,GAFH,GAMjCN,EAAEO,QAAU,CACRC,MAAS,iBAAkBR,GAAMA,EAAES,eAAiBC,oBAAoBD,eAAkB,MAC1FE,OAAQT,EAAOU,aAAa,eAC5BC,cAAeX,EAAOU,aAAa,wBAA0B,OAC7DE,0BAA2BZ,EAAOU,aAAa,oCAAsC,OACrFG,gBAAiBb,EAAOU,aAAa,0BAA4B,OACjEI,YAAad,EAAOU,aAAa,oBACjCK,aAAcC,KAAKC,MAAMjB,EAAOU,aAAa,uBAIjDX,EAAEI,qBAAqB,QAAQ,GAAGe,UAAapB,EAAEO,QAAa,MAAE,WAAW,MArB/E,CAsBGc,OAAQX"}

+ 60 - 115
searx/static/themes/simple/js/searx.js → searx/static/themes/simple/js/searxng.js

@@ -1,21 +1,10 @@
 /**
-* 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>
-*
-*/
-window.searx = (function(w, d) {
+ * @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.searxng = (function(w, d) {
 
   'use strict';
 
@@ -45,9 +34,9 @@ window.searx = (function(w, d) {
     }
   }
 
-  var searx = window.searx || {};
+  var searxng = window.searxng || {};
 
-  searx.on = function(obj, eventType, callback, useCapture) {
+  searxng.on = function(obj, eventType, callback, useCapture) {
     useCapture = useCapture || false;
     if (typeof obj !== 'string') {
       // obj HTMLElement, HTMLDocument
@@ -62,7 +51,7 @@ window.searx = (function(w, d) {
     }
   };
 
-  searx.ready = function(callback) {
+  searxng.ready = function(callback) {
     if (document.readyState != 'loading') {
       callback.call(w);
     } else {
@@ -70,7 +59,7 @@ window.searx = (function(w, d) {
     }
   };
 
-  searx.http = function(method, url) {
+  searxng.http = function(method, url) {
     var req = new XMLHttpRequest(),
     resolve = function() {},
     reject = function() {},
@@ -109,8 +98,8 @@ window.searx = (function(w, d) {
     return promise;
   };
 
-  searx.loadStyle = function(src) {
-    var path = searx.static_path + src,
+  searxng.loadStyle = function(src) {
+    var path = searxng.static_path + src,
     id = "style_" + src.replace('.', '_'),
     s = d.getElementById(id);
     if (s === null) {
@@ -123,8 +112,8 @@ window.searx = (function(w, d) {
     }
   };
 
-  searx.loadScript = function(src, callback) {
-    var path = searx.static_path + src,
+  searxng.loadScript = function(src, callback) {
+    var path = searxng.static_path + src,
     id = "script_" + src.replace('.', '_'),
     s = d.getElementById(id);
     if (s === null) {
@@ -147,29 +136,30 @@ window.searx = (function(w, d) {
     }
   };
 
-  searx.insertBefore = function (newNode, referenceNode) {
+  searxng.insertBefore = function (newNode, referenceNode) {
     referenceNode.parentNode.insertBefore(newNode, referenceNode);
   };
 
-  searx.insertAfter = function(newNode, referenceNode) {
+  searxng.insertAfter = function(newNode, referenceNode) {
     referenceNode.parentNode.insertAfter(newNode, referenceNode.nextSibling);
   };  
 
-  searx.on('.close', 'click', function() {
+  searxng.on('.close', 'click', function() {
     this.parentNode.classList.add('invisible');
   });
   
-  return searx;
+  return searxng;
 })(window, document);
-;/*global searx*/
+;/* SPDX-License-Identifier: AGPL-3.0-or-later */
+/*global searxng*/
 
-searx.ready(function() {
+searxng.ready(function() {
 
-  searx.on('.result', 'click', function() {
+  searxng.on('.result', 'click', function() {
     highlightResult(this)(true);
   });
 
-  searx.on('.result a', 'focus', function(e) {
+  searxng.on('.result a', 'focus', function(e) {
     var el = e.target;
     while (el !== undefined) {
       if (el.classList.contains('result')) {
@@ -281,7 +271,7 @@ searx.ready(function() {
     }
   };
 
-  searx.on(document, "keydown", function(e) {
+  searxng.on(document, "keydown", function(e) {
     // check for modifiers so we don't break browser's hotkeys
     if (Object.prototype.hasOwnProperty.call(vimKeys, e.keyCode) && !e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey) {
       var tagName = e.target.tagName.toLowerCase();
@@ -531,31 +521,15 @@ searx.ready(function() {
     }
   }
 });
-;/**
-* 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) 2014 by Thomas Pointhuber, <thomas.pointhuber@gmx.at>
-* (C) 2017 by Alexandre Flament, <alex@al-f.net>
-*/
+;/* SPDX-License-Identifier: AGPL-3.0-or-later */
 /* global L */
-(function (w, d, searx) {
+(function (w, d, searxng) {
   'use strict';
 
-  searx.ready(function () {
-    searx.on('.searx_init_map', 'click', function(event) {
+  searxng.ready(function () {
+    searxng.on('.searxng_init_map', 'click', function(event) {
       // no more request
-      this.classList.remove("searx_init_map");
+      this.classList.remove("searxng_init_map");
 
       //
       var leaflet_target = this.dataset.leafletTarget;
@@ -565,8 +539,8 @@ searx.ready(function() {
       var map_boundingbox = JSON.parse(this.dataset.mapBoundingbox);
       var map_geojson = JSON.parse(this.dataset.mapGeojson);
 
-      searx.loadStyle('css/leaflet.css');
-      searx.loadScript('js/leaflet.js', function() {
+      searxng.loadStyle('css/leaflet.css');
+      searxng.loadScript('js/leaflet.js', function() {
         var map_bounds = null;
         if(map_boundingbox) {
           var southWest = L.latLng(map_boundingbox[0], map_boundingbox[2]);
@@ -620,20 +594,21 @@ searx.ready(function() {
       event.preventDefault();
     });
   });
-})(window, document, window.searx);
-;(function (w, d, searx) {
+})(window, document, window.searxng);
+;/* SPDX-License-Identifier: AGPL-3.0-or-later */
+(function (w, d, searxng) {
     'use strict';
 
-    searx.ready(function() {
+    searxng.ready(function() {
         let engine_descriptions = null;
         function load_engine_descriptions() {
             if (engine_descriptions == null) {
-                searx.http("GET", "engine_descriptions.json").then(function(content) {
+                searxng.http("GET", "engine_descriptions.json").then(function(content) {
                     engine_descriptions = JSON.parse(content);
                     for (const [engine_name, description] of Object.entries(engine_descriptions)) {
                         let elements = d.querySelectorAll('[data-engine-name="' + engine_name + '"] .engine-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;
                         }
                     }
@@ -643,35 +618,20 @@ searx.ready(function() {
 
         if (d.querySelector('body[class="preferences_endpoint"]')) {
             for(const el of d.querySelectorAll('[data-engine-name]')) {
-                searx.on(el, 'mouseenter', load_engine_descriptions);
+                searxng.on(el, 'mouseenter', load_engine_descriptions);
             }
         }
     });
-})(window, document, window.searx);
-;/**
-* 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) {
+})(window, document, window.searxng);
+;/* SPDX-License-Identifier: AGPL-3.0-or-later */
+(function(w, d, searxng) {
   '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();
+  searxng.ready(function() {
+    searxng.image_thumbnail_layout = new searxng.ImageLayout('#urls', '#urls .result-images', 'img.image_thumbnail', 10, 200);
+    searxng.image_thumbnail_layout.watch();
 
-    searx.on('.btn-collapse', 'click', function() {
+    searxng.on('.btn-collapse', 'click', function() {
       var btnLabelCollapsed = this.getAttribute('data-btn-text-collapsed');
       var btnLabelNotCollapsed = this.getAttribute('data-btn-text-not-collapsed');
       var target = this.getAttribute('data-target');
@@ -687,7 +647,7 @@ searx.ready(function() {
       targetElement.classList.toggle('invisible');
     });
 
-    searx.on('.media-loader', 'click', function() {
+    searxng.on('.media-loader', 'click', function() {
       var target = this.getAttribute('data-target');
       var iframe_load = d.querySelector(target + ' > iframe');
       var srctest = iframe_load.getAttribute('src');
@@ -710,25 +670,10 @@ searx.ready(function() {
 
   });
 
-})(window, document, window.searx);
-;/**
-* 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>
-*/
+})(window, document, window.searxng);
+;/* SPDX-License-Identifier: AGPL-3.0-or-later */
 /* global AutoComplete */
-(function(w, d, searx) {
+(function(w, d, searxng) {
   'use strict';
 
   var firstFocus = true, qinput_id = "q", qinput;
@@ -767,7 +712,7 @@ searx.ready(function() {
     qinput.addEventListener('keyup', updateClearButton, false);
   }
 
-  searx.ready(function() {
+  searxng.ready(function() {
     qinput = d.getElementById(qinput_id);
 
     function placeCursorAtEndOnce() {
@@ -784,11 +729,11 @@ searx.ready(function() {
       createClearButton(qinput);
       
       // autocompleter
-      if (searx.autocompleter) {
-        searx.autocomplete = AutoComplete.call(w, {
+      if (searxng.autocompleter) {
+        searxng.autocomplete = AutoComplete.call(w, {
           Url: "./autocompleter",
-          EmptyMessage: searx.translations.no_item_found,
-          HttpMethod: searx.method,
+          EmptyMessage: searxng.translations.no_item_found,
+          HttpMethod: searxng.method,
           HttpHeaders: {
             "Content-type": "application/x-www-form-urlencoded",
             "X-Requested-With": "XMLHttpRequest"
@@ -809,10 +754,10 @@ searx.ready(function() {
     }
 
     // vanilla js version of search_on_category_select.js
-    if (qinput !== null && d.querySelector('.help') != null && searx.search_on_category_select) {
+    if (qinput !== null && d.querySelector('.help') != null && searxng.search_on_category_select) {
       d.querySelector('.help').className='invisible';
 
-      searx.on('#categories input', 'change', function() {
+      searxng.on('#categories input', 'change', function() {
         var i, categories = d.querySelectorAll('#categories input[type="checkbox"]');
         for(i=0; i<categories.length; i++) {
           if (categories[i] !== this && categories[i].checked) {
@@ -826,13 +771,13 @@ searx.ready(function() {
         return false;
       });
 
-      searx.on(d.getElementById('time_range'), 'change', submitIfQuery);
-      searx.on(d.getElementById('language'), 'change', submitIfQuery);
+      searxng.on(d.getElementById('time_range'), 'change', submitIfQuery);
+      searxng.on(d.getElementById('language'), 'change', submitIfQuery);
     }
 
   });
 
-})(window, document, window.searx);
+})(window, document, window.searxng);
 ;/**
 *
 * Google Image Layout v0.0.1
@@ -993,7 +938,7 @@ searx.ready(function() {
     }
   };
 
-  w.searx.ImageLayout = ImageLayout;
+  w.searxng.ImageLayout = ImageLayout;
 
 }(window, document));
 ;(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.AutoComplete = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){

File diff suppressed because it is too large
+ 6 - 0
searx/static/themes/simple/js/searxng.min.js


File diff suppressed because it is too large
+ 0 - 0
searx/static/themes/simple/js/searxng.min.js.map


+ 7 - 18
searx/static/themes/simple/src/js/head/00_init.js

@@ -1,20 +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/ >.
-*
-* (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
+ */
 /* global DocumentTouch:readonly */
 (function(w, d) {
     'use strict';
@@ -26,7 +15,7 @@
     })();
 
     // try to detect touch screen
-    w.searx = {
+    w.searxng = {
         touch: (("ontouchstart" in w) || w.DocumentTouch && document instanceof DocumentTouch) || false,
         method: script.getAttribute('data-method'),
         autocompleter: script.getAttribute('data-autocompleter') === 'true',
@@ -37,5 +26,5 @@
     };
 
     // update the css
-    d.getElementsByTagName("html")[0].className = (w.searx.touch)?"js touch":"js";
+    d.getElementsByTagName("html")[0].className = (w.searxng.touch)?"js touch":"js";
 })(window, document);

+ 18 - 29
searx/static/themes/simple/src/js/main/00_searx_toolkit.js

@@ -1,21 +1,10 @@
 /**
-* 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>
-*
-*/
-window.searx = (function(w, d) {
+ * @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.searxng = (function(w, d) {
 
   'use strict';
 
@@ -45,9 +34,9 @@ window.searx = (function(w, d) {
     }
   }
 
-  var searx = window.searx || {};
+  var searxng = window.searxng || {};
 
-  searx.on = function(obj, eventType, callback, useCapture) {
+  searxng.on = function(obj, eventType, callback, useCapture) {
     useCapture = useCapture || false;
     if (typeof obj !== 'string') {
       // obj HTMLElement, HTMLDocument
@@ -62,7 +51,7 @@ window.searx = (function(w, d) {
     }
   };
 
-  searx.ready = function(callback) {
+  searxng.ready = function(callback) {
     if (document.readyState != 'loading') {
       callback.call(w);
     } else {
@@ -70,7 +59,7 @@ window.searx = (function(w, d) {
     }
   };
 
-  searx.http = function(method, url) {
+  searxng.http = function(method, url) {
     var req = new XMLHttpRequest(),
     resolve = function() {},
     reject = function() {},
@@ -109,8 +98,8 @@ window.searx = (function(w, d) {
     return promise;
   };
 
-  searx.loadStyle = function(src) {
-    var path = searx.static_path + src,
+  searxng.loadStyle = function(src) {
+    var path = searxng.static_path + src,
     id = "style_" + src.replace('.', '_'),
     s = d.getElementById(id);
     if (s === null) {
@@ -123,8 +112,8 @@ window.searx = (function(w, d) {
     }
   };
 
-  searx.loadScript = function(src, callback) {
-    var path = searx.static_path + src,
+  searxng.loadScript = function(src, callback) {
+    var path = searxng.static_path + src,
     id = "script_" + src.replace('.', '_'),
     s = d.getElementById(id);
     if (s === null) {
@@ -147,17 +136,17 @@ window.searx = (function(w, d) {
     }
   };
 
-  searx.insertBefore = function (newNode, referenceNode) {
+  searxng.insertBefore = function (newNode, referenceNode) {
     referenceNode.parentNode.insertBefore(newNode, referenceNode);
   };
 
-  searx.insertAfter = function(newNode, referenceNode) {
+  searxng.insertAfter = function(newNode, referenceNode) {
     referenceNode.parentNode.insertAfter(newNode, referenceNode.nextSibling);
   };  
 
-  searx.on('.close', 'click', function() {
+  searxng.on('.close', 'click', function() {
     this.parentNode.classList.add('invisible');
   });
   
-  return searx;
+  return searxng;
 })(window, document);

+ 6 - 5
searx/static/themes/simple/src/js/main/searx_keyboard.js

@@ -1,12 +1,13 @@
-/*global searx*/
+/* SPDX-License-Identifier: AGPL-3.0-or-later */
+/*global searxng*/
 
-searx.ready(function() {
+searxng.ready(function() {
 
-  searx.on('.result', 'click', function() {
+  searxng.on('.result', 'click', function() {
     highlightResult(this)(true);
   });
 
-  searx.on('.result a', 'focus', function(e) {
+  searxng.on('.result a', 'focus', function(e) {
     var el = e.target;
     while (el !== undefined) {
       if (el.classList.contains('result')) {
@@ -118,7 +119,7 @@ searx.ready(function() {
     }
   };
 
-  searx.on(document, "keydown", function(e) {
+  searxng.on(document, "keydown", function(e) {
     // check for modifiers so we don't break browser's hotkeys
     if (Object.prototype.hasOwnProperty.call(vimKeys, e.keyCode) && !e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey) {
       var tagName = e.target.tagName.toLowerCase();

+ 8 - 24
searx/static/themes/simple/src/js/main/searx_mapresult.js

@@ -1,28 +1,12 @@
-/**
-* 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) 2014 by Thomas Pointhuber, <thomas.pointhuber@gmx.at>
-* (C) 2017 by Alexandre Flament, <alex@al-f.net>
-*/
+/* SPDX-License-Identifier: AGPL-3.0-or-later */
 /* global L */
-(function (w, d, searx) {
+(function (w, d, searxng) {
   'use strict';
 
-  searx.ready(function () {
-    searx.on('.searx_init_map', 'click', function(event) {
+  searxng.ready(function () {
+    searxng.on('.searxng_init_map', 'click', function(event) {
       // no more request
-      this.classList.remove("searx_init_map");
+      this.classList.remove("searxng_init_map");
 
       //
       var leaflet_target = this.dataset.leafletTarget;
@@ -32,8 +16,8 @@
       var map_boundingbox = JSON.parse(this.dataset.mapBoundingbox);
       var map_geojson = JSON.parse(this.dataset.mapGeojson);
 
-      searx.loadStyle('css/leaflet.css');
-      searx.loadScript('js/leaflet.js', function() {
+      searxng.loadStyle('css/leaflet.css');
+      searxng.loadScript('js/leaflet.js', function() {
         var map_bounds = null;
         if(map_boundingbox) {
           var southWest = L.latLng(map_boundingbox[0], map_boundingbox[2]);
@@ -87,4 +71,4 @@
       event.preventDefault();
     });
   });
-})(window, document, window.searx);
+})(window, document, window.searxng);

+ 7 - 6
searx/static/themes/simple/src/js/main/searx_preferences.js

@@ -1,16 +1,17 @@
-(function (w, d, searx) {
+/* SPDX-License-Identifier: AGPL-3.0-or-later */
+(function (w, d, searxng) {
     'use strict';
 
-    searx.ready(function() {
+    searxng.ready(function() {
         let engine_descriptions = null;
         function load_engine_descriptions() {
             if (engine_descriptions == null) {
-                searx.http("GET", "engine_descriptions.json").then(function(content) {
+                searxng.http("GET", "engine_descriptions.json").then(function(content) {
                     engine_descriptions = JSON.parse(content);
                     for (const [engine_name, description] of Object.entries(engine_descriptions)) {
                         let elements = d.querySelectorAll('[data-engine-name="' + engine_name + '"] .engine-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;
                         }
                     }
@@ -20,8 +21,8 @@
 
         if (d.querySelector('body[class="preferences_endpoint"]')) {
             for(const el of d.querySelectorAll('[data-engine-name]')) {
-                searx.on(el, 'mouseenter', load_engine_descriptions);
+                searxng.on(el, 'mouseenter', load_engine_descriptions);
             }
         }
     });
-})(window, document, window.searx);
+})(window, document, window.searxng);

+ 8 - 23
searx/static/themes/simple/src/js/main/searx_results.js

@@ -1,27 +1,12 @@
-/**
-* 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) {
+/* SPDX-License-Identifier: AGPL-3.0-or-later */
+(function(w, d, searxng) {
   '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();
+  searxng.ready(function() {
+    searxng.image_thumbnail_layout = new searxng.ImageLayout('#urls', '#urls .result-images', 'img.image_thumbnail', 10, 200);
+    searxng.image_thumbnail_layout.watch();
 
-    searx.on('.btn-collapse', 'click', function() {
+    searxng.on('.btn-collapse', 'click', function() {
       var btnLabelCollapsed = this.getAttribute('data-btn-text-collapsed');
       var btnLabelNotCollapsed = this.getAttribute('data-btn-text-not-collapsed');
       var target = this.getAttribute('data-target');
@@ -37,7 +22,7 @@
       targetElement.classList.toggle('invisible');
     });
 
-    searx.on('.media-loader', 'click', function() {
+    searxng.on('.media-loader', 'click', function() {
       var target = this.getAttribute('data-target');
       var iframe_load = d.querySelector(target + ' > iframe');
       var srctest = iframe_load.getAttribute('src');
@@ -60,4 +45,4 @@
 
   });
 
-})(window, document, window.searx);
+})(window, document, window.searxng);

+ 12 - 27
searx/static/themes/simple/src/js/main/searx_search.js

@@ -1,21 +1,6 @@
-/**
-* 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>
-*/
+/* SPDX-License-Identifier: AGPL-3.0-or-later */
 /* global AutoComplete */
-(function(w, d, searx) {
+(function(w, d, searxng) {
   'use strict';
 
   var firstFocus = true, qinput_id = "q", qinput;
@@ -54,7 +39,7 @@
     qinput.addEventListener('keyup', updateClearButton, false);
   }
 
-  searx.ready(function() {
+  searxng.ready(function() {
     qinput = d.getElementById(qinput_id);
 
     function placeCursorAtEndOnce() {
@@ -71,11 +56,11 @@
       createClearButton(qinput);
       
       // autocompleter
-      if (searx.autocompleter) {
-        searx.autocomplete = AutoComplete.call(w, {
+      if (searxng.autocompleter) {
+        searxng.autocomplete = AutoComplete.call(w, {
           Url: "./autocompleter",
-          EmptyMessage: searx.translations.no_item_found,
-          HttpMethod: searx.method,
+          EmptyMessage: searxng.translations.no_item_found,
+          HttpMethod: searxng.method,
           HttpHeaders: {
             "Content-type": "application/x-www-form-urlencoded",
             "X-Requested-With": "XMLHttpRequest"
@@ -96,10 +81,10 @@
     }
 
     // vanilla js version of search_on_category_select.js
-    if (qinput !== null && d.querySelector('.help') != null && searx.search_on_category_select) {
+    if (qinput !== null && d.querySelector('.help') != null && searxng.search_on_category_select) {
       d.querySelector('.help').className='invisible';
 
-      searx.on('#categories input', 'change', function() {
+      searxng.on('#categories input', 'change', function() {
         var i, categories = d.querySelectorAll('#categories input[type="checkbox"]');
         for(i=0; i<categories.length; i++) {
           if (categories[i] !== this && categories[i].checked) {
@@ -113,10 +98,10 @@
         return false;
       });
 
-      searx.on(d.getElementById('time_range'), 'change', submitIfQuery);
-      searx.on(d.getElementById('language'), 'change', submitIfQuery);
+      searxng.on(d.getElementById('time_range'), 'change', submitIfQuery);
+      searxng.on(d.getElementById('language'), 'change', submitIfQuery);
     }
 
   });
 
-})(window, document, window.searx);
+})(window, document, window.searxng);

+ 1 - 1
searx/static/themes/simple/src/less/definitions.less

@@ -1,5 +1,5 @@
 /*
- * searx, A privacy-respecting, hackable metasearch engine
+ * SearXNG, A privacy-respecting, hackable metasearch engine
  *
  * To change the colors of the site, simple edit this variables
  */

+ 1 - 1
searx/static/themes/simple/src/less/mixins.less

@@ -1,5 +1,5 @@
 /*
-* searx, A privacy-respecting, hackable metasearch engine
+* SearXNG, A privacy-respecting, hackable metasearch engine
 */
 
 // Mixins

+ 1 - 1
searx/static/themes/simple/src/less/search.less

@@ -1,5 +1,5 @@
 /*
-* searx, A privacy-respecting, hackable metasearch engine
+* SearXNG, A privacy-respecting, hackable metasearch engine
 */
 
 #search {

+ 1 - 1
searx/static/themes/simple/src/less/style.less

@@ -1,5 +1,5 @@
 /*
-* searx, A privacy-respecting, hackable metasearch engine
+* SearXNG, A privacy-respecting, hackable metasearch engine
 *
 * To convert "style.less" to "style.css" run: $make styles
 */

+ 7 - 7
searx/templates/simple/base.html

@@ -2,9 +2,9 @@
 <html class="no-js" lang="en" {% if rtl %} dir="rtl"{% endif %}>
 <head>
   <meta charset="UTF-8" />
-  <meta name="description" content="searx — a privacy-respecting, hackable metasearch engine">
-  <meta name="keywords" content="searx, search, search engine, metasearch, meta search">
-  <meta name="generator" content="searx/{{ searx_version }}">
+  <meta name="description" content="SearXNG — a privacy-respecting, hackable metasearch engine">
+  <meta name="keywords" content="SearXNG, search, search engine, metasearch, meta search">
+  <meta name="generator" content="searxng/{{ searx_version }}">
   <meta name="referrer" content="no-referrer">
   <meta name="robots" content="noarchive">
   <meta name="viewport" content="width=device-width, maximum-scale=1.0, user-scalable=1">
@@ -13,13 +13,13 @@
   <title>{% block title %}{% endblock %}{{ instance_name }}</title>
   {% block meta %}{% endblock %}
   {% if rtl %}
-  <link rel="stylesheet" href="{{ url_for('static', filename='css/searx-rtl.min.css') }}" type="text/css" media="screen" />
+  <link rel="stylesheet" href="{{ url_for('static', filename='css/searxng-rtl.min.css') }}" type="text/css" media="screen" />
   {% else %}
-  <link rel="stylesheet" href="{{ url_for('static', filename='css/searx.min.css') }}" type="text/css" media="screen" />
+  <link rel="stylesheet" href="{{ url_for('static', filename='css/searxng.min.css') }}" type="text/css" media="screen" />
   {% endif %}
   {% block styles %}{% endblock %}
   <!--[if gte IE 9]>-->
-  <script src="{{ url_for('static', filename='js/searx.head.min.js') }}"
+  <script src="{{ url_for('static', filename='js/searxng.head.min.js') }}"
           data-method="{{ method or 'POST' }}"
           data-autocompleter="{% if autocomplete %}true{% else %}false{% endif %}"
           data-search-on-category-select="{{ 'true' if 'plugins/js/search_on_category_select.js' in scripts else 'false'}}"
@@ -59,7 +59,7 @@
     </p>
   </footer>
   <!--[if gte IE 9]>-->
-  <script src="{{ url_for('static', filename='js/searx.min.js') }}"></script>
+  <script src="{{ url_for('static', filename='js/searxng.min.js') }}"></script>
   <!--<![endif]-->
 </body>
 </html>

+ 1 - 1
searx/templates/simple/messages/no_results.html

@@ -11,7 +11,7 @@
   </p>
   {%- endfor %}
 
-  <p><small>{{ _('Please, try again later or find another searx instance.') }} (<a href="{{ get_setting('brand.public_instances') }}">{{ _('Public instances') }}</a>) </small></p>
+  <p><small>{{ _('Please, try again later or find another SearXNG instance.') }} (<a href="{{ get_setting('brand.public_instances') }}">{{ _('Public instances') }}</a>) </small></p>
 </div>
 {% else %}
 <div class="dialog-error" role="alert">

+ 6 - 6
searx/templates/simple/preferences.html

@@ -95,7 +95,7 @@
 {% block head %} {% endblock %}
 {% block content %}
 
-<a href="{{ url_for('index') }}"><h1><span>searx</span></h1></a>
+<a href="{{ url_for('index') }}"><h1><span>SearXNG</span></h1></a>
 
 <h2>{{ _('Preferences') }}</h2>
 
@@ -194,7 +194,7 @@
           {%- endfor -%}
         </select>
       </p>
-      <div class="description">{{ _('Change searx layout') }}</div>
+      <div class="description">{{ _('Change SearXNG layout') }}</div>
     </fieldset>
     {% endif %}
     {% if 'results_on_new_tab' not in locked_preferences %}
@@ -234,7 +234,7 @@
           <option value="" {% if not image_proxy %}selected="selected"{% endif %}>{{ _('Disabled') }}</option>
         </select>
       </p>
-      <div class="description">{{ _('Proxying image results through searx') }}</div>
+      <div class="description">{{ _('Proxying image results through SearXNG') }}</div>
     </fieldset>
     {% endif %}
     {{ plugin_preferences('privacy') }}
@@ -293,7 +293,7 @@
         <th>{{ _('Examples') }}</th>
       </tr>
       <td></td>
-      <th scope="colgroup" colspan="4">{{ _('This is the list of searx\'s instant answering modules.') }}</th>
+      <th scope="colgroup" colspan="4">{{ _('This is the list of SearXNG\'s instant answering modules.') }}</th>
       {% for answerer in answerers %}
       <tr>
         <td></td>
@@ -323,8 +323,8 @@
 
   {{ tab_header('maintab', 'cookies', _('Cookies')) }}
      <p class="text-muted">
-        {{ _('This is the list of cookies and their values searx is storing on your computer.') }}<br />
-        {{ _('With that list, you can assess searx transparency.') }}<br />
+        {{ _('This is the list of cookies and their values SearXNG is storing on your computer.') }}<br />
+        {{ _('With that list, you can assess SearXNG transparency.') }}<br />
      </p>
      {% if cookies %}
      <table class="cookies">

+ 1 - 1
searx/templates/simple/result_templates/map.html

@@ -39,7 +39,7 @@
 </table>
 
 {%- if (result.latitude and result.longitude) or result.boundingbox -%}
-    <small> <a class="btn-collapse collapsed searx_init_map hide_if_nojs" data-target="#result-map-{{ index }}" data-btn-text-collapsed="{{ _('show map') }}" data-btn-text-not-collapsed="{{ _('hide map') }}" data-leaflet-target="osm-map-{{ index }}" data-map-lon="{{ result.longitude }}" data-map-lat="{{ result.latitude }}" {% if result.boundingbox %}data-map-boundingbox='{{ result.boundingbox|tojson|safe }}'{% endif %} {% if result.geojson %}data-map-geojson='{{ result.geojson|tojson|safe }}'{% endif %}>{{ icon( 'globe') }} {{ _('show map') }}</a></small>
+    <small> <a class="btn-collapse collapsed searxng_init_map hide_if_nojs" data-target="#result-map-{{ index }}" data-btn-text-collapsed="{{ _('show map') }}" data-btn-text-not-collapsed="{{ _('hide map') }}" data-leaflet-target="osm-map-{{ index }}" data-map-lon="{{ result.longitude }}" data-map-lat="{{ result.latitude }}" {% if result.boundingbox %}data-map-boundingbox='{{ result.boundingbox|tojson|safe }}'{% endif %} {% if result.geojson %}data-map-geojson='{{ result.geojson|tojson|safe }}'{% endif %}>{{ icon( 'globe') }} {{ _('show map') }}</a></small>
 {%- endif -%}
 
 {{- result_sub_footer(result, proxify) -}}

+ 1 - 1
searx/templates/simple/stats.html

@@ -16,7 +16,7 @@
 {% block head %} {% endblock %}
 {% block content %}
 
-<a href="{{ url_for('index') }}"><h1><span>searx</span></h1></a>
+<a href="{{ url_for('index') }}"><h1><span>SearXNG</span></h1></a>
 
 <h2>{% if selected_engine_name %}<a href="{{ url_for('stats') }}">{% endif %}{{ _('Engine stats') }}{% if selected_engine_name %}</a> - {{ selected_engine_name }}{% endif %}</h2>
 

Some files were not shown because too many files changed in this diff