diff --git a/index.html b/index.html index afa424a..f7575e3 100644 --- a/index.html +++ b/index.html @@ -7,23 +7,19 @@ +
-
-
-

New Profile:

+

- - - - - -
Hostname
Port
Username
Password
- + Welcome to the chat client! Select a server, or create a new one.

diff --git a/scripts/profiles.js b/scripts/profiles.js index f3c79a6..10781d3 100644 --- a/scripts/profiles.js +++ b/scripts/profiles.js @@ -1,9 +1,8 @@ -// Create a profiles varible +// Setup some varibles var profiles; - -// Create a connections varible var connections = []; +var active_profile; // Load the profiles fs.readFile("profiles.json", "utf-8", function(err, data) @@ -32,6 +31,9 @@ fs.readFile("profiles.json", "utf-8", function(err, data) // Connect to the server profile_connect(i); } + + document.getElementById("chat-menu-profiles").style.bottom = + document.getElementById("chat-menu-config").style.height; }); function profile_save() @@ -71,13 +73,14 @@ function profile_connect(id) function profile_switch_to(id) { - + // Set the active profile + active_profile = id; } function profiles_reload() { // Get the chat menu id - var chat_menu = document.getElementById("chat-menu"); + var chat_menu = document.getElementById("chat-menu-profiles"); // Reset it chat_menu.innerHTML = ""; @@ -99,10 +102,27 @@ function profiles_reload() } // Set the html for the list item - profile.innerHTML = ""+profiles[i].username+"@"+profiles[i].hostname+port_display+""; // Add the profile to the menu chat_menu.appendChild(profile); } } + +function switch_new_profile() +{ + // Set the html + document.getElementById("chat-main").innerHTML = "\ +

New Profile:

\ +

\ + \ + \ + \ + \ + \ +
Hostname
Port
Username
Password
\ + \ +

\ + "; +} diff --git a/style.css b/style.css index e69de29..b91f233 100644 --- a/style.css +++ b/style.css @@ -0,0 +1,31 @@ +.chat-menu ul#chat-menu-profiles { + top: 0; + bottom: 56px; + overflow-y: auto; +} + +.chat-menu ul { + list-style-type: none; + margin: 0; + padding: 0; + background-color: #CCC; + width: 240px; + position: fixed; + left: 0; + bottom: 0; +} + +.chat-menu ul li a { + display: block; + padding: 20px; + text-decoration: none; + color: #000; +} + +.chat-menu ul li a:hover { + background-color: #AAA; +} + +.chat-main { + padding-left: 240px; +}