Initial support for webfonts in MobileFrontend

Written in pair-programming with Ryan Kaldari.

This adds a version of webfonts initialization that is stripped
of any smart features. It only loads the basic jquery.webfonts
library and the fonts repository in a way that is usable
with the MobileFronted extension.

It is completely disabled by default.

It can be enabled by setting
$wgULSMobileWebfontsEnabled = true;
and even then it will only be enabled for users
who opted in for the mobile beta mode.

Change-Id: I488e411232a1192bbf46ae5675c701366bda9a3e
This commit is contained in:
Amir E. Aharoni
2013-09-27 16:42:37 -07:00
parent 78152b95c0
commit fd885d9881
4 changed files with 84 additions and 0 deletions

View File

@@ -344,4 +344,21 @@ class UniversalLanguageSelectorHooks {
return true;
}
/**
* Add basic webfonts support to the mobile interface (via MobileFrontend extension)
* Hook: EnterMobileMode
* @param MobileContext $context
* @return bool
*/
public static function onEnterMobileMode( $context ) {
global $wgULSEnable, $wgULSMobileWebfontsEnabled;
// Currently only supported in mobile Beta mode
if ( $wgULSEnable && $wgULSMobileWebfontsEnabled && $context->isBetaGroupMember() ) {
$context->getOutput()->addModules( 'ext.uls.webfonts.mobile' );
}
return true;
}
}