X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=tools%2Fhtdocs%2Fmkws.js;h=e61878d8172467243835863977d681b43d6bb740;hb=fd8e19788d91b39cf4cb550c805bf5cc05d0349e;hp=1837390cfec590988004c9646611f5b897314fbf;hpb=a90455e88951e83ca8ceb430dde3a46c7726049d;p=mkws-moved-to-github.git diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index 1837390..e61878d 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -10,7 +10,6 @@ Handlebars.registerHelper('json', function(obj) { Handlebars.registerHelper('translate', function(s) { - debug("translating '" + s + "'"); return mkws.M(s); }); @@ -144,7 +143,7 @@ if (mkws_config == null || typeof mkws_config != 'object') { // wrapper for jQuery lib function _make_mkws_team($, teamName) { var that = {}; - var m_termName = teamName; + var m_teamName = teamName; var m_submitted = false; var m_query; // initially undefined var m_sort = 'relevance'; @@ -262,7 +261,7 @@ function _make_mkws_team($, teamName) { } // navi - var results = document.getElementById("mkwsRecords"); + var results = $(".mkwsRecords.mkwsTeam_" + m_teamName); var html = []; for (var i = 0; i < data.hits.length; i++) { @@ -274,7 +273,7 @@ function _make_mkws_team($, teamName) { html.push(renderDetails(m_curDetRecData)); } } - replaceHtml(results, html.join('')); + results.html(html.join('')); } @@ -328,9 +327,9 @@ function _make_mkws_team($, teamName) { } } - var termlist = document.getElementById("mkwsTermlists"); + var termlist = $("#mkwsTermlists"); if (termlist) - replaceHtml(termlist, acc.join('')); + termlist.html(acc.join('')); } @@ -745,21 +744,6 @@ function _make_mkws_team($, teamName) { } - function replaceHtml(el, html) { - var oldEl = typeof el === "string" ? document.getElementById(el) : el; - /*@cc_on // Pure innerHTML is slightly faster in IE - oldEl.innerHTML = html; - return oldEl; - @*/ - var newEl = oldEl.cloneNode(false); - newEl.innerHTML = html; - oldEl.parentNode.replaceChild(newEl, oldEl); - /* Since we just removed the old element from the DOM, return a reference - to the new element, which can be used to restore variable references. */ - return newEl; - }; - - function renderDetails(data, marker) { var template = loadTemplate("Record"); @@ -881,8 +865,8 @@ function _make_mkws_team($, teamName) { debug("HTML search form"); $("#mkwsSearch").html('\
\ - \ - \ + \ + \
'); debug("HTML records"); @@ -898,19 +882,19 @@ function _make_mkws_team($, teamName) { $("#mkwsResults").html('\ \ \ - \ \ \ \ \ \
\ -
\ +
\ +
\
\ -
\ -
\ -
\ -
\ +
\ +
\ +
\ +
\
\ -
\ +
\
'); @@ -989,7 +973,7 @@ function _make_mkws_team($, teamName) { debug("HTML targets"); $("#mkwsTargets").html('\ -
\ +
\ No information available yet.\
'); $("#mkwsTargets").css("display", "none");