From 5ae4e929e5dc537520d0ea03787087079bb67978 Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Thu, 20 Jun 2013 14:15:01 +0000 Subject: [PATCH] bring support for direct access pazpar2 --- experiments/spclient/mkws.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/experiments/spclient/mkws.js b/experiments/spclient/mkws.js index 3eb4931..69a30f7 100644 --- a/experiments/spclient/mkws.js +++ b/experiments/spclient/mkws.js @@ -1,18 +1,26 @@ /* A very simple client that shows a basic usage of the pz2.js */ +"use strict"; // HTML5 + +var pazpar2_url = mkws_config.pazpar2_url ? mkws_config.pazpar2_url : "/pazpar2/search.pz2"; +var service_proxy_url = mkws_config.service_proxy_url ? mkws_config.service_proxy_url : "/service-proxy/"; + +var pazpar2path = mkws_config.use_service_proxy ? service_proxy_url : pazpar2_url; +var usesessions = mkws_config.use_service_proxy ? false : true; + // create a parameters array and pass it to the pz2's constructor // then register the form submit event with the pz2.search function // autoInit is set to true on default var my_paz = new pz2( { "onshow": my_onshow, "showtime": 500, //each timer (show, stat, term, bytarget) can be specified this way - "pazpar2path": '/service-proxy/', + "pazpar2path": pazpar2path, "oninit": my_oninit, "onstat": my_onstat, "onterm": my_onterm, "termlist": "xtargets,subject,author", "onbytarget": my_onbytarget, - "usesessions" : false, + "usesessions" : usesessions, "showResponseType": '', // or "json" (for debugging?) "onrecord": my_onrecord } ); // some state vars -- 1.7.10.4