| Index: trunk/extensions/MobileFrontend2/MobileFrontend2.php |
| — | — | @@ -0,0 +1,66 @@ |
| | 2 | +<?php |
| | 3 | +/** |
| | 4 | +* Extension MobileFrontend2 — Mobile Frontend 2 |
| | 5 | +* |
| | 6 | +* @file |
| | 7 | +* @ingroup Extensions |
| | 8 | +*/ |
| | 9 | + |
| | 10 | +// Needs to be called within MediaWiki; not standalone |
| | 11 | +if ( !defined( 'MEDIAWIKI' ) ) { |
| | 12 | + echo( "This is an extension to the MediaWiki package and cannot be run standalone.\n" ); |
| | 13 | + die( -1 ); |
| | 14 | +} |
| | 15 | + |
| | 16 | +// Extension credits that will show up on Special:Version |
| | 17 | +$wgExtensionCredits['other'][] = array( |
| | 18 | + 'path' => __FILE__, |
| | 19 | + 'name' => 'MobileFrontend2', |
| | 20 | + 'version' => 1, |
| | 21 | + 'author' => 'John Du Hart', |
| | 22 | + 'descriptionmsg' => 'mobile-frontend2-desc', |
| | 23 | + 'url' => 'https://www.mediawiki.org/wiki/Extension:MobileFrontend2', |
| | 24 | +); |
| | 25 | + |
| | 26 | +$dir = dirname( __FILE__ ) . '/'; |
| | 27 | +$wgExtensionMessagesFiles['MobileFrontend2'] = $dir . 'MobileFrontend2.i18n.php'; |
| | 28 | + |
| | 29 | +$wgAutoloadClasses['MobileFrontend2_Detection'] = $dir . 'MobileFrontend2_Detection.php'; |
| | 30 | +$wgAutoloadClasses['MobileFrontend2_Hooks'] = $dir . 'MobileFrontend2_Hooks.php'; |
| | 31 | +$wgAutoloadClasses['MobileFrontend2_PostParse'] = $dir . 'MobileFrontend2_PostParse.php'; |
| | 32 | + |
| | 33 | +// Skins |
| | 34 | +$wgAutoloadClasses['SkinMobile'] = $dir . 'skins/Mobile.php'; |
| | 35 | + |
| | 36 | +// Hooks |
| | 37 | +$wgHooks['RequestContextCreateSkin'][] = 'MobileFrontend2_Hooks::createSkin'; |
| | 38 | +$wgHooks['ParserSectionCreate'][] = 'MobileFrontend2_Hooks::parserSectionCreate'; |
| | 39 | +$wgHooks['ArticleViewHeader'][] = 'MobileFrontend2_Hooks::articleView'; |
| | 40 | +$wgExtensionFunctions[] = 'MobileFrontend2_Hooks::setup'; |
| | 41 | + |
| | 42 | +// Modules |
| | 43 | +$commonModuleInfo = array( |
| | 44 | + 'localBasePath' => dirname( __FILE__ ) . '/modules', |
| | 45 | + 'remoteExtPath' => 'MobileFrontend2/modules', |
| | 46 | +); |
| | 47 | + |
| | 48 | +// Main style |
| | 49 | +$wgResourceModules['ext.mobileFrontend2'] = array( |
| | 50 | + 'scripts' => 'ext.mobileFrontend2/ext.mobileFrontend2.js', |
| | 51 | + 'messages' => array( |
| | 52 | + 'mobile-frontend2-show-button', |
| | 53 | + 'mobile-frontend2-hide-button', |
| | 54 | + ), |
| | 55 | +) + $commonModuleInfo; |
| | 56 | + |
| | 57 | +$wgResourceModules['ext.mobileFrontend2.common'] = array( |
| | 58 | + 'styles' => 'ext.mobileFrontend2/ext.mobileFrontend2.css', |
| | 59 | +) + $commonModuleInfo; |
| | 60 | + |
| | 61 | +// Config |
| | 62 | +/** |
| | 63 | + * Logo used on MobileFrontend2 |
| | 64 | + * |
| | 65 | + * @var $wgMobileFrontend2Logo string |
| | 66 | + */ |
| | 67 | +$wgMobileFrontend2Logo = null; |
| \ No newline at end of file |
| Property changes on: trunk/extensions/MobileFrontend2/MobileFrontend2.php |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| 1 | 68 | + native |
| Index: trunk/extensions/MobileFrontend2/MobileFrontend2_PostParse.php |
| — | — | @@ -0,0 +1,92 @@ |
| | 2 | +<?php |
| | 3 | + |
| | 4 | +/** |
| | 5 | + * Take the bodycontent and manipulate it for mobile |
| | 6 | + */ |
| | 7 | +class MobileFrontend2_PostParse { |
| | 8 | + |
| | 9 | + /** |
| | 10 | + * HTML to parse |
| | 11 | + * |
| | 12 | + * @var string |
| | 13 | + */ |
| | 14 | + protected $html; |
| | 15 | + |
| | 16 | + /** |
| | 17 | + * DOM of the bodycontent |
| | 18 | + * |
| | 19 | + * @var DOMDocument |
| | 20 | + */ |
| | 21 | + protected $dom; |
| | 22 | + |
| | 23 | + /** |
| | 24 | + * Private constructor, use the mange function |
| | 25 | + * |
| | 26 | + * @param $html |
| | 27 | + */ |
| | 28 | + protected function __construct( $html ) { |
| | 29 | + $this->html = $html; |
| | 30 | + |
| | 31 | + $this->initDom(); |
| | 32 | + } |
| | 33 | + |
| | 34 | + /** |
| | 35 | + * Entry point for the class |
| | 36 | + * |
| | 37 | + * @param $text string |
| | 38 | + * @return string |
| | 39 | + */ |
| | 40 | + public static function mangle( $text ) { |
| | 41 | + $postParse = new self( $text ); |
| | 42 | + $postParse->parse(); |
| | 43 | + |
| | 44 | + return $postParse->html; |
| | 45 | + } |
| | 46 | + |
| | 47 | + /** |
| | 48 | + * Sets up the DOM document |
| | 49 | + */ |
| | 50 | + protected function initDom() { |
| | 51 | + // LibXML is noisy apparently |
| | 52 | + libxml_use_internal_errors( true ); |
| | 53 | + $dom = new DOMDocument(); |
| | 54 | + $dom->loadHTML( '<?xml encoding="UTF-8">' . $this->html ); |
| | 55 | + libxml_use_internal_errors( false ); |
| | 56 | + |
| | 57 | + $dom->strictErrorChecking = false; |
| | 58 | + $dom->encoding = 'UTF-8'; |
| | 59 | + |
| | 60 | + $this->dom = $dom; |
| | 61 | + } |
| | 62 | + |
| | 63 | + /** |
| | 64 | + * Actually parse the DOM |
| | 65 | + */ |
| | 66 | + public function parse() { |
| | 67 | + // Remove the TOC |
| | 68 | + $this->removeToc(); |
| | 69 | + |
| | 70 | + // Render the now manipulated HTML |
| | 71 | + $this->render(); |
| | 72 | + } |
| | 73 | + |
| | 74 | + /** |
| | 75 | + * Removes the TOC (#toc) from the body |
| | 76 | + */ |
| | 77 | + protected function removeToc() { |
| | 78 | + $element = $this->dom->getElementById( 'toc' ); |
| | 79 | + |
| | 80 | + if ( $element !== null ) { |
| | 81 | + $element->parentNode->removeChild( $element ); |
| | 82 | + } |
| | 83 | + } |
| | 84 | + |
| | 85 | + /** |
| | 86 | + * Saves the HTML to $html |
| | 87 | + */ |
| | 88 | + protected function render() { |
| | 89 | + $this->html = $this->dom->saveXML( |
| | 90 | + $this->dom->getElementsByTagName( 'body' ) |
| | 91 | + ->item( 0 )->childNodes->item( 0 ) ); |
| | 92 | + } |
| | 93 | +} |
| \ No newline at end of file |
| Property changes on: trunk/extensions/MobileFrontend2/MobileFrontend2_PostParse.php |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| 1 | 94 | + native |
| Index: trunk/extensions/MobileFrontend2/MobileFrontend2_Hooks.php |
| — | — | @@ -0,0 +1,85 @@ |
| | 2 | +<?php |
| | 3 | + |
| | 4 | +/** |
| | 5 | + * Hooks for the new mobile frontend |
| | 6 | + */ |
| | 7 | +class MobileFrontend2_Hooks { |
| | 8 | + /** |
| | 9 | + * Loads the mobile skin if we need to |
| | 10 | + * |
| | 11 | + * @param $context ResourceContext |
| | 12 | + * @param $skin Skin |
| | 13 | + * @return bool |
| | 14 | + */ |
| | 15 | + public static function createSkin( $context, &$skin ) { |
| | 16 | + // Abort if we're not using the mobile frontend |
| | 17 | + if ( !MobileFrontend2_Detection::isEnabled() ) { |
| | 18 | + return true; |
| | 19 | + } |
| | 20 | + |
| | 21 | + // TODO: WML support |
| | 22 | + $skin = new SkinMobile; |
| | 23 | + |
| | 24 | + // Be a dick and halt the hook |
| | 25 | + return false; |
| | 26 | + } |
| | 27 | + |
| | 28 | + /** |
| | 29 | + * Adds jump back a section links to content blocks |
| | 30 | + * |
| | 31 | + * @param $parser MobileFrontend2_Parser |
| | 32 | + * @param $i int |
| | 33 | + * @param $section string |
| | 34 | + * @param $showEditLink bool |
| | 35 | + * @return bool |
| | 36 | + */ |
| | 37 | + public static function parserSectionCreate( $parser, $i, &$section, $showEditLink ) { |
| | 38 | + if ( !MobileFrontend2_Detection::isEnabled() ) { |
| | 39 | + return true; |
| | 40 | + } |
| | 41 | + |
| | 42 | + // We don't enclose the opening section |
| | 43 | + if ( $i == 0 ) { |
| | 44 | + return true; |
| | 45 | + } |
| | 46 | + |
| | 47 | + // Separate the header from the section |
| | 48 | + preg_match( '/<H[1-6].*?' . '>.*?<\/H[1-6]>/i', $section, $match ); |
| | 49 | + $headerLength = strlen( $match[0] ); |
| | 50 | + |
| | 51 | + $section = "<div section_id=\"$i\" id=\"section-$i\" class=\"mf2-section-container\">" |
| | 52 | + . substr( $section, 0, $headerLength ) |
| | 53 | + . '<div class="content_block">' |
| | 54 | + . substr( $section, $headerLength ) |
| | 55 | + . '<div class="section_anchors">' |
| | 56 | + . '<a href="#section-' . $i . '" class="back_to_top">' |
| | 57 | + . wfMessage( 'mobile-frontend2-back-to-top-of-section' )->escaped() |
| | 58 | + . '</a></div></div></div>'; |
| | 59 | + |
| | 60 | + return true; |
| | 61 | + } |
| | 62 | + |
| | 63 | + public static function articleView( &$article, &$outputDone, &$useParserCache ) { |
| | 64 | + // This is where we want to fetch the article from squids |
| | 65 | + return true; |
| | 66 | + } |
| | 67 | + |
| | 68 | + /** |
| | 69 | + * Perform very early setup |
| | 70 | + * |
| | 71 | + * This implements the parser if we're going to use the frontend |
| | 72 | + * @return bool |
| | 73 | + */ |
| | 74 | + public static function setup() { |
| | 75 | + if ( !MobileFrontend2_Detection::isEnabled() ) { |
| | 76 | + return true; |
| | 77 | + } |
| | 78 | + global $wgMobileFrontend2Logo, $wgExtensionAssetsPath; |
| | 79 | + |
| | 80 | + // We need a sane default and $wgExtensionAssetsPath isn't ready until |
| | 81 | + // after LocalSettings |
| | 82 | + if ( $wgMobileFrontend2Logo === null ) { |
| | 83 | + $wgMobileFrontend2Logo = $wgExtensionAssetsPath . '/MobileFrontend2/modules/ext.mobileFrontend2/images/mw.png'; |
| | 84 | + } |
| | 85 | + } |
| | 86 | +} |
| \ No newline at end of file |
| Property changes on: trunk/extensions/MobileFrontend2/MobileFrontend2_Hooks.php |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| 1 | 87 | + native |
| Index: trunk/extensions/MobileFrontend2/skins/Mobile.php |
| — | — | @@ -0,0 +1,187 @@ |
| | 2 | +<?php |
| | 3 | + |
| | 4 | +class SkinMobile extends SkinTemplate { |
| | 5 | + var $skinname = 'mobile', |
| | 6 | + $stylename = 'mobile', |
| | 7 | + $template = 'MobileTemplate', |
| | 8 | + $useHeadElement = false; |
| | 9 | + |
| | 10 | + /** |
| | 11 | + * Overridden to make changes to resource loader |
| | 12 | + * |
| | 13 | + * @param null|OutputPage $out |
| | 14 | + */ |
| | 15 | + function outputPage( OutputPage $out = null ) { |
| | 16 | + global $wgScript, $wgMobileFrontend2Logo; |
| | 17 | + |
| | 18 | + $out = $this->getOutput(); |
| | 19 | + $request = $this->getRequest(); |
| | 20 | + $user = $this->getUser(); |
| | 21 | + $title = $this->getTitle(); |
| | 22 | + |
| | 23 | + // We need to disable all the default RL modules, do that like this |
| | 24 | + $out->clearAllModules(); |
| | 25 | + |
| | 26 | + // Add the mobile js |
| | 27 | + $out->addModules( 'ext.mobileFrontend2' ); |
| | 28 | + |
| | 29 | + // TODO: Hook for adding modules |
| | 30 | + |
| | 31 | + Profiler::instance()->setTemplated( true ); |
| | 32 | + |
| | 33 | + $this->initPage( $out ); |
| | 34 | + $tpl = $this->setupTemplate( $this->template, 'skins' ); |
| | 35 | + |
| | 36 | + // Give the skin (us) to the template |
| | 37 | + $tpl->setRef( 'skin', $this ); |
| | 38 | + |
| | 39 | + // Language stuff |
| | 40 | + $lang = $this->getLanguage(); |
| | 41 | + $userlang = $lang->getHtmlCode(); |
| | 42 | + $userdir = $lang->getDir(); |
| | 43 | + |
| | 44 | + $tpl->set( 'lang', $userlang ); |
| | 45 | + $tpl->set( 'dir', $userdir ); |
| | 46 | + |
| | 47 | + // Title |
| | 48 | + $tpl->set( 'title', $out->getPageTitle() ); |
| | 49 | + $tpl->set( 'pagetitle', $out->getHTMLTitle() ); |
| | 50 | + |
| | 51 | + // Scriptpath (Used for search and forms) |
| | 52 | + $tpl->setRef( 'wgScript', $wgScript ); |
| | 53 | + |
| | 54 | + // Mobile stuff |
| | 55 | + $tpl->setRef( 'mobilelogopath', $wgMobileFrontend2Logo ); |
| | 56 | + |
| | 57 | + # Add a <div class="mw-content-ltr/rtl"> around the body text |
| | 58 | + # not for special pages or file pages AND only when viewing AND if the page exists |
| | 59 | + # (or is in MW namespace, because that has default content) |
| | 60 | + if( !in_array( $title->getNamespace(), array( NS_SPECIAL, NS_FILE ) ) && |
| | 61 | + in_array( $request->getVal( 'action', 'view' ), array( 'view', 'historysubmit' ) ) && |
| | 62 | + ( $title->exists() || $title->getNamespace() == NS_MEDIAWIKI ) ) { |
| | 63 | + $pageLang = $title->getPageLanguage(); |
| | 64 | + $realBodyAttribs = array( 'lang' => $pageLang->getHtmlCode(), 'dir' => $pageLang->getDir(), |
| | 65 | + 'class' => 'mw-content-'.$pageLang->getDir() ); |
| | 66 | + $out->mBodytext = Html::rawElement( 'div', $realBodyAttribs, $out->mBodytext ); |
| | 67 | + } |
| | 68 | + |
| | 69 | + $tpl->setRef( 'bodycontent', MobileFrontend2_PostParse::mangle( $out->mBodytext ) ); |
| | 70 | + |
| | 71 | + // CSS & JS |
| | 72 | + // Make these last |
| | 73 | + $tpl->set( 'headscripts', $out->getHeadScripts() ); |
| | 74 | + $tpl->set( 'csslinks', $out->buildCssLinks() ); |
| | 75 | + $tpl->set( 'bottomscripts', $this->bottomScripts() ); |
| | 76 | + |
| | 77 | + // Debug comments and stuff |
| | 78 | + $tpl->set( 'debughtml', $this->generateDebugHTML() ); |
| | 79 | + |
| | 80 | + |
| | 81 | + // Output |
| | 82 | + $res = $tpl->execute(); |
| | 83 | + // result may be an error |
| | 84 | + $this->printOrError( $res ); |
| | 85 | + } |
| | 86 | + |
| | 87 | + /** |
| | 88 | + * Skin CSS |
| | 89 | + * |
| | 90 | + * @param OutputPage $out |
| | 91 | + */ |
| | 92 | + function setupSkinUserCss( OutputPage $out ) { |
| | 93 | + $out->addModuleStyles( 'ext.mobileFrontend2.common' ); |
| | 94 | + } |
| | 95 | + |
| | 96 | + /** |
| | 97 | + * We're too cool for edit links, don't output them. Instead, output the |
| | 98 | + * section toggle button. |
| | 99 | + * |
| | 100 | + * @param Title $nt |
| | 101 | + * @param $section |
| | 102 | + * @param null $tooltip |
| | 103 | + * @param bool $lang |
| | 104 | + * @return string |
| | 105 | + */ |
| | 106 | + public function doEditSectionLink( Title $nt, $section, $tooltip = null, $lang = false ) { |
| | 107 | + return '<button>' . wfMessage( 'mobile-frontend2-show-button' )->escaped() . '</button>'; |
| | 108 | + } |
| | 109 | +} |
| | 110 | + |
| | 111 | +class MobileTemplate extends BaseTemplate { |
| | 112 | + |
| | 113 | + /** |
| | 114 | + * Main function, used by classes that subclass QuickTemplate |
| | 115 | + * to show the actual HTML output |
| | 116 | + */ |
| | 117 | + public function execute() { |
| | 118 | +?> |
| | 119 | + <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
| | 120 | + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| | 121 | + <html lang="<?php $this->text( 'lang' ) ?>" dir="<?php $this->text( 'dir' ) ?>" xml:lang="<?php $this->text( 'lang' ) ?>" xmlns="http://www.w3.org/1999/xhtml"> |
| | 122 | + <head> |
| | 123 | + <title><?php $this->text( 'pagetitle' ) ?></title> |
| | 124 | + |
| | 125 | + <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" /> |
| | 126 | + <meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /> |
| | 127 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| | 128 | + |
| | 129 | + <?php $this->html( 'csslinks' ) ?> |
| | 130 | + <?php $this->html( 'headscripts' ) ?> |
| | 131 | + </head> |
| | 132 | + <body> |
| | 133 | + <!-- search/header --> |
| | 134 | + <div id="header"> |
| | 135 | + <div id="searchbox"> |
| | 136 | + <img src="<?php $this->text( 'mobilelogopath' ) ?>" alt="Logo" id="logo" width="35" height="22" /> |
| | 137 | + <form action="<?php $this->text( 'wgScript' ) ?>" class="search_bar" method="get"> |
| | 138 | + <input type="hidden" name="title" value="Special:Search" /> |
| | 139 | + |
| | 140 | + <div id="sq" class="divclearable"> |
| | 141 | + <input type="text" name="search" id="search" size="22" value="" autocorrect="off" autocomplete="off" autocapitalize="off" maxlength="1024" /> |
| | 142 | + <div class="clearlink" id="clearsearch"></div> |
| | 143 | + </div> |
| | 144 | + <button id="goButton" type="submit"></button> |
| | 145 | + </form> |
| | 146 | + </div> |
| | 147 | + </div> |
| | 148 | + |
| | 149 | + <!-- content --> |
| | 150 | + <div class="show" id="content_wrapper"> |
| | 151 | + <!-- firstHeading --> |
| | 152 | + <h1 id="firstHeading" class="firstHeading"> |
| | 153 | + <span dir="auto"><?php $this->html( 'title' ) ?></span> |
| | 154 | + </h1> |
| | 155 | + <!-- /firstHeading --> |
| | 156 | + <!-- bodyContent --> |
| | 157 | + <div id="bodyContent"> |
| | 158 | + <?php $this->html( 'bodycontent' ) ?> |
| | 159 | + <!-- debughtml --> |
| | 160 | + <?php $this->html( 'debughtml' ); ?> |
| | 161 | + <!-- /debughtml --> |
| | 162 | + </div> |
| | 163 | + <!-- /bodyContent --> |
| | 164 | + </div> |
| | 165 | + |
| | 166 | + <!-- footer --> |
| | 167 | + <div id="footer"> |
| | 168 | + <div class="nav" id="footmenu"> |
| | 169 | + <div class="mwm-notice"> |
| | 170 | + <a href="#"><?php $this->msg( 'mobile-frontend2-regular-site' ) ?></a> | <a href="#"><?php $this->msg( 'mobile-frontend2-disable-images' ) ?></a> |
| | 171 | + |
| | 172 | + <div id="perm"> |
| | 173 | + <a href="#"><?php $this->msg( 'mobile-frontend2-perm-stop-redirect' ) ?></a> |
| | 174 | + </div> |
| | 175 | + </div> |
| | 176 | + <div id="copyright"> |
| | 177 | + <?php $this->msg( 'mobile-frontend2-copyright' ) ?> |
| | 178 | + </div> |
| | 179 | + </div> |
| | 180 | + </div> |
| | 181 | + |
| | 182 | + <?php $this->html( 'bottomscripts' ) ?> |
| | 183 | + |
| | 184 | + </body> |
| | 185 | + </html> |
| | 186 | +<?php |
| | 187 | + } |
| | 188 | +} |
| \ No newline at end of file |
| Property changes on: trunk/extensions/MobileFrontend2/skins/Mobile.php |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| 1 | 189 | + native |
| Index: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/ext.mobileFrontend2.css |
| — | — | @@ -0,0 +1,612 @@ |
| | 2 | +.clearlink { |
| | 3 | + /* @embed */ |
| | 4 | + background: url(images/close-button.png) no-repeat scroll 0 0 transparent; |
| | 5 | + background-position: center center; |
| | 6 | + cursor: pointer; |
| | 7 | + zoom: 1; |
| | 8 | + position: absolute; |
| | 9 | + right: 0.25em; |
| | 10 | + top: 50%; |
| | 11 | + margin: 1px; |
| | 12 | + height: 12px; |
| | 13 | + width: 12px; |
| | 14 | + margin-top: -6px; |
| | 15 | + z-index: 2; |
| | 16 | + border: 0px solid; |
| | 17 | + display: none; |
| | 18 | +} |
| | 19 | + |
| | 20 | +#zero-rated-banner { |
| | 21 | + position: relative; |
| | 22 | + height: 20px; |
| | 23 | + width: 100%; |
| | 24 | + z-index: 99; |
| | 25 | + background: #F4A83D; |
| | 26 | + display: block; |
| | 27 | + border-bottom: 1px solid #D6800C; |
| | 28 | + padding: 7px 0; |
| | 29 | + font-size: 130%; |
| | 30 | + font-weight: bold; |
| | 31 | + text-align: center; |
| | 32 | + color: #735005; |
| | 33 | +} |
| | 34 | + |
| | 35 | +#zero-rated-banner a { |
| | 36 | + text-decoration: underline; |
| | 37 | + color: #735005; |
| | 38 | +} |
| | 39 | + |
| | 40 | +#zero-rated-banner-red { |
| | 41 | + position: relative; |
| | 42 | + height: 20px; |
| | 43 | + width: 100%; |
| | 44 | + z-index: 99; |
| | 45 | + background: #FF0000; |
| | 46 | + display: block; |
| | 47 | + border-bottom: 1px solid #D6800C; |
| | 48 | + padding: 7px 0; |
| | 49 | + font-size: 130%; |
| | 50 | + font-weight: bold; |
| | 51 | + text-align: center; |
| | 52 | + color: #735005; |
| | 53 | +} |
| | 54 | + |
| | 55 | +#zero-rated-banner span.notify-close { |
| | 56 | + background-color: #FAD163; |
| | 57 | + float: right; |
| | 58 | + margin-right: 20px; |
| | 59 | + border: 2px solid #735005; |
| | 60 | + padding-left: 4px; |
| | 61 | + padding-right: 4px; |
| | 62 | + text-decoration: none; |
| | 63 | + display: block; |
| | 64 | + cursor: pointer; |
| | 65 | + height: 18px; |
| | 66 | + display: table-cell; |
| | 67 | + vertical-align: middle; |
| | 68 | + text-align: center; |
| | 69 | +} |
| | 70 | + |
| | 71 | +#zero-rated-banner span.notify-close a { |
| | 72 | + text-decoration: none; |
| | 73 | +} |
| | 74 | + |
| | 75 | +#zero-rated-banner-red #zero-rated-banner-text { |
| | 76 | + margin: 0px; |
| | 77 | + color: #ffffff; |
| | 78 | + font-weight: bold; |
| | 79 | + text-align: center; |
| | 80 | +} |
| | 81 | + |
| | 82 | +#zero-rated-banner-red a { |
| | 83 | + text-decoration: underline; |
| | 84 | + color: #ffffff; |
| | 85 | +} |
| | 86 | + |
| | 87 | +#zero-rated-banner-text { |
| | 88 | + margin: 0px; |
| | 89 | + color: #735005; |
| | 90 | + font-weight: bold; |
| | 91 | + text-align: center; |
| | 92 | +} |
| | 93 | + |
| | 94 | +.suggestions-results { |
| | 95 | + font-size: 1.2em; |
| | 96 | + cursor: pointer; |
| | 97 | +} |
| | 98 | + |
| | 99 | +.suggestions-result { |
| | 100 | + color: black; |
| | 101 | + color: WindowText; |
| | 102 | + margin: 0; |
| | 103 | + line-height: 1.8em; |
| | 104 | + padding: 0.01em 0.25em; |
| | 105 | + text-align: left; |
| | 106 | + postion: relative; |
| | 107 | + border-bottom: solid 1px #999999; |
| | 108 | +} |
| | 109 | + |
| | 110 | +.suggestions-result a { |
| | 111 | + text-decoration: none; |
| | 112 | + color: #000000; |
| | 113 | +} |
| | 114 | +.suggestions-result a:link { |
| | 115 | + text-decoration: none; |
| | 116 | + color:#000000; |
| | 117 | +} |
| | 118 | +.suggestions-result a:visited { |
| | 119 | + text-decoration: none; |
| | 120 | + color:#000000; |
| | 121 | +} |
| | 122 | +.suggestions-result a:hover { |
| | 123 | + text-decoration: none; |
| | 124 | + color:#000000; |
| | 125 | +} |
| | 126 | +.suggestions-result a:active { |
| | 127 | + text-decoration: none; |
| | 128 | + color:#000000; |
| | 129 | +} |
| | 130 | +.suggestions-result:hover { |
| | 131 | + background-color: #ACD1E9; |
| | 132 | +} |
| | 133 | +a.sq-val-update { |
| | 134 | + font-size: 1.3em; |
| | 135 | + display: block; |
| | 136 | + font-weight: normal; |
| | 137 | + text-decoration: none; |
| | 138 | + color: #000000; |
| | 139 | + position: absolute; |
| | 140 | + right: 0; |
| | 141 | + width: 1.5em; |
| | 142 | + text-align: center; |
| | 143 | +} |
| | 144 | +a.sq-val-update:link { |
| | 145 | + text-decoration: none; |
| | 146 | + color:#000000; |
| | 147 | +} |
| | 148 | +a.sq-val-update:visited { |
| | 149 | + text-decoration: none; |
| | 150 | + color:#000000; |
| | 151 | +} |
| | 152 | +a.sq-val-update:hover { |
| | 153 | + text-decoration: none; |
| | 154 | + color:#000000; |
| | 155 | +} |
| | 156 | +a.sq-val-update:active { |
| | 157 | + text-decoration: none; |
| | 158 | + color:#000000; |
| | 159 | +} |
| | 160 | + |
| | 161 | +a.search-result-item { |
| | 162 | + display: block; |
| | 163 | + margin-right: 2em; |
| | 164 | +} |
| | 165 | + |
| | 166 | +#results { |
| | 167 | + display: none; |
| | 168 | + background-color: #ffffff; |
| | 169 | + border-top: none; |
| | 170 | + border-left: 1px solid #888; |
| | 171 | + border-right: 1px solid #888; |
| | 172 | + border-bottom: 1px solid #888; |
| | 173 | + z-index: 2; |
| | 174 | + position: absolute; |
| | 175 | +} |
| | 176 | + |
| | 177 | +#search { |
| | 178 | + -webkit-appearance: none; |
| | 179 | + border-top-width: 0px; |
| | 180 | + border-right-width: 0px; |
| | 181 | + border-bottom-width: 0px; |
| | 182 | + border-left-width: 0px; |
| | 183 | + outline-style: none; |
| | 184 | + outline-width: initial; |
| | 185 | + outline-color: initial; |
| | 186 | + height: 1.4em; |
| | 187 | +} |
| | 188 | + |
| | 189 | +ul#footer-info { |
| | 190 | + list-style: none; |
| | 191 | + list-style-image: none; |
| | 192 | + list-style-type: none; |
| | 193 | + margin: 0; |
| | 194 | + padding: 0; |
| | 195 | +} |
| | 196 | + |
| | 197 | +.divclearable { |
| | 198 | + border: 1px solid #888; |
| | 199 | + display: -moz-inline-stack; |
| | 200 | + display: inline-block; |
| | 201 | + zoom: 1; |
| | 202 | + *display: inline; |
| | 203 | + vertical-align: middle; |
| | 204 | + height: 1.5em; |
| | 205 | + position: relative; |
| | 206 | +} |
| | 207 | + |
| | 208 | +#userloginForm table, #userloginForm .user-login tr, #userloginForm .user-login th, #userloginForm .user-login td { |
| | 209 | + width: 200px; |
| | 210 | + border: 0px; |
| | 211 | +} |
| | 212 | + |
| | 213 | +table { |
| | 214 | + border-spacing: 0 !important; |
| | 215 | + width: 100%; |
| | 216 | + border-collapse: collapse !important; |
| | 217 | + border: 1px solid #cccccc; |
| | 218 | + padding: 3px; |
| | 219 | + margin-bottom: 15px; |
| | 220 | +} |
| | 221 | + |
| | 222 | +table.gallery .thumb[style] { |
| | 223 | + border: 0; |
| | 224 | + padding: 0 !important; |
| | 225 | + width: auto !important; |
| | 226 | + margin: 0 auto; |
| | 227 | +} |
| | 228 | + |
| | 229 | +table.geography[style] td[style*="text-align"], table.geography[style] td[colspan="2"] { |
| | 230 | + text-align: left !important; |
| | 231 | + margin-left: 0 !important; |
| | 232 | + margin-right: 0 !important; |
| | 233 | +} |
| | 234 | + |
| | 235 | +table.toc h2 { |
| | 236 | + border: 0; |
| | 237 | + padding: 0; |
| | 238 | + margin-top: 5px; |
| | 239 | +} |
| | 240 | + |
| | 241 | +table.gallery th, table.gallery td { |
| | 242 | + display: block; |
| | 243 | + border: 0; |
| | 244 | + border-bottom: 1px solid #cccccc; |
| | 245 | +} |
| | 246 | + |
| | 247 | +table[style] { |
| | 248 | + width: 100% !important; |
| | 249 | + float: none !important; |
| | 250 | + margin-left: 0 !important; |
| | 251 | +} |
| | 252 | + |
| | 253 | +table.navbox td.navbox-group { |
| | 254 | + background: #ddddff; |
| | 255 | + width: 25%; |
| | 256 | + padding: 3px; |
| | 257 | +} |
| | 258 | + |
| | 259 | +table.gallery { |
| | 260 | + background: #f9f9f9; |
| | 261 | + border-bottom: 0; |
| | 262 | +} |
| | 263 | + |
| | 264 | +table.navbox { |
| | 265 | + font-size: 0.9em; |
| | 266 | + width: 100% !important; |
| | 267 | +} |
| | 268 | + |
| | 269 | +table.gallery .gallerytext { |
| | 270 | + margin-top: -12px; |
| | 271 | + text-align: center; |
| | 272 | +} |
| | 273 | + |
| | 274 | +table.navbox th.navbox-title { |
| | 275 | + background: #ccccff; |
| | 276 | + padding: 5px; |
| | 277 | +} |
| | 278 | + |
| | 279 | +table.navbox div[style*="padding"] { |
| | 280 | + padding-left: 0 !important; |
| | 281 | + padding-right: 0 !important; |
| | 282 | +} |
| | 283 | + |
| | 284 | +table.gallery .gallerybox[style] { |
| | 285 | + width: auto !important; |
| | 286 | + margin-bottom: -16px; |
| | 287 | +} |
| | 288 | + |
| | 289 | +table td, table th { |
| | 290 | + border: 1px solid #cccccc; |
| | 291 | + padding: 3px; |
| | 292 | +} |
| | 293 | + |
| | 294 | +.mwm-message.mwm-notice { |
| | 295 | + background: #FFFFFF; |
| | 296 | + font-size: 1.1em; |
| | 297 | + color: #000000; |
| | 298 | +} |
| | 299 | +.mwm-message.mwm-notice a { |
| | 300 | + text-decoration: underline; |
| | 301 | + font-weight: bold; |
| | 302 | + color: #000000; |
| | 303 | +} |
| | 304 | + |
| | 305 | +h3#sopa-notice { |
| | 306 | + color: #000000; |
| | 307 | + -webkit-margin-after: 0.5em; |
| | 308 | + margin: 0px; |
| | 309 | +} |
| | 310 | + |
| | 311 | +table table { |
| | 312 | + border: 0; |
| | 313 | +} |
| | 314 | + |
| | 315 | +table table td, table table th { |
| | 316 | + border: 0; |
| | 317 | +} |
| | 318 | + |
| | 319 | +table.toc { |
| | 320 | + background: #f9f9f9; |
| | 321 | +} |
| | 322 | + |
| | 323 | +table.navbox td.navbox-abovebelow { |
| | 324 | + padding: 3px; |
| | 325 | +} |
| | 326 | + |
| | 327 | +table.navbox td.navbox-group + td { |
| | 328 | + padding: 3px; |
| | 329 | +} |
| | 330 | + |
| | 331 | +table.navbox div[style*="padding"] a { |
| | 332 | + white-space: pre-wrap; |
| | 333 | +} |
| | 334 | + |
| | 335 | +table.navbox span[style*="white"] { |
| | 336 | + white-space: pre-wrap !important; |
| | 337 | +} |
| | 338 | + |
| | 339 | +table.navbox td, table.navbox th { |
| | 340 | + padding: 0; |
| | 341 | +} |
| | 342 | + |
| | 343 | +table.navbox table { |
| | 344 | + margin-bottom: 0; |
| | 345 | +} |
| | 346 | + |
| | 347 | +table.wikitable th { |
| | 348 | + background: #f3f3f3; |
| | 349 | +} |
| | 350 | + |
| | 351 | +table.infobox { |
| | 352 | + background: #f9f9f9; |
| | 353 | +} |
| | 354 | + |
| | 355 | +table.infobox th, table.infobox td { |
| | 356 | + border: 0; |
| | 357 | +} |
| | 358 | + |
| | 359 | +table.infobox td[colspan="3"], table.infobox th[colspan="3"] { |
| | 360 | + border: 1px solid #cccccc; |
| | 361 | +} |
| | 362 | + |
| | 363 | +table.geography[style] th { |
| | 364 | + text-align: left; |
| | 365 | +} |
| | 366 | + |
| | 367 | +table.geography[style] td[style*="text-align"] div[style], table.geography[style] td[colspan="2"] div[style] { |
| | 368 | + text-align: left !important; |
| | 369 | +} |
| | 370 | + |
| | 371 | +table.admin { |
| | 372 | + width: 300px; |
| | 373 | +} |
| | 374 | + |
| | 375 | +html { |
| | 376 | + font-size: 0.8em; |
| | 377 | +} |
| | 378 | + |
| | 379 | +body { |
| | 380 | + line-height: 1; |
| | 381 | + color: black; |
| | 382 | + background: white; |
| | 383 | + font-family: sans-serif; |
| | 384 | + -webkit-text-size-adjust: none; |
| | 385 | +} |
| | 386 | + |
| | 387 | +p, li, dl, #featured_article { |
| | 388 | + line-height: 1.65; |
| | 389 | +} |
| | 390 | + |
| | 391 | +pre { |
| | 392 | + white-space: pre-wrap; |
| | 393 | +} |
| | 394 | + |
| | 395 | +h2 { |
| | 396 | + border-bottom: 1px solid #aaaaaa; |
| | 397 | + padding-top: 0.3em; |
| | 398 | +} |
| | 399 | + |
| | 400 | +a { |
| | 401 | + text-decoration: none; |
| | 402 | + color: #002bb8; |
| | 403 | +} |
| | 404 | + |
| | 405 | +a:visited { |
| | 406 | + color: #5a3696; |
| | 407 | +} |
| | 408 | + |
| | 409 | +a:active { |
| | 410 | + color: #faa700; |
| | 411 | +} |
| | 412 | + |
| | 413 | +a:hover { |
| | 414 | + text-decoration: underline; |
| | 415 | +} |
| | 416 | + |
| | 417 | +a.new, a.new:visited, a.new:hover { |
| | 418 | + color: red; |
| | 419 | +} |
| | 420 | + |
| | 421 | +a.back_to_top, a.back_to_top:visited { |
| | 422 | + margin-top: 7px; |
| | 423 | + color: blue; |
| | 424 | +} |
| | 425 | + |
| | 426 | +.links { |
| | 427 | + float: left; |
| | 428 | + padding: 10px; |
| | 429 | +} |
| | 430 | + |
| | 431 | +#contentSub, .dablink { |
| | 432 | + margin-bottom: 10px; |
| | 433 | +} |
| | 434 | + |
| | 435 | +#firstHeading { |
| | 436 | + font-size: 1.7em; |
| | 437 | +} |
| | 438 | + |
| | 439 | +h2 { |
| | 440 | + font-size: 1.3em; |
| | 441 | +} |
| | 442 | + |
| | 443 | +.section_anchors a { |
| | 444 | + display: block; |
| | 445 | +} |
| | 446 | + |
| | 447 | +.section_anchor { |
| | 448 | + height: 1px; |
| | 449 | + width: 1px; |
| | 450 | +} |
| | 451 | + |
| | 452 | +.printonly, .geo-multi-punct, .geo-nondefault { |
| | 453 | + display: none; |
| | 454 | +} |
| | 455 | + |
| | 456 | +#featured_article .noprint, .today .noprint { |
| | 457 | + display: none; |
| | 458 | +} |
| | 459 | + |
| | 460 | +.thumb { |
| | 461 | + border: 1px solid #cccccc; |
| | 462 | + -webkit-border-radius: 5px; |
| | 463 | + -moz-border-radius: 5px; |
| | 464 | + background: #f9f9f9; |
| | 465 | + margin-bottom: 10px; |
| | 466 | +} |
| | 467 | + |
| | 468 | +.thumb .thumbinner[style] { |
| | 469 | + margin: 5px auto; |
| | 470 | +} |
| | 471 | + |
| | 472 | +.thumb .thumbcaption { |
| | 473 | + width: 100%; |
| | 474 | + margin: 5px 10px 0; |
| | 475 | + text-align: center; |
| | 476 | + width: auto !important; |
| | 477 | +} |
| | 478 | + |
| | 479 | +img.thumbborder { |
| | 480 | + border: 1px solid #cccccc; |
| | 481 | +} |
| | 482 | + |
| | 483 | +.floatright { |
| | 484 | + float: right; |
| | 485 | +} |
| | 486 | + |
| | 487 | +#content_wrapper.home h1#firstHeading { |
| | 488 | + display: none; |
| | 489 | +} |
| | 490 | + |
| | 491 | +body { |
| | 492 | + margin: 0; |
| | 493 | +} |
| | 494 | + |
| | 495 | +#header { |
| | 496 | + margin: 8px 8px 0 8px; |
| | 497 | +} |
| | 498 | + |
| | 499 | +#content_wrapper { |
| | 500 | + clear: both; |
| | 501 | + margin: 0 8px; |
| | 502 | +} |
| | 503 | + |
| | 504 | +#footer { |
| | 505 | + margin: 0 8px; |
| | 506 | +} |
| | 507 | + |
| | 508 | +#header img, #header form, #header input, #header button { |
| | 509 | + vertical-align: middle; |
| | 510 | + display: inline-block; |
| | 511 | +} |
| | 512 | + |
| | 513 | +#searchbox { |
| | 514 | + width: auto; |
| | 515 | + padding: 5px; |
| | 516 | + border: 1px solid #cccccc; |
| | 517 | + -webkit-border-radius: 2px; |
| | 518 | + -moz-border-radius: 2px; |
| | 519 | +} |
| | 520 | + |
| | 521 | +#searchbox a, #searchbox img { |
| | 522 | + border: 0px; |
| | 523 | + vertical-align: middle; |
| | 524 | +} |
| | 525 | + |
| | 526 | +#searchbox #goButton { |
| | 527 | + border: 0; |
| | 528 | + /* @embed */ |
| | 529 | + background: url(images/s.gif) no-repeat top left; |
| | 530 | + background-size: 27px 25px; |
| | 531 | + height: 25px; |
| | 532 | + width: 27px; |
| | 533 | +} |
| | 534 | + |
| | 535 | +#searchbox #searchField { |
| | 536 | + width: auto; |
| | 537 | +} |
| | 538 | + |
| | 539 | +#nav { |
| | 540 | + -webkit-border-radius: 2px; |
| | 541 | + -moz-border-radius: 2px; |
| | 542 | + clear: both; |
| | 543 | + padding: 5px 0; |
| | 544 | +} |
| | 545 | + |
| | 546 | +#nav form, #nav button { |
| | 547 | + display: inline-block; |
| | 548 | +} |
| | 549 | + |
| | 550 | +#nav button, |
| | 551 | +#disableButtons button { |
| | 552 | + /* @embed */ |
| | 553 | + background: url(images/buttonbg.gif) no-repeat center; |
| | 554 | + border: 0; |
| | 555 | + height: 23px; |
| | 556 | + width: 83px; |
| | 557 | +} |
| | 558 | + |
| | 559 | +#disableButtons { |
| | 560 | + text-align: center; |
| | 561 | +} |
| | 562 | + |
| | 563 | +#disableButtons #backButton { |
| | 564 | + margin-top: 5em; |
| | 565 | +} |
| | 566 | + |
| | 567 | +.mwm-notice { |
| | 568 | + padding: 5px; |
| | 569 | + background: #dddddd; |
| | 570 | + -webkit-border-radius: 5px; |
| | 571 | + margin-top: 5px; |
| | 572 | + text-align: center; |
| | 573 | + border: 1px solid grey; |
| | 574 | +} |
| | 575 | + |
| | 576 | +.mwm-message.mwm-notice { |
| | 577 | + font-size: 1.1em; |
| | 578 | +} |
| | 579 | + |
| | 580 | +#image_wrapper { |
| | 581 | + margin: 8px 0 8px -3px; |
| | 582 | +} |
| | 583 | + |
| | 584 | +#footer { |
| | 585 | + padding-top: 1em; |
| | 586 | +} |
| | 587 | + |
| | 588 | +#footer #perm { |
| | 589 | + padding-top: 2em; |
| | 590 | + font-size: 90%; |
| | 591 | +} |
| | 592 | + |
| | 593 | +#footer #copyright { |
| | 594 | + padding: 1em 0; |
| | 595 | + font-size: 80%; |
| | 596 | +} |
| | 597 | + |
| | 598 | +ol.references > li:target, |
| | 599 | +sup.reference:target, |
| | 600 | +span.citation:target, cite:target { |
| | 601 | + background-color: #ddeeff; |
| | 602 | +} |
| | 603 | + |
| | 604 | +.content_block, |
| | 605 | +/*.section_anchors,*/ |
| | 606 | +button.section_heading.hide { |
| | 607 | + display: none; |
| | 608 | +} |
| | 609 | + |
| | 610 | +#search:focus { |
| | 611 | + outline: none; |
| | 612 | +} |
| | 613 | + |
| Property changes on: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/ext.mobileFrontend2.css |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| 1 | 614 | + native |
| Index: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/ext.mobileFrontend2.js |
| — | — | @@ -0,0 +1,21 @@ |
| | 2 | +var MobileFrontend2 = mf2 = { |
| | 3 | + init: function() { |
| | 4 | + // Hook the section toggle |
| | 5 | + $( '.mf2-section-container h2' ).click( mf2.toggleSection ); |
| | 6 | + }, |
| | 7 | + |
| | 8 | + toggleSection: function() { |
| | 9 | + var $header = $( this ), |
| | 10 | + $contentDiv = $header.next(), |
| | 11 | + buttonMsg; |
| | 12 | + |
| | 13 | + // Toggle the div |
| | 14 | + $contentDiv.toggle(); |
| | 15 | + |
| | 16 | + // Change the button text |
| | 17 | + buttonMsg = $contentDiv.css( 'display' ) === 'block' ? 'mobile-frontend2-hide-button' : 'mobile-frontend2-show-button'; |
| | 18 | + $header.find( 'button' ).html( mw.msg( buttonMsg ) ); |
| | 19 | + } |
| | 20 | +}; |
| | 21 | + |
| | 22 | +$( mf2.init ); |
| \ No newline at end of file |
| Property changes on: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/ext.mobileFrontend2.js |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| 1 | 23 | + native |
| Index: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/100px-globe.png |
| Cannot display: file marked as a binary type. |
| svn:mime-type = image/png |
| Property changes on: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/100px-globe.png |
| ___________________________________________________________________ |
| Added: svn:mime-type |
| 2 | 24 | + image/png |
| Index: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/clearicon.png |
| Cannot display: file marked as a binary type. |
| svn:mime-type = image/png |
| Property changes on: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/clearicon.png |
| ___________________________________________________________________ |
| Added: svn:mime-type |
| 3 | 25 | + image/png |
| Index: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/logo-en.png |
| Cannot display: file marked as a binary type. |
| svn:mime-type = image/png |
| Property changes on: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/logo-en.png |
| ___________________________________________________________________ |
| Added: svn:mime-type |
| 4 | 26 | + image/png |
| Index: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/search-big.png |
| Cannot display: file marked as a binary type. |
| svn:mime-type = image/png |
| Property changes on: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/search-big.png |
| ___________________________________________________________________ |
| Added: svn:mime-type |
| 5 | 27 | + image/png |
| Index: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/buttonbg.gif |
| Cannot display: file marked as a binary type. |
| svn:mime-type = image/gif |
| Property changes on: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/buttonbg.gif |
| ___________________________________________________________________ |
| Added: svn:mime-type |
| 6 | 28 | + image/gif |
| Index: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/search.png |
| Cannot display: file marked as a binary type. |
| svn:mime-type = image/png |
| Property changes on: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/search.png |
| ___________________________________________________________________ |
| Added: svn:mime-type |
| 7 | 29 | + image/png |
| Index: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/system-search.gif |
| Cannot display: file marked as a binary type. |
| svn:mime-type = image/gif |
| Property changes on: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/system-search.gif |
| ___________________________________________________________________ |
| Added: svn:mime-type |
| 8 | 30 | + image/gif |
| Index: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/s-xhdpi.png |
| Cannot display: file marked as a binary type. |
| svn:mime-type = image/png |
| Property changes on: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/s-xhdpi.png |
| ___________________________________________________________________ |
| Added: svn:mime-type |
| 9 | 31 | + image/png |
| Index: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/s.svg |
| Cannot display: file marked as a binary type. |
| svn:mime-type = image/svg+xml |
| Property changes on: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/s.svg |
| ___________________________________________________________________ |
| Added: svn:mime-type |
| 10 | 32 | + image/svg+xml |
| Index: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/close-button.png |
| Cannot display: file marked as a binary type. |
| svn:mime-type = image/png |
| Property changes on: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/close-button.png |
| ___________________________________________________________________ |
| Added: svn:mime-type |
| 11 | 33 | + image/png |
| Index: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/arrow-left.png |
| Cannot display: file marked as a binary type. |
| svn:mime-type = image/png |
| Property changes on: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/arrow-left.png |
| ___________________________________________________________________ |
| Added: svn:mime-type |
| 12 | 34 | + image/png |
| Index: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/mw.png |
| Cannot display: file marked as a binary type. |
| svn:mime-type = image/png |
| Property changes on: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/mw.png |
| ___________________________________________________________________ |
| Added: svn:mime-type |
| 13 | 35 | + image/png |
| Index: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/s.gif |
| Cannot display: file marked as a binary type. |
| svn:mime-type = image/gif |
| Property changes on: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/s.gif |
| ___________________________________________________________________ |
| Added: svn:mime-type |
| 14 | 36 | + image/gif |
| Index: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/s-hdpi.png |
| Cannot display: file marked as a binary type. |
| svn:mime-type = image/png |
| Property changes on: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/s-hdpi.png |
| ___________________________________________________________________ |
| Added: svn:mime-type |
| 15 | 37 | + image/png |
| Index: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/search.gif |
| Cannot display: file marked as a binary type. |
| svn:mime-type = image/gif |
| Property changes on: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/search.gif |
| ___________________________________________________________________ |
| Added: svn:mime-type |
| 16 | 38 | + image/gif |
| Index: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/w.gif |
| Cannot display: file marked as a binary type. |
| svn:mime-type = image/gif |
| Property changes on: trunk/extensions/MobileFrontend2/modules/ext.mobileFrontend2/images/w.gif |
| ___________________________________________________________________ |
| Added: svn:mime-type |
| 17 | 39 | + image/gif |
| Index: trunk/extensions/MobileFrontend2/MobileFrontend2.i18n.php |
| — | — | @@ -0,0 +1,13 @@ |
| | 2 | +<?php |
| | 3 | +/** |
| | 4 | + * Internationalisation file for the extension MobileFrontend2 |
| | 5 | + * |
| | 6 | + * @file |
| | 7 | + * @ingroup Extensions |
| | 8 | + */ |
| | 9 | + |
| | 10 | +$messages = array(); |
| | 11 | + |
| | 12 | +$messages['en'] = array( |
| | 13 | + 'mobile-frontend2-desc' => 'Mobile Frontend', |
| | 14 | +); |
| \ No newline at end of file |
| Property changes on: trunk/extensions/MobileFrontend2/MobileFrontend2.i18n.php |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| 1 | 15 | + native |
| Index: trunk/extensions/MobileFrontend2/MobileFrontend2_Detection.php |
| — | — | @@ -0,0 +1,64 @@ |
| | 2 | +<?php |
| | 3 | + |
| | 4 | +/** |
| | 5 | + * Class containing all detection logic for mobile frontend |
| | 6 | + */ |
| | 7 | +class MobileFrontend2_Detection { |
| | 8 | + |
| | 9 | + /** |
| | 10 | + * Cached detection result |
| | 11 | + * |
| | 12 | + * @var null|bool |
| | 13 | + */ |
| | 14 | + protected static $enabled = null; |
| | 15 | + |
| | 16 | + /** |
| | 17 | + * Main function deciding if the MobileFrontend should be enabled |
| | 18 | + * |
| | 19 | + * @return bool |
| | 20 | + */ |
| | 21 | + public static function isEnabled() { |
| | 22 | + if ( self::$enabled !== null ) { |
| | 23 | + return self::$enabled; |
| | 24 | + } |
| | 25 | + |
| | 26 | + self::detect(); |
| | 27 | + |
| | 28 | + return self::$enabled; |
| | 29 | + } |
| | 30 | + |
| | 31 | + private static function detect() { |
| | 32 | + $request = RequestContext::getMain()->getRequest(); |
| | 33 | + $useFormat = $request->getText( 'useformat' ); |
| | 34 | + |
| | 35 | + // Start with the basics, did they force the frontend? |
| | 36 | + if ( $useFormat == 'mobile' ) { |
| | 37 | + return self::enable(); |
| | 38 | + } |
| | 39 | + |
| | 40 | + // TODO: Other detection magic |
| | 41 | + |
| | 42 | + // Nope. No mobile frontend for you. |
| | 43 | + return self::disable(); |
| | 44 | + } |
| | 45 | + |
| | 46 | + /** |
| | 47 | + * Enable mobile frontend |
| | 48 | + * |
| | 49 | + * @return bool |
| | 50 | + */ |
| | 51 | + private function enable() { |
| | 52 | + self::$enabled = true; |
| | 53 | + return true; |
| | 54 | + } |
| | 55 | + |
| | 56 | + /** |
| | 57 | + * Disable mobile frontend |
| | 58 | + * |
| | 59 | + * @return bool |
| | 60 | + */ |
| | 61 | + private function disable() { |
| | 62 | + self::$enabled = false; |
| | 63 | + return false; |
| | 64 | + } |
| | 65 | +} |
| Property changes on: trunk/extensions/MobileFrontend2/MobileFrontend2_Detection.php |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| 1 | 66 | + native |