Hello Aaron Schulz, Esanders, Addshore, Florianschmidtwelzow, jenkins-bot, VolkerE, Jforrester, Jdlrobson, Jackmcbarn, Mvolz,
I'd like you to do a code review. Please visit https://gerrit.wikimedia.org/r/338215 to review the following change. Change subject: Revert "Revert "Use OOjs UI icons"" ...................................................................... Revert "Revert "Use OOjs UI icons"" This reverts commit 7a7609bbaf443b4862e552ae5ddc40bc59aa0a1c. Change-Id: I5fb1a6ec0d051ca2a6e4271e4f1115c5484a5130 --- M frontend/FlaggablePageView.php M frontend/FlaggedRevsXML.php M frontend/modules/ext.flaggedRevs.advanced.js M frontend/modules/ext.flaggedRevs.basic.css D frontend/modules/img/1.png D frontend/modules/img/2.png D frontend/modules/img/3.png D frontend/modules/img/arrow-down.png D frontend/modules/img/arrow-up.png D frontend/modules/img/checkmark-green.png D frontend/modules/img/checkmark-orange.png D frontend/modules/img/doc-check.png D frontend/modules/img/doc-magnify.png M frontend/modules/img/license.txt D frontend/modules/img/lock-closed.png D frontend/modules/img/lock-open.png 16 files changed, 58 insertions(+), 40 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FlaggedRevs refs/changes/15/338215/1 diff --git a/frontend/FlaggablePageView.php b/frontend/FlaggablePageView.php index 610fcaa..c7f268f 100644 --- a/frontend/FlaggablePageView.php +++ b/frontend/FlaggablePageView.php @@ -53,6 +53,15 @@ if ( $this->article == null ) { throw new Exception( 'FlaggablePageView has no context article!' ); } + $this->getOutput()->enableOOUI(); + $this->getOutput()->addModuleStyles( + [ + 'oojs-ui.styles.icons-moderation', + 'oojs-ui.styles.icons-movement', + 'oojs-ui.styles.icons-content', + 'oojs-ui.styles.icons-alerts', + ] + ); $this->out = $this->getOutput(); // convenience } } diff --git a/frontend/FlaggedRevsXML.php b/frontend/FlaggedRevsXML.php index bad5196..71fb4db 100644 --- a/frontend/FlaggedRevsXML.php +++ b/frontend/FlaggedRevsXML.php @@ -4,14 +4,6 @@ * Includes functions for selectors, icons, notices, CSS, and form aspects. */ class FlaggedRevsXML { - /** - * Get the URL path to where the client side resources are (JS, CSS, images..) - * @return string - */ - public static function styleUrlPath() { - global $wgExtensionAssetsPath; - return "$wgExtensionAssetsPath/FlaggedRevs/frontend/modules"; - } /** * Get a selector of reviewable namespaces @@ -310,11 +302,14 @@ * @return string */ public static function ratingArrow() { - $encPath = htmlspecialchars( self::styleUrlPath() . '/img' ); - $img = '<img id="mw-fr-revisiontoggle" class="fr-toggle-arrow"'; - $img .= " src=\"{$encPath}/arrow-down.png\" style=\"display:none;\""; - $img .= ' alt="' . wfMessage( 'revreview-toggle-title' )->escaped() . '" />'; - return $img; + return ( new OOUI\IndicatorWidget( + [ + 'indicator' => 'down', + 'classes' => [ 'fr-toggle-arrow' ], + 'id' => 'mw-fr-revisiontoggle', + 'title' => wfMessage( 'revreview-toggle-title' )->text(), + ] + ) )->toString(); } /** @@ -371,25 +366,33 @@ * @return string */ public static function draftStatusIcon() { - $encPath = htmlspecialchars( self::styleUrlPath() . '/img' ); - $encTitle = wfMessage( 'revreview-draft-title' )->escaped(); - return "<img class=\"flaggedrevs-icon\" src=\"$encPath/1.png\"" . - " alt=\"$encTitle\" title=\"$encTitle\" />"; + $encTitle = wfMessage( 'revreview-draft-title' )->text(); + return ( new OOUI\IconWidget( + [ + 'icon' => 'block', + 'classes' => [ 'flaggedrevs-icon' ], + 'title' => $encTitle, + ] + ) )->toString(); } - + /** * Creates CSS stable page icon * @param bool $isQuality * @return string */ public static function stableStatusIcon( $isQuality ) { - $encPath = htmlspecialchars( self::styleUrlPath() . '/img' ); - $file = $isQuality ? '3.png' : '2.png'; + $icon = $isQuality ? 'check' : 'eye'; $encTitle = $isQuality - ? wfMessage( 'revreview-quality-title' )->escaped() - : wfMessage( 'revreview-basic-title' )->escaped(); - return "<img class=\"flaggedrevs-icon\" src=\"$encPath/$file\"" . - " alt=\"$encTitle\" title=\"$encTitle\" />"; + ? wfMessage( 'revreview-quality-title' )->text() + : wfMessage( 'revreview-basic-title' )->text(); + return ( new OOUI\IconWidget( + [ + 'icon' => $icon, + 'classes' => [ 'flaggedrevs-icon' ], + 'title' => $encTitle, + ] + ) )->toString(); } /** @@ -398,18 +401,22 @@ * @return string */ public static function lockStatusIcon( $flaggedArticle ) { - $encPath = htmlspecialchars( self::styleUrlPath() . '/img' ); if ( $flaggedArticle->isPageLocked() ) { - $encTitle = wfMessage( 'revreview-locked-title' )->escaped(); - return "<img class=\"flaggedrevs-icon\" src=\"$encPath/doc-magnify.png\"" . - " alt=\"$encTitle\" title=\"$encTitle\" />"; + $encTitle = wfMessage( 'revreview-locked-title' )->text(); + $icon = 'articleSearch'; } elseif ( $flaggedArticle->isPageUnlocked() ) { - $encTitle = wfMessage( 'revreview-unlocked-title' )->escaped(); - return "<img class=\"flaggedrevs-icon\" src=\"$encPath/doc-check.png\"" . - " alt=\"$encTitle\" title=\"$encTitle\" />"; + $encTitle = wfMessage( 'revreview-unlocked-title' )->text(); + $icon = 'articleCheck'; + } else { + return ''; } - - return ''; + return ( new OOUI\IconWidget( + [ + 'icon' => $icon, + 'classes' => [ 'flaggedrevs-icon' ], + 'title' => $encTitle, + ] + ) )->toString(); } /** @@ -453,4 +460,5 @@ $article->getTitle()->getPrefixedText(), '', $params ); return "<div id=\"mw-fr-logexcerpt\">$logHtml</div>"; } + } diff --git a/frontend/modules/ext.flaggedRevs.advanced.js b/frontend/modules/ext.flaggedRevs.advanced.js index ad55f71..09e11f6 100644 --- a/frontend/modules/ext.flaggedRevs.advanced.js +++ b/frontend/modules/ext.flaggedRevs.advanced.js @@ -175,7 +175,7 @@ var $toggle = $( '#mw-fr-revisiontoggle' ); if ( $toggle.length ) { - $toggle.css( 'display', 'inline' ); // show toggle control + $toggle.css( 'display', 'inline-block' ); // show toggle control fr.hideBoxDetails(); // hide the initially displayed ratings } @@ -189,7 +189,7 @@ // Enables diff detail box and toggle $toggle = $( '#mw-fr-difftoggle' ); if ( $toggle.length ) { - $toggle.css( 'display', 'inline' ); // show toggle control + $toggle.css( 'display', 'inline-block' ); // show toggle control $( '#mw-fr-stablediff' ).hide(); } $toggle.children( 'a' ).click( fr.toggleDiff ); @@ -197,7 +197,7 @@ // Enables log detail box and toggle $toggle = $( '#mw-fr-logtoggle' ); if ( $toggle.length ) { - $toggle.css( 'display', 'inline' ); // show toggle control + $toggle.css( 'display', 'inline-block' ); // show toggle control if ( $toggle.hasClass( 'fr-logtoggle-details' ) ) { // hide in edit mode $( '#mw-fr-logexcerpt' ).hide(); diff --git a/frontend/modules/ext.flaggedRevs.basic.css b/frontend/modules/ext.flaggedRevs.basic.css index 2fba3a5..c46d1c6 100644 --- a/frontend/modules/ext.flaggedRevs.basic.css +++ b/frontend/modules/ext.flaggedRevs.basic.css @@ -238,17 +238,19 @@ cursor: pointer; } -img.fr-toggle-arrow { +span.fr-toggle-arrow { cursor: pointer; + opacity: 0.87; } li.fr-hist-stable-margin { margin-top: 2em; } -img.flaggedrevs-icon { +span.flaggedrevs-icon { margin-right: 0.2em; margin-left: 0.2em; + opacity: 0.87; } .fr-diff-ratings { diff --git a/frontend/modules/img/1.png b/frontend/modules/img/1.png deleted file mode 100644 index 6ac6954..0000000 --- a/frontend/modules/img/1.png +++ /dev/null Binary files differ diff --git a/frontend/modules/img/2.png b/frontend/modules/img/2.png deleted file mode 100644 index 8dc93ed..0000000 --- a/frontend/modules/img/2.png +++ /dev/null Binary files differ diff --git a/frontend/modules/img/3.png b/frontend/modules/img/3.png deleted file mode 100644 index d2fa5b5..0000000 --- a/frontend/modules/img/3.png +++ /dev/null Binary files differ diff --git a/frontend/modules/img/arrow-down.png b/frontend/modules/img/arrow-down.png deleted file mode 100644 index 0148dbb..0000000 --- a/frontend/modules/img/arrow-down.png +++ /dev/null Binary files differ diff --git a/frontend/modules/img/arrow-up.png b/frontend/modules/img/arrow-up.png deleted file mode 100644 index 664be9a..0000000 --- a/frontend/modules/img/arrow-up.png +++ /dev/null Binary files differ diff --git a/frontend/modules/img/checkmark-green.png b/frontend/modules/img/checkmark-green.png deleted file mode 100644 index 3ff4bec..0000000 --- a/frontend/modules/img/checkmark-green.png +++ /dev/null Binary files differ diff --git a/frontend/modules/img/checkmark-orange.png b/frontend/modules/img/checkmark-orange.png deleted file mode 100644 index 46836e8..0000000 --- a/frontend/modules/img/checkmark-orange.png +++ /dev/null Binary files differ diff --git a/frontend/modules/img/doc-check.png b/frontend/modules/img/doc-check.png deleted file mode 100644 index 2a0c3af..0000000 --- a/frontend/modules/img/doc-check.png +++ /dev/null Binary files differ diff --git a/frontend/modules/img/doc-magnify.png b/frontend/modules/img/doc-magnify.png deleted file mode 100644 index 0bef54b..0000000 --- a/frontend/modules/img/doc-magnify.png +++ /dev/null Binary files differ diff --git a/frontend/modules/img/license.txt b/frontend/modules/img/license.txt index a3ac876..6f0c8dd 100644 --- a/frontend/modules/img/license.txt +++ b/frontend/modules/img/license.txt @@ -1,5 +1,4 @@ All images in this folder are available under the GNU Free Documentation license (1.2+). -All the images are to be credited to Joerg Baach, except for lock-open.png and lock-closed.png, -which where created by "Jasu" (http://commons.wikimedia.org/wiki/User:Jasu), under the same license. \ No newline at end of file +All the images are to be credited to Joerg Baach. diff --git a/frontend/modules/img/lock-closed.png b/frontend/modules/img/lock-closed.png deleted file mode 100644 index 897cfd0..0000000 --- a/frontend/modules/img/lock-closed.png +++ /dev/null Binary files differ diff --git a/frontend/modules/img/lock-open.png b/frontend/modules/img/lock-open.png deleted file mode 100644 index a04115b..0000000 --- a/frontend/modules/img/lock-open.png +++ /dev/null Binary files differ -- To view, visit https://gerrit.wikimedia.org/r/338215 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5fb1a6ec0d051ca2a6e4271e4f1115c5484a5130 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/FlaggedRevs Gerrit-Branch: master Gerrit-Owner: Ladsgroup <ladsgr...@gmail.com> Gerrit-Reviewer: Aaron Schulz <asch...@wikimedia.org> Gerrit-Reviewer: Addshore <addshorew...@gmail.com> Gerrit-Reviewer: Esanders <esand...@wikimedia.org> Gerrit-Reviewer: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com> Gerrit-Reviewer: Jackmcbarn <jackmcb...@gmail.com> Gerrit-Reviewer: Jdlrobson <jrob...@wikimedia.org> Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org> Gerrit-Reviewer: Mvolz <mv...@wikimedia.org> Gerrit-Reviewer: VolkerE <volke...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits