From c2df52da18ce8a772a1dd70c8ff14b7527fd4339 Mon Sep 17 00:00:00 2001 From: Yorhel Date: Mon, 1 Feb 2010 13:27:23 +0100 Subject: Properly copy over search string on switching with the searchtabs --- ChangeLog | 1 + data/script.js | 16 ++++++++++++++++ data/style.css | 6 +++--- lib/VNDB/Util/CommonHTML.pm | 19 ++++++------------- 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5b13dae1..0bd97f2e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,7 @@ git - ? - Notification system (still only used for PMs) - Removed the ?l10n= paremeter - Remove sessions that haven't been used for more than a month + - Properly copy over search string on switching with the searchtabs 2.10 - 2010-01-10 - VN score on tag pages use plain averages instead of bayesian rating diff --git a/data/script.js b/data/script.js index 437385cd..07dd1581 100644 --- a/data/script.js +++ b/data/script.js @@ -1973,6 +1973,22 @@ if(byId('lang_select')) { l[i].onclick = f; } +// search tabs +if(byId('searchtabs')) { + var f = function() { + var str = byId('q').value; + if(str.length > 1) { + if(this.href.indexOf('/g') >= 0) + this.href += '/list'; + this.href += '?q=' + encodeURIComponent(str); + } + return true; + }; + var l = byName(byId('searchtabs'), 'a'); + for(var i=0; i 'search'; - p class => 'searchtabs'; - a href => "/v/all$q", $sel eq 'v' ? (class => 'sel') : (), mt '_searchbox_vn'; - a href => "/r$q", $sel eq 'r' ? (class => 'sel') : (), mt '_searchbox_releases'; - a href => "/p/all$q", $sel eq 'p' ? (class => 'sel') : (), mt '_searchbox_producers'; - a href => '/g'.($q?"/list$q":''), $sel eq 'g' ? (class => 'sel') : (), mt '_searchbox_tags'; - a href => "/u/all$q", $sel eq 'u' ? (class => 'sel') : (), mt '_searchbox_users'; + p id => 'searchtabs'; + a href => '/v/all', $sel eq 'v' ? (class => 'sel') : (), mt '_searchbox_vn'; + a href => '/r', $sel eq 'r' ? (class => 'sel') : (), mt '_searchbox_releases'; + a href => '/p/all', $sel eq 'p' ? (class => 'sel') : (), mt '_searchbox_producers'; + a href => '/g', $sel eq 'g' ? (class => 'sel') : (), mt '_searchbox_tags'; + a href => '/u/all', $sel eq 'u' ? (class => 'sel') : (), mt '_searchbox_users'; end; input type => 'text', name => 'q', id => 'q', class => 'text', value => $v; input type => 'submit', class => 'submit', value => mt '_searchbox_submit'; -- cgit v1.2.3