Index: trunk/phase3/resources/mediawiki.util/mediawiki.util.test.js |
— | — | @@ -68,6 +68,8 @@ |
69 | 69 | 'object (string)'); |
70 | 70 | mw.test.addTest('typeof mw.util', |
71 | 71 | 'object (string)'); |
| 72 | + mw.test.addTest('typeof mw.html', |
| 73 | + 'object (string)'); |
72 | 74 | mw.test.addTest('typeof String.prototype.ucFirst', |
73 | 75 | 'function (string)'); |
74 | 76 | mw.test.addTest('\'mediawiki\'.ucFirst()', |
— | — | @@ -88,16 +90,22 @@ |
89 | 91 | 'function (string)'); |
90 | 92 | mw.test.addTest('mw.util.getParamValue( \'action\' )', |
91 | 93 | 'mwutiltest (string)'); |
| 94 | + mw.test.addTest('mw.util.getParamValue( \'foo\', \'http://mw.org/?foo=wrong&foo=right#&foo=bad\' )', |
| 95 | + 'right (string)'); |
92 | 96 | mw.test.addTest('mw.util.tooltipAccessKeyRegexp.constructor.name', |
93 | 97 | 'RegExp (string)'); |
94 | 98 | mw.test.addTest('typeof mw.util.updateTooltipAccessKeys', |
95 | 99 | 'function (string)'); |
96 | 100 | mw.test.addTest('typeof mw.util.addPortletLink', |
97 | 101 | 'function (string)'); |
98 | | - mw.test.addTest('typeof mw.util.addPortletLink("p-tb", "http://mediawiki.org/", "MediaWiki.org", "t-mworg", "Go to MediaWiki.org ", "m", "#t-print")', |
| 102 | + mw.test.addTest('typeof mw.util.addPortletLink( "p-tb", "http://mediawiki.org/", "MediaWiki.org", "t-mworg", "Go to MediaWiki.org ", "m", "#t-print" )', |
99 | 103 | 'object (string)'); |
100 | | - mw.test.addTest('a = mw.util.addPortletLink("p-tb", "http://mediawiki.org/", "MediaWiki.org", "t-mworg", "Go to MediaWiki.org ", "m", "#t-print"); $(a).text();', |
| 104 | + mw.test.addTest('a = mw.util.addPortletLink( "p-tb", "http://mediawiki.org/", "MediaWiki.org", "t-mworg", "Go to MediaWiki.org ", "m", "#t-print" ); $(a).text();', |
101 | 105 | 'MediaWiki.org (string)'); |
| 106 | + mw.test.addTest('mw.html.element( \'hr\' )', |
| 107 | + '<hr/> (string)'); |
| 108 | + mw.test.addTest('mw.html.element( \'img\', { \'src\': \'http://mw.org/?title=Main page&action=edit\' } )', |
| 109 | + '<img src="http://mw.org/?title=Main page&action=edit"/> (string)'); |
102 | 110 | |
103 | 111 | // Run tests and compare results |
104 | 112 | var exec, |
Index: trunk/phase3/resources/mediawiki/mediawiki.js |
— | — | @@ -968,11 +968,11 @@ |
969 | 969 | s += ' ' + attrName + '="' + this.escape( attrs[attrName] ) + '"'; |
970 | 970 | } |
971 | 971 | if ( typeof contents == 'undefined' || contents === null ) { |
972 | | - // Short close tag |
| 972 | + // Self close tag |
973 | 973 | s += '/>'; |
974 | 974 | return s; |
975 | 975 | } |
976 | | - // Regular close tag |
| 976 | + // Regular open tag |
977 | 977 | s += '>'; |
978 | 978 | if (typeof contents === 'string') { |
979 | 979 | // Escaped |