Insert missing space.
[mkws-moved-to-github.git] / experiments / spclient / mkws.js
index 5db9f7e..6bc3a30 100644 (file)
@@ -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",
@@ -150,11 +150,11 @@ function my_onstat(data) {
     if (stat == null)
        return;
 
-    stat.innerHTML = '<b>STATUS INFO</b> -- Active clients: '
-                        + data.activeclients
-                        + '/' + data.clients + ' -- </span>'
-                        + '<span>Retrieved records: ' + data.records
-                        + '/' + data.hits + ' :.</span>';
+    stat.innerHTML = '<span class="head">Status info</span>' +
+       ' -- ' +
+       '<span class="clients">' + data.activeclients + '/' + data.clients + '</span>' +
+       ' -- ' +
+        '<span class="records">' + data.records + '/' + data.hits + '</span>';
 }
 
 function my_onterm(data) {
@@ -162,20 +162,27 @@ function my_onterm(data) {
        return;
     
     var termlists = [];
-    termlists.push('<hr/><b>' + M('TERMLISTS') + ':</b><hr/><div class="termtitle">' + M('Sources') + '</div>');
+    termlists.push('<div class="title">' + M('Termlists') + '</div>');
+
+    termlists.push('<div class="facet">');
+    termlists.push('<div class="termtitle">' + M('Sources') + '</div>');
     for (var i = 0; i < data.xtargets.length && i < SourceMax; i++ ) {
         termlists.push('<a href="#" target_id='+data.xtargets[i].id
             + ' onclick="limitTarget(this.getAttribute(\'target_id\'), this.firstChild.nodeValue);return false;">' + data.xtargets[i].name
         + ' </a><span> (' + data.xtargets[i].freq + ')</span><br/>');
     }
+    termlists.push('</div>');
 
-    termlists.push('<hr/><div class="termtitle">' + M('Subjects') + '</div>');
+    termlists.push('<div class="facet">');
+    termlists.push('<div class="termtitle">' + M('Subjects') + '</div>');
     for (var i = 0; i < data.subject.length && i < SubjectMax; i++ ) {
         termlists.push('<a href="#" onclick="limitQuery(\'su\', this.firstChild.nodeValue);return false;">' + data.subject[i].name + '</a><span>  ('
               + data.subject[i].freq + ')</span><br/>');
     }
+    termlists.push('</div>');
 
-    termlists.push('<hr/><div class="termtitle">' + M('Authors') + '</div>');
+    termlists.push('<div class="facet">');
+    termlists.push('<div class="termtitle">' + M('Authors') + '</div>');
     for (var i = 0; i < data.author.length && i < AuthorMax; i++ ) {
         termlists.push('<a href="#" onclick="limitQuery(\'au\', this.firstChild.nodeValue);return false;">'
                             + data.author[i].name
@@ -183,6 +190,8 @@ function my_onterm(data) {
                             + data.author[i].freq
                             + ')</span><br/>');
     }
+    termlists.push('</div>');
+
     var termlist = document.getElementById("termlist");
     replaceHtml(termlist, termlists.join(''));
 }
@@ -370,15 +379,23 @@ function switchView(view) {
 
     var targets = document.getElementById('mkwsTargets');
     var records = document.getElementById('mkwsRecords');
+    var blanket = document.getElementById('mkwsBlanket');
 
     switch(view) {
         case 'targets':
             targets.style.display = "block";
             records.style.display = "none";
+            if (blanket) { blanket.style.display = "none"; }
             break;
         case 'records':
             targets.style.display = "none";
             records.style.display = "block";
+            if (blanket) { blanket.style.display = "block"; }
+            break;
+       case 'none':
+            targets.style.display = "none";
+            records.style.display = "none";
+            if (blanket) { blanket.style.display = "none"; }
             break;
         default:
             alert('Unknown view.');
@@ -513,7 +530,7 @@ function mkws_html_all(config) {
           <td valign="top">\
             <div id="ranking">\
               <form name="select" id="select" action="" >\
-        ' + M('Sort by') + mkws_html_sort(config) + '\
+        ' + M('Sort by') + ' ' + mkws_html_sort(config) + '\
         ' + M('and show') + ' ' + mkws_html_perpage(config) + '\
         ' + M('per page') + '.\
        </form>\