Skip to content

Commit b80b6ed

Browse files
authored
Merge pull request #2022 from BookStackApp/dark-mode
Addition of a user-selectable dark-mode option
2 parents 627720c + 50669e3 commit b80b6ed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+5501
-136
lines changed

app/Http/Controllers/UserController.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,16 @@ public function changeSort(Request $request, string $id, string $type)
312312
return $this->changeListSort($id, $request, $type);
313313
}
314314

315+
/**
316+
* Toggle dark mode for the current user.
317+
*/
318+
public function toggleDarkMode()
319+
{
320+
$enabled = setting()->getForCurrentUser('dark-mode-enabled', false);
321+
setting()->putUser(user(), 'dark-mode-enabled', $enabled ? 'false' : 'true');
322+
return redirect()->back();
323+
}
324+
315325
/**
316326
* Update the stored section expansion preference for the given user.
317327
*/

app/Http/Kernel.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class Kernel extends HttpKernel
2626
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
2727
\Illuminate\Session\Middleware\StartSession::class,
2828
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
29-
\Illuminate\Routing\Middleware\ThrottleRequests::class,
3029
\BookStack\Http\Middleware\VerifyCsrfToken::class,
3130
\BookStack\Http\Middleware\Localization::class,
3231
\BookStack\Http\Middleware\GlobalViewData::class,

public/libs/tinymce/plugins/help/plugin.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/libs/tinymce/plugins/image/plugin.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/libs/tinymce/plugins/imagetools/plugin.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/libs/tinymce/plugins/lists/plugin.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/libs/tinymce/plugins/paste/plugin.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/libs/tinymce/plugins/print/plugin.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/libs/tinymce/plugins/table/plugin.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/libs/tinymce/plugins/textpattern/plugin.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)