mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-11-24 22:35:45 +00:00
ci: lint code to MediaWiki standards
Check commit and GitHub actions for more details
This commit is contained in:
parent
68d8621220
commit
90e1826134
|
@ -208,9 +208,9 @@ class CitizenHooks {
|
|||
* @return bool|void True or no return value to continue or false to abort
|
||||
*/
|
||||
public static function onPreferencesFormPreSave( $formData, $form, $user, &$result, $oldUserOptions ) {
|
||||
if (isset($formData['CitizenThemeUser']) && $formData['CitizenThemeUser'] !== 'auto') {
|
||||
if ( isset( $formData['CitizenThemeUser'] ) && $formData['CitizenThemeUser'] !== 'auto' ) {
|
||||
// Reset override cookie from theme toggle
|
||||
$form->getOutput()->getRequest()->response()->setCookie('skin-citizen-theme-override', null);
|
||||
$form->getOutput()->getRequest()->response()->setCookie( 'skin-citizen-theme-override', null );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -775,15 +775,15 @@ class SkinCitizen extends SkinMustache {
|
|||
|
||||
// Add HTML class based on theme set
|
||||
$out->addHtmlClasses( 'skin-citizen-' . $theme );
|
||||
if ($this->getRequest()->getCookie('skin-citizen-theme-override') === null) {
|
||||
if ( $this->getRequest()->getCookie( 'skin-citizen-theme-override' ) === null ) {
|
||||
// Only set the theme cookie if the theme wasn't overridden by the user through the button
|
||||
$this->getRequest()->response()->setCookie('skin-citizen-theme', $theme, 0, [
|
||||
$this->getRequest()->response()->setCookie( 'skin-citizen-theme', $theme, 0, [
|
||||
'httpOnly' => false,
|
||||
]);
|
||||
] );
|
||||
}
|
||||
|
||||
// Script content at 'skins.citizen.scripts.theme-switcher/inline.js
|
||||
$this->getOutput()->addHeadItem('theme-switcher', '<script>(()=>{try{const t=document.cookie.match(/skin-citizen-theme=(dark|light|auto)/),e=null!==t?t.pop():null;null!==e&&(document.documentElement.classList.remove(...["auto","dark","light"].map(t=>"skin-citizen-"+t)),document.documentElement.classList.add("skin-citizen-"+e))}catch(t){}})();</script>');
|
||||
$this->getOutput()->addModules('skins.citizen.scripts.theme-switcher');
|
||||
$this->getOutput()->addHeadItem( 'theme-switcher', '<script>(()=>{try{const t=document.cookie.match(/skin-citizen-theme=(dark|light|auto)/),e=null!==t?t.pop():null;null!==e&&(document.documentElement.classList.remove(...["auto","dark","light"].map(t=>"skin-citizen-"+t)),document.documentElement.classList.add("skin-citizen-"+e))}catch(t){}})();</script>' );
|
||||
$this->getOutput()->addModules( 'skins.citizen.scripts.theme-switcher' );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
.mw-theme-toggle {
|
||||
background-color: transparent;
|
||||
border: 0;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
font-size: 0;
|
||||
opacity: 0.4;
|
||||
width: 39px;
|
||||
height: 56px;
|
||||
border: 0;
|
||||
background-color: transparent;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
font-size: 0;
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
.skin-citizen-dark {
|
||||
.mw-theme-toggle {
|
||||
filter: invert(1);
|
||||
filter: invert( 1 );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue