password box
This commit is contained in:
parent
11a25c1444
commit
8a9fb95c06
@ -64,8 +64,15 @@ body {
|
|||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
color: #2196f3;
|
color: #2196f3;
|
||||||
}
|
}
|
||||||
|
.ircclient .coverwindow .wrapper label.autosize {
|
||||||
|
width: auto;
|
||||||
|
display: inline-block !important;
|
||||||
|
font-size: 90% !important;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
.ircclient .coverwindow .wrapper input[type=text],
|
.ircclient .coverwindow .wrapper input[type=text],
|
||||||
.ircclient .coverwindow .wrapper input[type=number] {
|
.ircclient .coverwindow .wrapper input[type=number],
|
||||||
|
.ircclient .coverwindow .wrapper input[type=password] {
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
width: 300px;
|
width: 300px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
|
@ -25,14 +25,22 @@
|
|||||||
<form action="" id="IRCConnector">
|
<form action="" id="IRCConnector">
|
||||||
<label for="nickname">Nickname</label>
|
<label for="nickname">Nickname</label>
|
||||||
<input type="text" name="nickname" id="nickname" value="">
|
<input type="text" name="nickname" id="nickname" value="">
|
||||||
|
<label class="autosize" for="password_trig">I have a password</label>
|
||||||
|
<input type="checkbox" name="password_trig" id="password_trig">
|
||||||
|
<div class="password_box" style="display: none;">
|
||||||
|
<label for="password">Password</label>
|
||||||
|
<input type="password" name="password" id="password">
|
||||||
|
</div>
|
||||||
<label for="channel">Channel</label>
|
<label for="channel">Channel</label>
|
||||||
<input type="text" name="channel" id="channel" value="#diamond">
|
<input type="text" name="channel" id="channel" value="#diamond">
|
||||||
|
<div class="server_data">
|
||||||
<label for="server">Server</label>
|
<label for="server">Server</label>
|
||||||
<input type="text" name="server" id="server" value="irc.icynet.ml">
|
<input type="text" name="server" id="server" value="irc.icynet.ml">
|
||||||
<label for="port">Port</label>
|
<label for="port">Port</label>
|
||||||
<input type="number" name="port" id="port" value="6667">
|
<input type="number" name="port" id="port" value="6667">
|
||||||
<label for="secure">Secure connection</label>
|
<label for="secure">Secure connection</label>
|
||||||
Use SSL <input type="checkbox" name="secure" id="secure">
|
Use SSL <input type="checkbox" name="secure" id="secure">
|
||||||
|
</div>
|
||||||
<input type="submit" value="Connect">
|
<input type="submit" value="Connect">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -415,6 +415,10 @@ let commands = {
|
|||||||
irc.socket.emit("userinput", {command: "quit", server: buffer.server, message: listargs.slice(1).join(" "), arguments: []});
|
irc.socket.emit("userinput", {command: "quit", server: buffer.server, message: listargs.slice(1).join(" "), arguments: []});
|
||||||
}, description: "[<message>] - Quit the current server with message.", aliases: ['exit']},
|
}, description: "[<message>] - Quit the current server with message.", aliases: ['exit']},
|
||||||
|
|
||||||
|
mode: {execute: function(buffer, handler, command, message, listargs) {
|
||||||
|
irc.socket.emit("userinput", {command: "mode", server: buffer.server, message: listargs.slice(1).join(" "), arguments: []});
|
||||||
|
}, description: "[target] [mode] - Set/remove mode of target."},
|
||||||
|
|
||||||
msg: {execute: function(buffer, handler, command, message, listargs) {
|
msg: {execute: function(buffer, handler, command, message, listargs) {
|
||||||
if(!listargs[1] || !listargs[2])
|
if(!listargs[1] || !listargs[2])
|
||||||
return handler.commandError(buffer, listargs[0].toUpperCase()+': Missing parameters!');
|
return handler.commandError(buffer, listargs[0].toUpperCase()+': Missing parameters!');
|
||||||
@ -1060,6 +1064,10 @@ class IRCConnector {
|
|||||||
if(key === 27 && this.canClose)
|
if(key === 27 && this.canClose)
|
||||||
this.authComplete();
|
this.authComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clientdom.connector.pwtrigger.onclick = (e) => {
|
||||||
|
this.togglePassword();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fillFormFromURI() {
|
fillFormFromURI() {
|
||||||
@ -1113,6 +1121,7 @@ class IRCConnector {
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
let nickname = clientdom.connector.nickname.value;
|
let nickname = clientdom.connector.nickname.value;
|
||||||
|
let password = clientdom.connector.password.value;
|
||||||
let channel = clientdom.connector.channel.value;
|
let channel = clientdom.connector.channel.value;
|
||||||
let server = clientdom.connector.server.value;
|
let server = clientdom.connector.server.value;
|
||||||
let port = clientdom.connector.port.value;
|
let port = clientdom.connector.port.value;
|
||||||
@ -1161,11 +1170,14 @@ class IRCConnector {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!clientdom.connector.pwtrigger.checked)
|
||||||
|
password = "";
|
||||||
|
|
||||||
irc.socket.emit('irc_create', {nickname: nickname,
|
irc.socket.emit('irc_create', {nickname: nickname,
|
||||||
autojoin: channel,
|
autojoin: channel,
|
||||||
server: server,
|
server: server,
|
||||||
port: port,
|
port: port,
|
||||||
password: null,
|
password: password,
|
||||||
secure: clientdom.connector.secure.checked });
|
secure: clientdom.connector.secure.checked });
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1176,6 +1188,13 @@ class IRCConnector {
|
|||||||
this.formLocked = false;
|
this.formLocked = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
togglePassword() {
|
||||||
|
if(clientdom.connector.pwtrigger.checked)
|
||||||
|
clientdom.connector.pwbox.style.display = "block";
|
||||||
|
else
|
||||||
|
clientdom.connector.pwbox.style.display = "none";
|
||||||
|
}
|
||||||
|
|
||||||
authComplete() {
|
authComplete() {
|
||||||
clientdom.connector.frame.style.display = "none";
|
clientdom.connector.frame.style.display = "none";
|
||||||
this.formLocked = false;
|
this.formLocked = false;
|
||||||
@ -1217,7 +1236,7 @@ class InputHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
keyUpHandle(e, key) {
|
keyUpHandle(e, key) {
|
||||||
if(key == 38 || key == 40 || key == 8 || key == 9) return;
|
if(key == 38 || key == 40 || key == 9) return;
|
||||||
let input = clientdom.input.value;
|
let input = clientdom.input.value;
|
||||||
let word = input.split(/ |\n/).pop();
|
let word = input.split(/ |\n/).pop();
|
||||||
|
|
||||||
@ -1296,11 +1315,6 @@ class InputHandler {
|
|||||||
// Remember the word until next time.
|
// Remember the word until next time.
|
||||||
this.lastWord = word;
|
this.lastWord = word;
|
||||||
|
|
||||||
return;
|
|
||||||
} else if(key == 8) {
|
|
||||||
this.index = -1;
|
|
||||||
this.lastWord = "";
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1753,6 +1767,9 @@ window.onload = function() {
|
|||||||
clientdom.connector['messenger'] = clientdom.connector.frame.querySelector('#connmsg');
|
clientdom.connector['messenger'] = clientdom.connector.frame.querySelector('#connmsg');
|
||||||
clientdom.connector['form'] = clientdom.connector.frame.querySelector('#IRCConnector');
|
clientdom.connector['form'] = clientdom.connector.frame.querySelector('#IRCConnector');
|
||||||
clientdom.connector['nickname'] = clientdom.connector.form.querySelector('#nickname');
|
clientdom.connector['nickname'] = clientdom.connector.form.querySelector('#nickname');
|
||||||
|
clientdom.connector['password'] = clientdom.connector.form.querySelector('#password');
|
||||||
|
clientdom.connector['pwtrigger'] = clientdom.connector.form.querySelector('#password_trig');
|
||||||
|
clientdom.connector['pwbox'] = clientdom.connector.form.querySelector('.password_box');
|
||||||
clientdom.connector['channel'] = clientdom.connector.form.querySelector('#channel');
|
clientdom.connector['channel'] = clientdom.connector.form.querySelector('#channel');
|
||||||
clientdom.connector['server'] = clientdom.connector.form.querySelector('#server');
|
clientdom.connector['server'] = clientdom.connector.form.querySelector('#server');
|
||||||
clientdom.connector['port'] = clientdom.connector.form.querySelector('#port');
|
clientdom.connector['port'] = clientdom.connector.form.querySelector('#port');
|
||||||
|
@ -75,7 +75,12 @@ body
|
|||||||
font-size: 80%
|
font-size: 80%
|
||||||
margin-top: 5px
|
margin-top: 5px
|
||||||
color: #2196F3
|
color: #2196F3
|
||||||
input[type=text], input[type=number]
|
&.autosize
|
||||||
|
width: auto
|
||||||
|
display: inline-block !important
|
||||||
|
font-size: 90% !important
|
||||||
|
margin-bottom: 10px
|
||||||
|
input[type=text], input[type=number], input[type=password]
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
width: 300px;
|
width: 300px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
|
@ -220,6 +220,7 @@ class IRCConnectionHandler {
|
|||||||
case "042":
|
case "042":
|
||||||
this.conn.emit('pass_to_client', {type: "server_message", messageType: "regular", message: line.arguments[1] +" "+ line.trailing, server: serverName, from: realServerName});
|
this.conn.emit('pass_to_client', {type: "server_message", messageType: "regular", message: line.arguments[1] +" "+ line.trailing, server: serverName, from: realServerName});
|
||||||
break;
|
break;
|
||||||
|
case "501":
|
||||||
case "401":
|
case "401":
|
||||||
case "402":
|
case "402":
|
||||||
case "421":
|
case "421":
|
||||||
|
@ -54,7 +54,7 @@ io.sockets.on('connection', function (socket) {
|
|||||||
connections[socket.id] = {
|
connections[socket.id] = {
|
||||||
host: {
|
host: {
|
||||||
ipaddr: userip,
|
ipaddr: userip,
|
||||||
hostname: "localhost"
|
hostname: userip
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,9 +63,10 @@ io.sockets.on('connection', function (socket) {
|
|||||||
hostQuery.then((arr) => {
|
hostQuery.then((arr) => {
|
||||||
if(arr.length > 0)
|
if(arr.length > 0)
|
||||||
connections[socket.id].host.hostname = arr[0];
|
connections[socket.id].host.hostname = arr[0];
|
||||||
|
}).catch((err) => { console.log("Host resolve for "+socket.id+" failed: ", err); });
|
||||||
|
|
||||||
if(config.server.debug)
|
if(config.server.debug)
|
||||||
console.log("Hostname of "+socket.id+" was determined to be "+connections[socket.id].host.hostname);
|
console.log("Hostname of "+socket.id+" was determined to be "+connections[socket.id].host.hostname);
|
||||||
}).catch((err) => { console.log("Host resolve for "+socket.id+" failed: ", err); });
|
|
||||||
|
|
||||||
socket.on('disconnect', function() {
|
socket.on('disconnect', function() {
|
||||||
for (let d in connections[socket.id]) {
|
for (let d in connections[socket.id]) {
|
||||||
|
Reference in New Issue
Block a user