Merge pull request '2023_09_17' (#9) from 2023_09_17 into main

Reviewed-on: #9
This commit is contained in:
meaz 2023-09-19 19:38:35 +00:00
commit 3219d1eb2c
23 changed files with 464 additions and 300 deletions

View file

@ -658,4 +658,4 @@ svg.leaflet-image-layer.leaflet-interactive path {
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 466 KiB

After

Width:  |  Height:  |  Size: 45 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,99 +1,173 @@
/*
this file is generated automatically by searxng_extra/update/update_pygments.py
using pygments version 2.15.1
using pygments version 2.16.1
*/
.code-highlight .linenos {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
cursor: default;
&::selection {
background: transparent; /* WebKit/Blink Browsers */
}
&::-moz-selection {
background: transparent; /* Gecko Browsers */
}
.code-highlight {
margin-right: 8px;
text-align: right;
pre { line-height: 100%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.hll { background-color: #ffffcc }
.c { color: #3D7B7B; font-style: italic } /* Comment */
.err { border: 1px solid #FF0000 } /* Error */
.k { color: #008000; font-weight: bold } /* Keyword */
.o { color: #666666 } /* Operator */
.ch { color: #3D7B7B; font-style: italic } /* Comment.Hashbang */
.cm { color: #3D7B7B; font-style: italic } /* Comment.Multiline */
.cp { color: #9C6500 } /* Comment.Preproc */
.cpf { color: #3D7B7B; font-style: italic } /* Comment.PreprocFile */
.c1 { color: #3D7B7B; font-style: italic } /* Comment.Single */
.cs { color: #3D7B7B; font-style: italic } /* Comment.Special */
.gd { color: #A00000 } /* Generic.Deleted */
.ge { font-style: italic } /* Generic.Emph */
.ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.gr { color: #E40000 } /* Generic.Error */
.gh { color: #000080; font-weight: bold } /* Generic.Heading */
.gi { color: #008400 } /* Generic.Inserted */
.go { color: #717171 } /* Generic.Output */
.gp { color: #000080; font-weight: bold } /* Generic.Prompt */
.gs { font-weight: bold } /* Generic.Strong */
.gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.gt { color: #0044DD } /* Generic.Traceback */
.kc { color: #008000; font-weight: bold } /* Keyword.Constant */
.kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
.kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
.kp { color: #008000 } /* Keyword.Pseudo */
.kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
.kt { color: #B00040 } /* Keyword.Type */
.m { color: #666666 } /* Literal.Number */
.s { color: #BA2121 } /* Literal.String */
.na { color: #687822 } /* Name.Attribute */
.nb { color: #008000 } /* Name.Builtin */
.nc { color: #0000FF; font-weight: bold } /* Name.Class */
.no { color: #880000 } /* Name.Constant */
.nd { color: #AA22FF } /* Name.Decorator */
.ni { color: #717171; font-weight: bold } /* Name.Entity */
.ne { color: #CB3F38; font-weight: bold } /* Name.Exception */
.nf { color: #0000FF } /* Name.Function */
.nl { color: #767600 } /* Name.Label */
.nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
.nt { color: #008000; font-weight: bold } /* Name.Tag */
.nv { color: #19177C } /* Name.Variable */
.ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
.w { color: #bbbbbb } /* Text.Whitespace */
.mb { color: #666666 } /* Literal.Number.Bin */
.mf { color: #666666 } /* Literal.Number.Float */
.mh { color: #666666 } /* Literal.Number.Hex */
.mi { color: #666666 } /* Literal.Number.Integer */
.mo { color: #666666 } /* Literal.Number.Oct */
.sa { color: #BA2121 } /* Literal.String.Affix */
.sb { color: #BA2121 } /* Literal.String.Backtick */
.sc { color: #BA2121 } /* Literal.String.Char */
.dl { color: #BA2121 } /* Literal.String.Delimiter */
.sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
.s2 { color: #BA2121 } /* Literal.String.Double */
.se { color: #AA5D1F; font-weight: bold } /* Literal.String.Escape */
.sh { color: #BA2121 } /* Literal.String.Heredoc */
.si { color: #A45A77; font-weight: bold } /* Literal.String.Interpol */
.sx { color: #008000 } /* Literal.String.Other */
.sr { color: #A45A77 } /* Literal.String.Regex */
.s1 { color: #BA2121 } /* Literal.String.Single */
.ss { color: #19177C } /* Literal.String.Symbol */
.bp { color: #008000 } /* Name.Builtin.Pseudo */
.fm { color: #0000FF } /* Name.Function.Magic */
.vc { color: #19177C } /* Name.Variable.Class */
.vg { color: #19177C } /* Name.Variable.Global */
.vi { color: #19177C } /* Name.Variable.Instance */
.vm { color: #19177C } /* Name.Variable.Magic */
.il { color: #666666 } /* Literal.Number.Integer.Long */
}
.code-highlight pre { line-height: 125%; }
.code-highlight td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
.code-highlight span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
.code-highlight td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.code-highlight span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.code-highlight .hll { background-color: #ffffcc }
.code-highlight { background: #f8f8f8; }
.code-highlight .c { color: #3D7B7B; font-style: italic } /* Comment */
.code-highlight .err { border: 1px solid #FF0000 } /* Error */
.code-highlight .k { color: #008000; font-weight: bold } /* Keyword */
.code-highlight .o { color: #666666 } /* Operator */
.code-highlight .ch { color: #3D7B7B; font-style: italic } /* Comment.Hashbang */
.code-highlight .cm { color: #3D7B7B; font-style: italic } /* Comment.Multiline */
.code-highlight .cp { color: #9C6500 } /* Comment.Preproc */
.code-highlight .cpf { color: #3D7B7B; font-style: italic } /* Comment.PreprocFile */
.code-highlight .c1 { color: #3D7B7B; font-style: italic } /* Comment.Single */
.code-highlight .cs { color: #3D7B7B; font-style: italic } /* Comment.Special */
.code-highlight .gd { color: #A00000 } /* Generic.Deleted */
.code-highlight .ge { font-style: italic } /* Generic.Emph */
.code-highlight .gr { color: #E40000 } /* Generic.Error */
.code-highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.code-highlight .gi { color: #008400 } /* Generic.Inserted */
.code-highlight .go { color: #717171 } /* Generic.Output */
.code-highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
.code-highlight .gs { font-weight: bold } /* Generic.Strong */
.code-highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.code-highlight .gt { color: #0044DD } /* Generic.Traceback */
.code-highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
.code-highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
.code-highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
.code-highlight .kp { color: #008000 } /* Keyword.Pseudo */
.code-highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
.code-highlight .kt { color: #B00040 } /* Keyword.Type */
.code-highlight .m { color: #666666 } /* Literal.Number */
.code-highlight .s { color: #BA2121 } /* Literal.String */
.code-highlight .na { color: #687822 } /* Name.Attribute */
.code-highlight .nb { color: #008000 } /* Name.Builtin */
.code-highlight .nc { color: #0000FF; font-weight: bold } /* Name.Class */
.code-highlight .no { color: #880000 } /* Name.Constant */
.code-highlight .nd { color: #AA22FF } /* Name.Decorator */
.code-highlight .ni { color: #717171; font-weight: bold } /* Name.Entity */
.code-highlight .ne { color: #CB3F38; font-weight: bold } /* Name.Exception */
.code-highlight .nf { color: #0000FF } /* Name.Function */
.code-highlight .nl { color: #767600 } /* Name.Label */
.code-highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
.code-highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */
.code-highlight .nv { color: #19177C } /* Name.Variable */
.code-highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
.code-highlight .w { color: #bbbbbb } /* Text.Whitespace */
.code-highlight .mb { color: #666666 } /* Literal.Number.Bin */
.code-highlight .mf { color: #666666 } /* Literal.Number.Float */
.code-highlight .mh { color: #666666 } /* Literal.Number.Hex */
.code-highlight .mi { color: #666666 } /* Literal.Number.Integer */
.code-highlight .mo { color: #666666 } /* Literal.Number.Oct */
.code-highlight .sa { color: #BA2121 } /* Literal.String.Affix */
.code-highlight .sb { color: #BA2121 } /* Literal.String.Backtick */
.code-highlight .sc { color: #BA2121 } /* Literal.String.Char */
.code-highlight .dl { color: #BA2121 } /* Literal.String.Delimiter */
.code-highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
.code-highlight .s2 { color: #BA2121 } /* Literal.String.Double */
.code-highlight .se { color: #AA5D1F; font-weight: bold } /* Literal.String.Escape */
.code-highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */
.code-highlight .si { color: #A45A77; font-weight: bold } /* Literal.String.Interpol */
.code-highlight .sx { color: #008000 } /* Literal.String.Other */
.code-highlight .sr { color: #A45A77 } /* Literal.String.Regex */
.code-highlight .s1 { color: #BA2121 } /* Literal.String.Single */
.code-highlight .ss { color: #19177C } /* Literal.String.Symbol */
.code-highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */
.code-highlight .fm { color: #0000FF } /* Name.Function.Magic */
.code-highlight .vc { color: #19177C } /* Name.Variable.Class */
.code-highlight .vg { color: #19177C } /* Name.Variable.Global */
.code-highlight .vi { color: #19177C } /* Name.Variable.Instance */
.code-highlight .vm { color: #19177C } /* Name.Variable.Magic */
.code-highlight .il { color: #666666 } /* Literal.Number.Integer.Long */
.code-highlight-dark(){
.code-highlight {
pre { line-height: 100%; }
td.linenos .normal { color: #3c4354; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: #3c4354; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #3c4354; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #3c4354; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.hll { background-color: #6e7681 }
.c { color: #7e8aa1 } /* Comment */
.err { color: #f88f7f } /* Error */
.esc { color: #d4d2c8 } /* Escape */
.g { color: #d4d2c8 } /* Generic */
.k { color: #FFAD66 } /* Keyword */
.l { color: #D5FF80 } /* Literal */
.n { color: #d4d2c8 } /* Name */
.o { color: #FFAD66 } /* Operator */
.x { color: #d4d2c8 } /* Other */
.p { color: #d4d2c8 } /* Punctuation */
.ch { color: #f88f7f; font-style: italic } /* Comment.Hashbang */
.cm { color: #7e8aa1 } /* Comment.Multiline */
.cp { color: #FFAD66; font-weight: bold } /* Comment.Preproc */
.cpf { color: #7e8aa1 } /* Comment.PreprocFile */
.c1 { color: #7e8aa1 } /* Comment.Single */
.cs { color: #7e8aa1; font-style: italic } /* Comment.Special */
.gd { color: #f88f7f; background-color: #3d1e20 } /* Generic.Deleted */
.ge { color: #d4d2c8; font-style: italic } /* Generic.Emph */
.ges { color: #d4d2c8 } /* Generic.EmphStrong */
.gr { color: #f88f7f } /* Generic.Error */
.gh { color: #d4d2c8 } /* Generic.Heading */
.gi { color: #6ad4af; background-color: #19362c } /* Generic.Inserted */
.go { color: #7e8aa1 } /* Generic.Output */
.gp { color: #d4d2c8 } /* Generic.Prompt */
.gs { color: #d4d2c8; font-weight: bold } /* Generic.Strong */
.gu { color: #d4d2c8 } /* Generic.Subheading */
.gt { color: #f88f7f } /* Generic.Traceback */
.kc { color: #FFAD66 } /* Keyword.Constant */
.kd { color: #FFAD66 } /* Keyword.Declaration */
.kn { color: #FFAD66 } /* Keyword.Namespace */
.kp { color: #FFAD66 } /* Keyword.Pseudo */
.kr { color: #FFAD66 } /* Keyword.Reserved */
.kt { color: #73D0FF } /* Keyword.Type */
.ld { color: #D5FF80 } /* Literal.Date */
.m { color: #DFBFFF } /* Literal.Number */
.s { color: #D5FF80 } /* Literal.String */
.na { color: #FFD173 } /* Name.Attribute */
.nb { color: #FFD173 } /* Name.Builtin */
.nc { color: #73D0FF } /* Name.Class */
.no { color: #FFD173 } /* Name.Constant */
.nd { color: #7e8aa1; font-weight: bold; font-style: italic } /* Name.Decorator */
.ni { color: #95E6CB } /* Name.Entity */
.ne { color: #73D0FF } /* Name.Exception */
.nf { color: #FFD173 } /* Name.Function */
.nl { color: #d4d2c8 } /* Name.Label */
.nn { color: #d4d2c8 } /* Name.Namespace */
.nx { color: #d4d2c8 } /* Name.Other */
.py { color: #FFD173 } /* Name.Property */
.nt { color: #5CCFE6 } /* Name.Tag */
.nv { color: #d4d2c8 } /* Name.Variable */
.ow { color: #FFAD66 } /* Operator.Word */
.pm { color: #d4d2c8 } /* Punctuation.Marker */
.w { color: #d4d2c8 } /* Text.Whitespace */
.mb { color: #DFBFFF } /* Literal.Number.Bin */
.mf { color: #DFBFFF } /* Literal.Number.Float */
.mh { color: #DFBFFF } /* Literal.Number.Hex */
.mi { color: #DFBFFF } /* Literal.Number.Integer */
.mo { color: #DFBFFF } /* Literal.Number.Oct */
.sa { color: #F29E74 } /* Literal.String.Affix */
.sb { color: #D5FF80 } /* Literal.String.Backtick */
.sc { color: #D5FF80 } /* Literal.String.Char */
.dl { color: #D5FF80 } /* Literal.String.Delimiter */
.sd { color: #7e8aa1 } /* Literal.String.Doc */
.s2 { color: #D5FF80 } /* Literal.String.Double */
.se { color: #95E6CB } /* Literal.String.Escape */
.sh { color: #D5FF80 } /* Literal.String.Heredoc */
.si { color: #95E6CB } /* Literal.String.Interpol */
.sx { color: #95E6CB } /* Literal.String.Other */
.sr { color: #95E6CB } /* Literal.String.Regex */
.s1 { color: #D5FF80 } /* Literal.String.Single */
.ss { color: #DFBFFF } /* Literal.String.Symbol */
.bp { color: #5CCFE6 } /* Name.Builtin.Pseudo */
.fm { color: #FFD173 } /* Name.Function.Magic */
.vc { color: #d4d2c8 } /* Name.Variable.Class */
.vg { color: #d4d2c8 } /* Name.Variable.Global */
.vi { color: #d4d2c8 } /* Name.Variable.Instance */
.vm { color: #d4d2c8 } /* Name.Variable.Magic */
.il { color: #DFBFFF } /* Literal.Number.Integer.Long */
}
}

View file

@ -55,121 +55,145 @@ searxng.ready(function () {
}
}, true);
var vimKeys = {
27: {
key: 'Escape',
// these bindings are always on
var keyBindings = {
'Escape': {
key: 'ESC',
fun: removeFocus,
des: 'remove focus from the focused input',
cat: 'Control'
},
73: {
'ArrowLeft': {
key: '⬅',
fun: highlightResult('up'),
des: 'Use left arrow to select previous search result',
cat: 'Results'
},
'ArrowRight': {
key: '➡',
fun: highlightResult('down'),
des: 'Use right arrow to select next search result',
cat: 'Results'
},
'h': {
key: 'h',
fun: toggleHelp,
des: 'toggle help window',
cat: 'Other'
},
'i': {
key: 'i',
fun: searchInputFocus,
des: 'focus on the search input',
cat: 'Control'
},
66: {
key: 'b',
fun: scrollPage(-window.innerHeight),
des: 'scroll one page up',
cat: 'Navigation'
},
70: {
key: 'f',
fun: scrollPage(window.innerHeight),
des: 'scroll one page down',
cat: 'Navigation'
},
85: {
key: 'u',
fun: scrollPage(-window.innerHeight / 2),
des: 'scroll half a page up',
cat: 'Navigation'
},
68: {
key: 'd',
fun: scrollPage(window.innerHeight / 2),
des: 'scroll half a page down',
cat: 'Navigation'
},
71: {
key: 'g',
fun: scrollPageTo(-document.body.scrollHeight, 'top'),
des: 'scroll to the top of the page',
cat: 'Navigation'
},
86: {
key: 'v',
fun: scrollPageTo(document.body.scrollHeight, 'bottom'),
des: 'scroll to the bottom of the page',
cat: 'Navigation'
},
75: {
key: 'k',
fun: highlightResult('up'),
des: 'select previous search result',
cat: 'Results'
},
74: {
key: 'j',
fun: highlightResult('down'),
des: 'select next search result',
cat: 'Results'
},
80: {
key: 'p',
fun: GoToPreviousPage(),
des: 'go to previous page',
cat: 'Results'
},
78: {
'n': {
key: 'n',
fun: GoToNextPage(),
des: 'go to next page',
cat: 'Results'
},
79: {
'o': {
key: 'o',
fun: openResult(false),
des: 'open search result',
cat: 'Results'
},
84: {
key: 't',
fun: openResult(true),
des: 'open the result in a new tab',
'p': {
key: 'p',
fun: GoToPreviousPage(),
des: 'go to previous page',
cat: 'Results'
},
82: {
'r': {
key: 'r',
fun: reloadPage,
des: 'reload page from the server',
cat: 'Control'
},
72: {
key: 'h',
fun: toggleHelp,
des: 'toggle help window',
cat: 'Other'
}
't': {
key: 't',
fun: openResult(true),
des: 'open the result in a new tab',
cat: 'Results'
},
}
// these bindings are enabled by user preferences
var vimKeys = {
'b': {
key: 'b',
fun: scrollPage(-window.innerHeight),
des: 'scroll one page up',
cat: 'Navigation'
},
'f': {
key: 'f',
fun: scrollPage(window.innerHeight),
des: 'scroll one page down',
cat: 'Navigation'
},
'u': {
key: 'u',
fun: scrollPage(-window.innerHeight / 2),
des: 'scroll half a page up',
cat: 'Navigation'
},
'd': {
key: 'd',
fun: scrollPage(window.innerHeight / 2),
des: 'scroll half a page down',
cat: 'Navigation'
},
'g': {
key: 'g',
fun: scrollPageTo(-document.body.scrollHeight, 'top'),
des: 'scroll to the top of the page',
cat: 'Navigation'
},
'v': {
key: 'v',
fun: scrollPageTo(document.body.scrollHeight, 'bottom'),
des: 'scroll to the bottom of the page',
cat: 'Navigation'
},
'k': {
key: 'k',
fun: highlightResult('up'),
des: 'select previous search result',
cat: 'Results'
},
'j': {
key: 'j',
fun: highlightResult('down'),
des: 'select next search result',
cat: 'Results'
},
};
if (searxng.settings.hotkeys) {
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();
if (e.keyCode === 27) {
vimKeys[e.keyCode].fun(e);
} else {
if (e.target === document.body || tagName === 'a' || tagName === 'button') {
e.preventDefault();
vimKeys[e.keyCode].fun();
}
// To add Vim-like key bindings, merge the 'vimKeys' into 'keyBindings'.
Object.assign(keyBindings, vimKeys);
}
searxng.on(document, "keydown", function (e) {
// check for modifiers so we don't break browser's hotkeys
if (
Object.prototype.hasOwnProperty.call(keyBindings, e.key)
&& !e.ctrlKey && !e.altKey
&& !e.shiftKey && !e.metaKey
) {
var tagName = e.target.tagName.toLowerCase();
if (e.key === 'Escape') {
keyBindings[e.key].fun(e);
} else {
if (e.target === document.body || tagName === 'a' || tagName === 'button') {
e.preventDefault();
keyBindings[e.key].fun();
}
}
});
}
}
});
function highlightResult (which) {
return function (noScroll, keepFocus) {
@ -189,6 +213,7 @@ searxng.ready(function () {
}
var next, results = document.querySelectorAll('.result');
results = Array.from(results); // convert NodeList to Array for further use
if (typeof effectiveWhich !== 'string') {
next = effectiveWhich;
@ -209,16 +234,10 @@ searxng.ready(function () {
}
break;
case 'down':
next = current.nextElementSibling;
if (next === null) {
next = results[0];
}
next = results[results.indexOf(current) + 1] || current;
break;
case 'up':
next = current.previousElementSibling;
if (next === null) {
next = results[results.length - 1];
}
next = results[results.indexOf(current) - 1] || current;
break;
case 'bottom':
next = results[results.length - 1];
@ -347,8 +366,8 @@ searxng.ready(function () {
function initHelpContent (divElement) {
var categories = {};
for (var k in vimKeys) {
var key = vimKeys[k];
for (var k in keyBindings) {
var key = keyBindings[k];
categories[key.cat] = categories[key.cat] || [];
categories[key.cat].push(key);
}
@ -362,7 +381,7 @@ searxng.ready(function () {
}
var html = '<a href="#" class="close" aria-label="close" title="close">×</a>';
html += '<h3>How to navigate searx with Vim-like hotkeys</h3>';
html += '<h3>How to navigate SearXNG with hotkeys</h3>';
html += '<table>';
for (var i = 0; i < sorted.length; i++) {
@ -404,8 +423,6 @@ searxng.ready(function () {
helpPanel.id = 'vim-hotkeys-help';
helpPanel.className = 'dialog-modal';
initHelpContent(helpPanel);
initHelpContent(helpPanel);
initHelpContent(helpPanel);
var body = document.getElementsByTagName('body')[0];
body.appendChild(helpPanel);
} else {

View file

@ -1,9 +1,51 @@
.code-highlight pre {
overflow: auto;
background-color: inherit;
color: inherit;
border: inherit;
@import "../generated/pygments.less";
.codelines {
margin: @results-margin 0 0 0;
padding: @result-padding 0 0 0;
}
// stylelint-disable no-invalid-position-at-import-rule
@import "../generated/pygments.less";
.code-highlight-sxng() {
.code-highlight {
pre {
overflow: auto;
margin: 0;
padding: 0 0 0.75rem 0;
}
.linenos {
user-select: none;
cursor: default;
&::selection {
background: transparent; /* WebKit/Blink Browsers */
}
&::-moz-selection {
background: transparent; /* Gecko Browsers */
}
margin-right: 8px;
text-align: right;
}
span.linenos {
color: #64708d;
}
}
}
.code-highlight-sxng();
/// Dark Theme (autoswitch based on device pref)
@media (prefers-color-scheme: dark) {
:root.theme-auto {
.code-highlight-dark();
.code-highlight-sxng();
}
}
// Dark Theme by preferences
:root.theme-dark {
.code-highlight-dark();
.code-highlight-sxng();
}

View file

@ -78,7 +78,7 @@
/// Settings Colors
--color-settings-tr-hover: #ebebeb;
--color-settings-engine-description-font: #545454;
--color-settings-engine-group-background: #0001;
--color-settings-table-group-background: #0001;
/// Detail modal
--color-result-detail-font: #fff;
--color-result-detail-label-font: lightgray;
@ -198,7 +198,7 @@
/// Settings Colors
--color-settings-tr-hover: #2c2c32;
--color-settings-engine-description-font: darken(#dcdcdc, 30%);
--color-settings-engine-group-background: #1b1b21;
--color-settings-table-group-background: #1b1b21;
/// Toolkit Colors
--color-toolkit-badge-font: #fff;
--color-toolkit-badge-background: #555;

View file

@ -1,7 +1,18 @@
#tab-content-query table td,
#tab-content-query table th {
.ltr-text-align-right() !important;
height: 3rem;
table {
border-collapse: collapse;
th,
td {
text-align: center;
padding: 1rem 0.5rem;
.ltr-text-align-left();
}
tr.pref-group th {
font-weight: normal;
.ltr-text-align-left();
background: var(--color-settings-table-group-background);
}
}
#main_preferences {
@ -81,14 +92,6 @@
border: 0 none;
}
table {
border-collapse: collapse;
}
table td {
text-align: center;
}
.category {
.ltr-margin-right(0.5rem);
@ -104,10 +107,6 @@
}
table.table_engines {
td {
height: 3.75rem;
}
th.name {
/* stylelint-disable */
label {
@ -130,12 +129,7 @@
}
}
.engine-group {
.ltr-text-align-left();
font-weight: normal;
background: var(--color-settings-engine-group-background);
}
.checkbox-col,
.name,
.shortcut {
.ltr-text-align-left();

View file

@ -64,6 +64,8 @@ html {
background-color: var(--color-base-background);
padding: 0;
margin: 0;
scroll-behavior: smooth;
}
body,
@ -634,6 +636,18 @@ summary.title {
span {
overflow-wrap: anywhere;
}
.answer {
display: flex;
flex-direction: column;
}
.answer-url {
margin-left: auto;
margin-top: 5px;
margin-right: 10px;
margin-bottom: 10px;
}
}
#infoboxes {
@ -793,6 +807,7 @@ summary.title {
.ltr-left(@results-width + @results-offset + (0.5 * @results-gap - 1.2em));
transition: opacity 0.5s;
opacity: 0;
pointer-events: none;
.rounded-corners;
a {
@ -811,6 +826,7 @@ summary.title {
#results.scrolling #backToTop {
opacity: 1;
pointer-events: all;
}
/*

View file

@ -52,33 +52,12 @@
</article>
{%- endmacro -%}
<!-- -->
{%- macro tabs_open() -%}
<div class="tabs" role="tablist">
{%- endmacro -%}
{%- macro tab_header(name, id, label, checked) -%}
<input type="radio" name="{{ name }}" id="tab-{{ id }}" {% if checked is sameas true %}checked="checked"{% endif %} />
<label id="tab-label-{{ label }}" for="tab-{{ id }}" role="tab" aria-controls="tab-content-{{ id }}">{{ label }}</label>
<section id="tab-content-{{ id }}" role="tabpanel" aria-labelledby="tab-label-{{ label }}" aria-hidden="false">
{%- endmacro -%}
{%- macro tab_footer() -%}
</section>
{%- endmacro -%}
{%- macro tabs_close() -%}
</div>
{%- endmacro -%}
<!-- input checkbox, on/off slider user can tap-->
{%- macro checkbox_onoff(name, checked) -%}
<input type="checkbox" name="{{ name }}" id="{{ name }}" value="None" class="checkbox-onoff" {% if checked %}checked{% endif %} />
{%- endmacro -%}
{%- macro checkbox(name, checked, disabled) -%}
{%- if checked == '?' -%}
{{- icon_small('warning') -}}
{%- else -%}
<input type="checkbox"{% if name %} name="{{ name }}"{% endif %} value="None"{% if checked %} checked{% endif %}{% if disabled %} disabled{% endif %} />
{%- endif -%}
<input type="checkbox" {{- ' ' -}}
name="{{ name }}" {{- ' ' -}}
id="{{ name }}" {{- ' ' -}}
aria-labelledby="pref_{{ name }}"{{- ' ' -}}
class="checkbox-onoff"{{- ' ' -}}
{%- if checked -%} checked{%- endif -%}/>
{%- endmacro -%}

View file

@ -1,4 +1,4 @@
{%- from 'beetroot/icons.html' import icon_big -%}
{%- from 'beetroot/icons.html' import icon_small, icon_big -%}
{%- extends "beetroot/page_with_header.html" -%}
{%- macro tabs_open() -%}

View file

@ -8,14 +8,15 @@
<th>{{ _('Examples') }}</th>{{- '' -}}
</tr>{{- '' -}}
<td></td>{{- '' -}}
<th scope="colgroup" colspan="4">
{{- _("This is the list of SearXNG's instant answering modules.") -}}
</th>
<tr class="pref-group" >{{- '' -}}
<th scope="colgroup" colspan="5">
{{- _("This is the list of SearXNG's instant answering modules.") -}}
</th>{{- '' -}}
</tr>
{%- for answerer in answerers -%}
<tr>{{- '' -}}
<td></td>{{- '' -}}
<td class="checkbox-col"></td>{{- '' -}}
<td>{{ answerer.keywords|join(', ') }}</td>{{- '' -}}
<td>{{ answerer.info.name }}</td>{{- '' -}}
<td>{{ answerer.info.description }}</td>{{- '' -}}
@ -23,15 +24,16 @@
</tr>
{%- endfor -%}
<td></td>{{- '' -}}
<th scope="colgroup" colspan="4">
{{- _('This is the list of plugins.') -}}
</th>{{- '' -}}
<tr class="pref-group" >{{- '' -}}
<th scope="colgroup" colspan="5">
{{- _('This is the list of plugins.') -}}
</th>{{- '' -}}
</th>
{%- for plugin in plugins -%}
{%- if plugin.preference_section == 'query' -%}
<tr>{{- '' -}}
<td>{{- checkbox_onoff_reversed('plugin_' + plugin.id, plugin.id not in allowed_plugins) -}}</td>{{- '' -}}
<td class="checkbox-col">{{- checkbox_onoff_reversed('plugin_' + plugin.id, plugin.id not in allowed_plugins) -}}</td>{{- '' -}}
<td>{{ plugin.query_keywords|join(', ') }}</td>{{- '' -}}
<td>{{ _(plugin.name) }}</td>{{- '' -}}
<td>{{ _(plugin.description) }}</td>{{- '' -}}

View file

@ -1,10 +1,14 @@
<fieldset>{{- '' -}}
<legend id="pref_center_alignment">{{ _('Center Alignment') }}</legend>{{- '' -}}
<p class="value">{{- '' -}}
<select name="center_alignment" aria-labelledby="pref_center_alignment">{{- '' -}}
<option value="1" {% if preferences.get_value('center_alignment') %}selected="selected"{% endif %}>{{ _('On') }}</option>{{- '' -}}
<option value="0" {% if not preferences.get_value('center_alignment') %}selected="selected"{% endif %}>{{ _('Off')}}</option>{{- '' -}}
</select>{{- '' -}}
<input type="checkbox" {{- ' ' -}}
name="center_alignment" {{- ' ' -}}
aria-labelledby="pref_center_alignment" {{- ' ' -}}
class="checkbox-onoff" {{- ' ' -}}
{%- if preferences.get_value('center_alignment') -%}
checked
{%- endif -%}{{- ' ' -}}
/>{{- '' -}}
</p>{{- '' -}}
<div class="description">
{{- _('Displays results in the center of the page (Oscar layout).') -}}

View file

@ -14,12 +14,13 @@
<table class="striped table_engines">{{- '' -}}
<tr>{{- '' -}}
<th class="engine_checkbox">{{- _("Allow") -}}</th>{{- '' -}}
<th class="checkbox-col">{{- _("Allow") -}}</th>{{- '' -}}
<th class="name">{{- _("Engine name") -}}</th>{{- '' -}}
<th class="shortcut">{{ _("!bang") -}}</th>{{- '' -}}
<th>{{- _("Supports selected language") -}}</th>{{- '' -}}
<th>{{- _("SafeSearch") -}}</th>{{- '' -}}
<th>{{- _("Time range") -}}</th>{{- '' -}}
<th>{{- _("Weight") }}</th>
{%- if enable_metrics -%}
<th>{{- _("Response time") -}}</th>
{%- endif -%}
@ -32,9 +33,9 @@
{%- for group, group_bang, engines in engines_by_category[categ] | group_engines_in_tab -%}
{%- if loop.length > 1 -%}
<tr>{{- '' -}}
<th class="engine-group" colspan="2">{{- _(group) -}}</th>{{- '' -}}
<th class="engine-group" colspan="7">
<tr class="pref-group" >{{- '' -}}
<th colspan="2">{{- _(group) -}}</th>{{- '' -}}
<th colspan="8">
{%- if group_bang -%}
<span class="bang">{{- group_bang -}}</span>
{%- endif -%}</th>{{- '' -}}
@ -72,6 +73,7 @@
<td>
{{- checkbox(None, supports[search_engine.name]['time_range_support'], true) -}}
</td>{{- '' -}}
<td>{{- search_engine.weight or '1.0' -}}</td>{{- '' -}}
{%- if enable_metrics -%}
{{- engine_time(search_engine.name) -}}
{%- endif -%}

View file

@ -1,11 +1,15 @@
<fieldset>{{- '' -}}
<legend id="pref_image_proxy">{{ _('Image proxy') }}</legend>{{- '' -}}
<p class="value">{{- '' -}}
<select name='image_proxy' aria-labelledby="pref_image_proxy">{{- '' -}}
<option value="1" {% if image_proxy %}selected="selected"{% endif %}>{{ _('Enabled') }}</option>{{- '' -}}
<option value="0" {% if not image_proxy %}selected="selected"{% endif %}>{{ _('Disabled') }}</option>{{- '' -}}
</select>{{- '' -}}
</p>
<input type="checkbox" {{- ' ' -}}
name="image_proxy" {{- ' ' -}}
aria-labelledby="pref_image_proxy" {{- ' ' -}}
class="checkbox-onoff" {{- ' ' -}}
{%- if preferences.get_value('image_proxy') -%}
checked
{%- endif -%}{{- ' ' -}}
/>{{- '' -}}
</p>{{- '' -}}
<div class="description">
{{- _('Proxying image results through SearXNG') -}}
</div>{{- '' -}}

View file

@ -1,10 +1,14 @@
<fieldset>{{- '' -}}
<legend>{{ _('Infinite scroll') }}</legend>{{- '' -}}
<p class="value">{{- '' -}}
<select name='infinite_scroll'>{{- '' -}}
<option value="1" {% if infinite_scroll %}selected="selected"{% endif %}>{{ _('On') }}</option>{{- '' -}}
<option value="0" {% if not infinite_scroll %}selected="selected"{% endif %}>{{ _('Off')}}</option>{{- '' -}}
</select>{{- '' -}}
<input type="checkbox" {{- ' ' -}}
name="infinite_scroll" {{- ' ' -}}
aria-labelledby="pref_infinite_scroll" {{- ' ' -}}
class="checkbox-onoff" {{- ' ' -}}
{%- if preferences.get_value('infinite_scroll') -%}
checked
{%- endif -%}{{- ' ' -}}
/>{{- '' -}}
</p>{{- '' -}}
<div class="description">
{{- _('Automatically load next page when scrolling to bottom of current page') -}}

View file

@ -1,10 +1,14 @@
<fieldset>{{- '' -}}
<legend id="pref_query_in_title">{{ _("Query in the page's title") }}</legend>
<legend id="pref_query_in_title">{{ _("Query in the page's title") }}</legend>{{- '' -}}
<p class="value">{{- '' -}}
<select name='query_in_title' aria-labelledby="pref_query_in_title">{{- '' -}}
<option value="1" {% if query_in_title %}selected="selected"{% endif %}>{{ _('Enabled') }}</option>{{- '' -}}
<option value="0" {% if not query_in_title %}selected="selected"{% endif %}>{{ _('Disabled') }}</option>{{- '' -}}
</select>{{- '' -}}
<input type="checkbox" {{- ' ' -}}
name="query_in_title" {{- ' ' -}}
aria-labelledby="pref_query_in_title" {{- ' ' -}}
class="checkbox-onoff" {{- ' ' -}}
{%- if preferences.get_value('query_in_title') -%}
checked
{%- endif -%}{{- ' ' -}}
/>{{- '' -}}
</p>{{- '' -}}
<div class="description">
{{- _("When enabled, the result page's title contains your query. Your browser can record this title") -}}

View file

@ -1,10 +1,14 @@
<fieldset>{{- '' -}}
<legend id="pref_results_on_new_tab">{{ _('Results on new tabs') }}</legend>{{- '' -}}
<p class="value">{{- '' -}}
<select name='results_on_new_tab' aria-labelledby="pref_results_on_new_tab">{{- '' -}}
<option value="1" {% if results_on_new_tab %}selected="selected"{% endif %}>{{ _('On') }}</option>{{- '' -}}
<option value="0" {% if not results_on_new_tab %}selected="selected"{% endif %}>{{ _('Off')}}</option>{{- '' -}}
</select>{{- '' -}}
<input type="checkbox" {{- ' ' -}}
name="results_on_new_tab" {{- ' ' -}}
aria-labelledby="pref_results_on_new_tab" {{- ' ' -}}
class="checkbox-onoff" {{- ' ' -}}
{%- if preferences.get_value('results_on_new_tab') -%}
checked
{%- endif -%}{{- ' ' -}}
/>{{- ' ' -}}
</p>{{- '' -}}
<div class="description">
{{- _('Open result links on new browser tabs') -}}

View file

@ -2,12 +2,31 @@
{{ result_header(result, favicons, image_proxify) -}}
{{- result_sub_header(result) -}}
{%- if result.content %}{{ result.content|safe }}{% endif %}</p>
{%- if result.repository -%}
<p class="content"><a href="{{ result.repository|safe }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ result.repository }}</a></p>
{%- if result.content -%}
<p class="content">
{{- result.content|safe -}}
</p>
{%- endif -%}
{%- if result.repository -%}
<p class="content">{{- '' -}}
{{ _('repo') }}: {{- ' ' -}}
<a href="{{ result.repository|safe }}"{{- ' ' -}}
{% if results_on_new_tab %}
target="_blank" {{- ' ' -}}
rel="noopener noreferrer"
{%- else -%}
rel="noreferrer"
{%- endif -%}
>
{{- result.repository -}}
</a>{{- '' -}}
</p>
{%- endif -%}
<div dir="ltr" class="codelines">
{{- result.codelines|code_highlighter(result.code_language)|safe -}}
</div>{{- '' -}}
</div>
{{- result_sub_footer(result, proxify) -}}
{{ result_footer(result) }}
{{- result_footer(result) -}}

View file

@ -23,11 +23,10 @@
<div id="answers" role="complementary" aria-labelledby="answers-title"><h4 class="title" id="answers-title">{{ _('Answers') }} : </h4>
{%- for answer in answers.values() -%}
<div class="answer">
{% if answer.url %}
<a href="{{ answer.url }}">{{ answer.answer }}</a>
{% else %}
<span>{{ answer.answer }}</span>
{% endif %}
<span>{{ answer.answer }}</span>
{% if answer.url -%}
<a href="{{ answer.url }}" class="answer-url">{{ urlparse(answer.url).hostname }}</a>
{% endif -%}
</div>
{%- endfor -%}
</div>