From: Niels Erik G. Nielsen Date: Sat, 7 May 2011 13:05:23 +0000 (-0400) Subject: JS forwards identifier for current browser window X-Git-Tag: v1.5.7~13^2~4^2~2 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=c7949a6cf267d6be3e3cbaf3fb2a0815adddcd73;p=pazpar2-moved-to-github.git JS forwards identifier for current browser window ... to enable support for multiple simultaneous Pazpar2 sessions in different windows/tabs of the same browser via Service Proxy --- diff --git a/js/pz2.js b/js/pz2.js index 8aab9bf..31d2c33 100644 --- a/js/pz2.js +++ b/js/pz2.js @@ -226,7 +226,7 @@ pz2.prototype = var context = this; var request = new pzHttpRequest(this.pz2String, this.errorHandler); request.safeGet( - { "command": "ping", "session": this.sessionID }, + { "command": "ping", "session": this.sessionID, "windowId" : self.window.name }, function(data) { if ( data.getElementsByTagName("status")[0] .childNodes[0].nodeValue == "OK" ) { @@ -271,14 +271,15 @@ pz2.prototype = else var start = 0; - var searchParams = { - "command": "search", - "query": this.currQuery, - "session": this.sessionID + var searchParams = { + "command": "search", + "query": this.currQuery, + "session": this.sessionID, + "windowId" : self.window.name }; if (filter !== undefined) - searchParams["filter"] = filter; + searchParams["filter"] = filter; // copy additional parmeters, do not overwrite if (addParamsArr != undefined) { @@ -322,7 +323,7 @@ pz2.prototype = var context = this; var request = new pzHttpRequest(this.pz2String, this.errorHandler); request.safeGet( - { "command": "stat", "session": this.sessionID }, + { "command": "stat", "session": this.sessionID, "windowId" : self.window.name }, function(data) { if ( data.getElementsByTagName("stat") ) { var activeClients = @@ -379,7 +380,8 @@ pz2.prototype = "num": this.currentNum, "sort": this.currentSort, "block": 1, - "type": this.showResponseType + "type": this.showResponseType, + "windowId" : self.window.name }, function(data, type) { var show = null; @@ -453,7 +455,8 @@ pz2.prototype = var recordParams = { "command": "record", "session": this.sessionID, - "id": this.currRecID + "id": this.currRecID, + "windowId" : self.window.name }; this.currRecOffset = null; @@ -541,7 +544,8 @@ pz2.prototype = { "command": "termlist", "session": this.sessionID, - "name": this.termKeys + "name": this.termKeys, + "windowId" : self.window.name }, function(data) { if ( data.getElementsByTagName("termlist") ) { @@ -618,7 +622,7 @@ pz2.prototype = var context = this; var request = new pzHttpRequest(this.pz2String, this.errorHandler); request.safeGet( - { "command": "bytarget", "session": this.sessionID }, + { "command": "bytarget", "session": this.sessionID, "windowId" : self.window.name}, function(data) { if ( data.getElementsByTagName("status")[0] .childNodes[0].nodeValue == "OK" ) {