Skip to content

Instantly share code, notes, and snippets.

@jdlrobson
Last active December 15, 2015 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdlrobson/5281620 to your computer and use it in GitHub Desktop.
Save jdlrobson/5281620 to your computer and use it in GitHub Desktop.
diff --git a/includes/MobileContext.php b/includes/MobileContext.php
index de0c1d7..2b9fb1e 100644
--- a/includes/MobileContext.php
+++ b/includes/MobileContext.php
@@ -32,7 +32,6 @@ class MobileContext extends ContextSource {
protected $mobileAction;
private $forceMobileView = false;
- private $forceLeftMenu = false;
private $contentTransformations = true;
private $mobileView = null;
@@ -134,17 +133,6 @@ class MobileContext extends ContextSource {
}
/**
- * @return bool: Whether skin should render the left menu
- */
- public function getForceLeftMenu() {
- return $this->forceLeftMenu;
- }
-
- public function setForceLeftMenu( $value ) {
- $this->forceLeftMenu = $value;
- }
-
- /**
* @param $value bool: Whether mobile view should always be enforced
*/
public function setForceMobileView( $value ) {
diff --git a/includes/skins/SkinMobile.php b/includes/skins/SkinMobile.php
index 9a0c6d1..f643d34 100644
--- a/includes/skins/SkinMobile.php
+++ b/includes/skins/SkinMobile.php
@@ -27,18 +27,29 @@ class SkinMobile extends SkinMobileBase {
$tpl->set( 'action', $context->getRequest()->getText( 'action' ) );
$tpl->set( 'isAlphaGroupMember', $inAlpha );
$tpl->set( 'isBetaGroupMember', $inBeta );
- $tpl->set( 'renderLeftMenu', $context->getForceLeftMenu() );
+
+ // add head items
+ if ( $wgAppleTouchIcon !== false ) {
+ $out->addHeadItem( 'touchicon',
+ Html::element( 'link', array( 'rel' => 'apple-touch-icon', 'href' => $wgAppleTouchIcon ) )
+ );
+ }
+ $out->addHeadItem( 'canonical',
+ Html::element( 'link', array( 'href' => $title->getCanonicalURL() ) )
+ );
+ $out->addHeadItem( 'viewport',
+ Html::element( 'meta', array( 'name' => 'viewport', 'content' => 'initial-scale=1.0, user-scalable=yes' ) )
+ );
+ $out->addHeadItem( 'loadingscript', Html::inlineScript(
+ "document.documentElement.className += ' page-loading';"
+ ) );
+
$tpl->set( 'pagetitle', $out->getHTMLTitle() );
$this->prepareTemplatePageContent( $tpl );
$this->prepareTemplateLinks( $tpl );
$tpl->set( 'isMainPage', $title->isMainPage() );
- if ( $title->isMainPage() || $specialPage ) {
- $this->addArticleClass( 'mw-mf-special' );
- }
- $tpl->set( 'articleClass', $this->getArticleClassString() );
- $tpl->set( 'robots', $this->getRobotsPolicy() );
$tpl->set( 'languageCount', count( $this->getLanguageUrls() ) + 1 );
wfProfileIn( __METHOD__ . '-modules' );
@@ -46,8 +57,6 @@ class SkinMobile extends SkinMobileBase {
wfProfileOut( __METHOD__ . '-modules' );
- $tpl->setRef( 'wgAppleTouchIcon', $wgAppleTouchIcon );
-
// setup destinations for styles/scripts at top and at bottom
$tpl = $this->attachResources( $title, $tpl, $device );
@@ -126,7 +135,6 @@ class SkinMobile extends SkinMobileBase {
getLocalUrl( array( 'returnto' => $returnToTitle ) );
// set urls
- $tpl->set( 'canonicalUrl', $title->getCanonicalURL() );
$tpl->set( 'donateImageUrl', $donateUrl );
$tpl->set( 'historyLink', $historyLink );
$tpl->set( 'nearbyURL', $nearbyUrl );
@@ -273,18 +281,10 @@ class SkinMobile extends SkinMobileBase {
} else {
$bottomScripts = '';
}
+ $bottomScripts .= Html::inlineScript(
+ "document.documentElement.className = document.documentElement.className.replace( 'page-loading', '' );"
+ );
- $headHtml = $out->getHeadLinks( null, true );
- $headHtml .= $out->buildCssLinks();
- $headHtml .= $out->getHeadScripts();
- /*
- FIXME: I'm not too keen on adding getHeadItems here
- it allows anything to add javascript/css without checking
- if it works on mobile. For instance CentralNotice extension adds a remote geolookupip script
- */
- $headHtml .= $out->getHeadItems();
-
- $tpl->set( 'preamble', $headHtml );
$tpl->set( 'bottomScripts', $bottomScripts );
return $tpl;
}
@@ -538,18 +538,6 @@ HTML;
return $languageVariantUrls;
}
- /**
- * Extracts <meta name="robots"> from head items that we don't need
- * @return string
- */
- private function getRobotsPolicy() {
- wfProfileIn( __METHOD__ );
- $links = $this->getOutput()->getHeadLinksArray();
- $robots = $links['meta-robots'];
- wfProfileOut( __METHOD__ );
- return $robots;
- }
-
private function getLogInOutLink() {
global $wgMFForceSecureLogin;
wfProfileIn( __METHOD__ );
diff --git a/includes/skins/SkinMobileBase.php b/includes/skins/SkinMobileBase.php
index 75ad4b7..e59219b 100644
--- a/includes/skins/SkinMobileBase.php
+++ b/includes/skins/SkinMobileBase.php
@@ -10,8 +10,8 @@ abstract class SkinMobileBase extends SkinTemplate {
/** @var string html representing the header of the skin */
private $mobileHtmlHeader = null;
- /** @var array of classes that should be present on the content_wrapper */
- private $articleClassNames = array();
+ /** @var array of classes that should be present on the body tag */
+ private $pageClassNames = array();
/**
* Provides alternative html for the header
@@ -30,17 +30,36 @@ abstract class SkinMobileBase extends SkinTemplate {
}
/**
+ * This will be called by OutputPage::headElement when it is creating the
+ * "<body>" tag, - adds output property bodyClassName to the existing classes
+ * @param $out OutputPage
+ * @param $bodyAttrs Array
+ */
+ public function addToBodyAttributes( $out, &$bodyAttrs ) {
+ // does nothing by default
+ $classes = $out->getProperty( 'bodyClassName' );
+ $bodyAttrs[ 'class' ] .= ' ' . $classes;
+ }
+
+ /**
* @param string $className: valid class name
*/
- public function addArticleClass( $className ) {
- $this->articleClassNames[ $className ] = true;
+ private function addPageClass( $className ) {
+ $this->pageClassNames[ $className ] = true;
}
/**
- * @return string representing the class attribute of element
+ * Takes a title and returns classes to apply to the body tag
+ * @param $title Title
+ * @return String
*/
- public function getArticleClassString() {
- return implode( ' ', array_keys( $this->articleClassNames ) );
+ public function getPageClasses( $title ) {
+ if ( $title->isMainPage() || $title->isSpecialPage() ) {
+ $className = 'mw-mf-special ';
+ } else {
+ $className = '';
+ }
+ return $className . implode( ' ', array_keys( $this->pageClassNames ) );
}
public static function factory( ExtMobileFrontend $extMobileFrontend ) {
@@ -55,6 +74,15 @@ abstract class SkinMobileBase extends SkinTemplate {
public function __construct( ExtMobileFrontend $extMobileFrontend ) {
$this->setContext( $extMobileFrontend );
$this->extMobileFrontend = $extMobileFrontend;
+ $ctx = MobileContext::singleton();
+ $this->addPageClass( 'mobile' );
+ if ( $ctx->isAlphaGroupMember() ) {
+ $this->addPageClass( 'alpha' );
+ } else if ( $ctx->isBetaGroupMember() ) {
+ $this->addPageClass( 'beta' );
+ } else {
+ $this->addPageClass( 'stable' );
+ }
}
public function outputPage( OutputPage $out = null ) {
@@ -75,6 +103,7 @@ abstract class SkinMobileBase extends SkinTemplate {
if ( $html !== false ) {
wfProfileIn( __METHOD__ . '-tpl' );
$tpl = $this->prepareTemplate();
+ $tpl->set( 'headelement', $out->headElement( $this ) );
$tpl->set( 'bodytext', $html );
$tpl->set( 'zeroRatedBanner', $this->extMobileFrontend->getZeroRatedBanner() );
$notice = '';
@@ -95,8 +124,6 @@ abstract class SkinMobileBase extends SkinTemplate {
$tpl = $this->setupTemplate( $this->template );
$tpl->setRef( 'skin', $this );
- $tpl->set( 'code', $lang->getHtmlCode() );
- $tpl->set( 'dir', $lang->getDir() );
$tpl->set( 'scriptUrl', wfScript() );
$url = MobileContext::singleton()->getDesktopUrl( wfExpandUrl(
diff --git a/includes/skins/SkinMobileTemplate.php b/includes/skins/SkinMobileTemplate.php
index 81e0960..909d624 100644
--- a/includes/skins/SkinMobileTemplate.php
+++ b/includes/skins/SkinMobileTemplate.php
@@ -10,7 +10,7 @@ class SkinMobileTemplate extends BaseTemplate {
<div id="siteNotice"></div>
<?php } ?>
<?php $this->renderArticleHeader() ?>
- <div class='show <?php $this->html( 'articleClass' ); ?>' id='content_wrapper'>
+ <div class='show' id='content_wrapper'>
<div id="content" class="content">
<?php $this->html( 'prebodytext' ) ?>
<?php $this->html( 'bodytext' ) ?>
@@ -38,45 +38,10 @@ class SkinMobileTemplate extends BaseTemplate {
public function execute() {
$this->prepareData();
- if ( $this->data['isAlphaGroupMember'] ) {
- $this->set( 'bodyClasses', 'mobile alpha' );
- } else {
- $this->data['isBetaGroupMember'] ? $this->set( 'bodyClasses', 'mobile beta' ) :
- $this->set( 'bodyClasses', 'mobile live' );
- }
-
- $htmlClass = '';
- if ( $this->data[ 'isSpecialPage' ] ) {
- $htmlClass .= ' specialPage';
- }
- if ( $this->data['renderLeftMenu'] ) {
- $htmlClass .= ' navigationEnabled navigationFullScreen';
- }
- if ( $this->data['action'] == 'edit' ) {
- $htmlClass .= ' actionEdit';
- }
- $this->set( 'htmlClasses', trim( $htmlClass ) );
-
- ?><!doctype html>
- <html lang="<?php $this->text('code') ?>" dir="<?php $this->html( 'dir' ) ?>" class="<?php $this->text( 'htmlClasses' ) ?>">
- <head>
- <title><?php $this->text( 'pagetitle' ) ?></title>
- <meta http-equiv="content-type" content="text/html; charset=utf-8" />
- <?php $this->html( 'robots' ) ?>
- <meta name="viewport" content="initial-scale=1.0, user-scalable=yes">
- <?php $this->html( 'touchIcon' ) ?>
- <?php if ( $this->data['supports_jquery'] ) { ?>
- <script type="text/javascript">
- document.documentElement.className += ' client-js page-loading';
- </script>
- <?php } ?>
- <?php $this->html( 'preamble' ) ?>
- <link rel="canonical" href="<?php $this->html( 'canonicalUrl' ) ?>" >
- </head>
- <body class="<?php $this->text( 'bodyClasses' ) ?>">
- <?php $this->renderArticleSkin(); ?>
- <?php $this->html( 'bcHack' ) ?>
- <?php $this->html( 'bottomScripts' ) ?>
+ $this->html( 'headelement' );
+ $this->renderArticleSkin();
+ $this->html( 'bcHack' );
+ $this->html( 'bottomScripts' ) ?>
</body>
</html><?php
}
@@ -150,13 +115,6 @@ class SkinMobileTemplate extends BaseTemplate {
wfProfileIn( __METHOD__ );
$this->setRef( 'wgExtensionAssetsPath', $wgExtensionAssetsPath );
- if ( $this->data['wgAppleTouchIcon'] !== false ) {
- $link = Html::element( 'link', array( 'rel' => 'apple-touch-icon', 'href' => $this->data['wgAppleTouchIcon'] ) );
- } else {
- $link = '';
- }
- $this->set( 'touchIcon', $link );
-
$this->set( 'wgMobileFrontendLogo', $wgMobileFrontendLogo );
wfProfileOut( __METHOD__ );
diff --git a/includes/specials/SpecialMobileMenu.php b/includes/specials/SpecialMobileMenu.php
index 54324a3..1fe585e 100644
--- a/includes/specials/SpecialMobileMenu.php
+++ b/includes/specials/SpecialMobileMenu.php
@@ -7,12 +7,8 @@ class SpecialMobileMenu extends UnlistedSpecialPage {
public function execute( $par = '' ) {
$this->setHeaders();
- $this->getOutput()->setPageTitle( wfMessage( 'mobile-frontend-main-menu-page-title' )->text() );
- $context = MobileContext::singleton();
- // add navigationEnabled class
- $context->setForceLeftMenu( true );
-
- $context->setForceMobileView( true );
- $context->setContentTransformations( false );
+ $out = $this->getOutput();
+ $out->setPageTitle( wfMessage( 'mobile-frontend-main-menu-page-title' )->text() );
+ $out->setProperty( 'bodyClassName', 'navigation-enabled navigation-full-screen' );
}
}
diff --git a/includes/specials/SpecialMobileWatchlist.php b/includes/specials/SpecialMobileWatchlist.php
index e3288e2..dd9b7ec 100644
--- a/includes/specials/SpecialMobileWatchlist.php
+++ b/includes/specials/SpecialMobileWatchlist.php
@@ -18,9 +18,8 @@ class SpecialMobileWatchlist extends SpecialWatchlist {
$ctx = MobileContext::singleton();
$this->usePageImages = !$ctx->imagesDisabled() && defined( 'PAGE_IMAGES_INSTALLED' );
- // assumes mobile skin
- $mobileSkin = $ctx->getSkin();
- $mobileSkin->setHtmlHeader( $this->getWatchlistHeader() );
+ $skin = $ctx->getSkin();
+ $skin->setHtmlHeader( $this->getWatchlistHeader() ); // FIXME: assumes mobile skin = bad
$user = $this->getUser();
$output = $this->getOutput();
@@ -37,7 +36,7 @@ class SpecialMobileWatchlist extends SpecialWatchlist {
wfProfileOut( __METHOD__ );
return;
} else {
- $mobileSkin->addArticleClass( 'noMargins' );
+ $output->setProperty( 'bodyClassName', 'no-margins' );
}
if ( $recentChangesView ) {
diff --git a/includes/specials/UnlistedSpecialMobilePage.php b/includes/specials/UnlistedSpecialMobilePage.php
index 575d7e8..644385e 100644
--- a/includes/specials/UnlistedSpecialMobilePage.php
+++ b/includes/specials/UnlistedSpecialMobilePage.php
@@ -8,10 +8,6 @@ class UnlistedSpecialMobilePage extends UnlistedSpecialPage {
public function clearPageMargins() {
$ctx = MobileContext::singleton();
- // assumes mobile skin
- $mobileSkin = $ctx->getSkin();
- if ( $ctx->shouldDisplayMobileView() ) {
- $mobileSkin->addArticleClass( 'noMargins' );
- } // FIXME: do redirect ? Make page work on desktop?
+ $this->getOutput()->setProperty( 'bodyClassName', 'no-margins' );
}
}
diff --git a/javascripts/common/mf-application.js b/javascripts/common/mf-application.js
index 8b4d00f..5f8c462 100644
--- a/javascripts/common/mf-application.js
+++ b/javascripts/common/mf-application.js
@@ -108,7 +108,6 @@
emit( 'homepage-loaded' );
}
- $doc.removeClass( 'page-loading' );
if( supportsPositionFixed() ) {
$doc.addClass( 'supportsPositionFixed' );
}
diff --git a/javascripts/common/mf-navigation.js b/javascripts/common/mf-navigation.js
index c7e076c..6a0efdb 100644
--- a/javascripts/common/mf-navigation.js
+++ b/javascripts/common/mf-navigation.js
@@ -2,6 +2,7 @@
var m = ( function( $ ) {
var View = M.require( 'view' ),
+ menu,
u = M.utils, mfePrefix = M.prefix,
inBeta = mw.config.get( 'wgMFMode' ) === 'beta',
Overlay,
@@ -81,8 +82,8 @@ var m = ( function( $ ) {
}
this.$el.appendTo( 'body' );
this.scrollTop = document.body.scrollTop;
- $( 'html' ).addClass( 'overlay' ).
- removeClass( 'navigationEnabled' );
+ $( 'html' ).addClass( 'overlay' );
+ $( 'body' ).removeClass( 'navigation-enabled' );
// skip the URL bar if possible
window.scrollTo( 0, 1 );
@@ -132,17 +133,20 @@ var m = ( function( $ ) {
}
function openNavigation() {
- $( 'html' ).addClass( 'navigationEnabled' );
+ $( 'body' ).addClass( 'navigation-enabled' );
}
function closeNavigation() {
M.history.pushState( '#' );
- $( 'html' ).removeClass( 'navigationEnabled' );
+ $( 'body' ).removeClass( 'navigation-enabled' );
+ }
+
+ function isOpen() {
+ return $( 'body' ).hasClass( 'navigation-enabled' );
}
function toggleNavigation() {
- var $html = $( 'html' );
- if( !$html.hasClass( 'navigationEnabled' ) ) {
+ if( !isOpen() ) {
openNavigation();
} else {
closeNavigation();
@@ -157,7 +161,7 @@ var m = ( function( $ ) {
// close navigation if content tapped
$( '#mw-mf-page-center' ).on( 'touchend', function() {
- if ( $( 'html' ).hasClass( 'navigationEnabled' ) ) {
+ if ( isOpen() ) {
closeNavigation();
}
} );
@@ -172,17 +176,22 @@ var m = ( function( $ ) {
u( search ).bind( 'focus', function() {
if ( !inBeta || $( window ).width() < 700 ) {
- u( document.documentElement ).removeClass( 'navigationEnabled' );
+ closeNavigation();
}
} );
+ return {
+ close: closeNavigation,
+ open: openNavigation
+ };
}
- init();
+ menu = init();
return {
CtaDrawer: CtaDrawer,
Overlay: Overlay,
- getPageMenu: getPageMenu
+ getPageMenu: getPageMenu,
+ getMenu: menu
};
}( jQuery ));
diff --git a/javascripts/modules/mf-random.js b/javascripts/modules/mf-random.js
index 9ecab3a..e2c68a2 100644
--- a/javascripts/modules/mf-random.js
+++ b/javascripts/modules/mf-random.js
@@ -1,6 +1,7 @@
( function( M, $ ) {
var m = ( function() {
var randomPageReq,
+ nav = M.require( 'navigation' ),
isSpecialPage = mw.config.get( 'wgNamespaceNumber' ) === mw.config.get( 'wgNamespaceIds' ).special;
function makeHeader( articles ) {
@@ -54,7 +55,7 @@ var m = ( function() {
// prevent the random button closing the navigation menu and make it work via ajax
$( '#randomButton' ).unbind( 'click' ).click( function( ev ) {
if ( $( window ).width() < 700 ) {
- $( 'html' ).removeClass( 'navigationEnabled' );
+ nav.getMenu().close();
}
ev.preventDefault();
getRandomArticle();
diff --git a/less/actions/mf-edit.less b/less/actions/mf-edit.less
index 784d242..193cc89 100644
--- a/less/actions/mf-edit.less
+++ b/less/actions/mf-edit.less
@@ -1,6 +1,6 @@
@import "../mf-mixins.less";
-.client-js.page-loading.actionEdit {
+.client-js.page-loading .action-edit {
#content_wrapper {
.ajaxLoader();
diff --git a/less/common/mainmenu.less b/less/common/mainmenu.less
index 3b7a918..7b8f026 100644
--- a/less/common/mainmenu.less
+++ b/less/common/mainmenu.less
@@ -81,8 +81,8 @@
}
@media all and (min-width: 700px) {
- .navigationEnabled .alpha,
- .navigationEnabled .beta {
+ body.navigation-enabled.alpha,
+ body.navigation-enabled.beta {
#mw-mf-page-left {
width: 20%;
display: block;
diff --git a/less/common/mf-navigation.less b/less/common/mf-navigation.less
index e234766..0aa6203 100644
--- a/less/common/mf-navigation.less
+++ b/less/common/mf-navigation.less
@@ -34,7 +34,7 @@
min-height: 100%;
}
-.navigationEnabled {
+body.navigation-enabled {
#mw-mf-page-left {
width: 80%;
@@ -49,11 +49,6 @@
}
}
-body.navigationEnabled {
- height: 100%;
- overflow: hidden;
-}
-
html.overlay {
.mw-mf-overlay {
display: block;
@@ -235,8 +230,8 @@ html[dir="rtl"] {
}
}
-html.navigationEnabled {
- body,
+body.navigation-enabled {
+ &,
#mw-mf-viewport,
#mw-mf-page-center {
overflow: hidden;
@@ -265,8 +260,12 @@ body {
}
}
-.supportsPositionFixed.navigationEnabled #mw-mf-viewport {
- overflow-y: auto;
+.supportsPositionFixed {
+ body.navigation-enabled {
+ #mw-mf-viewport {
+ overflow-y: auto;
+ }
+ }
}
/* Page actions */
diff --git a/less/common/mf-typography.less b/less/common/mf-typography.less
index 2620ba2..8b82ff9 100644
--- a/less/common/mf-typography.less
+++ b/less/common/mf-typography.less
@@ -82,8 +82,8 @@ sup {
margin: @headingMarginTop @contentMarginRight 0 @contentMarginLeft;
}
-.noMargins {
- > .content {
+body.no-margins {
+ #content_wrapper > .content {
margin: 0;
}
}
diff --git a/less/specials/mobilemenu.less b/less/specials/mobilemenu.less
index 6ae8ba8..ed6530b 100644
--- a/less/specials/mobilemenu.less
+++ b/less/specials/mobilemenu.less
@@ -1,4 +1,4 @@
-.navigationFullScreen {
+body.navigation-full-screen {
#mw-mf-page-left {
// !important needed to override rules set by @media min-width: 700px
width: 100% !important;
diff --git a/less/specials/userlogin.less b/less/specials/userlogin.less
index 65c7ffe..bb96eab 100644
--- a/less/specials/userlogin.less
+++ b/less/specials/userlogin.less
@@ -1,16 +1,15 @@
@import "../mf-variables.less";
@import "../mf-mixins.less";
-.specialPage.overlay {
+.overlay {
- body {
+ body.mw-mf-special {
background-color: @overlayContentBackground;
- }
-
- .mw-mf-overlay {
- .header {
- h1 {
- padding-left: @overlayHeadingIndent;
+ .mw-mf-overlay {
+ .header {
+ h1 {
+ padding-left: @overlayHeadingIndent;
+ }
}
}
}
diff --git a/stylesheets/actions/mf-edit.css b/stylesheets/actions/mf-edit.css
index 3eb10d6..313593d 100644
--- a/stylesheets/actions/mf-edit.css
+++ b/stylesheets/actions/mf-edit.css
@@ -1,10 +1,10 @@
-.client-js.page-loading.actionEdit #content_wrapper {
+.client-js.page-loading .action-edit #content_wrapper {
background-image: url(../common/images/ajax-loader.gif);
min-height: 48px;
background-repeat: no-repeat;
background-position: center center;
}
-.client-js.page-loading.actionEdit #content_wrapper #content {
+.client-js.page-loading .action-edit #content_wrapper #content {
display: none;
}
#mw-anon-edit-warning {
diff --git a/stylesheets/common/mf-navigation.css b/stylesheets/common/mf-navigation.css
index d2f52b0..8d97fd2 100644
--- a/stylesheets/common/mf-navigation.css
+++ b/stylesheets/common/mf-navigation.css
@@ -18,20 +18,16 @@
z-index: 3;
min-height: 100%;
}
-.navigationEnabled #mw-mf-page-left {
+body.navigation-enabled #mw-mf-page-left {
width: 80%;
right: 20%;
display: block;
}
-.navigationEnabled .position-fixed,
-.navigationEnabled #mw-mf-page-center {
+body.navigation-enabled .position-fixed,
+body.navigation-enabled #mw-mf-page-center {
left: 80% !important;
overflow-x: hidden;
}
-body.navigationEnabled {
- height: 100%;
- overflow: hidden;
-}
html.overlay .mw-mf-overlay {
display: block;
}
@@ -206,9 +202,9 @@ html[dir="rtl"] button.escapeOverlay {
-webkit-transform: rotate(180deg);
transform: rotate(180deg);
}
-html.navigationEnabled body,
-html.navigationEnabled #mw-mf-viewport,
-html.navigationEnabled #mw-mf-page-center {
+body.navigation-enabled,
+body.navigation-enabled #mw-mf-viewport,
+body.navigation-enabled #mw-mf-page-center {
overflow: hidden;
height: 100%;
}
@@ -229,7 +225,7 @@ body {
font-size: 0.8em;
}
}
-.supportsPositionFixed.navigationEnabled #mw-mf-viewport {
+.supportsPositionFixed body.navigation-enabled #mw-mf-viewport {
overflow-y: auto;
}
/* Page actions */
diff --git a/stylesheets/common/mf-typography.css b/stylesheets/common/mf-typography.css
index 40377ba..8c99954 100644
--- a/stylesheets/common/mf-typography.css
+++ b/stylesheets/common/mf-typography.css
@@ -81,7 +81,7 @@ sup {
.content {
margin: 14pt 23px 0 23px;
}
-.noMargins > .content {
+body.no-margins #content_wrapper > .content {
margin: 0;
}
#content_wrapper {
diff --git a/stylesheets/common/ui.css b/stylesheets/common/ui.css
index af23f98..e43c447 100644
--- a/stylesheets/common/ui.css
+++ b/stylesheets/common/ui.css
@@ -195,16 +195,16 @@ input[type=submit].cancel {
background-image: /* @embed */ url(images/menu/loginout.png);
}
@media all and (min-width: 700px) {
- .navigationEnabled .alpha #mw-mf-page-left,
- .navigationEnabled .beta #mw-mf-page-left {
+ body.navigation-enabled.alpha #mw-mf-page-left,
+ body.navigation-enabled.beta #mw-mf-page-left {
width: 20%;
display: block;
right: 80%;
}
- .navigationEnabled .alpha .position-fixed,
- .navigationEnabled .beta .position-fixed,
- .navigationEnabled .alpha #mw-mf-page-center,
- .navigationEnabled .beta #mw-mf-page-center {
+ body.navigation-enabled.alpha .position-fixed,
+ body.navigation-enabled.beta .position-fixed,
+ body.navigation-enabled.alpha #mw-mf-page-center,
+ body.navigation-enabled.beta #mw-mf-page-center {
left: 20% !important;
right: 0 !important;
width: 80%;
diff --git a/stylesheets/devices/blackberry.css b/stylesheets/devices/blackberry.css
index a23b736..90964ed 100644
--- a/stylesheets/devices/blackberry.css
+++ b/stylesheets/devices/blackberry.css
@@ -1,7 +1,3 @@
-body.live input.search {
- margin-top: 0 !important;
-}
-
input.searchSubmit {
padding-top: 0;
padding-bottom: 0;
diff --git a/stylesheets/specials/mobilemenu.css b/stylesheets/specials/mobilemenu.css
index 913060c..f9f91cc 100644
--- a/stylesheets/specials/mobilemenu.css
+++ b/stylesheets/specials/mobilemenu.css
@@ -1,9 +1,9 @@
-.navigationFullScreen #mw-mf-page-left {
+body.navigation-full-screen #mw-mf-page-left {
width: 100% !important;
right: 0 !important;
display: block !important;
}
-.navigationFullScreen #mw-mf-page-center {
+body.navigation-full-screen #mw-mf-page-center {
display: none;
}
#mw-mf-menu-main li.icon-home a {
diff --git a/stylesheets/specials/userlogin.css b/stylesheets/specials/userlogin.css
index f9d6f12..81fa8f2 100644
--- a/stylesheets/specials/userlogin.css
+++ b/stylesheets/specials/userlogin.css
@@ -1,7 +1,7 @@
-.specialPage.overlay body {
+.overlay body.mw-mf-special {
background-color: #ffffff;
}
-.specialPage.overlay .mw-mf-overlay .header h1 {
+.overlay body.mw-mf-special .mw-mf-overlay .header h1 {
padding-left: 0.4em;
}
#mw-mf-login .watermark,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment