jenkins-bot has submitted this change and it was merged.

Change subject: Fix the notifications icon in alpha
......................................................................


Fix the notifications icon in alpha

* Fix the bell.svg file to be the correct size
* Move span out of the iconed element in alpha only - restructure
SkinMinervaAlpha to allow this.
* Use a generic class name for notification count.

Bug: 72979
Bug: 72977
Change-Id: I7b4cf7ace757f89eb0b339d9e58eb896e514955e
---
M includes/skins/SkinMinerva.php
M includes/skins/SkinMinervaAlpha.php
M less/images/icons/bell.png
M less/images/icons/bell.svg
A less/images/icons/editSourceNormal.png
A less/images/icons/editToggle.png
A less/images/icons/editVeNormal.png
M less/ui.less
8 files changed, 88 insertions(+), 41 deletions(-)

Approvals:
  Bmansurov: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index f36a764..a68c8d5 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -229,6 +229,30 @@
        }
 
        /**
+        * Creates element relating to secondary button
+        * @param string $title Title attribute value of secondary button
+        * @param string $url of secondary button
+        * @param string $spanLabel text of span associated with secondary 
button.
+        * @param string $spanClass the class of the secondary button
+        * @return string html relating to button
+        */
+       protected function createSecondaryButton( $title, $url, $spanLabel, 
$spanClass ) {
+               return Html::openElement( 'a', array(
+                               'title' => $title,
+                               'href' => $url,
+                               'class' => MobileUI::iconClass( 
'notifications', 'element',
+                                       'user-button main-header-button 
icon-32px' ),
+                               'id' => 'secondary-button',
+                       ) ) .
+                       Html::element(
+                               'span',
+                               array( 'class' => $spanClass ),
+                               $spanLabel
+                       ) .
+                       Html::closeElement( 'a' );
+       }
+
+       /**
         * Prepares the user button.
         * @param QuickTemplate $tpl
         */
@@ -258,21 +282,13 @@
                }
 
                if ( $notificationsTitle ) {
+                       $spanClass = $isZero ? 'zero notification-count' : 
'notification-count';
+
+                       $url = $notificationsTitle->getLocalURL(
+                               array( 'returnto' => 
$currentTitle->getPrefixedText() ) );
+
                        $tpl->set( 'secondaryButton',
-                               Html::openElement( 'a', array(
-                                       'title' => $notificationsMsg,
-                                       'href' => 
$notificationsTitle->getLocalURL(
-                                               array( 'returnto' => 
$currentTitle->getPrefixedText() ) ),
-                                       'class' => MobileUI::iconClass( 
'notifications', 'element',
-                                               'user-button main-header-button 
icon-32px' ),
-                                       'id' => 'secondary-button',
-                               ) ) .
-                               Html::element(
-                                       'span',
-                                       array( 'class' => $isZero ? 'zero' : '' 
),
-                                       $countLabel
-                               ) .
-                               Html::closeElement( 'a' )
+                               $this->createSecondaryButton( 
$notificationsMsg, $url, $countLabel, $spanClass )
                        );
                }
        }
diff --git a/includes/skins/SkinMinervaAlpha.php 
b/includes/skins/SkinMinervaAlpha.php
index d1b2456..135319b 100644
--- a/includes/skins/SkinMinervaAlpha.php
+++ b/includes/skins/SkinMinervaAlpha.php
@@ -30,6 +30,29 @@
        }
 
        /**
+        * Creates element relating to secondary button
+        * @param string $title Title attribute value of secondary button
+        * @param string $url of secondary button
+        * @param string $spanLabel text of span associated with secondary 
button.
+        * @param string $spanClass the class of the secondary button
+        * @return string html relating to button
+        */
+       protected function createSecondaryButton( $title, $url, $spanLabel, 
$spanClass ) {
+               return Html::element( 'a', array(
+                               'title' => $title,
+                               'href' => $url,
+                               'class' => MobileUI::iconClass( 
'notifications', 'element',
+                                       'user-button main-header-button 
icon-32px' ),
+                               'id' => 'secondary-button',
+                       ) ) .
+                       Html::element(
+                               'span',
+                               array( 'class' => $spanClass ),
+                               $spanLabel
+                       );
+       }
+
+       /**
         * initialize various variables and generate the template
         * @return QuickTemplate
         */
diff --git a/less/images/icons/bell.png b/less/images/icons/bell.png
index 5e36546..f630986 100644
--- a/less/images/icons/bell.png
+++ b/less/images/icons/bell.png
Binary files differ
diff --git a/less/images/icons/bell.svg b/less/images/icons/bell.svg
index e04ac8e..819f13f 100644
--- a/less/images/icons/bell.svg
+++ b/less/images/icons/bell.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <svg xmlns="http://www.w3.org/2000/svg"; width="48" height="48" 
viewBox="-282.375 419.5 48 48" enable-background="new -282.375 419.5 48 48">
-    <path fill="#555" d="M-252.692 457.249h7.582c.697 0 1.395-.463 
1.625-1.084.309-.618.154-1.392-.388-1.935-2.476-2.552-3.016-6.345-3.48-9.979-.774-5.416-1.625-11.528-9.362-12.303v-1.006c0-1.005-.772-1.779-1.778-1.779-1.007
 0-1.78.774-1.78 1.779v1.006c-7.66.775-8.511 6.887-9.285 12.303-.541 
3.635-1.005 7.428-3.481 9.979-.464.543-.619 1.239-.386 1.935.309.621.928 1.084 
1.624 1.084h7.427m5.88 2.167c-1.239 0-2.168-.929-2.245-2.167h4.487c-.076 
1.16-1.084 2.167-2.242 2.167zm0-5.727h-9.827c1.47-2.862 1.935-6.035 
2.322-8.976.851-6.266 1.547-9.284 7.505-9.284 6.035 0 6.729 3.018 7.582 
9.284.385 2.94.851 6.113 2.32 8.976h-9.902z"/>
+    <path d="M-249.122 464.146h11.915c1.095 0 2.192-.728 
2.554-1.703.486-.971.242-2.187-.61-3.041-3.891-4.01-4.739-9.971-5.469-15.682-1.216-8.511-2.554-18.116-14.712-19.334v-1.581c0-1.579-1.213-2.796-2.794-2.796-1.582
 0-2.797 1.216-2.797 2.796v1.581c-12.037 1.218-13.375 10.823-14.591 19.334-.85 
5.712-1.579 11.673-5.47 15.682-.729.853-.973 1.947-.607 3.041.486.976 1.458 
1.703 2.552 1.703h11.671m9.24 3.405c-1.947 0-3.407-1.46-3.528-3.405h7.051c-.119 
1.823-1.703 3.405-3.523 3.405zm0-9h-15.443c2.31-4.497 3.041-9.484 3.649-14.105 
1.337-9.847 2.431-14.589 11.794-14.589 9.484 0 10.574 4.743 11.915 14.589.605 
4.62 1.337 9.606 3.646 14.105h-15.561z" id="path4" fill="#555"/>
 </svg>
diff --git a/less/images/icons/editSourceNormal.png 
b/less/images/icons/editSourceNormal.png
new file mode 100644
index 0000000..c9ce1d9
--- /dev/null
+++ b/less/images/icons/editSourceNormal.png
Binary files differ
diff --git a/less/images/icons/editToggle.png b/less/images/icons/editToggle.png
new file mode 100644
index 0000000..60810a6
--- /dev/null
+++ b/less/images/icons/editToggle.png
Binary files differ
diff --git a/less/images/icons/editVeNormal.png 
b/less/images/icons/editVeNormal.png
new file mode 100644
index 0000000..56282f6
--- /dev/null
+++ b/less/images/icons/editVeNormal.png
Binary files differ
diff --git a/less/ui.less b/less/ui.less
index a308c08..3778b09 100644
--- a/less/ui.less
+++ b/less/ui.less
@@ -233,34 +233,34 @@
                &.loading span {
                        display: none;
                }
+       }
+}
 
-               span {
-                       text-indent: 0;
-                       display: inline-block;
-                       font-weight: bold;
-                       color: #fff;
-                       background: #c91f2c;
-                       border-radius: 2px;
-                       height: 1.2em;
-                       line-height: 1.2em;
-                       min-width: 1em;
-                       margin: .6em .6em 0 0;
-                       padding: 0 0.1em;
-                       text-align: center;
+.notification-count {
+       text-indent: 0;
+       display: inline-block;
+       font-weight: bold;
+       color: #fff;
+       background: #c91f2c;
+       border-radius: 2px;
+       height: 1.2em;
+       line-height: 1.2em;
+       min-width: 1em;
+       margin: .6em .6em 0 0;
+       padding: 0 0.1em;
+       text-align: center;
 
-                       &.zero {
-                               display: none;
-                       }
+       &.zero {
+               display: none;
+       }
 
-                       // FIXME: There must be a better way of doing this
-                       &.max {
-                               right: .2em;
-                               width: 2em;
-                               height: 2em;
-                               line-height: 2em;
-                               font-size: 0.7em;
-                       }
-               }
+       // FIXME: There must be a better way of doing this
+       &.max {
+               right: .2em;
+               width: 2em;
+               height: 2em;
+               line-height: 2em;
+               font-size: 0.7em;
        }
 }
 
@@ -277,3 +277,11 @@
                width: auto;
        }
 }
+
+.alpha {
+       .notification-count {
+               position: absolute;
+               right: .3em;
+               top: 0;
+       }
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/171463
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7b4cf7ace757f89eb0b339d9e58eb896e514955e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: Awjrichards <[email protected]>
Gerrit-Reviewer: Bmansurov <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to