mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
[enh] themes: display the engine descriptions
This commit is contained in:
parent
bfd24d1226
commit
2f1384f198
7 changed files with 71 additions and 4 deletions
23
searx/static/themes/oscar/src/js/preferences.js
Normal file
23
searx/static/themes/oscar/src/js/preferences.js
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
$(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();
|
||||
});
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue