Kaldari has uploaded a new change for review.
https://gerrit.wikimedia.org/r/73555
Change subject: Promoting pageactions (including editing) to stable
......................................................................
Promoting pageactions (including editing) to stable
Also removing unused 'pagetitle' message
Change-Id: I7c1379874b115cf05ebd932b2f713d94062e08ee
---
M includes/Resources.php
M includes/skins/MobileTemplate.php
M includes/skins/MobileTemplateBeta.php
M includes/skins/SkinMinerva.php
M includes/skins/SkinMobileBeta.php
D javascripts/common/application-beta.js
M javascripts/common/mf-application.js
M less/common/user.less
M less/mf-variables.less
M stylesheets/common/drawer.css
M stylesheets/common/ui.css
M stylesheets/common/user.css
12 files changed, 128 insertions(+), 126 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/55/73555/1
diff --git a/includes/Resources.php b/includes/Resources.php
index bb325a7..86c9ba0 100644
--- a/includes/Resources.php
+++ b/includes/Resources.php
@@ -112,13 +112,13 @@
'stylesheets/common/overlays.css',
'stylesheets/common/drawer.css',
'stylesheets/common/mf-hacks.css',
+ 'stylesheets/common/pageactions.css',
),
'position' => 'top',
),
'mobile.styles.beta' => $wgMFMobileResourceBoilerplate + array(
'styles' => array(
- 'stylesheets/common/pageactions.css',
'stylesheets/common/user.css',
),
'position' => 'top',
@@ -166,49 +166,8 @@
'mobile-frontend-photo-nag-learn-more-1' => array(
'parse' ),
'mobile-frontend-photo-nag-learn-more-2' => array(
'parse' ),
'mobile-frontend-photo-nag-learn-more-3' => array(
'parse' ),
- ),
- 'localBasePath' => $localBasePath,
- 'localTemplateBasePath' => $localBasePath . '/templates',
- 'templates' => array(
- 'wikitext/commons-upload',
- // LanguageOverlay.js
- 'overlays/languages',
- // leadphoto.js
- 'leadPhoto',
- 'overlay',
- 'overlays/cleanup',
- 'overlays/learnMore',
- // search-2.js
- 'articleList',
- 'overlays/search/search',
- // PhotoUploader.js
- // For new page action menu
- 'photoUploadAction',
- 'photoUploader',
- // PhotoUploaderPreview.js
- 'photoUploadPreview',
- // NagOverlay.js
- 'photoNag',
- 'ctaDrawer',
- ),
- 'class' => 'MFResourceLoaderModule',
- ),
-
- 'mobile.beta.plumbing' => array(
- 'localBasePath' => $localBasePath,
- 'localTemplateBasePath' => $localBasePath . '/templates',
- 'templates' => array(
- 'overlays/editor',
- 'section',
- // talk.js
- 'overlays/talk',
- 'overlays/talkSectionAdd',
- 'talkSection',
// page.js
- 'page',
- 'languageSection',
- ),
- 'messages' => array(
+ 'mobile-frontend-talk-overlay-header',
// editor.js
'mobile-frontend-editor-disabled',
'mobile-frontend-editor-cta',
@@ -231,8 +190,50 @@
'mobile-frontend-editor-error-preview',
// modules/editor/EditorOverlay.js and modules/talk.js
'mobile-frontend-editor-save',
+ ),
+ 'localBasePath' => $localBasePath,
+ 'localTemplateBasePath' => $localBasePath . '/templates',
+ 'templates' => array(
+ 'overlays/editor',
+ 'section',
+ 'wikitext/commons-upload',
+ // LanguageOverlay.js
+ 'overlays/languages',
+ // leadphoto.js
+ 'leadPhoto',
+ 'overlay',
+ 'overlays/cleanup',
+ 'overlays/learnMore',
+ // search-2.js
+ 'articleList',
+ 'overlays/search/search',
// page.js
- 'mobile-frontend-talk-overlay-header',
+ 'page',
+ // PhotoUploader.js
+ // For new page action menu
+ 'photoUploadAction',
+ 'photoUploader',
+ // PhotoUploaderPreview.js
+ 'photoUploadPreview',
+ // NagOverlay.js
+ 'photoNag',
+ 'ctaDrawer',
+ ),
+ 'class' => 'MFResourceLoaderModule',
+ ),
+
+ 'mobile.beta.plumbing' => array(
+ 'localBasePath' => $localBasePath,
+ 'localTemplateBasePath' => $localBasePath . '/templates',
+ 'templates' => array(
+ // talk.js
+ 'overlays/talk',
+ 'overlays/talkSectionAdd',
+ 'talkSection',
+ 'languageSection',
+ ),
+ 'messages' => array(
+
// history-beta.js
'mobile-frontend-language-article-heading',
),
@@ -245,13 +246,9 @@
'mobile.stable.common',
),
'scripts' => array(
- 'javascripts/common/application-beta.js',
'javascripts/common/history-beta.js',
- 'javascripts/views/page.js',
),
'messages' => array(
- // page.js and talk.js (alpha)
- 'mobile-frontend-talk-overlay-header',
// LanguageOverlay.js
'mobile-frontend-language-header',
'mobile-frontend-language-site-choose',
@@ -265,13 +262,9 @@
'mobile.beta.common',
),
'styles' => array(
- 'stylesheets/modules/editor.css',
'stylesheets/modules/talk.css',
),
'scripts' => array(
- 'javascripts/modules/editor/EditorApi.js',
- 'javascripts/modules/editor/EditorOverlay.js',
- 'javascripts/modules/editor/editor.js',
'javascripts/modules/mf-toggle-dynamic.js',
'javascripts/modules/talk/TalkSectionOverlay.js',
'javascripts/modules/talk.js',
@@ -281,8 +274,6 @@
),
'position' => 'bottom',
'messages' => array(
- 'pagetitle',
-
// for mf-toggle-dynamic.js
'mobile-frontend-show-button',
'mobile-frontend-hide-button',
@@ -379,6 +370,7 @@
'stylesheets/modules/mf-cleanuptemplates.css',
'stylesheets/modules/mf-watchstar.css',
'stylesheets/modules/mf-photo.css',
+ 'stylesheets/modules/editor.css',
),
'position' => 'top',
),
@@ -400,6 +392,7 @@
'javascripts/widgets/progress-bar.js',
'javascripts/common/mf-navigation.js',
'javascripts/common/mf-notification.js',
+ 'javascripts/views/page.js',
// Upload specific code
'javascripts/modules/uploads/LearnMoreOverlay.js',
'javascripts/modules/uploads/PhotoApi.js',
@@ -469,6 +462,10 @@
'mobile.stable.styles',
),
'scripts' => array(
+
+ 'javascripts/modules/editor/EditorApi.js',
+ 'javascripts/modules/editor/EditorOverlay.js',
+ 'javascripts/modules/editor/editor.js',
'javascripts/modules/mf-toggle.js',
'javascripts/modules/mf-cleanuptemplates.js',
'javascripts/modules/languages.js',
diff --git a/includes/skins/MobileTemplate.php
b/includes/skins/MobileTemplate.php
index 5bd9c7c..33a3718 100644
--- a/includes/skins/MobileTemplate.php
+++ b/includes/skins/MobileTemplate.php
@@ -16,6 +16,27 @@
return $this->data['personal_urls'];
}
+ protected function renderContentWrapper( $data ) {
+ $isSpecialPage = $this->getSkin()->getTitle()->isSpecialPage();
+ ?>
+ <div class='show' id='content_wrapper'>
+ <?php
+ if ( !$isSpecialPage ) {
+ echo $data['prebodytext'];
+ $this->renderPageActions( $data );
+ }
+ ?>
+ <div id="content" class="content">
+ <?php
+ echo $data[ 'bodytext' ];
+ $this->renderLanguages( $data );
+ $this->renderHistoryLink( $data );
+ ?>
+ </div>
+ </div>
+ <?php
+ }
+
/**
* Returns an array of footerlinks trimmed down to only those footer
links that
* are valid.
diff --git a/includes/skins/MobileTemplateBeta.php
b/includes/skins/MobileTemplateBeta.php
index 5309a17..5e0923a 100644
--- a/includes/skins/MobileTemplateBeta.php
+++ b/includes/skins/MobileTemplateBeta.php
@@ -12,25 +12,4 @@
</ul>
<?php
}
-
- protected function renderContentWrapper( $data ) {
- $isSpecialPage = $this->getSkin()->getTitle()->isSpecialPage();
- ?>
- <div class='show' id='content_wrapper'>
- <?php
- if ( !$isSpecialPage ) {
- echo $data['prebodytext'];
- $this->renderPageActions( $data );
- }
- ?>
- <div id="content" class="content">
- <?php
- echo $data[ 'bodytext' ];
- $this->renderLanguages( $data );
- $this->renderHistoryLink( $data );
- ?>
- </div>
- </div>
- <?php
- }
}
diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index 8893bb5..d40f27a 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -68,7 +68,8 @@
'id'=> 'mw-mf-main-menu-button',
) )
);
- $tpl->set( 'userButton', '<ul id="mw-mf-menu-page"></ul>' );
+ // Set userButton to nothing for now (will be for notifications
later)
+ $tpl->set( 'userButton', '' );
$banners = array();
if ( $wgMFEnableSiteNotice ) {
@@ -77,7 +78,34 @@
$tpl->set( 'banners', $banners );
// site_urls is used on beta only
$tpl->set( 'site_urls', array() );
- $tpl->set( 'page_actions', array() );
+
+ // Reuse template data variable from SkinTemplate to construct
page menu
+ $menu = array();
+ $actions = $tpl->data['content_navigation']['actions'];
+
+ // empty placeholder for edit and photos which both require js
+ $menu['edit'] = array( 'id' => 'ca-edit', 'text' => '' );
+ $menu['photo'] = array( 'id' => 'ca-upload', 'text' => '' );
+
+ $watchTemplate = array(
+ 'id' => 'ca-watch',
+ 'class' => 'watch-this-article',
+ );
+ // standardise watch article into one menu item
+ if ( isset( $actions['watch'] ) ) {
+ $menu['watch'] = array_merge( $actions['watch'],
$watchTemplate );
+ } else if ( isset( $actions['unwatch'] ) ) {
+ $menu['watch'] = array_merge( $actions['unwatch'],
$watchTemplate );
+ $menu['watch']['class'] .= ' watched';
+ } else {
+ // placeholder for not logged in
+ $menu['watch'] = $watchTemplate;
+ // FIXME: makeLink (used by makeListItem) when no text
is present defaults to use the key
+ $menu['watch']['text'] = '';
+ $menu['watch']['class'] = 'cta';
+ }
+
+ $tpl->set( 'page_actions', $menu );
}
/**
diff --git a/includes/skins/SkinMobileBeta.php
b/includes/skins/SkinMobileBeta.php
index 754abed..a263c5d 100644
--- a/includes/skins/SkinMobileBeta.php
+++ b/includes/skins/SkinMobileBeta.php
@@ -34,47 +34,21 @@
),
) );
- // Reuse template data variable from SkinTemplate to construct
page menu
- $menu = array();
- $actions = $tpl->data['content_navigation']['actions'];
+ // Add talk to page menu
+ $menu = $tpl->get( 'page_actions' ) ?: array();
$namespaces = $tpl->data['content_navigation']['namespaces'];
-
- // empty placeholder for edit photos which both require js
- $menu['edit'] = array( 'id' => 'ca-edit', 'text' => '' );
- $menu['photo'] = array( 'id' => 'ca-upload', 'text' => '' );
-
if ( isset( $namespaces['talk'] ) ) {
$menu['talk'] = $namespaces['talk'];
// FIXME [Core Skin]: I'm not sure why this is treated
differently.
} else if ( isset( $namespaces['project_talk'] ) ) {
$menu['talk'] = $namespaces['project_talk'];
}
-
if ( isset( $menu['talk'] ) ) {
if ( isset( $tpl->data['_talkdata'] ) ) {
$menu['talk']['text'] =
$tpl->data['_talkdata']['text'];
$menu['talk']['class'] =
$tpl->data['_talkdata']['class'];
}
}
-
- $watchTemplate = array(
- 'id' => 'ca-watch',
- 'class' => 'watch-this-article',
- );
- // standardise watch article into one menu item
- if ( isset( $actions['watch'] ) ) {
- $menu['watch'] = array_merge( $actions['watch'],
$watchTemplate );
- } else if ( isset( $actions['unwatch'] ) ) {
- $menu['watch'] = array_merge( $actions['unwatch'],
$watchTemplate );
- $menu['watch']['class'] .= ' watched';
- } else {
- // placeholder for not logged in
- $menu['watch'] = $watchTemplate;
- // FIXME: makeLink (used by makeListItem) when no text
is present defaults to use the key
- $menu['watch']['text'] = '';
- $menu['watch']['class'] = 'cta';
- }
-
$tpl->set( 'page_actions', $menu );
$this->prepareUserButton( $tpl );
diff --git a/javascripts/common/application-beta.js
b/javascripts/common/application-beta.js
deleted file mode 100644
index 7ee9b8b..0000000
--- a/javascripts/common/application-beta.js
+++ /dev/null
@@ -1,17 +0,0 @@
-( function( M, $ ) {
-
- function deParam( qs ) {
- var params = {};
- if ( qs ) {
- qs.split( '&' ).forEach( function( p ) {
- p = p.split( '=' );
- params[ p[0] ] = p[1];
- } );
- }
- return params;
- }
- $.extend( M, {
- deParam: deParam
- } );
-
-}( mw.mobileFrontend, jQuery ) );
diff --git a/javascripts/common/mf-application.js
b/javascripts/common/mf-application.js
index 811111f..538023c 100644
--- a/javascripts/common/mf-application.js
+++ b/javascripts/common/mf-application.js
@@ -250,6 +250,17 @@
return sessionId;
}
+ function deParam( qs ) {
+ var params = {};
+ if ( qs ) {
+ qs.split( '&' ).forEach( function( p ) {
+ p = p.split( '=' );
+ params[ p[0] ] = p[1];
+ } );
+ }
+ return params;
+ }
+
$( init );
$.extend( M, {
@@ -269,7 +280,8 @@
prettyEncodeTitle: prettyEncodeTitle,
template: template,
unlockViewport: unlockViewport,
- router: new Router()
+ router: new Router(),
+ deParam: deParam
} );
}( mw.mobileFrontend, jQuery ) );
diff --git a/less/common/user.less b/less/common/user.less
index a1109bf..e80d6d2 100644
--- a/less/common/user.less
+++ b/less/common/user.less
@@ -23,3 +23,8 @@
}
}
}
+
+// Override right padding on header to make room for user button
+.header {
+ padding-right: 40px;
+}
diff --git a/less/mf-variables.less b/less/mf-variables.less
index 5cbbf0a..a6c2cd3 100644
--- a/less/mf-variables.less
+++ b/less/mf-variables.less
@@ -1,5 +1,5 @@
@searchBarPaddingLeft: 40px;
-@searchBarPaddingRight: 40px;
+@searchBarPaddingRight: 10px;
@searchResultPaddingVertical: 12px;
@searchBoxColor: #fafafa;
@headerHeight: 46px;
diff --git a/stylesheets/common/drawer.css b/stylesheets/common/drawer.css
index d8682d2..2219978 100644
--- a/stylesheets/common/drawer.css
+++ b/stylesheets/common/drawer.css
@@ -20,7 +20,7 @@
}
.drawer a.button {
display: block;
- margin: 1em 40px 1em 40px;
+ margin: 1em 40px 1em 10px;
}
.drawer a.signup {
display: block;
diff --git a/stylesheets/common/ui.css b/stylesheets/common/ui.css
index c6e0f57..060223e 100644
--- a/stylesheets/common/ui.css
+++ b/stylesheets/common/ui.css
@@ -354,7 +354,7 @@
min-height: 46px;
overflow: hidden;
position: relative;
- padding: 0 40px 0 40px;
+ padding: 0 10px 0 40px;
}
.header h1,
.header h2 {
diff --git a/stylesheets/common/user.css b/stylesheets/common/user.css
index c504d1a..36a519d 100644
--- a/stylesheets/common/user.css
+++ b/stylesheets/common/user.css
@@ -29,3 +29,6 @@
#user-button span.zero {
display: none;
}
+.header {
+ padding-right: 40px;
+}
--
To view, visit https://gerrit.wikimedia.org/r/73555
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7c1379874b115cf05ebd932b2f713d94062e08ee
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Kaldari <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits