diff --git a/scripts/profiles.js b/scripts/profiles.js index 39ff1c4..f833711 100644 --- a/scripts/profiles.js +++ b/scripts/profiles.js @@ -142,6 +142,10 @@ function title(id) { function profile_switch_to(id) { + // Switch the profile classes + $("#profile_button_"+active_profile).removeClass("selected"); + $("#profile_button_"+id).addClass("selected"); + // Set the active profile active_profile = id; @@ -152,7 +156,7 @@ function profile_switch_to(id) for(var i=0;i" + chats_menu += "
  • " +connections[id].chats[i].name+"
  • "; } @@ -259,6 +263,10 @@ function chat_switch_to(id) document.title = title(active_profile)+" - " +connections[active_profile].chats[id].name; + // Move the active class + $("#chat_switch_"+active_chat).removeClass("selected"); + $("#chat_switch_"+id).addClass("selected"); + // Set the active chat active_chat = id; @@ -335,6 +343,9 @@ function chat_send() function add_chat_menu() { + // Deselect the selected chat + $("#chat_switch_"+active_chat).removeClass("selected"); + // Set the html data document.getElementById("chat-area").innerHTML = "\

    \ @@ -361,6 +372,8 @@ function add_chat() function profiles_reload() { + console.log("Profiles reloaded"); + // Get the chat menu id var chat_menu = document.getElementById("server-menu-profiles"); diff --git a/style.css b/style.css index 445d76b..dc8ca64 100644 --- a/style.css +++ b/style.css @@ -90,7 +90,7 @@ padding: 8px; margin: 4px; border-radius: 6px; - background-color: #CCD; + background-color: #BBC; } .chat-content-message p.message-header { @@ -117,3 +117,7 @@ #server-menu-profiles li a.disabled { background-color: #BBC; } + +.selected { + background-color: #AAB; +}