From fea60ba244b06f105e7410ccfc57db5c94285920 Mon Sep 17 00:00:00 2001 From: jdlrobson Date: Fri, 6 Sep 2019 12:13:20 -0700 Subject: [PATCH] New table of contents icon, prepare for arrow->expand rename Bug: T231613 Change-Id: I86a4bdac83e1d6caef025ad025962127d74556dd --- includes/skins/MinervaTemplate.php | 5 ++++- resources/skins.minerva.icons.images/toc-ltr.svg | 1 + resources/skins.minerva.icons.images/toc-rtl.svg | 1 + resources/skins.minerva.scripts/init.js | 9 ++++++--- skin.json | 6 ++++++ 5 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 resources/skins.minerva.icons.images/toc-ltr.svg create mode 100644 resources/skins.minerva.icons.images/toc-rtl.svg diff --git a/includes/skins/MinervaTemplate.php b/includes/skins/MinervaTemplate.php index 9501476ce..42ce2d84e 100644 --- a/includes/skins/MinervaTemplate.php +++ b/includes/skins/MinervaTemplate.php @@ -124,7 +124,10 @@ class MinervaTemplate extends BaseTemplate { $args = [ 'clockIconClass' => MinervaUI::iconClass( 'clock', 'before' ), 'arrowIconClass' => MinervaUI::iconClass( - 'arrow-gray', 'element', 'mw-ui-icon-small mf-mw-ui-icon-rotate-anti-clockwise indicator', + 'expand-gray', 'element', + // FIXME: `mw-ui-icon-mf-arrow-gray` can be removed from list of classes + // when Ibbc706146710a9e31a72b3c2cd4e247d7a227488 lands. + 'mw-ui-icon-small mf-mw-ui-icon-rotate-anti-clockwise indicator mw-ui-icon-mf-arrow-gray', // Uses icon in MobileFrontend so must be prefixed mf. // Without MobileFrontend it will not render. // Rather than maintain 2 versions (and variants) of the arrow icon which can conflict diff --git a/resources/skins.minerva.icons.images/toc-ltr.svg b/resources/skins.minerva.icons.images/toc-ltr.svg new file mode 100644 index 000000000..9c1f01870 --- /dev/null +++ b/resources/skins.minerva.icons.images/toc-ltr.svg @@ -0,0 +1 @@ +table of contents \ No newline at end of file diff --git a/resources/skins.minerva.icons.images/toc-rtl.svg b/resources/skins.minerva.icons.images/toc-rtl.svg new file mode 100644 index 000000000..670f1f861 --- /dev/null +++ b/resources/skins.minerva.icons.images/toc-rtl.svg @@ -0,0 +1 @@ +table of contents \ No newline at end of file diff --git a/resources/skins.minerva.scripts/init.js b/resources/skins.minerva.scripts/init.js index 5d1d8dab7..0b99892cb 100644 --- a/resources/skins.minerva.scripts/init.js +++ b/resources/skins.minerva.scripts/init.js @@ -152,7 +152,7 @@ $bar = $lastModifiedLink.closest( '.last-modified-bar' ); $bar.addClass( 'active' ); $bar.find( '.mw-ui-icon-minerva-clock' ).addClass( 'mw-ui-icon-minerva-clock-invert' ); - $bar.find( '.mw-ui-icon-mf-arrow-gray' ).addClass( 'mw-ui-icon-mf-arrow-invert' ); + $bar.find( '.mw-ui-icon-mf-expand-gray' ).addClass( 'mw-ui-icon-mf-expand-invert' ); } msg = time.getLastModifiedMessage( ts, username, gender, historyUrl ); $lastModifiedLink.replaceWith( msg ); @@ -348,12 +348,15 @@ // setup toc icons new Icon( { - glyphPrefix: 'mf', + glyphPrefix: 'minerva', name: 'toc' } ).$el.prependTo( '.toctitle' ); new Icon( { glyphPrefix: 'mf', - name: 'arrow', + name: 'expand', + // FIXME: `additionalClassNames` for backwards compatibility. + // Can be removed when Ibbc706146710a9e31a72b3c2cd4e247d7a227488 lands. + additionalClassNames: 'mw-ui-icon-mf-arrow', isSmall: true } ).$el.appendTo( '.toctitle' ); } ); diff --git a/skin.json b/skin.json index c6b7aa61e..27fde4644 100644 --- a/skin.json +++ b/skin.json @@ -316,6 +316,12 @@ } }, "images": { + "toc": { + "file": { + "ltr": "resources/skins.minerva.icons.images/toc-ltr.svg", + "rtl": "resources/skins.minerva.icons.images/toc-rtl.svg" + } + }, "watch": "resources/skins.minerva.icons.images/watch.svg", "watched": "resources/skins.minerva.icons.images/watched.svg", "warning": "resources/skins.minerva.icons.images/warning.svg",