Index: trunk/extensions/WebFonts/WebFonts.hooks.php |
— | — | @@ -41,8 +41,16 @@ |
42 | 42 | |
43 | 43 | return true; |
44 | 44 | } |
45 | | - |
| 45 | + |
46 | 46 | /** |
| 47 | + * Hook: ResourceLoaderGetConfigVars |
| 48 | + */ |
| 49 | + public static function addConfig( &$vars ) { |
| 50 | + $vars['wgWebFontsHelpPage'] = wfMsgForContent( 'webfonts-help-page' ); |
| 51 | + return true; |
| 52 | + } |
| 53 | + |
| 54 | + /** |
47 | 55 | * UserGetDefaultOptions hook handler. |
48 | 56 | * @param $defaultOptions array |
49 | 57 | * @return bool |
Index: trunk/extensions/WebFonts/resources/ext.webfonts.js |
— | — | @@ -328,10 +328,10 @@ |
329 | 329 | $fontsMenu.append( $resetItem ); |
330 | 330 | |
331 | 331 | |
332 | | - |
| 332 | + var helpPage = mw.config.get( 'wgWebFontsHelpPage' ); |
333 | 333 | var $helpLink = $( '<a id="webfont-help-link" >' ) |
334 | 334 | .text( mw.msg( 'webfonts-help' ) ) |
335 | | - .prop( 'href', '//mediawiki.org/wiki/Special:MyLanguage/Help:Web_fonts' ) |
| 335 | + .prop( 'href', helpPage ) |
336 | 336 | .prop( 'target', '_blank'); |
337 | 337 | var $helpItem = $( '<li>' ).addClass( 'webfont-help-item' ).append( $helpLink ); |
338 | 338 | $fontsMenu.append( $helpItem ); |
Index: trunk/extensions/WebFonts/WebFonts.i18n.php |
— | — | @@ -19,6 +19,7 @@ |
20 | 20 | 'webfonts-enable-preference' => 'Enable font embedding (WebFonts)', |
21 | 21 | 'webfonts-menu-tooltip' => 'Select a font for the page', |
22 | 22 | 'webfonts-help' => 'Help', |
| 23 | + 'webfonts-help-page' => '//mediawiki.org/wiki/Special:MyLanguage/Help:Web_fonts', |
23 | 24 | ); |
24 | 25 | |
25 | 26 | /** Message documentation (Message documentation) |
— | — | @@ -31,6 +32,7 @@ |
32 | 33 | 'webfonts-reset' => '{{Identical|Reset}}', |
33 | 34 | 'webfonts-menu-tooltip' => 'Tooltip text displayed in the webfont link', |
34 | 35 | 'webfonts-help' => 'Text for the help link', |
| 36 | + 'webfonts-help-page' => 'Change this only if you want to point the help link to a different wiki page.', |
35 | 37 | ); |
36 | 38 | |
37 | 39 | /** Arabic (العربية) |
Index: trunk/extensions/WebFonts/WebFonts.php |
— | — | @@ -37,6 +37,7 @@ |
38 | 38 | $wgHooks['BeforePageDisplay'][] = 'WebFontsHooks::addModules'; |
39 | 39 | $wgHooks['GetPreferences'][] = 'WebFontsHooks::addPreference'; |
40 | 40 | $wgHooks['UserGetDefaultOptions'][] = 'WebFontsHooks::addDefaultOptions'; |
| 41 | +$wgHooks['ResourceLoaderGetConfigVars'][] = 'WebFontsHooks::addConfig'; |
41 | 42 | |
42 | 43 | $wgWebFontsEnabledByDefault = true; |
43 | 44 | |
— | — | @@ -57,7 +58,13 @@ |
58 | 59 | ), |
59 | 60 | 'localBasePath' => $dir, |
60 | 61 | 'remoteExtPath' => 'WebFonts', |
61 | | - 'messages' => array( 'webfonts-load', 'webfonts-reset', 'webfonts-menu-tooltip' ), |
62 | | - 'dependencies' => 'jquery.cookie' , |
| 62 | + 'messages' => array( |
| 63 | + 'webfonts-load', |
| 64 | + 'webfonts-reset', |
| 65 | + 'webfonts-menu-tooltip', |
| 66 | + 'webfonts-help', |
| 67 | + 'webfonts-help-page', |
| 68 | + ), |
| 69 | + 'dependencies' => 'jquery.cookie', |
63 | 70 | 'position' => 'top', |
64 | 71 | ); |