From eee3aeeed5df75614ae7c77c77a2d2da521c526a Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Tue, 9 Jul 2013 16:38:58 +0100 Subject: [PATCH] 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. --- tools/htdocs/mkws.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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); } } -- 1.7.10.4