mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 21:43:21 +00:00
settings: Add automatic theme detection feature.
With this implementation of the feature of the automatic theme detection, we make the following changes in the backend, frontend and documentation. This replaces the previous night_mode boolean with an enum, with the default value being to use the prefers-color-scheme feature of the operating system to determine which theme to use. Fixes: #14451. Co-authored-by: @kPerikou <44238834+kPerikou@users.noreply.github.com>
This commit is contained in:
@@ -29,6 +29,8 @@ exports.set_up = function () {
|
||||
|
||||
$("#demote_inactive_streams").val(page_params.demote_inactive_streams);
|
||||
|
||||
$("#color_scheme").val(page_params.color_scheme);
|
||||
|
||||
$("#twenty_four_hour_time").val(JSON.stringify(page_params.twenty_four_hour_time));
|
||||
|
||||
$(".emojiset_choice[value=" + page_params.emojiset + "]").prop("checked", true);
|
||||
@@ -82,6 +84,11 @@ exports.set_up = function () {
|
||||
change_display_setting(data, '#display-settings-status');
|
||||
});
|
||||
|
||||
$('#color_scheme').change(function () {
|
||||
const data = {color_scheme: this.value};
|
||||
change_display_setting(data, '#display-settings-status');
|
||||
});
|
||||
|
||||
$('body').on('click', '.reload_link', function () {
|
||||
window.location.reload();
|
||||
});
|
||||
@@ -146,8 +153,8 @@ exports.update_page = function () {
|
||||
$("#left_side_userlist").prop('checked', page_params.left_side_userlist);
|
||||
$("#default_language_name").text(page_params.default_language_name);
|
||||
$("#translate_emoticons").prop('checked', page_params.translate_emoticons);
|
||||
$("#night_mode").prop('checked', page_params.night_mode);
|
||||
$("#twenty_four_hour_time").val(JSON.stringify(page_params.twenty_four_hour_time));
|
||||
$("#color_scheme").val(JSON.stringify(page_params.color_scheme));
|
||||
|
||||
// TODO: Set emojiset selector here.
|
||||
// Longer term, we'll want to automate this function
|
||||
|
||||
Reference in New Issue
Block a user