Commit graph

5 commits

Author SHA1 Message Date
Martin Fischer
3f77ff29a3 [fix] plugin JS/CSS dependencies depend on themes
SearXNG supports plugins. Plugins can declare JavaScript and CSS
dependencies. Currently three plugins declare such dependencies:

* search_on_category_select (on by default)
* vim_hotkeys
* infinite_scroll

If a user enables a plugin its JavaScript and CSS dependencies are
embedded into every page. Sounds simple right?

Ironically in the Simple theme things start to get complicated:
The scripts were originally written for the Oscar theme and thus depend
on jQuery (which isn't loaded in the Simple theme) and look for certain
element identifiers (which aren't present in the Simple theme).  So how
did the plugins actually work with the simple theme?

The simple theme just didn't embed the plugin dependencies (which wasn't
even documented anywhere). Instead the simple theme checked if the paths
contained a certain script path, then set an attribute, which 00_init.js
detected and turned into a boolean, which was then used to enable
vanilla-JS reimplementations of the plugins.

This commit ends this horrible hack (and fixes #769).  The necessary
changes to the Simple theme are introduced in the next commit.
2022-01-18 19:03:15 +01:00
Markus Heiser
3d96a9839a [format.python] initial formatting of the python code
This patch was generated by black [1]::

    make format.python

[1] https://github.com/psf/black

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-12-27 09:26:22 +01:00
Étienne Deparis
0d4d58f794 [enh] Add preference section to two upstream plugins for simple theme integration 2019-01-07 10:48:14 +01:00
Adam Tauber
257e52954a [enh][fix] update to latest dependencies ++ fix tests & travis test runner
WARNING: dependency changes
2016-07-04 22:46:43 +02:00
Kirill Isakov
3246541bdc [WIP] Add vim-hotkeys plugin 2016-04-23 22:26:02 +06:00