Phuedx has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/201484

Change subject: [WIP] [Alpha] Minor Special:MobileMenu improvements
......................................................................

[WIP] [Alpha] Minor Special:MobileMenu improvements

* Use the back icon from the original mocks
* Put the search icon before the "Search Wikipedia" placeholder

Bug: T94458
Change-Id: I17af2887e760ff50a9d4b51c821bbbeb8acf2a19
---
A images/icons/alpha/back-ltr.svg
M includes/Resources.php
M includes/skins/MinervaTemplate.php
M includes/skins/MinervaTemplateAlpha.php
M includes/skins/SkinMinervaAlpha.php
M less/specials/mobilemenu.less
6 files changed, 62 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/84/201484/1

diff --git a/images/icons/alpha/back-ltr.svg b/images/icons/alpha/back-ltr.svg
new file mode 100644
index 0000000..71c1f8a
--- /dev/null
+++ b/images/icons/alpha/back-ltr.svg
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 
6.00 Build 0)  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";>
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; x="0px" y="0px" viewBox="0 0 24 24" 
enable-background="new 0 0 24 24" xml:space="preserve">
+<g>
+       <path fill="#575757" 
d="M6.6,12l10,10l0,0c0.9-0.9,0.9-2.2,0-3.1L9.8,12l6.7-6.8c0.9-0.9,0.9-2.2,0-3.1L6.6,12z"/>
+       <path fill="#575757" 
d="M16.6,23l-11-11L16.5,1L17,1.5c0.6,0.6,0.9,1.3,0.9,2.1c0,0.8-0.3,1.5-0.9,2.1L10.8,12l6.3,6.3
   c0.6,0.6,0.9,1.3,0.9,2.1c0,0.8-0.3,1.5-0.9,2.1L16.6,23z 
M7.6,12l8.8,8.8c0-0.1,0.1-0.3,0.1-0.4c0-0.4-0.2-0.8-0.5-1.1L8.8,12   
L16,4.7c0.3-0.3,0.5-0.7,0.5-1.1c0-0.1,0-0.3-0.1-0.4L7.6,12z"/>
+</g>
+</svg>
\ No newline at end of file
diff --git a/includes/Resources.php b/includes/Resources.php
index 1060e89..c7fda91 100644
--- a/includes/Resources.php
+++ b/includes/Resources.php
@@ -141,6 +141,14 @@
                        'edit-enabled' => 'images/icons/beta/edit.svg',
                ),
        ),
+       'skins.minerva.alpha.images' => $wgMFResourceFileModuleBoilerplate + 
array(
+                       'class' => 'ResourceLoaderImageModule',
+                       'selector' => '.mw-ui-icon-{name}:before',
+                       'images' => array(
+                               // Special:MobileMenu-specific back icon
+                               'back-mobilemenu' => 
'images/icons/alpha/back-ltr.svg',
+                       ),
+               ),
 );
 
 $wgResourceModules = array_merge( $wgResourceModules, array(
diff --git a/includes/skins/MinervaTemplate.php 
b/includes/skins/MinervaTemplate.php
index 4c2ec11..07a8e18 100644
--- a/includes/skins/MinervaTemplate.php
+++ b/includes/skins/MinervaTemplate.php
@@ -37,12 +37,7 @@
         * @return string
         */
        protected function makeSearchForm( $data ) {
-               return Html::openElement( 'form',
-                               array(
-                                       'action' => $data['wgScript'],
-                                       'class' => 'search-box',
-                               )
-                       ) .
+               return Html::openElement( 'form', 
$this->getSearchFormAttributes( $data ) ) .
                        $this->makeSearchInput( $this->getSearchAttributes() ) .
                        $this->makeSearchButton(
                                'fulltext',
@@ -54,6 +49,19 @@
        }
 
        /**
+        * Get the attributes for the search form.
+        *
+        * @param $data
+        * @return array
+        */
+       protected function getSearchFormAttributes( $data ) {
+               return array(
+                       'action' => $data['wgScript'],
+                       'class' => 'search-box',
+               );
+       }
+
+       /**
         * Get elements for personal toolbar
         * @return array
         */
diff --git a/includes/skins/MinervaTemplateAlpha.php 
b/includes/skins/MinervaTemplateAlpha.php
index 41ae807..c5d260e 100644
--- a/includes/skins/MinervaTemplateAlpha.php
+++ b/includes/skins/MinervaTemplateAlpha.php
@@ -91,7 +91,7 @@
 
                if ( $this->isSpecialMobileMenuPage ) {
                        $args += array(
-                               'mobileMenuClass' => 'js-only back ' . 
MobileUI::iconClass( 'back' ),
+                               'mobileMenuClass' => 'js-only back ' . 
MobileUI::iconClass( 'back-mobilemenu' ),
                                'mobileMenuLink' => '#back',
                                'mobileMenuTitle' => wfMessage( 
'mobile-frontend-main-menu-back' )->parse(),
                                'searchForm' => $this->makeSearchForm( $data ),
@@ -171,4 +171,15 @@
                </html>
                <?php
        }
+
+       /**
+        * @inheritdoc
+        */
+       protected function getSearchFormAttributes( $data ) {
+               $searchFormAttributes = parent::getSearchFormAttributes( $data 
);
+
+               $searchFormAttributes['class'] .= ' ' . MobileUI::iconClass( 
'search', 'before' );
+
+               return $searchFormAttributes;
+       }
 }
diff --git a/includes/skins/SkinMinervaAlpha.php 
b/includes/skins/SkinMinervaAlpha.php
index 121a540..72667b3 100644
--- a/includes/skins/SkinMinervaAlpha.php
+++ b/includes/skins/SkinMinervaAlpha.php
@@ -60,4 +60,15 @@
 
                return $vars;
        }
+
+       /**
+        * @inheritdoc
+        */
+       protected function getSkinStyles() {
+               $skinStyles = parent::getSkinStyles();
+
+               $skinStyles[] = 'skins.minerva.alpha.images';
+
+               return $skinStyles;
+       }
 }
diff --git a/less/specials/mobilemenu.less b/less/specials/mobilemenu.less
index 232815e..822c2b1 100644
--- a/less/specials/mobilemenu.less
+++ b/less/specials/mobilemenu.less
@@ -25,3 +25,11 @@
                }
        }
 }
+
+.alpha {
+       .search-box.mw-ui-icon-before {
+               &:before {
+                       margin-right: 0;
+               }
+       }
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I17af2887e760ff50a9d4b51c821bbbeb8acf2a19
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Phuedx <g...@samsmith.io>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to