From c4cfd7e4b56457e6feb35d24d40c752ff86fe1be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Astori?= Date: Wed, 17 Aug 2016 01:46:26 -0400 Subject: [PATCH] Alphabetically order default user settings, remove unnecessary continue statement, transform ifs into else-ifs --- client/js/lounge.js | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/client/js/lounge.js b/client/js/lounge.js index edcde75b..2b8b0ee6 100644 --- a/client/js/lounge.js +++ b/client/js/lounge.js @@ -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();