Add login tab. Add javascript from mk2-ui-core
[pazpar2-moved-to-github.git] / www / iphone / example_client.js
index 4edf65c..a131b8a 100644 (file)
@@ -9,10 +9,10 @@ var pazpar2path = '/pazpar2/search.pz2';
 var showResponseType = '';
 var querys = {'su': '', 'au': '', 'xt': ''};
 
-if (document.location.hash == '#useproxy') {
+if (document.location.hash == '#useproxy' || document.location.search.match("useproxy=true")) {
     usesessions = false;
     pazpar2path = '/service-proxy/';
-    showResponseType = 'json';
+    showResponseType = 'xml';
 }
 
 my_paz = new pz2( { "onshow": my_onshow,
@@ -282,6 +282,8 @@ function domReady ()
     document.select.perpage.onchange = onSelectDdChange;
     if (document.location.search.match("inApp=true")) 
        applicationMode(true);
+    else
+       applicationMode(false);
 }
  
 function applicationMode(newmode) 
@@ -303,6 +305,7 @@ function applicationMode(newmode)
 function onFormSubmitEventHandler() 
 {
     resetPage();
+    document.getElementById("logo").style.display = 'none';
     loadSelect();
     triggerSearch();
     submitted = true;
@@ -490,6 +493,7 @@ function showDetails (prefixRecId) {
     
     // remove current detailed view if any
     var detRecordDiv = document.getElementById('det_'+oldRecId);
+    //alert("oldRecId: " + oldRecId + " " + detRecordDiv != null); 
     // lovin DOM!
     if (detRecordDiv)
       detRecordDiv.parentNode.removeChild(detRecordDiv);
@@ -569,7 +573,7 @@ function renderDetails_iphone(data, marker)
        //return renderDetails(data,marker);
 
 
-    var details = ''
+    var details = '<div class="details" id="det_'+data.recid+'" >'
 /*
     details = '<div id="header" id="det_'+data.recid+'">' 
        + '<h1>Detailed Info</h1>' 
@@ -598,7 +602,7 @@ function renderDetails_iphone(data, marker)
     
     if (data["location"][0]["@name"] != undefined)
        details += renderLine('Location', data["location"][0]["@name"] + " (" +data["location"][0]["@id"] + ")");
-    details += '</ul>';
+    details += '</ul></div>';
     return details;
 }