save last username/pass for login

This commit is contained in:
mappu 2017-02-05 16:03:43 +13:00
parent d0219cb16a
commit e9b3fedb17

View File

@ -258,6 +258,10 @@ var submit = function() {
if (hub_state === 0) { if (hub_state === 0) {
hub_state = 1; hub_state = 1;
if (window.localStorage) {
localStorage["login"] = str;
}
var name_parts = str.split(":", 2); var name_parts = str.split(":", 2);
hub_last_nick = name_parts[0]; hub_last_nick = name_parts[0];
@ -618,6 +622,13 @@ var show_joins = false;
window.onload = function() { window.onload = function() {
write("tab-main").system("Communicating with server..."); 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; document.title = DCWEBUI_CONF.title;
// HTML event handlers // HTML event handlers