Rename all the rec_* IDs as mkwsRec_*
[mkws-moved-to-github.git] / experiments / spclient / mkws.js
index 56e3298..8fa3b76 100644 (file)
@@ -126,9 +126,9 @@ function my_onshow(data) {
     var html = [];
     for (var i = 0; i < data.hits.length; i++) {
         var hit = data.hits[i];
-             html.push('<div class="record" id="recdiv_'+hit.recid+'" >'
+             html.push('<div class="record" id="mkwsRecdiv_'+hit.recid+'" >'
             +'<span>'+ (i + 1 + recPerPage * (curPage - 1)) +'. </span>'
-            +'<a href="#" id="rec_'+hit.recid
+            +'<a href="#" id="mkwsRec_'+hit.recid
             +'" onclick="showDetails(this.id);return false;"><b>'
             + hit["md-title"] +' </b></a>');
              if (hit["md-title-remainder"] !== undefined) {
@@ -210,16 +210,16 @@ function my_onrecord(data) {
     // FIXME: record is async!!
     clearTimeout(my_paz.recordTimer);
     // in case on_show was faster to redraw element
-    var detRecordDiv = document.getElementById('det_'+data.recid);
+    var detRecordDiv = document.getElementById('mkwsDet_'+data.recid);
     if (detRecordDiv) return;
     curDetRecData = data;
-    var recordDiv = document.getElementById('recdiv_'+curDetRecData.recid);
+    var recordDiv = document.getElementById('mkwsRecdiv_'+curDetRecData.recid);
     var html = renderDetails(curDetRecData);
     recordDiv.innerHTML += html;
 }
 
 function my_onbytarget(data) {
-    var targetDiv = document.getElementById("bytarget");
+    var targetDiv = document.getElementById("mkwsBytarget");
     var table ='<table><thead><tr><td>Target ID</td><td>Hits</td><td>Diags</td>'
         +'<td>Records</td><td>State</td></tr></thead><tbody>';
 
@@ -294,7 +294,7 @@ function limitQuery (field, value)
 // limit by target functions
 function limitTarget (id, name)
 {
-    var navi = document.getElementById('navi');
+    var navi = document.getElementById('mkwsNavi');
     navi.innerHTML =
         'Source: <a class="crossout" href="#" onclick="delimitTarget();return false;">'
         + name + '</a>';
@@ -308,7 +308,7 @@ function limitTarget (id, name)
 
 function delimitTarget ()
 {
-    var navi = document.getElementById('navi');
+    var navi = document.getElementById('mkwsNavi');
     navi.innerHTML = '';
     curFilter = null;
     resetPage();
@@ -414,12 +414,12 @@ function switchView(view) {
 
 // detailed record drawing
 function showDetails (prefixRecId) {
-    var recId = prefixRecId.replace('rec_', '');
+    var recId = prefixRecId.replace('mkwsRec_', '');
     var oldRecId = curDetRecId;
     curDetRecId = recId;
 
     // remove current detailed view if any
-    var detRecordDiv = document.getElementById('det_'+oldRecId);
+    var detRecordDiv = document.getElementById('mkwsDet_'+oldRecId);
     // lovin DOM!
     if (detRecordDiv)
       detRecordDiv.parentNode.removeChild(detRecordDiv);
@@ -450,7 +450,7 @@ function replaceHtml(el, html) {
 
 function renderDetails(data, marker)
 {
-    var details = '<div class="details" id="det_'+data.recid+'"><table>';
+    var details = '<div class="details" id="mkwsDet_'+data.recid+'"><table>';
     if (marker) details += '<tr><td>'+ marker + '</td></tr>';
 
     details += renderField("Title", data["md-title"], data["md-title-remainder"], data["md-title-responsibility"]);
@@ -556,7 +556,7 @@ function mkws_html_all(config) {
        </form>\
             </div>\
             <div id="mkwsPager"></div>\
-            <div id="navi"></div>\
+            <div id="mkwsNavi"></div>\
             <div id="mkwsResults"></div>\
           </td>\
         </tr>\
@@ -621,7 +621,7 @@ function mkws_html_switch(config) {
 
     debug("HTML targets");
     $("#mkwsTargets").html('\
-      <div id="bytarget">\
+      <div id="mkwsBytarget">\
        No information available yet.\
       </div>');
     $("#mkwsTargets").css("display", "none");