- Connect
+ Chat Client
diff --git a/scripts/communications.js b/scripts/communications.js
index 490ac90..a1b0b93 100644
--- a/scripts/communications.js
+++ b/scripts/communications.js
@@ -272,6 +272,7 @@ function connect(profile, connection_id)
// Create a client
var client = new net.Socket();
+ g.client = client;
function rsa_task_send(data)
{
diff --git a/scripts/profiles.js b/scripts/profiles.js
index 2154961..b0367e8 100644
--- a/scripts/profiles.js
+++ b/scripts/profiles.js
@@ -87,6 +87,21 @@ function profile_connect(id)
}
}
+function port_display(i)
+{
+ // Should the port be displayed
+ var port_display = "";
+
+ // Is the port not the default port
+ if(profiles[i].port != PORT_DEFAULT)
+ {
+ // Set the port display varible
+ port_display = ":"+profiles[i].port.toString();
+ }
+
+ return port_display;
+}
+
function profile_switch_to(id)
{
// Set the active profile
@@ -117,14 +132,46 @@ function profile_switch_to(id)
// Set the html data
document.getElementById("chat-main").innerHTML = "\
\
";
+
+ // Set the title
+ document.title = profiles[id].username+"@"+profiles[id].hostname+port_display(id);
+}
+
+function add_chat_menu()
+{
+ // Set the html data
+ document.getElementById("chat-area").innerHTML = "\
+
\
+
\
+
Name
\
+
\
+ \
+ \
+ ";
+}
+
+function add_chat()
+{
+ // Send the data to the server
+ socket_write(
+ connections[active_profile].client,
+ connections[active_profile].encryption,
+ {
+ mode: "new_chat",
+ name: document.getElementById('add-chat-name').value
+ }
+ );
}
function profiles_reload()
@@ -144,19 +191,11 @@ function profiles_reload()
// Create a list item
var profile = document.createElement("li");
- // Should the port be displayed
- var port_display = "";
- // Is the port not the default port
- if(profiles[i].port != PORT_DEFAULT)
- {
- // Set the port display varible
- port_display = ":"+profiles[i].port.toString();
- }
// Set the html for the list item
profile.innerHTML = ""+profiles[i].username+"@"+profiles[i].hostname+port_display+"";
+ i+")'>"+profiles[i].username+"@"+profiles[i].hostname+port_display(i)+"";
// Add the profile to the menu
chat_menu.appendChild(profile);
@@ -167,6 +206,7 @@ function profiles_reload()
function switch_new_profile()
{
// Set the html
+ document.title = "New Profile";
document.getElementById("chat-main").innerHTML = "\