From 45d7fd78d2951c1c28343c956c924bcf380e5075 Mon Sep 17 00:00:00 2001 From: jsrobson10 Date: Fri, 19 Apr 2019 11:31:20 +1000 Subject: [PATCH] Made child processes exit automatically --- proxy.js | 7 +++++++ rsa.js | 7 +++++++ scripts/communications.js | 13 +++++++++++++ scripts/profiles.js | 3 +-- style.css | 4 ++++ 5 files changed, 32 insertions(+), 2 deletions(-) diff --git a/proxy.js b/proxy.js index ddcdcde..18d9aa2 100644 --- a/proxy.js +++ b/proxy.js @@ -45,3 +45,10 @@ process.on('message', function(data) proxy.write(Buffer(data)); } }); + +// Has the parent been killed +process.on('disconnect', function() +{ + // Exit + process.exit(); +}); diff --git a/rsa.js b/rsa.js index ed0892e..4ee6959 100644 --- a/rsa.js +++ b/rsa.js @@ -109,3 +109,10 @@ process.on('message', function(message) process.exit(); }*/ }); + +// Has the parent been killed +process.on('disconnect', function() +{ + // Exit + process.exit(); +}); diff --git a/scripts/communications.js b/scripts/communications.js index a8ce9ee..dacb6f7 100644 --- a/scripts/communications.js +++ b/scripts/communications.js @@ -499,6 +499,19 @@ function connect(profile, connection_id) g.users = data.users; g.chats = data.chats; + // Remove the disabled class + $("#profile_button_"+connection_id).removeClass("disabled"); + + // Set onclick + $("#profile_button_"+connection_id).on("click", function() + { + // Switch to the profile id + profile_switch_to(connection_id); + }); + + // Set the href + document.getElementById("profile_button_"+connection_id).href = "#"; + // Switch to this chat profile_switch_to(connection_id); } diff --git a/scripts/profiles.js b/scripts/profiles.js index ae945c1..875fc98 100644 --- a/scripts/profiles.js +++ b/scripts/profiles.js @@ -361,8 +361,7 @@ function profiles_reload() var profile = document.createElement("li"); // Set the html for the list item - profile.innerHTML = ""+title(i)+""; + profile.innerHTML = ""+title(i)+""; // Add the profile to the menu chat_menu.appendChild(profile); diff --git a/style.css b/style.css index e9724a2..445d76b 100644 --- a/style.css +++ b/style.css @@ -113,3 +113,7 @@ position: fixed; visibility: hidden; } + +#server-menu-profiles li a.disabled { + background-color: #BBC; +}