diff options
Diffstat (limited to 'searx/static/themes/oscar/js/searx.js')
-rw-r--r-- | searx/static/themes/oscar/js/searx.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/searx/static/themes/oscar/js/searx.js b/searx/static/themes/oscar/js/searx.js index 5c0350514..7209ea073 100644 --- a/searx/static/themes/oscar/js/searx.js +++ b/searx/static/themes/oscar/js/searx.js @@ -300,6 +300,29 @@ $(document).ready(function(){ }); }); ;$(document).ready(function(){ + let engine_descriptions = null; + function load_engine_descriptions() { + if (engine_descriptions == null) { + $.ajax("engine_descriptions.json", dataType="json").done(function(data) { + engine_descriptions = data; + 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'] + ': ' + description[1] + '</i>)'; + element.innerHTML = description[0] + source; + } + } + }); + } + } + + if (document.querySelector('body[class="preferences_endpoint"]')) { + $('[data-engine-name]').hover(function() { + load_engine_descriptions(); + }); + } +}); +;$(document).ready(function(){ $("#allow-all-engines").click(function() { $(".onoffswitch-checkbox").each(function() { this.checked = false;}); }); |