diff options
author | Marvin Borner | 2019-05-13 20:40:46 +0200 |
---|---|---|
committer | Marvin Borner | 2019-05-13 20:40:46 +0200 |
commit | 59b910056f2e171d60ef635d6bca7308b3c617d2 (patch) | |
tree | 40dacf8a63c4f42df944073a9d918da2d57250e3 /src/main/resources/views/fileview.rocker.html | |
parent | 5f484e57f1a2361441e725e643905b1d20ac45ad (diff) |
Improved dark mode in editor/fileview
Co-authored-by: LarsVomMars <lars@kroenner.eu>
Diffstat (limited to 'src/main/resources/views/fileview.rocker.html')
-rw-r--r-- | src/main/resources/views/fileview.rocker.html | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/resources/views/fileview.rocker.html b/src/main/resources/views/fileview.rocker.html index b3f8341..30e0caf 100644 --- a/src/main/resources/views/fileview.rocker.html +++ b/src/main/resources/views/fileview.rocker.html @@ -1,9 +1,17 @@ +@import space.anity.DatabaseController +@import space.anity.UserHandler @import io.javalin.* @args (String content, String filename, String extension, Context ctx) @css => { <link href="/css/fileview.css" rel="stylesheet"> <link href="/css/markdown.css" rel="stylesheet"> + +@if((new DatabaseController()).isDarkTheme((new UserHandler()).getVerifiedUserId(ctx))) { +<link href="/css/darkTheme.css" rel="stylesheet"/> +} else { +<link href="/css/lightTheme.css" rel="stylesheet"/> +} } @js => { @@ -14,10 +22,9 @@ } @layout.template("File " + filename, ctx, css, js) -> { -<button class="switch" id="raw">Show raw</button> +<button class="switch" id="raw">Show preview</button> <span class="settings" id="settings"> <label for="code">Linecount</label><input id="code" type="checkbox"> - <label for="dark">Dark mode</label><input id="dark" type="checkbox"> </span> <pre class="prettyprint" id="content"><code class="lang-@extension">@content</code></pre> <textarea class="modify" id="modify"></textarea> |