2019-01-31 17:06:48 +01:00
//META{"name":"EditUsers","website":"https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/EditUsers","source":"https://raw.githubusercontent.com/mwittrien/BetterDiscordAddons/master/Plugins/EditUsers/EditUsers.plugin.js"}*//
2018-10-11 10:21:26 +02:00
2019-07-21 16:27:11 +02:00
class EditUsers {
2019-01-09 12:18:37 +01:00
getName ( ) { return "EditUsers" ; }
2019-09-07 09:21:39 +02:00
getVersion ( ) { return "3.5.4" ; }
2019-01-09 12:18:37 +01:00
getAuthor ( ) { return "DevilBro" ; }
2019-01-17 23:48:29 +01:00
getDescription ( ) { return "Allows you to change the icon, name, tag and color of users." ; }
2019-01-26 22:45:19 +01:00
2019-09-04 12:34:02 +02:00
constructor ( ) {
2019-02-07 22:54:50 +01:00
this . changelog = {
2019-09-07 09:21:39 +02:00
"fixed" : [ [ "BotTags" , "No longer forces bottag color to be the same as the role color unless BetterRoleColors is enabled and the bottag option in BRC is enabled" ] ]
2019-02-07 22:54:50 +01:00
} ;
2019-09-04 12:34:02 +02:00
this . labels = { } ;
2019-01-26 22:45:19 +01:00
2018-12-27 08:47:43 +01:00
this . patchModules = {
2018-12-23 10:46:07 +01:00
"ChannelTextArea" : "componentDidMount" ,
2019-08-19 11:17:57 +02:00
"MemberListItem" : [ "componentDidMount" , "componentDidUpdate" ] ,
2019-07-21 16:27:11 +02:00
"UserPopout" : [ "componentDidMount" , "componentDidUpdate" ] ,
"UserProfile" : [ "componentDidMount" , "componentDidUpdate" ] ,
2019-07-18 12:53:00 +02:00
"FriendRow" : "componentDidMount" ,
2019-08-29 10:44:05 +02:00
"VoiceUser" : [ "componentDidMount" , "componentDidUpdate" ] ,
2019-06-19 20:29:33 +02:00
"Account" : [ "componentDidMount" , "componentDidUpdate" ] ,
2018-12-22 23:41:25 +01:00
"AuditLog" : "componentDidMount" ,
2019-02-07 22:54:50 +01:00
"BannedCard" : "componentDidMount" ,
"InviteCard" : "componentDidMount" ,
"MemberCard" : "componentDidMount" ,
2019-03-28 13:56:12 +01:00
"InvitationCard" : "componentDidMount" ,
2019-02-03 22:11:35 +01:00
"TypingUsers" : "componentDidUpdate" ,
2019-07-22 12:01:05 +02:00
"MessageUsername" : [ "componentDidMount" , "componentDidUpdate" ] ,
2018-12-23 10:46:07 +01:00
"DirectMessage" : "componentDidMount" ,
"CallAvatar" : "componentDidMount" ,
2019-02-19 20:43:46 +01:00
"VideoTile" : "componentDidMount" ,
2019-02-19 12:09:01 +01:00
"PictureInPictureVideo" : "componentDidMount" ,
2019-01-12 15:07:06 +01:00
"PrivateChannel" : [ "componentDidMount" , "componentDidUpdate" ] ,
2018-12-25 16:52:37 +01:00
"HeaderBar" : [ "componentDidMount" , "componentDidUpdate" ] ,
2019-04-29 09:11:09 +02:00
"HeaderBarContainer" : [ "componentDidMount" , "componentDidUpdate" ] ,
2018-12-30 09:50:26 +01:00
"Clickable" : "componentDidMount" ,
2019-01-01 20:41:27 +01:00
"MessageContent" : [ "componentDidMount" , "componentDidUpdate" ] ,
"StandardSidebarView" : "componentWillUnmount"
2018-12-22 23:41:25 +01:00
} ;
2019-09-04 12:34:02 +02:00
}
2019-01-26 22:45:19 +01:00
2019-09-04 12:34:02 +02:00
initConstructor ( ) {
2019-07-20 10:56:48 +02:00
this . avatarselector = BDFDB . dotCNC . guildicon + BDFDB . dotCNC . avatar + BDFDB . dotCNC . callavatarwrapper + BDFDB . dotCN . voiceavatarcontainer ;
2018-10-11 10:21:26 +02:00
this . css = `
2019-06-03 21:24:55 +02:00
$ { BDFDB . dotCN . bottag } {
2019-06-07 11:46:51 +02:00
line - height : 13 px ;
2019-06-03 21:24:55 +02:00
height : 13 px ;
2019-06-07 11:39:54 +02:00
top : unset ;
bottom : 0 px ;
2019-06-03 21:24:55 +02:00
position : relative ;
margin : 0 0 0 1 ch ;
2018-12-22 23:41:25 +01:00
}
2019-07-11 23:03:36 +02:00
$ { BDFDB . dotCN . userpopoutheaderbottagwithnickname } {
2019-06-07 11:39:54 +02:00
bottom : 4 px ;
}
2019-08-06 20:53:56 +02:00
$ { BDFDB . dotCN . userpopoutheaderbottagwithnickname } {
2019-06-07 11:46:51 +02:00
bottom : 0 px ;
}
2019-08-06 20:53:56 +02:00
$ { BDFDB . dotCNS . userpopoutheadernamewrapper + BDFDB . dotCN . bottag } ,
$ { BDFDB . dotCN . userprofilebottag } ,
2019-07-28 15:55:42 +02:00
$ { BDFDB . dotCN . bottagmessagecozy } {
bottom : 2 px ;
}
2019-06-07 11:39:54 +02:00
$ { BDFDB . dotCN . bottagmessagecompact } {
2018-12-22 23:41:25 +01:00
margin - right : 6 px ;
2019-06-07 11:39:54 +02:00
bottom : 3 px ;
2018-10-11 10:21:26 +02:00
} ` ;
this . userContextEntryMarkup =
` <div class=" ${ BDFDB . disCN . contextmenuitemgroup } ">
2019-09-07 09:21:39 +02:00
< div class = "${BDFDB.disCN.contextmenuitemsubmenu} localusersettings-item" >
< div class = "${BDFDB.disCN.contextmenulabel} BDFDB-textscrollwrapper" speed = 3 > < div class = "BDFDB-textscroll" > REPLACE _context _localusersettings _text < / d i v > < / d i v >
< svg class = "${BDFDB.disCN.contextmenuitemsubmenucaret}" width = "24" height = "24" viewBox = "0 0 24 24" > < path fill = "currentColor" fill - rule = "evenodd" clip - rule = "evenodd" d = "M16.59 8.59004L12 13.17L7.41 8.59004L6 10L12 16L18 10L16.59 8.59004Z" > < / p a t h > < / s v g >
2018-10-11 10:21:26 +02:00
< / d i v >
< / d i v > ` ;
2019-01-26 22:45:19 +01:00
2018-10-11 10:21:26 +02:00
this . userContextSubMenuMarkup =
` <div class=" ${ BDFDB . disCN . contextmenu } editusers-submenu">
< div class = "${BDFDB.disCN.contextmenuitemgroup}" >
2019-09-07 09:21:39 +02:00
< div class = "${BDFDB.disCNS.contextmenuitem + BDFDB.disCN.contextmenuitemclickable} usersettings-item" >
< div class = "${BDFDB.disCN.contextmenulabel} BDFDB-textscrollwrapper" speed = 3 > < div class = "BDFDB-textscroll" > REPLACE _submenu _usersettings _text < / d i v > < / d i v >
2018-10-11 10:21:26 +02:00
< div class = "${BDFDB.disCN.contextmenuhint}" > < / d i v >
< / d i v >
2019-09-07 09:21:39 +02:00
< div class = "${BDFDB.disCNS.contextmenuitem + BDFDB.disCNS.contextmenuitemclickable + BDFDB.disCN.contextmenuitemdisabled} resetsettings-item" >
< div class = "${BDFDB.disCN.contextmenulabel} BDFDB-textscrollwrapper" speed = 3 > < div class = "BDFDB-textscroll" > REPLACE _submenu _resetsettings _text < / d i v > < / d i v >
2018-10-11 10:21:26 +02:00
< div class = "${BDFDB.disCN.contextmenuhint}" > < / d i v >
< / d i v >
< / d i v >
< / d i v > ` ;
2019-01-26 22:45:19 +01:00
2018-10-11 10:21:26 +02:00
this . userSettingsModalMarkup =
2019-04-18 09:28:20 +02:00
` <span class=" ${ this . name } -modal BDFDB-modal">
2018-10-11 10:21:26 +02:00
< div class = "${BDFDB.disCN.backdrop}" > < / d i v >
< div class = "${BDFDB.disCN.modal}" >
< div class = "${BDFDB.disCN.modalinner}" >
< div class = "${BDFDB.disCNS.modalsub + BDFDB.disCN.modalsizemedium}" >
2019-01-09 12:18:37 +01:00
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.modalheader}" style = "flex: 0 0 auto; padding-bottom: 10px;" >
2018-10-11 10:21:26 +02:00
< div class = "${BDFDB.disCN.flexchild}" style = "flex: 1 1 auto;" >
2019-09-07 09:21:39 +02:00
< h4 class = "${BDFDB.disCNS.h4 + BDFDB.disCNS.defaultcolor + BDFDB.disCN.h4defaultmargin}" > REPLACE _modal _header _text < / h 4 >
2018-10-11 10:21:26 +02:00
< div class = "${BDFDB.disCNS.modalguildname + BDFDB.disCNS.small + BDFDB.disCNS.size12 + BDFDB.disCNS.height16 + BDFDB.disCN.primary}" > < / d i v >
< / d i v >
2019-01-22 20:15:31 +01:00
< button type = "button" class = "${BDFDB.disCNS.modalclose + BDFDB.disCNS.flexchild + BDFDB.disCNS.button + BDFDB.disCNS.buttonlookblank + BDFDB.disCNS.buttoncolorbrand + BDFDB.disCN.buttongrow}" >
< div class = "${BDFDB.disCN.buttoncontents}" >
< svg name = "Close" width = "18" height = "18" viewBox = "0 0 12 12" style = "flex: 0 1 auto;" >
< g fill = "none" fill - rule = "evenodd" >
< path d = "M0 0h12v12H0" > < / p a t h >
< path class = "fill" fill = "currentColor" d = "M9.5 3.205L8.795 2.5 6 5.295 3.205 2.5l-.705.705L5.295 6 2.5 8.795l.705.705L6 6.705 8.795 9.5l.705-.705L6.705 6" > < / p a t h >
< / g >
< / s v g >
< / d i v >
< / b u t t o n >
2018-10-11 10:21:26 +02:00
< / d i v >
2019-01-09 12:18:37 +01:00
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCNS.marginbottom8 + BDFDB.disCN.tabbarcontainer}" style = "flex: 0 0 auto; padding-right: 12px;" >
< div class = "${BDFDB.disCNS.tabbar + BDFDB.disCN.tabbartop}" >
2019-04-23 08:26:48 +02:00
< div tab = "user" class = "${BDFDB.disCNS.settingsitem + BDFDB.disCN.tabbaritem}" > REPLACE _modal _tabheader1 _text < / d i v >
< div tab = "name" class = "${BDFDB.disCNS.settingsitem + BDFDB.disCN.tabbaritem}" > REPLACE _modal _tabheader2 _text < / d i v >
< div tab = "tag" class = "${BDFDB.disCNS.settingsitem + BDFDB.disCN.tabbaritem}" > REPLACE _modal _tabheader3 _text < / d i v >
2019-01-09 12:18:37 +01:00
< / d i v >
2018-10-11 10:21:26 +02:00
< / d i v >
< div class = "${BDFDB.disCNS.scrollerwrap + BDFDB.disCNS.modalcontent + BDFDB.disCNS.scrollerthemed + BDFDB.disCN.themeghosthairline}" >
< div class = "${BDFDB.disCNS.scroller + BDFDB.disCN.modalsubinner}" >
< div tab = "user" class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.vertical + BDFDB.disCNS.directioncolumn + BDFDB.disCNS.justifystart + BDFDB.disCNS.alignstretch + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom20} tab-content" style = "flex: 1 1 auto;" >
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8}" style = "flex: 1 1 auto;" >
< h3 class = "${BDFDB.disCNS.titledefault + BDFDB.disCNS.title + BDFDB.disCNS.marginreset + BDFDB.disCNS.weightmedium + BDFDB.disCNS.size16 + BDFDB.disCNS.height24 + BDFDB.disCN.flexchild}" style = "flex: 0 0 auto;" > REPLACE _modal _username _text < / h 3 >
< / d i v >
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8}" style = "flex: 1 1 auto;" >
< div class = "${BDFDB.disCNS.inputwrapper + BDFDB.disCNS.vertical + BDFDB.disCNS.flex + BDFDB.disCNS.directioncolumn + BDFDB.disCN.flexchild}" style = "flex: 1 1 auto;" > < input type = "text" class = "${BDFDB.disCNS.inputdefault + BDFDB.disCNS.input + BDFDB.disCN.size16}" id = "input-username" > < / d i v >
< / d i v >
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8}" style = "flex: 1 1 auto;" >
< h3 class = "${BDFDB.disCNS.titledefault + BDFDB.disCNS.title + BDFDB.disCNS.marginreset + BDFDB.disCNS.weightmedium + BDFDB.disCNS.size16 + BDFDB.disCNS.height24 + BDFDB.disCN.flexchild}" style = "flex: 0 0 auto;" > REPLACE _modal _usertag _text < / h 3 >
< / d i v >
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8}" style = "flex: 1 1 auto;" >
< div class = "${BDFDB.disCNS.inputwrapper + BDFDB.disCNS.vertical + BDFDB.disCNS.flex + BDFDB.disCNS.directioncolumn + BDFDB.disCN.flexchild}" style = "flex: 1 1 auto;" > < input type = "text" class = "${BDFDB.disCNS.inputdefault + BDFDB.disCNS.input + BDFDB.disCN.size16}" id = "input-usertag" > < / d i v >
< / d i v >
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8}" style = "flex: 1 1 auto;" >
< h3 class = "${BDFDB.disCNS.titledefault + BDFDB.disCNS.title + BDFDB.disCNS.marginreset + BDFDB.disCNS.weightmedium + BDFDB.disCNS.size16 + BDFDB.disCNS.height24 + BDFDB.disCN.flexchild}" style = "flex: 0 0 auto;" > REPLACE _modal _userurl _text < / h 3 >
< / d i v >
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8}" style = "flex: 1 1 auto;" >
< div class = "${BDFDB.disCNS.inputwrapper + BDFDB.disCNS.vertical + BDFDB.disCNS.flex + BDFDB.disCNS.directioncolumn + BDFDB.disCN.flexchild}" style = "flex: 1 1 auto;" > < input type = "text" class = "${BDFDB.disCNS.inputdefault + BDFDB.disCNS.input + BDFDB.disCN.size16}" id = "input-userurl" > < / d i v >
< / d i v >
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8}" style = "flex: 1 1 auto;" >
< h3 class = "${BDFDB.disCNS.titledefault + BDFDB.disCNS.title + BDFDB.disCNS.marginreset + BDFDB.disCNS.weightmedium + BDFDB.disCNS.size16 + BDFDB.disCNS.height24 + BDFDB.disCN.flexchild}" style = "flex: 1 1 auto;" > REPLACE _modal _removeicon _text < / h 3 >
< div class = "${BDFDB.disCNS.flexchild + BDFDB.disCNS.switchenabled + BDFDB.disCNS.switch + BDFDB.disCNS.switchvalue + BDFDB.disCNS.switchsizedefault + BDFDB.disCNS.switchsize + BDFDB.disCN.switchthemedefault}" style = "flex: 0 0 auto;" >
< input type = "checkbox" class = "${BDFDB.disCNS.switchinnerenabled + BDFDB.disCN.switchinner}" id = "input-removeicon" >
< / d i v >
< / d i v >
< / d i v >
< div tab = "name" class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.vertical + BDFDB.disCNS.directioncolumn + BDFDB.disCNS.justifystart + BDFDB.disCNS.alignstretch + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom20} tab-content" style = "flex: 1 1 auto;" >
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.vertical + BDFDB.disCNS.directioncolumn + BDFDB.disCNS.justifystart + BDFDB.disCNS.alignstart + BDFDB.disCN.nowrap}" style = "flex: 1 1 auto;" >
< h3 class = "${BDFDB.disCNS.titledefault + BDFDB.disCNS.title + BDFDB.disCNS.marginreset + BDFDB.disCNS.weightmedium + BDFDB.disCNS.size16 + BDFDB.disCNS.height24 + BDFDB.disCN.flexchild}" style = "flex: 0 0 auto;" > REPLACE _modal _colorpicker1 _text < / h 3 >
< / d i v >
2018-12-13 16:48:35 +01:00
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8} swatches" style = "flex: 1 1 auto;" > < / d i v >
2018-10-11 10:21:26 +02:00
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.vertical + BDFDB.disCNS.directioncolumn + BDFDB.disCNS.justifystart + BDFDB.disCNS.alignstart + BDFDB.disCN.nowrap}" style = "flex: 1 1 auto;" >
< h3 class = "${BDFDB.disCNS.titledefault + BDFDB.disCNS.title + BDFDB.disCNS.marginreset + BDFDB.disCNS.weightmedium + BDFDB.disCNS.size16 + BDFDB.disCNS.height24 + BDFDB.disCN.flexchild}" style = "flex: 0 0 auto;" > REPLACE _modal _colorpicker2 _text < / h 3 >
< / d i v >
2018-12-13 16:48:35 +01:00
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8} swatches" style = "flex: 1 1 auto;" > < / d i v >
2018-10-11 10:21:26 +02:00
< / d i v >
< div tab = "tag" class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.vertical + BDFDB.disCNS.directioncolumn + BDFDB.disCNS.justifystart + BDFDB.disCNS.alignstretch + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom20} tab-content" style = "flex: 1 1 auto;" >
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.vertical + BDFDB.disCNS.directioncolumn + BDFDB.disCNS.justifystart + BDFDB.disCNS.alignstart + BDFDB.disCN.nowrap}" style = "flex: 1 1 auto;" >
< h3 class = "${BDFDB.disCNS.titledefault + BDFDB.disCNS.title + BDFDB.disCNS.marginreset + BDFDB.disCNS.weightmedium + BDFDB.disCNS.size16 + BDFDB.disCNS.height24 + BDFDB.disCN.flexchild}" style = "flex: 0 0 auto;" > REPLACE _modal _colorpicker3 _text < / h 3 >
< / d i v >
2018-12-13 16:48:35 +01:00
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8} swatches" style = "flex: 1 1 auto;" > < / d i v >
2018-10-11 10:21:26 +02:00
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.vertical + BDFDB.disCNS.directioncolumn + BDFDB.disCNS.justifystart + BDFDB.disCNS.alignstart + BDFDB.disCN.nowrap}" style = "flex: 1 1 auto;" >
< h3 class = "${BDFDB.disCNS.titledefault + BDFDB.disCNS.title + BDFDB.disCNS.marginreset + BDFDB.disCNS.weightmedium + BDFDB.disCNS.size16 + BDFDB.disCNS.height24 + BDFDB.disCN.flexchild}" style = "flex: 0 0 auto;" > REPLACE _modal _colorpicker4 _text < / h 3 >
< / d i v >
2018-12-13 16:48:35 +01:00
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8} swatches" style = "flex: 1 1 auto;" > < / d i v >
2018-10-11 10:21:26 +02:00
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8}" style = "flex: 1 1 auto;" >
< h3 class = "${BDFDB.disCNS.titledefault + BDFDB.disCNS.title + BDFDB.disCNS.marginreset + BDFDB.disCNS.weightmedium + BDFDB.disCNS.size16 + BDFDB.disCNS.height24 + BDFDB.disCN.flexchild}" style = "flex: 1 1 auto;" > REPLACE _modal _ignoretagcolor _text < / h 3 >
< div class = "${BDFDB.disCNS.flexchild + BDFDB.disCNS.switchenabled + BDFDB.disCNS.switch + BDFDB.disCNS.switchvalue + BDFDB.disCNS.switchsizedefault + BDFDB.disCNS.switchsize + BDFDB.disCN.switchthemedefault}" style = "flex: 0 0 auto;" >
< input type = "checkbox" class = "${BDFDB.disCNS.switchinnerenabled + BDFDB.disCN.switchinner}" id = "input-ignoretagcolor" >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontalreverse + BDFDB.disCNS.horizontalreverse2 + BDFDB.disCNS.directionrowreverse + BDFDB.disCNS.justifystart + BDFDB.disCNS.alignstretch + BDFDB.disCNS.nowrap + BDFDB.disCN.modalfooter}" >
< button type = "button" class = "btn-save ${BDFDB.disCNS.button + BDFDB.disCNS.buttonlookfilled + BDFDB.disCNS.buttoncolorbrand + BDFDB.disCNS.buttonsizemedium + BDFDB.disCN.buttongrow}" >
< div class = "${BDFDB.disCN.buttoncontents}" > REPLACE _btn _save _text < / d i v >
< / b u t t o n >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
< / s p a n > ` ;
2019-01-26 22:45:19 +01:00
2019-01-01 20:41:27 +01:00
this . defaults = {
settings : {
changeInChatTextarea : { value : true , description : "Chat Textarea" } ,
changeInChatWindow : { value : true , description : "Messages" } ,
changeInMentions : { value : true , description : "Mentions" } ,
changeInVoiceChat : { value : true , description : "Voice Channels" } ,
changeInMemberList : { value : true , description : "Member List" } ,
changeInRecentDms : { value : true , description : "Direct Message Notifications" } ,
changeInDmsList : { value : true , description : "Direct Message List" } ,
changeInDmHeader : { value : true , description : "Direct Message Header" } ,
2019-02-19 20:43:46 +01:00
changeInDmCalls : { value : true , description : "Calls/ScreenShares" } ,
2019-01-01 20:41:27 +01:00
changeInTyping : { value : true , description : "Typing List" } ,
changeInFriendList : { value : true , description : "Friend List" } ,
2019-03-28 13:56:12 +01:00
changeInInviteList : { value : true , description : "Invite List" } ,
2019-01-01 20:41:27 +01:00
changeInActivity : { value : true , description : "Activity Page" } ,
changeInUserPopout : { value : true , description : "User Popouts" } ,
2019-01-09 13:05:51 +01:00
changeInUserProfil : { value : true , description : "User Profile Modal" } ,
2019-01-01 20:41:27 +01:00
changeInAutoComplete : { value : true , description : "Autocomplete Menu" } ,
changeInAuditLog : { value : true , description : "Audit Log" } ,
2019-02-07 22:54:50 +01:00
changeInMemberLog : { value : true , description : "Member Log" } ,
2019-01-01 20:41:27 +01:00
changeInSearchPopout : { value : true , description : "Search Popout" } ,
2019-03-27 19:18:10 +01:00
changeInUserAccount : { value : true , description : "Your Account Information" } ,
changeInAppTitle : { value : true , description : "Discord App Title (DMs)" }
2019-01-01 20:41:27 +01:00
}
} ;
2018-10-11 10:21:26 +02:00
}
2019-01-26 22:45:19 +01:00
2018-10-11 10:21:26 +02:00
getSettingsPanel ( ) {
2019-01-22 11:28:32 +01:00
if ( ! global . BDFDB || typeof BDFDB != "object" || ! BDFDB . loaded || ! this . started ) return ;
2019-09-04 12:34:02 +02:00
var settings = BDFDB . getAllData ( this , "settings" ) ;
2019-04-18 09:28:20 +02:00
var settingshtml = ` <div class=" ${ this . name } -settings BDFDB-settings"><div class=" ${ BDFDB . disCNS . titledefault + BDFDB . disCNS . title + BDFDB . disCNS . size18 + BDFDB . disCNS . height24 + BDFDB . disCNS . weightnormal + BDFDB . disCN . marginbottom8 } "> ${ this . name } </div><div class="BDFDB-settings-inner"> ` ;
settingshtml += ` <div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . flex2 + BDFDB . disCNS . horizontal + BDFDB . disCNS . horizontal2 + BDFDB . disCNS . directionrow + BDFDB . disCNS . justifystart + BDFDB . disCNS . aligncenter + BDFDB . disCNS . nowrap + BDFDB . disCN . marginbottom8 } " style="flex: 1 1 auto;"><h3 class=" ${ BDFDB . disCNS . titledefault + BDFDB . disCNS . title + BDFDB . disCNS . marginreset + BDFDB . disCNS . weightmedium + BDFDB . disCNS . size16 + BDFDB . disCNS . height24 + BDFDB . disCN . flexchild } " style="flex: 0 0 auto;">Change User in:</h3></div><div class="BDFDB-settings-inner-list"> ` ;
2019-01-01 20:41:27 +01:00
for ( let key in settings ) {
2019-01-12 15:07:06 +01:00
settingshtml += ` <div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . flex2 + BDFDB . disCNS . horizontal + BDFDB . disCNS . horizontal2 + BDFDB . disCNS . directionrow + BDFDB . disCNS . justifystart + BDFDB . disCNS . aligncenter + BDFDB . disCNS . nowrap + BDFDB . disCN . marginbottom8 } " style="flex: 1 1 auto;"><h3 class=" ${ BDFDB . disCNS . titledefault + BDFDB . disCNS . title + BDFDB . disCNS . marginreset + BDFDB . disCNS . weightmedium + BDFDB . disCNS . size16 + BDFDB . disCNS . height24 + BDFDB . disCN . flexchild } " style="flex: 1 1 auto;"> ${ this . defaults . settings [ key ] . description } </h3><div class=" ${ BDFDB . disCNS . flexchild + BDFDB . disCNS . switchenabled + BDFDB . disCNS . switch + BDFDB . disCNS . switchvalue + BDFDB . disCNS . switchsizedefault + BDFDB . disCNS . switchsize + BDFDB . disCN . switchthemedefault } " style="flex: 0 0 auto;"><input type="checkbox" value="settings ${ key } " class=" ${ BDFDB . disCNS . switchinnerenabled + BDFDB . disCN . switchinner } settings-switch" ${ settings [ key ] ? " checked" : "" } ></div></div> ` ;
2019-01-01 20:41:27 +01:00
}
settingshtml += ` </div> ` ;
2018-10-11 10:21:26 +02:00
settingshtml += ` <div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . flex2 + BDFDB . disCNS . horizontal + BDFDB . disCNS . horizontal2 + BDFDB . disCNS . directionrow + BDFDB . disCNS . justifystart + BDFDB . disCNS . aligncenter + BDFDB . disCNS . nowrap + BDFDB . disCN . marginbottom8 } " style="flex: 0 0 auto;"><h3 class=" ${ BDFDB . disCNS . titledefault + BDFDB . disCNS . title + BDFDB . disCNS . marginreset + BDFDB . disCNS . weightmedium + BDFDB . disCNS . size16 + BDFDB . disCNS . height24 + BDFDB . disCN . flexchild } " style="flex: 1 1 auto;">Reset all Users.</h3><button type="button" class=" ${ BDFDB . disCNS . flexchild + BDFDB . disCNS . button + BDFDB . disCNS . buttonlookfilled + BDFDB . disCNS . buttoncolorred + BDFDB . disCNS . buttonsizemedium + BDFDB . disCN . buttongrow } reset-button" style="flex: 0 0 auto;"><div class=" ${ BDFDB . disCN . buttoncontents } ">Reset</div></button></div> ` ;
settingshtml += ` </div></div> ` ;
2019-01-26 22:45:19 +01:00
2019-01-12 15:07:06 +01:00
let settingspanel = BDFDB . htmlToElement ( settingshtml ) ;
2018-10-11 10:21:26 +02:00
2019-01-15 10:04:23 +01:00
BDFDB . initElements ( settingspanel , this ) ;
2018-10-11 10:21:26 +02:00
2019-01-17 23:48:29 +01:00
BDFDB . addEventListener ( this , settingspanel , "click" , ".reset-button" , ( ) => {
BDFDB . openConfirmModal ( this , "Are you sure you want to reset all users?" , ( ) => {
BDFDB . removeAllData ( this , "users" ) ;
2019-03-27 19:18:10 +01:00
this . changeAppTitle ( ) ;
2019-01-17 23:48:29 +01:00
BDFDB . WebModules . forceAllUpdates ( this ) ;
2018-12-23 09:19:57 +01:00
} ) ;
2019-01-17 23:48:29 +01:00
} ) ;
2018-10-11 10:21:26 +02:00
return settingspanel ;
}
//legacy
load ( ) { }
start ( ) {
2019-02-04 09:13:15 +01:00
if ( ! global . BDFDB ) global . BDFDB = { myPlugins : { } } ;
if ( global . BDFDB && global . BDFDB . myPlugins && typeof global . BDFDB . myPlugins == "object" ) global . BDFDB . myPlugins [ this . getName ( ) ] = this ;
2019-05-26 13:55:26 +02:00
var libraryScript = document . querySelector ( 'head script#BDFDBLibraryScript' ) ;
if ( ! libraryScript || ( performance . now ( ) - libraryScript . getAttribute ( "date" ) ) > 600000 ) {
2018-10-11 10:21:26 +02:00
if ( libraryScript ) libraryScript . remove ( ) ;
libraryScript = document . createElement ( "script" ) ;
2019-05-26 13:55:26 +02:00
libraryScript . setAttribute ( "id" , "BDFDBLibraryScript" ) ;
2018-10-11 10:21:26 +02:00
libraryScript . setAttribute ( "type" , "text/javascript" ) ;
libraryScript . setAttribute ( "src" , "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js" ) ;
2019-01-17 23:48:29 +01:00
libraryScript . setAttribute ( "date" , performance . now ( ) ) ;
2019-05-26 13:55:26 +02:00
libraryScript . addEventListener ( "load" , ( ) => { this . initialize ( ) ; } ) ;
2018-10-11 10:21:26 +02:00
document . head . appendChild ( libraryScript ) ;
2019-05-26 13:55:26 +02:00
this . libLoadTimeout = setTimeout ( ( ) => {
libraryScript . remove ( ) ;
2019-09-07 09:21:39 +02:00
BDFDB . LibraryRequires . request ( "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js" , ( error , response , body ) => {
2019-05-26 13:55:26 +02:00
if ( body ) {
libraryScript = document . createElement ( "script" ) ;
libraryScript . setAttribute ( "id" , "BDFDBLibraryScript" ) ;
libraryScript . setAttribute ( "type" , "text/javascript" ) ;
libraryScript . setAttribute ( "date" , performance . now ( ) ) ;
libraryScript . innerText = body ;
document . head . appendChild ( libraryScript ) ;
}
this . initialize ( ) ;
} ) ;
} , 15000 ) ;
}
else if ( global . BDFDB && typeof BDFDB === "object" && BDFDB . loaded ) this . initialize ( ) ;
2018-10-11 10:21:26 +02:00
this . startTimeout = setTimeout ( ( ) => { this . initialize ( ) ; } , 30000 ) ;
}
initialize ( ) {
2019-01-17 23:48:29 +01:00
if ( global . BDFDB && typeof BDFDB === "object" && BDFDB . loaded ) {
2019-01-22 11:05:54 +01:00
if ( this . started ) return ;
2018-10-11 10:21:26 +02:00
BDFDB . loadMessage ( this ) ;
2019-01-26 22:45:19 +01:00
2019-03-27 19:18:10 +01:00
var observer = new MutationObserver ( ( ) => { this . changeAppTitle ( ) ; } ) ;
BDFDB . addObserver ( this , document . head . querySelector ( "title" ) , { name : "appTitleObserver" , instance : observer } , { childList : true } ) ;
this . changeAppTitle ( ) ;
2019-09-04 12:34:02 +02:00
2018-12-27 08:47:43 +01:00
BDFDB . WebModules . forceAllUpdates ( this ) ;
2018-10-11 10:21:26 +02:00
}
else {
2019-02-12 21:56:34 +01:00
console . error ( ` %c[ ${ this . getName ( ) } ]%c ` , 'color: #3a71c1; font-weight: 700;' , '' , 'Fatal Error: Could not load BD functions!' ) ;
2018-10-11 10:21:26 +02:00
}
}
stop ( ) {
2019-01-17 23:48:29 +01:00
if ( global . BDFDB && typeof BDFDB === "object" && BDFDB . loaded ) {
2018-12-22 23:41:25 +01:00
let data = BDFDB . loadAllData ( this , "users" ) ;
BDFDB . removeAllData ( this , "users" ) ;
2019-03-27 19:18:10 +01:00
try {
this . changeAppTitle ( ) ;
BDFDB . WebModules . forceAllUpdates ( this ) ;
} catch ( err ) { }
2018-12-22 23:41:25 +01:00
BDFDB . saveAllData ( data , this , "users" ) ;
2019-01-26 22:45:19 +01:00
2019-01-25 11:27:52 +01:00
BDFDB . removeEles ( ".autocompleteEditUsers" , ".autocompleteEditUsersRow" ) ;
2019-01-26 22:45:19 +01:00
2018-10-11 10:21:26 +02:00
BDFDB . unloadMessage ( this ) ;
}
}
2019-01-26 22:45:19 +01:00
2018-10-11 10:21:26 +02:00
// begin of own functions
changeLanguageStrings ( ) {
this . userContextEntryMarkup = this . userContextEntryMarkup . replace ( "REPLACE_context_localusersettings_text" , this . labels . context _localusersettings _text ) ;
2019-01-26 22:45:19 +01:00
2018-10-11 10:21:26 +02:00
this . userContextSubMenuMarkup = this . userContextSubMenuMarkup . replace ( "REPLACE_submenu_usersettings_text" , this . labels . submenu _usersettings _text ) ;
this . userContextSubMenuMarkup = this . userContextSubMenuMarkup . replace ( "REPLACE_submenu_resetsettings_text" , this . labels . submenu _resetsettings _text ) ;
2019-01-26 22:45:19 +01:00
2018-10-11 10:21:26 +02:00
this . userSettingsModalMarkup = this . userSettingsModalMarkup . replace ( "REPLACE_modal_header_text" , this . labels . modal _header _text ) ;
this . userSettingsModalMarkup = this . userSettingsModalMarkup . replace ( "REPLACE_modal_username_text" , this . labels . modal _username _text ) ;
this . userSettingsModalMarkup = this . userSettingsModalMarkup . replace ( "REPLACE_modal_usertag_text" , this . labels . modal _usertag _text ) ;
this . userSettingsModalMarkup = this . userSettingsModalMarkup . replace ( "REPLACE_modal_userurl_text" , this . labels . modal _userurl _text ) ;
this . userSettingsModalMarkup = this . userSettingsModalMarkup . replace ( "REPLACE_modal_removeicon_text" , this . labels . modal _removeicon _text ) ;
this . userSettingsModalMarkup = this . userSettingsModalMarkup . replace ( "REPLACE_modal_ignoretagcolor_text" , this . labels . modal _ignoretagcolor _text ) ;
this . userSettingsModalMarkup = this . userSettingsModalMarkup . replace ( "REPLACE_modal_tabheader1_text" , this . labels . modal _tabheader1 _text ) ;
this . userSettingsModalMarkup = this . userSettingsModalMarkup . replace ( "REPLACE_modal_tabheader2_text" , this . labels . modal _tabheader2 _text ) ;
this . userSettingsModalMarkup = this . userSettingsModalMarkup . replace ( "REPLACE_modal_tabheader3_text" , this . labels . modal _tabheader3 _text ) ;
this . userSettingsModalMarkup = this . userSettingsModalMarkup . replace ( "REPLACE_modal_colorpicker1_text" , this . labels . modal _colorpicker1 _text ) ;
this . userSettingsModalMarkup = this . userSettingsModalMarkup . replace ( "REPLACE_modal_colorpicker2_text" , this . labels . modal _colorpicker2 _text ) ;
this . userSettingsModalMarkup = this . userSettingsModalMarkup . replace ( "REPLACE_modal_colorpicker3_text" , this . labels . modal _colorpicker3 _text ) ;
this . userSettingsModalMarkup = this . userSettingsModalMarkup . replace ( "REPLACE_modal_colorpicker4_text" , this . labels . modal _colorpicker4 _text ) ;
this . userSettingsModalMarkup = this . userSettingsModalMarkup . replace ( "REPLACE_btn_cancel_text" , this . labels . btn _cancel _text ) ;
this . userSettingsModalMarkup = this . userSettingsModalMarkup . replace ( "REPLACE_btn_save_text" , this . labels . btn _save _text ) ;
}
2019-01-26 22:45:19 +01:00
2018-12-25 11:53:15 +01:00
onUserContextMenu ( instance , menu ) {
if ( instance . props && instance . props . user && ! menu . querySelector ( ".localusersettings-item" ) ) {
2019-01-12 15:07:06 +01:00
let userContextEntry = BDFDB . htmlToElement ( this . userContextEntryMarkup ) ;
2019-08-07 16:18:55 +02:00
let devgroup = BDFDB . getContextMenuDevGroup ( menu ) ;
2019-03-09 20:18:44 +01:00
if ( devgroup ) devgroup . parentElement . insertBefore ( userContextEntry , devgroup ) ;
else menu . appendChild ( userContextEntry , menu ) ;
2019-01-17 23:48:29 +01:00
let settingsitem = userContextEntry . querySelector ( ".localusersettings-item" ) ;
settingsitem . addEventListener ( "mouseenter" , ( ) => {
let userContextSubMenu = BDFDB . htmlToElement ( this . userContextSubMenuMarkup ) ;
let useritem = userContextSubMenu . querySelector ( ".usersettings-item" ) ;
useritem . addEventListener ( "click" , ( ) => {
2019-03-07 23:56:18 +01:00
BDFDB . closeContextMenu ( menu ) ;
2019-01-17 23:48:29 +01:00
this . showUserSettings ( instance . props . user ) ;
2018-10-11 10:21:26 +02:00
} ) ;
2019-01-17 23:48:29 +01:00
if ( BDFDB . loadData ( instance . props . user . id , this , "users" ) ) {
let resetitem = userContextSubMenu . querySelector ( ".resetsettings-item" ) ;
BDFDB . removeClass ( resetitem , BDFDB . disCN . contextmenuitemdisabled ) ;
resetitem . addEventListener ( "click" , ( ) => {
2019-03-07 23:56:18 +01:00
BDFDB . closeContextMenu ( menu ) ;
2019-01-17 23:48:29 +01:00
BDFDB . removeData ( instance . props . user . id , this , "users" ) ;
2019-03-27 19:18:10 +01:00
this . changeAppTitle ( ) ;
2019-01-17 23:48:29 +01:00
BDFDB . WebModules . forceAllUpdates ( this ) ;
} ) ;
}
BDFDB . appendSubMenu ( settingsitem , userContextSubMenu ) ;
} ) ;
2018-10-11 10:21:26 +02:00
}
}
2019-01-26 22:45:19 +01:00
2019-01-04 16:53:42 +01:00
showUserSettings ( info ) {
2019-01-01 20:41:27 +01:00
var { name , tag , url , removeIcon , ignoreTagColor , color1 , color2 , color3 , color4 } = BDFDB . loadData ( info . id , this , "users" ) || { } ;
2019-01-26 22:45:19 +01:00
2019-09-07 09:21:39 +02:00
var member = BDFDB . LibraryModules . MemberStore . getMember ( BDFDB . LibraryModules . LastGuildStore . getGuildId ( ) , info . id ) || { } ;
2019-01-26 22:45:19 +01:00
2019-01-12 15:07:06 +01:00
let userSettingsModal = BDFDB . htmlToElement ( this . userSettingsModalMarkup ) ;
let usernameinput = userSettingsModal . querySelector ( "#input-username" ) ;
let usertaginput = userSettingsModal . querySelector ( "#input-usertag" ) ;
let userurlinput = userSettingsModal . querySelector ( "#input-userurl" ) ;
let removeiconinput = userSettingsModal . querySelector ( "#input-removeicon" ) ;
let ignoretagcolorinput = userSettingsModal . querySelector ( "#input-ignoretagcolor" ) ;
2019-01-26 22:45:19 +01:00
2019-01-12 15:07:06 +01:00
userSettingsModal . querySelector ( BDFDB . dotCN . modalguildname ) . innerText = member . nick || info . username ;
usernameinput . value = name || "" ;
usernameinput . setAttribute ( "placeholder" , member . nick || info . username ) ;
usertaginput . value = tag || "" ;
userurlinput . value = url || "" ;
userurlinput . setAttribute ( "placeholder" , BDFDB . getUserAvatar ( info . id ) || "" ) ;
2019-01-17 23:48:29 +01:00
BDFDB . toggleClass ( userurlinput , "valid" , userurlinput . value . length > 0 ) ;
2019-01-12 15:07:06 +01:00
userurlinput . disabled = removeIcon ;
removeiconinput . checked = removeIcon ;
ignoretagcolorinput . checked = ignoreTagColor ;
2018-12-13 16:48:35 +01:00
BDFDB . setColorSwatches ( userSettingsModal , color1 ) ;
BDFDB . setColorSwatches ( userSettingsModal , color2 ) ;
BDFDB . setColorSwatches ( userSettingsModal , color3 ) ;
BDFDB . setColorSwatches ( userSettingsModal , color4 ) ;
2019-01-26 22:45:19 +01:00
2019-08-15 15:30:20 +02:00
let ignoredswatches = userSettingsModal . querySelectorAll ( ` .swatches[swatchnr='3'] ${ BDFDB . dotCN . colorpickerswatch } , .swatches[swatchnr='4'] ${ BDFDB . dotCN . colorpickerswatch } ` ) ;
2019-01-26 22:45:19 +01:00
2019-08-15 15:30:20 +02:00
BDFDB . toggleClass ( ignoredswatches , BDFDB . disCN . colorpickerswatchdisabled , ignoretagcolorinput . checked ) ;
2019-01-26 22:45:19 +01:00
2018-10-11 10:21:26 +02:00
BDFDB . appendModal ( userSettingsModal ) ;
2019-01-26 22:45:19 +01:00
2019-01-20 19:21:16 +01:00
removeiconinput . addEventListener ( "click" , ( ) => {
userurlinput . disabled = removeiconinput . checked ;
2019-01-17 23:48:29 +01:00
} ) ;
2019-01-20 19:21:16 +01:00
ignoretagcolorinput . addEventListener ( "click" , ( ) => {
2019-08-15 15:30:20 +02:00
BDFDB . toggleClass ( ignoredswatches , BDFDB . disCN . colorpickerswatchdisabled , ignoretagcolorinput . checked ) ;
2019-01-17 23:48:29 +01:00
} ) ;
2019-01-20 19:21:16 +01:00
userurlinput . addEventListener ( "input" , ( ) => {
this . checkUrl ( userurlinput ) ;
2019-01-17 23:48:29 +01:00
} ) ;
2019-01-20 19:21:16 +01:00
userurlinput . addEventListener ( "mouseenter" , ( ) => {
BDFDB . addClass ( userurlinput , "hovering" ) ;
this . createNoticeTooltip ( userurlinput ) ;
2019-01-17 23:48:29 +01:00
} ) ;
2019-01-20 19:21:16 +01:00
userurlinput . addEventListener ( "mouseleave" , ( ) => {
BDFDB . removeClass ( userurlinput , "hovering" ) ;
2019-01-17 23:48:29 +01:00
BDFDB . removeEles ( BDFDB . dotCNS . tooltips + ".notice-tooltip" ) ;
} ) ;
BDFDB . addChildEventListener ( userSettingsModal , "click" , ".btn-save" , e => {
name = usernameinput . value . trim ( ) ;
name = name ? name : null ;
2019-01-26 22:45:19 +01:00
2019-01-17 23:48:29 +01:00
tag = usertaginput . value . trim ( ) ;
tag = tag ? tag : null ;
2019-01-26 22:45:19 +01:00
2019-01-17 23:48:29 +01:00
removeIcon = removeiconinput . checked ;
2019-01-26 22:45:19 +01:00
2019-01-17 23:48:29 +01:00
ignoreTagColor = ignoretagcolorinput . checked ;
2019-01-26 22:45:19 +01:00
2019-01-17 23:48:29 +01:00
url = ! removeIcon && BDFDB . containsClass ( userurlinput , "valid" ) ? userurlinput . value . trim ( ) : null ;
url = url ? url : null ;
2019-01-26 22:45:19 +01:00
2019-01-17 23:48:29 +01:00
color1 = BDFDB . getSwatchColor ( userSettingsModal , 1 ) ;
color2 = BDFDB . getSwatchColor ( userSettingsModal , 2 ) ;
color3 = BDFDB . getSwatchColor ( userSettingsModal , 3 ) ;
color4 = BDFDB . getSwatchColor ( userSettingsModal , 4 ) ;
2019-01-26 22:45:19 +01:00
2019-01-17 23:48:29 +01:00
if ( name == null && tag == null && url == null && ! removeIcon && ! ignoreTagColor && color1 == null && color2 == null && color3 == null && color4 == null ) {
BDFDB . removeData ( info . id , this , "users" )
}
else {
BDFDB . saveData ( info . id , { name , tag , url , removeIcon , ignoreTagColor , color1 , color2 , color3 , color4 } , this , "users" ) ;
}
2019-03-27 19:18:10 +01:00
this . changeAppTitle ( ) ;
2019-01-17 23:48:29 +01:00
BDFDB . WebModules . forceAllUpdates ( this ) ;
} ) ;
2019-01-12 15:07:06 +01:00
usernameinput . focus ( ) ;
2018-10-11 10:21:26 +02:00
}
2019-01-26 22:45:19 +01:00
2019-01-03 18:46:14 +01:00
checkUrl ( input ) {
BDFDB . removeEles ( BDFDB . dotCNS . tooltips + ".notice-tooltip" ) ;
if ( ! input . value ) {
2019-01-17 23:48:29 +01:00
BDFDB . removeClass ( input , "valid" ) ;
BDFDB . removeClass ( input , "invalid" ) ;
2018-10-11 10:21:26 +02:00
}
else {
2019-09-07 09:21:39 +02:00
BDFDB . LibraryRequires . request ( input . value , ( error , response , result ) => {
2018-10-11 10:21:26 +02:00
if ( response && response . headers [ "content-type" ] && response . headers [ "content-type" ] . indexOf ( "image" ) != - 1 ) {
2019-01-17 23:48:29 +01:00
BDFDB . addClass ( input , "valid" ) ;
BDFDB . removeClass ( input , "invalid" ) ;
2018-10-11 10:21:26 +02:00
}
else {
2019-01-17 23:48:29 +01:00
BDFDB . removeClass ( input , "valid" ) ;
BDFDB . addClass ( input , "invalid" ) ;
2018-10-11 10:21:26 +02:00
}
2019-01-17 23:48:29 +01:00
if ( BDFDB . containsClass ( input , "hovering" ) ) this . createNoticeTooltip ( input ) ;
2018-10-11 10:21:26 +02:00
} ) ;
}
}
2019-01-26 22:45:19 +01:00
2019-01-03 18:46:14 +01:00
createNoticeTooltip ( input ) {
2018-12-13 16:48:35 +01:00
var disabled = input . disabled ;
2019-01-17 23:48:29 +01:00
var valid = BDFDB . containsClass ( input , "valid" ) ;
var invalid = BDFDB . containsClass ( input , "invalid" ) ;
2018-10-11 10:21:26 +02:00
if ( disabled || valid || invalid ) {
2019-01-03 18:46:14 +01:00
BDFDB . createTooltip ( disabled ? this . labels . modal _ignoreurl _text : valid ? this . labels . modal _validurl _text : this . labels . modal _invalidurl _text , input , { type : "right" , selector : "notice-tooltip" , color : disabled ? "black" : invalid ? "red" : "green" } ) ;
2018-10-11 10:21:26 +02:00
}
}
2019-01-26 22:45:19 +01:00
2018-12-22 23:41:25 +01:00
processChannelTextArea ( instance , wrapper ) {
2019-01-25 11:35:40 +01:00
let channel = BDFDB . getReactValue ( instance , "props.channel" ) ;
if ( channel ) {
2019-01-25 11:27:52 +01:00
var textarea = wrapper . querySelector ( "textarea" ) ;
if ( ! textarea ) return ;
2019-06-26 08:52:17 +02:00
if ( channel . type == 1 && instance . props . type == "normal" && ! instance . props . disabled ) {
2019-09-07 09:21:39 +02:00
let user = BDFDB . LibraryModules . UserStore . getUser ( channel . recipients [ 0 ] ) ;
2019-01-25 11:27:52 +01:00
if ( user ) {
let data = this . getUserData ( user . id , wrapper ) ;
textarea . setAttribute ( "placeholder" , BDFDB . LanguageStrings . TEXTAREA _PLACEHOLDER . replace ( "{{channel}}" , "@" + ( data . name || user . username ) ) ) ;
}
}
2019-02-16 12:58:25 +01:00
BDFDB . removeEventListener ( this , textarea ) ;
2019-01-25 11:27:52 +01:00
if ( BDFDB . getData ( "changeInAutoComplete" , this , "settings" ) ) {
BDFDB . addEventListener ( this , textarea , "keydown" , e => {
let autocompletemenu = textarea . parentElement . querySelector ( BDFDB . dotCN . autocomplete ) ;
if ( autocompletemenu && ( e . which == 9 || e . which == 13 ) ) {
if ( BDFDB . containsClass ( autocompletemenu . querySelector ( BDFDB . dotCN . autocompleteselected ) . parentElement , "autocompleteEditUsersRow" ) ) {
2019-02-03 22:11:35 +01:00
BDFDB . stopEvent ( e ) ;
2019-09-04 12:34:02 +02:00
this . swapWordWithMention ( textarea ) ;
2019-01-25 11:27:52 +01:00
}
}
else if ( autocompletemenu && ( e . which == 38 || e . which == 40 ) ) {
let autocompleteitems = autocompletemenu . querySelectorAll ( BDFDB . dotCN . autocompleteselectable + ":not(.autocompleteEditUsersSelector)" ) ;
let selected = autocompletemenu . querySelector ( BDFDB . dotCN . autocompleteselected ) ;
if ( BDFDB . containsClass ( selected , "autocompleteEditUsersSelector" ) || autocompleteitems [ e . which == 38 ? 0 : ( autocompleteitems . length - 1 ) ] == selected ) {
2019-02-03 22:11:35 +01:00
BDFDB . stopEvent ( e ) ;
2019-01-25 11:27:52 +01:00
let next = this . getNextSelection ( autocompletemenu , null , e . which == 38 ? false : true ) ;
BDFDB . removeClass ( selected , BDFDB . disCN . autocompleteselected ) ;
BDFDB . addClass ( selected , BDFDB . disCN . autocompleteselector ) ;
BDFDB . addClass ( next , BDFDB . disCN . autocompleteselected ) ;
}
}
else if ( textarea . value && ! e . shiftKey && e . which == 13 && ! autocompletemenu && textarea . value . indexOf ( "s/" ) != 0 ) {
this . format = true ;
textarea . dispatchEvent ( new Event ( "input" ) ) ;
}
else if ( ! e . ctrlKey && e . which != 16 && textarea . selectionStart == textarea . selectionEnd && textarea . selectionEnd == textarea . value . length ) {
clearTimeout ( textarea . EditUsersAutocompleteTimeout ) ;
2019-01-25 11:35:40 +01:00
textarea . EditUsersAutocompleteTimeout = setTimeout ( ( ) => { this . addAutoCompleteMenu ( textarea , channel ) ; } , 100 ) ;
2019-01-25 11:27:52 +01:00
}
2019-01-26 22:45:19 +01:00
2019-01-25 11:27:52 +01:00
if ( ! e . ctrlKey && e . which != 38 && e . which != 40 && ! ( e . which == 39 && textarea . selectionStart == textarea . selectionEnd && textarea . selectionEnd == textarea . value . length ) ) BDFDB . removeEles ( ".autocompleteEditUsers" , ".autocompleteEditUsersRow" ) ;
} ) ;
BDFDB . addEventListener ( this , textarea , "click" , e => {
2019-01-25 11:35:40 +01:00
if ( textarea . selectionStart == textarea . selectionEnd && textarea . selectionEnd == textarea . value . length ) setImmediate ( ( ) => { this . addAutoCompleteMenu ( textarea , channel ) ; } ) ;
2019-01-25 11:27:52 +01:00
} ) ;
2018-10-11 10:21:26 +02:00
}
}
2018-12-22 23:41:25 +01:00
}
2019-09-04 12:34:02 +02:00
2019-08-19 11:17:57 +02:00
processMemberListItem ( instance , wrapper ) {
2019-07-18 12:53:00 +02:00
let username = wrapper . querySelector ( BDFDB . dotCN . memberusername ) ;
if ( username ) {
this . changeName ( instance . props . user , username ) ;
this . changeAvatar ( instance . props . user , this . getAvatarDiv ( wrapper ) ) ;
this . addTag ( instance . props . user , username . parentElement , BDFDB . disCN . bottagnametag ) ;
}
}
processUserPopout ( instance , wrapper ) {
let username = wrapper . querySelector ( BDFDB . dotCNC . userpopoutheadertagusernamenonickname + BDFDB . dotCN . userpopoutheadernickname ) ;
if ( username ) {
this . changeName ( instance . props . user , username ) ;
this . changeAvatar ( instance . props . user , this . getAvatarDiv ( wrapper ) ) ;
2019-08-06 20:53:56 +02:00
this . addTag ( instance . props . user , username . parentElement , BDFDB . disCN . bottagnametag , wrapper ) ;
2019-07-18 12:53:00 +02:00
}
}
processUserProfile ( instance , wrapper ) {
let username = wrapper . querySelector ( BDFDB . dotCN . userprofileusername ) ;
if ( username ) {
this . changeName ( instance . props . user , username ) ;
this . changeAvatar ( instance . props . user , this . getAvatarDiv ( wrapper ) ) ;
2019-08-06 20:53:56 +02:00
this . addTag ( instance . props . user , username . parentElement , BDFDB . disCNS . userprofilebottag + BDFDB . disCN . bottagnametag , wrapper ) ;
2019-07-18 12:53:00 +02:00
}
}
2019-01-26 22:45:19 +01:00
2019-07-18 12:53:00 +02:00
processFriendRow ( instance , wrapper ) {
let username = wrapper . querySelector ( BDFDB . dotCN . friendsusername ) ;
2019-06-16 19:30:24 +02:00
if ( username ) {
this . changeName ( instance . props . user , username ) ;
this . changeAvatar ( instance . props . user , this . getAvatarDiv ( wrapper ) ) ;
}
}
2019-09-04 12:34:02 +02:00
2019-08-29 10:44:05 +02:00
processVoiceUser ( instance , wrapper ) {
let user = instance . props . user ;
if ( user && wrapper . className ) {
this . changeVoiceUser ( user , wrapper . querySelector ( BDFDB . dotCN . voicename ) , instance . props . speaking ) ;
this . changeAvatar ( user , this . getAvatarDiv ( wrapper ) ) ;
}
}
2019-06-16 19:30:24 +02:00
processAccount ( instance , wrapper ) {
let user = BDFDB . getReactValue ( instance , "_reactInternalFiber.child.stateNode.props.currentUser" ) ;
2019-06-16 21:11:15 +02:00
if ( user ) {
2019-09-07 09:21:39 +02:00
this . changeName ( user , wrapper . querySelector ( BDFDB . dotCN . accountinfodetails ) . firstElementChild ) ;
2019-06-16 21:11:15 +02:00
this . changeAvatar ( user , this . getAvatarDiv ( wrapper ) ) ;
}
2018-12-22 23:41:25 +01:00
}
2019-01-26 22:45:19 +01:00
2019-01-15 10:04:23 +01:00
processMessageUsername ( instance , wrapper ) {
let message = BDFDB . getReactValue ( instance , "props.message" ) ;
if ( message ) {
2018-12-22 23:41:25 +01:00
let username = wrapper . querySelector ( BDFDB . dotCN . messageusername ) ;
if ( username ) {
2019-09-07 09:21:39 +02:00
let channel = BDFDB . LibraryModules . ChannelStore . getChannel ( message . channel _id ) || { } ;
2019-01-15 10:04:23 +01:00
this . changeName ( message . author , username , channel . guild _id ) ;
2019-02-07 22:54:50 +01:00
if ( ! BDFDB . containsClass ( wrapper . parentElement , BDFDB . disCN . messageheadercompact ) ) this . changeAvatar ( message . author , this . getAvatarDiv ( wrapper ) ) ;
2019-01-15 10:04:23 +01:00
let messagegroup = BDFDB . getParentEle ( BDFDB . dotCN . messagegroup , wrapper ) ;
2019-07-18 12:53:00 +02:00
this . addTag ( message . author , wrapper , BDFDB . containsClass ( messagegroup , BDFDB . disCN . messagegroupcozy ) ? BDFDB . disCN . bottagmessagecozy : BDFDB . disCN . bottagmessagecompact ) ;
2018-12-22 22:34:45 +01:00
}
2018-10-11 10:21:26 +02:00
}
2018-12-22 23:41:25 +01:00
}
2019-01-26 22:45:19 +01:00
2018-12-22 23:41:25 +01:00
processAuditLog ( instance , wrapper ) {
2019-01-15 10:04:23 +01:00
let log = BDFDB . getReactValue ( instance , "props.log" ) ;
if ( log && log . user ) {
2018-12-26 10:26:55 +01:00
let hooks = wrapper . querySelectorAll ( BDFDB . dotCN . auditloguserhook ) ;
2019-01-15 10:04:23 +01:00
let guild _id = BDFDB . getReactValue ( instance , "_reactInternalFiber.return.memoizedProps.guildId" ) ;
if ( hooks . length > 0 ) this . changeName2 ( log . user , hooks [ 0 ] . firstChild , guild _id ) ;
if ( hooks . length > 1 && log . targetType == "USER" ) this . changeName2 ( log . target , hooks [ 1 ] . firstChild , guild _id ) ;
2018-12-22 23:41:25 +01:00
}
}
2019-01-26 22:45:19 +01:00
2019-02-07 22:54:50 +01:00
processBannedCard ( instance , wrapper ) {
if ( instance . props && instance . props . user && instance . props . guild ) {
let username = wrapper . querySelector ( BDFDB . dotCN . guildsettingsbannedusername ) ;
if ( username ) {
2019-09-04 12:34:02 +02:00
this . changeName3 ( instance . props . user , username ) ;
2019-02-07 22:54:50 +01:00
this . changeAvatar ( instance . props . user , this . getAvatarDiv ( wrapper ) ) ;
}
}
}
processInviteCard ( instance , wrapper ) {
let invite = BDFDB . getReactValue ( instance , "props.invite" ) ;
if ( invite && invite . inviter && invite . guild ) {
let username = wrapper . querySelector ( BDFDB . dotCN . guildsettingsinviteusername ) ;
if ( username ) {
this . changeName2 ( invite . inviter , username , invite . guild . id ) ;
this . changeAvatar ( invite . inviter , this . getAvatarDiv ( wrapper ) ) ;
}
}
}
processMemberCard ( instance , wrapper ) {
if ( instance . props && instance . props . user && instance . props . guild ) {
let username = wrapper . querySelector ( BDFDB . dotCN . guildsettingsmembername ) ;
if ( username ) {
this . changeName2 ( instance . props . user , username , instance . props . guild . id ) ;
this . changeAvatar ( instance . props . user , this . getAvatarDiv ( wrapper ) ) ;
}
}
}
2019-03-28 13:56:12 +01:00
processInvitationCard ( instance , wrapper ) {
if ( instance . props && instance . props . user ) {
let username = wrapper . querySelector ( BDFDB . dotCN . invitemodalinviterowname ) ;
if ( username ) {
this . changeName3 ( instance . props . user , username ) ;
this . changeAvatar ( instance . props . user , this . getAvatarDiv ( wrapper ) ) ;
}
}
}
2019-02-03 22:11:35 +01:00
processTypingUsers ( instance , wrapper ) {
2019-09-07 09:21:39 +02:00
let users = ! instance . props . typingUsers ? [ ] : Object . keys ( instance . props . typingUsers ) . filter ( id => id != BDFDB . myData . id ) . filter ( id => ! BDFDB . LibraryModules . FriendUtils . isBlocked ( id ) ) . map ( id => BDFDB . LibraryModules . UserStore . getUser ( id ) ) . filter ( id => id != null ) ;
2019-01-15 10:04:23 +01:00
wrapper . querySelectorAll ( BDFDB . dotCNS . typing + "strong" ) . forEach ( ( username , i ) => {
if ( users [ i ] && username ) this . changeName2 ( users [ i ] , username ) ;
2018-12-22 23:41:25 +01:00
} ) ;
}
2019-01-26 22:45:19 +01:00
2018-12-22 23:41:25 +01:00
processDirectMessage ( instance , wrapper ) {
2019-01-15 10:04:23 +01:00
let channel = BDFDB . getReactValue ( instance , "props.channel" ) ;
if ( channel && channel . type == 1 ) {
2019-09-07 09:21:39 +02:00
let user = BDFDB . LibraryModules . UserStore . getUser ( channel . recipients [ 0 ] ) ;
2018-12-22 23:41:25 +01:00
if ( user ) {
let avatar = this . getAvatarDiv ( wrapper ) ;
if ( avatar ) {
this . changeAvatar ( user , avatar ) ;
this . changeTooltip ( user , avatar , "right" ) ;
}
2018-12-22 22:34:45 +01:00
}
2018-10-11 10:21:26 +02:00
}
2018-12-22 23:41:25 +01:00
}
2019-01-26 22:45:19 +01:00
2018-12-22 23:41:25 +01:00
processCallAvatar ( instance , wrapper ) {
if ( instance . props && instance . props . id ) {
2019-09-07 09:21:39 +02:00
let user = BDFDB . LibraryModules . UserStore . getUser ( instance . props . id ) ;
2018-12-22 23:41:25 +01:00
if ( ! user ) {
2019-09-07 09:21:39 +02:00
let channel = BDFDB . LibraryModules . ChannelStore . getChannel ( instance . props . id ) ;
if ( channel && channel . type == 1 ) user = BDFDB . LibraryModules . UserStore . getUser ( channel . recipients [ 0 ] ) ;
2018-12-22 23:41:25 +01:00
}
if ( user ) {
let avatar = wrapper . querySelector ( BDFDB . dotCN . callavatar ) ;
this . changeName2 ( user , wrapper . parentElement . querySelector ( BDFDB . dotCN . callmembers ) ) ;
this . changeAvatar ( user , avatar ) ;
2019-01-17 23:48:29 +01:00
if ( BDFDB . containsClass ( avatar , BDFDB . disCN . callvideo ) ) this . changeTooltip ( user , avatar , "left" ) ;
2018-10-11 10:21:26 +02:00
}
}
2018-12-22 23:41:25 +01:00
}
2019-01-26 22:45:19 +01:00
2019-02-19 20:43:46 +01:00
processVideoTile ( instance , wrapper ) {
if ( instance . props && instance . props . user ) this . changeAvatar ( instance . props . user , this . getAvatarDiv ( wrapper ) ) ;
}
2019-02-19 12:09:01 +01:00
processPictureInPictureVideo ( instance , wrapper ) {
if ( instance . props && instance . props . backgroundKey ) {
2019-09-07 09:21:39 +02:00
let user = BDFDB . LibraryModules . UserStore . getUser ( instance . props . backgroundKey ) ;
2019-02-19 12:09:01 +01:00
if ( user ) this . changeAvatar ( user , this . getAvatarDiv ( wrapper ) ) ;
}
}
2018-12-22 23:41:25 +01:00
processPrivateChannel ( instance , wrapper ) {
if ( instance . props && instance . props . user ) {
let username = wrapper . querySelector ( BDFDB . dotCN . dmchannelname ) ;
2019-07-18 12:53:00 +02:00
this . changePrivateChannel ( instance . props . user , username && username . firstElementChild ? username . firstElementChild : username ) ;
2018-12-22 23:41:25 +01:00
this . changeAvatar ( instance . props . user , this . getAvatarDiv ( wrapper ) ) ;
}
}
2019-01-26 22:45:19 +01:00
2019-04-29 09:11:09 +02:00
processHeaderBarContainer ( instance , wrapper ) {
this . processHeaderBar ( instance , wrapper ) ;
}
2019-09-04 12:34:02 +02:00
2018-12-25 16:52:37 +01:00
processHeaderBar ( instance , wrapper ) {
2019-04-29 11:39:07 +02:00
let channel _id = BDFDB . getReactValue ( instance , "props.channelId" ) || BDFDB . getReactValue ( instance , "_reactInternalFiber.return.memoizedProps.channelId" ) ;
2019-01-15 10:04:23 +01:00
if ( channel _id ) {
2019-08-29 23:23:06 +02:00
let channelname = wrapper . querySelector ( BDFDB . dotCN . channelheaderheaderbartitle ) ;
if ( channelname ) {
2019-09-07 09:21:39 +02:00
let channel = BDFDB . LibraryModules . ChannelStore . getChannel ( channel _id ) ;
2018-12-25 16:52:37 +01:00
if ( channel ) {
2019-09-07 09:21:39 +02:00
if ( channel . type == 1 ) this . changeName ( BDFDB . LibraryModules . UserStore . getUser ( channel . recipients [ 0 ] ) , channelname ) ;
2018-12-25 16:52:37 +01:00
else {
2019-08-29 23:23:06 +02:00
if ( channelname . EditUsersChangeObserver && typeof channelname . EditUsersChangeObserver . disconnect == "function" ) channelname . EditUsersChangeObserver . disconnect ( ) ;
if ( BDFDB . isPluginEnabled ( "EditChannels" ) ) bdplugins . EditChannels . plugin . changeChannel ( channel , channelname ) ;
else {
channelname . style . removeProperty ( "color" ) ;
channelname . style . removeProperty ( "background" ) ;
BDFDB . setInnerText ( channelname , channel . name ) ;
}
2018-12-25 16:52:37 +01:00
}
}
}
}
}
2019-01-26 22:45:19 +01:00
2018-12-22 23:41:25 +01:00
processClickable ( instance , wrapper ) {
2018-12-25 11:53:15 +01:00
if ( ! wrapper || ! instance . props || ! instance . props . className ) return ;
2019-01-04 15:41:38 +01:00
if ( instance . props . tag == "a" && instance . props . className . indexOf ( BDFDB . disCN . anchorunderlineonhover ) > - 1 ) {
2019-01-17 23:48:29 +01:00
if ( BDFDB . containsClass ( wrapper . parentElement , BDFDB . disCN . messagesystemcontent ) && wrapper . parentElement . querySelector ( "a" ) == wrapper ) {
2018-12-22 23:41:25 +01:00
let message = BDFDB . getKeyInformation ( { node : wrapper . parentElement , key : "message" , up : true } ) ;
2019-02-16 12:58:25 +01:00
if ( message ) {
this . changeName ( message . author , wrapper ) ;
2019-09-07 09:21:39 +02:00
if ( message . mentions . length == 1 ) this . changeName ( BDFDB . LibraryModules . UserStore . getUser ( message . mentions [ 0 ] ) , wrapper . parentElement . querySelectorAll ( "a" ) [ 1 ] ) ;
2019-02-16 12:58:25 +01:00
}
2018-12-22 22:34:45 +01:00
}
2018-10-11 10:21:26 +02:00
}
2018-12-22 23:41:25 +01:00
else if ( instance . props . tag == "span" && instance . props . className . indexOf ( BDFDB . disCN . mention ) > - 1 ) {
2019-01-15 10:04:23 +01:00
let render = BDFDB . getReactValue ( instance , "_reactInternalFiber.return.return.stateNode.props.render" ) ;
2019-05-26 14:29:29 +02:00
if ( typeof render == "function" ) {
var props = render ( ) . props ;
if ( props && props . user ) this . changeMention ( props . user , wrapper ) ;
2019-09-07 09:21:39 +02:00
else if ( props && props . userId ) this . changeMention ( BDFDB . LibraryModules . UserStore . getUser ( props . userId ) , wrapper ) ;
2019-05-26 14:29:29 +02:00
}
2018-10-11 10:21:26 +02:00
}
2018-12-25 11:53:15 +01:00
else if ( instance . props . tag == "div" && instance . props . className . indexOf ( BDFDB . disCN . quickswitchresult ) > - 1 ) {
2019-03-13 13:02:06 +01:00
let user = BDFDB . getReactValue ( instance , "_reactInternalFiber.return.return.memoizedProps.user" ) ;
if ( user ) {
this . changeName2 ( user , wrapper . querySelector ( BDFDB . dotCN . quickswitchresultmatch ) ) ;
this . changeAvatar ( user , this . getAvatarDiv ( wrapper ) ) ;
2018-10-11 10:21:26 +02:00
}
}
2018-12-25 11:53:15 +01:00
else if ( instance . props . tag == "div" && instance . props . className . indexOf ( BDFDB . disCN . autocompleterow ) > - 1 ) {
2019-01-15 10:04:23 +01:00
let user = BDFDB . getReactValue ( instance , "_reactInternalFiber.return.memoizedProps.user" ) ;
if ( user ) {
this . changeName2 ( user , wrapper . querySelector ( BDFDB . dotCN . marginleft8 ) ) ;
this . changeAvatar ( user , this . getAvatarDiv ( wrapper ) ) ;
2018-10-11 10:21:26 +02:00
}
}
2019-08-19 11:17:57 +02:00
else if ( instance . props . tag == "div" && instance . props . className . indexOf ( BDFDB . disCN . searchpopoutuser ) > - 1 ) {
let result = BDFDB . getReactValue ( instance , "_reactInternalFiber.return.memoizedProps.result" ) ;
if ( result && result . user ) {
this . changeName3 ( result . user , wrapper . querySelector ( BDFDB . dotCN . searchpopoutdisplayednick ) ) ;
this . changeAvatar ( result . user , wrapper . querySelector ( BDFDB . dotCN . searchpopoutdisplayavatar ) ) ;
2018-12-25 11:53:15 +01:00
}
}
2018-10-11 10:21:26 +02:00
}
2019-01-26 22:45:19 +01:00
2018-12-30 09:50:26 +01:00
processMessageContent ( instance , wrapper ) {
2019-01-15 10:04:23 +01:00
let message = BDFDB . getReactValue ( instance , "props.message" ) ;
if ( message && message . author ) {
2018-12-30 09:50:26 +01:00
let markup = wrapper . querySelector ( BDFDB . dotCN . messagemarkup ) ;
if ( markup ) {
2019-09-07 09:21:39 +02:00
let channel = BDFDB . LibraryModules . ChannelStore . getChannel ( message . channel _id ) || { } ;
let member = BDFDB . LibraryModules . MemberStore . getMember ( channel . guild _id , message . author . id ) || { } ;
2019-01-15 10:04:23 +01:00
let data = this . getUserData ( message . author . id , wrapper ) ;
2019-08-19 11:17:57 +02:00
markup . style . setProperty ( "color" , window . settingsCookie [ "bda-gs-7" ] ? BDFDB . colorCONVERT ( data . color1 && ! BDFDB . isObject ( data . color1 ) ? data . color1 : member . colorString , "RGB" ) : null , "important" ) ;
2018-12-30 09:50:26 +01:00
}
}
}
2019-01-26 22:45:19 +01:00
2019-01-01 20:41:27 +01:00
processStandardSidebarView ( instance , wrapper ) {
2019-01-15 10:04:23 +01:00
if ( this . SettingsUpdated ) {
delete this . SettingsUpdated ;
2019-03-27 19:18:10 +01:00
this . changeAppTitle ( ) ;
2019-01-01 20:41:27 +01:00
BDFDB . WebModules . forceAllUpdates ( this ) ;
}
}
2019-09-04 12:34:02 +02:00
2019-03-27 19:18:10 +01:00
changeAppTitle ( ) {
2019-09-07 09:21:39 +02:00
let channel = BDFDB . LibraryModules . ChannelStore . getChannel ( BDFDB . LibraryModules . LastChannelStore . getChannelId ( ) ) ;
2019-03-27 19:18:10 +01:00
let title = document . head . querySelector ( "title" ) ;
if ( title && channel && channel . type == 1 ) {
2019-09-07 09:21:39 +02:00
let info = BDFDB . LibraryModules . UserStore . getUser ( channel . recipients [ 0 ] ) ;
2019-03-27 19:18:10 +01:00
if ( info ) {
let data = this . getUserData ( info . id , title ) ;
BDFDB . setInnerText ( title , "@" + ( data . name || info . username ) ) ;
}
}
}
2019-01-26 22:45:19 +01:00
2019-09-07 09:21:39 +02:00
changeName ( info , username , guildid = BDFDB . LibraryModules . LastGuildStore . getGuildId ( ) ) {
2018-12-25 17:09:23 +01:00
if ( ! info || ! username || ! username . parentElement ) return ;
2018-12-22 23:41:25 +01:00
if ( username . EditUsersChangeObserver && typeof username . EditUsersChangeObserver . disconnect == "function" ) username . EditUsersChangeObserver . disconnect ( ) ;
2019-01-01 20:41:27 +01:00
let data = this . getUserData ( info . id , username ) ;
2019-09-07 09:21:39 +02:00
let member = BDFDB . LibraryModules . MemberStore . getMember ( guildid , info . id ) || { } ;
2019-06-24 10:34:18 +02:00
this . changeBotTags ( data , username , member ) ;
2019-01-06 19:56:17 +01:00
if ( data . name || data . color1 || data . color2 || username . getAttribute ( "changed-by-editusers" ) ) {
2019-01-09 12:18:37 +01:00
let isBRCenabled = BDFDB . isPluginEnabled ( "BetterRoleColors" ) ;
2019-01-17 23:48:29 +01:00
let usenick = ! BDFDB . containsClass ( username , BDFDB . disCN . userprofileusername ) && ! BDFDB . containsClass ( username . parentElement , BDFDB . disCN . userprofilelistname , BDFDB . disCN . accountinfodetails , false ) && member . nick ;
let usemembercolor = ! BDFDB . containsClass ( username . parentElement , BDFDB . disCN . userprofilelistname ) && ( BDFDB . containsClass ( username , BDFDB . disCN . memberusername , BDFDB . disCN . messageusername , false ) || isBRCenabled ) ;
2019-09-04 12:34:02 +02:00
2019-08-19 11:17:57 +02:00
if ( BDFDB . isObject ( data . color1 ) ) {
username . style . removeProperty ( "color" ) ;
BDFDB . setInnerText ( username , BDFDB . htmlToElement ( ` <span style="pointer-events: none; -webkit-background-clip: text !important; color: transparent !important; background-image: ${ BDFDB . colorGRADIENT ( data . color1 ) } !important;"> ${ BDFDB . encodeToHTML ( data . name || ( usenick ? member . nick : info . username ) ) } </span> ` ) ) ;
}
else {
username . style . setProperty ( "color" , BDFDB . colorCONVERT ( data . color1 || ( usemembercolor ? member . colorString : null ) , "RGB" ) , "important" ) ;
BDFDB . setInnerText ( username , data . name || ( usenick ? member . nick : info . username ) ) ;
}
2019-09-04 12:34:02 +02:00
2019-08-19 11:17:57 +02:00
username . style . setProperty ( "background" , BDFDB . isObject ( data . color2 ) ? BDFDB . colorGRADIENT ( data . color2 ) : BDFDB . colorCONVERT ( data . color2 , "RGB" ) , "important" ) ;
2019-09-04 12:34:02 +02:00
2019-01-06 19:56:17 +01:00
if ( data . name || data . color1 || data . color2 ) {
username . setAttribute ( "changed-by-editusers" , true ) ;
username . EditUsersChangeObserver = new MutationObserver ( ( changes , _ ) => {
username . EditUsersChangeObserver . disconnect ( ) ;
this . changeName ( info , username ) ;
} ) ;
username . EditUsersChangeObserver . observe ( username , { attributes : true } ) ;
}
2019-01-12 15:07:06 +01:00
else username . removeAttribute ( "changed-by-editusers" ) ;
2018-10-11 10:21:26 +02:00
}
}
2019-01-26 22:45:19 +01:00
2019-09-07 09:21:39 +02:00
changeName2 ( info , username , guildid = BDFDB . LibraryModules . LastGuildStore . getGuildId ( ) ) {
2018-12-25 17:09:23 +01:00
if ( ! info || ! username || ! username . parentElement ) return ;
2018-12-22 23:41:25 +01:00
if ( username . EditUsersChangeObserver && typeof username . EditUsersChangeObserver . disconnect == "function" ) username . EditUsersChangeObserver . disconnect ( ) ;
2019-01-01 20:41:27 +01:00
let data = this . getUserData ( info . id , username ) ;
2019-09-07 09:21:39 +02:00
let member = BDFDB . LibraryModules . MemberStore . getMember ( guildid , info . id ) || { } ;
2019-06-24 10:34:18 +02:00
this . changeBotTags ( data , username , member ) ;
2019-01-06 19:56:17 +01:00
if ( data . name || data . color1 || username . getAttribute ( "changed-by-editusers" ) ) {
2019-08-19 11:17:57 +02:00
if ( BDFDB . isObject ( data . color1 ) ) {
username . style . removeProperty ( "color" ) ;
BDFDB . setInnerText ( username , BDFDB . htmlToElement ( ` <span style="pointer-events: none; -webkit-background-clip: text !important; color: transparent !important; background-image: ${ BDFDB . colorGRADIENT ( data . color1 ) } !important;"> ${ BDFDB . encodeToHTML ( data . name || member . nick || info . username ) } </span> ` ) ) ;
}
else {
username . style . setProperty ( "color" , BDFDB . colorCONVERT ( data . color1 || ( BDFDB . isPluginEnabled ( "BetterRoleColors" ) ? member . colorString : null ) , "RGB" ) , "important" ) ;
BDFDB . setInnerText ( username , data . name || member . nick || info . username ) ;
}
2019-01-06 19:56:17 +01:00
if ( data . name || data . color1 ) {
username . setAttribute ( "changed-by-editusers" , true ) ;
username . EditUsersChangeObserver = new MutationObserver ( ( changes , _ ) => {
username . EditUsersChangeObserver . disconnect ( ) ;
this . changeName ( info , username ) ;
} ) ;
username . EditUsersChangeObserver . observe ( username , { attributes : true } ) ;
}
2019-01-12 15:07:06 +01:00
else username . removeAttribute ( "changed-by-editusers" ) ;
2018-12-22 23:41:25 +01:00
}
2018-10-11 10:21:26 +02:00
}
2019-01-26 22:45:19 +01:00
2019-08-19 11:17:57 +02:00
changeName3 ( info , username , adddisc = false ) {
2018-12-25 17:09:23 +01:00
if ( ! info || ! username || ! username . parentElement ) return ;
2018-12-25 11:53:15 +01:00
if ( username . EditUsersChangeObserver && typeof username . EditUsersChangeObserver . disconnect == "function" ) username . EditUsersChangeObserver . disconnect ( ) ;
2019-01-01 20:41:27 +01:00
let data = this . getUserData ( info . id , username ) ;
2019-01-06 19:56:17 +01:00
if ( data . name || data . color1 || username . getAttribute ( "changed-by-editusers" ) ) {
2018-12-25 11:53:15 +01:00
if ( adddisc ) {
2019-08-19 11:17:57 +02:00
BDFDB . setInnerText ( username , BDFDB . htmlToElement ( ` <span ${ data . color1 ? ( BDFDB . isObject ( data . color1 ) ? 'style="pointer-events: none; -webkit-background-clip: text !important; color: transparent !important; background-image:' + BDFDB . colorGRADIENT ( data . color1 ) + ' !important;"' : 'style="color:' + data . color1 + ' !important;"' ) : '' } > ${ BDFDB . encodeToHTML ( data . name || info . username ) } </span><span ${ typeof adddisc == "string" ? ' class="' + adddisc + '"' : '' } ># ${ info . discriminator } </span> ` ) ) ;
2018-12-25 11:53:15 +01:00
}
else {
2019-08-19 11:17:57 +02:00
if ( BDFDB . isObject ( data . color1 ) ) {
username . style . removeProperty ( "color" ) ;
BDFDB . setInnerText ( username , BDFDB . htmlToElement ( ` <span style="pointer-events: none; -webkit-background-clip: text !important; color: transparent !important; background-image: ${ BDFDB . colorGRADIENT ( data . color1 ) } !important;"> ${ BDFDB . encodeToHTML ( data . name || info . username ) } </span> ` ) ) ;
}
else {
username . style . setProperty ( "color" , BDFDB . colorCONVERT ( data . color1 , "RGB" ) , "important" ) ;
BDFDB . setInnerText ( username , data . name || info . username ) ;
}
2018-12-25 11:53:15 +01:00
}
2019-01-06 19:56:17 +01:00
if ( data . name || data . color1 ) {
username . setAttribute ( "changed-by-editusers" , true ) ;
username . EditUsersChangeObserver = new MutationObserver ( ( changes , _ ) => {
username . EditUsersChangeObserver . disconnect ( ) ;
this . changeName ( info , username ) ;
} ) ;
username . EditUsersChangeObserver . observe ( username , { attributes : true } ) ;
}
2019-01-12 15:07:06 +01:00
else username . removeAttribute ( "changed-by-editusers" ) ;
2018-12-25 11:53:15 +01:00
}
}
2019-09-04 12:34:02 +02:00
2019-02-07 22:54:50 +01:00
changeBotTags ( data , username , member ) {
2019-08-06 13:12:31 +02:00
for ( let tag of username . parentElement . parentElement . querySelectorAll ( BDFDB . dotCN . bottag ) ) if ( ! BDFDB . containsClass ( tag , "TRE-tag" ) ) {
2019-09-07 09:21:39 +02:00
let isBRCenabled = BDFDB . getReactValue ( window . bdplugins , "BetterRoleColors.plugin.settings.modules.botTags" ) ;
2019-02-07 22:54:50 +01:00
let tagcolor = BDFDB . colorCONVERT ( data . color1 || ( isBRCenabled || BDFDB . containsClass ( tag , "owner-tag-rolecolor" ) ? member . colorString : null ) , "RGB" ) ;
tagcolor = BDFDB . colorISBRIGHT ( tagcolor ) ? BDFDB . colorCHANGE ( tagcolor , - 0.3 ) : tagcolor ;
2019-08-06 20:53:56 +02:00
tag . style . setProperty ( BDFDB . containsClass ( tag , BDFDB . disCN . bottaginvert ) ? "color" : "background-color" , tagcolor , "important" ) ;
2019-02-07 22:54:50 +01:00
}
}
2019-01-26 22:45:19 +01:00
2018-12-22 23:41:25 +01:00
changeAvatar ( info , avatar ) {
2018-12-25 17:09:23 +01:00
if ( ! info || ! avatar || ! avatar . parentElement ) return ;
2018-12-22 23:41:25 +01:00
if ( avatar . EditUsersChangeObserver && typeof avatar . EditUsersChangeObserver . disconnect == "function" ) avatar . EditUsersChangeObserver . disconnect ( ) ;
2019-01-01 20:41:27 +01:00
let data = this . getUserData ( info . id , avatar ) ;
2019-01-06 19:56:17 +01:00
if ( data . url || data . removeIcon || avatar . getAttribute ( "changed-by-editusers" ) ) {
if ( avatar . tagName == "IMG" ) avatar . setAttribute ( "src" , data . removeIcon ? null : ( data . url || BDFDB . getUserAvatar ( info . id ) ) ) ;
else {
let url = data . removeIcon ? null : ( "url(" + ( data . url || BDFDB . getUserAvatar ( info . id ) ) + ")" ) ;
2019-07-18 15:09:53 +02:00
if ( url && BDFDB . getParentEle ( BDFDB . dotCN . userprofile , avatar ) && url . search ( /discordapp\.com\/avatars\/[0-9]*\/a_/ ) > - 1 ) url = url . replace ( ".webp)" , ".gif)" ) ;
2019-01-06 19:56:17 +01:00
avatar . style . setProperty ( "background-image" , url ) ;
if ( data . url && ! data . removeIcon ) {
avatar . style . setProperty ( "background-position" , "center" ) ;
avatar . style . setProperty ( "background-size" , "cover" ) ;
}
2019-01-02 09:58:59 +01:00
}
2019-01-06 19:56:17 +01:00
if ( data . url || data . removeIcon ) {
avatar . setAttribute ( "changed-by-editusers" , true ) ;
2019-07-18 15:09:53 +02:00
avatar . EditUsersChangeObserver = new MutationObserver ( ( changes , _ ) => { changes . forEach ( ( change , i ) => {
avatar . EditUsersChangeObserver . disconnect ( ) ;
this . changeAvatar ( info , avatar ) ;
} ) ; } ) ;
2019-01-06 19:56:17 +01:00
avatar . EditUsersChangeObserver . observe ( avatar , { attributes : true } ) ;
}
2019-01-12 15:07:06 +01:00
else avatar . removeAttribute ( "changed-by-editusers" ) ;
2018-12-22 23:41:25 +01:00
}
2018-10-11 10:21:26 +02:00
}
2019-01-26 22:45:19 +01:00
2018-12-22 23:41:25 +01:00
changeTooltip ( info , wrapper , type ) {
2018-12-25 17:09:23 +01:00
if ( ! info || ! wrapper || ! wrapper . parentElement ) return ;
2019-01-01 20:41:27 +01:00
let data = this . getUserData ( info . id , wrapper ) ;
2019-04-25 22:44:02 +02:00
wrapper = BDFDB . containsClass ( wrapper , BDFDB . disCN . guildicon ) ? wrapper . parentElement . parentElement . parentElement : wrapper ;
2019-01-17 23:48:29 +01:00
wrapper . removeEventListener ( "mouseenter" , wrapper . tooltipListenerEditUsers ) ;
if ( data . name ) {
wrapper . tooltipListenerEditUsers = ( ) => {
BDFDB . createTooltip ( data . name , wrapper , { type , selector : "EditUsers-tooltip" , css : ` body ${ BDFDB . dotCN . tooltip } :not(.EditUsers-tooltip) {display: none !important;} ` } ) ;
} ;
wrapper . addEventListener ( "mouseenter" , wrapper . tooltipListenerEditUsers ) ;
}
2018-10-11 10:21:26 +02:00
}
2019-01-26 22:45:19 +01:00
2019-08-06 20:53:56 +02:00
addTag ( info , wrapper , selector = "" , container ) {
2019-01-17 23:48:29 +01:00
if ( ! info || ! wrapper || ! wrapper . parentElement || BDFDB . containsClass ( wrapper , BDFDB . disCN . accountinfodetails ) || BDFDB . containsClass ( wrapper , "discord-tag" ) ) return ;
2018-12-27 15:20:01 +01:00
BDFDB . removeEles ( wrapper . querySelectorAll ( ".EditUsers-tag" ) ) ;
2019-01-01 20:41:27 +01:00
let data = this . getUserData ( info . id , wrapper ) ;
if ( data . tag ) {
2019-09-07 09:21:39 +02:00
let member = data . ignoreTagColor ? ( BDFDB . LibraryModules . MemberStore . getMember ( BDFDB . LibraryModules . LastGuildStore . getGuildId ( ) , info . id ) || { } ) : { } ;
2019-08-19 11:17:57 +02:00
let color3 = BDFDB . isObject ( data . color3 ) && ! data . ignoreTagColor ? BDFDB . colorGRADIENT ( data . color3 ) : BDFDB . colorCONVERT ( ! data . ignoreTagColor ? data . color3 : member . colorString , "RGB" ) ;
let color4 = BDFDB . isObject ( data . color4 ) && ! data . ignoreTagColor ? BDFDB . colorGRADIENT ( data . color4 ) : ( ! data . ignoreTagColor && data . color4 ? BDFDB . colorCONVERT ( data . color4 , "RGB" ) : ( color3 ? ( BDFDB . colorISBRIGHT ( color3 ) ? "black" : "white" ) : null ) ) ;
2018-12-22 23:41:25 +01:00
let tag = document . createElement ( "span" ) ;
2019-08-06 20:53:56 +02:00
let invert = container && ! color3 && ! color4 && container . firstElementChild && ! ( BDFDB . containsClass ( container . firstElementChild , BDFDB . disCN . userpopoutheadernormal ) || BDFDB . containsClass ( container . firstElementChild , BDFDB . disCN . userprofiletopsectionnormal ) ) ;
tag . className = "EditUsers-tag " + ( ! invert ? BDFDB . disCN . bottagregular : BDFDB . disCN . bottaginvert ) + ( selector ? ( " " + selector ) : "" ) ;
2019-08-19 11:17:57 +02:00
tag . style . setProperty ( "background" , ! invert ? color3 : color4 , "important" ) ;
let fontcolor = invert ? color3 : color4 ;
let fontobj = invert ? data . color3 : data . color4 ;
if ( BDFDB . isObject ( fontobj ) ) tag . appendChild ( BDFDB . htmlToElement ( ` <span style="pointer-events: none; -webkit-background-clip: text !important; color: transparent !important; background-image: ${ fontcolor } !important;"> ${ BDFDB . encodeToHTML ( data . tag ) } </span> ` ) ) ;
else {
tag . innerText = data . tag ;
tag . style . setProperty ( "color" , fontcolor , "important" ) ;
}
2018-12-22 23:41:25 +01:00
wrapper . appendChild ( tag ) ;
2018-12-19 13:44:41 +01:00
}
2018-10-11 10:21:26 +02:00
}
2019-01-26 22:45:19 +01:00
2019-01-12 15:07:06 +01:00
changePrivateChannel ( info , username ) {
if ( ! info || ! username || ! username . parentElement ) return ;
let dmchannel = BDFDB . getParentEle ( BDFDB . dotCN . dmchannel , username ) ;
if ( ! dmchannel ) return ;
if ( username . EditUsersChangeObserver && typeof username . EditUsersChangeObserver . disconnect == "function" ) username . EditUsersChangeObserver . disconnect ( ) ;
2019-01-17 23:48:29 +01:00
dmchannel . removeEventListener ( "mouseenter" , dmchannel . mouseenterListenerEditUsers ) ;
dmchannel . removeEventListener ( "mouseleave" , dmchannel . mouseleaveListenerEditUsers ) ;
2019-01-12 15:07:06 +01:00
let data = this . getUserData ( info . id , username ) ;
if ( data . name || data . color1 || data . color2 || username . getAttribute ( "changed-by-editusers" ) ) {
2019-01-17 23:48:29 +01:00
if ( username . EditUsersHovered || BDFDB . containsClass ( dmchannel , BDFDB . disCN . dmchannelselected ) ) colorHover ( ) ;
2019-01-12 15:07:06 +01:00
else colorDefault ( ) ;
2019-01-26 22:45:19 +01:00
2019-01-12 15:07:06 +01:00
if ( data . name || data . color1 || data . color2 ) {
2019-01-17 23:48:29 +01:00
dmchannel . mouseenterListenerEditUsers = ( ) => {
username . EditUsersHovered = true ;
colorHover ( ) ;
} ;
dmchannel . mouseleaveListenerEditUsers = ( ) => {
delete username . EditUsersHovered ;
colorDefault ( ) ;
} ;
dmchannel . addEventListener ( "mouseenter" , dmchannel . mouseenterListenerEditUsers ) ;
dmchannel . addEventListener ( "mouseleave" , dmchannel . mouseleaveListenerEditUsers ) ;
2019-01-12 15:07:06 +01:00
username . setAttribute ( "changed-by-editusers" , true ) ;
username . EditUsersChangeObserver = new MutationObserver ( ( changes , _ ) => {
username . EditUsersChangeObserver . disconnect ( ) ;
this . changePrivateChannel ( info , username ) ;
} ) ;
username . EditUsersChangeObserver . observe ( username , { attributes : true } ) ;
}
else username . removeAttribute ( "changed-by-editusers" ) ;
function colorDefault ( ) {
2019-08-19 11:17:57 +02:00
if ( BDFDB . isObject ( data . color1 ) ) {
username . style . removeProperty ( "color" ) ;
BDFDB . setInnerText ( username , BDFDB . htmlToElement ( ` <span style="pointer-events: none; -webkit-background-clip: text !important; color: transparent !important; background-image: ${ BDFDB . colorGRADIENT ( BDFDB . colorCHANGE ( data . color1 , - 0.5 ) ) } !important;"> ${ BDFDB . encodeToHTML ( data . name || info . username ) } </span> ` ) ) ;
}
else {
username . style . setProperty ( "color" , BDFDB . colorCHANGE ( data . color1 , - 0.5 , "RGB" ) , "important" ) ;
BDFDB . setInnerText ( username , data . name || info . username ) ;
}
username . style . setProperty ( "background" , BDFDB . isObject ( data . color2 ) ? BDFDB . colorGRADIENT ( BDFDB . colorCHANGE ( data . color2 , - 0.5 ) ) : BDFDB . colorCHANGE ( data . color2 , - 0.5 , "RGB" ) , "important" ) ;
2019-01-12 15:07:06 +01:00
}
function colorHover ( ) {
2019-08-19 11:17:57 +02:00
if ( BDFDB . isObject ( data . color1 ) ) {
username . style . removeProperty ( "color" ) ;
BDFDB . setInnerText ( username , BDFDB . htmlToElement ( ` <span style="pointer-events: none; -webkit-background-clip: text !important; color: transparent !important; background-image: ${ BDFDB . colorGRADIENT ( data . color1 ) } !important;"> ${ BDFDB . encodeToHTML ( data . name || info . username ) } </span> ` ) ) ;
}
else {
username . style . setProperty ( "color" , BDFDB . colorCONVERT ( data . color1 , "RGB" ) , "important" ) ;
BDFDB . setInnerText ( username , data . name || info . username ) ;
}
username . style . setProperty ( "background" , BDFDB . isObject ( data . color2 ) ? BDFDB . colorGRADIENT ( data . color2 ) : BDFDB . colorCONVERT ( data . color2 , "RGB" ) , "important" ) ;
2019-01-12 15:07:06 +01:00
}
}
}
2019-01-26 22:45:19 +01:00
2018-12-22 23:41:25 +01:00
changeMention ( info , mention ) {
2018-12-25 17:09:23 +01:00
if ( ! info || ! mention || ! mention . parentElement ) return ;
2018-12-26 09:04:41 +01:00
if ( mention . EditUsersChangeObserver && typeof mention . EditUsersChangeObserver . disconnect == "function" ) mention . EditUsersChangeObserver . disconnect ( ) ;
2019-01-17 23:48:29 +01:00
mention . removeEventListener ( "mouseover" , mention . mouseoverListenerEditUsers ) ;
mention . removeEventListener ( "mouseout" , mention . mouseoutListenerEditUsers ) ;
2019-01-01 20:41:27 +01:00
let data = this . getUserData ( info . id , mention ) ;
2019-09-07 09:21:39 +02:00
let member = BDFDB . LibraryModules . MemberStore . getMember ( BDFDB . LibraryModules . LastGuildStore . getGuildId ( ) , info . id ) || { } ;
2019-08-19 11:17:57 +02:00
let name = "@" + ( data . name ? data . name : ( BDFDB . isPluginEnabled ( "RemoveNicknames" ) ? window . bdplugins . RemoveNicknames . plugin . getNewName ( info ) : member . nick || info . username ) ) ;
2019-09-04 12:34:02 +02:00
2019-08-19 11:17:57 +02:00
let isgradient = data . color1 && BDFDB . isObject ( data . color1 ) ;
let datacolor = data . color1 || ( BDFDB . isPluginEnabled ( "BetterRoleColors" ) ? member . colorString : null ) ;
let color = isgradient ? BDFDB . colorGRADIENT ( data . color1 ) : BDFDB . colorCONVERT ( datacolor , "RGB" ) ;
let color0 _1 = isgradient ? BDFDB . colorGRADIENT ( BDFDB . colorSETALPHA ( data . color1 , 0.1 , "RGB" ) ) : BDFDB . colorSETALPHA ( datacolor , 0.1 , "RGB" ) ;
let color0 _7 = isgradient ? BDFDB . colorGRADIENT ( BDFDB . colorSETALPHA ( data . color1 , 0.7 , "RGB" ) ) : BDFDB . colorSETALPHA ( datacolor , 0.7 , "RGB" ) ;
2019-09-04 12:34:02 +02:00
2018-12-26 09:04:41 +01:00
if ( mention . EditUsersHovered ) colorHover ( ) ;
else colorDefault ( ) ;
2019-01-17 23:48:29 +01:00
mention . mouseoverListenerEditUsers = ( ) => {
mention . EditUsersHovered = true ;
colorHover ( ) ;
} ;
mention . mouseoutListenerEditUsers = ( ) => {
delete mention . EditUsersHovered ;
colorDefault ( ) ;
} ;
mention . addEventListener ( "mouseover" , mention . mouseoverListenerEditUsers ) ;
mention . addEventListener ( "mouseout" , mention . mouseoutListenerEditUsers ) ;
2018-12-26 10:26:55 +01:00
mention . EditUsersChangeObserver = new MutationObserver ( ( changes , _ ) => {
mention . EditUsersChangeObserver . disconnect ( ) ;
this . changeMention ( info , mention ) ;
} ) ;
mention . EditUsersChangeObserver . observe ( mention , { attributes : true } ) ;
2018-12-26 09:04:41 +01:00
function colorDefault ( ) {
2019-08-19 11:17:57 +02:00
mention . style . setProperty ( "background" , color0 _1 , "important" ) ;
if ( isgradient ) {
mention . style . removeProperty ( "color" ) ;
BDFDB . setInnerText ( mention , BDFDB . htmlToElement ( ` <span style="pointer-events: none; -webkit-background-clip: text !important; color: transparent !important; background-image: ${ color } !important;"> ${ BDFDB . encodeToHTML ( name ) } </span> ` ) ) ;
}
else {
mention . style . setProperty ( "color" , color , "important" ) ;
BDFDB . setInnerText ( mention , name ) ;
}
2018-12-26 09:04:41 +01:00
}
function colorHover ( ) {
2019-08-19 11:17:57 +02:00
mention . style . setProperty ( "background" , color0 _7 , "important" ) ;
mention . style . setProperty ( "color" , data . color1 ? "#FFFFFF" : null , "important" ) ;
BDFDB . setInnerText ( mention , name ) ;
2018-12-22 22:34:45 +01:00
}
2018-10-11 10:21:26 +02:00
}
2019-01-26 22:45:19 +01:00
2019-08-29 10:44:05 +02:00
changeVoiceUser ( info , username , speaking ) {
2018-12-25 17:09:23 +01:00
if ( ! info || ! username || ! username . parentElement ) return ;
2019-01-01 20:41:27 +01:00
if ( username . EditUsersChangeObserver && typeof username . EditUsersChangeObserver . disconnect == "function" ) username . EditUsersChangeObserver . disconnect ( ) ;
2019-04-23 08:09:58 +02:00
username . removeEventListener ( "mouseover" , username . mouseoverListenerEditUsers ) ;
username . removeEventListener ( "mouseout" , username . mouseoutListenerEditUsers ) ;
2019-01-01 20:41:27 +01:00
let data = this . getUserData ( info . id , username ) ;
2019-01-06 19:56:17 +01:00
if ( data . name || data . color1 || username . getAttribute ( "changed-by-editusers" ) ) {
2019-09-07 09:21:39 +02:00
let member = BDFDB . LibraryModules . MemberStore . getMember ( BDFDB . LibraryModules . LastGuildStore . getGuildId ( ) , info . id ) || { } ;
2019-04-23 08:09:58 +02:00
if ( username . EditUsersHovered ) colorHover ( ) ;
else colorDefault ( ) ;
2019-01-06 19:56:17 +01:00
if ( data . name || data . color1 ) {
2019-04-23 08:09:58 +02:00
username . mouseoverListenerEditUsers = ( ) => {
username . EditUsersHovered = true ;
colorHover ( ) ;
} ;
username . mouseoutListenerEditUsers = ( ) => {
delete username . EditUsersHovered ;
colorDefault ( ) ;
} ;
username . parentElement . parentElement . addEventListener ( "mouseover" , username . mouseoverListenerEditUsers ) ;
username . parentElement . parentElement . addEventListener ( "mouseout" , username . mouseoutListenerEditUsers ) ;
2019-01-06 19:56:17 +01:00
username . EditUsersChangeObserver = new MutationObserver ( ( changes , _ ) => {
username . EditUsersChangeObserver . disconnect ( ) ;
2019-08-29 10:44:05 +02:00
this . changeVoiceUser ( info , username , speaking ) ;
2019-01-06 19:56:17 +01:00
} ) ;
username . EditUsersChangeObserver . observe ( username , { attributes : true } ) ;
}
2019-01-12 15:07:06 +01:00
else username . removeAttribute ( "changed-by-editusers" ) ;
2019-04-23 08:09:58 +02:00
function colorDefault ( ) {
2019-08-19 11:17:57 +02:00
if ( BDFDB . isObject ( data . color1 ) ) {
username . style . removeProperty ( "color" ) ;
2019-08-29 10:44:05 +02:00
BDFDB . setInnerText ( username , BDFDB . htmlToElement ( ` <span style="pointer-events: none; -webkit-background-clip: text !important; color: transparent !important; background-image: ${ BDFDB . colorGRADIENT ( ! speaking ? BDFDB . colorCHANGE ( data . color1 , - 50 ) : data . color1 ) } !important;"> ${ BDFDB . encodeToHTML ( data . name || member . nick || info . username ) } </span> ` ) ) ;
2019-08-19 11:17:57 +02:00
}
else {
var color1 = data . color1 || ( BDFDB . isPluginEnabled ( "BetterRoleColors" ) ? member . colorString : "" ) ;
2019-08-29 10:44:05 +02:00
username . style . setProperty ( "color" , ! speaking ? BDFDB . colorCHANGE ( color1 , - 50 , "RGB" ) : BDFDB . colorCONVERT ( color1 , "RGB" ) , "important" ) ;
2019-08-19 11:17:57 +02:00
BDFDB . setInnerText ( username , data . name || member . nick || info . username ) ;
}
2019-04-23 08:09:58 +02:00
}
function colorHover ( ) {
2019-08-19 11:17:57 +02:00
if ( BDFDB . isObject ( data . color1 ) ) {
username . style . removeProperty ( "color" ) ;
BDFDB . setInnerText ( username , BDFDB . htmlToElement ( ` <span style="pointer-events: none; -webkit-background-clip: text !important; color: transparent !important; background-image: ${ BDFDB . colorGRADIENT ( data . color1 ) } !important;"> ${ BDFDB . encodeToHTML ( data . name || member . nick || info . username ) } </span> ` ) ) ;
}
else {
username . style . setProperty ( "color" , BDFDB . colorCONVERT ( data . color1 , "RGB" ) , "important" ) ;
BDFDB . setInnerText ( username , data . name || member . nick || info . username ) ;
}
2019-04-23 08:09:58 +02:00
}
2019-01-01 20:41:27 +01:00
}
2018-12-22 23:41:25 +01:00
}
2019-01-26 22:45:19 +01:00
2018-12-22 23:41:25 +01:00
getAvatarDiv ( wrapper ) {
2019-01-12 15:07:06 +01:00
var avatar = wrapper . querySelector ( this . avatarselector ) ;
2018-12-22 23:41:25 +01:00
while ( ! avatar && wrapper . parentElement ) {
wrapper = wrapper . parentElement ;
2019-01-12 15:07:06 +01:00
avatar = wrapper . querySelector ( this . avatarselector ) ;
2018-10-11 10:21:26 +02:00
}
2018-12-22 23:41:25 +01:00
return avatar . firstElementChild || avatar ;
2018-10-11 10:21:26 +02:00
}
2019-01-26 22:45:19 +01:00
2019-01-01 20:41:27 +01:00
getUserData ( id , wrapper ) {
let data = BDFDB . loadData ( id , this , "users" ) ;
2019-08-29 10:44:05 +02:00
if ( ! data ) {
delete wrapper . EditUsersCachedDataState ;
return { } ;
}
else if ( wrapper . EditUsersCachedDataState ) {
return data ;
}
2019-09-04 12:34:02 +02:00
2019-01-01 20:41:27 +01:00
let allenabled = true , settings = BDFDB . getAllData ( this , "settings" ) ;
2019-02-07 22:54:50 +01:00
for ( let i in settings ) if ( ! settings [ i ] ) {
allenabled = false ;
break ;
}
2019-01-01 20:41:27 +01:00
if ( allenabled ) return data ;
2019-09-04 12:34:02 +02:00
2019-02-16 12:58:25 +01:00
let key = null ;
2019-01-17 23:48:29 +01:00
if ( ! BDFDB . containsClass ( wrapper , BDFDB . disCN . mention ) && BDFDB . getParentEle ( BDFDB . dotCN . messagegroup , wrapper ) ) key = "changeInChatWindow" ;
else if ( BDFDB . containsClass ( wrapper , BDFDB . disCN . mention ) ) key = "changeInMentions" ;
2019-01-01 20:41:27 +01:00
else if ( BDFDB . getParentEle ( BDFDB . dotCN . textareawrapchat , wrapper ) ) key = "changeInChatTextarea" ;
else if ( BDFDB . getParentEle ( BDFDB . dotCN . voiceuser , wrapper ) ) key = "changeInVoiceChat" ;
else if ( BDFDB . getParentEle ( BDFDB . dotCN . members , wrapper ) ) key = "changeInMemberList" ;
2019-06-19 21:17:58 +02:00
else if ( BDFDB . getParentEle ( BDFDB . dotCN . guildouter , wrapper ) ) key = "changeInRecentDms" ;
2019-01-01 20:41:27 +01:00
else if ( BDFDB . getParentEle ( BDFDB . dotCN . dmchannels , wrapper ) ) key = "changeInDmsList" ;
else if ( BDFDB . getParentEle ( BDFDB . dotCN . channelheaderheaderbar , wrapper ) ) key = "changeInDmHeader" ;
2019-02-19 20:43:46 +01:00
else if ( BDFDB . getParentEle ( BDFDB . dotCN . callavatarwrapper , wrapper ) || BDFDB . getParentEle ( BDFDB . dotCN . callincoming , wrapper ) || BDFDB . getParentEle ( BDFDB . dotCN . callcurrentcontainer , wrapper ) || BDFDB . getParentEle ( BDFDB . dotCN . pictureinpicture , wrapper ) ) key = "changeInDmCalls" ;
2019-01-01 20:41:27 +01:00
else if ( BDFDB . getParentEle ( BDFDB . dotCN . typing , wrapper ) ) key = "changeInTyping" ;
2019-01-08 13:19:55 +01:00
else if ( BDFDB . getParentEle ( BDFDB . dotCN . friends , wrapper ) || BDFDB . getParentEle ( BDFDB . dotCN . userprofilebody , wrapper ) ) key = "changeInFriendList" ;
2019-03-28 13:56:12 +01:00
else if ( BDFDB . getParentEle ( BDFDB . dotCN . invitemodalinviterow , wrapper ) ) key = "changeInInviteList" ;
2019-01-01 20:41:27 +01:00
else if ( BDFDB . getParentEle ( BDFDB . dotCN . activityfeed , wrapper ) ) key = "changeInActivity" ;
else if ( BDFDB . getParentEle ( BDFDB . dotCN . userpopout , wrapper ) ) key = "changeInUserPopout" ;
else if ( BDFDB . getParentEle ( BDFDB . dotCN . userprofileheader , wrapper ) ) key = "changeInUserProfil" ;
else if ( BDFDB . getParentEle ( BDFDB . dotCN . autocomplete , wrapper ) ) key = "changeInAutoComplete" ;
else if ( BDFDB . getParentEle ( BDFDB . dotCN . auditlog , wrapper ) ) key = "changeInAuditLog" ;
2019-02-16 12:58:25 +01:00
else if ( BDFDB . getParentEle ( BDFDB . dotCN . guildsettingsbannedcard , wrapper ) || BDFDB . getParentEle ( BDFDB . dotCN . guildsettingsinvitecard , wrapper ) || BDFDB . getParentEle ( BDFDB . dotCN . guildsettingsmembercard , wrapper ) ) key = "changeInMemberLog" ;
else if ( BDFDB . getParentEle ( BDFDB . dotCN . searchpopout , wrapper ) || BDFDB . getParentEle ( BDFDB . dotCN . searchpopoutdmaddpopout , wrapper ) || BDFDB . getParentEle ( BDFDB . dotCN . quickswitcher , wrapper ) ) key = "changeInSearchPopout" ;
2019-01-01 20:41:27 +01:00
else if ( BDFDB . getParentEle ( BDFDB . dotCN . accountinfo , wrapper ) ) key = "changeInUserAccount" ;
2019-03-27 19:18:10 +01:00
else if ( wrapper . parentElement == document . head ) key = "changeInAppTitle" ;
2019-09-04 12:34:02 +02:00
2019-08-29 10:44:05 +02:00
if ( ! key || settings [ key ] ) {
wrapper . EditUsersCachedDataState = true ;
return data ;
}
else {
return { } ;
}
2019-01-01 20:41:27 +01:00
}
2019-01-26 22:45:19 +01:00
2019-01-25 11:27:52 +01:00
addAutoCompleteMenu ( textarea , channel ) {
if ( textarea . parentElement . querySelector ( ".autocompleteEditUsersRow" ) ) return ;
let words = textarea . value . split ( /\s/ ) ;
let lastword = words [ words . length - 1 ] . trim ( ) ;
if ( lastword && lastword . length > 1 && lastword [ 0 ] == "@" ) {
let users = BDFDB . loadAllData ( this , "users" ) ;
if ( ! users ) return ;
let userarray = [ ] ;
for ( let id in users ) if ( users [ id ] . name ) {
2019-09-07 09:21:39 +02:00
let user = BDFDB . LibraryModules . UserStore . getUser ( id ) ;
let member = user ? BDFDB . LibraryModules . MemberStore . getMember ( channel . guild _id , id ) : null ;
2019-01-25 11:27:52 +01:00
if ( user && member ) userarray . push ( Object . assign ( { lowercasename : users [ id ] . name . toLowerCase ( ) , user , member } , users [ id ] ) ) ;
}
userarray = BDFDB . sortArrayByKey ( userarray . filter ( n => n . lowercasename . indexOf ( lastword . toLowerCase ( ) . slice ( 1 ) ) != - 1 ) , "lowercasename" ) ;
if ( userarray . length ) {
let autocompletemenu = textarea . parentElement . querySelector ( BDFDB . dotCNS . autocomplete + BDFDB . dotCN . autocompleteinner ) , amount = 15 ;
if ( ! autocompletemenu ) {
autocompletemenu = BDFDB . htmlToElement ( ` <div class=" ${ BDFDB . disCNS . autocomplete + BDFDB . disCN . autocomplete2 } autocompleteEditUsers"><div class=" ${ BDFDB . disCN . autocompleteinner } "><div class=" ${ BDFDB . disCNS . autocompleterowvertical + BDFDB . disCN . autocompleterow } autocompleteEditUsersRow"><div class=" ${ BDFDB . disCN . autocompleteselector } autocompleteEditUsersSelector"><div class=" ${ BDFDB . disCNS . autocompletecontenttitle + BDFDB . disCNS . small + BDFDB . disCNS . size12 + BDFDB . disCNS . height16 + BDFDB . disCN . weightsemibold } "> ${ BDFDB . LanguageStrings . MEMBERS _MATCHING . replace ( "{{prefix}}" , BDFDB . encodeToHTML ( lastword ) ) } </strong></div></div></div></div></div> ` ) ;
textarea . parentElement . appendChild ( autocompletemenu ) ;
autocompletemenu = autocompletemenu . firstElementChild ;
}
else {
amount -= autocompletemenu . querySelectorAll ( BDFDB . dotCN . autocompleteselectable ) . length ;
}
2019-01-26 22:45:19 +01:00
2019-01-25 11:27:52 +01:00
BDFDB . addEventListener ( this , autocompletemenu , "mouseenter" , BDFDB . dotCN . autocompleteselectable , e => {
var selected = autocompletemenu . querySelectorAll ( BDFDB . dotCN . autocompleteselected ) ;
BDFDB . removeClass ( selected , BDFDB . disCN . autocompleteselected ) ;
BDFDB . addClass ( selected , BDFDB . disCN . autocompleteselector ) ;
BDFDB . addClass ( e . currentTarget , BDFDB . disCN . autocompleteselected ) ;
} ) ;
2019-01-26 22:45:19 +01:00
2019-01-25 11:27:52 +01:00
for ( let data of userarray ) {
if ( amount -- < 1 ) break ;
2019-07-20 11:38:57 +02:00
let status = BDFDB . getUserStatus ( data . user . id ) ;
2019-08-19 11:17:57 +02:00
let isgradient = data . color1 && BDFDB . isObject ( data . color1 ) ;
let username = isgradient ? ` <div class=" ${ BDFDB . disCN . marginleft8 } " changed-by-editusers="true" style="flex: 1 1 auto;"><span style="pointer-events: none; -webkit-background-clip: text !important; color: transparent !important; background-image: ${ BDFDB . colorGRADIENT ( data . color1 ) } !important;"> ${ BDFDB . encodeToHTML ( data . name || data . member . nick || data . user . username ) } </span></div> ` : ` <div class=" ${ BDFDB . disCN . marginleft8 } " changed-by-editusers="true" style="flex: 1 1 auto; ${ data . color1 ? ( ' color: ' + BDFDB . colorCONVERT ( data . color1 , 'RGB' ) + ' !important;' ) : '' } "> ${ BDFDB . encodeToHTML ( data . name || data . member . nick || data . user . username ) } </div> ` ;
let autocompleterow = BDFDB . htmlToElement ( ` <div class=" ${ BDFDB . disCNS . autocompleterowvertical + BDFDB . disCN . autocompleterow } autocompleteEditUsersRow"><div userid=" ${ data . user . id } " class=" ${ BDFDB . disCNS . autocompleteselector + BDFDB . disCN . autocompleteselectable } autocompleteEditUsersSelector"><div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . flex2 + BDFDB . disCNS . horizontal + BDFDB . disCNS . horizontal2 + BDFDB . disCNS . directionrow + BDFDB . disCNS . justifystart + BDFDB . disCNS . aligncenter + BDFDB . disCNS . nowrap + BDFDB . disCN . autocompletecontent } " style="flex: 1 1 auto;"><div class=" ${ BDFDB . disCN . avatarwrapper } " role="img" aria-label=" ${ data . user . username } , ${ BDFDB . LanguageStrings [ "STATUS_" + status . toUpperCase ( ) ] } " aria-hidden="false" style="width: 24px; height: 24px;"><svg width="30" height="24" viewBox="0 0 30 24" class=" ${ BDFDB . disCN . avatarmask } " aria-hidden="true"><foreignObject x="0" y="0" width="24" height="24" mask="url(#svg-mask-avatar-status-round-24)"><img src=" ${ data . url || BDFDB . getUserAvatar ( data . user . id ) } " alt=" " class=" ${ BDFDB . disCN . avatar } " aria-hidden="true"></foreignObject><rect width="8" height="8" x="16" y="16" fill=" ${ BDFDB . getUserStatusColor ( status ) } " mask="url(#svg-mask-status- ${ status } )" class=" ${ BDFDB . disCN . avatarpointerevents } "></rect></svg></div> ${ username } <div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . flex2 + BDFDB . disCNS . horizontal + BDFDB . disCNS . horizontal2 + BDFDB . disCNS . directionrow + BDFDB . disCNS . justifystart + BDFDB . disCNS . alignbaseline + BDFDB . disCNS . nowrap + BDFDB . disCN . autocompletedescription } " style="flex: 0 1 auto;"><div class=" ${ BDFDB . disCN . autocompletedescriptionusername } "> ${ BDFDB . encodeToHTML ( data . user . username ) } </div><div class=" ${ BDFDB . disCN . autocompletedescriptiondiscriminator } "># ${ data . user . discriminator } </div></div></div></div></div> ` ) ;
2019-01-25 11:27:52 +01:00
autocompleterow . querySelector ( BDFDB . dotCN . autocompleteselectable ) . addEventListener ( "click" , ( ) => { this . swapWordWithMention ( textarea ) ; } ) ;
autocompletemenu . appendChild ( autocompleterow ) ;
}
if ( ! autocompletemenu . querySelector ( BDFDB . dotCN . autocompleteselected ) ) {
BDFDB . addClass ( autocompletemenu . querySelector ( ".autocompleteEditUsersRow " + BDFDB . dotCN . autocompleteselectable ) , BDFDB . disCN . autocompleteselected ) ;
}
}
}
}
2019-01-26 22:45:19 +01:00
2019-01-25 11:27:52 +01:00
getNextSelection ( menu , selected , forward ) {
selected = selected ? selected : menu . querySelector ( BDFDB . dotCN . autocompleteselected ) . parentElement ;
let next , sibling = forward ? selected . nextElementSibling : selected . previousElementSibling ;
if ( sibling ) {
next = sibling . querySelector ( BDFDB . dotCN . autocompleteselectable ) ;
}
else {
let items = menu . querySelectorAll ( BDFDB . dotCN . autocompleteselectable ) ;
2019-09-04 12:34:02 +02:00
next = forward ? items [ 0 ] : items [ items . length - 1 ] ;
2019-01-25 11:27:52 +01:00
}
return next ? next : this . getNextSelection ( menu , sibling , forward ) ;
}
2019-01-26 22:45:19 +01:00
2019-01-25 11:27:52 +01:00
swapWordWithMention ( textarea ) {
let selected = textarea . parentElement . querySelector ( ".autocompleteEditUsersRow " + BDFDB . dotCN . autocompleteselected ) ;
let words = textarea . value . split ( /\s/ ) ;
let lastword = words [ words . length - 1 ] . trim ( ) ;
if ( selected && lastword ) {
let username = selected . querySelector ( BDFDB . dotCN . autocompletedescriptionusername ) . textContent ;
let discriminator = selected . querySelector ( BDFDB . dotCN . autocompletedescriptiondiscriminator ) . textContent ;
let userid = selected . getAttribute ( "userid" ) ;
BDFDB . removeEles ( ".autocompleteEditUsers" , ".autocompleteEditUsersRow" ) ;
2019-09-04 12:34:02 +02:00
textarea . focus ( ) ;
2019-01-25 11:27:52 +01:00
textarea . selectionStart = textarea . value . length - lastword . length ;
textarea . selectionEnd = textarea . value . length ;
2019-01-25 12:15:44 +01:00
document . execCommand ( "insertText" , false , ( username && discriminator ? ( "@" + username + discriminator ) : ` <@! ${ userid } > ` ) + " " ) ;
2019-01-25 11:27:52 +01:00
textarea . selectionStart = textarea . value . length ;
textarea . selectionEnd = textarea . value . length ;
}
}
2019-01-26 22:45:19 +01:00
2018-10-11 10:21:26 +02:00
setLabelsByLanguage ( ) {
switch ( BDFDB . getDiscordLanguage ( ) . id ) {
case "hr" : //croatian
return {
context _localusersettings _text : "Lokalne korisničke postavke" ,
submenu _usersettings _text : "Promijeni postavke" ,
submenu _resetsettings _text : "Poništi korisnika" ,
modal _header _text : "Lokalne korisničke postavke" ,
modal _username _text : "Lokalno korisničko ime" ,
modal _usertag _text : "Oznaka" ,
modal _userurl _text : "Ikona" ,
modal _removeicon _text : "Ukloni ikonu" ,
modal _tabheader1 _text : "Korisnik" ,
modal _tabheader2 _text : "Boja naziva" ,
modal _tabheader3 _text : "Boja oznaka" ,
modal _colorpicker1 _text : "Boja naziva" ,
modal _colorpicker2 _text : "Boja pozadine" ,
modal _colorpicker3 _text : "Boja oznaka" ,
modal _colorpicker4 _text : "Boja fonta" ,
modal _ignoreurl _text : "URL ignorirati" ,
modal _ignoretagcolor _text : "Upotrijebite boju uloga" ,
modal _validurl _text : "Vrijedi URL" ,
modal _invalidurl _text : "Nevažeći URL" ,
btn _cancel _text : "Prekid" ,
btn _save _text : "Uštedjeti"
} ;
case "da" : //danish
return {
context _localusersettings _text : "Lokal brugerindstillinger" ,
submenu _usersettings _text : "Skift indstillinger" ,
submenu _resetsettings _text : "Nulstil bruger" ,
modal _header _text : "Lokal brugerindstillinger" ,
modal _username _text : "Lokalt brugernavn" ,
modal _usertag _text : "Initialer" ,
modal _userurl _text : "Ikon" ,
modal _removeicon _text : "Fjern ikon" ,
modal _tabheader1 _text : "Bruger" ,
modal _tabheader2 _text : "Navnefarve" ,
modal _tabheader3 _text : "Etiketfarve" ,
modal _colorpicker1 _text : "Navnefarve" ,
modal _colorpicker2 _text : "Baggrundsfarve" ,
modal _colorpicker3 _text : "Etiketfarve" ,
modal _colorpicker4 _text : "Skriftfarve" ,
modal _ignoreurl _text : "Ignorer URL" ,
modal _ignoretagcolor _text : "Brug rollefarve" ,
modal _validurl _text : "Gyldig URL" ,
modal _invalidurl _text : "Ugyldig URL" ,
btn _cancel _text : "Afbryde" ,
btn _save _text : "Spare"
} ;
case "de" : //german
return {
context _localusersettings _text : "Lokale Benutzereinstellungen" ,
submenu _usersettings _text : "Einstellungen ändern" ,
submenu _resetsettings _text : "Benutzer zurücksetzen" ,
modal _header _text : "Lokale Benutzereinstellungen" ,
modal _username _text : "Lokaler Benutzername" ,
modal _usertag _text : "Etikett" ,
modal _userurl _text : "Icon" ,
modal _removeicon _text : "Entferne Icon" ,
modal _tabheader1 _text : "Benutzer" ,
modal _tabheader2 _text : "Namensfarbe" ,
modal _tabheader3 _text : "Etikettfarbe" ,
modal _colorpicker1 _text : "Namensfarbe" ,
modal _colorpicker2 _text : "Hintergrundfarbe" ,
modal _colorpicker3 _text : "Etikettfarbe" ,
modal _colorpicker4 _text : "Schriftfarbe" ,
modal _ignoreurl _text : "URL ignorieren" ,
modal _ignoretagcolor _text : "Benutze Rollenfarbe" ,
modal _validurl _text : "Gültige URL" ,
modal _invalidurl _text : "Ungültige URL" ,
btn _cancel _text : "Abbrechen" ,
btn _save _text : "Speichern"
} ;
case "es" : //spanish
return {
context _localusersettings _text : "Ajustes local de usuario" ,
submenu _usersettings _text : "Cambiar ajustes" ,
submenu _resetsettings _text : "Restablecer usuario" ,
modal _header _text : "Ajustes local de usuario" ,
modal _username _text : "Nombre local de usuario" ,
modal _usertag _text : "Etiqueta" ,
modal _userurl _text : "Icono" ,
modal _removeicon _text : "Eliminar icono" ,
modal _tabheader1 _text : "Usuario" ,
modal _tabheader2 _text : "Color del nombre" ,
modal _tabheader3 _text : "Color de la etiqueta" ,
modal _colorpicker1 _text : "Color del nombre" ,
modal _colorpicker2 _text : "Color de fondo" ,
modal _colorpicker3 _text : "Color de la etiqueta" ,
modal _colorpicker4 _text : "Color de fuente" ,
modal _ignoreurl _text : "Ignorar URL" ,
modal _ignoretagcolor _text : "Usar color de rol" ,
modal _validurl _text : "URL válida" ,
modal _invalidurl _text : "URL inválida" ,
btn _cancel _text : "Cancelar" ,
btn _save _text : "Guardar"
} ;
case "fr" : //french
return {
context _localusersettings _text : "Paramètres locale d'utilisateur" ,
submenu _usersettings _text : "Modifier les paramètres" ,
submenu _resetsettings _text : "Réinitialiser l'utilisateur" ,
modal _header _text : "Paramètres locale d'utilisateur" ,
modal _username _text : "Nom local d'utilisateur" ,
modal _usertag _text : "Étiquette" ,
modal _userurl _text : "Icône" ,
modal _removeicon _text : "Supprimer l'icône" ,
modal _tabheader1 _text : "Serveur" ,
modal _tabheader2 _text : "Couleur du nom" ,
modal _tabheader3 _text : "Couleur de l'étiquette" ,
modal _colorpicker1 _text : "Couleur du nom" ,
modal _colorpicker2 _text : "Couleur de fond" ,
modal _colorpicker3 _text : "Couleur de l'étiquette" ,
modal _colorpicker4 _text : "Couleur de la police" ,
modal _ignoreurl _text : "Ignorer l'URL" ,
modal _ignoretagcolor _text : "Utiliser la couleur de rôle" ,
modal _validurl _text : "URL valide" ,
modal _invalidurl _text : "URL invalide" ,
btn _cancel _text : "Abandonner" ,
btn _save _text : "Enregistrer"
} ;
case "it" : //italian
return {
context _localusersettings _text : "Impostazioni locale utente" ,
submenu _usersettings _text : "Cambia impostazioni" ,
submenu _resetsettings _text : "Ripristina utente" ,
modal _header _text : "Impostazioni locale utente" ,
modal _username _text : "Nome locale utente" ,
modal _usertag _text : "Etichetta" ,
modal _userurl _text : "Icona" ,
modal _removeicon _text : "Rimuova l'icona" ,
modal _tabheader1 _text : "Utente" ,
modal _tabheader2 _text : "Colore del nome" ,
modal _tabheader3 _text : "Colore della etichetta" ,
modal _colorpicker1 _text : "Colore del nome" ,
modal _colorpicker2 _text : "Colore di sfondo" ,
modal _colorpicker3 _text : "Colore della etichetta" ,
modal _colorpicker4 _text : "Colore del carattere" ,
modal _ignoreurl _text : "Ignora l'URL" ,
modal _ignoretagcolor _text : "Usa il colore del ruolo" ,
modal _validurl _text : "URL valido" ,
modal _invalidurl _text : "URL non valido" ,
btn _cancel _text : "Cancellare" ,
btn _save _text : "Salvare"
} ;
case "nl" : //dutch
return {
context _localusersettings _text : "Lokale gebruikerinstellingen" ,
submenu _usersettings _text : "Verandere instellingen" ,
submenu _resetsettings _text : "Reset gebruiker" ,
modal _header _text : "Lokale gebruikerinstellingen" ,
modal _username _text : "Lokale gebruikernaam" ,
modal _usertag _text : "Etiket" ,
modal _userurl _text : "Icoon" ,
modal _removeicon _text : "Verwijder icoon" ,
modal _tabheader1 _text : "Gebruiker" ,
modal _tabheader2 _text : "Naamkleur" ,
modal _tabheader3 _text : "Etiketkleur" ,
modal _colorpicker1 _text : "Naamkleur" ,
modal _colorpicker2 _text : "Achtergrondkleur" ,
modal _colorpicker3 _text : "Etiketkleur" ,
modal _colorpicker4 _text : "Doopvontkleur" ,
modal _ignoreurl _text : "URL negeren" ,
modal _ignoretagcolor _text : "Gebruik rolkleur" ,
modal _validurl _text : "Geldige URL" ,
modal _invalidurl _text : "Ongeldige URL" ,
btn _cancel _text : "Afbreken" ,
btn _save _text : "Opslaan"
} ;
case "no" : //norwegian
return {
context _localusersettings _text : "Lokal brukerinnstillinger" ,
submenu _usersettings _text : "Endre innstillinger" ,
submenu _resetsettings _text : "Tilbakestill bruker" ,
modal _header _text : "Lokal brukerinnstillinger" ,
modal _username _text : "Lokalt gebruikernavn" ,
modal _usertag _text : "Stikkord" ,
modal _userurl _text : "Ikon" ,
modal _removeicon _text : "Fjern ikon" ,
modal _tabheader1 _text : "Bruker" ,
modal _tabheader2 _text : "Navnfarge" ,
modal _tabheader3 _text : "Stikkordfarge" ,
modal _colorpicker1 _text : "Navnfarge" ,
modal _colorpicker2 _text : "Bakgrunnfarge" ,
modal _colorpicker3 _text : "Stikkordfarge" ,
modal _colorpicker4 _text : "Skriftfarge" ,
modal _ignoreurl _text : "Ignorer URL" ,
modal _ignoretagcolor _text : "Bruk rollefarge" ,
modal _validurl _text : "Gyldig URL" ,
modal _invalidurl _text : "Ugyldig URL" ,
btn _cancel _text : "Avbryte" ,
btn _save _text : "Lagre"
} ;
case "pl" : //polish
return {
context _localusersettings _text : "Lokalne ustawienia użytkownika" ,
submenu _usersettings _text : "Zmień ustawienia" ,
submenu _resetsettings _text : "Resetuj ustawienia" ,
modal _header _text : "Lokalne ustawienia użytkownika" ,
modal _username _text : "Lokalna nazwa użytkownika" ,
modal _usertag _text : "Etykieta" ,
modal _userurl _text : "Ikona" ,
modal _removeicon _text : "Usuń ikonę" ,
modal _tabheader1 _text : "Użytkownik" ,
modal _tabheader2 _text : "Kolor nazwy" ,
modal _tabheader3 _text : "Kolor etykiety" ,
modal _colorpicker1 _text : "Kolor nazwy" ,
modal _colorpicker2 _text : "Kolor tła" ,
modal _colorpicker3 _text : "Kolor etykiety" ,
modal _colorpicker4 _text : "Kolor czcionki" ,
modal _ignoreurl _text : "Ignoruj URL" ,
modal _ignoretagcolor _text : "Użyj kolor roli" ,
modal _validurl _text : "Prawidłowe URL" ,
modal _invalidurl _text : "Nieprawidłowe URL" ,
btn _cancel _text : "Anuluj" ,
btn _save _text : "Zapisz"
} ;
case "pt-BR" : //portuguese (brazil)
return {
context _localusersettings _text : "Configurações local do utilizador" ,
submenu _usersettings _text : "Mudar configurações" ,
submenu _resetsettings _text : "Redefinir utilizador" ,
modal _header _text : "Configurações local do utilizador" ,
modal _username _text : "Nome local do utilizador" ,
modal _usertag _text : "Etiqueta" ,
modal _userurl _text : "Icone" ,
modal _removeicon _text : "Remover ícone" ,
modal _tabheader1 _text : "Utilizador" ,
modal _tabheader2 _text : "Cor do nome" ,
modal _tabheader3 _text : "Cor da etiqueta" ,
modal _colorpicker1 _text : "Cor do nome" ,
modal _colorpicker2 _text : "Cor do fundo" ,
modal _colorpicker3 _text : "Cor da etiqueta" ,
modal _colorpicker4 _text : "Cor da fonte" ,
modal _ignoreurl _text : "Ignorar URL" ,
modal _ignoretagcolor _text : "Use a cor do papel" ,
modal _validurl _text : "URL válido" ,
modal _invalidurl _text : "URL inválida" ,
btn _cancel _text : "Cancelar" ,
btn _save _text : "Salvar"
} ;
case "fi" : //finnish
return {
context _localusersettings _text : "Paikallinen käyttäjä asetukset" ,
submenu _usersettings _text : "Vaihda asetuksia" ,
submenu _resetsettings _text : "Nollaa käyttäjä" ,
modal _header _text : "Paikallinen käyttäjä asetukset" ,
modal _username _text : "Paikallinen käyttäjätunnus" ,
modal _usertag _text : "Merkki" ,
modal _userurl _text : "Ikonin" ,
modal _removeicon _text : "Poista kuvake" ,
modal _tabheader1 _text : "Käyttäjä" ,
modal _tabheader2 _text : "Nimiväri" ,
modal _tabheader3 _text : "Merkkiväri" ,
modal _colorpicker1 _text : "Nimiväri" ,
modal _colorpicker2 _text : "Taustaväri" ,
modal _colorpicker3 _text : "Merkkiväri" ,
modal _colorpicker4 _text : "Fontinväri" ,
modal _ignoreurl _text : "Ohita URL" ,
modal _ignoretagcolor _text : "Käytä rooliväriä" ,
modal _validurl _text : "Voimassa URL" ,
modal _invalidurl _text : "Virheellinen URL" ,
btn _cancel _text : "Peruuttaa" ,
btn _save _text : "Tallentaa"
} ;
case "sv" : //swedish
return {
context _localusersettings _text : "Lokal användareinställningar" ,
submenu _usersettings _text : "Ändra inställningar" ,
submenu _resetsettings _text : "Återställ användare" ,
modal _header _text : "Lokal användareinställningar" ,
modal _username _text : "Lokalt användarenamn" ,
modal _usertag _text : "Märka" ,
modal _userurl _text : "Ikon" ,
modal _removeicon _text : "Ta bort ikonen" ,
modal _tabheader1 _text : "Användare" ,
modal _tabheader2 _text : "Namnfärg" ,
modal _tabheader3 _text : "Märkafärg" ,
modal _colorpicker1 _text : "Namnfärg" ,
modal _colorpicker2 _text : "Bakgrundfärg" ,
modal _colorpicker3 _text : "Märkafärg" ,
modal _colorpicker4 _text : "Fontfärg" ,
modal _ignoreurl _text : "Ignorera URL" ,
modal _ignoretagcolor _text : "Använd rollfärg" ,
modal _validurl _text : "Giltig URL" ,
modal _invalidurl _text : "Ogiltig URL" ,
btn _cancel _text : "Avbryta" ,
btn _save _text : "Spara"
} ;
case "tr" : //turkish
return {
context _localusersettings _text : "Yerel Kullanı cı Ayarları " ,
submenu _usersettings _text : "Ayarları Değiştir" ,
submenu _resetsettings _text : "Kullanı cı Sı fı rla" ,
modal _header _text : "Yerel Kullanı cı Ayarları " ,
modal _username _text : "Yerel Kullanı cı Isim" ,
modal _usertag _text : "Etiket" ,
modal _userurl _text : "Simge" ,
modal _removeicon _text : "Simge kaldı r" ,
modal _tabheader1 _text : "Kullanı cı " ,
modal _tabheader2 _text : "Simge rengi" ,
modal _tabheader3 _text : "Isim rengi" ,
modal _colorpicker1 _text : "Simge rengi" ,
modal _colorpicker2 _text : "Arka fon rengi" ,
modal _colorpicker3 _text : "Etiket rengi" ,
modal _colorpicker4 _text : "Yazı rengi" ,
modal _ignoreurl _text : "URL yoksay" ,
modal _ignoretagcolor _text : "Rol rengini kullan" ,
modal _validurl _text : "Geçerli URL" ,
modal _invalidurl _text : "Geçersiz URL" ,
btn _cancel _text : "Iptal" ,
btn _save _text : "Kayı t"
} ;
case "cs" : //czech
return {
context _localusersettings _text : "Místní nastavení uživatel" ,
submenu _usersettings _text : "Změnit nastavení" ,
submenu _resetsettings _text : "Obnovit uživatel" ,
modal _header _text : "Místní nastavení uživatel" ,
modal _username _text : "Místní název uživatel" ,
modal _usertag _text : "Štítek" ,
modal _userurl _text : "Ikony" ,
modal _removeicon _text : "Odstranit ikonu" ,
modal _tabheader1 _text : "Uživatel" ,
modal _tabheader2 _text : "Barva název" ,
modal _tabheader3 _text : "Barva štítek" ,
modal _colorpicker1 _text : "Barva název" ,
modal _colorpicker2 _text : "Barva pozadí" ,
modal _colorpicker3 _text : "Barva štítek" ,
modal _colorpicker4 _text : "Barva fontu" ,
modal _ignoreurl _text : "Ignorovat URL" ,
modal _ignoretagcolor _text : "Použijte barva role" ,
modal _validurl _text : "Platná URL" ,
modal _invalidurl _text : "Neplatná URL" ,
btn _cancel _text : "Zrušení" ,
btn _save _text : "Uložit"
} ;
case "bg" : //bulgarian
return {
context _localusersettings _text : "Настройки за локални потребител" ,
submenu _usersettings _text : "Промяна на настройките" ,
submenu _resetsettings _text : "Възстановяване на потребител" ,
modal _header _text : "Настройки за локални потребител" ,
modal _username _text : "Локално име на потребител" ,
modal _usertag _text : "Cво б о де н край" ,
modal _userurl _text : "Икона" ,
modal _removeicon _text : "Премахване на иконата" ,
modal _tabheader1 _text : "Потребител" ,
modal _tabheader2 _text : "Цвят на име" ,
modal _tabheader3 _text : "Цвят на свободен край" ,
modal _colorpicker1 _text : "Цвят на име" ,
modal _colorpicker2 _text : "Цвят на заден план" ,
modal _colorpicker3 _text : "Цвят на свободен край" ,
modal _colorpicker4 _text : "Цвят на шрифта" ,
modal _ignoreurl _text : "Игнориране на URL" ,
modal _ignoretagcolor _text : "Използвайте цвят на ролите" ,
modal _validurl _text : "Валиден URL" ,
modal _invalidurl _text : "Невалиден URL" ,
btn _cancel _text : "Зъбести" ,
btn _save _text : "Cпа с ява не "
} ;
case "ru" : //russian
return {
context _localusersettings _text : "Настройки локального пользователь" ,
submenu _usersettings _text : "Изменить настройки" ,
submenu _resetsettings _text : "Сбросить пользователь" ,
modal _header _text : "Настройки локального пользователь" ,
modal _username _text : "Имя локального пользователь" ,
modal _usertag _text : "Tе г " ,
modal _userurl _text : "Значок" ,
modal _removeicon _text : "Удалить значок" ,
modal _tabheader1 _text : "Пользователь" ,
modal _tabheader2 _text : "Цвет имя" ,
modal _tabheader3 _text : "Цвет тег" ,
modal _colorpicker1 _text : "Цвет имя" ,
modal _colorpicker2 _text : "Цвет задний план" ,
modal _colorpicker3 _text : "Цвет тег" ,
modal _colorpicker4 _text : "Цвет шрифта" ,
modal _ignoreurl _text : "Игнорировать URL" ,
modal _ignoretagcolor _text : "Использовать цвет ролей" ,
modal _validurl _text : "Действительный URL" ,
modal _invalidurl _text : "Неверная URL" ,
btn _cancel _text : "Отмена" ,
btn _save _text : "Cпа с ти"
} ;
case "uk" : //ukrainian
return {
context _localusersettings _text : "Налаштування локального користувач" ,
submenu _usersettings _text : "Змінити налаштування" ,
submenu _resetsettings _text : "Скидання користувач" ,
modal _header _text : "Налаштування локального користувач" ,
modal _username _text : "Локальне ім'я користувач" ,
modal _usertag _text : "Tе г " ,
modal _userurl _text : "Іконка" ,
modal _removeicon _text : "Видалити піктограму" ,
modal _tabheader1 _text : "Користувач" ,
modal _tabheader2 _text : "Колір ім'я" ,
modal _tabheader3 _text : "Колір тег" ,
modal _colorpicker1 _text : "Колір ім'я" ,
modal _colorpicker2 _text : "Колір фон" ,
modal _colorpicker3 _text : "Колір тег" ,
modal _colorpicker4 _text : "Колір шрифту" ,
modal _ignoreurl _text : "Ігнорувати URL" ,
modal _ignoretagcolor _text : "Використовуйте рольовий колір" ,
modal _validurl _text : "Дійсна URL" ,
modal _invalidurl _text : "Недійсна URL" ,
btn _cancel _text : "Скасувати" ,
btn _save _text : "Зберегти"
} ;
case "ja" : //japanese
return {
context _localusersettings _text : "ローカルユーザーー設定" ,
submenu _usersettings _text : "設定を変更する" ,
submenu _resetsettings _text : "ユーザーーをリセットする" ,
modal _header _text : "ローカルユーザーー設定" ,
modal _username _text : "ローカルユーザーー名" ,
modal _usertag _text : "タグ" ,
modal _userurl _text : "アイコン" ,
modal _removeicon _text : "アイコンを削除" ,
modal _tabheader1 _text : "ユーザー" ,
modal _tabheader2 _text : "名の色" ,
modal _tabheader3 _text : "タグの色" ,
modal _colorpicker1 _text : "名の色" ,
modal _colorpicker2 _text : "バックグラウンドの色" ,
modal _colorpicker3 _text : "タグの色" ,
modal _colorpicker4 _text : "フォントの色" ,
modal _ignoreurl _text : "URL を無視する" ,
modal _ignoretagcolor _text : "ロールカラーを使用する" ,
modal _validurl _text : "有効な URL" ,
modal _invalidurl _text : "無効な URL" ,
btn _cancel _text : "キャンセル" ,
btn _save _text : "セーブ"
} ;
case "zh-TW" : //chinese (traditional)
return {
context _localusersettings _text : "本地用戶設置" ,
submenu _usersettings _text : "更改設置" ,
submenu _resetsettings _text : "重置用戶" ,
modal _header _text : "本地用戶設置" ,
modal _username _text : "用戶名稱" ,
modal _usertag _text : "標籤" ,
modal _userurl _text : "圖標" ,
modal _removeicon _text : "刪除圖標" ,
modal _tabheader1 _text : "用戶" ,
modal _tabheader2 _text : "名稱顏色" ,
modal _tabheader3 _text : "標籤顏色" ,
modal _colorpicker1 _text : "名稱顏色" ,
modal _colorpicker2 _text : "背景顏色" ,
modal _colorpicker3 _text : "標籤顏色" ,
modal _colorpicker4 _text : "字體顏色" ,
modal _ignoreurl _text : "忽略 URL" ,
modal _ignoretagcolor _text : "使用角色" ,
modal _validurl _text : "有效的 URL" ,
modal _invalidurl _text : "無效的 URL" ,
btn _cancel _text : "取消" ,
btn _save _text : "保存"
} ;
case "ko" : //korean
return {
context _localusersettings _text : "로컬 사용자 설정" ,
submenu _usersettings _text : "설정 변경" ,
submenu _resetsettings _text : "사용자 재설정" ,
modal _header _text : "로컬 사용자 설정" ,
modal _username _text : "로컬 사용자 이름" ,
modal _usertag _text : "꼬리표" ,
modal _userurl _text : "상" ,
modal _removeicon _text : "상 삭제" ,
modal _tabheader1 _text : "사용자" ,
modal _tabheader2 _text : "이름 색깔" ,
modal _tabheader3 _text : "꼬리표 색깔" ,
modal _colorpicker1 _text : "이름 색깔" ,
modal _colorpicker2 _text : "배경 색깔" ,
modal _colorpicker3 _text : "꼬리표 색깔" ,
modal _colorpicker4 _text : "글꼴 색깔" ,
modal _ignoreurl _text : "URL 무시" ,
modal _ignoretagcolor _text : "역할 색상 사용" ,
modal _validurl _text : "유효한 URL" ,
modal _invalidurl _text : "잘못된 URL" ,
btn _cancel _text : "취소" ,
btn _save _text : "저장"
} ;
default : //default: english
return {
context _localusersettings _text : "Local Usersettings" ,
submenu _usersettings _text : "Change Settings" ,
submenu _resetsettings _text : "Reset User" ,
modal _header _text : "Local Usersettings" ,
modal _username _text : "Local Username" ,
modal _usertag _text : "Tag" ,
modal _userurl _text : "Icon" ,
modal _removeicon _text : "Remove Icon" ,
modal _tabheader1 _text : "User" ,
modal _tabheader2 _text : "Namecolor" ,
modal _tabheader3 _text : "Tagcolor" ,
modal _colorpicker1 _text : "Namecolor" ,
modal _colorpicker2 _text : "Backgroundcolor" ,
modal _colorpicker3 _text : "Tagcolor" ,
modal _colorpicker4 _text : "Fontcolor" ,
modal _ignoreurl _text : "Ignore URL" ,
modal _ignoretagcolor _text : "Use Rolecolor" ,
modal _validurl _text : "Valid URL" ,
modal _invalidurl _text : "Invalid URL" ,
btn _cancel _text : "Cancel" ,
btn _save _text : "Save"
} ;
}
}
2019-01-04 16:53:42 +01:00
}