From 189dd0155df60c98b5d7de73b873c8ad444ff931 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Tue, 4 Feb 2025 15:59:02 +0100 Subject: [PATCH] [web-client] simple theme: refactor jinja_svg_catalog and cleanup icon names This patch implements the template generation of the template: searx/templates/simple/icons.html by the way the icon set (the icon names) has been normalized: film-outline --> film magnet-outline --> magnet .. warning --> alert Some missing (categorie) icons had been added. Some of the ionicons are not suitable for a dark theme, we fixed the svg manually in src/svg/ionicons: - https://github.com/searxng/searxng/pull/4284#issuecomment-2680550342 Signed-off-by: Markus Heiser --- client/simple/package-lock.json | 711 +++++++++--------- client/simple/package.json | 5 +- .../src/svg/information-circle-outline.svg | 6 - .../ionicons/information-circle-outline.svg | 6 + .../src/svg/ionicons/newspaper-outline.svg | 6 + client/simple/theme_icons.js | 80 ++ .../simple/tools/jinja_svg_catalog.html.edge | 26 + client/simple/tools/jinja_svg_catalog.js | 130 ++++ searx/templates/simple/base.html | 6 +- searx/templates/simple/categories.html | 28 +- searx/templates/simple/icons.html | 73 +- searx/templates/simple/macros.html | 2 +- searx/templates/simple/preferences.html | 4 +- .../templates/simple/preferences/engines.html | 2 +- .../simple/result_templates/files.html | 4 +- .../simple/result_templates/images.html | 4 +- .../simple/result_templates/map.html | 2 +- .../simple/result_templates/torrent.html | 26 +- .../simple/result_templates/videos.html | 2 +- searx/templates/simple/results.html | 6 +- searx/templates/simple/search.html | 2 +- searx/templates/simple/simple_search.html | 2 +- searx/templates/simple/stats.html | 2 +- utils/lib_sxng_vite.sh | 1 + 24 files changed, 709 insertions(+), 427 deletions(-) delete mode 100644 client/simple/src/svg/information-circle-outline.svg create mode 100644 client/simple/src/svg/ionicons/information-circle-outline.svg create mode 100644 client/simple/src/svg/ionicons/newspaper-outline.svg create mode 100644 client/simple/theme_icons.js create mode 100644 client/simple/tools/jinja_svg_catalog.html.edge create mode 100644 client/simple/tools/jinja_svg_catalog.js diff --git a/client/simple/package-lock.json b/client/simple/package-lock.json index 7c93e4e2e..336cbacca 100644 --- a/client/simple/package-lock.json +++ b/client/simple/package-lock.json @@ -14,9 +14,11 @@ "@eslint/js": "^9.19.0", "copy-webpack-plugin": "^12.0.2", "css-loader": "^7.1.2", + "edge.js": "^6.2.1", "eslint": "^9.19.0", "filemanager-webpack-plugin": "^8.0.0", "globals": "^15.14.0", + "ionicons": "^7.4.0", "leaflet": "^1.9.4", "less": "^4.2.2", "less-loader": "^12.2.0", @@ -347,137 +349,6 @@ "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@img/sharp-darwin-arm64": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz", - "integrity": "sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-darwin-arm64": "1.0.4" - } - }, - "node_modules/@img/sharp-darwin-x64": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.5.tgz", - "integrity": "sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-darwin-x64": "1.0.4" - } - }, - "node_modules/@img/sharp-libvips-darwin-arm64": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.4.tgz", - "integrity": "sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "LGPL-3.0-or-later", - "optional": true, - "os": [ - "darwin" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-darwin-x64": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.4.tgz", - "integrity": "sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "LGPL-3.0-or-later", - "optional": true, - "os": [ - "darwin" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-linux-arm": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.5.tgz", - "integrity": "sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "LGPL-3.0-or-later", - "optional": true, - "os": [ - "linux" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-linux-arm64": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.4.tgz", - "integrity": "sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "LGPL-3.0-or-later", - "optional": true, - "os": [ - "linux" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-linux-s390x": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.4.tgz", - "integrity": "sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "LGPL-3.0-or-later", - "optional": true, - "os": [ - "linux" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, "node_modules/@img/sharp-libvips-linux-x64": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz", @@ -495,109 +366,6 @@ "url": "https://opencollective.com/libvips" } }, - "node_modules/@img/sharp-libvips-linuxmusl-arm64": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.4.tgz", - "integrity": "sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "LGPL-3.0-or-later", - "optional": true, - "os": [ - "linux" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-linuxmusl-x64": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz", - "integrity": "sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "LGPL-3.0-or-later", - "optional": true, - "os": [ - "linux" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-linux-arm": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.5.tgz", - "integrity": "sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linux-arm": "1.0.5" - } - }, - "node_modules/@img/sharp-linux-arm64": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.5.tgz", - "integrity": "sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linux-arm64": "1.0.4" - } - }, - "node_modules/@img/sharp-linux-s390x": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.5.tgz", - "integrity": "sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linux-s390x": "1.0.4" - } - }, "node_modules/@img/sharp-linux-x64": { "version": "0.33.5", "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz", @@ -621,123 +389,6 @@ "@img/sharp-libvips-linux-x64": "1.0.4" } }, - "node_modules/@img/sharp-linuxmusl-arm64": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.5.tgz", - "integrity": "sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linuxmusl-arm64": "1.0.4" - } - }, - "node_modules/@img/sharp-linuxmusl-x64": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.5.tgz", - "integrity": "sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linuxmusl-x64": "1.0.4" - } - }, - "node_modules/@img/sharp-wasm32": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.5.tgz", - "integrity": "sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==", - "cpu": [ - "wasm32" - ], - "dev": true, - "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", - "optional": true, - "dependencies": { - "@emnapi/runtime": "^1.2.0" - }, - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-wasm32/node_modules/@emnapi/runtime": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.3.1.tgz", - "integrity": "sha512-kEBmG8KyqtxJZv+ygbEim+KCGtIq1fC22Ms3S4ziXmYKm8uyoLX0MHONVKwp+9opg390VaKRNt4a7A9NwmpNhw==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, - "node_modules/@img/sharp-win32-ia32": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.5.tgz", - "integrity": "sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "Apache-2.0 AND LGPL-3.0-or-later", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-win32-x64": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.5.tgz", - "integrity": "sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0 AND LGPL-3.0-or-later", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - } - }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.8", "dev": true, @@ -821,6 +472,16 @@ "ieee754": "^1.2.1" } }, + "node_modules/@lukeed/ms": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@lukeed/ms/-/ms-2.0.2.tgz", + "integrity": "sha512-9I2Zn6+NJLfaGoz9jN3lpwDgAYvfGeNYdbAIjJOqzs4Tpc+VU3Jqq4IofSUBKajiDS8k9fZIg18/z13mpk1bsA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "dev": true, @@ -853,6 +514,84 @@ "node": ">= 8" } }, + "node_modules/@poppinss/exception": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@poppinss/exception/-/exception-1.2.0.tgz", + "integrity": "sha512-WLneXKQYNClhaMXccO111VQmZahSrcSRDaHRbV6KL5R4pTvK87fMn/MXLUcvOjk0X5dTHDPKF61tM7j826wrjQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.6.0" + } + }, + "node_modules/@poppinss/inspect": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@poppinss/inspect/-/inspect-1.0.1.tgz", + "integrity": "sha512-kLeEaBSGhlleyYvKc7c9s3uE6xv7cwyulE0EgHf4jU/CL96h0yC4mkdw1wvC1l1PYYQozCGy46FwMBAAMOobCA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/@poppinss/macroable": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@poppinss/macroable/-/macroable-1.0.4.tgz", + "integrity": "sha512-ct43jurbe7lsUX5eIrj4ijO3j/6zIPp7CDnFWXDs7UPAbw1Pu1iH3oAmFdP4jcskKJBURH5M9oTtyeiUXyHX8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.16.0" + } + }, + "node_modules/@poppinss/object-builder": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@poppinss/object-builder/-/object-builder-1.1.0.tgz", + "integrity": "sha512-FOrOq52l7u8goR5yncX14+k+Ewi5djnrt1JwXeS/FvnwAPOiveFhiczCDuvXdssAwamtrV2hp5Rw9v+n2T7hQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.6.0" + } + }, + "node_modules/@poppinss/string": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@poppinss/string/-/string-1.2.0.tgz", + "integrity": "sha512-1z78zjqhfjqsvWr+pQzCpRNcZpIM+5vNY5SFOvz28GrL/LRanwtmOku5tBX7jE8/ng3oXaOVrB59lnnXFtvkug==", + "dev": true, + "license": "MIT", + "dependencies": { + "@lukeed/ms": "^2.0.2", + "@types/bytes": "^3.1.5", + "@types/pluralize": "^0.0.33", + "bytes": "^3.1.2", + "case-anything": "^3.1.0", + "pluralize": "^8.0.0", + "slugify": "^1.6.6", + "truncatise": "^0.0.8" + }, + "engines": { + "node": ">=20.6.0" + } + }, + "node_modules/@poppinss/utils": { + "version": "6.9.2", + "resolved": "https://registry.npmjs.org/@poppinss/utils/-/utils-6.9.2.tgz", + "integrity": "sha512-ypVszZxhwiehhklM5so2BI+nClQJwp7mBUSJh/R1GepeUH1vvD5GtxMz8Lp9dO9oAbKyDmq1jc4g/4E0dv8r2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@poppinss/exception": "^1.2.0", + "@poppinss/object-builder": "^1.1.0", + "@poppinss/string": "^1.1.0", + "flattie": "^1.1.1", + "safe-stable-stringify": "^2.5.0", + "secure-json-parse": "^3.0.1" + }, + "engines": { + "node": ">=18.16.0" + } + }, "node_modules/@rollup/pluginutils": { "version": "5.1.4", "dev": true, @@ -920,6 +659,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@stencil/core": { + "version": "4.25.3", + "resolved": "https://registry.npmjs.org/@stencil/core/-/core-4.25.3.tgz", + "integrity": "sha512-wYSMS59jxB2ulWF8oNYOCMCo4NhGsvopn0Q7l7MBDQPRluBrodKRMfJiDV40tkJfYB4tq7o2TvgjcacH1gDNvQ==", + "dev": true, + "license": "MIT", + "bin": { + "stencil": "bin/stencil" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.10.0" + } + }, "node_modules/@trysound/sax": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz", @@ -938,6 +691,13 @@ "@types/readdir-glob": "*" } }, + "node_modules/@types/bytes": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@types/bytes/-/bytes-3.1.5.tgz", + "integrity": "sha512-VgZkrJckypj85YxEsEavcMmmSOIzkUHqWmM4CCyia5dc54YwsXzJ5uT4fYxBQNEXx+oF1krlhgCbvfubXqZYsQ==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/eslint": { "version": "9.6.1", "dev": true, @@ -974,6 +734,13 @@ "undici-types": "~6.20.0" } }, + "node_modules/@types/pluralize": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/@types/pluralize/-/pluralize-0.0.33.tgz", + "integrity": "sha512-JOqsl+ZoCpP4e8TDke9W79FDcSgPAR0l6pixx2JHkhnRjvShyYiAYw2LVsnA7K08Y6DeOnaU6ujmENO4os/cYg==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/readdir-glob": { "version": "1.1.5", "dev": true, @@ -1373,6 +1140,16 @@ "node": ">=8" } }, + "node_modules/astring": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/astring/-/astring-1.9.0.tgz", + "integrity": "sha512-LElXdjswlqjWrPpJFg1Fx4wpkOCxj1TDHlSV4PlaRxHGWko024xICaa97ZkMfs6DRKlCguiAI+rbXv5GWwXIkg==", + "dev": true, + "license": "MIT", + "bin": { + "astring": "bin/astring" + } + }, "node_modules/async": { "version": "3.2.6", "dev": true, @@ -1514,6 +1291,16 @@ "dev": true, "license": "MIT" }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/cacheable": { "version": "1.8.8", "dev": true, @@ -1558,6 +1345,19 @@ ], "license": "CC-BY-4.0" }, + "node_modules/case-anything": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/case-anything/-/case-anything-3.1.0.tgz", + "integrity": "sha512-rRYnn5Elur8RuNHKoJ2b0tgn+pjYxL7BzWom+JZ7NKKn1lt/yGV/tUNwOovxYa9l9VL5hnXQdMc+mENbhJzosQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/mesqueeb" + } + }, "node_modules/chalk": { "version": "4.1.2", "dev": true, @@ -1615,6 +1415,13 @@ "node": ">=6.0" } }, + "node_modules/classnames": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.5.1.tgz", + "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==", + "dev": true, + "license": "MIT" + }, "node_modules/clean-stack": { "version": "2.2.0", "dev": true, @@ -2150,6 +1957,70 @@ "node": ">=8" } }, + "node_modules/edge-error": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/edge-error/-/edge-error-4.0.2.tgz", + "integrity": "sha512-jB76VYn8wapDHKHSOmP3vbKLoa77RJYsTLNmfl8+cuCD69uxZtP3h+kqV+Prw/YkYmN7yHyp4IApE15pDByk0A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.16.0" + } + }, + "node_modules/edge-lexer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/edge-lexer/-/edge-lexer-6.0.3.tgz", + "integrity": "sha512-/s15CNnfhZv97bsW+ZgV5rtONULYjhCDYu+usbVLqZ8UQ6b/hQUNvQSIQBXA6Gql9dm72TMBB9sb/eWM2esufg==", + "dev": true, + "license": "MIT", + "dependencies": { + "edge-error": "^4.0.2" + }, + "engines": { + "node": ">=18.16.0" + } + }, + "node_modules/edge-parser": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/edge-parser/-/edge-parser-9.0.4.tgz", + "integrity": "sha512-vnjzfpqpjM4Mjt9typc1zLoFpC1F6kAObfcdyA6rSy+izIPji2RaQz5jWx5s5iG9hNcuyjtNyGRCLFVfoYhWcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.14.0", + "astring": "^1.9.0", + "edge-error": "^4.0.2", + "edge-lexer": "^6.0.3", + "js-stringify": "^1.0.2" + }, + "engines": { + "node": ">=18.16.0" + } + }, + "node_modules/edge.js": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/edge.js/-/edge.js-6.2.1.tgz", + "integrity": "sha512-me875zh6YA0V429hywgQIpHgMvQkondv5XHaP6EsL2yIBpLcBWCl7Ba1cai0SwYhp8iD0IyV3KjpxLrnW7S2Ag==", + "dev": true, + "license": "MIT", + "dependencies": { + "@poppinss/inspect": "^1.0.1", + "@poppinss/macroable": "^1.0.4", + "@poppinss/utils": "^6.9.2", + "classnames": "^2.5.1", + "edge-error": "^4.0.2", + "edge-lexer": "^6.0.3", + "edge-parser": "^9.0.4", + "fs-readdir-recursive": "^1.1.0", + "he": "^1.2.0", + "js-stringify": "^1.0.2", + "property-information": "^6.5.0", + "stringify-attributes": "^4.0.0" + }, + "engines": { + "node": ">=18.16.0" + } + }, "node_modules/electron-to-chromium": { "version": "1.5.90", "dev": true, @@ -2276,6 +2147,19 @@ "node": ">=6" } }, + "node_modules/escape-goat": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-4.0.0.tgz", + "integrity": "sha512-2Sd4ShcWxbx6OY1IHyla/CVNwvg7XwZVoXZHcSu9w9SReNP1EzzD5T8NWKIR38fIqEns9kDWKUQTXXAmlDrdPg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/escape-string-regexp": { "version": "4.0.0", "dev": true, @@ -2598,6 +2482,16 @@ "dev": true, "license": "ISC" }, + "node_modules/flattie": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/flattie/-/flattie-1.1.1.tgz", + "integrity": "sha512-9UbaD6XdAL97+k/n+N7JwX46K/M6Zc6KcFYskrYL8wbBV/Uyk0CTAMY0VT+qiK5PM7AIc9aTWYtq65U7T+aCNQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/fs-constants": { "version": "1.0.0", "dev": true, @@ -2616,6 +2510,13 @@ "node": ">=12" } }, + "node_modules/fs-readdir-recursive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", + "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==", + "dev": true, + "license": "MIT" + }, "node_modules/fs.realpath": { "version": "1.0.0", "dev": true, @@ -2769,6 +2670,16 @@ "node": ">= 0.4" } }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "license": "MIT", + "bin": { + "he": "bin/he" + } + }, "node_modules/hookified": { "version": "1.7.0", "dev": true, @@ -2923,6 +2834,16 @@ "node": ">=10.13.0" } }, + "node_modules/ionicons": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/ionicons/-/ionicons-7.4.0.tgz", + "integrity": "sha512-ZK94MMqgzMCPPMhmk8Ouu6goyVHFIlw/ACP6oe3FrikcI0N7CX0xcwVaEbUc0G/v3W0shI93vo+9ve/KpvcNhQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@stencil/core": "^4.0.3" + } + }, "node_modules/is-binary-path": { "version": "2.1.0", "dev": true, @@ -3060,6 +2981,13 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, + "node_modules/js-stringify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/js-stringify/-/js-stringify-1.0.2.tgz", + "integrity": "sha512-rtS5ATOo2Q5k1G+DADISilDA6lv79zIiwFd6CcjuIxGKLFm5C+RLImRscVap9k55i+MOZwgliw+NejvkLuGD5g==", + "dev": true, + "license": "MIT" + }, "node_modules/js-tokens": { "version": "4.0.0", "dev": true, @@ -3704,6 +3632,16 @@ "node": ">=8" } }, + "node_modules/pluralize": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", + "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/postcss": { "version": "8.5.1", "dev": true, @@ -3883,6 +3821,17 @@ "dev": true, "license": "MIT" }, + "node_modules/property-information": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-6.5.0.tgz", + "integrity": "sha512-PgTgs/BlvHxOu8QuEN7wi5A0OmXaBcHpmCSTehcs6Uuu9IkDIEo13Hy7n898RHfrQ49vKCoGeWZSaAK01nwVig==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/prr": { "version": "1.0.1", "dev": true, @@ -4141,6 +4090,16 @@ ], "license": "MIT" }, + "node_modules/safe-stable-stringify": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz", + "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, "node_modules/safer-buffer": { "version": "2.1.2", "dev": true, @@ -4202,6 +4161,23 @@ "dev": true, "license": "MIT" }, + "node_modules/secure-json-parse": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-3.0.2.tgz", + "integrity": "sha512-H6nS2o8bWfpFEV6U38sOSjS7bTbdgbCGU9wEM6W14P5H0QOsz94KCusifV44GpHDTu2nqZbuDNhTzu+mjDSw1w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, "node_modules/semver": { "version": "7.7.0", "dev": true, @@ -4326,6 +4302,16 @@ "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, + "node_modules/slugify": { + "version": "1.6.6", + "resolved": "https://registry.npmjs.org/slugify/-/slugify-1.6.6.tgz", + "integrity": "sha512-h+z7HKHYXj6wJU+AnS/+IH8Uh9fdcX1Lrhg1/VMdf9PwoBQXFcXiAdsy2tSK0P6gKwJLXp02r90ahUCqHk9rrw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/source-map": { "version": "0.6.1", "dev": true, @@ -4372,6 +4358,22 @@ "node": ">=8" } }, + "node_modules/stringify-attributes": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/stringify-attributes/-/stringify-attributes-4.0.0.tgz", + "integrity": "sha512-6Hq3K153wTTfhEHb4V/viuqmb0DRn08JCrRnmqc4Q/tmoNuvd4DEyqkiiJXtvVz8ZSUhlCQr7zCpCVTgrelesg==", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-goat": "^4.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/strip-ansi": { "version": "6.0.1", "dev": true, @@ -4923,6 +4925,13 @@ "node": ">=8.0" } }, + "node_modules/truncatise": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/truncatise/-/truncatise-0.0.8.tgz", + "integrity": "sha512-cXzueh9pzBCsLzhToB4X4gZCb3KYkrsAcBAX97JnazE74HOl3cpBJYEV7nabHeG/6/WXCU5Yujlde/WPBUwnsg==", + "dev": true, + "license": "MIT" + }, "node_modules/tslib": { "version": "2.8.1", "dev": true, diff --git a/client/simple/package.json b/client/simple/package.json index 77660cd0d..2e38f67d6 100644 --- a/client/simple/package.json +++ b/client/simple/package.json @@ -4,15 +4,18 @@ "type": "module", "scripts": { "build": "vite build", - "fix": "eslint --fix && stylelint --fix strict 'src/**/*.{css,scss,sass,less,styl,vue,svelte}'" + "fix": "eslint --fix && stylelint --fix strict 'src/**/*.{css,scss,sass,less,styl,vue,svelte}'", + "icons.html": "node theme_icons.js" }, "devDependencies": { "@eslint/js": "^9.19.0", "copy-webpack-plugin": "^12.0.2", "css-loader": "^7.1.2", + "edge.js": "^6.2.1", "eslint": "^9.19.0", "filemanager-webpack-plugin": "^8.0.0", "globals": "^15.14.0", + "ionicons": "^7.4.0", "leaflet": "^1.9.4", "less": "^4.2.2", "less-loader": "^12.2.0", diff --git a/client/simple/src/svg/information-circle-outline.svg b/client/simple/src/svg/information-circle-outline.svg deleted file mode 100644 index b7c300094..000000000 --- a/client/simple/src/svg/information-circle-outline.svg +++ /dev/null @@ -1,6 +0,0 @@ - - Information Circle - - - - \ No newline at end of file diff --git a/client/simple/src/svg/ionicons/information-circle-outline.svg b/client/simple/src/svg/ionicons/information-circle-outline.svg new file mode 100644 index 000000000..483062105 --- /dev/null +++ b/client/simple/src/svg/ionicons/information-circle-outline.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/client/simple/src/svg/ionicons/newspaper-outline.svg b/client/simple/src/svg/ionicons/newspaper-outline.svg new file mode 100644 index 000000000..5b743865b --- /dev/null +++ b/client/simple/src/svg/ionicons/newspaper-outline.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/client/simple/theme_icons.js b/client/simple/theme_icons.js new file mode 100644 index 000000000..04ae89614 --- /dev/null +++ b/client/simple/theme_icons.js @@ -0,0 +1,80 @@ +/** + * Generate icons.html for the jinja templates of the simple theme. + */ + +import { argv } from "node:process"; +import { dirname, resolve } from "node:path"; +import { jinja_svg_sets } from "./tools/jinja_svg_catalog.js"; + +const HERE = dirname(argv[1]) + "/"; +const dest = resolve(HERE, "../../searx/templates/simple/icons.html"); + +/** @type import("./tools/jinja_svg_catalog.js").JinjaMacro[] */ +const searxng_jinja_macros = [ + { name: "icon", class: "ion-icon" }, + { name: "icon_small", class: "ion-icon-small" }, + { name: "icon_big", class: "ion-icon-big" }, +]; + + +const sxng_icon_opts ={ + multipass: true, + plugins: [ + { name: "removeTitle" }, + { name: "removeXMLNS" }, + { name: "addAttributesToSVGElement", + params: { + attributes: [ + { + "aria-hidden": "true", + }]}}] +}; + + +/** @type import("./tools/jinja_svg_catalog.js").IconSet */ +const simple_icons = [ + { + base: resolve(HERE, "node_modules/ionicons/dist/svg"), + set: { + "alert": "alert-outline.svg", + "appstore": "apps-outline.svg", + "book": "book-outline.svg", + "close": "close-outline.svg", + "ellipsis-vertical": "ellipsis-vertical-outline.svg", + "file-tray-full": "file-tray-full-outline.svg", + "film": "film-outline.svg", + "globe": "globe-outline.svg", + "heart": "heart-outline.svg", + "image": "image-outline.svg", + "layers": "layers-outline.svg", + "location": "location-outline.svg", + "magnet": "magnet-outline.svg", + "musical-notes": "musical-notes-outline.svg", + "navigate-down": "chevron-down-outline.svg", + "navigate-left": "chevron-back-outline.svg", + "navigate-right": "chevron-forward-outline.svg", + "navigate-up": "chevron-up-outline.svg", + "people": "people-outline.svg", + "play": "play-outline.svg", + "radio": "radio-outline.svg", + "school": "school-outline.svg", + "search": "search-outline.svg", + "settings": "settings-outline.svg", + "tv": "tv-outline.svg", + }, + svgo_opts: sxng_icon_opts, + }, + // some of the ionicons are not suitable for a dark theme, we fixed the svg + // manually in src/svg/ionicons + // - https://github.com/searxng/searxng/pull/4284#issuecomment-2680550342 + { + base: resolve(HERE, "src/svg/ionicons"), + set: { + "information-circle": "information-circle-outline.svg", + "newspaper": "newspaper-outline.svg", + }, + svgo_opts: sxng_icon_opts, + } +]; + +jinja_svg_sets(dest, searxng_jinja_macros, simple_icons); diff --git a/client/simple/tools/jinja_svg_catalog.html.edge b/client/simple/tools/jinja_svg_catalog.html.edge new file mode 100644 index 000000000..ffec58cd5 --- /dev/null +++ b/client/simple/tools/jinja_svg_catalog.html.edge @@ -0,0 +1,26 @@ +{{-- +This is a EDGE https://edgejs.dev/ template to generate a HTML Jinja template +for the backend. Example output of this EDGE template: +- https://github.com/searxng/searxng/blob/master/searx/templates/simple/icons.html +--}} +{# +Catalog of SVG symbols that can be inserted into the HTML output of a Jinja +template. This file from: + + client/simple/tools/icon_catalog.edge.html +#} + +{%- +set catalog = { +@each((svg, name) in svg_catalog) + "{{{name}}}" : """{{{svg}}}""", +@end +} +-%} + +@each(macro in macros) + +{% macro {{ macro.name }}(action, alt) -%} + {{ open_curly_brace }} catalog[action] | replace("{{__jinja_class_placeholder__}}", "{{ macro.class }}") | safe {{ close_curly_brace }} +{%- endmacro %} +@end diff --git a/client/simple/tools/jinja_svg_catalog.js b/client/simple/tools/jinja_svg_catalog.js new file mode 100644 index 000000000..0adffa5af --- /dev/null +++ b/client/simple/tools/jinja_svg_catalog.js @@ -0,0 +1,130 @@ +import fs from "fs"; +import { resolve, dirname } from "path"; +import { Edge } from 'edge.js'; +import { optimize as svgo } from "svgo"; +import { fileURLToPath } from 'url'; + +const __dirname = dirname(fileURLToPath(import.meta.url)); +const __jinja_class_placeholder__ = "__jinja_class_placeholder__"; + +// -- types + +/** + * @typedef {object} IconSet - A set of icons + * @property {object[]} set - Array of SVG icons, where property name is the + * name of the icon and value is the src of the SVG (relative to base). + * @property {string} base - Folder in which the SVG src files are located. + * @property {import("svgo").Config} svgo_opts - svgo options for this set. + */ + +/** + * @typedef {object} IconSVG - Mapping of icon name to SVG source file. + * @property {string} name - Name of the icon isource file. + * @property {string} src - Name of the destination file. + * @property {import("svgo").Config} svgo_opts - Options passed to svgo. + */ + +/** + * @typedef {object} JinjaMacro - Arguments to create a jinja macro + * @property {string} name - Name of the jinja macro. + * @property {string} class - SVG's class name (value of XML class attribute) + */ + + +// -- functions + +/** + * Generate a jinja template with a catalog of SVG icons that can be + * used in in other HTML jinja templates. + * + * @param {string} dest - filename of the generate jinja template. + * @param {JinjaMacro} macros - Jinja macros to create. + * @param {IconSVG[]} items - Array of SVG items. + */ + +function jinja_svg_catalog(dest, macros, items) { + + const svg_catalog = {}; + const edge_template = resolve(__dirname, "jinja_svg_catalog.html.edge"); + + items.forEach( + (item) => { + + /** @type {import("svgo").Config} */ + const svgo_opts = JSON.parse(JSON.stringify(item.svgo_opts)); + svgo_opts.plugins.push({ + name: "addAttributesToSVGElement", + params: { + attributes: [{ "class": __jinja_class_placeholder__, }] + }} + ); + + try { + const raw = fs.readFileSync(item.src, "utf8"); + const opt = svgo(raw, svgo_opts); + svg_catalog[item.name] = opt.data; + } catch (err) { + console.error(`ERROR: jinja_svg_catalog processing ${item.name} src: ${item.src} -- ${err}`); + throw(err); + } + } + ); + + fs.mkdir(dirname(dest), { recursive: true }, (err) => { + if (err) throw err; + }); + + const ctx = { + svg_catalog: svg_catalog, + macros: macros, + edge_template: edge_template, + __jinja_class_placeholder__: __jinja_class_placeholder__, + // see https://github.com/edge-js/edge/issues/162 + open_curly_brace : "{{", + close_curly_brace : "}}" + }; + + const jinjatmpl = Edge.create().renderRawSync( + fs.readFileSync(edge_template, "utf-8"), + ctx + ); + + fs.writeFileSync(dest, jinjatmpl); + console.log(`[jinja_svg_catalog] created: ${dest}`); +} + + +/** + * Calls jinja_svg_catalog for a collection of icon sets where each set has its + * own parameters. + * + * @param {string} dest - filename of the generate jinja template. + * @param {JinjaMacro} macros - Jinja macros to create. + * @param {IconSet[]} sets - Array of SVG sets. + */ +function jinja_svg_sets(dest, macros, sets) { + /** @type IconSVG[] */ + const items = []; + const all = []; + for (const obj of sets) { + + for (const [name, file] of Object.entries(obj.set)) { + if (all.includes(name)) { + throw new Error(`ERROR: ${name} has already been defined`); + } + items.push({ + name: name, + src: resolve(obj.base, file), + svgo_opts: obj.svgo_opts, + }); + } + jinja_svg_catalog(dest, macros, items); + } +} + +// -- exports + +export { + jinja_svg_sets, + jinja_svg_catalog, +}; diff --git a/searx/templates/simple/base.html b/searx/templates/simple/base.html index 93249fbf8..2eebde676 100644 --- a/searx/templates/simple/base.html +++ b/searx/templates/simple/base.html @@ -46,15 +46,15 @@ {% block header %} diff --git a/searx/templates/simple/categories.html b/searx/templates/simple/categories.html index 10eaf97db..d3cd0b542 100644 --- a/searx/templates/simple/categories.html +++ b/searx/templates/simple/categories.html @@ -1,15 +1,19 @@ {% from 'simple/icons.html' import icon_big %} {%- set category_icons = { - 'general': 'search-outline', - 'images': 'image-outline', - 'videos': 'play-outline', - 'news': 'newspaper-outline', - 'map': 'location-outline', - 'music': 'musical-notes-outline', - 'it': 'layers-outline', - 'science': 'school-outline', - 'files': 'file-tray-full-outline', - 'social media': 'people-outline', + 'apps': 'appstore', + 'dictionaries': 'book', + 'files': 'file-tray-full', + 'general': 'search', + 'images': 'image', + 'it': 'layers', + 'map': 'location', + 'music': 'musical-notes', + 'news': 'newspaper', + 'radio': 'radio', + 'science': 'school', + 'social media': 'people', + 'TV': 'tv', + 'videos': 'play', } -%}
{{- '' -}}
@@ -18,7 +22,7 @@
{{- '' -}}
@@ -27,7 +31,7 @@ {%- else -%} {%- for category in categories -%}{{- '\n' -}} {{- '' -}} {%- endfor -%} diff --git a/searx/templates/simple/icons.html b/searx/templates/simple/icons.html index 6cbec3ee9..c6022de09 100644 --- a/searx/templates/simple/icons.html +++ b/searx/templates/simple/icons.html @@ -1,38 +1,55 @@ -{# this file was generated by searx/static/themes/simple/gruntfile.js #} -{%- set icons = { - 'warning':'', - 'close':'', - 'chevron-up-outline':'', - 'chevron-right':'', - 'chevron-left':'', - 'menu-outline':'', - 'ellipsis-vertical-outline':'', - 'magnet-outline':'', - 'globe-outline':'', - 'search-outline':'', - 'image-outline':'', - 'play-outline':'', - 'newspaper-outline':'', - 'location-outline':'', - 'musical-notes-outline':'', - 'layers-outline':'', - 'school-outline':'', - 'file-tray-full-outline':'', - 'people-outline':'', - 'heart-outline':'', - 'information-circle-outline':'', +{# +Catalog of SVG symbols that can be inserted into the HTML output of a Jinja +template. This file from: + client/simple/tools/icon_catalog.edge.html +#} + +{%- +set catalog = { + 'alert' : '', + 'appstore' : '', + 'book' : '', + 'close' : '', + 'download' : '', + 'ellipsis-vertical' : '', + 'file-tray-full' : '', + 'film' : '', + 'globe' : '', + 'heart' : '', + 'image' : '', + 'layers' : '', + 'leecher' : '', + 'location' : '', + 'magnet' : '', + 'musical-notes' : '', + 'navigate-down' : '', + 'navigate-left' : '', + 'navigate-right' : '', + 'navigate-up' : '', + 'people' : '', + 'play' : '', + 'radio' : '', + 'save' : '', + 'school' : '', + 'search' : '', + 'seeder' : '', + 'settings' : '', + 'tv' : '', + 'information-circle' : '', + 'newspaper' : '', } -%} + {% macro icon(action, alt) -%} - {{ icons[action] | replace("ionicon", "ion-icon") | safe }} + {{ catalog[action] | replace("__jinja_class_placeholder__", "ion-icon") | safe }} {%- endmacro %} -{% macro icon_small(action) -%} - {{ icons[action] | replace("ionicon", "ion-icon-small") | safe }} +{% macro icon_small(action, alt) -%} + {{ catalog[action] | replace("__jinja_class_placeholder__", "ion-icon-small") | safe }} {%- endmacro %} {% macro icon_big(action, alt) -%} - {{ icons[action] | replace("ionicon", "ion-icon-big") | safe }} -{%- endmacro %} + {{ catalog[action] | replace("__jinja_class_placeholder__", "ion-icon-big") | safe }} +{%- endmacro %} \ No newline at end of file diff --git a/searx/templates/simple/macros.html b/searx/templates/simple/macros.html index 7f537b033..6010a5a3d 100644 --- a/searx/templates/simple/macros.html +++ b/searx/templates/simple/macros.html @@ -47,7 +47,7 @@ {%- macro result_sub_footer(result, proxify) -%}
{% for engine in result.engines %}{{ engine }}{% endfor %} - {{ icon_small('ellipsis-vertical-outline') + result_link(cache_url + result.url, _('cached'), "cache_link") }}‎ {% if proxify and proxify_results %} {{ result_link(proxify(result.url), _('proxied'), "proxyfied_link") }} {% endif %} + {{ icon_small('ellipsis-vertical') + result_link(cache_url + result.url, _('cached'), "cache_link") }}‎ {% if proxify and proxify_results %} {{ result_link(proxify(result.url), _('proxied'), "proxyfied_link") }} {% endif %}
{{- '' -}}
{{- '' -}} {%- endmacro -%} diff --git a/searx/templates/simple/preferences.html b/searx/templates/simple/preferences.html index d68e90e4a..e86e926cc 100644 --- a/searx/templates/simple/preferences.html +++ b/searx/templates/simple/preferences.html @@ -21,7 +21,7 @@ {%- macro checkbox(name, checked, disabled) -%} {%- if checked == '?' -%} - {{- icon_small('warning') -}} + {{- icon_small('alert') -}} {%- else -%} {%- endif -%} @@ -128,7 +128,7 @@ {{- '' -}} {{- '' -}} - {{- icon_big('warning', 'The engine is not reliabled') }} {{ r -}} + {{- icon_big('alert', 'The engine is not reliabled') }} {{ r -}} {{- '' -}} {{- '' -}} {% endif %} @@ -110,7 +110,7 @@ {% if timeout_limit %}{% endif %} {{- engine_data_form(engine_data) -}} - +
{%- endif -%} diff --git a/searx/templates/simple/search.html b/searx/templates/simple/search.html index 360873c76..b26e27821 100644 --- a/searx/templates/simple/search.html +++ b/searx/templates/simple/search.html @@ -8,7 +8,7 @@
{% set display_tooltip = true %} diff --git a/searx/templates/simple/simple_search.html b/searx/templates/simple/simple_search.html index 30a6c2add..f69ba6142 100644 --- a/searx/templates/simple/simple_search.html +++ b/searx/templates/simple/simple_search.html @@ -4,7 +4,7 @@ diff --git a/searx/templates/simple/stats.html b/searx/templates/simple/stats.html index 9e177143c..575f6adb1 100644 --- a/searx/templates/simple/stats.html +++ b/searx/templates/simple/stats.html @@ -7,7 +7,7 @@ {% if selected_engine_name %} {{ column_name }} {% elif column_order==sort_order %} - {{ column_name }} {{ icon_big('arrow-dropdown') }} + {{ icon_big('navigate-down') }} {{ column_name }} {% else %} {{ column_name }} {% endif %} diff --git a/utils/lib_sxng_vite.sh b/utils/lib_sxng_vite.sh index 207bf2a84..d188fe503 100644 --- a/utils/lib_sxng_vite.sh +++ b/utils/lib_sxng_vite.sh @@ -36,6 +36,7 @@ vite.simple.build() { pushd "${VITE_SIMPLE_THEME}" npm install npm run fix + npm run icons.html npm run build )