diff options
| author | Matěj Grabovský <mgrabovsky@yahoo.com> | 2015-03-27 13:55:01 +0100 |
|---|---|---|
| committer | Matěj Grabovský <mgrabovsky@yahoo.com> | 2015-03-27 13:55:01 +0100 |
| commit | 6b37abab85ad342fd18e5c09c65248634e7dd194 (patch) | |
| tree | d9b4e8237b4deddff16c3f8f786fffb6a9c5d05a /js/catalog-search.js | |
| parent | 3d2ddb8c3b3eb0f1d5c697bc9dcf7faf371f6708 (diff) | |
Allow catalog search by a URL fragment (#s=...)
Diffstat (limited to 'js/catalog-search.js')
| -rw-r--r-- | js/catalog-search.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/js/catalog-search.js b/js/catalog-search.js index b91fc1ea..3235d1dc 100644 --- a/js/catalog-search.js +++ b/js/catalog-search.js @@ -26,9 +26,14 @@ var catalogSearch = function() { $threads.hide(); $found.show(); }); + + var m = location.hash.match(/[#&]s=([^&]+)/); + if(m) { + $searchBox.val(decodeURIComponent(m[1])).keyup(); + } }; -// Filter threads by their content, given a regex. Can be extended later to load data +// Filter threads by their content, given a regex. Can be extended to load data // remotely and filter by multiple fields var searchThreads = function($threads, query) { var re = new RegExp(query, 'mi'); |
