Index: trunk/phase3/skins/common/metadata.js |
— | — | @@ -49,5 +49,5 @@ |
50 | 50 | }; |
51 | 51 | |
52 | 52 | $( document ).ready( function() { |
53 | | - attachMetadataToggle( 'mw_metadata', mediaWiki.msg( 'metadata-expand' ), mediaWiki.msg( 'metadata-collapse' ) ); |
| 53 | + attachMetadataToggle( 'mw_metadata', mw.msg( 'metadata-expand' ), mw.msg( 'metadata-collapse' ) ); |
54 | 54 | } ); |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -2554,8 +2554,8 @@ |
2555 | 2555 | // Modules requests - let the client calculate dependencies and batch requests as it likes |
2556 | 2556 | $loader = ''; |
2557 | 2557 | if ( $this->getModules( true ) ) { |
2558 | | - $loader = Xml::encodeJsCall( 'mediaWiki.loader.load', array( $this->getModules( true ) ) ) . |
2559 | | - Xml::encodeJsCall( 'mediaWiki.loader.go', array() ); |
| 2558 | + $loader = Xml::encodeJsCall( 'mw.loader.load', array( $this->getModules( true ) ) ) . |
| 2559 | + Xml::encodeJsCall( 'mw.loader.go', array() ); |
2560 | 2560 | } |
2561 | 2561 | |
2562 | 2562 | $scripts .= Html::inlineScript( |
Index: trunk/phase3/includes/resourceloader/ResourceLoader.php |
— | — | @@ -492,7 +492,7 @@ |
493 | 493 | $out .= self::makeMessageSetScript( new XmlJsCode( $messagesBlob ) ); |
494 | 494 | break; |
495 | 495 | default: |
496 | | - // Minify CSS before embedding in mediaWiki.loader.implement call |
| 496 | + // Minify CSS before embedding in mw.loader.implement call |
497 | 497 | // (unless in debug mode) |
498 | 498 | if ( !$context->getDebug() ) { |
499 | 499 | foreach ( $styles as $media => $style ) { |
— | — | @@ -544,7 +544,7 @@ |
545 | 545 | /* Static Methods */ |
546 | 546 | |
547 | 547 | /** |
548 | | - * Returns JS code to call to mediaWiki.loader.implement for a module with |
| 548 | + * Returns JS code to call to mw.loader.implement for a module with |
549 | 549 | * given properties. |
550 | 550 | * |
551 | 551 | * @param $name Module name |
— | — | @@ -560,7 +560,7 @@ |
561 | 561 | $scripts = implode( $scripts, "\n" ); |
562 | 562 | } |
563 | 563 | return Xml::encodeJsCall( |
564 | | - 'mediaWiki.loader.implement', |
| 564 | + 'mw.loader.implement', |
565 | 565 | array( |
566 | 566 | $name, |
567 | 567 | new XmlJsCode( "function( $, mw ) {{$scripts}}" ), |
— | — | @@ -576,7 +576,7 @@ |
577 | 577 | * JSON-encoded message blob containing the same data, wrapped in an XmlJsCode object. |
578 | 578 | */ |
579 | 579 | public static function makeMessageSetScript( $messages ) { |
580 | | - return Xml::encodeJsCall( 'mediaWiki.messages.set', array( (object)$messages ) ); |
| 580 | + return Xml::encodeJsCall( 'mw.messages.set', array( (object)$messages ) ); |
581 | 581 | } |
582 | 582 | |
583 | 583 | /** |
— | — | @@ -605,7 +605,7 @@ |
606 | 606 | } |
607 | 607 | |
608 | 608 | /** |
609 | | - * Returns a JS call to mediaWiki.loader.state, which sets the state of a |
| 609 | + * Returns a JS call to mw.loader.state, which sets the state of a |
610 | 610 | * module or modules to a given value. Has two calling conventions: |
611 | 611 | * |
612 | 612 | * - ResourceLoader::makeLoaderStateScript( $name, $state ): |
— | — | @@ -616,9 +616,9 @@ |
617 | 617 | */ |
618 | 618 | public static function makeLoaderStateScript( $name, $state = null ) { |
619 | 619 | if ( is_array( $name ) ) { |
620 | | - return Xml::encodeJsCall( 'mediaWiki.loader.state', array( $name ) ); |
| 620 | + return Xml::encodeJsCall( 'mw.loader.state', array( $name ) ); |
621 | 621 | } else { |
622 | | - return Xml::encodeJsCall( 'mediaWiki.loader.state', array( $name, $state ) ); |
| 622 | + return Xml::encodeJsCall( 'mw.loader.state', array( $name, $state ) ); |
623 | 623 | } |
624 | 624 | } |
625 | 625 | |
— | — | @@ -642,7 +642,7 @@ |
643 | 643 | } |
644 | 644 | |
645 | 645 | /** |
646 | | - * Returns JS code which calls mediaWiki.loader.register with the given |
| 646 | + * Returns JS code which calls mw.loader.register with the given |
647 | 647 | * parameters. Has three calling conventions: |
648 | 648 | * |
649 | 649 | * - ResourceLoader::makeLoaderRegisterScript( $name, $version, $dependencies, $group ): |
— | — | @@ -667,10 +667,10 @@ |
668 | 668 | $dependencies = null, $group = null ) |
669 | 669 | { |
670 | 670 | if ( is_array( $name ) ) { |
671 | | - return Xml::encodeJsCall( 'mediaWiki.loader.register', array( $name ) ); |
| 671 | + return Xml::encodeJsCall( 'mw.loader.register', array( $name ) ); |
672 | 672 | } else { |
673 | 673 | $version = (int) $version > 1 ? (int) $version : 1; |
674 | | - return Xml::encodeJsCall( 'mediaWiki.loader.register', |
| 674 | + return Xml::encodeJsCall( 'mw.loader.register', |
675 | 675 | array( $name, $version, $dependencies, $group ) ); |
676 | 676 | } |
677 | 677 | } |
— | — | @@ -693,7 +693,7 @@ |
694 | 694 | * @param $configuration Array: List of configuration values keyed by variable name |
695 | 695 | */ |
696 | 696 | public static function makeConfigSetScript( array $configuration ) { |
697 | | - return Xml::encodeJsCall( 'mediaWiki.config.set', array( $configuration ) ); |
| 697 | + return Xml::encodeJsCall( 'mw.config.set', array( $configuration ) ); |
698 | 698 | } |
699 | 699 | |
700 | 700 | /** |
Index: trunk/phase3/includes/resourceloader/ResourceLoaderUserOptionsModule.php |
— | — | @@ -67,7 +67,7 @@ |
68 | 68 | } |
69 | 69 | |
70 | 70 | public function getScript( ResourceLoaderContext $context ) { |
71 | | - return Xml::encodeJsCall( 'mediaWiki.user.options.set', |
| 71 | + return Xml::encodeJsCall( 'mw.user.options.set', |
72 | 72 | array( $this->contextUserOptions( $context ) ) ); |
73 | 73 | } |
74 | 74 | |
Index: trunk/phase3/includes/resourceloader/ResourceLoaderFileModule.php |
— | — | @@ -219,7 +219,7 @@ |
220 | 220 | $script = ''; |
221 | 221 | foreach ( $files as $file ) { |
222 | 222 | $path = $this->getRemotePath( $file ); |
223 | | - $script .= "\n\t" . Xml::encodeJsCall( 'mediaWiki.loader.load', array( $path ) ); |
| 223 | + $script .= "\n\t" . Xml::encodeJsCall( 'mw.loader.load', array( $path ) ); |
224 | 224 | } |
225 | 225 | return $script; |
226 | 226 | } |
Index: trunk/phase3/includes/resourceloader/ResourceLoaderStartUpModule.php |
— | — | @@ -127,18 +127,18 @@ |
128 | 128 | $moduleMtime = wfTimestamp( TS_UNIX, $module->getModifiedTime( $context ) ); |
129 | 129 | $mtime = max( $moduleMtime, wfTimestamp( TS_UNIX, $wgCacheEpoch ) ); |
130 | 130 | // Modules without dependencies or a group pass two arguments (name, timestamp) to |
131 | | - // mediaWiki.loader.register() |
| 131 | + // mw.loader.register() |
132 | 132 | if ( !count( $module->getDependencies() && $module->getGroup() === null ) ) { |
133 | 133 | $registrations[] = array( $name, $mtime ); |
134 | 134 | } |
135 | 135 | // Modules with dependencies but no group pass three arguments |
136 | | - // (name, timestamp, dependencies) to mediaWiki.loader.register() |
| 136 | + // (name, timestamp, dependencies) to mw.loader.register() |
137 | 137 | else if ( $module->getGroup() === null ) { |
138 | 138 | $registrations[] = array( |
139 | 139 | $name, $mtime, $module->getDependencies() ); |
140 | 140 | } |
141 | 141 | // Modules with dependencies pass four arguments (name, timestamp, dependencies, group) |
142 | | - // to mediaWiki.loader.register() |
| 142 | + // to mw.loader.register() |
143 | 143 | else { |
144 | 144 | $registrations[] = array( |
145 | 145 | $name, $mtime, $module->getDependencies(), $module->getGroup() ); |
— | — | @@ -178,7 +178,7 @@ |
179 | 179 | $registrations = self::getModuleRegistrations( $context ); |
180 | 180 | $out .= "var startUp = function() {\n" . |
181 | 181 | "\t$registrations\n" . |
182 | | - "\t" . Xml::encodeJsCall( 'mediaWiki.config.set', array( $configuration ) ) . |
| 182 | + "\t" . Xml::encodeJsCall( 'mw.config.set', array( $configuration ) ) . |
183 | 183 | "};\n"; |
184 | 184 | |
185 | 185 | // Conditional script injection |
Index: trunk/phase3/resources/jquery/jquery.localize.js |
— | — | @@ -36,8 +36,9 @@ |
37 | 37 | return $(this) |
38 | 38 | .find( 'msg,html\\:msg' ) |
39 | 39 | .each( function() { |
| 40 | + var $el = $(this); |
40 | 41 | $(this) |
41 | | - .text( mediaWiki.msg( options.prefix + $(this).attr( 'key' ) ) ) |
| 42 | + .text( mw.msg( options.prefix + $(this).attr( 'key' ) ) ) |
42 | 43 | .replaceWith( $(this).html() ); |
43 | 44 | } ) |
44 | 45 | .end() |
Index: trunk/phase3/resources/mediawiki.action/mediawiki.action.watch.ajax.js |
— | — | @@ -11,17 +11,17 @@ |
12 | 12 | if ( action == 'watch' || action == 'unwatch' ) { |
13 | 13 | // save the accesskey from the title |
14 | 14 | var keyCommand = $link.attr( 'title' ).match( /\[.*?\]$/ ) ? $link.attr( 'title' ).match( /\[.*?\]$/ )[0] : ''; |
15 | | - $link.attr( 'title', mediaWiki.msg( 'tooltip-ca-' + action ) + ' ' + keyCommand ); |
| 15 | + $link.attr( 'title', mw.msg( 'tooltip-ca-' + action ) + ' ' + keyCommand ); |
16 | 16 | } |
17 | 17 | if ( $link.data( 'icon' ) ) { |
18 | | - $link.attr( 'alt', mediaWiki.msg( action ) ); |
| 18 | + $link.attr( 'alt', mw.msg( action ) ); |
19 | 19 | if ( action == 'watching' || action == 'unwatching' ) { |
20 | 20 | $link.addClass( 'loading' ); |
21 | 21 | } else { |
22 | 22 | $link.removeClass( 'loading' ); |
23 | 23 | } |
24 | 24 | } else { |
25 | | - $link.html( mediaWiki.msg( action ) ); |
| 25 | + $link.html( mw.msg( action ) ); |
26 | 26 | } |
27 | 27 | }; |
28 | 28 | |
— | — | @@ -117,7 +117,7 @@ |
118 | 118 | if( $link.closest( 'li' ).attr( 'id' ) == 'ca-' + action ) { |
119 | 119 | $link.closest( 'li' ).attr( 'id', 'ca-' + otheraction ); |
120 | 120 | // update the link text with the new message |
121 | | - $link.text( mediaWiki.msg( otheraction ) ); |
| 121 | + $link.text( mw.msg( otheraction ) ); |
122 | 122 | } |
123 | 123 | } |
124 | 124 | |
Index: trunk/phase3/resources/mediawiki.special/mediawiki.special.upload.js |
— | — | @@ -128,9 +128,9 @@ |
129 | 129 | $( '#mw-upload-thumbnail .fileinfo' ).text( info ); |
130 | 130 | }; |
131 | 131 | img.src = dataURL; |
132 | | - }, mediaWiki.config.get( 'wgFileCanRotate' ) ? function ( data ) { |
| 132 | + }, mw.config.get( 'wgFileCanRotate' ) ? function ( data ) { |
133 | 133 | try { |
134 | | - meta = mediaWiki.util.jpegmeta( data, file.fileName ); |
| 134 | + meta = mw.util.jpegmeta( data, file.fileName ); |
135 | 135 | meta._binary_data = null; |
136 | 136 | } catch ( e ) { |
137 | 137 | meta = null; |
Index: trunk/phase3/resources/mediawiki/mediawiki.js |
— | — | @@ -348,7 +348,7 @@ |
349 | 349 | * This ID is ephemeral for everyone, staying in their browser only until they close |
350 | 350 | * their browser. |
351 | 351 | * |
352 | | - * Do not use this method before the first call to mediaWiki.loader.go(), it depends on |
| 352 | + * Do not use this method before the first call to mw.loader.go(), it depends on |
353 | 353 | * jquery.cookie, which is added to the first pay-load just after mediaWiki is defined, but |
354 | 354 | * won't be loaded until the first call to go(). |
355 | 355 | * |
— | — | @@ -370,7 +370,7 @@ |
371 | 371 | * expiration time is reset each time the ID is queried, so in most cases this ID will |
372 | 372 | * persist until the browser's cookies are cleared or the user doesn't visit for 1 year. |
373 | 373 | * |
374 | | - * Do not use this method before the first call to mediaWiki.loader.go(), it depends on |
| 374 | + * Do not use this method before the first call to mw.loader.go(), it depends on |
375 | 375 | * jquery.cookie, which is added to the first pay-load just after mediaWiki is defined, but |
376 | 376 | * won't be loaded until the first call to go(). |
377 | 377 | * |
— | — | @@ -1112,14 +1112,14 @@ |
1113 | 1113 | }; |
1114 | 1114 | |
1115 | 1115 | /** |
1116 | | - * Wrapper object for raw HTML passed to mediaWiki.html.element(). |
| 1116 | + * Wrapper object for raw HTML passed to mw.html.element(). |
1117 | 1117 | */ |
1118 | 1118 | this.Raw = function( value ) { |
1119 | 1119 | this.value = value; |
1120 | 1120 | }; |
1121 | 1121 | |
1122 | 1122 | /** |
1123 | | - * Wrapper object for CDATA element contents passed to mediaWiki.html.element() |
| 1123 | + * Wrapper object for CDATA element contents passed to mw.html.element() |
1124 | 1124 | */ |
1125 | 1125 | this.Cdata = function( value ) { |
1126 | 1126 | this.value = value; |
— | — | @@ -1139,7 +1139,7 @@ |
1140 | 1140 | * See http://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html#h-B.3.2 |
1141 | 1141 | * |
1142 | 1142 | * Example: |
1143 | | - * var h = mediaWiki.html; |
| 1143 | + * var h = mw.html; |
1144 | 1144 | * return h.element( 'div', {}, |
1145 | 1145 | * new h.Raw( h.element( 'img', {src: '<'} ) ) ); |
1146 | 1146 | * Returns <div><img src="<"/></div> |
Index: trunk/phase3/resources/mediawiki/mediawiki.log.js |
— | — | @@ -15,7 +15,7 @@ |
16 | 16 | * @author Trevor Parscal <tparscal@wikimedia.org> |
17 | 17 | * @param {string} string Message to output to console |
18 | 18 | */ |
19 | | - mediaWiki.log = function( string ) { |
| 19 | + mw.log = function( string ) { |
20 | 20 | // Allow log messages to use a configured prefix |
21 | 21 | if ( mw.config.exists( 'mw.log.prefix' ) ) { |
22 | 22 | string = mw.config.get( 'mw.log.prefix' ) + '> ' + string; |