Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372560 )

Change subject: WIP: Remove special page handling
......................................................................

WIP: Remove special page handling

This is handled by MobileFrontend now, just as it should do.
We rely on skinStyles where possible.

Depends-On: I665f6fe60939475249786fdc951149c38473fda6
Change-Id: I0fe9efcf98bbd8e188d91a29d4cfda897d47808d
---
M includes/skins/SkinMinerva.php
D resources/skins.minerva.special.styles/common.less
D resources/skins.minerva.special.styles/forms.less
D resources/skins.minerva.special.watchlist.scripts/watchlist.js
D resources/skins.minerva.special.watchlist.styles/specialWatchlist.less
M skin.json
A skinStyles/mobile.special.styles/minerva.less
7 files changed, 31 insertions(+), 186 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/60/372560/1

diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index d108b48..4730d42 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -264,8 +264,6 @@
 
                if ( $title->isMainPage() ) {
                        $className .= ' page-Main_Page ';
-               } elseif ( $title->isSpecialPage() ) {
-                       $className .= ' mw-mf-special ';
                }
 
                if ( $this->isAuthenticatedUser() ) {
@@ -1369,12 +1367,6 @@
                } elseif ( $this->getUserPageHelper()->isUserPage() ) {
                        $styles[] = 'skins.minerva.userpage.styles';
                        $styles[] = 'skins.minerva.userpage.icons';
-               } elseif ( $title->isSpecialPage() ) {
-                       $styles[] = 'mobile.messageBox.styles';
-                       $styles['special'] = 'skins.minerva.special.styles';
-               }
-               if ( $this->getOutput()->getRequest()->getText( 'oldid' ) ) {
-                       $styles[] = 'mobile.messageBox.styles';
                }
 
                return $styles;
diff --git a/resources/skins.minerva.special.styles/common.less 
b/resources/skins.minerva.special.styles/common.less
deleted file mode 100644
index 5d2d0c7..0000000
--- a/resources/skins.minerva.special.styles/common.less
+++ /dev/null
@@ -1,63 +0,0 @@
-@import 'minerva.variables';
-@import 'minerva.mixins';
-
-// FIXME: Apply these styles to all special pages
-.mw-mf-special #content {
-       @verticalPadding: 0.5em;
-       #section_0 {
-               padding: @verticalPadding 0;
-               text-align: center;
-               font-size: 1.25em;
-               font-weight: bold;
-               border: 0;
-       }
-
-       .pre-content {
-               padding: 0;
-               border-bottom: 0;
-       }
-}
-
-// used in Special:Nearby and Special:UserLogin
-.errorbox,
-.error {
-       color: @colorErrorText;
-       background: @colorErrorBackground;
-}
-
-.mw-mf-special {
-       h1,
-       h2 {
-               font-family: @fontFamily;
-       }
-
-       .content-header {
-               padding: 0 0 20px;
-               border-bottom: 1px solid @colorGray12;
-
-               h2 {
-                       padding: 0;
-                       font-size: 1.1em;
-                       font-weight: bold;
-                       border-bottom: 0;
-                       text-align: center;
-               }
-       }
-
-       .content {
-               // don't apply these styles to headings in message boxes
-               > h2 {
-                       text-align: center;
-                       margin: 0.7em 0;
-                       font-size: 1.1em;
-                       color: @grayMedium;
-               }
-       }
-
-       .error {
-               h2 {
-                       margin-top: 0;
-                       text-transform: none;
-               }
-       }
-}
diff --git a/resources/skins.minerva.special.styles/forms.less 
b/resources/skins.minerva.special.styles/forms.less
deleted file mode 100644
index 1f3bbf5..0000000
--- a/resources/skins.minerva.special.styles/forms.less
+++ /dev/null
@@ -1,51 +0,0 @@
-@import 'mediawiki.mixins.less';
-@import 'minerva.variables.less';
-@import 'minerva.mixins.less';
-
-form {
-       // FIXME: work out what to do with these
-       #mw-prefs-restoreprefs {
-               display: none;
-       }
-
-       fieldset {
-               font-size: 0.9em;
-
-               .htmlform-tip {
-                       display: none;
-               }
-
-               .mw-label,
-               .mw-ui-checkbox {
-                       font-style: italic;
-                       font-size: 0.9em;
-               }
-
-               legend {
-                       color: @grayMedium;
-                       font-size: 0.8em;
-                       font-weight: bold;
-                       text-transform: uppercase;
-               }
-
-               fieldset {
-                       margin: 0 0 1em 0.3em;
-               }
-       }
-}
-
-// For old style forms
-// Special:MovePage?target=San%20Francisco
-// Special:Import
-// Special:NewPages
-// Special:RecentChanges
-// Special:Prefixindex
-// Special:Contributions
-// Special:ChangePassword
-// Special:ChangeEmail
-// Special:Allpages
-.mw-input [type='submit'],
-.mw-submit {
-       margin-top: 8px;
-       min-width: 80%;
-}
diff --git a/resources/skins.minerva.special.watchlist.scripts/watchlist.js 
b/resources/skins.minerva.special.watchlist.scripts/watchlist.js
deleted file mode 100644
index 0f50f6a..0000000
--- a/resources/skins.minerva.special.watchlist.scripts/watchlist.js
+++ /dev/null
@@ -1,31 +0,0 @@
-( function ( M, $ ) {
-       var WatchList = M.require( 'mobile.watchlist/WatchList' );
-
-       /**
-        * Initialises JavaScript on Special:Watchlist
-        * @method
-        * @ignore
-        */
-       function init() {
-               var $watchlist = $( 'ul.page-list' );
-
-               // FIXME: find more elegant way to not show watchlist stars on 
recent changes
-               if ( $( '.mw-mf-watchlist-selector' ).length === 0 ) {
-                       // eslint-disable-next-line no-new
-                       new WatchList( {
-                               api: new mw.Api(),
-                               el: $watchlist,
-                               funnel: 'watchlist',
-                               enhance: true
-                       } );
-                       $watchlist.find( '.page-summary .info' ).css( 
'visibility', 'visible' );
-               }
-               // not needed now we have JS view which has infinite scrolling
-               $( '.more' ).remove();
-       }
-
-       $( function () {
-               init();
-       } );
-
-}( mw.mobileFrontend, jQuery ) );
diff --git 
a/resources/skins.minerva.special.watchlist.styles/specialWatchlist.less 
b/resources/skins.minerva.special.watchlist.styles/specialWatchlist.less
deleted file mode 100644
index dd5fefe..0000000
--- a/resources/skins.minerva.special.watchlist.styles/specialWatchlist.less
+++ /dev/null
@@ -1,8 +0,0 @@
-@import 'minerva.variables';
-@import 'minerva.mixins';
-
-.client-js {
-       .page-summary .info {
-               visibility: hidden;
-       }
-}
diff --git a/skin.json b/skin.json
index 4e54d71..7c0674e 100644
--- a/skin.json
+++ b/skin.json
@@ -47,6 +47,12 @@
                                "skinStyles/mobile.startup/toast.less",
                                "skinStyles/mobile.startup/Overlay.less"
                        ],
+                       "mediawiki.special": [
+                               "skinStyles/mobile.special.styles/minerva.less"
+                       ],
+                       "mobile.special.styles": [
+                               "skinStyles/mobile.special.styles/minerva.less"
+                       ],
                        "mobile.toggle": [
                                "skinStyles/mobile.toggle/minerva.less"
                        ],
@@ -239,36 +245,11 @@
                                "resources/skins.minerva.mainMenu/MainMenu.js"
                        ]
                },
-               "skins.minerva.special.styles": {
-                       "targets": "mobile",
-                       "position": "top",
-                       "styles": [
-                               
"resources/skins.minerva.special.styles/common.less",
-                               
"resources/skins.minerva.special.styles/forms.less"
-                       ]
-               },
                "skins.minerva.special.search.styles": {
                        "targets": "mobile",
                        "position": "top",
                        "styles": [
                                
"resources/skins.minerva.special.search.styles/search.less"
-                       ]
-               },
-               "skins.minerva.special.watchlist.styles": {
-                       "targets": "mobile",
-                       "position": "top",
-                       "styles": [
-                               
"resources/skins.minerva.special.watchlist.styles/specialWatchlist.less"
-                       ]
-               },
-               "skins.minerva.special.watchlist.scripts": {
-                       "targets": "mobile",
-                       "dependencies": [
-                               "mobile.startup",
-                               "mobile.watchlist"
-                       ],
-                       "scripts": [
-                               
"resources/skins.minerva.special.watchlist.scripts/watchlist.js"
                        ]
                },
                "skins.minerva.special.userlogin.styles": {
diff --git a/skinStyles/mobile.special.styles/minerva.less 
b/skinStyles/mobile.special.styles/minerva.less
new file mode 100644
index 0000000..28a2ba1
--- /dev/null
+++ b/skinStyles/mobile.special.styles/minerva.less
@@ -0,0 +1,25 @@
+@import 'minerva.variables';
+
+.ns-special {
+       #content {
+               @verticalPadding: 0.5em;
+               #section_0 {
+                       padding: @verticalPadding 0;
+                       text-align: center;
+                       font-size: 1.25em;
+                       font-weight: bold;
+                       border: 0;
+               }
+
+               .pre-content {
+                       padding: 0;
+                       border-bottom: 0;
+               }
+       }
+
+       h1,
+       h2 {
+               // Important given we have no idea which rules special pages 
are enforcing
+               font-family: @fontFamily !important;
+       }
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0fe9efcf98bbd8e188d91a29d4cfda897d47808d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/MinervaNeue
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <jrob...@wikimedia.org>

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

Reply via email to