Commit Graph

666 Commits (master)

Author SHA1 Message Date
Markus Heiser d26a746d7d [build] /static 3 years ago
Markus Heiser f54460a805 [fix] simple theme: make JS sources available on non build hosts
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>
3 years ago
Markus Heiser 82125862c6 [fix] simple theme: remove static files no longer needed
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>
3 years ago
Alexandre Flament 28b22a0f98 [mod] simple theme: smaller build
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.
3 years ago
Markus Heiser 4798acc661 [build] /static 3 years ago
Markus Heiser 7dc9cc91a8 [mod] simple theme, JS: introduce window.searxng.theme namespace
In window.searxng.theme the theme data can be passed through to JS
implementations.

Initial the window.searxng.theme namespace starts with a value for
`img_load_error`::

    // image that is displayed if load of <img src='...'> failed
    img_load_error: 'img/img_load_error.svg'

The searx/static/themes/__common__/js/image_layout.js is patched to uses the
value, if the theme defines a value for img_load_error in this namespace.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser eff0884498 [simple] ImageLayout.watch: `img_load_error.svg` if img load fails
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 ..

d0e21a01b4/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>
3 years ago
Markus Heiser f8c3acd729 [build] /static 3 years ago
Markus Heiser fb5c1ed310 [fix] simple theme: set img background color to wallpaper's color
The *background color* of an transparent image is the color of the color of
wallpaper on which all images are shown on.

Set variable `--color-result-image-background` and `--color-base-background` to
the same value.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 0afcde071c [build] /static 3 years ago
Markus Heiser 944b73511a [enh] add SVG favicon href="favicon.svg" type="image/svg+xml"
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>
3 years ago
Markus Heiser e2e585319e [build] /static 3 years ago
Markus Heiser 9349c71c54 [mod] themes/simple/img/searxng.svg -> src/brand/searxng.svg
* 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>
3 years ago
Markus Heiser 8154dd2a2e [build] /static 3 years ago
Alexandre Flament 59f4c792b4 [mod] simple theme: use sharp instead of convert to create .png from .svg
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>
3 years ago
Markus Heiser 8c4c4259d4 [mod] gruntfile: do some polish (no functional change)
- 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>
3 years ago
mrpaulblack c443e56458 [build] /static 3 years ago
mrpaulblack 0bb4d6b296 [oscar theme] center search on index and use logo with ponthi 3 years ago
Markus Heiser e54a06bae7 [fix] oscar theme: use SearXNG logo and wordmark
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 3364a15b3a [build] /static 3 years ago
Markus Heiser 28a597e43e [simple theme] remove '-webkit-border-radius' property
[1] https://github.com/searxng/searxng/pull/537#issuecomment-976582675

Suggested-by: @dalf [1]
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 8935b1d8a2 [simple theme] remove '-moz-border-radius' property
Support for the prefixed version (-moz-border-radius) was removed in Gecko
13.0 (Firefox 13.0 / Thunderbird 13.0 / SeaMonkey 2.10) [1].

[1] https://developer.mozilla.org/pt-BR/docs/Web/CSS/border-radius

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 02391cc892 [build] /static 3 years ago
Markus Heiser f57a9f425d [simple template] format default string 'italic'
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 339838f9f5 [build] /static 3 years ago
mrpaulblack 6a367b59ce [simple theme] add animations.less for keyframe animations 3 years ago
Alexandre Flament e612b81f41 [fix] simple theme: fix modal dialog 3 years ago
mrpaulblack b0aebf7069 [build] /static 3 years ago
mrpaulblack f3aff26086 [simple theme] rework select; add safesearch to search and replace / with › in article url
* rework selection UI in pref (fix based on: 78643e9f43)
* moved search filters underneath categories
* cut params from url and replace / with ›
* make h3 and url in article bigger
* add safe search select to search filter (this will not override settings and only be valid while on result page in a session)
* make search form button not overlap each other when js is disabled
* 1rem padding around preview image and thumbnail in default article template
3 years ago
Markus Heiser 4330d7cf5d [mod] gruntfile.js - define grunt.template _brand & _templates
[1] https://gruntjs.com/api/grunt.template

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser c68c53acd8 [brand] initial - folder src/brand for searxng-wordmark
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>
3 years ago
mrpaulblack cf9d161d26 [build] /static 3 years ago
Alexandre Flament ec5a82fccd [enh] simple theme: add "simple-style" preferences 3 years ago
Alexandre Flament 55737a219b
Merge pull request #518 from dalf/fix-simple-image-detail
[fix] simple theme: fix image detail layout on mobile
3 years ago
Alexandre Flament ef2556770b [build] /static 3 years ago
Alexandre Flament 48d2dcbb20 [fix] simple theme: adjust image detail height
when on the top of the page, the image is just below the search fields.
this commit slightly aligh the top of the image detail with the bottom
of the search fields.
3 years ago
Alexandre Flament 0400b8ca5d [fix] simple theme: fix layout image detail on mobile
the width of #main_results #results.image-detail-open.only_template_images
was set to 59.25rem. On mobile, the images overflowed on right side of
the viewport, which creates a horizontal scroll.

This commit set the value to min(98%, 59.25rem) whatever the max-width is.
3 years ago
dependabot[bot] 958c7d7280
Bump ionicons from 5.5.4 to 6.0.0 in /searx/static/themes/simple
Bumps [ionicons](https://github.com/ionic-team/ionicons) from 5.5.4 to 6.0.0.
- [Release notes](https://github.com/ionic-team/ionicons/releases)
- [Commits](https://github.com/ionic-team/ionicons/compare/v5.5.4...v6.0.0)

---
updated-dependencies:
- dependency-name: ionicons
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
Markus Heiser 15758f1ac2 [fix] eslint - option configFile changed to overrideConfigFile
https://github.com/sindresorhus/grunt-eslint/pull/171

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
dependabot[bot] d06135e48f Bump grunt-eslint from 23.0.0 to 24.0.0 in /searx/static/themes/simple
Bumps [grunt-eslint](https://github.com/sindresorhus/grunt-eslint) from 23.0.0 to 24.0.0.
- [Release notes](https://github.com/sindresorhus/grunt-eslint/releases)
- [Commits](https://github.com/sindresorhus/grunt-eslint/compare/v23.0.0...v24.0.0)

---
updated-dependencies:
- dependency-name: grunt-eslint
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
Markus Heiser 3c05530518 [build] /static 3 years ago
Markus Heiser b07884c958 [fix] Optimize SVG for WEB usage / CSP 'style-src self'
- 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>
3 years ago
Markus Heiser 5721617de4 [build] /static 3 years ago
MrPaulBlack c79bba60a9 [theme] add border radius to engine token input 3 years ago
Alexandre Flament dfbbc3b471 [fix] simple theme: /preferences: add tokens field
include changes to display input text field in the preferences
3 years ago
Markus Heiser b369ff4425 [fix] delete trailing whitespace
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
MrPaulBlack 29e092b931 [build] /static 3 years ago
MrPaulBlack 566dfe3330 [simple theme] update to ion icons 5 and drop webfont
* 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
3 years ago
Markus Heiser 9bf53ab974 [build] /static 3 years ago
Markus Heiser 04ab012e03 [simple theme] SearXNG wordmark (plain SVG)
Remove XML namespaces from Incscape [1]::

   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"

[1] https://wiki.inkscape.org/wiki/PlainSVG

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser ee67a65180 [simple theme] replace old searx logo by searxng-wordmark.min.svg
Suggested-by: @dalf https://github.com/searxng/searxng/pull/473#issuecomment-962476683
Suggested-by: @MrPaulBlack https://github.com/searxng/searxng/pull/473#issuecomment-962579826
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 3a981257de [simple theme] create favicon.png from src/svg/searxng-wordmark.svg
new bash function convert_if_newer() / usage::

    convert_if_newer <origfile> <outfile> [<options>, ...]
    convert_if_newer "path/to/origin.svg" "path/to/converted.png" -transparent white -resize 64x64

Run's ImageMagik' convert comand to generate <outfile> from <origfile>, if
<origfile> is newer than <outfile>.  The command line is to convert is::

    convert <origfile> [<options>, ...] <outfile>

PNG 'searx/static/themes/simple/img/favicon.png' has been created by::

  $ make themes.simple
  CONVERT   searx/static/themes/simple/src/svg/searxng-wordmark.svg -transparent white -resize 64x64 searx/static/themes/simple/img/favicon.png
  ...

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser bf52353a5c [enh] minify searxng-wordmark.svg (HTMLMinifier)
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>
3 years ago
Markus Heiser edb081638b [simple theme] SearXNG wordmark (SVG)
Related-to:

- https://github.com/searxng/searxng/pull/430#issuecomment-951967239
- https://github.com/searxng/searxng/pull/378

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
MrPaulBlack 303cea3437 [build] /static 3 years ago
MrPaulBlack 1becb5e138 [simple theme] minor css fixes
* remove hover effect from vim help modal
* remove bold font weight from active item in prefenreces tab bar
* remove margin from answer box to unify with rest of result page
3 years ago
MrPaulBlack 9badec0260 [build] /static 3 years ago
MrPaulBlack a80b5dc110 [fix] scaling of result page on small screens by @ZetaTom
* thanks to https://github.com/ZetaTom for the fix!
* set the width of the input#q element to 100% of the 1fr space of the grid layout
* change the viewport meta tag to th recommended value (see: https://developer.mozilla.org/en-US/docs/Web/HTML/Viewport_meta_tag#viewport_basics)
* add a new @ultra-small-phone width of 20rem; when a device is smaller than that the search logo does not get displayed on the result page anymore
3 years ago
Alexandre Flament 67ab4d4165 [build] /static 3 years ago
Alexandre Flament ddc2346a06 [enh] simple theme: mobile layout: allow access to the preferences
when there is no query, reduce the width of the query field,
to display the preference button on the right.
3 years ago
Alexandre Flament 558e0c3241 [build] /static 3 years ago
Alexandre Flament c00e54d61b [fix] simple theme: image detail: click on the URL to the HTML page works
Before this commit, the default click event on an image result is prevented,
this include clicks inside the detail.

This commit makes sure the click happends outside the detail to prevent the default event.
3 years ago
Alexandre Flament 4d051c43f3 [fix] simple theme: various about the hotkeys help
* dark mode: #555 border (same as infoboxes and other borders)
* remove a call to console.log
* center the dialog without using the style attribute.
3 years ago
Alexandre Flament d1c09c84e2 [fix] simple theme: disable hotkeys when they are not enabled in the preferences 3 years ago
Alexandre Flament 6ab78f1a6a [build] /static 3 years ago
Alexandre Flament 680d70865f [mod] SearXNG: remove "searx" from the searx*.js file names. 3 years ago
Markus Heiser aa08c48af8 [build] /static 3 years ago
Markus Heiser 7ecd0583fe [simple theme] add .rounded-corners to selectable_url
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
MrPaulBlack e05bcd4311 [simple theme] result layout suggestions 3 years ago
Markus Heiser 4887c25e7f [simple theme] simplify and justify #answers & #corrections
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser ca971bd5e5 [simple theme] CSS remove box-shadow effects
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Alexandre Flament 8d6c119593 [build] /static 3 years ago
Alexandre Flament 7179af32f2 [mod] simple theme: dark mode: various fixes 3 years ago
Alexandre Flament 2dcd9a68d6 [mod] simple theme: adjust button colors in dark version.
buttons:
* previous & next in the result page
* save, restore, & back in the preferences
* back to top

<select> input in Chrom* browsers:
* fix the white text with a white background issue
3 years ago
Markus Heiser 67d3dc01a2 [build] /static 3 years ago
Markus Heiser 7996619691 [theme] simple - improve rendering of the "Answers" box
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Alexandre Flament 6782830a4a [build] /static 3 years ago
Alexandre Flament 540042d0ca [mod] simple theme: infobox: center the image 3 years ago
Alexandre Flament 60d595ea52 [mod] simple theme: use :root instead of html to define CSS variables
This allows to use the CSS variables in inline svg.
3 years ago
Alexandre Flament d0a3164514 [fix] simple theme: /preferences: dark theme version for select widgets
It is not possible to use CSS variable in a SVG when this is in a background.
This commit adds two .svg files, less converts them into data URL.
The two files are indentical except the fill color.
3 years ago
Alexandre Flament 67b0b68b40 [fix] simple theme: /preferences: dark theme version for the response time bar charts 3 years ago
Alexandre Flament 9f0b47f525 [fix] simple theme: cookie table doesn't overflow the expected width 3 years ago
Alexandre Flament 7bfaf42e4b [build] /static 3 years ago
Alexandre Flament 0650e73b12 [mod] simple theme: SearXNG logo 3 years ago
MrPaulBlack f86a658c1c [build] /static 3 years ago
MrPaulBlack 9ddcd62464 [simple theme] selection ui with border
* remove vim arrow
* add 1rem padding to results
* add 0.2rem left border to vim selected article
* set column gap to 1.2rem and make search bar in line with results
* put 10px border-radius selected article
* result article: 0.125rem margin on tablet and esktop; 1rem margin on phone
3 years ago
Alexandre Flament 861f046090 [build] /static 3 years ago
Alexandre Flament e2d312f6ae [mod] simple theme: adjust margins
* index page: margin top is 24% of the view port.
  avoid to scroll a small screen,
  center the content in the middle of the screen

* link to preferences at the same height same the input fields

* increase the category tab heighs

* increase the margin bottom of the query field

* in the results, change the h3 margin top and bottom to 0.4rem (6px)

* move the back to top button slightly on the right when the results are only images
3 years ago
Alexandre Flament a93bd19101 [build] /static 3 years ago
Alexandre Flament fd374d6322 [enh] simple theme: image detail
When an image is selected, the detail with the full size image is displayed
on the right side of the screen (or full screen on tablet and phone).

When Javascript is disabled, the thumbnail is a linked to the full size image,
as it was before.

When the image proxy is enabled, the full size image is also proxied,
in consequence this commit increases the bandwidth usage of instances.

The detail can be closed by the close button or the Esc key.
It is possible to go to the next and previous images using the j and k keys
or the button on the top right of the screen.
3 years ago
Markus Heiser 84447b87e1 [build] /static 3 years ago
MrPaulBlack 1723726361 [simple theme] make url clickable and cleanup result article header
* url in article head is clickable
* url is bigger now 0.96em font
* url is now left floating on tablet and phone
* there is a 8px top and bottom margin on h3 result heading
3 years ago
MrPaulBlack 8918fb3eb0 [build] /static 3 years ago
MrPaulBlack bcc313bcf8 [simple theme] add logo to search form on result page
* rework search form as grid layout
* remove various paddings and margins
* add logo and link to index to search form
* make categories bigger on phone
3 years ago
Alexandre Flament cab98ed6c7 [build] /static 3 years ago
Alexandre Flament ff5ded2baf [mod] upgrade grunt-contrib-concat: ~2.0.0 3 years ago
MrPaulBlack 9ff0a91fca [build] /static 3 years ago
MrPaulBlack 6204ef665f [simple theme] define device width with less vars in defenition.less 3 years ago
MrPaulBlack 32fb2bdf85 [build] /static 3 years ago
MrPaulBlack 5e6e964c54 [simple theme] center results on tablet 3 years ago
dependabot[bot] 1f39b99c03 Bump eslint from 7.32.0 to 8.0.1 in /searx/static/themes/simple
Bumps [eslint](https://github.com/eslint/eslint) from 7.32.0 to 8.0.1.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.32.0...v8.0.1)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
MrPaulBlack d8c9839625 [build] /static 3 years ago
MrPaulBlack bc2c8e6ba9 [simple theme] add a dark theme
* add a new color theme for a dark mode
* make the device auto switch between dark and light theme
3 years ago
MrPaulBlack 3daa024c04 [simple theme] new color theme and result on mobile and tablet
* clean up vars in defenition
* results look now the same on mobile and desktop
* reworked results on mobile
* new color theme with more vibrant colors
3 years ago
MrPaulBlack 740fca00cc Redo Color Theme and css cleanup
* remove vars and add elements to base and btn vars
* change default border radius to 10px and padding to 0.7em
* put border radius and padding on search input form, infoxbox and buttons
* remove unused .help class in #categories_container
* remove active background from tabs to straemline design
* redo search form: 10px padding
* 2rem margin on search results on desktop
* fix modal pacement of engine reliability in prefs
* use darker accent colors
* streamline autocomplete with more padding and a hover effect
3 years ago
MrPaulBlack 7c2a518d12 [theme] replace all hardcoded colors by css vars and drop ununsed vars 3 years ago
MrPaulBlack 452b266387 [theme] convert less vars to css vars in simple theme 3 years ago
dependabot[bot] 94de9ee61a
Bump grunt-contrib-jshint in /searx/static/themes/oscar
Bumps [grunt-contrib-jshint](https://github.com/gruntjs/grunt-contrib-jshint) from 3.0.0 to 3.1.1.
- [Release notes](https://github.com/gruntjs/grunt-contrib-jshint/releases)
- [Changelog](https://github.com/gruntjs/grunt-contrib-jshint/blob/main/CHANGELOG)
- [Commits](https://github.com/gruntjs/grunt-contrib-jshint/commits/v3.1.1)

---
updated-dependencies:
- dependency-name: grunt-contrib-jshint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
dependabot[bot] a88ee63aca
Bump grunt-contrib-jshint in /searx/static/themes/simple
Bumps [grunt-contrib-jshint](https://github.com/gruntjs/grunt-contrib-jshint) from 3.0.0 to 3.1.1.
- [Release notes](https://github.com/gruntjs/grunt-contrib-jshint/releases)
- [Changelog](https://github.com/gruntjs/grunt-contrib-jshint/blob/main/CHANGELOG)
- [Commits](https://github.com/gruntjs/grunt-contrib-jshint/commits/v3.1.1)

---
updated-dependencies:
- dependency-name: grunt-contrib-jshint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
Alexandre Flament 715c445e9b [build] /static 3 years ago
Alexandre Flament a53a4d5012 [build] /static 3 years ago
Alexandre Flament 74b0830362 SearXNG: simple theme 3 years ago
Alexandre Flament 1dfac73a64 [build] /static 3 years ago
Alexandre Flament df06dddc04 SearXNG: oscar theme 3 years ago
MrPaulBlack 43fc136207 [build] /static 3 years ago
MrPaulBlack 57f58f85bd [fix] position of engine description tooltip 3 years ago
Markus Heiser 73cb80e71d [build] /static 3 years ago
Markus Heiser 8ac776765c [theme] simple: do not prefer arial over user's sans-serif font
The default *sans-serif* font from the browsers most often renders much better
compared to Arial font.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
MrPaulBlack e8ed56251a [build] /static 3 years ago
MrPaulBlack f81afed60b [fix] backtotop and pagination on image result page 3 years ago
MrPaulBlack 8268873701 [fix] several issues in the simple theme
- using more rem in style and definitions
- mobile width in preferences.less fix max-width: 75em to 80em (normalized with
  style.less and other)
- do not display #backToTop position on tablet (when max-width: 80em)
- fix answer box on mobile (when max-width: 50em)
3 years ago
MrPaulBlack b6ae1f1c7a [theme] margin around checkboxes is bigger now, index centers the search more and the pref, stats and about page have a max-width now 3 years ago
MrPaulBlack 859179f0c9 [theme] optimize switching between different device types 3 years ago
MrPaulBlack 385dce213b [theme] cleanup grid layout and remove various margins and paddings from elements 3 years ago
Alexandre Flament cc3c54f4cd simple theme: update 3 years ago
MrPaulBlack 88c17d106d [fix] make selected tabs not change wifth anymore compared to not being selected 3 years ago
Alexandre Flament 39876d9f14 [build] /static 3 years ago
Alexandre Flament 2f1384f198 [enh] themes: display the engine descriptions 3 years ago
MrPaulBlack 30a9146bdc [build] /static 3 years ago
MrPaulBlack 7cb5099c88 [preferences] make elements in query selecter align left 3 years ago
MrPaulBlack fa95cd91a8 [build] /static 3 years ago
MrPaulBlack 79351c2e4d [fix] searx.js null pointer exception when category div is missing 3 years ago
Alexandre Flament e8e81c7432 [build] /static 3 years ago
Alexandre Flament 2cc6301c98 [fix] Oscar theme: fix input field on Safari
close #323
3 years ago
Markus Heiser b0623ac9f6 [build] /static 3 years ago
Markus Heiser bd830f7449 [fix] simple theme - preferences: fix tooltip overflow
Suggested-by: @dalf https://github.com/searxng/searxng/pull/295#discussion_r703370358
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 9068a72c6a [fix] oscar theme - preferences: rename col-checkbox/col-stat
[1] https://github.com/searxng/searxng/pull/295#discussion_r703318053
[2] https://github.com/searxng/searxng/pull/295#discussion_r703337237

Suggested-by: @dalf [1] [2]
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 222031e975 [fix] make oscar theme more CSP compliant - col-checkbox
Add col-checkbox in::

    searx/static/themes/oscar/src/less/preferences.less

Replaced style in file::

    searx/templates/oscar/preferences.html

Reported-by: https://github.com/searxng/searxng/issues/57
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 9d106ae972 [fix] make oscar theme more CSP compliant - default-image-style
Add default-image-style in::

    searx/static/themes/oscar/src/less/result_templates.less

Replaced style= in files::

    ./oscar/result_templates/default.html:19:        <img src="{{ image_proxify(result.img_src or result.thumbnail) }}" title="{{ result.title|striptags }}" style="width: auto; max-height: 60px; min-height: 60px;" class="col-xs-2 col-sm-4 col-md-4 result-content">
    ./oscar/result_templates/files.html:24:<img src="{{ image_proxify(result.img_src) }}" alt="{{ result.title|striptags }}" title="{{ result.title|striptags }}" style="width: auto; max-height: 60px; min-height: 60px;" class="col-xs-2 col-sm-4 col-md-4 result-content">

Reported-by: https://github.com/searxng/searxng/issues/57
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 0d070fde92 [build] /static 3 years ago
Markus Heiser ad528c706e [fix] make result template map more CSP compliant - simple & oscar
Add osm-map-box in::

    searx/static/themes/__common__/less/result_templates.less

Replaced sty= in files::

    ./oscar/result_templates/map.html:64:        <div style="height:300px; width:100%; margin: 10px 0;" id="osm-map-{{ index }}"></div>
    ./simple/result_templates/map.html:65:    <div id="result-map-{{ index }}" class="invisible"><div id="osm-map-{{ index }}" style="height:300px; width:100%; margin: 10px 0;" ></div></div>

Reported-by: https://github.com/searxng/searxng/issues/57
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 37b3d8c33b
Merge pull request #276 from dalf/simple_eslint
Simple theme: eslint and bug fix
3 years ago
Alexandre Flament d246679dbe [build] /static 3 years ago
Alexandre Flament f77f797f8c [mod] simple theme: fix eslint errors, fix VIM keys
* VIM keys: fix the next page and previous pages (n, p keys)
* Map: Enable the wikipedia map (the layer was initialized but not included)
3 years ago
Alexandre Flament 0ee316f3d1 eslint: grunt integration 3 years ago
Markus Heiser 2948a99b6e [mod] simple theme - add ESLint
[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>
3 years ago
Alexandre Flament d29094579b [build] /static 3 years ago
Markus Heiser 76a066d4a3 [mod] themes: remove banner generated by grunt
The banner is useless and responsible for unwanted diff.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser a3f58a3a3d [emacs] .dir-locals.el: add setup for js-mode
- 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>
3 years ago
Markus Heiser f73a00dcee [stylelint] disable role 'no-descending-specificity'
This patch disables role 'no-descending-specificity'.  IMO it is better to have
this rule active (see below [1]), but it is hard to rewrite the less files to
pass this rule, so for the first I chose to disable this rule.

---

Source order is important in CSS, and when two selectors have the same
specificity, the one that occurs last will take priority. However, the situation
is different when one of the selectors has a higher specificity. In that case,
source order does not matter: the selector with higher specificity will win out
even if it comes first.

The clashes of these two mechanisms for prioritization, source order and
specificity, can cause some confusion when reading stylesheets. If a selector
with higher specificity comes before the selector it overrides, we have to think
harder to understand it, because it violates the source order
expectation. Stylesheets are most legible when overriding selectors always come
after the selectors they override. That way both mechanisms, source order and
specificity, work together nicely.

This rule enforces that practice as best it can, reporting fewer errors than it
should. It cannot catch every actual overriding selector, but it can catch
certain common mistakes.

[1] https://stylelint.io/user-guide/rules/list/no-descending-specificity/

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 0b7d03c694 [stylelint] simple theme: fix some errors reported by stylelint
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 14b09c15c4 [fix] simple theme: use stylint to fix common lint errors
This fix was autogenerated by::

     npx stylelint -f unix --fix 'searx/static/themes/simple/src/less/**/*.less'

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser dfc5c3bc15 [mod] add stylelint process to target themes.simple
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>
3 years ago
Alexandre Flament 04492b76de [themes] ignore packages-lock.json 3 years ago
Alexandre Flament 2bc9b00cd7 Static build 3 years ago
Alexandre Flament dca3bcca9e [mod] simple theme: include fonts
"npm run webfont" to build the fonts directory.
It requires fontforge and ttfautohint distro packages.

partial revert of commit 7137d2893f
3 years ago
Alexandre Flament d20f6a1f19 [mod] make themes.all update pygments*.less
Add a searx/static/themes/*/src/generated empty folder
3 years ago
Alexandre Flament bb3e67f72b [mod] simple theme: normalize.css becomes a packages.json dependency 3 years ago
Alexandre Flament 14ba56fd1a [mod] make node.clean: call the "clean" script from the packages.json
The dependencies and build process are described in the gruntfiles.js and packages.json files.
It makes sense to move the clean up to these files too.
3 years ago
Alexandre Flament c013256881 [mod] remove common grunt install
Before this commit, there are 3 node_modules directory:
* one in .
* two others in ./searx/statics/themes/*

This is no desirable:
* it declares the npm depdenencies in the shell script.
* dependabot can't updates theses dependencies.
* this is a not standard way to build a package (two different locations for the dependencies).

With this commit and the PR  #150 there is one unique node_modules directory per theme.
3 years ago
Alexandre Flament 85033f3d09 Static build 3 years ago
Alexandre Flament 7137d2893f [mod] simple theme: remove src/less/ion.less
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
3 years ago
Alexandre Flament e3ebfd41d7 [mod] simple theme: autocomplete-js becomes a packages.json dependency
Update to version 2.7.1
3 years ago
Alexandre Flament b4a47cacd8 [mod] simple theme: leaflet becomes a packages.json dependency
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 )
3 years ago
Alexandre Flament 6288b549e2 [mod] simple theme: move magnet.svg to src/fonts
see https://github.com/searx/searx/pull/1109
3 years ago
Alexandre Flament 6b80c57a3c [mod] simple theme: move source files to the src directory 3 years ago
Alexandre Flament 49ea5b7644 Static build 3 years ago
Alexandre Flament 9108c90f0e [mod] simple theme: update dependencies 3 years ago
Markus Heiser 15178e5b96 [static] make themes.all - based on commit 12af3b39
Based on commit 12af3b39 this patch is generated by::

    make themes.all

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 12af3b39db [fix] make simple/result_templates/map.html more CSP compliant [1]
[1] https://github.com/searxng/searxng/issues/57

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser bf10b4a857 [fix] openstreetmap - fix some minor whitespace & indentation issues
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Alexandre Flament c75425655f [enh] openstreetmap / map template: improve results
implements ideas described in #69

* update the engine
* use wikidata
* update map.html template
3 years ago
Markus Heiser 60dc91f234 [static] make /stats more CSP compliant- make themes.all
Based on commit:

- a89b823f [mod] remove overpass API call

this patch is generated by::

     make themes.all

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Alexandre Flament a89b823f8d [mod] remove overpass API call
prepare the code the PR #90
3 years ago
Kyle Anthony Williams d6a2d4f969 [enh] add engine - Docker Hub
Slightly modified merge of commit [1cb1d3ac] from searx [PR 2543]:

      This adds Docker Hub .. as a search engine .. the engine's favicon was
      downloaded from the Docker Hub website with wget and converted to a PNG
      with ImageMagick .. It supports the parsing of URLs, titles, content,
      published dates, and thumbnails of Docker images.

[1cb1d3ac] https://github.com/searx/searx/pull/2543/commits/1cb1d3ac
[PR 2543] https://github.com/searx/searx/pull/2543

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 73d73dcf9b [static] make /stats more CSP compliant- make themes.all
Based on commits

- 0507e185 [fix] bar graph and rename CSS class engine-scores -> engine-score
- 3e9ad7ae [fix] make /stats more CSP compliant - github issue form
- 34859d0e [fix] make /stats more CSP compliant - oscar theme
- 0a6c4884 [fix] make /stats more CSP compliant - simple theme
- cdfb4b7f [fix] make /stats more CSP compliant - bar graph
- 965817f2 [fix] simple theme - generate missing sourceMap file

this patch is generated by::

     make themes.all

Reported-by: https://github.com/searxng/searxng/issues/57
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 0507e185a5 [fix] bar graph and rename CSS class engine-scores -> engine-score
- drop #main_stats selector in stats.less
- 'engine-score' exists before this PR.
- untabify searx/static/themes/__common__/less/stats.less

for details see comment at: d93bec7638..1204e4f07e (r633571496)

Suggested-by: @dalf in commit 1204e4f0
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 3e9ad7ae0c [fix] make /stats more CSP compliant - github issue form
Hide textarea from github issue form::

    ./__common__/new_issue.html:6:    <textarea name="body" style="display: none;">{{- '' -}}

BTW: fix indentation.

Reported-by: https://github.com/searxng/searxng/issues/57
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 0a6c488417 [fix] make /stats more CSP compliant - simple theme
Replace simple theme's *styles* (see below) by CSP compliant implementation in
``searx/static/themes/simple/less/stats.less`` ::

    ./simple/stats.html:26:  <table style="max-width: 1280px; margin: 0 auto 0 0;">
    ./simple/stats.html:28:  <th scope="col" style="width:20rem;">{{ th_sort('name', _("Engine name")) }}</th>
    ./simple/stats.html:29:  <th scope="col" style="width:7rem; text-align: right;">{{ th_sort('score', _('Scores')) }}</th>
    ./simple/stats.html:32:  <th scope="col" style="text-align: right;">{{ th_sort('reliability', _('Reliability')) }}</th>
    ./simple/stats.html:37:  <td style="text-align: right;">
    ./simple/stats.html:90:  <td style="text-align: right;"> {{ engine_reliabilities.get(engine_stat.name, {}).get('reliablity') }}</td>
    ./simple/stats.html:106: <table style="max-width: 1280px; margin: 1rem; border: 1px solid gray;">
    ./simple/stats.html:107: <tbody style="padding-top: 1rem;">
    ./simple/stats.html:110: <th scope="row" style="width: 10rem">{{ _('Exception') }}</th><td>{{ error.exception_classname }}</td>
    ./simple/stats.html:112: <th scope="row" style="width: 10rem">{{ _('Message') }}</th><td>{{ error.log_message }}</td>
    ./simple/stats.html:114: <th scope="row" style="width: 10rem">{{ _('Percentage') }}</th><td style="width: 10rem">{{ error.percentage }}</td>
    ./simple/stats.html:119: <span style="border-right: 1px solid gray; padding: 0 1rem 0 0; margin: 0 0 0 0.5rem;">{{ param }}</span>
    ./simple/stats.html:136: <th scope="col" style="width: 10rem">{{ _('Failed test') }}</th>

Reported-by: https://github.com/searxng/searxng/issues/57
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser cdfb4b7ff9 [fix] make /stats more CSP compliant - bar graph
Replace bar graph's *styles* (see below) by CSP compliant implementation in
``searx/static/themes/__common__/less/stats.less`` ::

    ./simple/stats.html:49: <span style="width: calc(max(2px, 100%*{{ (engine_stat.result_count / engine_stats.max_result_count )|round(3) }}))" class="stacked-bar-chart-serie1"></span>{{- "" -}}
    ./simple/stats.html:57: <span style="width: calc(max(2px, 100%*{{ (engine_stat.http / engine_stats.max_time )|round(3) }}))" class="stacked-bar-chart-serie1"></span>{{- "" -}}
    ./simple/stats.html:58: <span style="width: calc(100%*{{ engine_stat.processing / engine_stats.max_time |round(3) }})" class="stacked-bar-chart-serie2"></span>{{- "" -}}
    ./oscar/stats.html:50:  <span style="width: calc(max(2px, 100%*{{ (engine_stat.result_count / engine_stats.max_result_count )|round(3) }}))" class="stacked-bar-chart-serie1"></span>{{- "" -}}
    ./oscar/stats.html:58:  <span style="width: calc(max(2px, 100%*{{ (engine_stat.http / engine_stats.max_time )|round(3) }}))" class="stacked-bar-chart-serie1"></span>{{- "" -}}
    ./oscar/stats.html:59:  <span style="width: calc(100%*{{ engine_stat.processing / engine_stats.max_time |round(3) }})" class="stacked-bar-chart-serie2"></span>{{- "" -}}

Reported-by: https://github.com/searxng/searxng/issues/57
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 965817f294 [fix] simple theme - generate missing sourceMap file
C&P from searx/static/themes/oscar/gruntfile.js

Suggested-by: @dalf in commit 1204e4f0
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 93594a7b42 [less] update grunt-contrib-less v3.3.0
Upgraded [v3.3.0] otherwise::

`  width: calc(100% - 5rem);`

becomes `width: 95%` once compiled by less version 1.4.1.

[v3.3.0] https://github.com/gruntjs/grunt-contrib-less/releases/tag/v3.0.0

Suggested-by: @dalf in commit 1204e4f0
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 8291804082 [static] make themes.all - from commit 9e8171e38
Based on commit 9e8171e38 this patch is generated by::

     make themes.all

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 70cc196e2d [fix] new_issue.html: drop inline style attributes (CSP conformance)
Inline styles are blocked by default with Content Security Policy (CSP).  Move
the inline styles from 'new_issue.html' to::

    searx/static/themes/__common__/less/new_issue.less

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 7f2dc530b2 [fix] simple theme - remove no longer used stats.less file
File searx/static/themes/simple/less/stats.less is not used (imported) in any
other less file.  I can't say when it's usage was dropped or if it has ever been
used.  ATM this file is without any usage.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 54d57c8296 [fix] grunt/less/development: oscar light & dark logicodev mixes CSS
closes: https://github.com/searxng/searxng/issues/39

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 6b92e8c6fd [upd] ./manage pyenv.cmd searx_extra/update/update_pygments.py
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Alexandre Flament 7032f7521c [mod] /stats: simple theme implementation 3 years ago
Alexandre Flament 09e7ecdce2 [mod] /stats : add reliability column and sort by column links 3 years ago
Alexandre Flament 65c29081cc [mod] update /stats 3 years ago
Alexandre Flament baff1cbbab fix issues from review 3 years ago
Alexandre Flament 7cfd8d900a [mod] oscar: /preferences , engines tab: report engine times
* display the median time instead of the average.
* add a "Reliability" column (sum up the metrics and the checker results).
* the "selected language", "SafeSearch", "Time range" values are displayed as "broken" when the checker tests fail.
3 years ago
Alexandre Flament 92db0227b1 Merge remote-tracking branch 'dalf/oscar-images' 3 years ago
Markus Heiser 062d589f86 [fix] xpath expressions to grap all items from bandcamp's response
I also found some items missing a thumbnail and I used text_extract for content
and title, to remove unneeded whitespaces.

BTW: added bandcamp's favicon

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Alexandre Flament 7a0fbdecc4 [enh] oscar: image thumbnail layout
Adjust thumbnail sizes to fill the container width
3 years ago
Marc Abonce Seguin 419b907a0b fix dark "expand" button from infobox 3 years ago
Alexandre Flament d648001688 [mod] preferences: a tooltip is shown when the mouse is over the engine names 3 years ago
Alexandre Flament 6bd01bf81f [mod] oscar: fix the sourcemap URL in *.min.css
Close https://github.com/searx/searx/issues/2670

Note: clean-css contains a bug:
* a multiline comment or URL adds "$stdin" to the sourcemap (see src/less/logicodev/search.less)
* in this case when the user opens the devtools, the browser fails to load this "https://.../$stdin" URL
* it is not a problem and the error appears only when the user actively tries to debug the CSS.
* seems related to https://github.com/jakubpawlowicz/clean-css/issues/593
3 years ago
Alexandre Flament 6553c79029 [mod] replace /translations.js by embedded JSON
In webapp.py, there is a new function "get_translations" lists available translations

Close #2064
3 years ago
Alexandre Flament 32cd0d31b3 [mod] upgrade pygments
add searx_extra/update/update_pygments.py to update the css style of the oscar and simple themes.
3 years ago