From: Mike Taylor Date: Tue, 9 Jul 2013 15:38:58 +0000 (+0100) Subject: Much nicer MOTD handling: if the MOTD div is provided and the X-Git-Tag: 0.9.1~305^2~1 X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=commitdiff_plain;h=eee3aeeed5df75614ae7c77c77a2d2da521c526a Much nicer MOTD handling: if the MOTD div is provided and the container div is also present (as part of the standard mkwsResults boilerplate), the div is MOVED into the container. --- diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index 98ac5ee..6c544ea 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -413,7 +413,7 @@ function switchView(view) { var results = document.getElementById('mkwsResults') || document.getElementById('mkwsRecords'); var blanket = document.getElementById('mkwsBlanket'); - var motd = document.getElementById('mkwsEmbeddedMOTD'); + var motd = document.getElementById('mkwsMOTD'); switch(view) { case 'targets': @@ -585,12 +585,11 @@ function mkws_html_all(config) { \
\ \ - \ + \
\
\
\
\ -
\ \ \ '); @@ -622,11 +621,12 @@ function mkws_html_all(config) { // on first page, hide the termlist $(document).ready(function() { $("#mkwsTermlists").hide(); } ); - var elem = document.getElementById("mkwsMOTD"); - if (elem) { - // Move the MOTD from the provided element down into the embedded one - document.getElementById("mkwsEmbeddedMOTD").innerHTML = elem.innerHTML; - elem.style.display = "none"; + var motd = document.getElementById("mkwsMOTD"); + var container = document.getElementById("mkwsMOTDContainer"); + if (motd && container) { + // Move the MOTD from the provided element down into the container + motd.parentNode.removeChild(motd); + container.appendChild(motd); } }