X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=experiments%2Fspclient%2Fmkws.js;h=b29be6d17210470f2defebb11ecf0995dc4566d0;hb=8d5d8113fbe6cfe3e4061dff828eb0fddae2061c;hp=8f106b0c8344b5ba9597335e42529162b541351e;hpb=3cdb0893f242cff43cf4191ad226b94a4c8efcbf;p=mkws-moved-to-github.git
diff --git a/experiments/spclient/mkws.js b/experiments/spclient/mkws.js
index 8f106b0..b29be6d 100644
--- a/experiments/spclient/mkws.js
+++ b/experiments/spclient/mkws.js
@@ -30,7 +30,7 @@ var mkws_locale_lang = {
"Authors": "Autoren",
"Subjects": "Schlagwörter",
"Sources": "Daten und Quellen",
- "TERMLISTS": "Termlisten",
+ "Termlists": "Termlisten",
"Next": "Weiter",
"Prev": "Zurück",
"Search": "Suche",
@@ -54,7 +54,7 @@ var mkws_locale_lang = {
"Authors": "Forfattere",
"Subjects": "Emner",
"Sources": "Kilder",
- "TERMLISTS": "TERMLISTS",
+ "Termlists": "Termlists",
"Next": "Næste",
"Prev": "Forrige",
"Search": "Søg",
@@ -162,20 +162,27 @@ function my_onterm(data) {
return;
var termlists = [];
- termlists.push('
' + M('TERMLISTS') + ':
' + M('Sources') + '
');
+ termlists.push('' + M('Termlists') + '
');
+
+ termlists.push('');
+ termlists.push('
' + M('Sources') + '
');
for (var i = 0; i < data.xtargets.length && i < SourceMax; i++ ) {
termlists.push('
' + data.xtargets[i].name
+ ' (' + data.xtargets[i].freq + ')');
}
+ termlists.push('
');
- termlists.push('
' + M('Subjects') + '
');
+ termlists.push('');
+ termlists.push('
' + M('Subjects') + '
');
for (var i = 0; i < data.subject.length && i < SubjectMax; i++ ) {
termlists.push('
' + data.subject[i].name + ' ('
+ data.subject[i].freq + ')');
}
+ termlists.push('
');
- termlists.push('
' + M('Authors') + '
');
+ termlists.push('');
+
var termlist = document.getElementById("termlist");
replaceHtml(termlist, termlists.join(''));
}
@@ -433,30 +442,39 @@ function renderDetails(data, marker)
{
var details = '';
if (marker) details += ''+ marker + ' |
';
- if (data["md-title"] != undefined) {
- details += '' + M('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 += ' |
';
- }
- if (data["md-date"] != undefined)
- details += '' + M('Date') + ' | : ' + data["md-date"] + ' |
';
- if (data["md-author"] != undefined)
- details += '' + M('Author') + ' | : ' + data["md-author"] + ' |
';
- if (data["md-electronic-url"] != undefined)
- details += 'URL | : ' + data["md-electronic-url"] + '' + ' |
';
- if (data["location"][0]["md-subject"] != undefined)
- details += '' + M('Subject') + ' | : ' + data["location"][0]["md-subject"] + ' |
';
- if (data["location"][0]["@name"] != undefined)
- details += '' + M('Location') + ' | : ' + data["location"][0]["@name"] + " (" +data["location"][0]["@id"] + ")" + ' |
';
+
+ details += renderField("Title", data["md-title"], data["md-title-remainder"], data["md-title-responsibility"]);
+ details += renderField("Date", data["md-date"]);
+ details += renderField("Author", data["md-author"]);
+ details += renderField("URL", data["md-electronic-url"]);
+ details += renderField("Subject", data["location"][0]["md-subject"]);
+ details += renderField("Location", data["location"][0]["@name"], data["location"][0]["@id"]);
details += '
';
+
return details;
}
+function renderField(caption, data, data2, data3) {
+ if (data === undefined) {
+ return "";
+ }
+
+ if (caption == "URL") {
+ data = '' + data + '';
+ }
+
+ if (data2 != undefined) {
+ data = data + " (" + data2 + ")";
+ }
+
+ if (data3 != undefined) {
+ data = data + " " + data3 + "";
+ }
+
+ return '' + M(caption) + ' | ' + data + ' |
';
+}
+
+
/*
* All the HTML stuff to render the search forms and
* result pages.
@@ -521,7 +539,7 @@ function mkws_html_all(config) {
\
\
\
@@ -675,7 +693,7 @@ function mkws_html_lang(mkws_config) {
data += ' | ';
if (lang == l) {
- data += l;
+ data += ' ' + l + ' ';
} else {
data += ' ' + l + ' '
}
|