X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=www%2Fjsdemo%2Fexample_client.js;h=8342494859d9a2a72b9ef965f1ace4272a5dd87c;hb=5ff4a545337696359ee78f70c6612484af8bc3bf;hp=51c0e29cbc0a08ec091c671cdd4c13158b2b429b;hpb=5fd1cc0768a02607d750dd8d53149abfb94d483d;p=pazpar2-moved-to-github.git diff --git a/www/jsdemo/example_client.js b/www/jsdemo/example_client.js index 51c0e29..8342494 100644 --- a/www/jsdemo/example_client.js +++ b/www/jsdemo/example_client.js @@ -1,5 +1,4 @@ /* A very simple client that shows a basic usage of the pz2.js -** $Id: example_client.js,v 1.6 2008-01-15 13:59:18 jakub Exp $ */ // create a parameters array and pass it to the pz2's constructor @@ -7,12 +6,14 @@ // autoInit is set to true on default var usesessions = true; var pazpar2path = '/pazpar2/search.pz2'; -if (document.location.hash == '#nosessions') { +var showResponseType = ''; +if (document.location.hash == '#useproxy') { usesessions = false; - pazpar2path = '/pazpar2-proxy/'; + pazpar2path = '/service-proxy/'; + showResponseType = 'json'; } -my_paz = new pz2( { "onshow": my_onshow, +var my_paz = new pz2( { "onshow": my_onshow, "showtime": 500, //each timer (show, stat, term, bytarget) can be specified this way "pazpar2path": pazpar2path, "oninit": my_oninit, @@ -21,6 +22,7 @@ my_paz = new pz2( { "onshow": my_onshow, "termlist": "xtargets,subject,author", "onbytarget": my_onbytarget, "usesessions" : usesessions, + "showResponseType": showResponseType, "onrecord": my_onrecord } ); // some state vars var curPage = 1; @@ -243,7 +245,7 @@ function drawPager (pagerDiv) var prev = '<< Prev | '; if (curPage > 1) - var prev = ' | '; var middle = ''; @@ -258,14 +260,14 @@ function drawPager (pagerDiv) var next = ' | Next >>'; if (pages - curPage > 0) - var next = ' | '; - predots = ''; + var predots = ''; if (firstClkbl > 1) predots = '...'; - postdots = ''; + var postdots = ''; if (lastClkbl < pages) postdots = '...';