Index: trunk/extensions/WebFonts/resources/ext.webfonts.js |
— | — | @@ -10,7 +10,7 @@ |
11 | 11 | mw.webfonts = { |
12 | 12 | |
13 | 13 | oldconfig: false, |
14 | | - config: mw.webfonts.config, |
| 14 | + config: { fonts: {}, languages: {} }, |
15 | 15 | version: '0.1.2', |
16 | 16 | fonts : [], |
17 | 17 | set: function( font ) { |
— | — | @@ -335,8 +335,4 @@ |
336 | 336 | } |
337 | 337 | }; |
338 | 338 | |
339 | | - $( document ).ready( function() { |
340 | | - mw.webfonts.setup(); |
341 | | - } ); |
342 | | - |
343 | 339 | } ) ( jQuery ); |
Index: trunk/extensions/WebFonts/resources/ext.webfonts.fontlist.js |
— | — | @@ -4,9 +4,8 @@ |
5 | 5 | */ |
6 | 6 | |
7 | 7 | ( function ( $ ) { |
8 | | - mw.webfonts = {}; |
9 | 8 | |
10 | | - mw.webfonts.config = { |
| 9 | + config = { |
11 | 10 | fonts: { |
12 | 11 | RufScript: { |
13 | 12 | eot: "Latn/Rufscript.eot", |
— | — | @@ -316,4 +315,5 @@ |
317 | 316 | cdo: [ "Charis SIL" ] |
318 | 317 | } |
319 | 318 | }; |
| 319 | + $.extend( mw.webfonts.config, config); |
320 | 320 | } ) ( jQuery ); |
Index: trunk/extensions/WebFonts/resources/ext.webfonts.init.js |
— | — | @@ -0,0 +1,8 @@ |
| 2 | +/** |
| 3 | + * WebFonts startup script |
| 4 | + */ |
| 5 | +( function( $ ) { |
| 6 | + $( document ).ready( function() { |
| 7 | + mw.webfonts.setup(); |
| 8 | + } ); |
| 9 | +} )( jQuery ); |
Property changes on: trunk/extensions/WebFonts/resources/ext.webfonts.init.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 10 | + native |
Index: trunk/extensions/WebFonts/WebFonts.php |
— | — | @@ -40,17 +40,22 @@ |
41 | 41 | |
42 | 42 | $wgWebFontsEnabledByDefault = true; |
43 | 43 | |
44 | | -$wgResourceModules['webfonts'] = array( |
45 | | - 'scripts' => 'resources/ext.webfonts.js', |
46 | | - 'styles' => 'resources/ext.webfonts.css', |
| 44 | +$wgResourceModules['ext.webfonts.init'] = array( |
| 45 | + 'scripts' => 'resources/ext.webfonts.init.js', |
47 | 46 | 'localBasePath' => $dir, |
48 | 47 | 'remoteExtPath' => 'WebFonts', |
49 | | - 'messages' => array( 'webfonts-load', 'webfonts-reset' ), |
50 | | - 'dependencies' => array( 'jquery.cookie', 'ext.webfonts.fontlist'), |
| 48 | + 'dependencies' => 'ext.webfonts.core', |
| 49 | + 'position' => 'top', |
51 | 50 | ); |
52 | 51 | |
53 | | -$wgResourceModules['ext.webfonts.fontlist'] = array( |
54 | | - 'scripts' => 'resources/ext.webfonts.fontlist.js', |
| 52 | +$wgResourceModules['ext.webfonts.core'] = array( |
| 53 | + 'scripts' => array( 'resources/ext.webfonts.js', 'resources/ext.webfonts.fontlist.js' ), |
| 54 | + 'styles' => 'resources/ext.webfonts.css', |
55 | 55 | 'localBasePath' => $dir, |
56 | 56 | 'remoteExtPath' => 'WebFonts', |
| 57 | + 'messages' => array( 'webfonts-load', 'webfonts-reset' ), |
| 58 | + 'dependencies' => 'jquery.cookie' , |
| 59 | + 'position' => 'top', |
57 | 60 | ); |
| 61 | + |
| 62 | + |
Index: trunk/extensions/WebFonts/WebFonts.hooks.php |
— | — | @@ -15,7 +15,7 @@ |
16 | 16 | public static function addModules( $out, $skin ) { |
17 | 17 | |
18 | 18 | if ( $out->getUser()->getOption( 'webfontsEnable' ) ) { |
19 | | - $out->addModules( 'webfonts' ); |
| 19 | + $out->addModules( 'ext.webfonts.init' ); |
20 | 20 | } |
21 | 21 | |
22 | 22 | return true; |