summaryrefslogtreecommitdiff
path: root/searx/webapp.py
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2015-04-12 19:24:01 +0200
committerAdam Tauber <asciimoo@gmail.com>2015-04-12 19:24:01 +0200
commitdd84814b68369e36d6be20bae707848a051a025a (patch)
treece614f51091235ee9cceec9fbd3728cef2ebca31 /searx/webapp.py
parentf59daa4a4b92ae3c6cbe2482a14f50810a15a644 (diff)
downloadsearxng-dd84814b68369e36d6be20bae707848a051a025a.tar.gz
searxng-dd84814b68369e36d6be20bae707848a051a025a.zip
[enh] plugins: client side dependency support
Diffstat (limited to 'searx/webapp.py')
-rw-r--r--searx/webapp.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index cbdff8962..89ab9b543 100644
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -301,6 +301,16 @@ def render(template_name, override_theme=None, **kwargs):
kwargs['cookies'] = request.cookies
+ kwargs['scripts'] = set()
+ for plugin in request.user_plugins:
+ for script in plugin.js_dependencies:
+ kwargs['scripts'].add(script)
+
+ kwargs['styles'] = set()
+ for plugin in request.user_plugins:
+ for css in plugin.css_dependencies:
+ kwargs['styles'].add(css)
+
return render_template(
'{}/{}'.format(kwargs['theme'], template_name), **kwargs)