r94960 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94959‎ | r94960 | r94961 >
Date:23:09, 18 August 2011
Author:preilly
Status:ok
Tags:
Comment:
mft r94958
Modified paths:
  • /branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/MobileFrontend/views/layout/_search_webkit.html.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php
@@ -42,11 +42,20 @@
4343 $wgAutoloadClasses['DeviceDetection'] = $cwd . 'DeviceDetection.php';
4444 $wgAutoloadClasses['CssDetection'] = $cwd . 'CssDetection.php';
4545
 46+/**
 47+ * Path to the logo used in the mobile view
 48+ *
 49+ * Should be 22px tall at most
 50+ */
 51+$wgMobileFrontendLogo = false;
 52+
 53+
4654 $wgExtMobileFrontend = new ExtMobileFrontend();
4755
4856 $wgHooks['BeforePageDisplay'][] = array( &$wgExtMobileFrontend, 'beforePageDisplayHTML' );
4957
5058 $wgHooks['SkinTemplateOutputPageBeforeExec'][] = array( &$wgExtMobileFrontend, 'addMobileFooter' );
 59+$wgExtensionFunctions[] = array( &$wgExtMobileFrontend, 'setDefaultLogo' );
5160
5261 /**
5362 * Make the classes stripped from page content configurable. Each item will
@@ -61,7 +70,7 @@
6271 );
6372
6473 class ExtMobileFrontend {
65 - const VERSION = '0.5.36';
 74+ const VERSION = '0.5.37';
6675
6776 /**
6877 * @var DOMDocument
@@ -748,4 +757,14 @@
749758
750759 return $applicationHtml;
751760 }
 761+
 762+ /**
 763+ * Sets up the default logo image used in mobile view if none is set
 764+ */
 765+ public function setDefaultLogo() {
 766+ global $wgMobileFrontendLogo, $wgExtensionAssetsPath;
 767+ if ( $wgMobileFrontendLogo === false ) {
 768+ $wgMobileFrontendLogo = $wgExtensionAssetsPath . '/MobileFrontend/stylesheets/images/mw.png';
 769+ }
 770+ }
752771 }
Index: branches/wmf/1.17wmf1/extensions/MobileFrontend/views/layout/_search_webkit.html.php
@@ -1,5 +1,5 @@
22 <?php
3 -global $wgExtensionAssetsPath;
 3+global $wgExtensionAssetsPath, $wgMobileFrontendLogo;
44
55 $searchField = self::$searchField;
66 $mainPageUrl = self::$mainPageUrl;
@@ -12,7 +12,7 @@
1313 $searchWebkitHtml = <<<EOD
1414 <div id='header'>
1515 <div id='searchbox'>
16 - <img alt='W logo' id='logo' src='{$wgExtensionAssetsPath}/MobileFrontend/stylesheets/images/w.gif' />
 16+ <img alt='Logo' id='logo' src='{$wgMobileFrontendLogo}' />
1717 <form action='{$scriptUrl}' class='search_bar' method='get'>
1818 <input type="hidden" value="Special:Search" name="title" />
1919 <input type="hidden" value="Search" name="fulltext" />

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r94958fix for bug 30118 provided by johnduhartpreilly23:08, 18 August 2011

Status & tagging log