r36239 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r36238‎ | r36239 | r36240 >
Date:14:01, 12 June 2008
Author:demon
Status:old
Tags:
Comment:
(bug 14328) - Allow DOM objects to be used in jsMsg(), not only strings.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/skins/common/wikibits.js (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/wikibits.js
@@ -772,7 +772,7 @@
773773 * Add a cute little box at the top of the screen to inform the user of
774774 * something, replacing any preexisting message.
775775 *
776 - * @param String message HTML to be put inside the right div
 776+ * @param String -or- Dom Object message HTML to be put inside the right div
777777 * @param String className Used in adding a class; should be different for each
778778 * call to allow CSS/JS to hide different boxes. null = no class used.
779779 * @return Boolean True on success, false on failure
@@ -811,6 +811,15 @@
812812 messageDiv.setAttribute( 'class', 'mw-js-message-'+className );
813813 }
814814 messageDiv.innerHTML = message;
 815+
 816+ if (typeof message == 'string') {
 817+ messageDiv.innerHTML = message;
 818+ }
 819+ else if (typeof message == 'object') {
 820+ while (messageDiv.hasChildNodes()) // Remove old content
 821+ messageDiv.removeChild(messageDiv.firstChild);
 822+ messageDiv.appendChild (message); // Append new content
 823+ }
815824 return true;
816825 }
817826
Index: trunk/phase3/RELEASE-NOTES
@@ -154,6 +154,7 @@
155155 * Add a new hook LinkerMakeExternalLink to allow extensions to modify the output of
156156 external links.
157157 * (bug 14132) Allow user to disable bot edits from being output to UDP.
 158+* (bug 14328) jsMsg() within Wikibits now accepts a DOM object, not just a string
158159
159160 === Bug fixes in 1.13 ===
160161

Status & tagging log