Restore enableWebfonts pref and remove uls-enable

This patch restores the enableWebfonts preference, stored inside
the uls-preferences blob. It existed as 'enable-webfonts' in
the past and was removed in
If735a733717596fae03042c5e277bd538bd8501f

Each wiki can be configured to load the fonts by default
using the new global variable $wgULSWebfontsEnabled.
Its default value is true (to load fonts).

This also removes the preference 'uls-enable', recently added in
I71b70d8ee7c3cad7f49b32e5dc494ef4fc1bdb2f

The initialization of ext.uls.webfonts.js is changed as well,
so that minimal webfonts JS library code is loaded,
and the rest is loaded only if a user requests it.

Bug: 60304
Change-Id: I49e812eae32266f165591c75fd67b86ca06b13f0
This commit is contained in:
Santhosh Thottingal
2014-02-10 17:40:24 +05:30
parent 7b376a80c8
commit 27771fdeaf
20 changed files with 409 additions and 106 deletions

View File

@@ -100,10 +100,17 @@ $GLOBALS['wgULSLanguageDetection'] = true;
/**
* Enable the input methods feature for all users by default.
* Can be disabled manually by the user.
* Can be controlled by the user.
*/
$GLOBALS['wgULSIMEEnabled'] = true;
/**
* Enable the webfonts feature for all users by default.
* Can be controlled by the user.
* @since 2013.01
*/
$GLOBALS['wgULSWebfontsEnabled'] = true;
/**
* Set whether webfont support is loaded within the mobile interface (via the
* MobileFrontend extension).
@@ -195,7 +202,6 @@ $GLOBALS['wgHooks']['SkinTemplateOutputPageBeforeExec'][] =
$GLOBALS['wgHooks']['EnterMobileMode'][] = 'UniversalLanguageSelectorHooks::onEnterMobileMode';
$GLOBALS['wgDefaultUserOptions']['uls-preferences'] = '';
$GLOBALS['wgDefaultUserOptions']['uls-enable'] = '';
$GLOBALS['wgHooks']['GetPreferences'][] = 'UniversalLanguageSelectorHooks::onGetPreferences';
$GLOBALS['wgExtensionFunctions'][] = function () {
@@ -219,7 +225,7 @@ $GLOBALS['wgExtensionFunctions'][] = function () {
$wgResourceModules['schema.UniversalLanguageSelector'] = array(
'class' => 'ResourceLoaderSchemaModule',
'schema' => 'UniversalLanguageSelector',
'revision' => 5729800,
'revision' => 7327441,
);
} else {
wfWarn( 'UniversalLanguageSelector is configured to use EventLogging, but '