mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-24 06:13:54 +00:00
Remove MobileFrontend's font changing code from Minerva
Fontchanger code now runs on all skins under the `mobile` target. All the code will now live in MobileFrontend meaning developers can operate inside one code base. Depends-On: I857cfe2d9be9fe49c04c860bc234384c787239b2 Change-Id: I2759455cb6d7ddf13798e94452cb74baf502bafe
This commit is contained in:
parent
5cb46fe9d2
commit
d3318a9f85
|
@ -137,8 +137,6 @@ class MinervaHooks {
|
|||
=> $mobileContext->isBetaGroupMember(),
|
||||
SkinMinerva::OPTION_CATEGORIES
|
||||
=> $mobileContext->getConfigVariable( 'MinervaShowCategoriesButton' ),
|
||||
SkinMinerva::OPTION_FONT_CHANGER
|
||||
=> $mobileContext->getConfigVariable( 'MinervaEnableFontChanger' ),
|
||||
SkinMinerva::OPTION_BACK_TO_TOP
|
||||
=> $mobileContext->getConfigVariable( 'MinervaEnableBackToTop' ),
|
||||
SkinMinerva::OPTION_TOGGLING => true,
|
||||
|
|
|
@ -15,7 +15,6 @@ class SkinMinerva extends SkinTemplate implements ICustomizableSkin {
|
|||
/** Set of keys for available skin options. See $skinOptions. */
|
||||
const OPTION_MOBILE_OPTIONS = 'mobileOptionsLink';
|
||||
const OPTION_CATEGORIES = 'categories';
|
||||
const OPTION_FONT_CHANGER = 'fontChanger';
|
||||
const OPTION_BACK_TO_TOP = 'backToTop';
|
||||
const OPTION_TOGGLING = 'toggling';
|
||||
const OPTIONS_MOBILE_BETA = 'beta';
|
||||
|
@ -76,8 +75,6 @@ class SkinMinerva extends SkinTemplate implements ICustomizableSkin {
|
|||
self::OPTION_MOBILE_OPTIONS => false,
|
||||
/** Whether a categories button should appear at the bottom of the skin. */
|
||||
self::OPTION_CATEGORIES => false,
|
||||
/** Whether an option to change font size appears in Special:MobileOptions */
|
||||
self::OPTION_FONT_CHANGER => false,
|
||||
/** Whether a back to top button appears at the bottom of the view page */
|
||||
self::OPTION_BACK_TO_TOP => false,
|
||||
/** Whether sections can be collapsed (requires MobileFrontend and MobileFormatter) */
|
||||
|
@ -1347,10 +1344,6 @@ class SkinMinerva extends SkinTemplate implements ICustomizableSkin {
|
|||
$modules[] = 'skins.minerva.categories';
|
||||
}
|
||||
|
||||
if ( $this->getSkinOption( self::OPTION_FONT_CHANGER ) ) {
|
||||
$modules[] = 'skins.minerva.fontchanger';
|
||||
}
|
||||
|
||||
if ( $this->getSkinOption( self::OPTION_BACK_TO_TOP ) ) {
|
||||
$modules[] = 'skins.minerva.backtotop';
|
||||
}
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
( function ( M, $ ) {
|
||||
var userFontSize = mw.storage.get( 'userFontSize' );
|
||||
|
||||
if ( userFontSize !== '100' ) {
|
||||
$( '.content p' ).css( 'font-size', userFontSize + '%' );
|
||||
}
|
||||
}( mw.mobileFrontend, jQuery ) );
|
16
skin.json
16
skin.json
|
@ -471,18 +471,6 @@
|
|||
"resources/skins.minerva.watchstar/init.js"
|
||||
]
|
||||
},
|
||||
"skins.minerva.fontchanger": {
|
||||
"targets": [
|
||||
"mobile",
|
||||
"desktop"
|
||||
],
|
||||
"dependencies": [
|
||||
"mobile.startup"
|
||||
],
|
||||
"scripts": [
|
||||
"resources/skins.minerva.fontchanger/init.js"
|
||||
]
|
||||
},
|
||||
"skins.minerva.tablet.scripts": {
|
||||
"targets": [
|
||||
"mobile",
|
||||
|
@ -516,10 +504,6 @@
|
|||
"base": false,
|
||||
"beta": true
|
||||
},
|
||||
"MinervaEnableFontChanger": {
|
||||
"base": false,
|
||||
"beta": true
|
||||
},
|
||||
"MinervaEnableBackToTop": {
|
||||
"base": false,
|
||||
"beta": true
|
||||
|
|
|
@ -162,12 +162,11 @@ class SkinMinervaTest extends MediaWikiTestCase {
|
|||
*
|
||||
* @covers ::getContextSpecificModules
|
||||
* @dataProvider provideGetContextSpecificModules
|
||||
* @param string $fontchangerValue whether font changer feature is enabled
|
||||
* @param mixed $backToTopValue whether back to top feature is enabled
|
||||
* @param string $moduleName Module name that is being tested
|
||||
* @param bool $expected Whether the module is expected to be returned by the function being tested
|
||||
*/
|
||||
public function testGetContextSpecificModules( $fontchangerValue, $backToTopValue,
|
||||
public function testGetContextSpecificModules( $backToTopValue,
|
||||
$moduleName, $expected
|
||||
) {
|
||||
$skin = new SkinMinerva();
|
||||
|
@ -177,7 +176,6 @@ class SkinMinervaTest extends MediaWikiTestCase {
|
|||
|
||||
$skin->setContext( $testContext );
|
||||
$skin->setSkinOptions( [
|
||||
'fontChanger' => $fontchangerValue,
|
||||
'backToTop' => $backToTopValue,
|
||||
] );
|
||||
|
||||
|
@ -190,10 +188,8 @@ class SkinMinervaTest extends MediaWikiTestCase {
|
|||
|
||||
public function provideGetContextSpecificModules() {
|
||||
return [
|
||||
[ true, false, 'skins.minerva.fontchanger', true ],
|
||||
[ false, true, 'skins.minerva.fontchanger', false ],
|
||||
[ false, true, 'skins.minerva.backtotop', true ],
|
||||
[ false, false, 'skins.minerva.backtotop', false ],
|
||||
[ true, 'skins.minerva.backtotop', true ],
|
||||
[ false, 'skins.minerva.backtotop', false ],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue