From: Mike Taylor Date: Fri, 6 Dec 2013 18:00:40 +0000 (+0000) Subject: Support specification of (a single) target in auto-searches. X-Git-Tag: 0.9.1~120 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=37890f04937e3a8a55cea1b2d1a535ebed385cde;p=mkws-moved-to-github.git Support specification of (a single) target in auto-searches. We still need to generalise this to searching multiple targets. --- diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index c0171d9..67bedc6 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -417,7 +417,7 @@ function onFormSubmitEventHandler() return false; } -function newSearch(query, sort) +function newSearch(query, sort, targets) { if (!mkws.authenticated) { alert("searching before authentication"); @@ -428,7 +428,7 @@ function newSearch(query, sort) redraw_navi(); resetPage(); loadSelect(); - triggerSearch(query, sort); + triggerSearch(query, sort, targets); mkws.switchView('records'); // In case it's configured to start off as hidden submitted = true; } @@ -448,7 +448,7 @@ function resetPage() totalRec = 0; } -function triggerSearch (query, sort) +function triggerSearch (query, sort, targets) { var pp2filter = ""; var pp2limit = ""; @@ -460,6 +460,10 @@ function triggerSearch (query, sort) if (sort) { mkws.sort = sort; } + if (targets) { + // ### should support multiple |-separated targets + mkws.filters.push({ id: targets, name: targets }); + } for (var i in mkws.filters) { var filter = mkws.filters[i];