r36242 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r36241‎ | r36242 | r36243 >
Date:14:46, 12 June 2008
Author:demon
Status:old
Tags:
Comment:
Clean up a bit of a mess with jsMsg(). Should be much more functional now and accept all types.
Modified paths:
  • /trunk/phase3/skins/common/wikibits.js (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/wikibits.js
@@ -810,16 +810,15 @@
811811 if( className ) {
812812 messageDiv.setAttribute( 'class', 'mw-js-message-'+className );
813813 }
814 - messageDiv.innerHTML = message;
815814
816 - if (typeof message == 'string') {
817 - messageDiv.innerHTML = message;
818 - }
819 - else if (typeof message == 'object') {
 815+ if (typeof message === 'object') {
820816 while (messageDiv.hasChildNodes()) // Remove old content
821817 messageDiv.removeChild(messageDiv.firstChild);
822818 messageDiv.appendChild (message); // Append new content
823819 }
 820+ else {
 821+ messageDiv.innerHTML = message;
 822+ }
824823 return true;
825824 }
826825

Status & tagging log