Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/pazpar2
[pazpar2-moved-to-github.git] / www / iphone / example_client.js
index a336f8e..3edabac 100644 (file)
@@ -181,12 +181,15 @@ function my_onshow(data) {
                  +'<a href="#" id="rec_'+hit.recid
                  +'" onclick="showDetails(this.id);return false;">' 
                  + hit["md-title"] +'</a> '); 
-       if (hit["md-title-responsibility"] !== undefined) {
+       if (hit["md-title-remainder"] !== undefined) {
+           html.push('<a href="#">' + hit["md-title-remainder"] + ' </a> ');
+       }
+       if (hit["md-author"] != undefined) {
+           html.push('<a href="#">'+hit["md-author"]+'</a> ');
+       }
+       else if (hit["md-title-responsibility"] !== undefined) {
            html.push('<a href="#">'+hit["md-title-responsibility"]+'</a> ');
-           if (hit["md-title-remainder"] !== undefined) {
-               html.push('<a href="#">' + hit["md-title-remainder"] + ' </a> ');
-           }
-       }
+       }
         if (hit.recid == curDetRecId) {
             html.push(renderDetails_iphone(curDetRecData));
         }
@@ -699,8 +702,8 @@ function renderDetails(data, marker)
        if (data["md-title-remainder"] !== undefined) {
              details += ' : <span>' + data["md-title-remainder"] + ' </span>';
        }
-       if (data["md-title-responsibility"] !== undefined) {
-             details += ' <span><i>'+ data["md-title-responsibility"] +'</i></span>';
+       if (data["md-author"] !== undefined) {
+             details += ' <span><i>'+ data["md-auhtor"] +'</i></span>';
        }
          details += '</td></tr>';
     }
@@ -757,7 +760,9 @@ function renderDetails_iphone(data, marker)
         if (data["md-title-remainder"] !== undefined) {
              details += ' ' + data["md-title-remainder"] + ' ';
         }
-        if (data["md-title-responsibility"] !== undefined) {
+        if (data["md-author"] !== undefined) {
+             details += '<i>'+ data["md-author"] +'</i>';
+        } else if (data["md-title-responsibility"] !== undefined) {
              details += '<i>'+ data["md-title-responsibility"] +'</i>';
         }
         details += '</big>'