From: Jakub Skoczen Date: Thu, 14 Aug 2008 16:59:00 +0000 (+0200) Subject: Can send additional parameters with the search command (connected to bug #2217) X-Git-Tag: v1.1.0~131 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=8dd5c043d15bb050eacd9ebb9a49cacf60164086;p=pazpar2-moved-to-github.git Can send additional parameters with the search command (connected to bug #2217) --- diff --git a/js/pz2.js b/js/pz2.js index 6bad626..4e2702f 100644 --- a/js/pz2.js +++ b/js/pz2.js @@ -237,7 +237,7 @@ pz2.prototype = } ); }, - search: function (query, num, sort, filter, showfrom) + search: function (query, num, sort, filter, showfrom, addParamsArr) { clearTimeout(this.statTimer); clearTimeout(this.showTimer); @@ -271,6 +271,14 @@ pz2.prototype = if (filter !== undefined) searchParams["filter"] = filter; + + // copy additional parmeters, do not overwrite + if (addParamsArr != undefined) { + for (var prop in addParamsArr) { + if (!searchParams.hasOwnProperty(prop)) + searchParams[prop] = addParamsArr[prop]; + } + } var context = this; var request = new pzHttpRequest(this.pz2String, this.errorHandler);