chg: replaced google-search property with search.provider
enabled button for more results at other search providers
This commit is contained in:
parent
f65eff0015
commit
b8b58a2ce7
2 changed files with 11 additions and 1 deletions
|
|
@ -288,6 +288,15 @@
|
|||
<dl class='uk-description-list-line'>
|
||||
<% response.result %>
|
||||
</dl>
|
||||
<% if <% property search.provider %> is null then '' else <% site.skin $Site#moreResults %> %>
|
||||
|
||||
<% #moreResults %>
|
||||
<div class='uk-text-center'>
|
||||
<a href='<% property search.provider %>?q=<% request.q %>+site:<% site.href %>' class='uk-button'>
|
||||
<% gettext 'More results at {0}' <% property search.provider | replace 'https?://' '' %> %>
|
||||
<i class='uk-icon uk-icon-arrow-circle-right'></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<% #opensearchdescription %>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
|
|
|||
|
|
@ -234,7 +234,8 @@ Members.prototype.onCodeUpdate = function() {
|
|||
});
|
||||
|
||||
helma.aspects.addBefore(this, 'search_action', function (args, func, site) {
|
||||
if (getProperty('google-search') === 'true') {
|
||||
const provider = getProperty('search.provider');
|
||||
if (provider === 'google') {
|
||||
if (req.data.q) {
|
||||
if (!req.data.q.contains('site:')) {
|
||||
res.redirect(site.href(req.action) + '?q=' + encodeURIComponent(req.data.q + ' site:' + site.href().replace('test.www.', '')));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue