// ==UserScript==
// @name Extension for BeastMode chat
// @namespace bm_chat
// @version 1.1
// @description Extension for BeastMode chat
// @author bm_kronos
// @match https://beastmode.chatovod.com/*
// @match http://beastmode.chatovod.com/*
// @match https://*.beastmode.chatovod.com/*
// @match http://*.beastmode.chatovod.com/*
// @match https://beastmodeclan.tk/*
// @match http://beastmodeclan.tk/*
// @require http://code.jquery.com/jquery-2.2.4.js
// ==/UserScript==
(function() {
'use strict';
var css = [
"@namespace url(http://www.w3.org/1999/xhtml);",
".chatHeaderWrapper .goog-menu-button-hover {",
"background-color: #366092;",
"}",
".chatHeaderWrapper, .chatRooms ul li.active a, .chatRooms ul li.blink a, .chatRooms ul li:hover a,",
".chatRoomsButton a:hover, .closeIconWrapper > .closeIconColor, .chatWindow .header,",
".chatSendControlsWrapper div.buttonWrapper a.sendMessageButton, .chatSendControlsWrapper .buttons a.register,",
".nickIcon .filler {",
"background-color:#366092;",
"color: #ffffff;",
"}",
".chatRooms ul li a {",
"display:block;",
"text-decoration:none;",
"/*color:#000;*/",
"height:25px;",
"line-height:25px;",
"padding:0 8px;",
"background-color:#dfe8f3;",
"outline:0;",
"position:relative;",
"cursor: pointer;",
"}",
"a {",
"color:#366092;",
"text-decoration: none;",
"}",
".chatRoomsScrollBar > div.left > div {",
"left: 6px;",
"border-width: 5px 5px 5px 0;",
"border-color: transparent #4f81bd transparent transparent;",
"}",
".chatRoomsScrollBar > div.right > div {",
"right: 6px;",
"border-width: 5px 0 5px 5px;",
"border-color: transparent transparent transparent #4f81bd;",
"}",
].join("\n");
if (typeof GM_addStyle != "undefined") {
GM_addStyle(css);
} else if (typeof PRO_addStyle != "undefined") {
PRO_addStyle(css);
} else if (typeof addStyle != "undefined") {
addStyle(css);
} else {
var node = document.createElement("style");
node.type = "text/css";
node.appendChild(document.createTextNode(css));
var heads = document.getElementsByTagName("head");
if (heads.length > 0) {
heads[0].appendChild(node);
} else {
// no head yet, stick it whereever
document.documentElement.appendChild(node);
}
}
var bm_name = {
create: function (name){
name += '';
name = name.toLowerCase();
name = name[0].toUpperCase() + name.substr(1);
//name = name.replace(/[^A-Za-z0-9]/, '');
var chars = {
"a": "α", "A": "α",
"b": "в", "B": "β",
"c": "¢", "C": "₡",
"d": "d", "D": "Ꭰ",
"e": "є", "E": "E",
"f": "ƒ", "F": "F",
"g": "g", "G": "Ɠ",
"h": "н", "H": "ዠ",
"i": "ι", "I": "Ī",
"j": "נ", "J": "Ꮭ",
"k": "к", "K": "Ƙ",
"l": "ℓ", "L": "L",
"m": "м", "M": "M",
"n": "η", "N": "N",
"o": "σ", "O": "Ꭴ",
"p": "ρ", "P": "Ꭾ",
"q": "q", "Q": "Ҩ",
"r": "я", "R": "Ꮢ",
"s": "ѕ", "S": "S",
"t": "т", "T": "Ŧ",
"u": "υ", "U": "Ʊ",
"v": "ν", "V": "V",
"w": "ω", "W": "Ѡ",
"x": "χ", "X": "Ӿ",
"y": "у", "Y": "ꐯ",
"z": "z", "Z": "Ƶ"
};
for(var x in chars){
name = name.replace(new RegExp(x, 'g'), chars[x]);
}
return "๖ۣۜ"+name+"༻一βᗰ";
},
click: function(){
this.output.val(this.create(this.input.val()));
},
input: $("<input type='text' placeholder='Only letters a-z or A-Z or 0-9' />"),
output: $("<input type='text' placeholder='Your new name' readonly />"),
send: $("<button>Create name</button>"),
init: function(){
var ths = this;
$(this.send).click(function(){
ths.click();
});
var container = $(
"<div class='goog-menu-button menuItem goog-inline-block' id=' role='button' style='-webkit-user-select: none;'>"+
"<div class='goog-inline-block goog-menu-button-outer-box'>"+
"<div class='goog-inline-block goog-menu-button-inner-box'>"+
"<div class='goog-inline-block goog-menu-button-caption'>"+
"<span class='text' id='bm_name'>Create BM Name: </span>"+
"</div>"+
"</div>"+
"</div>"+
"</div>"
);
$(container).insertAfter("#chatMenu");
$(this.output).insertAfter("#bm_name");
$(this.send).insertAfter("#bm_name");
$(this.input).insertAfter("#bm_name");
}
};
bm_name.init();
})();