X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=experiments%2Fspclient%2Fmkws.js;h=f752a30b1ef04a3d9ecd280b2e1b1e19298ddf4b;hb=5cf55019a847a3db9c0b8ff19cc28e9e5a530ec0;hp=317027cec725a6e05a53c68abf1ffb0041691108;hpb=3bf6bcb8ee9b923acc06fff0e02f9b5e8978e56b;p=mkws-moved-to-github.git diff --git a/experiments/spclient/mkws.js b/experiments/spclient/mkws.js index 317027c..f752a30 100644 --- a/experiments/spclient/mkws.js +++ b/experiments/spclient/mkws.js @@ -30,6 +30,11 @@ var mkws_locale_lang = { "to": "von", "of": "aus", "found": "gefunden", + "Title": "Titel", + "Author": "Autor", + "Date": "Datum", + "Subject": "Schlagwort", + "Location": "Ort", "dummy": "dummy" }, @@ -49,6 +54,11 @@ var mkws_locale_lang = { "to": "til", "of": "ud af", "found": "fandt", + "Title": "Title", + "Author": "Forfatter", + "Date": "Dato", + "Subject": "Emneord", + "Location": "Lokation", "dummy": "dummy" } @@ -401,7 +411,7 @@ function renderDetails(data, marker) var details = '
'; if (marker) details += ''; if (data["md-title"] != undefined) { - details += ''; } if (data["md-date"] != undefined) - details += ''; + details += ''; if (data["md-author"] != undefined) - details += ''; + details += ''; if (data["md-electronic-url"] != undefined) details += ''; if (data["location"][0]["md-subject"] != undefined) - details += ''; + details += ''; if (data["location"][0]["@name"] != undefined) - details += ''; + details += ''; details += '
'+ marker + '
Title: '+data["md-title"]; + details += '
' + M('Title') + ': '+data["md-title"]; if (data["md-title-remainder"] !== undefined) { details += ' : ' + data["md-title-remainder"] + ' '; } @@ -411,15 +421,15 @@ function renderDetails(data, marker) details += '
Date: ' + data["md-date"] + '
' + M('Date') + ': ' + data["md-date"] + '
Author: ' + data["md-author"] + '
' + M('Author') + ': ' + data["md-author"] + '
URL: ' + data["md-electronic-url"] + '' + '
Subject: ' + data["location"][0]["md-subject"] + '
' + M('Subject') + ': ' + data["location"][0]["md-subject"] + '
Location: ' + data["location"][0]["@name"] + " (" +data["location"][0]["@id"] + ")" + '
' + M('Location') + ': ' + data["location"][0]["@name"] + " (" +data["location"][0]["@id"] + ")" + '
'; return details; } @@ -438,6 +448,7 @@ function mkws_html_all(data) { perpage_default: 20, query_width: 50, switch_menu: true, /* show/hide Records|Targets menu */ + lang_menu: true, /* show/hide language menu */ debug: 0, /* debug level for development: 0..2 */ dummy: "dummy" @@ -455,16 +466,21 @@ function mkws_html_all(data) { config[k] = data[k]; debug("Set config: " + k + ' => ' + data[k]); } + if (mkws_config.query_width < 5 || mkws_config.query_width > 150) { + debug("Reset query width: " + mkws_config.query_width); + mkws_config.query_width = 50; + } mkws_set_lang(mkws_config); - mkws_html_lang(mkws_config); + if (mkws_config.lang_menu) + mkws_html_lang(mkws_config); // For some reason, doing this programmatically results in // document.search.query being undefined, hence the raw HTML. debug("HTML search form"); $("#mkwsSearch").html('\
\ - \ + \ \
');