[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[branding]: New chrome header with branding

2017-01-17 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/330354 )

Change subject: New chrome header with branding
..


New chrome header with branding

* Replace search input in header with search icon and heading
* Search button without JS will take user to Special:Search as fallback
* Search form is now visible on Special:Search page at mobile resolutions
* Search button with JS will load search overlay
* Remove all basic search styles - these should not be necessary with new design
* Remove no longer needed placeholder messages for beta and app

Logo can be enabled in header+footer like so:
```
$wgMFCustomLogos = [
'copyright' => 
'https://en.m.wikipedia.org/static/images/mobile/wikipedia-wordmark-en.png'
];
```

Temporary breaking change:
* Note this temporarily makes it impossible to search on tablet resolutions.
* It also removes the search placeholder text from the search input in the 
search overlay.
* It breaks the non-JS experience - search input is no longer present (browser 
tests are disabled)

All problems will be fixed in follow ups.

Bug: T152458
Change-Id: I53558f7a69e541eb36ded822e70e4a9602353648
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M includes/skins/MinervaTemplate.php
M includes/skins/SkinMinerva.php
M includes/skins/minerva.mustache
D includes/skins/search_form.mustache
M resources/skins.minerva.base.styles/ui.less
D resources/skins.minerva.icons.images/magnifying-glass-white.svg
A resources/skins.minerva.icons.images/magnifying-glass.svg
M resources/skins.minerva.scripts/search.js
M resources/skins.minerva.special.search.styles/search.less
M resources/skins.minerva.tablet.styles/common.less
M tests/browser/features/no_javascript_site.feature
M tests/browser/features/search.feature
M tests/browser/features/search_loggedin.feature
M tests/browser/features/special.feature
M tests/browser/features/step_definitions/search_steps.rb
M tests/browser/features/support/pages/article_page.rb
19 files changed, 107 insertions(+), 151 deletions(-)

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



diff --git a/extension.json b/extension.json
index 3370ac2..de820c8 100644
--- a/extension.json
+++ b/extension.json
@@ -172,7 +172,7 @@
"mainmenu": 
"resources/skins.minerva.icons.images/hamburger.svg",
"edit": 
"resources/skins.minerva.icons.images/editLocked.svg",
"edit-enabled": 
"resources/skins.minerva.icons.images/edit.svg",
-   "magnifying-glass-white": 
"resources/skins.minerva.icons.images/magnifying-glass-white.svg",
+   "magnifying-glass": 
"resources/skins.minerva.icons.images/magnifying-glass.svg",
"language-switcher": 
"resources/skins.minerva.icons.images/languageSwitcher.svg"
}
},
diff --git a/i18n/en.json b/i18n/en.json
index 662a19d..5864d40 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -257,8 +257,6 @@
"mobile-frontend-photo-upload-user-count": "{{PLURAL:$1|1 
upload|$1 uploads}}",
"mobile-frontend-photo-upload-user-count-over-limit": "500+ uploads",
"mobile-frontend-placeholder": "Search {{SITENAME}}",
-   "mobile-frontend-placeholder-app": "Search {{SITENAME}} (Web App)",
-   "mobile-frontend-placeholder-beta": "Search {{SITENAME}} (Beta)",
"mobile-frontend-privacy-link-text": "Privacy",
"mobile-frontend-random-button": "Random",
"mobile-frontend-redirected-from": "Redirected from \"$1\"",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index dfc8ccc..c48dc27 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -257,8 +257,6 @@
"mobile-frontend-photo-upload-user-count": "Displays the number of 
images the user has uploaded.\n\nWrap the number in a 
 tag to allow the number to be incremented 
automatically. Please ensure the contents of the span always consists of 
numeric characters. e.g. 1000 not 1k\n\nParameters:\n* $1 - number of images",
"mobile-frontend-photo-upload-user-count-over-limit": "Displayed in 
place of mobile-frontend-photo-upload-user-count when user has uploaded more 
than 500 images.",
"mobile-frontend-placeholder": "Phrase used to prompt user to use 
search interface for mobile full screen search\n{{Identical|Search}}",
-   "mobile-frontend-placeholder-app": "Phrase used to prompt the user to 
use the search interface for a mobile full screen search with an identifier 
that it is in a special app mode.",
-   "mobile-frontend-placeholder-beta": "Phrase used to prompt the user to 
use a search interface for a mobile full screen search with identifier that it 
is in beta mode",
"mobile-frontend-privacy-link-text": "Custom version of \"Privacy 
policy\" link text for mobile footer, intended to be as brief as possible t

[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[branding]: New chrome header with branding

2017-01-03 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/330354 )

Change subject: New chrome header with branding
..

New chrome header with branding

* Replace search input in header with search icon and heading
* Search button without JS will take user to Special:Search as fallback
* Search button with JS will load search overlay

A follow up will replace the heading with an image if available.

Bug: T152458
Change-Id: I53558f7a69e541eb36ded822e70e4a9602353648
---
M extension.json
M includes/skins/MinervaTemplate.php
M includes/skins/minerva.mustache
D includes/skins/search_form.mustache
D resources/skins.minerva.base.styles/magnifying-glass.png
D resources/skins.minerva.base.styles/magnifying-glass.svg
M resources/skins.minerva.base.styles/ui.less
D resources/skins.minerva.icons.images/magnifying-glass-white.svg
A resources/skins.minerva.icons.images/magnifying-glass.svg
M resources/skins.minerva.special.search.styles/search.less
10 files changed, 40 insertions(+), 70 deletions(-)


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

diff --git a/extension.json b/extension.json
index 3370ac2..de820c8 100644
--- a/extension.json
+++ b/extension.json
@@ -172,7 +172,7 @@
"mainmenu": 
"resources/skins.minerva.icons.images/hamburger.svg",
"edit": 
"resources/skins.minerva.icons.images/editLocked.svg",
"edit-enabled": 
"resources/skins.minerva.icons.images/edit.svg",
-   "magnifying-glass-white": 
"resources/skins.minerva.icons.images/magnifying-glass-white.svg",
+   "magnifying-glass": 
"resources/skins.minerva.icons.images/magnifying-glass.svg",
"language-switcher": 
"resources/skins.minerva.icons.images/languageSwitcher.svg"
}
},
diff --git a/includes/skins/MinervaTemplate.php 
b/includes/skins/MinervaTemplate.php
index 5739257..8197a6e 100644
--- a/includes/skins/MinervaTemplate.php
+++ b/includes/skins/MinervaTemplate.php
@@ -17,34 +17,6 @@
protected $isMainPage;
 
/**
-* Gets the header content for the top chrome.
-* @param array $data Data used to build the page
-* @return string
-*/
-   protected function getChromeHeaderContentHtml( $data ) {
-   return $this->getSearchForm( $data );
-   }
-
-   /**
-* Generates the HTML required to render the search form.
-*
-* @param array $data The data used to render the page
-* @return string
-*/
-   protected function getSearchForm( $data ) {
-   $args = [
-   'action' => $data['wgScript'],
-   'searchInput' => $this->makeSearchInput( 
$data['searchInputAttributes'] ),
-   'searchButton' => $this->makeSearchButton( 'fulltext', [
-   'class' => MobileUI::buttonClass( 'progressive',
-   'fulltext-search' ),
-   ] )
-   ];
-   $templateParser = new TemplateParser( __DIR__ );
-   return $templateParser->processTemplate( 'search_form', $args );
-   }
-
-   /**
 * Start render the page in template
 */
public function execute() {
@@ -292,23 +264,6 @@
}
 
/**
-* Get HTML for header elements
-* @param array $data Data used to build the header
-* @return string
-*/
-   protected function getHeaderHtml( $data ) {
-   // Note these should be wrapped in divs
-   // see https://phabricator.wikimedia.org/T98498 for details
-   $html = '' . $data['menuButton'] . ''
-   . $this->getChromeHeaderContentHtml( $data );
-   // Do not show the secondary button container if no secondary 
button is available
-   if ( $data['secondaryButton'] ) {
-   $html .= '' . $data['secondaryButton'] . '';
-   }
-   return $html;
-   }
-
-   /**
 * Render the entire page
 * @param array $data Data used to build the page
 * @todo replace with template engines
@@ -320,7 +275,13 @@
$templateData = [
'banners' => $data['banners'],
'headelement' => $data[ 'headelement' ],
-   'headerhtml' => $this->getHeaderHtml( $data ),
+   'menuButton' => $data['menuButton'],
+   'searchButton' => Html::element( 'a', [
+   'href' => SpecialPage::getTitleFor( 'Search' 
)->getLocalURL(),
+   'id' => 'searchInput',
+