Merge "Make base font repository path configurable via $wgULSFontRepositoryBasePath"
This commit is contained in:
@@ -256,7 +256,8 @@ class UniversalLanguageSelectorHooks {
|
|||||||
*/
|
*/
|
||||||
public static function addConfig( &$vars ) {
|
public static function addConfig( &$vars ) {
|
||||||
global $wgULSGeoService, $wgULSIMEEnabled, $wgULSPosition, $wgULSNoWebfontsSelectors,
|
global $wgULSGeoService, $wgULSIMEEnabled, $wgULSPosition, $wgULSNoWebfontsSelectors,
|
||||||
$wgULSAnonCanChangeLanguage, $wgULSEventLogging, $wgULSNoImeSelectors;
|
$wgULSAnonCanChangeLanguage, $wgULSEventLogging, $wgULSNoImeSelectors,
|
||||||
|
$wgULSFontRepositoryBasePath, $wgExtensionAssetsPath;
|
||||||
|
|
||||||
// Place constant stuff here (not depending on request context)
|
// Place constant stuff here (not depending on request context)
|
||||||
if ( is_string( $wgULSGeoService ) ) {
|
if ( is_string( $wgULSGeoService ) ) {
|
||||||
@@ -269,6 +270,13 @@ class UniversalLanguageSelectorHooks {
|
|||||||
$vars['wgULSNoImeSelectors'] = $wgULSNoImeSelectors;
|
$vars['wgULSNoImeSelectors'] = $wgULSNoImeSelectors;
|
||||||
$vars['wgULSNoWebfontsSelectors'] = $wgULSNoWebfontsSelectors;
|
$vars['wgULSNoWebfontsSelectors'] = $wgULSNoWebfontsSelectors;
|
||||||
|
|
||||||
|
if ( is_string( $wgULSFontRepositoryBasePath ) ) {
|
||||||
|
$vars['wgULSFontRepositoryBasePath'] = $wgULSFontRepositoryBasePath;
|
||||||
|
} else {
|
||||||
|
$vars['wgULSFontRepositoryBasePath'] = $wgExtensionAssetsPath .
|
||||||
|
'/UniversalLanguageSelector/data/fontrepo/fonts/';
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -137,6 +137,14 @@ $wgULSNoImeSelectors = array( '#wpCaptchaWord', '.ve-ce-documentNode' );
|
|||||||
*/
|
*/
|
||||||
$wgULSNoWebfontsSelectors = array( '#p-lang li > a' );
|
$wgULSNoWebfontsSelectors = array( '#p-lang li > a' );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base path of ULS font repository.
|
||||||
|
* If not set, will be set to 'UniversalLanguageSelector/data/fontrepo/fonts/',
|
||||||
|
* relative to $wgExtensionAssetsPath.
|
||||||
|
* @since 2013.10
|
||||||
|
*/
|
||||||
|
$wgULSFontRepositoryBasePath = false;
|
||||||
|
|
||||||
// Internationalization
|
// Internationalization
|
||||||
$wgExtensionMessagesFiles['UniversalLanguageSelector'] =
|
$wgExtensionMessagesFiles['UniversalLanguageSelector'] =
|
||||||
__DIR__ . '/UniversalLanguageSelector.i18n.php';
|
__DIR__ . '/UniversalLanguageSelector.i18n.php';
|
||||||
|
|||||||
@@ -47,8 +47,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
mediawikiFontRepository = $.webfonts.repository;
|
mediawikiFontRepository = $.webfonts.repository;
|
||||||
mediawikiFontRepository.base = mw.config.get( 'wgExtensionAssetsPath' ) +
|
mediawikiFontRepository.base = mw.config.get( 'wgULSFontRepositoryBasePath' );
|
||||||
'/UniversalLanguageSelector/data/fontrepo/fonts/';
|
|
||||||
|
|
||||||
mw.webfonts.setup = function () {
|
mw.webfonts.setup = function () {
|
||||||
// Initialize webfonts
|
// Initialize webfonts
|
||||||
|
|||||||
Reference in New Issue
Block a user