Jdlrobson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/59722
Change subject: Don't special case homepage in alpha
......................................................................
Don't special case homepage in alpha
Because it's always been horrible.
Start trying to find other inventive ways using css to fix problem
Disable table module on homepage (as tables are frequently used in
this context)
I've been walkin' these streets so long
Singin' the same old song
I know every crack in these dirty sidewalks of Broadway
Where hustle's the name of the game
And nice guys get washed away
Like the snow and the rain
There's been a load of compromisin'
On the road to my horizon
But I'm gonna be where the lights are shinin' on me
Like a rhinestone cowboy
Riding out on a horse in a star-spangled rodeo
Change-Id: I444b061796b3e3344852327cf26b48e83381f457
---
M MobileFrontend.php
M includes/MobileFrontend.body.php
M includes/skins/SkinMobile.php
M javascripts/modules/mf-tables.js
A less/mainpage/mainpage.less
A stylesheets/mainpage/mainpage.css
6 files changed, 73 insertions(+), 5 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/22/59722/1
diff --git a/MobileFrontend.php b/MobileFrontend.php
index e3a83a3..8c212fc 100644
--- a/MobileFrontend.php
+++ b/MobileFrontend.php
@@ -168,6 +168,35 @@
'class' => 'MFResourceLoaderModule',
);
+// main page
+$wgResourceModules['mobile.mainpage.styles'] = $wgMFMobileResourceBoilerplate
+ array(
+ 'dependencies' => array( 'mobile.startup' ),
+ 'styles' => array(
+ 'stylesheets/mainpage/mainpage.css',
+ ),
+ 'group' => 'other',
+);
+
+$wgResourceModules['mobile.mainpage.dependencies'] = array(
+ 'messages' => array(
+ // mf-homepage.js
+ 'mobile-frontend-empty-homepage-text' => array( 'parse' ),
+ ),
+ 'class' => 'MFResourceLoaderModule',
+ 'group' => 'other',
+);
+
+$wgResourceModules['mobile.mainpage.scripts'] = $wgMFMobileResourceBoilerplate
+ array(
+ 'dependencies' => array(
+ 'mobile.startup',
+ 'mobile.mainpage.dependencies',
+ ),
+ 'scripts' => array(
+ 'javascripts/modules/mf-homepage.js',
+ ),
+ 'group' => 'other',
+);
+
// Filepages
$wgResourceModules['mobile.file.styles'] = $wgMFMobileResourceBoilerplate +
array(
'dependencies' => array( 'mobile.startup' ),
@@ -222,8 +251,6 @@
$wgResourceModules['mobile.stable.dependencies'] = array(
'messages' => array(
- // mf-homepage.js
- 'mobile-frontend-empty-homepage-text' => array( 'parse' ),
// mf-photo.js
'mobile-frontend-photo-license' => array( 'parse' ),
),
@@ -400,7 +427,7 @@
'javascripts/common/mf-view.js',
'javascripts/widgets/progress-bar.js',
'javascripts/common/mf-navigation.js',
- 'javascripts/common/mf-notification.js',
'javascripts/modules/mf-homepage.js',
+ 'javascripts/common/mf-notification.js',
'javascripts/modules/mf-cleanuptemplates.js',
'javascripts/modules/mf-last-modified.js',
'javascripts/modules/mf-watchstar.js',
diff --git a/includes/MobileFrontend.body.php b/includes/MobileFrontend.body.php
index 9c5f58f..78ee268 100644
--- a/includes/MobileFrontend.body.php
+++ b/includes/MobileFrontend.body.php
@@ -168,7 +168,10 @@
}
wfProfileIn( __METHOD__ . '-getText' );
- $formatter->setIsMainPage( $this->getTitle()->isMainPage() );
+ if ( !$context->isAlphaGroupMember() ) {
+ $formatter->setIsMainPage(
$this->getTitle()->isMainPage() );
+ }
+
if ( $context->getContentFormat() == 'HTML'
&& $this->getRequest()->getText( 'search' ) == '' )
{
diff --git a/includes/skins/SkinMobile.php b/includes/skins/SkinMobile.php
index 6423579..fd997a1 100644
--- a/includes/skins/SkinMobile.php
+++ b/includes/skins/SkinMobile.php
@@ -294,6 +294,14 @@
$out->addModuleStyles( 'mobile.styles.page' );
}
+ if ( $title->isMainPage() ) {
+ if ( $context->isAlphaGroupMember() ) {
+ $out->addModuleStyles( 'mobile.mainpage.styles'
);
+ } else {
+ $out->addModules( 'mobile.mainpage.scripts' );
+ }
+ }
+
if ( $action === 'edit' ) {
$out->addModules( 'mobile.action.edit' );
} else if ( $action === 'history' ) {
diff --git a/javascripts/modules/mf-tables.js b/javascripts/modules/mf-tables.js
index a7f4b95..e0fe693 100644
--- a/javascripts/modules/mf-tables.js
+++ b/javascripts/modules/mf-tables.js
@@ -15,7 +15,7 @@
colspan, $tr, maxHeight, $td,
$container = $( '<div class="tableContent">' );
- if ( $t.parents( 'table' ).length === 0 && $tc.length >
0 ) {
+ if ( $t.parents( 'table,.page-Main_Page' ).length === 0
&& $tc.length > 0 ) {
$block = $t.parents( '.content_block' );
if ( $block ) {
$t.addClass( 'expando' ).css( { height:
STEP_SIZE } );
diff --git a/less/mainpage/mainpage.less b/less/mainpage/mainpage.less
new file mode 100644
index 0000000..52333c4
--- /dev/null
+++ b/less/mainpage/mainpage.less
@@ -0,0 +1,19 @@
+body.page-Main_Page {
+
+ table {
+ tr,
+ td {
+ display: block !important;
+ ul {
+ li {
+ display: inline;
+ }
+ }
+ }
+ .section_heading {
+ button {
+ display: none !important;
+ }
+ }
+ }
+}
diff --git a/stylesheets/mainpage/mainpage.css
b/stylesheets/mainpage/mainpage.css
new file mode 100644
index 0000000..da23d0f
--- /dev/null
+++ b/stylesheets/mainpage/mainpage.css
@@ -0,0 +1,11 @@
+body.page-Main_Page table tr,
+body.page-Main_Page table td {
+ display: block !important;
+}
+body.page-Main_Page table tr ul li,
+body.page-Main_Page table td ul li {
+ display: inline;
+}
+body.page-Main_Page table .section_heading button {
+ display: none !important;
+}
--
To view, visit https://gerrit.wikimedia.org/r/59722
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I444b061796b3e3344852327cf26b48e83381f457
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits