From 62a749ba179815424e6ce035a5ab76b5e726175f Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Thu, 12 Jun 2008 14:01:05 +0000 Subject: [PATCH] (bug 14328) - Allow DOM objects to be used in jsMsg(), not only strings. --- RELEASE-NOTES | 1 + skins/common/wikibits.js | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 910dc9da56..25eea69e12 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -154,6 +154,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Add a new hook LinkerMakeExternalLink to allow extensions to modify the output of external links. * (bug 14132) Allow user to disable bot edits from being output to UDP. +* (bug 14328) jsMsg() within Wikibits now accepts a DOM object, not just a string === Bug fixes in 1.13 === diff --git a/skins/common/wikibits.js b/skins/common/wikibits.js index 802b595078..72f0996bd3 100644 --- a/skins/common/wikibits.js +++ b/skins/common/wikibits.js @@ -772,7 +772,7 @@ function ts_alternate(table) { * Add a cute little box at the top of the screen to inform the user of * something, replacing any preexisting message. * - * @param String message HTML to be put inside the right div + * @param String -or- Dom Object message HTML to be put inside the right div * @param String className Used in adding a class; should be different for each * call to allow CSS/JS to hide different boxes. null = no class used. * @return Boolean True on success, false on failure @@ -811,6 +811,15 @@ function jsMsg( message, className ) { messageDiv.setAttribute( 'class', 'mw-js-message-'+className ); } messageDiv.innerHTML = message; + + if (typeof message == 'string') { + messageDiv.innerHTML = message; + } + else if (typeof message == 'object') { + while (messageDiv.hasChildNodes()) // Remove old content + messageDiv.removeChild(messageDiv.firstChild); + messageDiv.appendChild (message); // Append new content + } return true; } -- 2.20.1