Alphabetically order default user settings, remove unnecessary continue statement, transform ifs into else-ifs

This commit is contained in:
Jérémie Astori 2016-08-17 01:46:26 -04:00
parent 34036a4b7a
commit c4cfd7e4b5

View file

@ -462,18 +462,18 @@ $(function() {
var userStyles = $("#user-specified-css");
var settings = $("#settings");
var options = $.extend({
desktopNotifications: false,
coloredNicks: true,
desktopNotifications: false,
join: true,
links: true,
mode: true,
motd: false,
nick: true,
notification: true,
part: true,
thumbnails: true,
quit: true,
notifyAllMessages: false,
part: true,
quit: true,
thumbnails: true,
userStyles: userStyles.text(),
}, JSON.parse(window.localStorage.getItem("settings")));
@ -483,7 +483,6 @@ $(function() {
$(document.head).find("#user-specified-css").html(options[i]);
}
settings.find("#user-specified-css-input").val(options[i]);
continue;
} else if (i === "highlights") {
settings.find("input[name=" + i + "]").val(options[i]);
} else if (options[i]) {
@ -515,14 +514,11 @@ $(function() {
"notifyAllMessages",
].indexOf(name) !== -1) {
chat.toggleClass("hide-" + name, !self.prop("checked"));
}
if (name === "coloredNicks") {
} else if (name === "coloredNicks") {
chat.toggleClass("colored-nicks", self.prop("checked"));
}
if (name === "userStyles") {
} else if (name === "userStyles") {
$(document.head).find("#user-specified-css").html(options[name]);
}
if (name === "highlights") {
} else if (name === "highlights") {
var highlightString = options[name];
highlights = highlightString.split(",").map(function(h) {
return h.trim();