mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Added full support for namechanging and removing the set name
This commit is contained in:
4
static/dist/main.min.js
vendored
4
static/dist/main.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,11 +1,25 @@
|
|||||||
var Chat = {
|
var Chat = {
|
||||||
|
|
||||||
|
namechange: function(newName)
|
||||||
|
{
|
||||||
|
socket.emit("namechange", newName);
|
||||||
|
Crypt.set_name(newName);
|
||||||
|
},
|
||||||
|
|
||||||
|
removename: function()
|
||||||
|
{
|
||||||
|
socket.emit("removename");
|
||||||
|
Crypt.remove_name();
|
||||||
|
},
|
||||||
|
|
||||||
chat: function(data)
|
chat: function(data)
|
||||||
{
|
{
|
||||||
if(data.value.length > 150)
|
if(data.value.length > 150)
|
||||||
return;
|
return;
|
||||||
if(data.value.startsWith("/name ")){
|
if(data.value.startsWith("/name ")){
|
||||||
socket.emit("namechange", data.value.substring(6));
|
Chat.namechange(data.value.substring(6));
|
||||||
|
}else if(data.value.startsWith("/removename")){
|
||||||
|
Chat.removename();
|
||||||
}
|
}
|
||||||
else if($(".tab a.active").attr("href") == "#all_chat")
|
else if($(".tab a.active").attr("href") == "#all_chat")
|
||||||
socket.emit("all,chat", data.value);
|
socket.emit("all,chat", data.value);
|
||||||
@@ -23,7 +37,8 @@ var Chat = {
|
|||||||
if($("#chat-bar").position()["left"] != 0)
|
if($("#chat-bar").position()["left"] != 0)
|
||||||
{
|
{
|
||||||
//$("#chat-btn").css("color", "grey");
|
//$("#chat-btn").css("color", "grey");
|
||||||
if(!blink_interval_exists)
|
|
||||||
|
if(!blink_interval_exists && inp.indexOf("changed name to") > -1)
|
||||||
{
|
{
|
||||||
$("#favicon").attr("href", "static/images/highlogo.png");
|
$("#favicon").attr("href", "static/images/highlogo.png");
|
||||||
blink_interval_exists = true;
|
blink_interval_exists = true;
|
||||||
@@ -51,7 +66,7 @@ var Chat = {
|
|||||||
{
|
{
|
||||||
if(data[1].indexOf(":") >= 0){
|
if(data[1].indexOf(":") >= 0){
|
||||||
//$("#chat-btn").css("color", "grey");
|
//$("#chat-btn").css("color", "grey");
|
||||||
if(!blink_interval_exists)
|
if(!blink_interval_exists && data.indexOf("changed name to") > -1)
|
||||||
{
|
{
|
||||||
$("#favicon").attr("href", "static/images/highlogo.png");
|
$("#favicon").attr("href", "static/images/highlogo.png");
|
||||||
blink_interval_exists = true;
|
blink_interval_exists = true;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ var Crypt = {
|
|||||||
}
|
}
|
||||||
Hostcontroller.change_enabled(conf_arr.remote);
|
Hostcontroller.change_enabled(conf_arr.remote);
|
||||||
if(conf_arr["width"] != 100) Player.set_width(conf_arr["width"]);
|
if(conf_arr["width"] != 100) Player.set_width(conf_arr["width"]);
|
||||||
|
if(conf_arr["name"] != undefined && conf_arr["name"] != "") Chat.namechange(conf_arr["name"]);
|
||||||
},
|
},
|
||||||
|
|
||||||
decrypt: function(cookie, name){
|
decrypt: function(cookie, name){
|
||||||
@@ -88,7 +89,7 @@ var Crypt = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
create_cookie: function(name){
|
create_cookie: function(name){
|
||||||
if(name == "_opt") cookie_object = {volume: 100, width: 100, remote: true};
|
if(name == "_opt") cookie_object = {volume: 100, width: 100, remote: true, name: ""};
|
||||||
else cookie_object = {passwords: {}};
|
else cookie_object = {passwords: {}};
|
||||||
|
|
||||||
var string_it = JSON.stringify(cookie_object);
|
var string_it = JSON.stringify(cookie_object);
|
||||||
@@ -121,6 +122,16 @@ var Crypt = {
|
|||||||
Crypt.encrypt(conf_pass, chan.toLowerCase());
|
Crypt.encrypt(conf_pass, chan.toLowerCase());
|
||||||
},
|
},
|
||||||
|
|
||||||
|
set_name:function(name){
|
||||||
|
conf_arr.name = name;
|
||||||
|
Crypt.encrypt(conf_arr, "_opt");
|
||||||
|
},
|
||||||
|
|
||||||
|
remove_name:function(){
|
||||||
|
conf_arr.name = "";
|
||||||
|
Crypt.encrypt(conf_arr, "_opt");
|
||||||
|
},
|
||||||
|
|
||||||
get_pass: function(chan){
|
get_pass: function(chan){
|
||||||
return conf_pass.passwords[chan];
|
return conf_pass.passwords[chan];
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user