diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2012-01-12 13:42:29 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2012-01-12 13:42:29 +0100 |
commit | ba0fc4fa20067528effd4802e53ceeb959640825 (patch) | |
tree | 4f62217349d3afa39dbba3f7e19dac0aecb344f6 /resources | |
parent | ca32f08966f1b51fcb19460f0996bb0c4048e6fe (diff) |
Update to MediaWiki 1.18.1
Diffstat (limited to 'resources')
-rw-r--r-- | resources/Resources.php | 2 | ||||
-rw-r--r-- | resources/jquery/jquery.delayedBind.js | 5 | ||||
-rw-r--r-- | resources/mediawiki/mediawiki.js | 49 | ||||
-rw-r--r-- | resources/mediawiki/mediawiki.util.js | 3 |
4 files changed, 41 insertions, 18 deletions
diff --git a/resources/Resources.php b/resources/Resources.php index 7549b9c9..940d646d 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -668,7 +668,7 @@ return array( 'scripts' => 'common/mwsuggest.js', 'remoteBasePath' => $GLOBALS['wgStylePath'], 'localBasePath' => $GLOBALS['wgStyleDirectory'], - 'dependencies' => array( 'mediawiki.legacy.wikibits', 'jquery.client' ), + 'dependencies' => 'mediawiki.legacy.wikibits', 'messages' => array( 'search-mwsuggest-enabled', 'search-mwsuggest-disabled' ), ), 'mediawiki.legacy.preview' => array( diff --git a/resources/jquery/jquery.delayedBind.js b/resources/jquery/jquery.delayedBind.js index 6d972996..d84ee267 100644 --- a/resources/jquery/jquery.delayedBind.js +++ b/resources/jquery/jquery.delayedBind.js @@ -19,6 +19,11 @@ $.fn.extend( { * @param callback Function to call */ delayedBind: function( timeout, event, data, callback ) { + if ( arguments.length == 3 ) { + // Shift optional parameter down + callback = data; + data = undefined; + } var encEvent = encodeEvent( event ); return this.each( function() { var that = this; diff --git a/resources/mediawiki/mediawiki.js b/resources/mediawiki/mediawiki.js index a763ba93..aca59e4e 100644 --- a/resources/mediawiki/mediawiki.js +++ b/resources/mediawiki/mediawiki.js @@ -1133,9 +1133,17 @@ window.mediaWiki = new ( function( $ ) { * Returns <div><img src="<"/></div> */ this.element = function( name, attrs, contents ) { - var s = '<' + name; + var v, s = '<' + name; for ( var attrName in attrs ) { - s += ' ' + attrName + '="' + this.escape( attrs[attrName] ) + '"'; + v = attrs[attrName]; + // Convert name=true, to name=name + if ( v === true ) { + v = attrName; + // Skip name=false + } else if ( v === false ) { + continue; + } + s += ' ' + attrName + '="' + this.escape( '' + v ) + '"'; } if ( contents === undefined || contents === null ) { // Self close tag @@ -1144,20 +1152,29 @@ window.mediaWiki = new ( function( $ ) { } // Regular open tag s += '>'; - if ( typeof contents === 'string' ) { - // Escaped - s += this.escape( contents ); - } else if ( contents instanceof this.Raw ) { - // Raw HTML inclusion - s += contents.value; - } else if ( contents instanceof this.Cdata ) { - // CDATA - if ( /<\/[a-zA-z]/.test( contents.value ) ) { - throw new Error( 'mw.html.element: Illegal end tag found in CDATA' ); - } - s += contents.value; - } else { - throw new Error( 'mw.html.element: Invalid type of contents' ); + switch ( typeof contents ) { + case 'string': + // Escaped + s += this.escape( contents ); + break; + case 'number': + case 'boolean': + // Convert to string + s += '' + contents; + break; + default: + if ( contents instanceof this.Raw ) { + // Raw HTML inclusion + s += contents.value; + } else if ( contents instanceof this.Cdata ) { + // CDATA + if ( /<\/[a-zA-z]/.test( contents.value ) ) { + throw new Error( 'mw.html.element: Illegal end tag found in CDATA' ); + } + s += contents.value; + } else { + throw new Error( 'mw.html.element: Invalid type of contents' ); + } } s += '</' + name + '>'; return s; diff --git a/resources/mediawiki/mediawiki.util.js b/resources/mediawiki/mediawiki.util.js index 71875835..59727b3d 100644 --- a/resources/mediawiki/mediawiki.util.js +++ b/resources/mediawiki/mediawiki.util.js @@ -164,12 +164,13 @@ var s = document.createElement( 'style' ); s.type = 'text/css'; s.rel = 'stylesheet'; + // Insert into document before setting cssText (bug 33305) + document.getElementsByTagName('head')[0].appendChild( s ); if ( s.styleSheet ) { s.styleSheet.cssText = text; // IE } else { s.appendChild( document.createTextNode( text + '' ) ); // Safari sometimes borks on null } - document.getElementsByTagName('head')[0].appendChild( s ); return s.sheet || s; }, |