Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
CSU
tweeki
Commits
742a57c3
Commit
742a57c3
authored
Nov 15, 2020
by
Tobias Haider
Browse files
replace deprecated setupSkinUserCss with BeforePageDisplay hook, fixes #170
parent
e8a07ec1
Changes
3
Hide whitespace changes
Inline
Side-by-side
includes/Hooks.php
View file @
742a57c3
...
...
@@ -51,6 +51,27 @@ class TweekiHooks {
return
true
;
}
/**
* Adding modules
*/
public
static
function
onBeforePageDisplay
(
OutputPage
$out
,
Skin
$skin
)
{
$styles
=
$GLOBALS
[
'wgTweekiSkinStyles'
];
if
(
$GLOBALS
[
'wgTweekiSkinUseAwesome'
]
===
true
)
{
$styles
[]
=
'skins.tweeki.awesome.styles'
;
}
if
(
$GLOBALS
[
'wgTweekiSkinUseBootstrapTheme'
]
===
true
)
{
$styles
[]
=
'skins.tweeki.bootstraptheme.styles'
;
}
if
(
isset
(
$GLOBALS
[
'wgCookieWarningEnabled'
]
)
&&
$GLOBALS
[
'wgCookieWarningEnabled'
]
===
true
)
{
$styles
[]
=
'skins.tweeki.cookiewarning.styles'
;
}
foreach
(
$GLOBALS
[
'wgTweekiSkinCustomCSS'
]
as
$customstyle
)
{
$styles
[]
=
$customstyle
;
}
Hooks
::
run
(
'SkinTweekiStyleModules'
,
array
(
$this
,
&
$styles
)
);
$out
->
addModuleStyles
(
$styles
);
}
/**
* Manipulate headlines – we need .mw-headline to be empty because it has a padding
* that we need for correct positioning for anchors and this would render links above headlines inaccessible
...
...
includes/SkinTweeki.php
View file @
742a57c3
...
...
@@ -63,30 +63,6 @@ class SkinTweeki extends SkinTemplate {
Hooks
::
run
(
'SkinTweekiAdditionalBodyClasses'
,
array
(
$this
,
&
$GLOBALS
[
'wgTweekiSkinAdditionalBodyClasses'
]
)
);
static
::
$bodyClasses
=
array_merge
(
static
::
$bodyClasses
,
$GLOBALS
[
'wgTweekiSkinAdditionalBodyClasses'
]
);
}
/**
* Loads skin and user CSS files.
* @param OutputPage $out
*/
function
setupSkinUserCss
(
OutputPage
$out
)
{
parent
::
setupSkinUserCss
(
$out
);
$styles
=
$GLOBALS
[
'wgTweekiSkinStyles'
];
if
(
$GLOBALS
[
'wgTweekiSkinUseAwesome'
]
===
true
)
{
$styles
[]
=
'skins.tweeki.awesome.styles'
;
}
if
(
$GLOBALS
[
'wgTweekiSkinUseBootstrapTheme'
]
===
true
)
{
$styles
[]
=
'skins.tweeki.bootstraptheme.styles'
;
}
if
(
isset
(
$GLOBALS
[
'wgCookieWarningEnabled'
]
)
&&
$GLOBALS
[
'wgCookieWarningEnabled'
]
===
true
)
{
$styles
[]
=
'skins.tweeki.cookiewarning.styles'
;
}
foreach
(
$GLOBALS
[
'wgTweekiSkinCustomCSS'
]
as
$customstyle
)
{
$styles
[]
=
$customstyle
;
}
Hooks
::
run
(
'SkinTweekiStyleModules'
,
array
(
$this
,
&
$styles
)
);
$out
->
addModuleStyles
(
$styles
);
}
/**
* Override to pass our Config instance to it
...
...
skin.json
View file @
742a57c3
...
...
@@ -38,7 +38,8 @@
"MagicWordMagicWords"
:
"TweekiHooks::onMagicWordMagicWords"
,
"MagicWordwgVariableIDs"
:
"TweekiHooks::onMagicWordwgVariableIDs"
,
"InternalParseBeforeLinks"
:
"TweekiHooks::onInternalParseBeforeLinks"
,
"OutputPageBeforeHTML"
:
"TweekiHooks::onOutputPageBeforeHTML"
"OutputPageBeforeHTML"
:
"TweekiHooks::onOutputPageBeforeHTML"
,
"BeforePageDisplay"
:
"TweekiHooks::onBeforePageDisplay"
},
"ResourceModules"
:
{
"skins.tweeki.bootstrap.styles"
:
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment