forked from wiki-chan/ModernSkylight
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SkinModernSkylight.php
64 lines (52 loc) · 1.94 KB
/
SkinModernSkylight.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
/**
* Modern Skylight - Modern skin for Mediawiki Engine
* http://wiki-chan.net
*
* @author Fenet (http://wiki-chan.net / [email protected])
* @author cafeinlove (http://wiki-chan.net / [email protected])
*/
if( !defined( 'MEDIAWIKI' ) ) {
die( -1 );
}
class SkinModernSkylight extends SkinTemplate {
var $skinname = 'modernskylight', $stylename = 'ModernSkylight',
$template = 'ModernSkylightTemplate', $useHeadElement = true;
/**
* Initializes output page and sets up skin-specific parameters
* @param $out OutputPage object to initialize
*/
public function initPage( OutputPage $out ) {
global $wgLocalStylePath;
parent::initPage( $out );
// Append CSS which includes IE only behavior fixes for hover support -
// this is better than including this in a CSS file since it doesn't
// wait for the CSS file to load before fetching the HTC file.
$min = $this->getRequest()->getFuzzyBool( 'debug' ) ? '' : '.min';
$out->addHeadItem( 'csshover',
'<!--[if lt IE 7]><style type="text/css">body{behavior:url("' .
htmlspecialchars( $wgLocalStylePath ) .
"/{$this->stylename}/csshover{$min}.htc\")}</style><![endif]-->");
// tab-size가 듣지 않는 IE를 위해 글꼴 강제 수정
$out->addHeadItem( 'fontoverride',
'<!--[if IE]><style type="text/css">pre{font-family:굴림,Gulrim !important;}</style><![endif]-->'
);
$out->addModuleScripts( 'skins.modern-skylight.js' );
if ($out->getTitle()->isMainPage()) {
$out->addModuleScripts( 'skins.modern-skylight.mainpage.js' );
}
}
function setupSkinUserCss( OutputPage $out ){
global $wgStylePath;
parent::setupSkinUserCss( $out );
$out->addModuleStyles( 'skins.modern-skylight.css' );
if ($out->getTitle()->isMainPage()) {
$out->addModuleStyles( 'skins.modern-skylight.mainpage.css' );
}
switch ($out->getTitle()->getNamespace()) {
case NS_CATEGORY:
$out->addModuleStyles( 'skins.modern-skylight.catpage.css' );
break;
}
}
}