mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-11-28 08:10:45 +00:00
fix: fix incorrect files from rebased PR (#203)
* refactor: Fix switching theme * ci: lint code to MediaWiki standards Check commit and GitHub actions for more details * refactor: Fix bad rebase * ci: lint code to MediaWiki standards Check commit and GitHub actions for more details Co-authored-by: github-actions <github-actions@users.noreply.github.com>
This commit is contained in:
parent
b4488f8ddb
commit
dde77d19dc
|
@ -784,16 +784,16 @@ class SkinCitizen extends SkinMustache {
|
|||
}
|
||||
|
||||
// Script content at 'skins.citizen.scripts.theme/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()->addHeadItem( 'theme-switcher', '<script>window.switchTheme=(()=>{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){}}),window.switchTheme();</script>' );
|
||||
|
||||
// Add styles and scripts module
|
||||
$options['scripts'] = array_merge(
|
||||
$options['scripts'],
|
||||
[ 'skins.citizen.scripts.theme' ]
|
||||
);
|
||||
if ( $theme === 'auto' ) {
|
||||
$options['scripts'] = array_merge(
|
||||
$options['scripts'],
|
||||
[ 'skins.citizen.scripts.theme' ]
|
||||
);
|
||||
}
|
||||
|
||||
$options['styles'] = array_merge(
|
||||
$options['styles'],
|
||||
[ 'skins.citizen.styles.theme' ]
|
||||
|
|
Loading…
Reference in a new issue