diff options
Diffstat (limited to 'elm/searchtabs.js')
-rw-r--r-- | elm/searchtabs.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/elm/searchtabs.js b/elm/searchtabs.js new file mode 100644 index 00000000..eed07ffc --- /dev/null +++ b/elm/searchtabs.js @@ -0,0 +1,11 @@ +document.querySelectorAll('#searchtabs a').forEach(function(l) { + l.onclick = function() { + var str = document.getElementById('q').value; + if(str.length > 1) { + if(this.href.indexOf('/g') >= 0 || this.href.indexOf('/i') >= 0) + this.href += '/list'; + this.href += '?q=' + encodeURIComponent(str); + } + return true; + }; +}); |