Skip to content

Commit

Permalink
Add "os" as browser default
Browse files Browse the repository at this point in the history
  • Loading branch information
bembelimen committed Dec 12, 2023
1 parent d12cf13 commit 954b6cd
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions administrator/templates/atum/component.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
$this->addHeadLink(HTMLHelper::_('image', 'favicon.ico', '', [], true, 1), 'alternate icon', 'rel', ['type' => 'image/vnd.microsoft.icon']);
$this->addHeadLink(HTMLHelper::_('image', 'joomla-favicon-pinned.svg', '', [], true, 1), 'mask-icon', 'rel', ['color' => '#000']);

$darkMode = $app->getIdentity()->getParam('colorScheme', $this->params->get('colorScheme', 0));
$darkMode = $app->getIdentity()->getParam('colorScheme', $this->params->get('colorScheme', 'os'));
$lastMode = !$darkMode ? $app->getInput()->cookie->get('atumColorScheme', '') : false;
$themeModes = [0 => ' data-color-scheme-os', 'light' => ' data-bs-theme="light" data-color-scheme="light"', 'dark' => ' data-bs-theme="dark" data-color-scheme="dark"'];
$themeModes = ['os' => ' data-color-scheme-os', 'light' => ' data-bs-theme="light" data-color-scheme="light"', 'dark' => ' data-bs-theme="dark" data-color-scheme="dark"'];
$themeModeAttr = ($themeModes[$darkMode] ?? '') . ($lastMode ? ($themeModes[$lastMode] ?? '') : '');
?>

Expand Down
4 changes: 2 additions & 2 deletions administrator/templates/atum/error_full.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@
$this->setMetaData('viewport', 'width=device-width, initial-scale=1');

$monochrome = (bool) $this->params->get('monochrome');
$darkMode = $app->getIdentity()->getParam('colorScheme', $this->params->get('colorScheme', 0));
$darkMode = $app->getIdentity()->getParam('colorScheme', $this->params->get('colorScheme', 'os'));
$lastMode = !$darkMode ? $app->getInput()->cookie->get('atumColorScheme', '') : false;
$themeModes = [0 => ' data-color-scheme-os', 'light' => ' data-bs-theme="light" data-color-scheme="light"', 'dark' => ' data-bs-theme="dark" data-color-scheme="dark"'];
$themeModes = ['os' => ' data-color-scheme-os', 'light' => ' data-bs-theme="light" data-color-scheme="light"', 'dark' => ' data-bs-theme="dark" data-color-scheme="dark"'];
$themeModeAttr = ($themeModes[$darkMode] ?? '') . ($lastMode ? ($themeModes[$lastMode] ?? '') : '');

// @see administrator/templates/atum/html/layouts/status.php
Expand Down
4 changes: 2 additions & 2 deletions administrator/templates/atum/error_login.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@
$this->setMetaData('viewport', 'width=device-width, initial-scale=1');

$monochrome = (bool) $this->params->get('monochrome');
$darkMode = $app->getIdentity()->getParam('colorScheme', $this->params->get('colorScheme', 0));
$darkMode = $app->getIdentity()->getParam('colorScheme', $this->params->get('colorScheme', 'os'));
$lastMode = !$darkMode ? $app->getInput()->cookie->get('atumColorScheme', '') : false;
$themeModes = [0 => ' data-color-scheme-os', 'light' => ' data-bs-theme="light" data-color-scheme="light"', 'dark' => ' data-bs-theme="dark" data-color-scheme="dark"'];
$themeModes = ['os' => ' data-color-scheme-os', 'light' => ' data-bs-theme="light" data-color-scheme="light"', 'dark' => ' data-bs-theme="dark" data-color-scheme="dark"'];
$themeModeAttr = ($themeModes[$darkMode] ?? '') . ($lastMode ? ($themeModes[$lastMode] ?? '') : '');

// @see administrator/templates/atum/html/layouts/status.php
Expand Down
4 changes: 2 additions & 2 deletions administrator/templates/atum/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@
$this->setMetaData('viewport', 'width=device-width, initial-scale=1');

$monochrome = (bool) $this->params->get('monochrome');
$darkMode = $app->getIdentity()->getParam('colorScheme', $this->params->get('colorScheme', 0));
$darkMode = $app->getIdentity()->getParam('colorScheme', $this->params->get('colorScheme', 'os'));
$lastMode = !$darkMode ? $app->getInput()->cookie->get('atumColorScheme', '') : false;
$themeModes = [0 => ' data-color-scheme-os', 'light' => ' data-bs-theme="light" data-color-scheme="light"', 'dark' => ' data-bs-theme="dark" data-color-scheme="dark"'];
$themeModes = ['os' => ' data-color-scheme-os', 'light' => ' data-bs-theme="light" data-color-scheme="light"', 'dark' => ' data-bs-theme="dark" data-color-scheme="dark"'];
$themeModeAttr = ($themeModes[$darkMode] ?? '') . ($lastMode ? ($themeModes[$lastMode] ?? '') : '');

Text::script('TPL_ATUM_MORE_ELEMENTS');
Expand Down
4 changes: 2 additions & 2 deletions administrator/templates/atum/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@
$this->setMetaData('viewport', 'width=device-width, initial-scale=1');

$monochrome = (bool) $this->params->get('monochrome');
$darkMode = $app->getIdentity()->getParam('colorScheme', $this->params->get('colorScheme', 0));
$darkMode = $app->getIdentity()->getParam('colorScheme', $this->params->get('colorScheme', 'os'));
$lastMode = !$darkMode ? $app->getInput()->cookie->get('atumColorScheme', '') : false;
$themeModes = [0 => ' data-color-scheme-os', 'light' => ' data-bs-theme="light" data-color-scheme="light"', 'dark' => ' data-bs-theme="dark" data-color-scheme="dark"'];
$themeModes = ['os' => ' data-color-scheme-os', 'light' => ' data-bs-theme="light" data-color-scheme="light"', 'dark' => ' data-bs-theme="dark" data-color-scheme="dark"'];
$themeModeAttr = ($themeModes[$darkMode] ?? '') . ($lastMode ? ($themeModes[$lastMode] ?? '') : '');

// Add cookie alert message
Expand Down
5 changes: 3 additions & 2 deletions administrator/templates/atum/templateDetails.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,10 @@
name="colorScheme"
type="list"
label="TPL_ATUM_COLORSCHEME_LABEL"
default="0"
default="os"
>
<option value="0">TPL_ATUM_COLORSCHEME_OPTION_FOLLOW_OS</option>
<option value="0">JDISABLED</option>
<option value="os">TPL_ATUM_COLORSCHEME_OPTION_FOLLOW_OS</option>
<option value="light">TPL_ATUM_COLORSCHEME_OPTION_LIGHT</option>
<option value="dark">TPL_ATUM_COLORSCHEME_OPTION_DARK</option>
</field>
Expand Down

0 comments on commit 954b6cd

Please sign in to comment.