X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=experiments%2Fspclient%2Fmkws.js;h=d3749905da5574ea72e3042f1ee8c17a2ff11304;hb=ff24fce4143dcbda6d62e16e1c8112eaad0baac2;hp=82b431bd9fde66608cb55f86ae4243d09891c7e3;hpb=6b18f26300187eaa2d3c9abde60fb8cfb6a65daf;p=mkws-moved-to-github.git diff --git a/experiments/spclient/mkws.js b/experiments/spclient/mkws.js index 82b431b..d374990 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": "Author", + "Date": "Dato", + "Subject": "Subject", + "Location": "Location", "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; } @@ -437,7 +447,8 @@ function mkws_html_all(data) { sort_default: "relevance", perpage_default: 20, query_width: 50, - switch: true, /* show/hide Records|Targets menu */ + 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('\ -
\ - \ + \ + \ \
'); @@ -477,7 +493,7 @@ function mkws_html_all(data) { \ \
\ -
\ + \ ' + M('Sort by') + mkws_html_sort(config) + '\ ' + M('and show') + ' ' + mkws_html_perpage(config) + '\ ' + M('per page') + '.\ @@ -488,8 +504,7 @@ function mkws_html_all(data) {
\ \ \ - \ -
'); + '); mkws_html_switch(config); if (mkws_config.use_service_proxy) @@ -532,8 +547,8 @@ function mkws_html_switch(config) { '); $("#mkwsTargets").css("display", "none"); - if (!config.switch) { - debug("disable switch"); + if (!config.switch_menu) { + debug("disable switch menu"); $("#mkwsSwitch").css("display", "none"); } } @@ -657,7 +672,8 @@ jQuery.extend({ function debug(string) { if (!mkws_debug) return; - + + var console; // IE8 quirks if (!console) { /* ARGH!!! */ return; }