summaryrefslogtreecommitdiff
path: root/searx/static/themes/simple/gruntfile.js
AgeCommit message (Collapse)Author
2025-02-28[web-client] simple theme: final build by vite & clean up grunt leftoversMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-01-20[fix] LESS sourcemaps broken in less-plugin-clean-css v1.6.0Markus Heiser
The ``less-plugin-clean-css`` lacks some maintenance: the sourcemaps are broken since v1.6.0 (08/2024) [1] - [1] https://github.com/less/less-plugin-clean-css/issues/42 Closes: https://github.com/searxng/searxng/issues/4143 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-01-20[mod] add swipe events to the image gallery (gesture control)Markus Heiser
Adds [1] to the searxng.min.js and horizontal swipe events to the image gallery. [1] https://www.npmjs.com/package/swiped-events Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-01-16[fix] build workflows of the themesMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-01-14[upd] migrate .eslintrc.json to eslint.config.mjsMarkus Heiser
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>
2024-11-25[mod] add CSS (LESS) to xsl style to view rss in browserMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2024-04-27[fix] ionic.io/ionicons - add back missing class="ionicon"Markus Heiser
Seems to me svg2jinja added the class in the past .. but no longer in new builds / this patch adds the class back by using addAttributesToSVGElement [1]. To test this patch use: $ ./manage themes.simple $ cat searx/templates/simple/icons.html and check `class="ionicon"` is in the outer `<svg ..>` tags. [1] https://svgo.dev/docs/plugins/add-attributes-to-svg-elements/ [2] https://ionic.io/ionicons Closes: https://github.com/searxng/searxng/issues/3383 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-07-02Theme: all top right icons have labels including "Preferences"Alexandre Flament
2022-06-25Theme: add Help and Donate links in all pagesAlexandre Flament
Close https://github.com/searxng/searxng/issues/931
2022-05-07theme: remove __common__Alexandre Flament
2022-02-26[simple theme] replace Image_layout.js with flexbox CS impl.mrpaulblack
* drop image_layout.js from simple theme * move image_layout.js to oscar theme and delete common js dir (since its empty now) * align top position of image detail modal with bottom position of search header * use flexbox to display images; row height can be set via @results-image-row-height in defenitions.less * display span title underneath each image with a max width of 12rem * increase margin and padding around image article on desktop and tablet * make article height smaller on phone layout (height of 6rem) to display more content on current view * remove content from result, if the title and content matches * use a group that cotains the flex image article, if images are mixed with other categories * fix pylint issues in webapp.py * use the default.html result template in unit tests (thanks @return42)
2022-01-22Changed preferences icon to settings icon in gruntfileMonty
2022-01-16[enh] simple theme: RTL supportAlexandre Flament
* mirror all inline SVGs so that direction SVGs display correctly on RTL * set the bold list element in info box to RTL so the colon gets displayed on the right side * set correct .ltr function for the left border on the search button in #q * move text to the right in autocomplete * move search form in lign with result article on RTL * add the correct padding for img thumbnails in categories like music on RTL * apply RTL to result table for map results * align text in tables part of /preferences on RTL * move burger menu on index page to the left on RTL * fix positioning of drop down arrow on select boxes on RTL * align result URL on the right (written LTR) * align vim hotkeys help on the left since it is not translated * image detail: * labels (author, format, URL, etc...) are written on the right, values are on the left. * URL are written LTR and overflow on the right
2022-01-14[fix] stop less grunt runner on missing filesMarkus Heiser
The less grunt runner silently ignore missing files and continue with the build[1]:: Running "less:production" (less) task >> Destination css/searxng.min.css not written because no source files were found. >> 1 stylesheet created. >> 1 sourcemap created. Add filter function that calls grunt.fail() if the scr file does not exists. [1] https://github.com/searxng/searxng/pull/750#discussion_r784357031 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-12-18[fix] theme: build `img_load_error.svg` as svgmrpaulblack
2021-12-14[simple theme] activate - SearXNG JavaScript Style GuideMarkus Heiser
Add the 'SearXNG JavaScript Style Guide' as one quality gate in the build chain of the simple theme:: make themes.simple make themes.simple.test In the github CI the `themes.all` target enforce a `themes.simple`. BTW: Remove 'jshint' left overs from 0ee316f3d Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-12-14[fix] eslint --fixMarkus Heiser
automatically fix some of the problems reported by eslint rules:: $ ./manage nvm.bash nvm-env$ npm --prefix searx/static/themes/simple run eslint-fix Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-12-14[mod] eslint: add gruntfile.js to the files to lintMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-12-14[mod] SearXNG JavaScript Style Guide (eslint:recommended)Markus Heiser
The SearXNG JavaScript Style Guide is a set of eslint rules [1] based on the eslint:recommended [2] rules. "extends": "eslint:recommended" The additional rules adopted from the JavaScript Standard Style [3][4]. [1] https://eslint.org/docs/rules/ [2] https://github.com/kunalgolani/eslint-config/tree/master/packages/recommended [3] https://standardjs.com/rules.html#javascript-standard-style [4] https://github.com/standard/eslint-config-standard/blob/master/.eslintrc.json Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-12-04[fix] simple theme: make LESS sources available on non build hostsMarkus Heiser
Include the LESS source files directly in the `.map` files [1]. Drawback: `.map` files grow up in size, but this should not bother, because the files are only loaded in debug mode. [1] https://github.com/gruntjs/grunt-contrib-less#outputsourcefiles [2] https://github.com/searxng/searxng/pull/575#issuecomment-984058868 Suggested-by: @dalf [2] Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-12-01[fix] simple theme: make JS sources available on non build hostsMarkus Heiser
Include the source files directly in the `.map` files [1] for two reasons: 1. In the simple theme, modules from `./node_modules` are only available on developer's build host (a `make node.env` is needed to get the sources). By example; in the `searxng.min.js.map` file, the `autocomplete.js` is linked at URL: ../node_modules/autocomplete-js/dist/autocomplete.js 2. Later, when client sources has been moved out of the `./static` URL [2] to the `<repo-roo>/src` folder, all JS sources are no longer available. Drawback: `.map` files grow up in size, but this should not bother, because the files are only loaded in debug mode. [1] https://github.com/gruntjs/grunt-contrib-uglify#sourcemapincludesources [2] https://github.com/searxng/searxng/issues/141 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-12-01[fix] simple theme: remove static files no longer neededMarkus Heiser
remove: searx/static/themes/simple/js/searxng.js searx/static/themes/simple/js/searxng.head.js searx/static/themes/simple/css/searxng-rtl.css searx/static/themes/simple/css/searxng.css Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-30[mod] simple theme: smaller buildAlexandre Flament
remove: * searx/static/themes/simple/js/searxng.head.js * searx/static/themes/simple/js/searxng.js * searx/static/themes/simple/css/searxng-rtl.css * searx/static/themes/simple/css/searxng.css These files are never used. About the js files: the .map files references the sources instead of the concated version.
2021-11-29[simple] ImageLayout.watch: `img_load_error.svg` if img load failsMarkus Heiser
Show default image `img/img_load_error.svg` when image can't be loaded. ---- Some words about class ImageLayout: The https://github.com/searxng/searxng/blob/master/searx/static/themes/simple/js/searxng.js is build by a grunt task .. https://github.com/searxng/searxng/blob/d0e21a01b4e14df905f25445a3f6bcbec481671c/searx/static/themes/simple/gruntfile.js#L91-L93 The `/__common__/js/*.js` concats also https://github.com/searxng/searxng/blob/master/searx/static/themes/__common__/js/image_layout.js where a modified copy of the of the "Google-image-layout" (`ImageLayout`) is implemented [1][2][3]. [1] https://ptgamr.github.io/2014-09-12-google-image-layout/ [2] https://ptgamr.github.io/google-image-layout/src/google-image-layout.js [3] https://github.com/ptgamr/google-image-layout/tree/master ---- Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-29[enh] add SVG favicon href="favicon.svg" type="image/svg+xml"Markus Heiser
Add link:: <link rel="icon" href="favicon.png" sizes="any"> <link rel="icon" href="favicon.svg" type="image/svg+xml"> Modern browsers should request:: INFO werkzeug : 127.0.0.1 - - [28/Nov/2021 17:03:07] "GET /static/themes/simple/img/favicon.svg HTTP/1.1" 200 - [1] https://github.com/audreyfeldroy/favicon-cheat-sheet#svg-file [2] https://dev.to/masakudamatsu/favicon-nightmare-how-to-maintain-sanity-3al7 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-29[mod] themes/simple/img/searxng.svg -> src/brand/searxng.svgMarkus Heiser
* move `searx/static/themes/simple/img/searxng.svg` to `src/brand/searxng.svg` * README.rst can use it without a reference to a theme. * the simple theme can create `searx/static/themes/simple/img/searxng.png` using the svg2png task Suggested-by: @dalf https://github.com/searxng/searxng/pull/561#issuecomment-981747902 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-28[mod] simple theme: use sharp instead of convert to create .png from .svgAlexandre Flament
define a custom grunt task, since grunt-sharp is too old (it can't be installed). in gruntfile.js, the image tasks are moved at the end the build chain. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-28[mod] gruntfile: do some polish (no functional change)Markus Heiser
- remove unused 'path' constant - fix indentation - Put all image tasks at the end, where it is easy to list which image is processed. Suggested -by: @dalf https://github.com/searxng/searxng/pull/541#discussion_r756247157 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-20[mod] gruntfile.js - define grunt.template _brand & _templatesMarkus Heiser
[1] https://gruntjs.com/api/grunt.template Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-20[brand] initial - folder src/brand for searxng-wordmarkMarkus Heiser
Folder src/brand is intended to place logo, wordmark and more in. This commit moves the origin (source) of searxng-wordmark.svg from the simple theme into this folder About the new created src/ folder: On the long term we can move all the files from static/themes/<name>/src/* into a src/themes/<name>/* folder. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-17[fix] eslint - option configFile changed to overrideConfigFileMarkus Heiser
https://github.com/sindresorhus/grunt-eslint/pull/171 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-15[fix] Optimize SVG for WEB usage / CSP 'style-src self'Markus Heiser
- Replace grunt-contrib-htmlmin by grunt-image [1]. - Activate svgo's [2] convertStyleToAttrs to make the HTML inline SVGs compoliant to the CSP policy [3]:: Content-Security-Policy: style-src self; [1] https://www.npmjs.com/package/grunt-image [2] https://github.com/svg/svgo [3] https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src Closes: https://github.com/searxng/searxng/issues/502 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-13[fix] delete trailing whitespaceMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-13[simple theme] update to ion icons 5 and drop webfontMrPaulBlack
* update from ionicons-npm to ionicons ver.5 * drop the webfont built by grunt for icons * built icons.html template for inlining icons with jinja2 into html * update icon to use mostly the outline version * add icons to categories and do not display them on mobile to save space * remove all legacy ion icon font files from simple theme * icons.html is added in this commit since make statc.build.restore requires git to know the file already * cleanup error-dialog
2021-11-13[enh] minify searxng-wordmark.svg (HTMLMinifier)Markus Heiser
Command:: ./node_modules/.bin/html-minifier \ --remove-comments \ --collapse-whitespace \ src/svg/searxng-wordmark.svg \ -o ../../../templates/__common__/searxng-wordmark.min.svg - html-minifier: https://github.com/kangax/html-minifier - onilne: https://kangax.github.io/html-minifier - grunt: https://www.npmjs.com/package/grunt-contrib-htmlmin - grunt-contrib-htmlmin: https://github.com/gruntjs/grunt-contrib-htmlmin - npm: https://www.npmjs.com/package/html-minifier To test, rebuild your node environment:: make node.env Alternatives: - pretty-data: https://github.com/vkiryukhin/pretty-data - grunt: https://www.npmjs.com/package/grunt-xmlmin - grunt-xmlming: https://github.com/dtrunk90/grunt-xmlmin - npm: https://www.npmjs.com/package/grunt-xmlmin - minify-xml: https://github.com/kristian/minify-xml - no grunt package available - npm: https://www.npmjs.com/package/minify-xml src/svg/searxng-wordmark.svg': '../../../templates/__common__/searxng-wordmark.min.svg' Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-10-01SearXNG: simple themeAlexandre Flament
2021-08-31eslint: grunt integrationAlexandre Flament
2021-08-31[mod] simple theme - add ESLintMarkus Heiser
[1] https://eslint.org/ [2] https://eslint.org/docs/user-guide/configuring/ [3] https://eslint.org/docs/user-guide/command-line-interface Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-28[mod] themes: remove banner generated by gruntMarkus Heiser
The banner is useless and responsible for unwanted diff. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-24[emacs] .dir-locals.el: add setup for js-modeMarkus Heiser
- move jshint option from gruntfile to .jshintrc - remove trailing-whitespace from gruntfile and - add jshint esversion: 6 - .dir-locals.el add locals for js-mode to use JSHint from the simple theme Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-24[mod] add stylelint process to target themes.simpleMarkus Heiser
Before build, do lint the LESS files using stylelint [1]. The configuration 'stylelint-config-standard' [2] is added to the root of the simple theme [3]. [1] https://stylelint.io/ [2] https://github.com/stylelint/stylelint-config-standard [3] https://stylelint.io/user-guide/configure Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-22[mod] simple theme: include fontsAlexandre Flament
"npm run webfont" to build the fonts directory. It requires fontforge and ttfautohint distro packages. partial revert of commit 7137d2893f33e9158e8563a21d9586119d175269
2021-06-16[mod] simple theme: remove src/less/ion.lessAlexandre Flament
This file is generated by webfont. * It is now generated as searx/static/themes/simple/ion.less * It is generated before the .less compilation. * .gitignore includes this file Add two new package depedencies: fontforge ttfautohint See utils/searx.sh
2021-06-16[mod] simple theme: autocomplete-js becomes a packages.json dependencyAlexandre Flament
Update to version 2.7.1
2021-06-16[mod] simple theme: leaflet becomes a packages.json dependencyAlexandre Flament
the build of the themes updates: * js/leaflet.js ( was leaflet/leaflet.js ) * css/leaflet.css ( was leaflet/leaflet.css ) * css/images ( was leaflet/images )
2021-06-16[mod] simple theme: move magnet.svg to src/fontsAlexandre Flament
see https://github.com/searx/searx/pull/1109
2021-06-16[mod] simple theme: move source files to the src directoryAlexandre Flament
2021-05-17[fix] simple theme - generate missing sourceMap fileMarkus Heiser
C&P from searx/static/themes/oscar/gruntfile.js Suggested-by: @dalf in commit 1204e4f0 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-04-05[enh] oscar: image thumbnail layoutAlexandre Flament
Adjust thumbnail sizes to fill the container width
2020-03-25[fix] brands: add variables from build env to grunt processMarkus Heiser
We have some variables in the build environment which are also needed in the grunt process when building themes. Theses variables are relavant if one creates a fork with its own branding. We treat these variables under the term 'brands'. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>