Remove skins.minerva.icons.images.variants module
This module produces 6 icons: ["clock", "profile"] * ["black", "gray", "white"] of which only 3 are needed: clock-gray, clock-white, profile-gray. This patch removes the module and moves the "clock" and "profile" icons into `skins.minerva.icons.images`. Since that module does not inline SVG's, the additional cost of adding these icons, which are loaded at startup, is minimal. The editLocked.svg icon has also been edited to correct its color. Bug: T218807 Change-Id: Ib54960eb556dfe0c1ae06d2f73d4f350e519e20f
|
@ -160,7 +160,6 @@ class MinervaHooks {
|
||||||
switch ( $name ) {
|
switch ( $name ) {
|
||||||
case 'MobileMenu':
|
case 'MobileMenu':
|
||||||
$out->addModuleStyles( [
|
$out->addModuleStyles( [
|
||||||
'skins.minerva.icons.images.variants',
|
|
||||||
'skins.minerva.mainMenu.icons',
|
'skins.minerva.mainMenu.icons',
|
||||||
'skins.minerva.mainMenu.styles',
|
'skins.minerva.mainMenu.styles',
|
||||||
] );
|
] );
|
||||||
|
|
|
@ -114,7 +114,7 @@ class MinervaTemplate extends BaseTemplate {
|
||||||
$action = Action::getActionName( RequestContext::getMain() );
|
$action = Action::getActionName( RequestContext::getMain() );
|
||||||
if ( isset( $data['historyLink'] ) && $action === 'view' ) {
|
if ( isset( $data['historyLink'] ) && $action === 'view' ) {
|
||||||
$args = [
|
$args = [
|
||||||
'clockIconClass' => MinervaUI::iconClass( 'clock-gray', 'before' ),
|
'clockIconClass' => MinervaUI::iconClass( 'clock', 'before' ),
|
||||||
'arrowIconClass' => MinervaUI::iconClass(
|
'arrowIconClass' => MinervaUI::iconClass(
|
||||||
'arrow-gray', 'element', 'mw-ui-icon-small mf-mw-ui-icon-rotate-anti-clockwise indicator',
|
'arrow-gray', 'element', 'mw-ui-icon-small mf-mw-ui-icon-rotate-anti-clockwise indicator',
|
||||||
// Uses icon in MobileFrontend so must be prefixed mf.
|
// Uses icon in MobileFrontend so must be prefixed mf.
|
||||||
|
|
|
@ -730,7 +730,7 @@ class SkinMinerva extends SkinTemplate {
|
||||||
->addComponent(
|
->addComponent(
|
||||||
$username,
|
$username,
|
||||||
Title::newFromText( $username, NS_USER )->getLocalUrl(),
|
Title::newFromText( $username, NS_USER )->getLocalUrl(),
|
||||||
MinervaUI::iconClass( 'profile-gray', 'before', 'truncated-text primary-action' ),
|
MinervaUI::iconClass( 'profile', 'before', 'truncated-text primary-action' ),
|
||||||
[ 'data-event-name' => 'profile' ]
|
[ 'data-event-name' => 'profile' ]
|
||||||
)
|
)
|
||||||
->addComponent(
|
->addComponent(
|
||||||
|
@ -1279,7 +1279,7 @@ class SkinMinerva extends SkinTemplate {
|
||||||
*/
|
*/
|
||||||
protected function getHistoryPageAction() {
|
protected function getHistoryPageAction() {
|
||||||
return [
|
return [
|
||||||
'class' => MinervaUI::iconClass( 'clock-gray' ),
|
'class' => MinervaUI::iconClass( 'clock' ),
|
||||||
'text' => $this->msg( 'mobile-frontend-history' ),
|
'text' => $this->msg( 'mobile-frontend-history' ),
|
||||||
'href' => $this->getHistoryUrl( $this->getTitle() )
|
'href' => $this->getHistoryUrl( $this->getTitle() )
|
||||||
];
|
];
|
||||||
|
@ -1459,7 +1459,7 @@ class SkinMinerva extends SkinTemplate {
|
||||||
'mediawiki.hlist',
|
'mediawiki.hlist',
|
||||||
'mediawiki.ui.icon',
|
'mediawiki.ui.icon',
|
||||||
'mediawiki.ui.button',
|
'mediawiki.ui.button',
|
||||||
'skins.minerva.icons.images',
|
'skins.minerva.icons.images'
|
||||||
];
|
];
|
||||||
if ( $title->isMainPage() ) {
|
if ( $title->isMainPage() ) {
|
||||||
$styles[] = 'skins.minerva.mainPage.styles';
|
$styles[] = 'skins.minerva.mainPage.styles';
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 -407 24 24"><path d="M21.348-401.268q.94 0 1.61.668l.92.922-11.858 11.86L.198-399.66l.922-.94q.65-.686 1.59-.686.94 0 1.61.668l7.718 7.7 7.7-7.682q.67-.668 1.61-.668z"/></svg>
|
|
Before Width: | Height: | Size: 287 B |
|
@ -1 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 13c-5.9 0-8 3-8 5v3h16v-3c0-2-2.1-5-8-5z"/><circle cx="12" cy="7.5" r="4.5"/></svg>
|
|
Before Width: | Height: | Size: 217 B |
Before Width: | Height: | Size: 489 B After Width: | Height: | Size: 489 B |
|
@ -1 +1 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><g id="Page-1" fill="none" fill-rule="evenodd"><g id="edit-locked" fill="#72777d"><path d="M14 15h.75l-7 7H3v-4.75l9-9V13a2 2 0 0 0 2 2zm7.036-8c.532 0 .964.432.964.964v4.072a.965.965 0 0 1-.964.964h-6.072a.965.965 0 0 1-.964-.964V7.964c0-.532.432-.964.964-.964h.536V5.5S15.5 3 18 3s2.5 2.5 2.5 2.5V7h.536zM19.5 7V5.75C19.5 5 19.5 4 18 4s-1.5 1-1.5 1.75V7h3zM18 11a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"/></g></g></svg>
|
<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><g id="Page-1" fill="none" fill-rule="evenodd"><g id="edit-locked" fill="#54595d"><path d="M14 15h.75l-7 7H3v-4.75l9-9V13a2 2 0 0 0 2 2zm7.036-8c.532 0 .964.432.964.964v4.072a.965.965 0 0 1-.964.964h-6.072a.965.965 0 0 1-.964-.964V7.964c0-.532.432-.964.964-.964h.536V5.5S15.5 3 18 3s2.5 2.5 2.5 2.5V7h.536zM19.5 7V5.75C19.5 5 19.5 4 18 4s-1.5 1-1.5 1.75V7h3zM18 11a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"/></g></g></svg>
|
Before Width: | Height: | Size: 531 B After Width: | Height: | Size: 531 B |
|
@ -0,0 +1 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="#54595d" d="M12 13c-5.9 0-8 3-8 5v3h16v-3c0-2-2.1-5-8-5z"/><circle fill="#54595d" cx="12" cy="7.5" r="4.5"/></svg>
|
After Width: | Height: | Size: 247 B |
|
@ -169,10 +169,8 @@
|
||||||
if ( time.isRecent( delta ) ) {
|
if ( time.isRecent( delta ) ) {
|
||||||
$bar = $lastModifiedLink.closest( '.last-modified-bar' );
|
$bar = $lastModifiedLink.closest( '.last-modified-bar' );
|
||||||
$bar.addClass( 'active' );
|
$bar.addClass( 'active' );
|
||||||
// in beta update icons to be inverted
|
$bar.find( '.mw-ui-icon-minerva-clock' ).addClass( 'mw-ui-icon-minerva-clock-invert' );
|
||||||
$bar.find( '.mw-ui-icon' ).each( function () {
|
$bar.find( '.mw-ui-icon-mf-arrow-gray' ).addClass( 'mw-ui-icon-mf-arrow-invert' );
|
||||||
$( this ).attr( 'class', $( this ).attr( 'class' ).replace( '-gray', '-invert' ) );
|
|
||||||
} );
|
|
||||||
}
|
}
|
||||||
msg = time.getLastModifiedMessage( ts, username, gender, historyUrl );
|
msg = time.getLastModifiedMessage( ts, username, gender, historyUrl );
|
||||||
$lastModifiedLink.replaceWith( msg );
|
$lastModifiedLink.replaceWith( msg );
|
||||||
|
|
36
skin.json
|
@ -228,8 +228,16 @@
|
||||||
},
|
},
|
||||||
"skins.minerva.icons.images": {
|
"skins.minerva.icons.images": {
|
||||||
"class": "ResourceLoaderImageModule",
|
"class": "ResourceLoaderImageModule",
|
||||||
"selector": ".mw-ui-icon-minerva-{name}:before",
|
"selectorWithoutVariant": ".mw-ui-icon-minerva-{name}:before",
|
||||||
|
"selectorWithVariant": ".mw-ui-icon-minerva-{name}-{variant}:before",
|
||||||
"useDataURI": false,
|
"useDataURI": false,
|
||||||
|
"defaultColor": "#54595d",
|
||||||
|
"variants": {
|
||||||
|
"invert": {
|
||||||
|
"color": "#fff",
|
||||||
|
"global": false
|
||||||
|
}
|
||||||
|
},
|
||||||
"images": {
|
"images": {
|
||||||
"watch": "resources/skins.minerva.icons.images/watch.svg",
|
"watch": "resources/skins.minerva.icons.images/watch.svg",
|
||||||
"watched": "resources/skins.minerva.icons.images/watched.svg",
|
"watched": "resources/skins.minerva.icons.images/watched.svg",
|
||||||
|
@ -237,26 +245,12 @@
|
||||||
"mainmenu": "resources/skins.minerva.icons.images/hamburger.svg",
|
"mainmenu": "resources/skins.minerva.icons.images/hamburger.svg",
|
||||||
"edit": "resources/skins.minerva.icons.images/editLocked.svg",
|
"edit": "resources/skins.minerva.icons.images/editLocked.svg",
|
||||||
"edit-enabled": "resources/skins.minerva.icons.images/edit.svg",
|
"edit-enabled": "resources/skins.minerva.icons.images/edit.svg",
|
||||||
"language-switcher": "resources/skins.minerva.icons.images/languageSwitcher.svg"
|
"language-switcher": "resources/skins.minerva.icons.images/languageSwitcher.svg",
|
||||||
}
|
"profile": "resources/skins.minerva.icons.images/profile.svg",
|
||||||
},
|
"clock": {
|
||||||
"skins.minerva.icons.images.variants": {
|
"file": "resources/skins.minerva.icons.images/clock.svg",
|
||||||
"selectorWithoutVariant": ".mw-ui-icon-minerva-{name}:before",
|
"variants": [ "invert" ]
|
||||||
"selectorWithVariant": ".mw-ui-icon-minerva-{name}-{variant}:before",
|
|
||||||
"class": "ResourceLoaderImageModule",
|
|
||||||
"variants": {
|
|
||||||
"gray": {
|
|
||||||
"color": "#54595d",
|
|
||||||
"global": true
|
|
||||||
},
|
|
||||||
"invert": {
|
|
||||||
"color": "#fff",
|
|
||||||
"global": true
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"images": {
|
|
||||||
"profile": "resources/skins.minerva.icons.images.variants/profile.svg",
|
|
||||||
"clock": "resources/skins.minerva.icons.images.variants/clock.svg"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"skins.minerva.icons.images.scripts": {
|
"skins.minerva.icons.images.scripts": {
|
||||||
|
@ -372,7 +366,6 @@
|
||||||
"desktop"
|
"desktop"
|
||||||
],
|
],
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"skins.minerva.icons.images.variants",
|
|
||||||
"skins.minerva.mainMenu.icons",
|
"skins.minerva.mainMenu.icons",
|
||||||
"skins.minerva.mainMenu.styles",
|
"skins.minerva.mainMenu.styles",
|
||||||
"jquery.cookie",
|
"jquery.cookie",
|
||||||
|
@ -533,7 +526,6 @@
|
||||||
],
|
],
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"mobile.startup",
|
"mobile.startup",
|
||||||
"skins.minerva.icons.images.variants",
|
|
||||||
"skins.minerva.scripts"
|
"skins.minerva.scripts"
|
||||||
],
|
],
|
||||||
"scripts": [
|
"scripts": [
|
||||||
|
|