From e9b3fedb177d16daff373bc236ab6c801faa6472 Mon Sep 17 00:00:00 2001 From: mappu Date: Sun, 5 Feb 2017 16:03:43 +1300 Subject: [PATCH] save last username/pass for login --- client/dcwebui.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/client/dcwebui.js b/client/dcwebui.js index b3a7f91..2eb2276 100644 --- a/client/dcwebui.js +++ b/client/dcwebui.js @@ -258,6 +258,10 @@ var submit = function() { if (hub_state === 0) { hub_state = 1; + if (window.localStorage) { + localStorage["login"] = str; + } + var name_parts = str.split(":", 2); hub_last_nick = name_parts[0]; @@ -618,6 +622,13 @@ var show_joins = false; window.onload = function() { write("tab-main").system("Communicating with server..."); + if (window.localStorage) { + var saved_login = localStorage["login"]; + if (saved_login !== undefined) { + $("#chatbox").value = saved_login; + } + } + document.title = DCWEBUI_CONF.title; // HTML event handlers