Paladox has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/224841

Change subject: Move functions into own file
......................................................................

Move functions into own file

Change-Id: I89b96efab3f986fd31b1c1067c1032f5b3b21c5f
---
A Theme.hooks.php
M Theme.php
M monobook/dark.css
M vector/dark.css
4 files changed, 90 insertions(+), 52 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Theme 
refs/changes/41/224841/1

diff --git a/Theme.hooks.php b/Theme.hooks.php
new file mode 100644
index 0000000..58488c8
--- /dev/null
+++ b/Theme.hooks.php
@@ -0,0 +1,45 @@
+<?php
+
+class ThemeHooks {
+
+       public static function wfDisplayTheme( &$out, &$sk ) {
+               global $wgRequest, $wgDefaultTheme, $wgValidSkinNames;
+               global $wgResourceModules;
+
+               $theme = $wgRequest->getVal( 'usetheme', false );
+               $useskin = $wgRequest->getVal( 'useskin', false );
+               $skin = $useskin ? $useskin : $sk->getSkinName();
+
+               if ( !array_key_exists( strtolower( $skin ), $wgValidSkinNames 
) ) {
+                       // so we don't load themes for skins when we can't 
actually load the skin
+                       $skin = $sk->getSkinName();
+               }
+
+               // Monaco is a special case, since it handles its themes in its 
main PHP
+               // file instead of leaving theme handling to us (ShoutWiki bug 
#173)
+               if ( strtolower( $skin ) == 'monaco' ) {
+                       return true;
+               }
+
+               if ( $theme ) {
+                       $themeName = $theme;
+               } elseif ( isset( $wgDefaultTheme ) && $wgDefaultTheme != 
'default' ) {
+                       $themeName = $wgDefaultTheme;
+               } else {
+                       $themeName = false;
+               }
+
+               $moduleName = 'themeloader.skins.' . strtolower( $skin ) . '.' .
+                       strtolower( $themeName );
+
+               // Check that we have something to include later on; if not, 
bail out
+               if ( !$themeName || !isset( $wgResourceModules[$moduleName] ) ) 
{
+                       return true;
+               }
+
+               // Add the CSS file via ResourceLoader.
+               $out->addModuleStyles( $moduleName );
+
+               return true;
+       }
+}
\ No newline at end of file
diff --git a/Theme.php b/Theme.php
index 6216fc1..ca74a26 100644
--- a/Theme.php
+++ b/Theme.php
@@ -4,7 +4,7 @@
  *
  * @file
  * @ingroup Extensions
- * @version 1.7
+ * @version 1.7.1
  * @author Ryan Schmidt <skizzerz at gmail dot com>
  * @author Jack Phoenix <j...@countervandalism.net>
  * @license https://en.wikipedia.org/wiki/Public_domain Public domain
@@ -18,11 +18,16 @@
 // Extension credits that will show up on Special:Version
 $wgExtensionCredits['other'][] = array(
        'name' => 'Theme',
-       'version' => '1.7',
+       'version' => '1.7.1',
        'author' => array( 'Ryan Schmidt', 'Jack Phoenix' ),
        'description' => 'Theme loader extension for skins',
        'url' => 'https://www.mediawiki.org/wiki/Extension:Theme'
 );
+
+$wgAutoloadClasses['ThemeHooks'] = __DIR__ . '/Theme.hooks.php';
+
+// Actual extension logic begins here
+$wgHooks['BeforePageDisplay'][] = 'ThemeHooks::wfDisplayTheme';
 
 // For ShoutWiki, $wgDefaultTheme is set in GlobalSettings.php to 'default'
 // For a non-ShoutWiki site where you want to use this extension, you should
@@ -64,7 +69,6 @@
        'styles' => array(
                'extensions/Theme/monobook/stellarbook.css' => array( 'media' 
=> 'screen' )
        )
-
 );
 
 // Vector
@@ -72,48 +76,4 @@
        'styles' => array(
                'extensions/Theme/vector/dark.css' => array( 'media' => 
'screen' )
        )
-);
-
-// Actual extension logic begins here
-$wgHooks['BeforePageDisplay'][] = 'wfDisplayTheme';
-
-function wfDisplayTheme( &$out, &$sk ) {
-       global $wgRequest, $wgDefaultTheme, $wgValidSkinNames;
-       global $wgResourceModules;
-
-       $theme = $wgRequest->getVal( 'usetheme', false );
-       $useskin = $wgRequest->getVal( 'useskin', false );
-       $skin = $useskin ? $useskin : $sk->getSkinName();
-
-       if ( !array_key_exists( strtolower( $skin ), $wgValidSkinNames ) ) {
-               // so we don't load themes for skins when we can't actually 
load the skin
-               $skin = $sk->getSkinName();
-       }
-
-       // Monaco is a special case, since it handles its themes in its main PHP
-       // file instead of leaving theme handling to us (ShoutWiki bug #173)
-       if ( strtolower( $skin ) == 'monaco' ) {
-               return true;
-       }
-
-       if ( $theme ) {
-               $themeName = $theme;
-       } elseif ( isset( $wgDefaultTheme ) && $wgDefaultTheme != 'default' ) {
-               $themeName = $wgDefaultTheme;
-       } else {
-               $themeName = false;
-       }
-
-       $moduleName = 'themeloader.skins.' . strtolower( $skin ) . '.' .
-               strtolower( $themeName );
-
-       // Check that we have something to include later on; if not, bail out
-       if ( !$themeName || !isset( $wgResourceModules[$moduleName] ) ) {
-               return true;
-       }
-
-       // Add the CSS file via ResourceLoader.
-       $out->addModuleStyles( $moduleName );
-
-       return true;
-}
\ No newline at end of file
+);
\ No newline at end of file
diff --git a/monobook/dark.css b/monobook/dark.css
index 9c8a82d..293c2ab 100644
--- a/monobook/dark.css
+++ b/monobook/dark.css
@@ -2,7 +2,7 @@
 ** Dark theme for MonoBook
 ** Originally from ZeldaWiki.org and modified by Skizzerz 
<skizz...@shoutwiki.com> for ShoutWiki
 **
-** @date 14 September 2011
+** @date 1 November 2014
 */
 div#content {
        background: #1c3855;
@@ -313,7 +313,7 @@
 
 /* also used on Special:Version */
 table.wikitable {
-       background-color: transparent;
+       background-color: transparent !important;
        color: #d2d2d2;
 }
 
@@ -424,4 +424,14 @@
 td.diff-context {
        background-color: transparent !important;
        color: #d2d2d2;
+}
+
+/**
+ * This class appears to be the new version of TablePager, I guess?
+ * Everywhere where I see that this is used, the element also has the 
TablePager
+ * class, but all CSS definitions are on this class and its children.
+ * Anyway, Special:ListFiles, Special:AbuseFilter, etc. use this class.
+ */
+table.mw-datatable th, table.mw-datatable tr:hover td, table.mw-datatable td {
+       background-color: transparent;
 }
\ No newline at end of file
diff --git a/vector/dark.css b/vector/dark.css
index fe133ea..9d0d7ac 100644
--- a/vector/dark.css
+++ b/vector/dark.css
@@ -178,10 +178,17 @@
 }
 
 /* OVERRIDDEN BY COMPLIANT BROWSERS */
+/* ashley 21 June 2015: maybe not? anyway, this was breaking the little arrow
+icon next to the "More" menu, hence why it's now commented out
 div.vectorMenu h3 a,
 div.vectorMenu h5 a {
-       /* @embed */
        background-image: url('dark/tab-break.png');
+}
+*/
+
+/* Make the text for the "More [actions]" menu more readable */
+div.vectorMenu h3 span {
+       color: inherit;
 }
 
 /* Search */
@@ -192,6 +199,21 @@
 }
 
 div#simpleSearch input#searchInput {
+       color: #e0e0e0;
+}
+
+/**
+ * Make the search box placeholder text a tad bit lighter
+ * It's beyond stupid that these rules cannot be combined into one...browsers,
+ * why must you be so random?!
+ */
+div#simpleSearch #searchInput.placeholder {
+       color: #e0e0e0;
+}
+div#simpleSearch :-ms-input-placeholder#searchInput {
+       color: #e0e0e0;
+}
+div#simpleSearch :-moz-placeholder#searchInput {
        color: #e0e0e0;
 }
 
@@ -218,10 +240,11 @@
        padding: 0;
 }
 
+/* ashley 21 June 2015: this doesn't look good anymore, so removing it
 div#mw-panel div.portal div.body {
-       /* @embed */
        background-image: url('dark/portal-break.png');
 }
+*/
 
 div#mw-panel div.portal div.body ul li a {
        color: #F4F26B;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I89b96efab3f986fd31b1c1067c1032f5b3b21c5f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Theme
Gerrit-Branch: master
Gerrit-Owner: Paladox <thomasmulhall...@yahoo.com>

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

Reply via email to