on master help sign in
[enh] new plugin to open results on new browser tabs
commitab6a7601cbdbdd93fa07ec6405bc3167f392b792 authorAdam Tauber <asciimoo@gmail.com> dateWed 10 Feb 2016, 18:04 (11 years ago) parent2b53ac9
3 files changed+29
searx/plugins/__init__.py+2 searx/plugins/open_results_on_new_tab.py+24 searx/static/plugins/js/open_results_on_new_tab.js+3
searx/plugins/__init__.py+2
@@ -20,6 +20,7 @@ from searx import logger
2020logger = logger.getChild('plugins')
2121
2222from searx.plugins import (https_rewrite,
23+ open_results_on_new_tab,
2324 self_info,
2425 search_on_category_select,
2526 tracker_url_remover)
@@ -72,6 +73,7 @@ class PluginStore():
7273
7374plugins = PluginStore()
7475plugins.register(https_rewrite)
76+plugins.register(open_results_on_new_tab)
7577plugins.register(self_info)
7678plugins.register(search_on_category_select)
7779plugins.register(tracker_url_remover)
searx/plugins/open_results_on_new_tab.pynew file+24
@@ -0,0 +1,24 @@
1+'''
2+searx is free software: you can redistribute it and/or modify
3+it under the terms of the GNU Affero General Public License as published by
4+the Free Software Foundation, either version 3 of the License, or
5+(at your option) any later version.
6+
7+searx is distributed in the hope that it will be useful,
8+but WITHOUT ANY WARRANTY; without even the implied warranty of
9+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10+GNU Affero General Public License for more details.
11+
12+You should have received a copy of the GNU Affero General Public License
13+along with searx. If not, see < http://www.gnu.org/licenses/ >.
14+
15+(C) 2016 by Adam Tauber, <asciimoo@gmail.com>
16+'''
17+from flask.ext.babel import gettext
18+name = gettext('Open result links on new browser tabs')
19+description = gettext('Results are opened in the same window by default. '
20+ 'This plugin overwrites the default behaviour to open links on new tabs/windows. '
21+ '(JavaScript required)')
22+default_on = False
23+
24+js_dependencies = ('plugins/js/open_results_on_new_tab.js',)
searx/static/plugins/js/open_results_on_new_tab.jsnew file+3
@@ -0,0 +1,3 @@
1+$(document).ready(function() {
2+ $('.result_header > a').attr('target', '_blank');
3+});