CSS do not load with upgrade to mediawiki 1.14

If you are having problems with GuMax, post here.
Post Reply
User avatar
Tolsome
Rank 0
Rank 0
Posts: 3
Joined: February 19th, 2008, 10:31 am

CSS do not load with upgrade to mediawiki 1.14

Post by Tolsome »

hello :)
I'm using your GuMax 3.1 - Released May 1, 2007 - and I upgraded MediaWiki to 1.14, yesterday. Now my Common.css (Link: http://simpire.megamers.ch/wikipire/ind ... Common.css) do not work anymore with your skin. :(
I fixed it (with: importStylesheet('MediaWiki:Common.css'); in the Common.js) because I missing all my other site-wide local CSS
and it won't load now for non-javascript users.

I really love your skin, can you fix that, please?
User avatar
Paul
Development Team Leader
Development Team Leader
Posts: 1132
Joined: October 20th, 2007, 2:23 pm

Re: CSS do not load with upgrade to mediawiki 1.14

Post by Paul »

This is because MediaWiki keeps changing SkinTemplate class, and it breaks old skins and custom skins...

All you need to do is replacing the GuMax header with latest monobook header, the problem will be solved...

Here is example I did for GuMaxDD:

Code: Select all

class SkinGuMaxDD extends SkinTemplate {
	/** Using GuMaxDD */
	function initPage( OutputPage $out ) {
		parent::initPage( $out );
		$this->skinname  = 'gumaxdd';
		$this->stylename = 'gumaxdd';
		$this->template  = 'GuMaxDDTemplate';

	}

	function setupSkinUserCss( OutputPage $out ) {
		global $wgHandheldStyle;

		parent::setupSkinUserCss( $out );

		// Append to the default screen common & print styles...
		$out->addStyle( 'gumaxdd/gumax_main.css', 'screen' );
		if( $wgHandheldStyle ) {
			// Currently in testing... try 'chick/main.css'
			$out->addStyle( $wgHandheldStyle, 'handheld' );
		}

		$out->addStyle( 'gumaxdd/IE50Fixes.css', 'screen', 'lt IE 5.5000' );
		$out->addStyle( 'gumaxdd/IE55Fixes.css', 'screen', 'IE 5.5000' );
		$out->addStyle( 'gumaxdd/IE60Fixes.css', 'screen', 'IE 6' );
		$out->addStyle( 'gumaxdd/IE70Fixes.css', 'screen', 'IE 7' );

		$out->addStyle( 'gumaxdd/rtl.css', 'screen', '', 'rtl' );

		$out->addStyle( 'gumaxdd/gumax_print.css', 'print' );
	}
}

/**
 * @todo document
 * @ingroup Skins
 */
class GuMaxDDTemplate extends QuickTemplate {
	var $skin;
	/**
	 * Template filter callback for GuMaxDD skin.
	 * Takes an associative array of data set from a SkinTemplate-based
	 * class, and a wrapper for MediaWiki's localization database, and
	 * outputs a formatted page.
	 *
	 * @access private
	 */
	function execute() {
		global $wgRequest;
		$this->skin = $skin = $this->data['skin'];
		$action = $wgRequest->getText( 'action' );

		// Suppress warnings to prevent notices about missing indexes in $this->data
		wfSuppressWarnings();

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="<?php $this->text('xhtmldefaultnamespace') ?>" <?php
	foreach($this->data['xhtmlnamespaces'] as $tag => $ns) {
		?>xmlns:<?php echo "{$tag}=\"{$ns}\" ";
	} ?>xml:lang="<?php $this->text('lang') ?>" lang="<?php $this->text('lang') ?>" dir="<?php $this->text('dir') ?>">
	<head>
		<meta http-equiv="Content-Type" content="<?php $this->text('mimetype') ?>; charset=<?php $this->text('charset') ?>" />
		<?php $this->html('headlinks') ?>
		<title><?php $this->text('pagetitle') ?></title>
		<?php $this->html('csslinks') ?>

		<!--[if lt IE 7]><script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath') ?>/common/IEFixes.js?<?php echo $GLOBALS['wgStyleVersion'] ?>"></script>
		<meta http-equiv="imagetoolbar" content="no" /><![endif]-->

		<?php print Skin::makeGlobalVariablesScript( $this->data ); ?>

		<script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath' ) ?>/common/wikibits.js?<?php echo $GLOBALS['wgStyleVersion'] ?>"><!-- wikibits js --></script>
		<!-- Head Scripts -->
<?php $this->html('headscripts') ?>
<?php	if($this->data['jsvarurl']) { ?>
		<script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('jsvarurl') ?>"><!-- site js --></script>
<?php	} ?>
<?php	if($this->data['pagecss']) { ?>
		<style type="text/css"><?php $this->html('pagecss') ?></style>
<?php	}
		if($this->data['usercss']) { ?>
		<style type="text/css"><?php $this->html('usercss') ?></style>
<?php	}
		if($this->data['userjs']) { ?>
		<script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('userjs' ) ?>"></script>
<?php	}
		if($this->data['userjsprev']) { ?>
		<script type="<?php $this->text('jsmimetype') ?>"><?php $this->html('userjsprev') ?></script>
<?php	}
		if($this->data['trackbackhtml']) print $this->data['trackbackhtml']; ?>


	<script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/scripts/jquery-1.3.2.min.js?<?php echo $GLOBALS['wgStyleVersion'] ?>"></script>
	<script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/scripts/jquery.droppy.js?<?php echo $GLOBALS['wgStyleVersion'] ?>"></script>
	<script type="<?php $this->text('jsmimetype') ?>"> $(function() { $('#gumax-nav').droppy({speed: 300}); }); </script>

</head>
User avatar
Tolsome
Rank 0
Rank 0
Posts: 3
Joined: February 19th, 2008, 10:31 am

Re: CSS do not load with upgrade to mediawiki 1.14

Post by Tolsome »

Thank you. :)
Post Reply