Skip to content

Commit

Permalink
Merge pull request #27896 from nextcloud/backport/27854/stable21
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusknorr authored Jul 13, 2021
2 parents 6b5bd9d + da127e5 commit 7e446c3
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/accessibility/js/accessibilityoca.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/accessibility/js/accessibilityoca.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions apps/accessibility/lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public function injectCss(IUserSession $userSession,
$hash = md5(implode('-', $userValues));
$linkToCSS = $urlGenerator->linkToRoute(self::APP_ID . '.accessibility.getCss', ['md5' => $hash]);
\OCP\Util::addHeader('link', ['rel' => 'stylesheet', 'media' => '(prefers-color-scheme: dark)', 'href' => $linkToCSS]);
\OCP\Util::addScript('accessibility', 'accessibilityoca');
}
}
}
1 change: 1 addition & 0 deletions apps/accessibility/lib/Service/JSDataService.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public function getData() {
}

return [
'checkMedia' => $user === null,
'theme' => $theme,
'highcontrast' => $highcontrast,
];
Expand Down
5 changes: 5 additions & 0 deletions apps/accessibility/src/accessibilityoca.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
import { loadState } from '@nextcloud/initial-state'

OCA.Accessibility = loadState('accessibility', 'data')
if (OCA.Accessibility.checkMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
// Overwrite the theme for Guests based on the prefers-color-scheme
OCA.Accessibility.theme = 'dark'
}

if (OCA.Accessibility.theme !== false) {
document.body.classList.add(`theme--${OCA.Accessibility.theme}`)
} else {
Expand Down
5 changes: 1 addition & 4 deletions core/templates/filepicker.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ <h2>{emptytext}</h2>
<span class="filename-parts__last">{filename2}</span>
</span>
</td>
<td class="filesize"
style="color:rgb({sizeColor}, {sizeColor}, {sizeColor})">
{size}
</td>
<td class="filesize">{size}</td>
<td class="date">{date}</td>
</tr>
</tbody>
Expand Down

0 comments on commit 7e446c3

Please sign in to comment.