6 Commits

Author SHA1 Message Date
Bnyro
15b6830089 [build] /static 2025-01-07 14:51:07 +01:00
Bnyro
e352e7611a [chore] stylelint: fix reported errors 2025-01-07 14:51:07 +01:00
Bnyro
7509b02559 [upd] stylelint: use less-compatible configuration and update rules 2025-01-07 14:51:00 +01:00
Markus Heiser
2497b94187 [fix] issues reported by sytlelint
"Unexpected vendor-prefixed":
   -webkit-transform & -ms-transform [3]
   -webkit-animation [2]
   @-webkit-keyframes [1]

[1] https://developer.mozilla.org/en-US/docs/Web/CSS/@keyframes
[2] https://developer.mozilla.org/en-US/docs/Web/CSS/animation
[3] https://developer.mozilla.org/en-US/docs/Web/CSS/transform

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-01-03 07:57:06 +01:00
Markus Heiser
76f423785d [upd] migrate .eslintrc.json to eslint.config.mjs
The migration was done by the following steps, firts prepare the node enviroment
an open a bash in this environment::

    $ make clean nvm.nodejs
    ...
    $ ./manage nvm.bash
    $ which npx
    searxng/.nvm/versions/node/v23.5.0/bin/npx

In this environment the migration command from [1] is started::

    $ npx @eslint/migrate-config .eslintrc.json
    Need to install the following packages:
    @eslint/migrate-config@1.3.5
    Migrating .eslintrc.json

    Wrote new config to ./eslint.config.mjs

    You will need to install the following packages to use the new config:
    - globals
    - @eslint/js
    - @eslint/eslintrc

    You can install them using the following command:

    npm install globals @eslint/js @eslint/eslintrc -D

    The following messages were generated during migration:
    - The 'node' environment is used, so switching sourceType to 'commonjs'.

[1] https://eslint.org/docs/latest/use/configure/migration-guide#migrate-your-config-file

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-01-02 08:58:32 +01:00
Markus Heiser
7e30ec47bf [upd] update npm dependencies (package.json) and .tool-versions
To avoid issue like [1], versions from now on are pinned in::

    searx/static/themes/simple/package-lock.json

To test nodejs v23 or newer is needed (will be installed by nvm).  To drop a
possibly existing installation::

    $ make clean

Install nodejs in nvm::

    $ make nvm.nodejs
    INFO:  install (update) NVM at searxng/.nvm
    ...
    Now using node v23.5.0 (npm v10.9.2)
    Creating default alias: default -> v23.5 (-> v23.5.0)
    INFO:  Node.js is installed at searxng/.nvm/versions/node/v23.5.0/bin/node
    INFO:  Node.js is version v23.5.0
    INFO:  npm is installed at searxng/.nvm/versions/node/v23.5.0/bin/npm
    INFO:  npm is version 10.9.2
    INFO:  NVM is installed at searxng/.nvm

To test npm checks and builds:

    $ make static.build.commit

Related:

[1] https://github.com/searxng/searxng/issues/4143

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-01-02 08:32:33 +01:00
21 changed files with 9841 additions and 136 deletions

2
.nvmrc
View File

@@ -1 +1 @@
v20.10
v23.5

View File

@@ -1,2 +1,4 @@
python 3.12.0
shellcheck 0.9.0
nodejs 23.5.0
python 3.13.1
shellcheck 0.10.0
sqlite 3.47.2

View File

@@ -1,7 +1,7 @@
{
"dependencies": {
"eslint": "^9.0.0",
"pyright": "^1.1.329"
"eslint": "^9.17.0",
"pyright": "^1.1.391"
},
"scripts": {
"clean": "rm -Rf node_modules package-lock.json"

View File

@@ -1,28 +0,0 @@
{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 12
},
"rules": {
"indent": ["error", 2],
"keyword-spacing": ["error", { "before": true, "after": true }],
"no-trailing-spaces": 2,
"space-before-function-paren": ["error", "always"],
"space-infix-ops": "error",
"comma-spacing": ["error", { "before": false, "after": true }],
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"curly": ["error", "multi-line"],
"block-spacing": ["error", "always"],
"dot-location": ["error", "property"],
"key-spacing": ["error", { "beforeColon": false, "afterColon": true }],
"spaced-comment": ["error", "always", {
"line": { "markers": ["*package", "!", "/", ",", "="] },
"block": { "balanced": true, "markers": ["*package", "!", ",", ":", "::", "flow-include"], "exceptions": ["*"] }
}]
}
}

View File

@@ -1,2 +1 @@
/node_modules
package-lock.json

View File

@@ -1,7 +1,14 @@
{
"extends": "stylelint-config-standard",
"extends": "stylelint-config-standard-less",
"rules": {
"declaration-empty-line-before": null,
"no-invalid-position-at-import-rule": null
"no-invalid-position-at-import-rule": null,
"property-no-vendor-prefix": null,
"selector-no-vendor-prefix": null,
"selector-attribute-quotes": null,
"shorthand-property-no-redundant-values": null,
"at-rule-no-vendor-prefix": null,
"selector-id-pattern": null,
"selector-class-pattern": null
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,68 @@
import globals from "globals";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});
export default [...compat.extends("eslint:recommended"), {
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
ecmaVersion: 12,
sourceType: "commonjs",
},
rules: {
indent: ["error", 2],
"keyword-spacing": ["error", {
before: true,
after: true,
}],
"no-trailing-spaces": 2,
"space-before-function-paren": ["error", "always"],
"space-infix-ops": "error",
"comma-spacing": ["error", {
before: false,
after: true,
}],
"brace-style": ["error", "1tbs", {
allowSingleLine: true,
}],
curly: ["error", "multi-line"],
"block-spacing": ["error", "always"],
"dot-location": ["error", "property"],
"key-spacing": ["error", {
beforeColon: false,
afterColon: true,
}],
"spaced-comment": ["error", "always", {
line: {
markers: ["*package", "!", "/", ",", "="],
},
block: {
balanced: true,
markers: ["*package", "!", ",", ":", "::", "flow-include"],
exceptions: ["*"],
},
}],
},
}];

View File

@@ -35,7 +35,7 @@ module.exports = function (grunt) {
},
eslint: {
options: {
overrideConfigFile: '.eslintrc.json',
overrideConfigFile: 'eslint.config.mjs',
failOnError: true,
fix: grunt.option('fix')
},

File diff suppressed because it is too large Load Diff

View File

@@ -1,28 +1,29 @@
{
"devDependencies": {
"eslint": "^9.0.0",
"grunt": "~1.6.1",
"ejs": "^3.1.10",
"eslint": "^9.17.0",
"grunt": "^1.6.1",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-cssmin": "^5.0.0",
"grunt-contrib-less": "~3.0.0",
"grunt-contrib-uglify": "~5.2.1",
"grunt-xmlmin": "~0.1.8",
"grunt-contrib-watch": "~1.1.0",
"grunt-eslint": "^24.0.0",
"grunt-stylelint": "^0.16.0",
"grunt-contrib-less": "^3.0.0",
"grunt-contrib-uglify": "^5.2.2",
"grunt-contrib-watch": "^1.1.0",
"grunt-eslint": "^25.0.0",
"grunt-image": "^6.4.0",
"ionicons": "^7.1.0",
"less": "^4.1.3",
"less-plugin-clean-css": "^1.5.1",
"sharp": "^0.33.0",
"stylelint": "^13.13.1",
"stylelint-config-standard": "^22.0.0",
"ejs": "^3.1.8",
"svgo": "^3.0.0"
"grunt-stylelint": "^0.20.1",
"grunt-xmlmin": "^0.1.8",
"ionicons": "^7.4.0",
"less": "^4.2.1",
"less-plugin-clean-css": "^1.6.0",
"sharp": "^0.33.5",
"stylelint": "^16.12.0",
"stylelint-config-standard": "^36.0.0",
"stylelint-config-standard-less": "^3.0.1",
"svgo": "^3.3.2"
},
"dependencies": {
"autocomplete-js": "2.7.1",
"leaflet": "^1.8.0",
"autocomplete-js": "^2.7.1",
"leaflet": "^1.9.4",
"normalize.css": "^8.0.1"
},
"scripts": {
@@ -32,7 +33,7 @@
"eslint": "grunt eslint",
"eslint-fix": "grunt eslint --fix",
"watch": "grunt watch",
"clean": "rm -Rf node_modules package-lock.json",
"clean": "rm -Rf node_modules",
"stylelint": "grunt stylelint",
"stylelint-fix": "grunt stylelint --fix"
}

View File

@@ -85,8 +85,8 @@
--color-result-detail-background: #242424;
--color-result-detail-hr: #555;
--color-result-detail-link: #8af;
--color-result-detail-loader-border: rgba(255, 255, 255, 0.2);
--color-result-detail-loader-borderleft: rgba(0, 0, 0, 0);
--color-result-detail-loader-border: rgb(255 255 255 / 20%);
--color-result-detail-loader-borderleft: rgb(0 0 0 / 0%);
/// Toolkit Colors
--color-toolkit-badge-font: #fff;
--color-toolkit-badge-background: #545454;
@@ -111,16 +111,16 @@
--color-toolkit-checkbox-input-border: #3050ff;
--color-toolkit-engine-tooltip-border: #ddd;
--color-toolkit-engine-tooltip-background: #fff;
--color-toolkit-loader-border: rgba(0, 0, 0, 0.2);
--color-toolkit-loader-borderleft: rgba(255, 255, 255, 0);
--color-toolkit-loader-border: rgb(0 0 0 / 20%);
--color-toolkit-loader-borderleft: rgb(255 255 255 / 0%);
--color-doc-code: #003;
--color-doc-code-background: #ddeaff;
/// Other misc colors
--color-bar-chart-primary: #5bc0de;
--color-bar-chart-secondary: #deb15b;
--color-image-resolution-background: rgba(0, 0, 0, 50%);
--color-image-resolution-background: rgb(0 0 0 / 50%);
--color-image-resolution-font: #fff;
--color-loading-indicator: rgba(255, 255, 255, 0.2);
--color-loading-indicator: rgb(255 255 255 / 20%);
--color-loading-indicator-gap: #fff;
--color-line-number: #64708d;
// Favicons Colors
@@ -200,8 +200,8 @@
--color-result-detail-background: #1a1a1c;
--color-result-detail-hr: #555;
--color-result-detail-link: #8af;
--color-result-detail-loader-border: rgba(255, 255, 255, 0.2);
--color-result-detail-loader-borderleft: rgba(0, 0, 0, 0);
--color-result-detail-loader-border: rgb(255 255 255 / 20%);
--color-result-detail-loader-borderleft: rgb(0 0 0 / 0%);
// Images Colors
--color-result-image-span-font: #bbb;
--color-result-image-span-font-selected: #222;
@@ -234,8 +234,8 @@
--color-toolkit-checkbox-input-border: #58f;
--color-toolkit-engine-tooltip-border: #333;
--color-toolkit-engine-tooltip-background: #222;
--color-toolkit-loader-border: rgba(255, 255, 255, 0.2);
--color-toolkit-loader-borderleft: rgba(0, 0, 0, 0);
--color-toolkit-loader-border: rgb(255 255 255 / 20%);
--color-toolkit-loader-borderleft: rgb(0 0 0 / 0%);
--color-doc-code: #ddd;
--color-doc-code-background: #4d5a6f;
// Favicons Colors

View File

@@ -93,8 +93,7 @@ article.result-images .detail {
p.result-url {
white-space: nowrap;
overflow-x: hidden;
overflow-y: hidden;
overflow: hidden hidden;
text-overflow: ellipsis;
}

View File

@@ -15,8 +15,7 @@
background: var(--color-header-background);
border-bottom: 1px solid var(--color-header-border);
display: grid;
column-gap: 1.2rem;
row-gap: 1rem;
gap: 1rem 1.2rem;
grid-template-columns: 3rem 1fr;
grid-template-areas:
"logo search"
@@ -268,8 +267,7 @@ html.no-js #clear_search.hide_if_nojs {
#categories {
width: 100%;
.ltr-text-align-left();
overflow-x: scroll;
overflow-y: hidden;
overflow: scroll hidden;
-webkit-overflow-scrolling: touch;
}
}
@@ -280,8 +278,7 @@ html.no-js #clear_search.hide_if_nojs {
width: 100%;
margin: 0;
padding: 0.1rem 0 0 0;
column-gap: 0;
row-gap: 0;
gap: 0 0;
grid-template-areas:
"logo search"
"categories categories";

View File

@@ -14,7 +14,7 @@ on the /search URL and when the "center alignment" preference is enabled.
}
}
@media screen and (min-width: 62rem) {
@media screen and (width >= 62rem) {
.center-alignment-yes #main_results {
--center-page-width: 60rem;
}
@@ -91,7 +91,7 @@ on the /search URL and when the "center alignment" preference is enabled.
align-self: flex-start;
}
&:not(.only_template_images):not(.image-detail-open) {
&:not(.only_template_images, .image-detail-open) {
// the gap is set in style.less
.ltr-margin-left(1.5rem);
grid-template-columns: calc(var(--center-page-width) - @results-gap - @results-sidebar-width) @results-sidebar-width;

View File

@@ -244,9 +244,8 @@ article[data-vim-selected].category-social {
align-items: center;
font-size: 1rem;
color: var(--color-result-url-font);
flex-wrap: nowrap;
flex-flow: row nowrap;
overflow: hidden;
flex-direction: row;
margin: 0;
padding: 0;
@@ -269,9 +268,7 @@ article[data-vim-selected].category-social {
.url_o2 {
overflow: hidden;
white-space: nowrap;
flex-basis: content;
flex-grow: 0;
flex-shrink: 1;
flex: 0 1 content;
text-align: right;
padding-bottom: 1px;
@@ -546,14 +543,8 @@ article[data-vim-selected].category-social {
margin-bottom: 0;
.ltr-margin-left(@results-offset);
display: grid;
grid-template-columns: @results-width @results-sidebar-width;
grid-template-rows: min-content min-content 1fr min-content;
grid-template: "corrections sidebar" min-content "answers sidebar" min-content "urls sidebar" 1fr "pagination sidebar" min-content / @results-width @results-sidebar-width;
gap: 0 @results-gap;
grid-template-areas:
"corrections sidebar"
"answers sidebar"
"urls sidebar"
"pagination sidebar";
}
#results #sidebar *:first-child {
@@ -676,10 +667,7 @@ summary.title {
}
.answer-url {
margin-left: auto;
margin-top: 5px;
margin-right: 10px;
margin-bottom: 10px;
margin: 5px 10px 10px auto;
}
}
@@ -979,19 +967,12 @@ summary.title {
margin: 0 auto;
justify-content: center;
display: grid;
grid-template-columns: @results-width;
grid-template-rows: min-content min-content min-content 1fr min-content min-content;
grid-template: "corrections" min-content "answers" min-content "sidebar" min-content "urls" 1fr "pagination" min-content min-content / @results-width;
gap: 0;
grid-template-areas:
"corrections"
"answers"
"sidebar"
"urls"
"pagination";
}
}
@media screen and (max-width: calc(@tablet - 0.5px)) {
@media screen and (width <= calc(@tablet - 0.5px)) {
#links_on_top {
span {
display: none;
@@ -999,7 +980,7 @@ summary.title {
}
}
@media screen and (max-width: 52rem) {
@media screen and (width <= 52rem) {
body.results_endpoint {
#links_on_top {
.link_on_top_about,
@@ -1024,15 +1005,8 @@ summary.title {
#main_results div#results.only_template_images {
margin: 1rem @results-tablet-offset 0 @results-tablet-offset;
display: grid;
grid-template-columns: 100%;
grid-template-rows: min-content min-content min-content 1fr min-content;
grid-template: "corrections" min-content "answers" min-content "sidebar" min-content "urls" 1fr "pagination" min-content / 100%;
gap: 0;
grid-template-areas:
"corrections"
"answers"
"sidebar"
"urls"
"pagination";
#sidebar {
display: none;

View File

@@ -217,8 +217,7 @@ div.selectable_url {
//
.scrollx {
overflow-x: auto;
overflow-y: hidden;
overflow: auto hidden;
display: block;
padding: 0;
margin: 0;
@@ -505,7 +504,7 @@ input.checkbox-onoff.reversed-checkbox[type="checkbox"] {
}
// if not checked and possible to checked then display a "light" check mark on hover
input.checkbox[type=checkbox]:not(:checked):not([disabled]):not(.checkbox-onoff):hover::after {
input.checkbox[type=checkbox]:not(:checked, [disabled], .checkbox-onoff):hover::after {
opacity: 0.5;
}
}
@@ -593,8 +592,7 @@ td:hover .engine-tooltip,
width: -moz-available;
width: -webkit-fill-available;
width: fill;
flex-direction: row;
flex-wrap: nowrap;
flex-flow: row nowrap;
align-items: center;
display: inline-flex;
}

View File

@@ -14,33 +14,16 @@
border-right: 1.1em solid var(--color-loading-indicator);
border-bottom: 1.1em solid var(--color-loading-indicator);
border-left: 1.1em solid var(--color-loading-indicator-gap);
-webkit-transform: translateZ(0);
-ms-transform: translateZ(0);
transform: translateZ(0);
-webkit-animation: load8 1.1s infinite linear;
animation: load8 1.1s infinite linear;
}
@-webkit-keyframes load8 {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes load8 {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}