X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=www%2Fiphone%2Fexample_client.js;h=755b68c32c2969569cc47ea601b6f65ca42fbe80;hb=d8f4cd30b30f562c17cf77dae52d4d35e3b5a771;hp=783a1d7ed9180c5f4eea21dcc7c36358f7f18ad1;hpb=6b1261dc2896f94a533577edd4e1eb5c64496e9a;p=pazpar2-moved-to-github.git diff --git a/www/iphone/example_client.js b/www/iphone/example_client.js index 783a1d7..755b68c 100644 --- a/www/iphone/example_client.js +++ b/www/iphone/example_client.js @@ -77,7 +77,7 @@ function my_onshow(data) { } } if (hit.recid == curDetRecId) { - html.push(renderDetails(curDetRecData)); + html.push(renderDetails_iphone(curDetRecData)); } html.push(''); } @@ -243,7 +243,7 @@ function my_onrecord(data) { if (detRecordDiv) return; curDetRecData = data; var recordDiv = document.getElementById('recdiv_'+curDetRecData.recid); - var html = renderDetails(curDetRecData); + var html = renderDetails_iphone(curDetRecData); recordDiv.innerHTML += html; } @@ -446,7 +446,7 @@ function drawPager (pagerDiv) if (lastClkbl < pages) postdots = '...'; - pagerDiv.innerHTML += '
' + pagerDiv.innerHTML += '
' + prev + predots + middle + postdots + next + '

'; } @@ -554,4 +554,54 @@ function renderDetails(data, marker) details += '
'; return details; } - //EOF + +function renderLine(title, value) { + if (value != undefined) + return '
  • ' + title + '

    ' + value + '
  • '; + return ''; +} + +function renderLineURL(title, URL, display) { + if (URL != undefined) + return '
  • ' + title + '

    ' + display + '
  • '; + return ''; +} + +function renderLineEmail(dtitle, email, display) { + if (email != undefined) + return '
  • ' + title + '

    ' + display + '
  • '; + return ''; +} + +function renderDetails_iphone(data, marker) +{ + //return renderDetails(data,marker); + + var details = '
    '; + if (marker) + details += '

    '+ marker + '

    '; + details += '
      '; + if (data["md-title"] != undefined) { + details += '
    • Title

      ' + data["md-title"]; + if (data["md-title-remainder"] !== undefined) { + details += '' + data["md-title-remainder"] + ' '; + } + if (data["md-title-responsibility"] !== undefined) { + details += ' '+ data["md-title-responsibility"] +''; + } + details += '' + details += '
    • ' + } + details + +=renderLine('Date', data["md-date"]) + + renderLine('Author', data["md-author"]) + + renderLineURL('URL', data["md-electronic-url"], data["md-electronic-url"]) + + renderLine('Subject', data["location"][0]["md-subject"]); + + if (data["location"][0]["@name"] != undefined) + renderLine(details, 'Location', data["location"][0]["@name"] + " (" +data["location"][0]["@id"] + ")"); + details += '
    '; + return details; +} + +//EOF