mirror of
https://github.com/searxng/searxng.git
synced 2025-02-18 11:20:03 +00:00
[build] /static
This commit is contained in:
parent
c00e54d61b
commit
558e0c3241
Binary file not shown.
@ -965,7 +965,7 @@ template {
|
|||||||
--color-toolkit-badge-background: #777;
|
--color-toolkit-badge-background: #777;
|
||||||
--color-toolkit-kbd-font: #000;
|
--color-toolkit-kbd-font: #000;
|
||||||
--color-toolkit-kbd-background: #fff;
|
--color-toolkit-kbd-background: #fff;
|
||||||
--color-toolkit-dialog-border: #333;
|
--color-toolkit-dialog-border: #555;
|
||||||
--color-toolkit-dialog-background: #222;
|
--color-toolkit-dialog-background: #222;
|
||||||
--color-toolkit-tabs-label-border: #222;
|
--color-toolkit-tabs-label-border: #222;
|
||||||
--color-toolkit-tabs-section-border: #555;
|
--color-toolkit-tabs-section-border: #555;
|
||||||
@ -1544,10 +1544,9 @@ div.selectable_url pre {
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
/* bring your own prefixes */
|
margin: 0 auto;
|
||||||
transform: translate(-50%, -50%);
|
transform: translate(-50%, -50%);
|
||||||
z-index: 100000;
|
z-index: 10000000;
|
||||||
margin: 0 50% 0 0;
|
|
||||||
}
|
}
|
||||||
.dialog-modal::before {
|
.dialog-modal::before {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
BIN
searx/static/themes/simple/css/searxng-rtl.min.css
vendored
BIN
searx/static/themes/simple/css/searxng-rtl.min.css
vendored
Binary file not shown.
Binary file not shown.
@ -965,7 +965,7 @@ template {
|
|||||||
--color-toolkit-badge-background: #777;
|
--color-toolkit-badge-background: #777;
|
||||||
--color-toolkit-kbd-font: #000;
|
--color-toolkit-kbd-font: #000;
|
||||||
--color-toolkit-kbd-background: #fff;
|
--color-toolkit-kbd-background: #fff;
|
||||||
--color-toolkit-dialog-border: #333;
|
--color-toolkit-dialog-border: #555;
|
||||||
--color-toolkit-dialog-background: #222;
|
--color-toolkit-dialog-background: #222;
|
||||||
--color-toolkit-tabs-label-border: #222;
|
--color-toolkit-tabs-label-border: #222;
|
||||||
--color-toolkit-tabs-section-border: #555;
|
--color-toolkit-tabs-section-border: #555;
|
||||||
@ -1544,10 +1544,9 @@ div.selectable_url pre {
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
/* bring your own prefixes */
|
margin: 0 auto;
|
||||||
transform: translate(-50%, -50%);
|
transform: translate(-50%, -50%);
|
||||||
z-index: 100000;
|
z-index: 10000000;
|
||||||
margin: 0 50% 0 0;
|
|
||||||
}
|
}
|
||||||
.dialog-modal::before {
|
.dialog-modal::before {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
BIN
searx/static/themes/simple/css/searxng.min.css
vendored
BIN
searx/static/themes/simple/css/searxng.min.css
vendored
Binary file not shown.
Binary file not shown.
@ -21,6 +21,7 @@
|
|||||||
autocompleter: script.getAttribute('data-autocompleter') === 'true',
|
autocompleter: script.getAttribute('data-autocompleter') === 'true',
|
||||||
search_on_category_select: script.getAttribute('data-search-on-category-select') === 'true',
|
search_on_category_select: script.getAttribute('data-search-on-category-select') === 'true',
|
||||||
infinite_scroll: script.getAttribute('data-infinite-scroll') === 'true',
|
infinite_scroll: script.getAttribute('data-infinite-scroll') === 'true',
|
||||||
|
hotkeys: script.getAttribute('data-hotkeys') === 'true',
|
||||||
static_path: script.getAttribute('data-static-path'),
|
static_path: script.getAttribute('data-static-path'),
|
||||||
translations: JSON.parse(script.getAttribute('data-translations')),
|
translations: JSON.parse(script.getAttribute('data-translations')),
|
||||||
};
|
};
|
||||||
|
BIN
searx/static/themes/simple/js/searxng.head.min.js
vendored
BIN
searx/static/themes/simple/js/searxng.head.min.js
vendored
Binary file not shown.
Binary file not shown.
@ -155,20 +155,55 @@ window.searxng = (function(w, d) {
|
|||||||
|
|
||||||
searxng.ready(function() {
|
searxng.ready(function() {
|
||||||
|
|
||||||
searxng.on('.result', 'click', function() {
|
function isElementInDetail(el) {
|
||||||
highlightResult(this)(true);
|
while (el !== undefined) {
|
||||||
|
if (el.classList.contains('detail')) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (el.classList.contains('result')) {
|
||||||
|
// we found a result, no need to go to the root of the document:
|
||||||
|
// el is not inside a <div class="detail"> element
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
el = el.parentNode;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getResultElement(el) {
|
||||||
|
while (el !== undefined) {
|
||||||
|
if (el.classList.contains('result')) {
|
||||||
|
return el;
|
||||||
|
}
|
||||||
|
el = el.parentNode;
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isImageResult(resultElement) {
|
||||||
|
return resultElement && resultElement.classList.contains('result-images');
|
||||||
|
}
|
||||||
|
|
||||||
|
searxng.on('.result', 'click', function(e) {
|
||||||
|
if (!isElementInDetail(e.target)) {
|
||||||
|
highlightResult(this)(true);
|
||||||
|
let resultElement = getResultElement(e.target);
|
||||||
|
if (isImageResult(resultElement)) {
|
||||||
|
e.preventDefault();
|
||||||
|
searxng.selectImage(resultElement);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
searxng.on('.result a', 'focus', function(e) {
|
searxng.on('.result a', 'focus', function(e) {
|
||||||
var el = e.target;
|
if (!isElementInDetail(e.target)) {
|
||||||
while (el !== undefined) {
|
let resultElement = getResultElement(e.target);
|
||||||
if (el.classList.contains('result')) {
|
if (resultElement && resultElement.getAttribute("data-vim-selected") === null) {
|
||||||
if (el.getAttribute("data-vim-selected") === null) {
|
highlightResult(resultElement)(true);
|
||||||
highlightResult(el)(true);
|
}
|
||||||
}
|
if (isImageResult(resultElement)) {
|
||||||
break;
|
searxng.selectImage(resultElement);
|
||||||
}
|
}
|
||||||
el = el.parentNode;
|
|
||||||
}
|
}
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
@ -271,20 +306,22 @@ searxng.ready(function() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
searxng.on(document, "keydown", function(e) {
|
if (searxng.hotkeys) {
|
||||||
// check for modifiers so we don't break browser's hotkeys
|
searxng.on(document, "keydown", function(e) {
|
||||||
if (Object.prototype.hasOwnProperty.call(vimKeys, e.keyCode) && !e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey) {
|
// check for modifiers so we don't break browser's hotkeys
|
||||||
var tagName = e.target.tagName.toLowerCase();
|
if (Object.prototype.hasOwnProperty.call(vimKeys, e.keyCode) && !e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey) {
|
||||||
if (e.keyCode === 27) {
|
var tagName = e.target.tagName.toLowerCase();
|
||||||
vimKeys[e.keyCode].fun(e);
|
if (e.keyCode === 27) {
|
||||||
} else {
|
vimKeys[e.keyCode].fun(e);
|
||||||
if (e.target === document.body || tagName === 'a' || tagName === 'button') {
|
} else {
|
||||||
e.preventDefault();
|
if (e.target === document.body || tagName === 'a' || tagName === 'button') {
|
||||||
vimKeys[e.keyCode].fun();
|
e.preventDefault();
|
||||||
|
vimKeys[e.keyCode].fun();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
|
|
||||||
function highlightResult(which) {
|
function highlightResult(which) {
|
||||||
return function(noScroll) {
|
return function(noScroll) {
|
||||||
@ -505,14 +542,12 @@ searxng.ready(function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function toggleHelp() {
|
function toggleHelp() {
|
||||||
var helpPanel = document.querySelector('#vim-hotkeys-help');
|
var helpPanel = document.querySelector('#vim-hotkeys-help');
|
||||||
console.log(helpPanel);
|
|
||||||
if (helpPanel === undefined || helpPanel === null) {
|
if (helpPanel === undefined || helpPanel === null) {
|
||||||
// first call
|
// first call
|
||||||
helpPanel = document.createElement('div');
|
helpPanel = document.createElement('div');
|
||||||
helpPanel.id = 'vim-hotkeys-help';
|
helpPanel.id = 'vim-hotkeys-help';
|
||||||
helpPanel.className='dialog-modal';
|
helpPanel.className='dialog-modal';
|
||||||
helpPanel.style='width: 40%';
|
|
||||||
initHelpContent(helpPanel);
|
initHelpContent(helpPanel);
|
||||||
initHelpContent(helpPanel);
|
initHelpContent(helpPanel);
|
||||||
initHelpContent(helpPanel);
|
initHelpContent(helpPanel);
|
||||||
@ -664,17 +699,13 @@ searxng.ready(function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function selectImage(e) {
|
searxng.selectImage = function(resultElement) {
|
||||||
/*eslint no-unused-vars: 0*/
|
/*eslint no-unused-vars: 0*/
|
||||||
let t = e.target;
|
if (resultElement) {
|
||||||
while (t && t.nodeName != 'ARTICLE') {
|
|
||||||
t = t.parentNode;
|
|
||||||
}
|
|
||||||
if (t) {
|
|
||||||
// load full size image in background
|
// load full size image in background
|
||||||
const imgElement = t.querySelector('.result-images-source img');
|
const imgElement = resultElement.querySelector('.result-images-source img');
|
||||||
const thumbnailElement = t.querySelector('.image_thumbnail');
|
const thumbnailElement = resultElement.querySelector('.image_thumbnail');
|
||||||
const detailElement = t.querySelector('.detail');
|
const detailElement = resultElement.querySelector('.detail');
|
||||||
if (imgElement) {
|
if (imgElement) {
|
||||||
const imgSrc = imgElement.getAttribute('data-src');
|
const imgSrc = imgElement.getAttribute('data-src');
|
||||||
if (imgSrc) {
|
if (imgSrc) {
|
||||||
@ -707,12 +738,6 @@ searxng.ready(function() {
|
|||||||
searxng.image_thumbnail_layout.align();
|
searxng.image_thumbnail_layout.align();
|
||||||
searxng.scrollPageToSelected();
|
searxng.scrollPageToSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
searxng.on('.result-images', 'click', e => {
|
|
||||||
e.preventDefault();
|
|
||||||
selectImage(e);
|
|
||||||
});
|
|
||||||
searxng.on('.result-images a', 'focus', selectImage, true);
|
|
||||||
searxng.on('.result-detail-close', 'click', e => {
|
searxng.on('.result-detail-close', 'click', e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
searxng.closeDetail();
|
searxng.closeDetail();
|
||||||
|
BIN
searx/static/themes/simple/js/searxng.min.js
vendored
BIN
searx/static/themes/simple/js/searxng.min.js
vendored
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user