Index: branches/resourceloader/phase3/skins/common/wikibits.js |
— | — | @@ -3,6 +3,9 @@ |
4 | 4 | window.clientPC = navigator.userAgent.toLowerCase(); // Get client info |
5 | 5 | window.is_gecko = /gecko/.test( clientPC ) && |
6 | 6 | !/khtml|spoofer|netscape\/7\.0/.test(clientPC); |
| 7 | + |
| 8 | +window.is_safari = window.is_safari_win = window.webkit_version = |
| 9 | + window.is_chrome = window.is_chrome_mac = false; |
7 | 10 | window.webkit_match = clientPC.match(/applewebkit\/(\d+)/); |
8 | 11 | if (webkit_match) { |
9 | 12 | window.is_safari = clientPC.indexOf('applewebkit') != -1 && |
— | — | @@ -15,12 +18,16 @@ |
16 | 19 | clientPC.indexOf('spoofer') === -1; |
17 | 20 | window.is_chrome_mac = is_chrome && clientPC.indexOf('mac') !== -1 |
18 | 21 | } |
| 22 | + |
19 | 23 | // For accesskeys; note that FF3+ is included here! |
20 | 24 | window.is_ff2 = /firefox\/[2-9]|minefield\/3/.test( clientPC ); |
21 | 25 | window.ff2_bugs = /firefox\/2/.test( clientPC ); |
22 | 26 | // These aren't used here, but some custom scripts rely on them |
23 | 27 | window.is_ff2_win = is_ff2 && clientPC.indexOf('windows') != -1; |
24 | 28 | window.is_ff2_x11 = is_ff2 && clientPC.indexOf('x11') != -1; |
| 29 | + |
| 30 | +window.is_opera = window.is_opera_preseven = window.is_opera_95 = |
| 31 | + window.opera6_bugs = window.opera7_bugs = window.opera95_bugs = false; |
25 | 32 | if (clientPC.indexOf('opera') != -1) { |
26 | 33 | window.is_opera = true; |
27 | 34 | window.is_opera_preseven = window.opera && !document.childNodes; |
Index: branches/resourceloader/phase3/includes/ResourceLoader.php |
— | — | @@ -256,19 +256,23 @@ |
257 | 257 | $scripts .= $module->getScript( $parameters['lang'], $parameters['skin'], $parameters['debug'] ); |
258 | 258 | // Special meta-information for the 'mediawiki' module |
259 | 259 | if ( $name === 'mediawiki' && $parameters['only'] === 'scripts' ) { |
260 | | - $config = array( 'server' => $server, 'debug', 'debug' => $parameters['debug'] ); |
| 260 | + $config = array( 'server' => $server, 'debug' => $parameters['debug'] ); |
261 | 261 | $scripts .= "mediaWiki.config.set( " . FormatJson::encode( $config ) . " );\n"; |
| 262 | + |
| 263 | + // FIXME: This loop shades the $name and $module variables from the outer loop. WTF? |
262 | 264 | foreach ( self::$modules as $name => $module ) { |
263 | 265 | $loader = $module->getLoaderScript(); |
264 | 266 | if ( $loader !== false ) { |
265 | 267 | $scripts .= $loader; |
266 | 268 | } else { |
267 | | - if ( !count( $module->getDependencies() ) && !in_array( $name, $missing ) ) { |
| 269 | + if ( !count( $module->getDependencies() ) && !in_array( $name, $missing ) && !in_array( $name, $modules ) ) { |
268 | 270 | $registrations[$name] = $name; |
269 | 271 | } else { |
270 | 272 | $registrations[$name] = array( $name, $module->getDependencies() ); |
271 | 273 | if ( in_array( $name, $missing ) ) { |
272 | 274 | $registrations[$name][] = 'missing'; |
| 275 | + } else if ( in_array( $name, $modules ) ) { |
| 276 | + $registrations[$name][] = 'ready'; |
273 | 277 | } |
274 | 278 | } |
275 | 279 | } |
— | — | @@ -300,13 +304,14 @@ |
301 | 305 | $styles = Xml::escapeJsString( $styles ); |
302 | 306 | echo "mediaWiki.loader.implement( '{$name}', function() {\n{$scripts}\n}, '{$styles}', {$messages} );\n"; |
303 | 307 | } |
304 | | - if ( $includeScripts ) { |
305 | | - // Register modules without loaders |
306 | | - echo "mediaWiki.loader.register( " . FormatJson::encode( array_values( $registrations ) ) . " );\n"; |
307 | | - } |
308 | 308 | } |
309 | 309 | |
310 | 310 | // Final processing |
| 311 | + if ( $includeScripts ) { |
| 312 | + // Register modules without loaders |
| 313 | + echo "mediaWiki.loader.register( " . FormatJson::encode( array_values( $registrations ) ) . " );\n"; |
| 314 | + } |
| 315 | + |
311 | 316 | if ( $parameters['only'] == 'styles' ) { |
312 | 317 | header( 'Content-Type: text/css' ); |
313 | 318 | } else { |