Page MenuHomePhabricator

b30118.patch

Authored By
bzimport
Nov 21 2014, 11:56 PM
Size
2 KB
Referenced Files
None
Subscribers
None

b30118.patch

Index: views/layout/_search_webkit.html.php
===================================================================
--- views/layout/_search_webkit.html.php (revision 94783)
+++ views/layout/_search_webkit.html.php (working copy)
@@ -1,5 +1,5 @@
<?php
-global $wgExtensionAssetsPath;
+global $wgExtensionAssetsPath, $wgMobileFrontendLogo;
$searchField = (!empty($_GET['search'])) ? $_GET['search'] : '';
@@ -13,7 +13,7 @@
$searchWebkitHtml = <<<EOD
<div id='header'>
<div id='searchbox'>
- <img alt='W logo' id='logo' src='{$wgExtensionAssetsPath}/MobileFrontend/stylesheets/images/w.gif' />
+ <img alt='Logo' id='logo' src='{$wgMobileFrontendLogo}' />
<form action='{$scriptUrl}' class='search_bar' method='get'>
<input type="hidden" value="Special:Search" name="title" />
<input type="hidden" value="Search" name="fulltext" />
Index: MobileFrontend.php
===================================================================
--- MobileFrontend.php (revision 94783)
+++ MobileFrontend.php (working copy)
@@ -42,11 +42,18 @@
$wgAutoloadClasses['DeviceDetection'] = $cwd . 'DeviceDetection.php';
$wgAutoloadClasses['CssDetection'] = $cwd . 'CssDetection.php';
+/**
+ * Path to the logo used in the mobile view
+ *
+ * Should be 22px tall at most
+ */
+$wgMobileFrontendLogo = false;
+
$wgExtMobileFrontend = new ExtMobileFrontend();
$wgHooks['BeforePageDisplay'][] = array( &$wgExtMobileFrontend, 'beforePageDisplayHTML' );
-
$wgHooks['SkinTemplateOutputPageBeforeExec'][] = array( &$wgExtMobileFrontend, 'addMobileFooter' );
+$wgExtensionFunctions[] = array( &$wgExtMobileFrontend, 'setDefaultLogo' );
class ExtMobileFrontend {
const VERSION = '0.5.32';
@@ -735,4 +742,14 @@
return $applicationHtml;
}
+
+ /**
+ * Sets up the default logo image used in mobile view if none is set
+ */
+ public function setDefaultLogo() {
+ global $wgMobileFrontendLogo, $wgExtensionAssetsPath;
+ if ( $wgMobileFrontendLogo === false ) {
+ $wgMobileFrontendLogo = $wgExtensionAssetsPath . '/MobileFrontend/stylesheets/images/mw.png';
+ }
+ }
}

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
7782
Default Alt Text
b30118.patch (2 KB)

Event Timeline