From: Mike Taylor Date: Mon, 8 Jul 2013 16:36:11 +0000 (+0100) Subject: Support for message of the day (MKWS-8): X-Git-Tag: 0.9.1~306^2~3 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=8d86ab20c14a35723083c21332ace86743df3d0e;p=mkws-moved-to-github.git Support for message of the day (MKWS-8): -- If #mkwsMOTD div is provided, contents are copied into #mkwsEmbeddeMOTD -- embedded motd div is turned off when viewing search or targets --- diff --git a/experiments/spclient/mkws.js b/experiments/spclient/mkws.js index dfd1c19..98ac5ee 100644 --- a/experiments/spclient/mkws.js +++ b/experiments/spclient/mkws.js @@ -413,22 +413,26 @@ function switchView(view) { var results = document.getElementById('mkwsResults') || document.getElementById('mkwsRecords'); var blanket = document.getElementById('mkwsBlanket'); + var motd = document.getElementById('mkwsEmbeddedMOTD'); switch(view) { case 'targets': if (targets) targets.style.display = "block"; if (results) results.style.display = "none"; if (blanket) blanket.style.display = "none"; + if (motd) motd.style.display = "none"; break; case 'records': if (targets) targets.style.display = "none"; if (results) results.style.display = "block"; if (blanket) blanket.style.display = "block"; + if (motd) motd.style.display = "none"; break; case 'none': if (targets) targets.style.display = "none"; if (results) results.style.display = "none"; if (blanket) blanket.style.display = "none"; + if (motd) motd.style.display = "none"; break; default: alert("Unknown view '" + view + "'"); @@ -586,6 +590,7 @@ function mkws_html_all(config) {
\
\
\ +
\ \ \ '); @@ -617,6 +622,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"; + } } /* Responsive web design - change layout on the fly depending on