2019-10-18 19:19:38 +02:00
( _ => {
2019-12-01 12:16:38 +01:00
if ( window . BDFDB && window . BDFDB . ListenerUtils && typeof window . BDFDB . ListenerUtils . remove == "function" ) window . BDFDB . ListenerUtils . remove ( window . BDFDB ) ;
if ( window . BDFDB && window . BDFDB . ObserverUtils && typeof window . BDFDB . ObserverUtils . disconnect == "function" ) window . BDFDB . ObserverUtils . disconnect ( window . BDFDB ) ;
if ( window . BDFDB && window . BDFDB . ModuleUtils && typeof window . BDFDB . ModuleUtils . unpatch == "function" ) window . BDFDB . ModuleUtils . unpatch ( window . BDFDB ) ;
2019-12-07 10:21:17 +01:00
if ( window . BDFDB && window . BDFDB . WindowUtils && typeof window . BDFDB . WindowUtils . closeAll == "function" ) window . BDFDB . WindowUtils . closeAll ( window . BDFDB ) ;
if ( window . BDFDB && window . BDFDB . WindowUtils && typeof window . BDFDB . WindowUtils . removeListener == "function" ) window . BDFDB . WindowUtils . removeListener ( window . BDFDB ) ;
2019-12-01 12:16:38 +01:00
var BDFDB = {
myPlugins : Object . assign ( { } , window . BDFDB && window . BDFDB . myPlugins ) ,
InternalData : Object . assign ( {
pressedKeys : [ ] ,
mousePosition : {
pageX : 0 ,
pageY : 0
} ,
2020-01-30 15:46:30 +01:00
componentPatchQueries : { }
2020-01-09 13:21:40 +01:00
} ,
window . BDFDB && window . BDFDB . InternalData ,
{
2019-12-01 12:16:38 +01:00
creationTime : performance . now ( )
} ) ,
BDv2Api : window . BDFDB && window . BDFDB . BDv2Api || undefined ,
name : "$BDFDB"
} ;
2019-11-07 10:27:34 +01:00
var loadid = Math . round ( Math . random ( ) * 10000000000000000 ) , InternalBDFDB = { } ;
BDFDB . InternalData . loadid = loadid ;
2020-01-25 17:05:23 +01:00
if ( typeof Array . prototype . flat != "function" ) Array . prototype . flat = function ( ) { return this ; }
2019-11-03 16:53:33 +01:00
2020-02-03 11:39:06 +01:00
InternalBDFDB . defaults = {
settings : {
showToasts : { value : true , description : "Show Plugin start and stop Toasts" } ,
showSupportBadges : { value : true , description : "Show little Badges for Users who support my Patreon" } ,
addSupportLinks : { value : true , description : "Add PayPal/Patreon links to my Plugin Entries" }
}
} ;
2019-11-03 16:53:33 +01:00
BDFDB . LogUtils = { } ;
2019-11-03 18:31:51 +01:00
BDFDB . LogUtils . log = function ( string , name ) {
2019-11-03 16:53:33 +01:00
if ( typeof string != "string" ) string = "" ;
2019-11-03 18:31:51 +01:00
if ( typeof name != "string" || name == "$BDFDB" ) name = "BDFDB" ;
2019-12-06 12:53:45 +01:00
console . log ( ` %c[ ${ name } ] ` , "color: #3a71c1; font-weight: 700;" , string . trim ( ) ) ;
2019-11-03 16:53:33 +01:00
} ;
2019-11-03 18:31:51 +01:00
BDFDB . LogUtils . warn = function ( string , name ) {
2019-11-03 16:53:33 +01:00
if ( typeof string != "string" ) string = "" ;
2019-11-03 18:31:51 +01:00
if ( typeof name != "string" || name == "$BDFDB" ) name = "BDFDB" ;
2019-12-06 12:53:45 +01:00
console . warn ( ` %c[ ${ name } ] ` , "color: #3a71c1; font-weight: 700;" , string . trim ( ) ) ;
2019-11-03 16:53:33 +01:00
} ;
2019-11-03 18:31:51 +01:00
BDFDB . LogUtils . error = function ( string , name ) {
2019-11-03 16:53:33 +01:00
if ( typeof string != "string" ) string = "" ;
2019-11-03 18:31:51 +01:00
if ( typeof name != "string" || name == "$BDFDB" ) name = "BDFDB" ;
2019-12-06 12:53:45 +01:00
console . error ( ` %c[ ${ name } ] ` , "color: #3a71c1; font-weight: 700;" , "Fatal Error: " + string . trim ( ) ) ;
2019-10-18 10:56:41 +02:00
} ;
2019-11-03 16:53:33 +01:00
BDFDB . LogUtils . log ( "Loading library." ) ;
2019-10-18 10:56:41 +02:00
BDFDB . PluginUtils = { } ;
BDFDB . PluginUtils . init = function ( plugin ) {
plugin . name = plugin . name || ( typeof plugin . getName == "function" ? plugin . getName ( ) : null ) ;
plugin . version = plugin . version || ( typeof plugin . getVersion == "function" ? plugin . getVersion ( ) : null ) ;
plugin . author = plugin . author || ( typeof plugin . getAuthor == "function" ? plugin . getAuthor ( ) : null ) ;
plugin . description = plugin . description || ( typeof plugin . getDescription == "function" ? plugin . getDescription ( ) : null ) ;
2019-10-22 12:17:08 +02:00
2019-11-14 17:40:04 +01:00
if ( plugin . patchModules ) {
plugin . patchedModules = { after : plugin . patchModules } ;
delete plugin . patchModules ;
}
plugin . patchedModules = BDFDB . ObjectUtils . filter ( plugin . patchedModules , type => WebModulesData . Patchtypes . includes ( type ) , true ) ;
2019-10-22 12:17:08 +02:00
InternalBDFDB . clearStartTimeout ( plugin ) ;
2019-10-18 10:56:41 +02:00
2020-01-18 09:57:17 +01:00
let loadmessage = BDFDB . LanguageUtils . LibraryStringsFormat ( "toast_plugin_started" , "v" + plugin . version ) ;
2019-11-03 16:53:33 +01:00
BDFDB . LogUtils . log ( loadmessage , plugin . name ) ;
2020-02-03 12:49:03 +01:00
if ( ! BDFDB . BDUtils . getSettings ( "fork-ps-2" ) && BDFDB . DataUtils . get ( BDFDB , "settings" , "showToasts" ) ) BDFDB . NotificationUtils . toast ( plugin . name + " " + loadmessage , { nopointer : true , selector : "plugin-started-toast" } ) ;
2019-10-18 10:56:41 +02:00
2020-01-18 09:57:17 +01:00
let url = typeof plugin . getRawUrl == "function" && typeof plugin . getRawUrl ( ) == "string" ? plugin . getRawUrl ( ) : ` https://mwittrien.github.io/BetterDiscordAddons/Plugins/ ${ plugin . name } / ${ plugin . name } .plugin.js ` ;
2019-10-18 10:56:41 +02:00
BDFDB . PluginUtils . checkUpdate ( plugin . name , url ) ;
2019-11-20 16:25:28 +01:00
if ( BDFDB . ObjectUtils . is ( plugin . classes ) ) InternalBDFDB . addPluginClasses ( plugin ) ;
2019-11-20 16:30:59 +01:00
if ( typeof plugin . initConstructor === "function" ) BDFDB . TimeUtils . suppress ( plugin . initConstructor . bind ( plugin ) , "Could not initiate constructor!" , plugin . name ) ( ) ;
2019-11-20 16:28:31 +01:00
if ( typeof plugin . css === "string" ) BDFDB . DOMUtils . appendLocalStyle ( plugin . name , plugin . css ) ;
2019-10-18 10:56:41 +02:00
2019-10-22 12:17:08 +02:00
InternalBDFDB . patchPlugin ( plugin ) ;
2020-01-30 11:30:07 +01:00
InternalBDFDB . addSpecialListeners ( plugin ) ;
2019-10-18 10:56:41 +02:00
BDFDB . PluginUtils . translate ( plugin ) ;
BDFDB . PluginUtils . checkChangeLog ( plugin ) ;
if ( ! window . PluginUpdates || typeof window . PluginUpdates !== "object" ) window . PluginUpdates = { plugins : { } } ;
window . PluginUpdates . plugins [ url ] = { name : plugin . name , raw : url , version : plugin . version } ;
2019-11-01 10:14:50 +01:00
if ( typeof window . PluginUpdates . interval === "undefined" ) window . PluginUpdates . interval = BDFDB . TimeUtils . interval ( _ => { BDFDB . PluginUtils . checkAllUpdates ( ) ; } , 1000 * 60 * 60 * 2 ) ;
2019-10-18 10:56:41 +02:00
plugin . started = true ;
2019-10-22 12:17:08 +02:00
delete plugin . stopping ;
2019-10-18 10:56:41 +02:00
2019-11-28 14:11:05 +01:00
for ( let name in BDFDB . myPlugins ) if ( ! BDFDB . myPlugins [ name ] . started && typeof BDFDB . myPlugins [ name ] . initialize == "function" ) setImmediate ( _ => { BDFDB . TimeUtils . suppress ( BDFDB . myPlugins [ name ] . initialize . bind ( BDFDB . myPlugins [ name ] ) , "Could not initiate plugin!" , name ) ( ) ; } ) ;
2019-10-18 10:56:41 +02:00
} ;
BDFDB . PluginUtils . clear = function ( plugin ) {
InternalBDFDB . clearStartTimeout ( plugin ) ;
delete BDFDB . myPlugins [ plugin . name ] ;
2020-01-18 09:57:17 +01:00
let unloadmessage = BDFDB . LanguageUtils . LibraryStringsFormat ( "toast_plugin_stopped" , "v" + plugin . version ) ;
2019-11-03 16:53:33 +01:00
BDFDB . LogUtils . log ( unloadmessage , plugin . name ) ;
2020-02-03 12:49:03 +01:00
if ( ! BDFDB . BDUtils . getSettings ( "fork-ps-2" ) && BDFDB . DataUtils . get ( BDFDB , "settings" , "showToasts" ) ) BDFDB . NotificationUtils . toast ( plugin . name + " " + unloadmessage , { nopointer : true , selector : "plugin-stopped-toast" } ) ;
2019-10-18 10:56:41 +02:00
2020-01-18 09:57:17 +01:00
let url = typeof plugin . getRawUrl == "function" && typeof plugin . getRawUrl ( ) == "string" ? plugin . getRawUrl ( ) : ` https://mwittrien.github.io/BetterDiscordAddons/Plugins/ ${ plugin . name } / ${ plugin . name } .plugin.js ` ;
2019-10-18 10:56:41 +02:00
2019-11-20 16:25:28 +01:00
if ( BDFDB . ObjectUtils . is ( plugin . classes ) ) InternalBDFDB . removePluginClasses ( plugin ) ;
2019-11-20 16:28:31 +01:00
if ( typeof plugin . css === "string" ) BDFDB . DOMUtils . removeLocalStyle ( plugin . name ) ;
2019-10-18 10:56:41 +02:00
2019-11-03 20:30:37 +01:00
BDFDB . ModuleUtils . unpatch ( plugin ) ;
2019-10-18 10:56:41 +02:00
BDFDB . ListenerUtils . remove ( plugin ) ;
2019-10-18 12:16:34 +02:00
BDFDB . ObserverUtils . disconnect ( plugin ) ;
2019-12-07 10:21:17 +01:00
BDFDB . WindowUtils . closeAll ( plugin ) ;
BDFDB . WindowUtils . removeListener ( plugin ) ;
2019-10-18 12:16:34 +02:00
2020-01-30 15:46:30 +01:00
for ( let type in BDFDB . InternalData . componentPatchQueries ) BDFDB . ArrayUtils . remove ( BDFDB . InternalData . componentPatchQueries [ type ] . query , plugin , true ) ;
2020-01-30 13:37:01 +01:00
2019-10-18 10:56:41 +02:00
for ( let modal of document . querySelectorAll ( ` . ${ plugin . name } -modal, . ${ plugin . name . toLowerCase ( ) } -modal, . ${ plugin . name } -settingsmodal, . ${ plugin . name . toLowerCase ( ) } -settingsmodal ` ) ) {
let closebutton = modal . querySelector ( BDFDB . dotCN . modalclose ) ;
if ( closebutton ) closebutton . click ( ) ;
}
2020-01-18 09:57:17 +01:00
delete BDFDB . DataUtils . cached [ plugin . name ]
2019-10-18 10:56:41 +02:00
delete window . PluginUpdates . plugins [ url ] ;
2019-10-22 12:17:08 +02:00
delete plugin . started ;
2019-11-28 14:11:05 +01:00
BDFDB . TimeUtils . timeout ( _ => { delete plugin . stopping ; } ) ;
2019-10-18 10:56:41 +02:00
} ;
BDFDB . PluginUtils . translate = function ( plugin ) {
2019-10-24 13:11:20 +02:00
plugin . labels = { } ;
2019-10-18 10:56:41 +02:00
if ( typeof plugin . setLabelsByLanguage === "function" || typeof plugin . changeLanguageStrings === "function" ) {
if ( document . querySelector ( "html" ) . lang ) translate ( ) ;
else {
2019-11-01 10:14:50 +01:00
var translateinterval = BDFDB . TimeUtils . interval ( _ => {
2019-10-18 10:56:41 +02:00
if ( document . querySelector ( "html" ) . lang ) {
2019-11-01 11:09:32 +01:00
BDFDB . TimeUtils . clear ( translateinterval ) ;
2019-10-18 10:56:41 +02:00
translate ( ) ;
}
} , 100 ) ;
}
function translate ( ) {
2019-10-19 11:41:39 +02:00
var language = BDFDB . LanguageUtils . getLanguage ( ) ;
2019-10-18 10:56:41 +02:00
if ( typeof plugin . setLabelsByLanguage === "function" ) plugin . labels = plugin . setLabelsByLanguage ( language . id ) ;
if ( typeof plugin . changeLanguageStrings === "function" ) plugin . changeLanguageStrings ( ) ;
2019-11-03 16:53:33 +01:00
BDFDB . LogUtils . log ( BDFDB . LanguageUtils . LibraryStringsFormat ( "toast_plugin_translated" , language . ownlang ) , plugin . name ) ;
2019-10-18 10:56:41 +02:00
}
}
} ;
2020-02-03 11:39:06 +01:00
BDFDB . PluginUtils . checkUpdate = function ( pluginName , url ) {
if ( BDFDB . BDUtils . isBDv2 ( ) || ! pluginName || ! url ) return ;
2019-10-18 10:56:41 +02:00
LibraryRequires . request ( url , ( error , response , result ) => {
if ( error ) return ;
var newversion = result . match ( /['"][0-9]+\.[0-9]+\.[0-9]+['"]/i ) ;
if ( ! newversion ) return ;
2019-10-23 11:10:01 +02:00
if ( BDFDB . NumberUtils . getVersionDifference ( newversion [ 0 ] , window . PluginUpdates . plugins [ url ] . version ) > 0.2 ) {
2020-02-03 11:39:06 +01:00
BDFDB . NotificationUtils . toast ( ` ${ pluginName } will be force updated, because your version is heavily outdated. ` , { type : "warn" , nopointer : true , selector : "plugin-forceupdate-toast" } ) ;
BDFDB . PluginUtils . downloadUpdate ( pluginName , url ) ;
2019-10-18 10:56:41 +02:00
}
2020-02-03 11:39:06 +01:00
else if ( BDFDB . NumberUtils . compareVersions ( newversion [ 0 ] , window . PluginUpdates . plugins [ url ] . version ) ) BDFDB . PluginUtils . showUpdateNotice ( pluginName , url ) ;
else BDFDB . PluginUtils . removeUpdateNotice ( pluginName ) ;
2019-10-18 10:56:41 +02:00
} ) ;
} ;
BDFDB . PluginUtils . checkAllUpdates = function ( ) {
for ( let url in window . PluginUpdates . plugins ) {
var plugin = window . PluginUpdates . plugins [ url ] ;
BDFDB . PluginUtils . checkUpdate ( plugin . name , plugin . raw ) ;
}
} ;
2020-02-03 11:39:06 +01:00
BDFDB . PluginUtils . showUpdateNotice = function ( pluginName , url ) {
if ( ! pluginName || ! url ) return ;
2019-10-18 10:56:41 +02:00
var updatenotice = document . querySelector ( "#pluginNotice" ) ;
if ( ! updatenotice ) {
2019-10-23 11:10:01 +02:00
updatenotice = BDFDB . NotificationUtils . notice ( ` The following plugins need to be updated: <strong id="outdatedPlugins"></strong> ` , { html : true , id : "pluginNotice" , type : "info" , btn : ! BDFDB . BDUtils . isAutoLoadEnabled ( ) ? "Reload" : "" , customicon : ` <svg height="100%" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="100%" version="1.1" viewBox="0 0 2000 2000"><metadata /><defs><filter id="shadow1"><feDropShadow dx="20" dy="0" stdDeviation="20" flood-color="rgba(0,0,0,0.35)"/></filter><filter id="shadow2"><feDropShadow dx="15" dy="0" stdDeviation="20" flood-color="rgba(255,255,255,0.15)"/></filter><filter id="shadow3"><feDropShadow dx="10" dy="0" stdDeviation="20" flood-color="rgba(0,0,0,0.35)"/></filter></defs><g><path style="filter: url(#shadow3)" d="M1195.44+135.442L1195.44+135.442L997.6+136.442C1024.2+149.742+1170.34+163.542+1193.64+179.742C1264.34+228.842+1319.74+291.242+1358.24+365.042C1398.14+441.642+1419.74+530.642+1422.54+629.642L1422.54+630.842L1422.54+632.042C1422.54+773.142+1422.54+1228.14+1422.54+1369.14L1422.54+1370.34L1422.54+1371.54C1419.84+1470.54+1398.24+1559.54+1358.24+1636.14C1319.74+1709.94+1264.44+1772.34+1193.64+1821.44C1171.04+1837.14+1025.7+1850.54+1000+1863.54L1193.54+1864.54C1539.74+1866.44+1864.54+1693.34+1864.54+1296.64L1864.54+716.942C1866.44+312.442+1541.64+135.442+1195.44+135.442Z" fill="#171717" opacity="1"/><path style="filter: url(#shadow2)" d="M1695.54+631.442C1685.84+278.042+1409.34+135.442+1052.94+135.442L361.74+136.442L803.74+490.442L1060.74+490.442C1335.24+490.442+1335.24+835.342+1060.74+835.342L1060.74+1164.84C1150.22+1164.84+1210.53+1201.48+1241.68+1250.87C1306.07+1353+1245.76+1509.64+1060.74+1509.64L361.74+1863.54L1052.94+1864.54C1409.24+1864.54+1685.74+1721.94+1695.54+1368.54C1695.54+1205.94+1651.04+1084.44+1572.64+999.942C1651.04+915.542+1695.54+794.042+1695.54+631.442Z" fill="#3E82E5" opacity="1"/><path style="filter: url(#shadow1)" d="M1469.25+631.442C1459.55+278.042+1183.05+135.442+826.65+135.442L135.45+135.442L135.45+1004C135.45+1004+135.427+1255.21+355.626+1255.21C575.825+1255.21+575.848+1004+575.848+1004L577.45+490.442L834.45+490.442C1108.95+490.442+1108.95+835.342+834.45+835.342L664.65+835.342L664.65+1164.84L834.45+1164.84C923.932+1164.84+984.244+1201.48+1015.39+1250.87C1079.78+1353+1019.47+1509.64+834.45+1509.64L135.45+1509.64L135.45+1864.54L826.65+1864.54C1182.95+1864.54+1459.45+1721.94+1469.25+1368.54C1469.25+1205.94+1424.75+1084.44+1346.35+999.942C1424.75+915.542+1469.25+794.042+1469.25+631.442Z" fill="#FFFFFF" opacity="1"/></g></svg> ` } ) ;
2019-10-18 10:56:41 +02:00
updatenotice . style . setProperty ( "display" , "block" , "important" ) ;
updatenotice . style . setProperty ( "visibility" , "visible" , "important" ) ;
updatenotice . style . setProperty ( "opacity" , "1" , "important" ) ;
2019-10-18 19:19:38 +02:00
updatenotice . querySelector ( BDFDB . dotCN . noticedismiss ) . addEventListener ( "click" , _ => {
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . remove ( ".update-clickme-tooltip" ) ;
2019-10-18 10:56:41 +02:00
} ) ;
2020-01-16 16:20:41 +01:00
let reloadbutton = updatenotice . querySelector ( BDFDB . dotCN . noticebutton ) ;
2019-10-18 10:56:41 +02:00
if ( reloadbutton ) {
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . toggle ( reloadbutton , true ) ;
2019-10-18 19:19:38 +02:00
reloadbutton . addEventListener ( "click" , _ => {
2020-01-16 16:20:41 +01:00
LibraryRequires . electron . remote . getCurrentWindow ( ) . reload ( ) ;
2019-10-18 10:56:41 +02:00
} ) ;
2019-10-18 19:19:38 +02:00
reloadbutton . addEventListener ( "mouseenter" , _ => {
2019-10-18 10:56:41 +02:00
if ( window . PluginUpdates . downloaded ) BDFDB . TooltipUtils . create ( reloadbutton , window . PluginUpdates . downloaded . join ( ", " ) , { type : "bottom" , selector : "update-notice-tooltip" , style : "max-width: 420px" } ) ;
} ) ;
}
}
if ( updatenotice ) {
var updatenoticelist = updatenotice . querySelector ( "#outdatedPlugins" ) ;
2020-02-03 11:39:06 +01:00
if ( updatenoticelist && ! updatenoticelist . querySelector ( ` # ${ pluginName } -notice ` ) ) {
2019-10-23 11:10:01 +02:00
if ( updatenoticelist . querySelector ( "span" ) ) updatenoticelist . appendChild ( BDFDB . DOMUtils . create ( ` <span class="separator">, </span> ` ) ) ;
2020-02-03 11:39:06 +01:00
var updateentry = BDFDB . DOMUtils . create ( ` <span id=" ${ pluginName } -notice"> ${ pluginName } </span> ` ) ;
updateentry . addEventListener ( "click" , _ => { BDFDB . PluginUtils . downloadUpdate ( pluginName , url ) ; } ) ;
2019-10-18 10:56:41 +02:00
updatenoticelist . appendChild ( updateentry ) ;
2019-10-19 19:15:57 +02:00
if ( ! document . querySelector ( ".update-clickme-tooltip" ) ) BDFDB . TooltipUtils . create ( updatenoticelist , "Click us!" , { type : "bottom" , selector : "update-clickme-tooltip" , delay : 500 } ) ;
2019-10-18 10:56:41 +02:00
}
}
} ;
2020-02-03 11:39:06 +01:00
BDFDB . PluginUtils . removeUpdateNotice = function ( pluginName , updatenotice = document . querySelector ( "#pluginNotice" ) ) {
if ( ! pluginName || ! updatenotice ) return ;
2019-10-18 10:56:41 +02:00
var updatenoticelist = updatenotice . querySelector ( "#outdatedPlugins" ) ;
if ( updatenoticelist ) {
2020-02-03 11:39:06 +01:00
var noticeentry = updatenoticelist . querySelector ( ` # ${ pluginName } -notice ` ) ;
2019-10-18 10:56:41 +02:00
if ( noticeentry ) {
var nextsibling = noticeentry . nextSibling ;
var prevsibling = noticeentry . prevSibling ;
2019-10-23 11:10:01 +02:00
if ( nextsibling && BDFDB . DOMUtils . containsClass ( nextsibling , "separator" ) ) nextsibling . remove ( ) ;
else if ( prevsibling && BDFDB . DOMUtils . containsClass ( prevsibling , "separator" ) ) prevsibling . remove ( ) ;
2019-10-18 10:56:41 +02:00
noticeentry . remove ( ) ;
}
if ( ! updatenoticelist . querySelector ( "span" ) ) {
var reloadbutton = updatenotice . querySelector ( BDFDB . dotCN . noticebutton ) ;
if ( reloadbutton ) {
updatenotice . querySelector ( ".notice-message" ) . innerText = "To finish updating you need to reload." ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . toggle ( reloadbutton , false ) ;
2019-10-18 10:56:41 +02:00
}
else updatenotice . querySelector ( BDFDB . dotCN . noticedismiss ) . click ( ) ;
}
}
} ;
2020-02-03 11:39:06 +01:00
BDFDB . PluginUtils . downloadUpdate = function ( pluginName , url ) {
if ( ! pluginName || ! url ) return ;
2019-10-18 10:56:41 +02:00
LibraryRequires . request ( url , ( error , response , result ) => {
2020-02-03 11:39:06 +01:00
if ( error ) return BDFDB . LogUtils . warn ( "Unable to get update for " + pluginName ) ;
2019-11-03 16:53:33 +01:00
BDFDB . InternalData . creationTime = 0 ;
2019-10-18 10:56:41 +02:00
var newversion = result . match ( /['"][0-9]+\.[0-9]+\.[0-9]+['"]/i ) ;
newversion = newversion . toString ( ) . replace ( /['"]/g , "" ) ;
2019-10-23 11:10:01 +02:00
LibraryRequires . fs . writeFileSync ( LibraryRequires . path . join ( BDFDB . BDUtils . getPluginsFolder ( ) , url . split ( "/" ) . slice ( - 1 ) [ 0 ] ) , result ) ;
2020-02-03 11:39:06 +01:00
BDFDB . NotificationUtils . toast ( ` ${ pluginName } v ${ window . PluginUpdates . plugins [ url ] . version } has been replaced by ${ pluginName } v ${ newversion } . ` , { nopointer : true , selector : "plugin-updated-toast" } ) ;
2019-10-18 10:56:41 +02:00
var updatenotice = document . querySelector ( "#pluginNotice" ) ;
if ( updatenotice ) {
if ( updatenotice . querySelector ( BDFDB . dotCN . noticebutton ) ) {
window . PluginUpdates . plugins [ url ] . version = newversion ;
if ( ! window . PluginUpdates . downloaded ) window . PluginUpdates . downloaded = [ ] ;
2020-02-03 11:39:06 +01:00
if ( ! window . PluginUpdates . downloaded . includes ( pluginName ) ) window . PluginUpdates . downloaded . push ( pluginName ) ;
2019-10-18 10:56:41 +02:00
}
2020-02-03 11:39:06 +01:00
BDFDB . PluginUtils . removeUpdateNotice ( pluginName , updatenotice ) ;
2019-10-18 10:56:41 +02:00
}
} ) ;
} ;
BDFDB . PluginUtils . checkChangeLog = function ( plugin ) {
if ( ! BDFDB . ObjectUtils . is ( plugin ) || ! plugin . changelog ) return ;
2019-10-22 14:20:12 +02:00
var changelog = BDFDB . DataUtils . load ( plugin , "changelog" ) ;
2019-10-23 11:10:01 +02:00
if ( ! changelog . currentversion || BDFDB . NumberUtils . compareVersions ( plugin . version , changelog . currentversion ) ) {
2019-10-18 10:56:41 +02:00
changelog . currentversion = plugin . version ;
2019-10-22 14:20:12 +02:00
BDFDB . DataUtils . save ( changelog , plugin , "changelog" ) ;
2019-10-18 10:56:41 +02:00
BDFDB . PluginUtils . openChangeLog ( plugin ) ;
}
} ;
BDFDB . PluginUtils . openChangeLog = function ( plugin ) {
if ( ! BDFDB . ObjectUtils . is ( plugin ) || ! plugin . changelog ) return ;
2019-11-10 18:06:24 +01:00
var changeLogHTML = "" , headers = {
2019-10-18 10:56:41 +02:00
added : "New Features" ,
fixed : "Bug Fixes" ,
improved : "Improvements" ,
progress : "Progress"
} ;
for ( let type in plugin . changelog ) {
type = type . toLowerCase ( ) ;
var classname = BDFDB . disCN [ "changelog" + type ] ;
if ( classname ) {
2019-11-22 15:05:45 +01:00
changeLogHTML += ` <h1 class=" ${ classname } ${ BDFDB . disCN . margintop20 } " ${ changeLogHTML . indexOf ( "<h1" ) == - 1 ? ` style="margin-top: 0px !important;" ` : "" } > ${ headers [ type ] } </h1><ul> ` ;
2019-10-18 10:56:41 +02:00
for ( let log of plugin . changelog [ type ] ) changeLogHTML += ` <li><strong> ${ log [ 0 ] } </strong> ${ log [ 1 ] ? ( ": " + log [ 1 ] + "." ) : "" } </li> ` ;
changeLogHTML += ` </ul> `
}
}
2019-11-20 21:02:42 +01:00
if ( changeLogHTML ) BDFDB . ModalUtils . open ( plugin , { header : ` ${ plugin . name } ${ BDFDB . LanguageUtils . LanguageStrings . CHANGE _LOG } ` , subheader : ` Version ${ plugin . version } ` , children : BDFDB . ReactUtils . elementToReact ( BDFDB . DOMUtils . create ( changeLogHTML ) ) , className : BDFDB . disCN . modalchangelogmodal , contentClassName : BDFDB . disCNS . changelogcontainer + BDFDB . disCN . modalminicontent } ) ;
2019-10-18 10:56:41 +02:00
} ;
2020-01-17 20:31:32 +01:00
BDFDB . PluginUtils . addLoadingIcon = function ( icon ) {
if ( ! Node . prototype . isPrototypeOf ( icon ) ) return ;
BDFDB . DOMUtils . addClass ( icon , BDFDB . disCN . loadingicon ) ;
let loadingiconwrapper = document . querySelector ( BDFDB . dotCN . app + ">" + BDFDB . dotCN . loadingiconwrapper ) ;
if ( ! loadingiconwrapper ) {
loadingiconwrapper = BDFDB . DOMUtils . create ( ` <div class=" ${ BDFDB . disCN . loadingiconwrapper } "></div> ` ) ;
document . querySelector ( BDFDB . dotCN . app ) . appendChild ( loadingiconwrapper ) ;
let killObserver = new MutationObserver ( changes => { if ( ! loadingiconwrapper . firstElementChild ) BDFDB . DOMUtils . remove ( loadingiconwrapper ) ; } ) ;
killObserver . observe ( loadingiconwrapper , { childList : true } ) ;
}
loadingiconwrapper . appendChild ( icon ) ;
} ;
2019-10-18 10:56:41 +02:00
BDFDB . PluginUtils . createSettingsPanel = function ( plugin , children ) {
2019-10-20 20:57:23 +02:00
if ( ! BDFDB . ObjectUtils . is ( plugin ) || ! children || ( ! BDFDB . ReactUtils . isValidElement ( children ) && ! BDFDB . ArrayUtils . is ( children ) ) || ( BDFDB . ArrayUtils . is ( children ) && ! children . length ) ) return ;
2020-02-03 12:37:51 +01:00
let settingspanel = BDFDB . DOMUtils . create ( ` <div class=" ${ plugin . name } -settings ${ BDFDB . disCN . settingspanel } "></div> ` ) ;
2020-02-08 11:14:10 +01:00
BDFDB . ReactUtils . render ( BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . SettingsPanel , {
2020-02-03 12:37:51 +01:00
key : ` ${ plugin . name } -settingspanel ` ,
title : plugin . name == "$BDFDB" ? "BDFDB" : plugin . name ,
2019-10-18 10:56:41 +02:00
children
} ) , settingspanel ) ;
return settingspanel ;
} ;
2020-01-22 11:26:18 +01:00
BDFDB . PluginUtils . refreshSettingsPanel = function ( plugin , settingspanel , ... args ) {
if ( ! BDFDB . ObjectUtils . is ( plugin ) || typeof plugin . getSettingsPanel != "function" || ! Node . prototype . isPrototypeOf ( settingspanel ) || ! settingspanel . parentElement ) return ;
settingspanel . parentElement . appendChild ( plugin . getSettingsPanel ( ... args ) ) ;
settingspanel . remove ( ) ;
} ;
2019-10-18 10:56:41 +02:00
InternalBDFDB . clearStartTimeout = function ( plugin ) {
if ( ! BDFDB . ObjectUtils . is ( plugin ) ) return ;
2019-11-03 20:30:37 +01:00
BDFDB . TimeUtils . clear ( plugin . startTimeout , plugin . libLoadTimeout ) ;
2019-10-18 10:56:41 +02:00
delete plugin . startTimeout ;
delete plugin . libLoadTimeout ;
} ;
2020-01-30 11:30:07 +01:00
InternalBDFDB . addSpecialListeners = function ( plugin ) {
if ( BDFDB . ObjectUtils . is ( plugin ) ) {
if ( typeof plugin . onSettingsClosed === "function" ) {
let SettingsLayer = BDFDB . ModuleUtils . findByName ( "StandardSidebarView" ) ;
if ( SettingsLayer ) BDFDB . ModuleUtils . patch ( plugin , SettingsLayer . prototype , "componentWillUnmount" , { after : e => {
plugin . onSettingsClosed ( ) ;
} } ) ;
2019-10-18 12:16:34 +02:00
}
2020-01-30 11:30:07 +01:00
if ( typeof plugin . onSwitch === "function" ) {
let spacer = document . querySelector ( ` ${ BDFDB . dotCN . guildswrapper } ~ * > ${ BDFDB . dotCN . chatspacer } ` ) ;
if ( spacer ) {
let noChannelObserver = new MutationObserver ( changes => { changes . forEach ( change => {
if ( change . target && BDFDB . DOMUtils . containsClass ( change . target , BDFDB . disCN . nochannel ) ) plugin . onSwitch ( ) ;
} ) ; } ) ;
BDFDB . ObserverUtils . connect ( plugin , spacer . querySelector ( BDFDB . dotCNC . chat + BDFDB . dotCN . nochannel ) , { name : "switchFixNoChannelObserver" , instance : noChannelObserver } , { attributes : true } ) ;
let spacerObserver = new MutationObserver ( changes => { changes . forEach ( change => { if ( change . addedNodes ) { change . addedNodes . forEach ( node => {
if ( BDFDB . DOMUtils . containsClass ( node , BDFDB . disCN . chat , BDFDB . disCN . nochannel , false ) ) {
BDFDB . ObserverUtils . connect ( plugin , node , { name : "switchFixNoChannelObserver" , instance : noChannelObserver } , { attributes : true } ) ;
}
} ) ; } } ) ; } ) ;
BDFDB . ObserverUtils . connect ( plugin , spacer , { name : "switchFixSpacerObserver" , instance : spacerObserver } , { childList : true } ) ;
}
}
InternalBDFDB . addContextListeners ( plugin ) ;
2019-10-18 12:16:34 +02:00
}
} ;
2019-10-18 10:56:41 +02:00
BDFDB . ObserverUtils = { } ;
BDFDB . ObserverUtils . connect = function ( plugin , eleOrSelec , observer , config = { childList : true } ) {
if ( ! BDFDB . ObjectUtils . is ( plugin ) || ! eleOrSelec || ! observer ) return ;
if ( BDFDB . ObjectUtils . isEmpty ( plugin . observers ) ) plugin . observers = { } ;
2019-10-18 14:56:41 +02:00
if ( ! BDFDB . ArrayUtils . is ( plugin . observers [ observer . name ] ) ) plugin . observers [ observer . name ] = [ ] ;
2019-10-18 10:56:41 +02:00
if ( ! observer . multi ) for ( let subinstance of plugin . observers [ observer . name ] ) subinstance . disconnect ( ) ;
if ( observer . instance ) plugin . observers [ observer . name ] . push ( observer . instance ) ;
var instance = plugin . observers [ observer . name ] [ plugin . observers [ observer . name ] . length - 1 ] ;
if ( instance ) {
var node = Node . prototype . isPrototypeOf ( eleOrSelec ) ? eleOrSelec : typeof eleOrSelec === "string" ? document . querySelector ( eleOrSelec ) : null ;
if ( node ) instance . observe ( node , config ) ;
}
} ;
BDFDB . ObserverUtils . disconnect = function ( plugin , observer ) {
if ( BDFDB . ObjectUtils . is ( plugin ) && ! BDFDB . ObjectUtils . isEmpty ( plugin . observers ) ) {
let observername = typeof observer == "string" ? observer : ( BDFDB . ObjectUtils . is ( observer ) ? observer . name : null ) ;
if ( ! observername ) {
for ( let observer in plugin . observers ) for ( let instance of plugin . observers [ observer ] ) instance . disconnect ( ) ;
delete plugin . observers ;
}
2019-10-18 14:56:41 +02:00
else if ( ! BDFDB . ArrayUtils . is ( plugin . observers [ observername ] ) ) {
2019-10-18 10:56:41 +02:00
for ( let instance of plugin . observers [ observername ] ) instance . disconnect ( ) ;
delete plugin . observers [ observername ] ;
}
}
} ;
BDFDB . ListenerUtils = { } ;
BDFDB . ListenerUtils . add = function ( plugin , ele , actions , selectorOrCallback , callbackOrNothing ) {
if ( ! BDFDB . ObjectUtils . is ( plugin ) || ( ! Node . prototype . isPrototypeOf ( ele ) && ele !== window ) || ! actions ) return ;
var callbackIs4th = typeof selectorOrCallback == "function" ;
var selector = callbackIs4th ? undefined : selectorOrCallback ;
var callback = callbackIs4th ? selectorOrCallback : callbackOrNothing ;
if ( typeof callback != "function" ) return ;
BDFDB . ListenerUtils . remove ( plugin , ele , actions , selector ) ;
for ( var action of actions . split ( " " ) ) {
action = action . split ( "." ) ;
var eventname = action . shift ( ) . toLowerCase ( ) ;
if ( ! eventname ) return ;
var origeventname = eventname ;
eventname = eventname == "mouseenter" || eventname == "mouseleave" ? "mouseover" : eventname ;
var namespace = ( action . join ( "." ) || "" ) + plugin . name ;
2019-10-18 14:56:41 +02:00
if ( ! BDFDB . ArrayUtils . is ( plugin . listeners ) ) plugin . listeners = [ ] ;
2019-10-18 10:56:41 +02:00
var eventcallback = null ;
if ( selector ) {
if ( origeventname == "mouseenter" || origeventname == "mouseleave" ) {
eventcallback = e => {
for ( let child of e . path ) if ( typeof child . matches == "function" && child . matches ( selector ) && ! child [ namespace + "BDFDB" + origeventname ] ) {
child [ namespace + "BDFDB" + origeventname ] = true ;
if ( origeventname == "mouseenter" ) callback ( BDFDB . ListenerUtils . copyEvent ( e , child ) ) ;
let mouseout = e2 => {
if ( e2 . target . contains ( child ) || e2 . target == child || ! child . contains ( e2 . target ) ) {
if ( origeventname == "mouseleave" ) callback ( BDFDB . ListenerUtils . copyEvent ( e , child ) ) ;
delete child [ namespace + "BDFDB" + origeventname ] ;
document . removeEventListener ( "mouseout" , mouseout ) ;
}
} ;
document . addEventListener ( "mouseout" , mouseout ) ;
break ;
}
} ;
}
else {
eventcallback = e => {
for ( let child of e . path ) if ( typeof child . matches == "function" && child . matches ( selector ) ) {
callback ( BDFDB . ListenerUtils . copyEvent ( e , child ) ) ;
break ;
}
} ;
}
}
else eventcallback = e => { callback ( BDFDB . ListenerUtils . copyEvent ( e , ele ) ) ; } ;
plugin . listeners . push ( { ele , eventname , origeventname , namespace , selector , eventcallback } ) ;
ele . addEventListener ( eventname , eventcallback , true ) ;
}
} ;
BDFDB . ListenerUtils . remove = function ( plugin , ele , actions = "" , selector ) {
2019-10-18 14:56:41 +02:00
if ( ! BDFDB . ObjectUtils . is ( plugin ) || ! BDFDB . ArrayUtils . is ( plugin . listeners ) ) return ;
2019-10-18 10:56:41 +02:00
if ( Node . prototype . isPrototypeOf ( ele ) || ele === window ) {
for ( var action of actions . split ( " " ) ) {
action = action . split ( "." ) ;
var eventname = action . shift ( ) . toLowerCase ( ) ;
var namespace = ( action . join ( "." ) || "" ) + plugin . name ;
for ( let listener of plugin . listeners ) {
let removedlisteners = [ ] ;
if ( listener . ele == ele && ( ! eventname || listener . origeventname == eventname ) && listener . namespace == namespace && ( selector === undefined || listener . selector == selector ) ) {
ele . removeEventListener ( listener . eventname , listener . eventcallback , true ) ;
removedlisteners . push ( listener ) ;
}
if ( removedlisteners . length ) plugin . listeners = plugin . listeners . filter ( listener => { return removedlisteners . indexOf ( listener ) < 0 ; } ) ;
}
}
}
else if ( ! ele ) {
for ( let listener of plugin . listeners ) listener . ele . removeEventListener ( listener . eventname , listener . eventcallback , true ) ;
plugin . listeners = [ ] ;
}
} ;
2019-10-29 22:25:10 +01:00
BDFDB . ListenerUtils . multiAdd = function ( node , actions , callback ) {
if ( ! Node . prototype . isPrototypeOf ( node ) || ! actions || typeof callback != "function" ) return ;
for ( var action of actions . trim ( ) . split ( " " ) . filter ( n => n ) ) node . addEventListener ( action , callback , true ) ;
} ;
BDFDB . ListenerUtils . multiRemove = function ( node , actions , callback ) {
if ( ! Node . prototype . isPrototypeOf ( node ) || ! actions || typeof callback != "function" ) return ;
for ( var action of actions . trim ( ) . split ( " " ) . filter ( n => n ) ) node . removeEventListener ( action , callback , true ) ;
} ;
2019-10-18 10:56:41 +02:00
BDFDB . ListenerUtils . addToChildren = function ( node , actions , selector , callback ) {
if ( ! Node . prototype . isPrototypeOf ( node ) || ! actions || ! selector || ! selector . trim ( ) || typeof callback != "function" ) return ;
2019-10-29 22:25:10 +01:00
for ( var action of actions . trim ( ) . split ( " " ) . filter ( n => n ) ) {
2019-10-18 10:56:41 +02:00
var eventcallback = callback ;
if ( action == "mouseenter" || action == "mouseleave" ) eventcallback = e => { if ( e . target . matches ( selector ) ) callback ( e ) ; } ;
node . querySelectorAll ( selector . trim ( ) ) . forEach ( child => { child . addEventListener ( action , eventcallback , true ) ; } ) ;
}
} ;
BDFDB . ListenerUtils . copyEvent = function ( e , ele ) {
if ( ! e || ! e . constructor || ! e . type ) return e ;
var ecopy = new e . constructor ( e . type , e ) ;
Object . defineProperty ( ecopy , "originalEvent" , { value : e } ) ;
Object . defineProperty ( ecopy , "which" , { value : e . which } ) ;
Object . defineProperty ( ecopy , "keyCode" , { value : e . keyCode } ) ;
Object . defineProperty ( ecopy , "path" , { value : e . path } ) ;
Object . defineProperty ( ecopy , "relatedTarget" , { value : e . relatedTarget } ) ;
Object . defineProperty ( ecopy , "srcElement" , { value : e . srcElement } ) ;
Object . defineProperty ( ecopy , "target" , { value : e . target } ) ;
Object . defineProperty ( ecopy , "toElement" , { value : e . toElement } ) ;
if ( ele ) Object . defineProperty ( ecopy , "currentTarget" , { value : ele } ) ;
return ecopy ;
} ;
BDFDB . ListenerUtils . stopEvent = function ( e ) {
if ( BDFDB . ObjectUtils . is ( e ) ) {
if ( typeof e . preventDefault == "function" ) e . preventDefault ( ) ;
if ( typeof e . stopPropagation == "function" ) e . stopPropagation ( ) ;
if ( typeof e . stopImmediatePropagation == "function" ) e . stopImmediatePropagation ( ) ;
if ( BDFDB . ObjectUtils . is ( e . originalEvent ) ) {
if ( typeof e . originalEvent . preventDefault == "function" ) e . originalEvent . preventDefault ( ) ;
if ( typeof e . originalEvent . stopPropagation == "function" ) e . originalEvent . stopPropagation ( ) ;
if ( typeof e . originalEvent . stopImmediatePropagation == "function" ) e . originalEvent . stopImmediatePropagation ( ) ;
}
}
} ;
2019-10-18 14:56:41 +02:00
var NotificationBars = [ ] , DesktopNotificationQueue = { queue : [ ] , running : false } ;
2019-10-18 10:56:41 +02:00
BDFDB . NotificationUtils = { } ;
BDFDB . NotificationUtils . toast = function ( text , options = { } ) {
2020-01-17 20:31:32 +01:00
let toasts = document . querySelector ( ".toasts, .bd-toasts" ) ;
2019-10-18 10:56:41 +02:00
if ( ! toasts ) {
2020-01-17 20:31:32 +01:00
let channels = document . querySelector ( BDFDB . dotCN . channels + " + div" ) ;
let channelrects = channels ? BDFDB . DOMUtils . getRects ( channels ) : null ;
let members = channels ? channels . querySelector ( BDFDB . dotCN . memberswrap ) : null ;
let left = channelrects ? channelrects . left : 310 ;
let width = channelrects ? ( members ? channelrects . width - BDFDB . DOMUtils . getRects ( members ) . width : channelrects . width ) : window . outerWidth - 0 ;
let form = channels ? channels . querySelector ( "form" ) : null ;
let bottom = form ? BDFDB . DOMUtils . getRects ( form ) . height : 80 ;
2019-10-23 11:10:01 +02:00
toasts = BDFDB . DOMUtils . create ( ` <div class="toasts bd-toasts" style="width: ${ width } px; left: ${ left } px; bottom: ${ bottom } px;"></div> ` ) ;
2019-11-01 14:47:22 +01:00
( document . querySelector ( BDFDB . dotCN . app ) || document . body ) . appendChild ( toasts ) ;
2019-10-18 10:56:41 +02:00
}
const { type = "" , icon = true , timeout = 3000 , html = false , selector = "" , nopointer = false , color = "" } = options ;
2020-01-17 20:31:32 +01:00
let toast = BDFDB . DOMUtils . create ( ` <div class="toast bd-toast"> ${ html === true ? text : BDFDB . StringUtils . htmlEscape ( text ) } </div> ` ) ;
2019-10-18 10:56:41 +02:00
if ( type ) {
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . addClass ( toast , "toast-" + type ) ;
if ( icon ) BDFDB . DOMUtils . addClass ( toast , "icon" ) ;
2019-10-18 10:56:41 +02:00
}
else if ( color ) {
2020-01-17 20:31:32 +01:00
let rgbcolor = BDFDB . ColorUtils . convert ( color , "RGB" ) ;
2019-10-18 10:56:41 +02:00
if ( rgbcolor ) toast . style . setProperty ( "background-color" , rgbcolor ) ;
}
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . addClass ( toast , selector ) ;
2019-10-18 10:56:41 +02:00
toasts . appendChild ( toast ) ;
2019-10-18 19:19:38 +02:00
toast . close = _ => {
2019-10-18 10:56:41 +02:00
if ( document . contains ( toast ) ) {
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . addClass ( toast , "closing" ) ;
2019-10-18 10:56:41 +02:00
toast . style . setProperty ( "pointer-events" , "none" , "important" ) ;
2019-11-01 10:14:50 +01:00
BDFDB . TimeUtils . timeout ( _ => {
2019-10-18 10:56:41 +02:00
toast . remove ( ) ;
if ( ! toasts . querySelectorAll ( ".toast, .bd-toast" ) . length ) toasts . remove ( ) ;
} , 3000 ) ;
}
} ;
if ( nopointer ) toast . style . setProperty ( "pointer-events" , "none" , "important" ) ;
else toast . addEventListener ( "click" , toast . close ) ;
2019-11-01 10:14:50 +01:00
BDFDB . TimeUtils . timeout ( _ => { toast . close ( ) ; } , timeout > 0 ? timeout : 600000 ) ;
2019-10-18 10:56:41 +02:00
return toast ;
} ;
BDFDB . NotificationUtils . desktop = function ( parsedcontent , parsedoptions = { } ) {
2019-10-18 19:19:38 +02:00
var queue = _ => {
2019-10-18 10:56:41 +02:00
DesktopNotificationQueue . queue . push ( { parsedcontent , parsedoptions } ) ;
runqueue ( ) ;
} ;
2019-10-18 19:19:38 +02:00
var runqueue = _ => {
2019-10-18 10:56:41 +02:00
if ( ! DesktopNotificationQueue . running ) {
var notification = DesktopNotificationQueue . queue . shift ( ) ;
if ( notification ) notify ( notification . parsedcontent , notification . parsedoptions ) ;
}
} ;
var notify = ( content , options ) => {
DesktopNotificationQueue . running = true ;
var muted = options . silent ;
options . silent = options . silent || options . sound ? true : false ;
var notification = new Notification ( content , options ) ;
var audio = new Audio ( ) ;
2019-11-01 10:14:50 +01:00
var timeout = BDFDB . TimeUtils . timeout ( _ => { close ( ) ; } , options . timeout ? options . timeout : 3000 ) ;
2019-10-18 19:19:38 +02:00
if ( typeof options . click == "function" ) notification . onclick = _ => {
2019-11-01 11:09:32 +01:00
BDFDB . TimeUtils . clear ( timeout ) ;
2019-10-18 10:56:41 +02:00
close ( ) ;
options . click ( ) ;
} ;
if ( ! muted && options . sound ) {
audio . src = options . sound ;
audio . play ( ) ;
}
2019-10-18 19:19:38 +02:00
var close = _ => {
2019-10-18 10:56:41 +02:00
audio . pause ( ) ;
notification . close ( ) ;
DesktopNotificationQueue . running = false ;
2019-11-01 10:14:50 +01:00
BDFDB . TimeUtils . timeout ( _ => { runqueue ( ) ; } , 1000 ) ;
2019-10-18 10:56:41 +02:00
} ;
} ;
if ( ! ( "Notification" in window ) ) { }
else if ( Notification . permission === "granted" ) queue ( ) ;
else if ( Notification . permission !== "denied" ) Notification . requestPermission ( function ( response ) { if ( response === "granted" ) queue ( ) ; } ) ;
} ;
BDFDB . NotificationUtils . notice = function ( text , options = { } ) {
if ( ! text ) return ;
var layers = document . querySelector ( BDFDB . dotCN . layers ) ;
if ( ! layers ) return ;
2019-10-23 11:10:01 +02:00
var id = BDFDB . NumberUtils . generateId ( NotificationBars ) ;
2019-11-28 12:40:41 +01:00
var notice = BDFDB . DOMUtils . create ( ` <div class=" ${ BDFDB . disCNS . notice + BDFDB . disCN . noticewrapper } " notice-id=" ${ id } "><div class=" ${ BDFDB . disCN . noticedismiss } " style="height: 36px !important; position: absolute !important; top: 0 !important; right: 0 !important; left: unset !important;"></div><span class="notice-message"></span></div> ` ) ;
2019-10-18 10:56:41 +02:00
layers . parentElement . insertBefore ( notice , layers ) ;
2019-11-28 12:40:41 +01:00
var noticemessage = notice . querySelector ( ".notice-message" ) ;
2019-10-18 10:56:41 +02:00
if ( options . platform ) for ( let platform of options . platform . split ( " " ) ) if ( DiscordClasses [ "noticeicon" + platform ] ) {
2019-10-23 11:10:01 +02:00
let icon = BDFDB . DOMUtils . create ( ` <i class=" ${ BDFDB . disCN [ "noticeicon" + platform ] } "></i> ` ) ;
BDFDB . DOMUtils . addClass ( icon , BDFDB . disCN . noticeplatformicon ) ;
BDFDB . DOMUtils . removeClass ( icon , BDFDB . disCN . noticeicon ) ;
2019-10-18 10:56:41 +02:00
notice . insertBefore ( icon , noticemessage ) ;
}
if ( options . customicon ) {
2019-10-23 11:10:01 +02:00
let iconinner = BDFDB . DOMUtils . create ( options . customicon )
let icon = BDFDB . DOMUtils . create ( ` <i></i> ` ) ;
2019-10-18 10:56:41 +02:00
if ( iconinner . tagName == "span" && ! iconinner . firstElementChild ) icon . style . setProperty ( "background" , ` url( ${ options . customicon } ) center/cover no-repeat ` ) ;
else icon . appendChild ( iconinner ) ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . addClass ( icon , BDFDB . disCN . noticeplatformicon ) ;
BDFDB . DOMUtils . removeClass ( icon , BDFDB . disCN . noticeicon ) ;
2019-10-18 10:56:41 +02:00
notice . insertBefore ( icon , noticemessage ) ;
}
2019-10-23 11:10:01 +02:00
if ( options . btn || options . button ) notice . appendChild ( BDFDB . DOMUtils . create ( ` <button class=" ${ BDFDB . disCNS . noticebutton + BDFDB . disCNS . titlesize14 + BDFDB . disCN . weightmedium } "> ${ options . btn || options . button } </button> ` ) ) ;
2019-10-18 10:56:41 +02:00
if ( options . id ) notice . id = options . id . split ( " " ) . join ( "" ) ;
2019-10-23 11:10:01 +02:00
if ( options . selector ) BDFDB . DOMUtils . addClass ( notice , options . selector ) ;
if ( options . css ) BDFDB . DOMUtils . appendLocalStyle ( "BDFDBcustomnotificationbar" + id , options . css ) ;
2019-10-18 10:56:41 +02:00
if ( options . style ) notice . style = options . style ;
if ( options . html === true ) noticemessage . innerHTML = text ;
else {
var link = document . createElement ( "a" ) ;
var newtext = [ ] ;
for ( let word of text . split ( " " ) ) {
2019-10-23 11:10:01 +02:00
var encodedword = BDFDB . StringUtils . htmlEscape ( word ) ;
2019-10-18 10:56:41 +02:00
link . href = word ;
newtext . push ( link . host && link . host !== window . location . host ? ` <label class=" ${ BDFDB . disCN . textlink } "> ${ encodedword } </label> ` : encodedword ) ;
}
noticemessage . innerHTML = newtext . join ( " " ) ;
}
var type = null ;
if ( options . type && ! document . querySelector ( BDFDB . dotCNS . chatbase + BDFDB . dotCN . noticestreamer ) ) {
2019-10-23 11:10:01 +02:00
if ( type = BDFDB . disCN [ "notice" + options . type ] ) BDFDB . DOMUtils . addClass ( notice , type ) ;
2019-10-18 10:56:41 +02:00
if ( options . type == "premium" ) {
var noticebutton = notice . querySelector ( BDFDB . dotCN . noticebutton ) ;
2019-10-23 11:10:01 +02:00
if ( noticebutton ) BDFDB . DOMUtils . addClass ( noticebutton , BDFDB . disCN . noticepremiumaction ) ;
BDFDB . DOMUtils . addClass ( noticemessage , BDFDB . disCN . noticepremiumtext ) ;
notice . insertBefore ( BDFDB . DOMUtils . create ( ` <i class=" ${ BDFDB . disCN . noticepremiumlogo } "></i> ` ) , noticemessage ) ;
2019-10-18 10:56:41 +02:00
}
}
if ( ! type ) {
2019-10-23 10:03:33 +02:00
var comp = BDFDB . ColorUtils . convert ( options . color , "RGBCOMP" ) ;
2019-10-18 10:56:41 +02:00
if ( comp ) {
var fontcolor = comp [ 0 ] > 180 && comp [ 1 ] > 180 && comp [ 2 ] > 180 ? "#000" : "#FFF" ;
2019-10-23 10:03:33 +02:00
var backgroundcolor = BDFDB . ColorUtils . convert ( comp , "HEX" ) ;
2019-10-18 10:56:41 +02:00
var filter = comp [ 0 ] > 180 && comp [ 1 ] > 180 && comp [ 2 ] > 180 ? "brightness(0%)" : "brightness(100%)" ;
2019-11-28 12:34:57 +01:00
BDFDB . DOMUtils . appendLocalStyle ( "BDFDBcustomnotificationbarColorCorrection" + id , ` ${ BDFDB . dotCN . noticewrapper } [notice-id=" ${ id } "]{background-color: ${ backgroundcolor } !important;} ${ BDFDB . dotCN . noticewrapper } [notice-id=" ${ id } "] .notice-message {color: ${ fontcolor } !important;} ${ BDFDB . dotCN . noticewrapper } [notice-id=" ${ id } "] ${ BDFDB . dotCN . noticebutton } {color: ${ fontcolor } !important;border-color: ${ BDFDB . ColorUtils . setAlpha ( fontcolor , 0.25 , "RGBA" ) } !important;} ${ BDFDB . dotCN . noticewrapper } [notice-id=" ${ id } "] ${ BDFDB . dotCN . noticebutton } :hover {color: ${ backgroundcolor } !important;background-color: ${ fontcolor } !important;} ${ BDFDB . dotCN . noticewrapper } [notice-id=" ${ id } "] ${ BDFDB . dotCN . noticedismiss } {filter: ${ filter } !important;} ` ) ;
2019-10-18 10:56:41 +02:00
}
2019-10-23 11:10:01 +02:00
else BDFDB . DOMUtils . addClass ( notice , BDFDB . disCN . noticedefault ) ;
2019-10-18 10:56:41 +02:00
}
notice . style . setProperty ( "height" , "36px" , "important" ) ;
notice . style . setProperty ( "min-width" , "70vw" , "important" ) ;
notice . style . setProperty ( "left" , "unset" , "important" ) ;
notice . style . setProperty ( "right" , "unset" , "important" ) ;
2019-10-23 11:10:01 +02:00
let sidemargin = ( ( BDFDB . DOMUtils . getWidth ( document . body . firstElementChild ) - BDFDB . DOMUtils . getWidth ( notice ) ) / 2 ) ;
2019-10-18 10:56:41 +02:00
notice . style . setProperty ( "left" , sidemargin + "px" , "important" ) ;
notice . style . setProperty ( "right" , sidemargin + "px" , "important" ) ;
notice . style . setProperty ( "min-width" , "unset" , "important" ) ;
notice . style . setProperty ( "width" , "unset" , "important" ) ;
notice . style . setProperty ( "max-width" , "calc(100vw - " + ( sidemargin * 2 ) + "px)" , "important" ) ;
2019-10-18 19:19:38 +02:00
notice . querySelector ( BDFDB . dotCN . noticedismiss ) . addEventListener ( "click" , _ => {
2019-10-18 10:56:41 +02:00
notice . style . setProperty ( "overflow" , "hidden" , "important" ) ;
notice . style . setProperty ( "height" , "0px" , "important" ) ;
2019-11-01 10:14:50 +01:00
BDFDB . TimeUtils . timeout ( _ => {
2019-10-18 10:56:41 +02:00
BDFDB . ArrayUtils . remove ( NotificationBars , id ) ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . removeLocalStyle ( "BDFDBcustomnotificationbar" + id ) ;
BDFDB . DOMUtils . removeLocalStyle ( "BDFDBcustomnotificationbarColorCorrection" + id ) ;
2019-10-18 10:56:41 +02:00
notice . remove ( ) ;
} , 500 ) ;
} ) ;
return notice ;
} ;
BDFDB . NotificationUtils . alert = function ( header , body ) {
if ( typeof header == "string" && typeof header == "string" && window . BdApi && typeof BdApi . alert == "function" ) BdApi . alert ( header , body ) ;
} ;
var Tooltips = [ ] ;
BDFDB . TooltipUtils = { } ;
BDFDB . TooltipUtils . create = function ( anker , text , options = { } ) {
2019-11-28 11:33:23 +01:00
var itemlayercontainer = document . querySelector ( BDFDB . dotCN . appmount + " > * > " + BDFDB . dotCN . itemlayercontainer ) ;
if ( ! itemlayercontainer || ( typeof text != "string" && ! BDFDB . ObjectUtils . is ( options . guild ) ) || ! Node . prototype . isPrototypeOf ( anker ) || ! document . contains ( anker ) ) return null ;
2019-10-23 11:10:01 +02:00
var id = BDFDB . NumberUtils . generateId ( Tooltips ) ;
2019-11-28 12:34:57 +01:00
var itemlayer = BDFDB . DOMUtils . create ( ` <div class=" ${ BDFDB . disCNS . itemlayer + BDFDB . disCN . itemlayerdisabledpointerevents } "><div class=" ${ BDFDB . disCN . tooltip } " tooltip-id=" ${ id } "></div></div> ` ) ;
2019-10-18 10:56:41 +02:00
itemlayercontainer . appendChild ( itemlayer ) ;
var tooltip = itemlayer . firstElementChild ;
2019-11-28 11:24:46 +01:00
2019-10-18 10:56:41 +02:00
if ( options . id ) tooltip . id = options . id . split ( " " ) . join ( "" ) ;
2019-11-28 11:24:46 +01:00
if ( ! options . type || ! BDFDB . disCN [ "tooltip" + options . type . toLowerCase ( ) ] ) options . type = "top" ;
BDFDB . DOMUtils . addClass ( tooltip , BDFDB . disCN [ "tooltip" + options . type . toLowerCase ( ) ] ) ;
tooltip . type = options . type . toLowerCase ( ) ;
let fontColorIsGradient = false , customBackgroundColor = false , style = "" ;
if ( options . style ) style += options . style ;
if ( options . fontColor ) {
fontColorIsGradient = BDFDB . ObjectUtils . is ( options . fontColor ) ;
if ( ! fontColorIsGradient ) style = ( style ? ( style + " " ) : "" ) + ` color: ${ BDFDB . ColorUtils . convert ( options . fontColor , "RGBA" ) } !important; `
}
if ( options . backgroundColor ) {
customBackgroundColor = true ;
let backgroundColorIsGradient = BDFDB . ObjectUtils . is ( options . backgroundColor ) ;
let backgroundColor = ! backgroundColorIsGradient ? BDFDB . ColorUtils . convert ( options . backgroundColor , "RGBA" ) : BDFDB . ColorUtils . createGradient ( options . backgroundColor ) ;
style = ( style ? ( style + " " ) : "" ) + ` background: ${ backgroundColor } !important; border-color: ${ backgroundColorIsGradient ? BDFDB . ColorUtils . convert ( options . backgroundColor [ options . type == "left" ? 100 : 0 ] , "RGBA" ) : backgroundColor } !important; ` ;
}
if ( style ) tooltip . style = style ;
if ( customBackgroundColor ) BDFDB . DOMUtils . addClass ( tooltip , BDFDB . disCN . tooltipcustom ) ;
else if ( options . color && BDFDB . disCN [ "tooltip" + options . color . toLowerCase ( ) ] ) BDFDB . DOMUtils . addClass ( tooltip , BDFDB . disCN [ "tooltip" + options . color . toLowerCase ( ) ] ) ;
else BDFDB . DOMUtils . addClass ( tooltip , BDFDB . disCN . tooltipblack ) ;
2019-11-25 22:58:14 +01:00
if ( options . list || BDFDB . ObjectUtils . is ( options . guild ) ) BDFDB . DOMUtils . addClass ( tooltip , BDFDB . disCN . tooltiplistitem ) ;
2019-11-28 11:24:46 +01:00
2019-10-23 11:10:01 +02:00
if ( options . selector ) BDFDB . DOMUtils . addClass ( tooltip , options . selector ) ;
2019-11-28 11:24:46 +01:00
2019-11-24 11:13:45 +01:00
if ( BDFDB . ObjectUtils . is ( options . guild ) ) {
2019-11-25 22:56:54 +01:00
let streamOwnerIds = LibraryModules . StreamUtils . getAllApplicationStreams ( ) . filter ( app => app . guildId === options . guild . id ) . map ( app => app . ownerId ) ;
2019-12-28 19:37:59 +01:00
let streamOwners = streamOwnerIds . map ( ownerId => LibraryModules . UserStore . getUser ( ownerId ) ) . filter ( n => n ) ;
let connectedUsers = Object . keys ( LibraryModules . VoiceUtils . getVoiceStates ( options . guild . id ) ) . map ( userId => ! streamOwnerIds . includes ( userId ) && BDFDB . LibraryModules . UserStore . getUser ( userId ) ) . filter ( n => n ) ;
2019-11-25 22:56:54 +01:00
let tooltiptext = text || options . guild . toString ( ) ;
2019-11-28 11:24:46 +01:00
if ( fontColorIsGradient ) tooltiptext = ` <span style="pointer-events: none; -webkit-background-clip: text !important; color: transparent !important; background-image: ${ BDFDB . ColorUtils . createGradient ( options . fontColor ) } !important;"> ${ BDFDB . StringUtils . htmlEscape ( tooltiptext ) } </span> ` ;
2019-11-24 11:13:45 +01:00
BDFDB . ReactUtils . render ( BDFDB . ReactUtils . createElement ( BDFDB . ReactUtils . Fragment , {
children : [
BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . tooltiprow , BDFDB . disCN . tooltiprowguildname ) ,
children : [
2020-02-08 11:14:10 +01:00
BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . GuildComponents . Badge , {
2019-11-24 11:13:45 +01:00
guild : options . guild ,
size : LibraryModules . StringUtils . cssValueToNumber ( DiscordClassModules . TooltipGuild . iconSize ) ,
className : BDFDB . disCN . tooltiprowicon
} ) ,
BDFDB . ReactUtils . createElement ( "span" , {
2019-11-24 20:56:00 +01:00
className : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . tooltipguildnametext , ( connectedUsers . length || streamOwners . length ) && BDFDB . disCN . tooltipguildnametextlimitedsize ) ,
2019-11-28 11:24:46 +01:00
children : fontColorIsGradient || options . html ? BDFDB . ReactUtils . elementToReact ( BDFDB . DOMUtils . create ( tooltiptext ) ) : tooltiptext
2019-11-24 11:13:45 +01:00
} )
]
} ) ,
2019-11-24 20:56:00 +01:00
connectedUsers . length ? BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . tooltiprow ,
children : [
2020-02-08 11:14:10 +01:00
BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . SvgIcon , {
name : InternalComponents . LibraryComponents . SvgIcon . Names . SPEAKER ,
2019-11-24 20:56:00 +01:00
className : BDFDB . disCN . tooltipactivityicon
} ) ,
2020-02-08 11:14:10 +01:00
BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . UserSummaryItem , {
2019-11-24 20:56:00 +01:00
users : connectedUsers ,
max : 6
} )
]
} ) : null ,
streamOwners . length ? BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . tooltiprow ,
children : [
2020-02-08 11:14:10 +01:00
BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . SvgIcon , {
name : InternalComponents . LibraryComponents . SvgIcon . Names . STREAM ,
2019-11-24 20:56:00 +01:00
className : BDFDB . disCN . tooltipactivityicon
} ) ,
2020-02-08 11:14:10 +01:00
BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . UserSummaryItem , {
2019-11-24 20:56:00 +01:00
users : streamOwners ,
max : 6
} )
]
} ) : null
] . filter ( n => n )
2019-11-24 11:13:45 +01:00
} ) , tooltip ) ;
}
else {
2019-11-28 11:24:46 +01:00
if ( fontColorIsGradient ) tooltip . innerHTML = ` <span style="pointer-events: none; -webkit-background-clip: text !important; color: transparent !important; background-image: ${ BDFDB . ColorUtils . createGradient ( options . fontColor ) } !important;"> ${ BDFDB . StringUtils . htmlEscape ( text ) } </span> ` ;
else if ( options . html === true ) tooltip . innerHTML = text ;
2019-11-24 11:13:45 +01:00
else tooltip . innerText = text ;
}
2019-11-28 11:24:46 +01:00
2019-10-30 13:08:32 +01:00
tooltip . appendChild ( BDFDB . DOMUtils . create ( ` <div class=" ${ BDFDB . disCN . tooltippointer } "></div> ` ) ) ;
2019-10-18 10:56:41 +02:00
tooltip . anker = anker ;
2019-11-28 12:34:57 +01:00
if ( options . hide ) BDFDB . DOMUtils . appendLocalStyle ( "BDFDBhideOtherTooltips" + id , ` #app-mount ${ BDFDB . dotCN . tooltip } :not([tooltip-id=" ${ id } "]) {display: none !important;} ` , itemlayercontainer ) ;
2019-10-18 10:56:41 +02:00
2020-01-20 00:21:05 +01:00
let mouseleave = _ => { BDFDB . DOMUtils . remove ( itemlayer ) ; } ;
2019-10-18 10:56:41 +02:00
anker . addEventListener ( "mouseleave" , mouseleave ) ;
2020-01-20 00:21:05 +01:00
let observer = new MutationObserver ( changes => changes . forEach ( change => {
let nodes = Array . from ( change . removedNodes ) ;
if ( nodes . indexOf ( itemlayer ) > - 1 || nodes . indexOf ( anker ) > - 1 || nodes . some ( n => n . contains ( anker ) ) ) {
BDFDB . ArrayUtils . remove ( Tooltips , id ) ;
observer . disconnect ( ) ;
BDFDB . DOMUtils . remove ( itemlayer ) ;
BDFDB . DOMUtils . removeLocalStyle ( "BDFDBhideOtherTooltips" + id , itemlayercontainer ) ;
anker . removeEventListener ( "mouseleave" , mouseleave ) ;
}
} ) ) ;
2019-10-18 10:56:41 +02:00
observer . observe ( document . body , { subtree : true , childList : true } ) ;
BDFDB . TooltipUtils . update ( tooltip ) ;
if ( options . delay ) {
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . toggle ( itemlayer ) ;
2019-11-01 10:14:50 +01:00
BDFDB . TimeUtils . timeout ( _ => { BDFDB . DOMUtils . toggle ( itemlayer ) ; } , options . delay ) ;
2019-10-18 10:56:41 +02:00
}
2019-10-18 12:10:53 +02:00
return itemlayer ;
2019-10-18 10:56:41 +02:00
} ;
BDFDB . TooltipUtils . update = function ( tooltip ) {
if ( ! Node . prototype . isPrototypeOf ( tooltip ) ) return ;
2019-10-23 11:10:01 +02:00
let itemlayer = BDFDB . DOMUtils . getParent ( BDFDB . dotCN . itemlayer , tooltip ) ;
2019-10-18 10:56:41 +02:00
if ( ! Node . prototype . isPrototypeOf ( itemlayer ) ) return ;
tooltip = itemlayer . querySelector ( BDFDB . dotCN . tooltip ) ;
2019-11-28 11:24:46 +01:00
if ( ! Node . prototype . isPrototypeOf ( tooltip ) || ! Node . prototype . isPrototypeOf ( tooltip . anker ) || ! tooltip . type ) return ;
2019-10-18 10:56:41 +02:00
var pointer = tooltip . querySelector ( BDFDB . dotCN . tooltippointer ) ;
2019-10-30 13:08:32 +01:00
var left , top , trects = BDFDB . DOMUtils . getRects ( tooltip . anker ) , irects = BDFDB . DOMUtils . getRects ( itemlayer ) , arects = BDFDB . DOMUtils . getRects ( document . querySelector ( BDFDB . dotCN . appmount ) ) , positionoffsets = { height : 10 , width : 10 } ;
2019-11-28 11:24:46 +01:00
switch ( tooltip . type ) {
2019-10-18 10:56:41 +02:00
case "top" :
top = trects . top - irects . height - positionoffsets . height + 2 ;
left = trects . left + ( trects . width - irects . width ) / 2 ;
break ;
case "bottom" :
top = trects . top + trects . height + positionoffsets . height - 2 ;
left = trects . left + ( trects . width - irects . width ) / 2 ;
break ;
case "left" :
top = trects . top + ( trects . height - irects . height ) / 2 ;
left = trects . left - irects . width - positionoffsets . width + 2 ;
break ;
case "right" :
top = trects . top + ( trects . height - irects . height ) / 2 ;
left = trects . left + trects . width + positionoffsets . width - 2 ;
break ;
}
itemlayer . style . setProperty ( "top" , top + "px" ) ;
itemlayer . style . setProperty ( "left" , left + "px" ) ;
pointer . style . removeProperty ( "margin-left" ) ;
pointer . style . removeProperty ( "margin-top" ) ;
2019-11-28 11:24:46 +01:00
if ( tooltip . type == "top" || tooltip . type == "bottom" ) {
2019-10-18 10:56:41 +02:00
if ( left < 0 ) {
itemlayer . style . setProperty ( "left" , "5px" ) ;
pointer . style . setProperty ( "margin-left" , ` ${ left - 10 } px ` ) ;
}
else {
var rightmargin = arects . width - ( left + irects . width ) ;
if ( rightmargin < 0 ) {
itemlayer . style . setProperty ( "left" , arects . width - irects . width - 5 + "px" ) ;
pointer . style . setProperty ( "margin-left" , ` ${ - 1 * rightmargin } px ` ) ;
}
}
}
2019-11-28 11:24:46 +01:00
else if ( tooltip . type == "left" || tooltip . type == "right" ) {
2019-10-18 10:56:41 +02:00
if ( top < 0 ) {
itemlayer . style . setProperty ( "top" , "5px" ) ;
pointer . style . setProperty ( "margin-top" , ` ${ top - 10 } px ` ) ;
}
else {
var bottommargin = arects . height - ( top + irects . height ) ;
if ( bottommargin < 0 ) {
itemlayer . style . setProperty ( "top" , arects . height - irects . height - 5 + "px" ) ;
pointer . style . setProperty ( "margin-top" , ` ${ - 1 * bottommargin } px ` ) ;
}
}
}
} ;
BDFDB . ObjectUtils = { } ;
BDFDB . ObjectUtils . is = function ( obj ) {
return obj && Object . prototype . isPrototypeOf ( obj ) && ! Array . prototype . isPrototypeOf ( obj ) ;
} ;
2019-10-30 13:08:32 +01:00
BDFDB . ObjectUtils . extract = function ( obj , ... keys ) {
let newobj = { } ;
2019-11-22 14:26:12 +01:00
if ( BDFDB . ObjectUtils . is ( obj ) ) for ( let key of keys . flat ( 10 ) . filter ( n => n ) ) if ( obj [ key ] ) newobj [ key ] = obj [ key ] ;
2019-11-07 13:45:41 +01:00
return newobj ;
} ;
BDFDB . ObjectUtils . exclude = function ( obj , ... keys ) {
let newobj = Object . assign ( { } , obj ) ;
BDFDB . ObjectUtils . delete ( newobj , ... keys )
2019-10-30 13:08:32 +01:00
return newobj ;
} ;
2019-10-27 19:48:03 +01:00
BDFDB . ObjectUtils . delete = function ( obj , ... keys ) {
2019-11-22 14:26:12 +01:00
if ( BDFDB . ObjectUtils . is ( obj ) ) for ( let key of keys . flat ( 10 ) . filter ( n => n ) ) delete obj [ key ] ;
2019-10-27 19:48:03 +01:00
} ;
2019-10-18 10:56:41 +02:00
BDFDB . ObjectUtils . sort = function ( obj , sort , except ) {
if ( ! BDFDB . ObjectUtils . is ( obj ) ) return { } ;
var newobj = { } ;
if ( sort === undefined || ! sort ) for ( let key of Object . keys ( obj ) . sort ( ) ) newobj [ key ] = obj [ key ] ;
else {
let values = [ ] ;
for ( let key in obj ) values . push ( obj [ key ] ) ;
values = BDFDB . ArrayUtils . keySort ( values , sort , except ) ;
for ( let value of values ) for ( let key in obj ) if ( BDFDB . equals ( value , obj [ key ] ) ) {
newobj [ key ] = value ;
break ;
}
}
return newobj ;
} ;
BDFDB . ObjectUtils . reverse = function ( obj , sort ) {
if ( ! BDFDB . ObjectUtils . is ( obj ) ) return { } ;
var newobj = { } ;
for ( let key of ( sort === undefined || ! sort ) ? Object . keys ( obj ) . reverse ( ) : Object . keys ( obj ) . sort ( ) . reverse ( ) ) newobj [ key ] = obj [ key ] ;
return newobj ;
} ;
BDFDB . ObjectUtils . filter = function ( obj , filter , bykey = false ) {
if ( ! BDFDB . ObjectUtils . is ( obj ) ) return { } ;
if ( typeof filter != "function" ) return obj ;
2019-10-18 12:27:30 +02:00
return Object . keys ( obj ) . filter ( key => filter ( bykey ? key : obj [ key ] ) ) . reduce ( ( newobj , key ) => ( newobj [ key ] = obj [ key ] , newobj ) , { } ) ;
2019-10-18 10:56:41 +02:00
} ;
BDFDB . ObjectUtils . push = function ( obj , value ) {
if ( BDFDB . ObjectUtils . is ( obj ) ) obj [ Object . keys ( obj ) . length ] = value ;
} ;
BDFDB . ObjectUtils . pop = function ( obj , value ) {
if ( BDFDB . ObjectUtils . is ( obj ) ) {
let keys = Object . keys ( obj ) ;
if ( ! keys . length ) return ;
let value = obj [ keys [ keys . length - 1 ] ] ;
delete obj [ keys [ keys . length - 1 ] ] ;
return value ;
}
} ;
2019-10-23 19:55:17 +02:00
BDFDB . ObjectUtils . map = function ( obj , mapfunc ) {
2019-10-18 10:56:41 +02:00
if ( ! BDFDB . ObjectUtils . is ( obj ) ) return { } ;
2019-10-23 19:55:17 +02:00
if ( typeof mapfunc != "string" && typeof mapfunc != "function" ) return obj ;
2019-10-18 10:56:41 +02:00
var newobj = { } ;
2019-10-23 22:08:10 +02:00
for ( let key in obj ) if ( BDFDB . ObjectUtils . is ( obj [ key ] ) ) newobj [ key ] = typeof mapfunc == "string" ? obj [ key ] [ mapfunc ] : mapfunc ( obj [ key ] , key ) ;
2019-10-18 10:56:41 +02:00
return newobj ;
} ;
2019-10-23 19:08:55 +02:00
BDFDB . ObjectUtils . toArray = function ( obj ) {
if ( ! BDFDB . ObjectUtils . is ( obj ) ) return [ ] ;
return Object . entries ( obj ) . map ( n => n [ 1 ] ) ;
} ;
2019-10-18 10:56:41 +02:00
BDFDB . ObjectUtils . deepAssign = function ( obj , ... objs ) {
if ( ! objs . length ) return obj ;
2020-01-05 12:00:41 +01:00
let nextobj = objs . shift ( ) ;
2019-10-18 10:56:41 +02:00
if ( BDFDB . ObjectUtils . is ( obj ) && BDFDB . ObjectUtils . is ( nextobj ) ) {
2020-01-05 12:00:41 +01:00
for ( let key in nextobj ) {
2019-10-18 10:56:41 +02:00
if ( BDFDB . ObjectUtils . is ( nextobj [ key ] ) ) {
if ( ! obj [ key ] ) Object . assign ( obj , { [ key ] : { } } ) ;
BDFDB . ObjectUtils . deepAssign ( obj [ key ] , nextobj [ key ] ) ;
}
else Object . assign ( obj , { [ key ] : nextobj [ key ] } ) ;
}
}
return BDFDB . ObjectUtils . deepAssign ( obj , ... objs ) ;
} ;
BDFDB . ObjectUtils . isEmpty = function ( obj ) {
return ! BDFDB . ObjectUtils . is ( obj ) || Object . getOwnPropertyNames ( obj ) . length == 0 ;
} ;
BDFDB . ArrayUtils = { } ;
BDFDB . ArrayUtils . is = function ( array ) {
return array && Array . isArray ( array ) ;
} ;
2020-01-09 22:53:02 +01:00
BDFDB . ArrayUtils . sum = function ( array ) {
return Array . isArray ( array ) ? array . reduce ( ( total , num ) => total + Math . round ( num ) , 0 ) : 0 ;
} ;
2019-10-18 10:56:41 +02:00
BDFDB . ArrayUtils . keySort = function ( array , key , except ) {
if ( ! BDFDB . ArrayUtils . is ( array ) ) return [ ] ;
if ( key == null ) return array ;
if ( except === undefined ) except = null ;
2020-01-09 22:53:02 +01:00
return array . sort ( ( x , y ) => {
2019-10-18 10:56:41 +02:00
var xvalue = x [ key ] , yvalue = y [ key ] ;
if ( xvalue !== except ) return xvalue < yvalue ? - 1 : xvalue > yvalue ? 1 : 0 ;
} ) ;
} ;
BDFDB . ArrayUtils . numSort = function ( array ) {
2020-01-09 22:53:02 +01:00
return array . sort ( ( x , y ) => { return x < y ? - 1 : x > y ? 1 : 0 ; } ) ;
2019-10-18 10:56:41 +02:00
} ;
BDFDB . ArrayUtils . remove = function ( array , value , all = false ) {
if ( ! BDFDB . ArrayUtils . is ( array ) ) return [ ] ;
if ( ! array . includes ( value ) ) return array ;
if ( ! all ) array . splice ( array . indexOf ( value ) , 1 ) ;
else while ( array . indexOf ( value ) > - 1 ) array . splice ( array . indexOf ( value ) , 1 ) ;
2019-11-12 20:39:10 +01:00
return array ;
2019-10-18 10:56:41 +02:00
} ;
BDFDB . ArrayUtils . getAllIndexes = function ( array , value ) {
2019-11-06 23:57:43 +01:00
if ( ! BDFDB . ArrayUtils . is ( array ) && typeof array != "string" ) return [ ] ;
2019-10-18 10:56:41 +02:00
var indexes = [ ] , index = - 1 ;
while ( ( index = array . indexOf ( value , index + 1 ) ) !== - 1 ) indexes . push ( index ) ;
return indexes ;
} ;
BDFDB . ArrayUtils . removeCopies = function ( array ) {
if ( ! BDFDB . ArrayUtils . is ( array ) ) return [ ] ;
return [ ... new Set ( array ) ] ;
} ;
2019-11-01 10:14:50 +01:00
2019-10-20 20:57:23 +02:00
BDFDB . ModuleUtils = { } ;
2020-01-05 15:37:33 +01:00
BDFDB . ModuleUtils . cached = window . BDFDB && window . BDFDB . ModuleUtils && window . BDFDB . ModuleUtils . cached || { } ;
2019-12-05 11:08:22 +01:00
BDFDB . ModuleUtils . find = function ( filter , getExport ) {
getExport = typeof getExport != "boolean" ? true : getExport ;
2019-11-01 10:16:54 +01:00
var req = InternalBDFDB . getWebModuleReq ( ) ;
2019-10-18 10:56:41 +02:00
for ( let i in req . c ) if ( req . c . hasOwnProperty ( i ) ) {
var m = req . c [ i ] . exports ;
2019-12-05 11:08:22 +01:00
if ( m && ( typeof m == "object" || typeof m == "function" ) && filter ( m ) ) return getExport ? m : req . c [ i ] ;
2020-01-30 19:55:56 +01:00
if ( m && m . _ _esModule ) {
for ( let j in m ) if ( m [ j ] && ( typeof m [ j ] == "object" || typeof m [ j ] == "function" ) && filter ( m [ j ] ) ) return getExport ? m [ j ] : req . c [ i ] ;
if ( m . default && ( typeof m . default == "object" || typeof m . default == "function" ) ) for ( let j in m . default ) if ( m . default [ j ] && ( typeof m . default [ j ] == "object" || typeof m . default [ j ] == "function" ) && filter ( m . default [ j ] ) ) return getExport ? m . default [ j ] : req . c [ i ] ;
}
2019-10-18 10:56:41 +02:00
}
} ;
2019-12-05 11:08:22 +01:00
BDFDB . ModuleUtils . findByProperties = function ( ... properties ) {
properties = properties . flat ( 10 ) ;
let getExport = properties . pop ( ) ;
if ( typeof getExport != "boolean" ) {
properties . push ( getExport ) ;
getExport = true ;
2019-10-18 10:56:41 +02:00
}
2019-12-05 11:08:22 +01:00
return InternalBDFDB . findModule ( "prop" , JSON . stringify ( properties ) , m => properties . every ( prop => m [ prop ] !== undefined ) , getExport ) ;
2019-10-18 10:56:41 +02:00
} ;
2019-12-05 11:08:22 +01:00
BDFDB . ModuleUtils . findByName = function ( name , getExport ) {
2020-01-30 19:55:56 +01:00
return InternalBDFDB . findModule ( "name" , JSON . stringify ( name ) , m => m . displayName === name || m . render && m . render . displayName === name , typeof getExport != "boolean" ? true : getExport ) ;
2019-12-05 11:08:22 +01:00
} ;
BDFDB . ModuleUtils . findByString = function ( ... strings ) {
strings = strings . flat ( 10 ) ;
let getExport = strings . pop ( ) ;
if ( typeof getExport != "boolean" ) {
strings . push ( getExport ) ;
getExport = true ;
2019-10-18 10:56:41 +02:00
}
2020-01-30 12:13:36 +01:00
return InternalBDFDB . findModule ( "string" , JSON . stringify ( strings ) , m => strings . every ( string => typeof m == "function" && ( m . toString ( ) . indexOf ( string ) > - 1 || m . _ _originalMethod && m . _ _originalMethod . toString ( ) . indexOf ( string ) > - 1 || m . _ _originalFunction && m . _ _originalFunction . toString ( ) . indexOf ( string ) > - 1 ) || BDFDB . ObjectUtils . is ( m ) && typeof m . type == "function" && ( m . type . toString ( ) . indexOf ( string ) > - 1 || m . type . _ _originalMethod && m . type . _ _originalMethod . toString ( ) . indexOf ( string ) > - 1 || m . type . _ _originalFunction && m . type . _ _originalFunction . toString ( ) . indexOf ( string ) > - 1 ) ) , getExport ) ;
2019-10-18 10:56:41 +02:00
} ;
2019-12-05 11:08:22 +01:00
BDFDB . ModuleUtils . findByPrototypes = function ( ... protoprops ) {
protoprops = protoprops . flat ( 10 ) ;
let getExport = protoprops . pop ( ) ;
if ( typeof getExport != "boolean" ) {
protoprops . push ( getExport ) ;
getExport = true ;
2019-10-18 10:56:41 +02:00
}
2019-12-05 11:08:22 +01:00
return InternalBDFDB . findModule ( "proto" , JSON . stringify ( protoprops ) , m => m . prototype && protoprops . every ( prop => m . prototype [ prop ] !== undefined ) , getExport ) ;
2019-10-18 10:56:41 +02:00
} ;
2019-12-05 11:08:22 +01:00
InternalBDFDB . findModule = function ( type , cachestring , filter , getExport ) {
2020-01-05 15:18:14 +01:00
if ( ! BDFDB . ObjectUtils . is ( BDFDB . ModuleUtils . cached [ type ] ) ) BDFDB . ModuleUtils . cached [ type ] = { module : { } , export : { } } ;
if ( getExport && BDFDB . ModuleUtils . cached [ type ] . export [ cachestring ] ) return BDFDB . ModuleUtils . cached [ type ] . export [ cachestring ] ;
else if ( ! getExport && BDFDB . ModuleUtils . cached [ type ] . module [ cachestring ] ) return BDFDB . ModuleUtils . cached [ type ] . module [ cachestring ] ;
2019-10-18 10:56:41 +02:00
else {
2019-12-05 11:08:22 +01:00
var m = BDFDB . ModuleUtils . find ( filter , getExport ) ;
2019-10-18 10:56:41 +02:00
if ( m ) {
2020-01-05 15:18:14 +01:00
if ( getExport ) BDFDB . ModuleUtils . cached [ type ] . export [ cachestring ] = m ;
else BDFDB . ModuleUtils . cached [ type ] . module [ cachestring ] = m ;
2019-10-18 10:56:41 +02:00
return m ;
}
2019-12-05 11:08:22 +01:00
else BDFDB . LogUtils . warn ( ` ${ cachestring } [ ${ type } ] not found in WebModules ` ) ;
2019-10-18 10:56:41 +02:00
}
} ;
2019-11-01 10:14:50 +01:00
InternalBDFDB . getWebModuleReq = function ( ) {
if ( ! InternalBDFDB . getWebModuleReq . req ) {
const id = "BDFDB-WebModules" ;
2019-11-18 13:46:07 +01:00
const req = window . webpackJsonp . push ( [ [ ] , { [ id ] : ( module , exports , req ) => module . exports = req } , [ [ id ] ] ] ) ;
2019-11-01 10:14:50 +01:00
delete req . m [ id ] ;
delete req . c [ id ] ;
InternalBDFDB . getWebModuleReq . req = req ;
2019-10-29 21:39:41 +01:00
}
2019-11-01 10:14:50 +01:00
return InternalBDFDB . getWebModuleReq . req ;
} ;
2019-11-06 14:26:00 +01:00
var WebModulesData = { } ;
WebModulesData . Patchtypes = [ "before" , "instead" , "after" ] ;
WebModulesData . Patchmap = {
2019-11-01 10:14:50 +01:00
BannedCard : "BannedUser" ,
2019-12-21 10:42:12 +01:00
ChannelWindow : "Channel" ,
2019-11-01 10:14:50 +01:00
InvitationCard : "InviteRow" ,
InviteCard : "InviteRow" ,
2019-12-01 17:57:07 +01:00
MemberCard : "Member" ,
2019-11-01 10:14:50 +01:00
PopoutContainer : "Popout" ,
2019-12-01 15:40:19 +01:00
QuickSwitchResult : "Result" ,
2020-01-27 14:49:20 +01:00
UserProfile : "UserProfileBody" ,
2019-11-01 10:14:50 +01:00
WebhookCard : "Webhook"
} ;
2020-01-30 23:06:25 +01:00
WebModulesData . ForceObserve = [
2020-01-10 18:35:39 +01:00
"DirectMessage" ,
2020-02-07 12:12:32 +01:00
"GuildIcon"
2019-12-01 16:01:19 +01:00
] ;
2020-01-30 23:06:25 +01:00
WebModulesData . DefaultRender = [
2020-02-08 11:14:10 +01:00
"ContextMenuItem" ,
2020-01-31 10:38:02 +01:00
"DiscordTag" ,
2020-02-05 12:31:17 +01:00
"InviteModalUserRow" ,
2020-02-07 19:20:01 +01:00
"Mention" ,
2020-01-31 09:20:27 +01:00
"Message" ,
2020-02-01 19:54:26 +01:00
"MessageHeader" ,
2020-02-01 20:14:02 +01:00
"MessageTimestamp" ,
2020-02-08 09:40:39 +01:00
"NameTag" ,
"NowPlayingItem" ,
2020-02-02 20:27:46 +01:00
"SystemMessage" ,
2020-02-07 15:04:22 +01:00
"SimpleMessageAccessories" ,
"UserInfo"
2020-01-31 09:08:52 +01:00
] ;
WebModulesData . MemoComponent = [
2020-02-08 10:13:17 +01:00
"MessageContent" ,
"NowPlayingHeader"
2019-12-21 02:11:03 +01:00
] ;
2020-01-31 09:08:52 +01:00
WebModulesData . NonPrototype = [ ] . concat ( WebModulesData . DefaultRender , WebModulesData . MemoComponent , [
2020-01-30 23:06:25 +01:00
"ChannelTextAreaContainer"
2020-01-30 21:08:33 +01:00
] ) ;
2019-12-30 10:41:25 +01:00
WebModulesData . LoadedInComponents = {
2020-02-08 10:43:40 +01:00
AutocompleteChannelResult : "LibraryComponents.AutocompleteComponents.Channel" ,
AutocompleteUserResult : "LibraryComponents.AutocompleteComponents.User" ,
ContextMenuItem : "NativeSubComponents.ContextMenuItem" ,
QuickSwitchChannelResult : "LibraryComponents.QuickSwitchComponents.Channel" ,
QuickSwitchGroupDMResult : "LibraryComponents.QuickSwitchComponents.GroupDM" ,
QuickSwitchGuildResult : "LibraryComponents.QuickSwitchComponents.Guild" ,
QuickSwitchUserResult : "LibraryComponents.QuickSwitchComponents.User"
2019-12-30 10:41:25 +01:00
} ;
2019-11-06 14:26:00 +01:00
WebModulesData . Patchfinder = {
2019-11-01 10:14:50 +01:00
Account : "accountinfo" ,
2019-11-05 12:56:55 +01:00
App : "app" ,
2019-12-11 00:43:17 +01:00
AppSkeleton : "app" ,
2019-11-24 20:56:00 +01:00
AppView : "appcontainer" ,
2019-11-01 10:14:50 +01:00
AuthWrapper : "loginscreen" ,
BannedCard : "guildsettingsbannedcard" ,
ChannelMember : "member" ,
2019-12-21 10:42:12 +01:00
ChannelTextAreaForm : "chatform" ,
ChannelWindow : "chatcontent" ,
2020-01-10 10:58:51 +01:00
DirectMessage : "guildouter" ,
2019-11-01 10:14:50 +01:00
EmojiPicker : "emojipicker" ,
FriendRow : "friendsrow" ,
Guild : "guildouter" ,
2019-12-01 17:57:07 +01:00
GuildIcon : "avataricon" ,
2020-02-01 22:22:24 +01:00
GuildSettingsBans : "guildsettingsbannedcard" ,
GuildSettingsEmoji : "guildsettingsemojicard" ,
GuildSettingsMembers : "guildsettingsmembercard" ,
2019-12-01 18:25:43 +01:00
GuildSidebar : "guildchannels" ,
2019-12-11 00:35:07 +01:00
I18nLoaderWrapper : "app" ,
2019-11-01 10:14:50 +01:00
InstantInviteModal : "invitemodalwrapper" ,
InvitationCard : "invitemodalinviterow" ,
InviteCard : "guildsettingsinvitecard" ,
PopoutContainer : "popout" ,
PrivateChannelCall : "callcurrentcontainer" ,
2020-02-07 14:13:00 +01:00
PrivateChannelCallParticipants : "callcurrentcontainer" ,
2020-01-23 10:51:43 +01:00
PrivateChannelRecipientsInvitePopout : "searchpopoutdmaddpopout" ,
2019-11-20 16:57:13 +01:00
PrivateChannelsList : "dmchannelsscroller" ,
2019-12-01 15:40:19 +01:00
QuickSwitchChannelResult : "quickswitchresult" ,
QuickSwitchGuildResult : "quickswitchresult" ,
QuickSwitchResult : "quickswitchresult" ,
2019-11-01 10:14:50 +01:00
MemberCard : "guildsettingsmembercard" ,
2020-01-17 12:15:36 +01:00
Messages : "messages" ,
2019-12-30 10:41:25 +01:00
MessagesPopout : "messagespopout" ,
2019-12-01 14:28:31 +01:00
MutualGuilds : "userprofilebody" ,
MutualFriends : "userprofilebody" ,
2019-11-01 10:14:50 +01:00
NameTag : "nametag" ,
Note : "usernote" ,
SearchResults : "searchresultswrap" ,
TypingUsers : "typing" ,
2019-11-21 11:07:39 +01:00
UnreadDMs : "guildsscroller" ,
2019-12-21 11:25:13 +01:00
Upload : "uploadmodal" ,
2020-02-05 11:32:40 +01:00
UserHook : "auditloguserhook" ,
2019-11-01 10:14:50 +01:00
UserPopout : "userpopout" ,
2020-01-27 14:49:20 +01:00
UserProfile : "userprofile" ,
2019-11-03 17:04:09 +01:00
V2C _ContentColumn : "contentcolumn" ,
2019-11-01 10:14:50 +01:00
V2C _List : "_repolist" ,
V2C _PluginCard : "_repoheader" ,
V2C _ThemeCard : "_repoheader"
} ;
2019-11-06 14:26:00 +01:00
WebModulesData . GlobalModules = { } ;
try { WebModulesData . GlobalModules [ "V2C_ContentColumn" ] = V2C _ContentColumn ; } catch ( err ) { BDFDB . LogUtils . warn ( ` Could not find global Module "V2C_ContentColumn" ` ) ; }
try { WebModulesData . GlobalModules [ "V2C_List" ] = V2C _List ; } catch ( err ) { BDFDB . LogUtils . warn ( ` Could not find global Module "V2C_List" ` ) ; }
try { WebModulesData . GlobalModules [ "V2C_PluginCard" ] = V2C _PluginCard ; } catch ( err ) { BDFDB . LogUtils . warn ( ` Could not find global Module "V2C_PluginCard" ` ) ; }
try { WebModulesData . GlobalModules [ "V2C_ThemeCard" ] = V2C _ThemeCard ; } catch ( err ) { BDFDB . LogUtils . warn ( ` Could not find global Module "V2C_ThemeCard" ` ) ; }
2019-12-09 13:20:52 +01:00
BDFDB . ModuleUtils . isPatched = function ( plugin , module , modulefunction ) {
if ( ! plugin || ! BDFDB . ObjectUtils . is ( module ) || ! module . BDFDBpatch || ! modulefunction ) return false ;
2020-02-03 11:39:06 +01:00
const pluginId = ( typeof plugin === "string" ? plugin : plugin . name ) . toLowerCase ( ) ;
2020-02-04 09:17:14 +01:00
return pluginId && module [ modulefunction ] && module [ modulefunction ] . _ _isBDFDBpatched && module . BDFDBpatch [ modulefunction ] && Object . keys ( module . BDFDBpatch [ modulefunction ] ) . some ( patchfunc => Object . keys ( module . BDFDBpatch [ modulefunction ] [ patchfunc ] ) . includes ( pluginId ) ) ;
2019-12-06 22:59:13 +01:00
} ;
2019-12-11 08:47:46 +01:00
BDFDB . ModuleUtils . patch = function ( plugin , module , modulefunctions , patchfunctions , forceRepatch = false ) {
2019-12-06 22:59:13 +01:00
if ( ! plugin || ! BDFDB . ObjectUtils . is ( module ) || ! modulefunctions || ! BDFDB . ObjectUtils . is ( patchfunctions ) ) return null ;
2019-11-14 17:40:04 +01:00
patchfunctions = BDFDB . ObjectUtils . filter ( patchfunctions , type => WebModulesData . Patchtypes . includes ( type ) , true ) ;
2019-12-05 11:08:22 +01:00
if ( BDFDB . ObjectUtils . isEmpty ( patchfunctions ) ) return null ;
2020-02-03 11:39:06 +01:00
const pluginName = typeof plugin === "string" ? plugin : plugin . name ;
const pluginId = pluginName . toLowerCase ( ) ;
2019-11-01 10:14:50 +01:00
if ( ! module . BDFDBpatch ) module . BDFDBpatch = { } ;
2019-11-22 14:26:12 +01:00
modulefunctions = [ modulefunctions ] . flat ( 10 ) . filter ( n => n ) ;
2020-01-31 09:12:55 +01:00
for ( let modulefunction of modulefunctions ) if ( module [ modulefunction ] == null || typeof module [ modulefunction ] == "function" ) {
2020-02-04 09:17:14 +01:00
if ( ! module . BDFDBpatch [ modulefunction ] || forceRepatch && ( ! module [ modulefunction ] || ! module [ modulefunction ] . _ _isBDFDBpatched ) ) {
2019-12-11 08:47:46 +01:00
if ( ! module . BDFDBpatch [ modulefunction ] ) {
module . BDFDBpatch [ modulefunction ] = { } ;
for ( let type of WebModulesData . Patchtypes ) module . BDFDBpatch [ modulefunction ] [ type ] = { } ;
}
2020-01-31 09:12:55 +01:00
if ( ! module [ modulefunction ] ) module [ modulefunction ] = ( _ => { } ) ;
2019-12-11 08:59:48 +01:00
const originalfunction = module [ modulefunction ] ;
2019-12-09 20:26:38 +01:00
module . BDFDBpatch [ modulefunction ] . originalMethod = originalfunction ;
2019-11-01 10:14:50 +01:00
module [ modulefunction ] = function ( ) {
2019-12-17 15:17:06 +01:00
let callInstead = false , stopCall = false ;
2019-11-05 19:50:36 +01:00
const data = {
2019-11-01 10:14:50 +01:00
thisObject : this ,
methodArguments : arguments ,
originalMethod : originalfunction ,
originalMethodName : modulefunction ,
2019-12-17 14:33:02 +01:00
callOriginalMethod : _ => { if ( ! stopCall ) data . returnValue = data . originalMethod . apply ( data . thisObject , data . methodArguments ) } ,
callOriginalMethodAfterwards : _ => { callInstead = true ; } ,
stopOriginalMethodCall : _ => { stopCall = true ; }
2019-11-01 10:14:50 +01:00
} ;
2020-01-16 16:20:41 +01:00
if ( module . BDFDBpatch && module . BDFDBpatch [ modulefunction ] ) {
2019-11-01 10:14:50 +01:00
if ( ! BDFDB . ObjectUtils . isEmpty ( module . BDFDBpatch [ modulefunction ] . before ) ) for ( let id in BDFDB . ObjectUtils . sort ( module . BDFDBpatch [ modulefunction ] . before ) ) {
2020-02-08 11:33:48 +01:00
BDFDB . TimeUtils . suppress ( module . BDFDBpatch [ modulefunction ] . before [ id ] , ` "before" callback of ${ modulefunction } in ${ module . constructor ? ( module . constructor . displayName || module . constructor . name ) : "module" } ` , module . BDFDBpatch [ modulefunction ] . before [ id ] . pluginName ) ( data ) ;
2019-10-30 14:37:35 +01:00
}
2019-12-17 14:33:02 +01:00
let hasInsteadPatches = ! BDFDB . ObjectUtils . isEmpty ( module . BDFDBpatch [ modulefunction ] . instead ) ;
if ( hasInsteadPatches ) for ( let id in BDFDB . ObjectUtils . sort ( module . BDFDBpatch [ modulefunction ] . instead ) ) {
2020-02-08 11:33:48 +01:00
let tempreturn = BDFDB . TimeUtils . suppress ( module . BDFDBpatch [ modulefunction ] . instead [ id ] , ` "instead" callback of ${ modulefunction } in ${ module . constructor ? ( module . constructor . displayName || module . constructor . name ) : "module" } ` , module . BDFDBpatch [ modulefunction ] . instead [ id ] . pluginName ) ( data ) ;
2019-11-01 10:14:50 +01:00
if ( tempreturn !== undefined ) data . returnValue = tempreturn ;
2019-10-21 17:06:50 +02:00
}
2020-02-08 11:33:48 +01:00
if ( ( ! hasInsteadPatches || callInstead ) && ! stopCall ) BDFDB . TimeUtils . suppress ( data . callOriginalMethod , ` originalMethod of ${ modulefunction } in ${ module . constructor ? ( module . constructor . displayName || module . constructor . name ) : "module" } ` ) ( ) ;
2019-11-01 10:14:50 +01:00
if ( ! BDFDB . ObjectUtils . isEmpty ( module . BDFDBpatch [ modulefunction ] . after ) ) for ( let id in BDFDB . ObjectUtils . sort ( module . BDFDBpatch [ modulefunction ] . after ) ) {
2020-02-08 11:33:48 +01:00
let tempreturn = BDFDB . TimeUtils . suppress ( module . BDFDBpatch [ modulefunction ] . after [ id ] , ` "after" callback of ${ modulefunction } in ${ module . constructor ? ( module . constructor . displayName || module . constructor . name ) : "module" } ` , module . BDFDBpatch [ modulefunction ] . after [ id ] . pluginName ) ( data ) ;
2019-11-01 10:14:50 +01:00
if ( tempreturn !== undefined ) data . returnValue = tempreturn ;
2019-10-30 14:37:35 +01:00
}
2019-10-21 17:06:50 +02:00
}
2019-11-07 19:34:41 +01:00
else BDFDB . TimeUtils . suppress ( data . callOriginalMethod , ` originalMethod of ${ modulefunction } in ${ module . constructor ? module . constructor . displayName || module . constructor . name : "module" } ` ) ( ) ;
2019-12-17 15:17:06 +01:00
callInstead = false , stopCall = false ;
2019-11-07 13:53:42 +01:00
return modulefunction == "render" && data . returnValue === undefined ? null : data . returnValue ;
2019-11-01 10:14:50 +01:00
} ;
2020-01-25 18:22:17 +01:00
for ( let key of Object . keys ( originalfunction ) ) module [ modulefunction ] [ key ] = originalfunction [ key ] ;
2020-02-08 10:43:40 +01:00
if ( ! module [ modulefunction ] . _ _originalMethod ) module [ modulefunction ] . _ _originalMethod = originalfunction ;
if ( ! module [ modulefunction ] . _ _originalFunction ) module [ modulefunction ] . _ _originalFunction = originalfunction ;
2020-02-04 09:17:14 +01:00
module [ modulefunction ] . _ _isBDFDBpatched = true ;
2019-10-18 10:56:41 +02:00
}
2019-11-14 17:40:04 +01:00
for ( let type in patchfunctions ) if ( typeof patchfunctions [ type ] == "function" ) {
2020-02-03 11:39:06 +01:00
module . BDFDBpatch [ modulefunction ] [ type ] [ pluginId ] = patchfunctions [ type ] ;
module . BDFDBpatch [ modulefunction ] [ type ] [ pluginId ] . pluginName = pluginName ;
2019-11-10 17:29:00 +01:00
}
2019-10-18 10:56:41 +02:00
}
2019-11-05 16:15:27 +01:00
let cancel = _ => { BDFDB . ModuleUtils . unpatch ( plugin , module , modulefunctions ) ; } ;
2019-12-07 10:21:17 +01:00
if ( BDFDB . ObjectUtils . is ( plugin ) ) {
2019-10-18 14:56:41 +02:00
if ( ! BDFDB . ArrayUtils . is ( plugin . patchCancels ) ) plugin . patchCancels = [ ] ;
2019-10-18 10:56:41 +02:00
plugin . patchCancels . push ( cancel ) ;
}
return cancel ;
} ;
2019-10-20 20:57:23 +02:00
BDFDB . ModuleUtils . unpatch = function ( plugin , module , modulefunctions ) {
if ( ! module && ! modulefunctions ) {
2019-10-22 12:20:12 +02:00
if ( BDFDB . ObjectUtils . is ( plugin ) && BDFDB . ArrayUtils . is ( plugin . patchCancels ) ) {
for ( let cancel of plugin . patchCancels ) cancel ( ) ;
plugin . patchCancels = [ ] ;
}
2019-10-20 20:57:23 +02:00
}
else {
if ( ! BDFDB . ObjectUtils . is ( module ) || ! module . BDFDBpatch ) return ;
2020-02-03 11:39:06 +01:00
const pluginName = ! plugin ? null : ( typeof plugin === "string" ? plugin : plugin . name ) . toLowerCase ( ) ;
2019-10-20 20:57:23 +02:00
if ( modulefunctions ) {
2020-02-03 11:39:06 +01:00
for ( let modulefunction of [ modulefunctions ] . flat ( 10 ) . filter ( n => n ) ) if ( module [ modulefunction ] && module . BDFDBpatch [ modulefunction ] ) unpatch ( modulefunction , pluginName ) ;
2019-10-20 20:57:23 +02:00
}
2020-02-03 11:39:06 +01:00
else for ( let patchedfunction of module . BDFDBpatch ) unpatch ( patchedfunction , pluginName ) ;
2019-10-20 20:57:23 +02:00
}
2020-02-03 11:39:06 +01:00
function unpatch ( func , pluginName ) {
2019-11-06 14:26:00 +01:00
for ( let type of WebModulesData . Patchtypes ) {
2020-02-03 11:39:06 +01:00
if ( pluginName ) delete module . BDFDBpatch [ func ] [ type ] [ pluginName ] ;
2019-10-20 20:57:23 +02:00
else delete module . BDFDBpatch [ func ] [ type ] ;
}
2020-02-03 11:39:06 +01:00
let empty = true ;
2019-11-06 14:26:00 +01:00
for ( let type of WebModulesData . Patchtypes ) if ( ! BDFDB . ObjectUtils . isEmpty ( module . BDFDBpatch [ func ] [ type ] ) ) empty = false ;
2019-10-20 20:57:23 +02:00
if ( empty ) {
module [ func ] = module . BDFDBpatch [ func ] . originalMethod ;
delete module . BDFDBpatch [ func ] ;
if ( BDFDB . ObjectUtils . isEmpty ( module . BDFDBpatch ) ) delete module . BDFDBpatch ;
2019-10-18 10:56:41 +02:00
}
}
} ;
2019-11-05 20:35:35 +01:00
BDFDB . ModuleUtils . forceAllUpdates = function ( plugin , selectedtypes ) {
2019-11-14 17:40:04 +01:00
if ( BDFDB . ObjectUtils . is ( plugin ) && BDFDB . ObjectUtils . is ( plugin . patchedModules ) ) {
2019-10-18 10:56:41 +02:00
const app = document . querySelector ( BDFDB . dotCN . app ) ;
const bdsettings = document . querySelector ( "#bd-settingspane-container " + BDFDB . dotCN . scrollerwrap ) ;
if ( app ) {
2019-11-14 17:40:04 +01:00
let filteredmodules = [ ] , patchtypes = { } ;
for ( let patchtype in plugin . patchedModules ) for ( let type in plugin . patchedModules [ patchtype ] ) {
2019-11-22 14:26:12 +01:00
let methodnames = [ plugin . patchedModules [ patchtype ] [ type ] ] . flat ( 10 ) . filter ( n => n ) ;
2019-11-14 17:40:04 +01:00
if ( methodnames . includes ( "componentDidMount" ) || methodnames . includes ( "componentDidUpdate" ) || methodnames . includes ( "render" ) ) {
filteredmodules . push ( type ) ;
let unmappedtype = type . split ( " _ _ " ) [ 0 ] ;
if ( ! patchtypes [ unmappedtype ] ) patchtypes [ unmappedtype ] = [ ] ;
patchtypes [ unmappedtype ] . push ( patchtype ) ;
}
2019-10-18 10:56:41 +02:00
}
2019-11-22 14:26:12 +01:00
selectedtypes = [ selectedtypes ] . flat ( 10 ) . filter ( n => n ) ;
2019-11-05 20:35:35 +01:00
if ( selectedtypes . length ) {
2019-11-06 14:26:00 +01:00
selectedtypes = selectedtypes . map ( type => type && WebModulesData . Patchmap [ type ] ? WebModulesData . Patchmap [ type ] + " _ _ " + type : type ) ;
2019-11-05 20:35:35 +01:00
filteredmodules = filteredmodules . filter ( type => selectedtypes . indexOf ( type ) > - 1 ) ;
}
2019-11-14 17:40:04 +01:00
filteredmodules = BDFDB . ArrayUtils . removeCopies ( filteredmodules ) ;
2019-10-18 10:56:41 +02:00
if ( filteredmodules . length ) {
try {
2019-11-22 14:26:12 +01:00
const appinsdown = BDFDB . ReactUtils . findOwner ( app , { name : filteredmodules , all : true , group : true , unlimited : true } ) ;
const appinsup = BDFDB . ReactUtils . findOwner ( app , { name : filteredmodules , all : true , group : true , unlimited : true , up : true } ) ;
2019-11-14 17:40:04 +01:00
for ( let type in appinsdown ) for ( let ins of appinsdown [ type ] ) InternalBDFDB . forceInitiateProcess ( plugin , ins , type , patchtypes [ type ] ) ;
for ( let type in appinsup ) for ( let ins of appinsup [ type ] ) InternalBDFDB . forceInitiateProcess ( plugin , ins , type , patchtypes [ type ] ) ;
2019-10-18 10:56:41 +02:00
if ( bdsettings ) {
2019-11-22 14:26:12 +01:00
const bdsettingsins = BDFDB . ReactUtils . findOwner ( bdsettings , { name : filteredmodules , all : true , group : true , unlimited : true } ) ;
2019-11-14 17:40:04 +01:00
for ( let type in bdsettingsins ) for ( let ins of bdsettingsins [ type ] ) InternalBDFDB . forceInitiateProcess ( plugin , ins , type , patchtypes [ type ] ) ;
2019-10-18 10:56:41 +02:00
}
}
2019-11-03 16:53:33 +01:00
catch ( err ) { BDFDB . LogUtils . error ( "Could not force update components! " + err , plugin . name ) ; }
2019-10-18 10:56:41 +02:00
}
}
}
} ;
2019-11-14 17:40:04 +01:00
InternalBDFDB . forceInitiateProcess = function ( plugin , instance , type , patchtypes ) {
2019-10-18 19:19:38 +02:00
if ( ! plugin || ! instance || ! type ) return ;
2019-11-14 17:40:04 +01:00
let methodnames = [ ] ;
for ( let patchtype in plugin . patchedModules ) if ( plugin . patchedModules [ patchtype ] [ type ] ) methodnames . push ( plugin . patchedModules [ patchtype ] [ type ] ) ;
2019-11-22 14:26:12 +01:00
methodnames = BDFDB . ArrayUtils . removeCopies ( methodnames ) . flat ( 10 ) . filter ( n => n ) ;
2019-11-14 17:40:04 +01:00
if ( methodnames . includes ( "componentDidMount" ) ) InternalBDFDB . initiateProcess ( plugin , type , { instance , methodname : "componentDidMount" , patchtypes } ) ;
2019-10-23 22:32:36 +02:00
if ( methodnames . includes ( "render" ) ) BDFDB . ReactUtils . forceUpdate ( instance ) ;
2019-11-14 17:40:04 +01:00
else if ( methodnames . includes ( "componentDidUpdate" ) ) InternalBDFDB . initiateProcess ( plugin , type , { instance , methodname : "componentDidUpdate" , patchtypes } ) ;
2019-10-22 14:20:12 +02:00
} ;
2019-10-29 18:47:38 +01:00
InternalBDFDB . initiateProcess = function ( plugin , type , e ) {
2019-11-05 09:15:23 +01:00
if ( BDFDB . ObjectUtils . is ( plugin ) && ! plugin . stopping && e . instance ) {
2019-11-02 01:46:42 +01:00
// REMOVE
let isLib = plugin . name == "$BDFDB" ;
2020-02-03 11:39:06 +01:00
if ( plugin . name == "$BDFDB" ) plugin = InternalBDFDB ;
2019-10-22 14:20:12 +02:00
type = ( type . split ( " _ _ " ) [ 1 ] || type ) . replace ( /[^A-z0-9]|_/g , "" ) ;
2019-10-29 18:47:38 +01:00
type = type . charAt ( 0 ) . toUpperCase ( ) + type . slice ( 1 ) ;
2019-10-22 14:20:12 +02:00
if ( typeof plugin [ "process" + type ] == "function" ) {
2019-10-29 18:47:38 +01:00
// REMOVE
2019-11-02 01:46:42 +01:00
let isOldType = ! isLib && plugin [ "process" + type ] . toString ( ) . split ( "\n" ) [ 0 ] . replace ( / /g , "" ) . split ( "," ) . length > 1 ;
2019-10-29 18:47:38 +01:00
if ( isOldType ) {
if ( e . methodname == "render" ) {
if ( e . returnvalue ) plugin [ "process" + type ] ( e . instance , null , e . returnvalue , [ e . methodname ] ) ;
}
else {
let wrapper = BDFDB . ReactUtils . findDOMNode ( e . instance ) ;
if ( wrapper ) plugin [ "process" + type ] ( e . instance , wrapper , e . returnvalue , [ e . methodname ] ) ;
2019-11-01 10:14:50 +01:00
else BDFDB . TimeUtils . timeout ( _ => {
2019-10-29 18:47:38 +01:00
wrapper = BDFDB . ReactUtils . findDOMNode ( e . instance ) ;
if ( wrapper ) plugin [ "process" + type ] ( e . instance , wrapper , e . returnvalue , [ e . methodname ] ) ;
} ) ;
}
}
else {
2020-01-31 09:33:13 +01:00
if ( typeof e . methodname == "string" && ( e . methodname . indexOf ( "componentDid" ) == 0 || e . methodname . indexOf ( "componentWill" ) == 0 ) ) {
2019-10-29 18:47:38 +01:00
e . node = BDFDB . ReactUtils . findDOMNode ( e . instance ) ;
if ( e . node ) plugin [ "process" + type ] ( e ) ;
2019-11-01 10:14:50 +01:00
else BDFDB . TimeUtils . timeout ( _ => {
2019-10-29 18:47:38 +01:00
e . node = BDFDB . ReactUtils . findDOMNode ( e . instance ) ;
if ( e . node ) plugin [ "process" + type ] ( e ) ;
} ) ;
2020-01-31 09:33:13 +01:00
2019-10-29 18:47:38 +01:00
}
2020-01-31 09:33:13 +01:00
else if ( e . returnvalue || e . patchtypes . includes ( "before" ) ) plugin [ "process" + type ] ( e ) ;
2019-10-29 18:47:38 +01:00
}
2019-10-22 14:20:12 +02:00
}
}
2019-10-18 19:19:38 +02:00
} ;
2019-10-22 12:17:08 +02:00
InternalBDFDB . patchPlugin = function ( plugin ) {
2019-11-14 17:40:04 +01:00
if ( ! BDFDB . ObjectUtils . is ( plugin ) || ! BDFDB . ObjectUtils . is ( plugin . patchedModules ) ) return ;
BDFDB . ModuleUtils . unpatch ( plugin ) ;
for ( let patchtype in plugin . patchedModules ) for ( let type in plugin . patchedModules [ patchtype ] ) {
if ( WebModulesData . GlobalModules [ type ] && typeof WebModulesData . GlobalModules [ type ] == "function" ) patchInstance ( WebModulesData . GlobalModules [ type ] , type , patchtype ) ;
else {
2020-02-08 11:14:10 +01:00
let unmappedtype = type . split ( " _ _ " ) [ 1 ] || type ;
let component = WebModulesData . LoadedInComponents [ type ] && BDFDB . ReactUtils . getValue ( InternalComponents , WebModulesData . LoadedInComponents [ type ] ) ;
if ( component ) patchInstance ( WebModulesData . DefaultRender . includes ( unmappedtype ) ? ( BDFDB . ModuleUtils . find ( m => m == component , false ) || { } ) . exports : component , type , patchtype ) ;
2019-12-30 10:41:25 +01:00
else {
2020-02-08 11:14:10 +01:00
let classname = WebModulesData . Patchfinder [ unmappedtype ] ;
2019-12-30 10:41:25 +01:00
let mapped = WebModulesData . Patchmap [ type ] ;
let mappedtype = mapped ? mapped + " _ _ " + type : type ;
2020-02-08 11:14:10 +01:00
let name = mappedtype . split ( " _ _ " ) [ 0 ] ;
2019-12-30 10:41:25 +01:00
if ( mapped ) {
plugin . patchedModules [ patchtype ] [ mappedtype ] = plugin . patchedModules [ patchtype ] [ type ] ;
delete plugin . patchedModules [ patchtype ] [ type ] ;
}
2020-02-08 11:14:10 +01:00
if ( WebModulesData . DefaultRender . includes ( unmappedtype ) ) patchInstance ( ( BDFDB . ModuleUtils . findByName ( name , false ) || { } ) . exports , mappedtype , patchtype , true ) ;
else if ( WebModulesData . MemoComponent . includes ( unmappedtype ) ) patchInstance ( ( BDFDB . ModuleUtils . findByName ( name , false ) || { exports : { } } ) . exports . default , mappedtype , patchtype , true ) ;
else if ( ! classname ) patchInstance ( BDFDB . ModuleUtils . findByName ( name ) , mappedtype , patchtype ) ;
else if ( DiscordClasses [ classname ] ) checkForInstance ( classname , mappedtype , patchtype , WebModulesData . ForceObserve . includes ( unmappedtype ) ) ;
2019-10-18 10:56:41 +02:00
}
}
2019-11-14 17:40:04 +01:00
}
2020-01-30 21:08:33 +01:00
function patchInstance ( instance , type , patchtype , exported ) {
2019-11-14 17:40:04 +01:00
if ( instance ) {
2019-12-24 09:10:36 +01:00
let name = type . split ( " _ _ " ) [ 0 ] ;
2019-11-14 17:40:04 +01:00
instance = instance . _reactInternalFiber && instance . _reactInternalFiber . type ? instance . _reactInternalFiber . type : instance ;
2020-01-30 23:28:43 +01:00
instance = exported || InternalBDFDB . isInstanceCorrect ( instance , name ) || WebModulesData . LoadedInComponents [ type ] ? instance : ( BDFDB . ReactUtils . findConstructor ( instance , name ) || BDFDB . ReactUtils . findConstructor ( instance , name , { up : true } ) ) ;
2019-10-18 10:56:41 +02:00
if ( instance ) {
instance = instance . _reactInternalFiber && instance . _reactInternalFiber . type ? instance . _reactInternalFiber . type : instance ;
2019-11-14 17:40:04 +01:00
let patchfunctions = { } ;
2020-01-30 22:08:01 +01:00
patchfunctions [ patchtype ] = e => { InternalBDFDB . initiateProcess ( plugin , type , { instance : window != e . thisObject ? e . thisObject : { props : e . methodArguments [ 0 ] } , returnvalue : e . returnValue , methodname : e . originalMethodName , patchtypes : [ patchtype ] } ) } ;
2020-01-30 23:06:25 +01:00
BDFDB . ModuleUtils . patch ( plugin , WebModulesData . NonPrototype . includes ( name ) ? instance : instance . prototype , plugin . patchedModules [ patchtype ] [ type ] , patchfunctions ) ;
2019-10-18 10:56:41 +02:00
}
}
2019-11-14 17:40:04 +01:00
}
2019-12-01 15:40:19 +01:00
function checkForInstance ( classname , type , patchtype , forceobserve ) {
2019-11-14 17:40:04 +01:00
const app = document . querySelector ( BDFDB . dotCN . app ) , bdsettings = document . querySelector ( "#bd-settingspane-container " + BDFDB . dotCN . scrollerwrap ) ;
2019-12-01 15:40:19 +01:00
let instancefound = false ;
if ( ! forceobserve ) {
if ( app ) {
let appins = BDFDB . ReactUtils . findConstructor ( app , type , { unlimited : true } ) || BDFDB . ReactUtils . findConstructor ( app , type , { unlimited : true , up : true } ) ;
if ( appins && ( instancefound = true ) ) patchInstance ( appins , type , patchtype ) ;
}
if ( ! instancefound && bdsettings ) {
let bdsettingsins = BDFDB . ReactUtils . findConstructor ( bdsettings , type , { unlimited : true } ) ;
if ( bdsettingsins && ( instancefound = true ) ) patchInstance ( bdsettingsins , type , patchtype ) ;
}
2019-10-18 10:56:41 +02:00
}
2019-11-14 17:40:04 +01:00
if ( ! instancefound ) {
2019-11-20 16:57:13 +01:00
let found = false , disclass = BDFDB . disCN [ classname ] , dotclass = BDFDB . dotCN [ classname ] ;
2019-12-01 16:01:19 +01:00
for ( let ele of document . querySelectorAll ( dotclass ) ) {
let ins = BDFDB . ReactUtils . getInstance ( ele ) ;
if ( isCorrectInstance ( ins , type ) ) {
found = true ;
patchInstance ( ins , type , patchtype ) ;
BDFDB . ModuleUtils . forceAllUpdates ( plugin , type ) ;
break ;
2019-11-14 17:40:04 +01:00
}
2019-12-01 16:01:19 +01:00
}
if ( ! found ) {
let instanceobserver = new MutationObserver ( cs => { cs . forEach ( c => { c . addedNodes . forEach ( n => {
if ( found || ! n || ! n . tagName ) return ;
let ele = null ;
if ( ( ele = BDFDB . DOMUtils . containsClass ( n , disclass ) ? n : n . querySelector ( dotclass ) ) != null ) {
let ins = BDFDB . ReactUtils . getInstance ( ele ) ;
if ( isCorrectInstance ( ins , type ) ) {
found = true ;
instanceobserver . disconnect ( ) ;
patchInstance ( ins , type , patchtype ) ;
BDFDB . ModuleUtils . forceAllUpdates ( plugin , type ) ;
}
}
} ) ; } ) ; } ) ;
BDFDB . ObserverUtils . connect ( plugin , BDFDB . dotCN . appmount , { name : "checkForInstanceObserver" , instance : instanceobserver , multi : true
} , { childList : true , subtree : true } ) ;
}
2019-10-18 10:56:41 +02:00
}
}
2019-11-14 17:40:04 +01:00
function isCorrectInstance ( instance , name ) {
if ( ! instance ) return false ;
instance = instance . _reactInternalFiber && instance . _reactInternalFiber . type ? instance . _reactInternalFiber . type : instance ;
2020-01-30 23:28:43 +01:00
instance = InternalBDFDB . isInstanceCorrect ( instance , name ) ? instance : ( BDFDB . ReactUtils . findConstructor ( instance , name ) || BDFDB . ReactUtils . findConstructor ( instance , name , { up : true } ) ) ;
2019-11-14 17:40:04 +01:00
return ! ! instance ;
}
2019-10-18 10:56:41 +02:00
} ;
2020-01-30 23:40:14 +01:00
InternalBDFDB . isInstanceCorrect = function ( instance , name ) {
2020-01-30 23:55:07 +01:00
return instance && ( ( instance . type && ( instance . type . render && instance . type . render . displayName === name || instance . type . displayName === name || instance . type . name === name || instance . type === name ) ) || instance . render && ( instance . render . displayName === name || instance . render . name === name ) || instance . displayName == name || instance . name === name ) ;
2020-01-30 23:28:43 +01:00
} ;
2020-01-30 11:30:07 +01:00
InternalBDFDB . addContextListeners = function ( plugin ) {
2020-02-08 11:14:10 +01:00
for ( let type of ComponentTypeData . NormalContextMenus ) if ( typeof plugin [ ` on ${ type } ` ] === "function" ) InternalBDFDB . patchContextMenuPlugin ( plugin , type , InternalComponents . LibraryComponents . ContextMenus [ type ] ) ;
2020-01-30 15:46:30 +01:00
for ( let type of ComponentTypeData . FluxContextMenus ) if ( typeof plugin [ ` on ${ type } ` ] === "function" ) {
if ( BDFDB . InternalData . componentPatchQueries [ type ] . module ) InternalBDFDB . patchContextMenuPlugin ( plugin , type , BDFDB . InternalData . componentPatchQueries [ type ] . module ) ;
2020-01-30 20:23:41 +01:00
else {
BDFDB . InternalData . componentPatchQueries [ type ] . query . push ( plugin ) ;
BDFDB . InternalData . componentPatchQueries [ type ] . query . sort ( ( x , y ) => { return x . name < y . name ? - 1 : x . name > y . name ? 1 : 0 ; } ) ;
}
2019-10-18 10:56:41 +02:00
}
2020-01-30 15:46:30 +01:00
for ( let type of ComponentTypeData . QueuedComponents ) if ( typeof plugin [ ` on ${ type } ` ] === "function" ) {
if ( BDFDB . InternalData . componentPatchQueries [ type ] . module ) InternalBDFDB . patchExportedContextMenuPlugin ( plugin , type , BDFDB . InternalData . componentPatchQueries [ type ] . module ) ;
2020-01-30 20:23:41 +01:00
else {
BDFDB . InternalData . componentPatchQueries [ type ] . query . push ( plugin ) ;
BDFDB . InternalData . componentPatchQueries [ type ] . query . sort ( ( x , y ) => { return x . name < y . name ? - 1 : x . name > y . name ? 1 : 0 ; } ) ;
}
2020-01-07 10:43:01 +01:00
}
2019-10-18 10:56:41 +02:00
} ;
2020-01-30 11:30:07 +01:00
InternalBDFDB . patchContextMenuPlugin = function ( plugin , type , module ) {
2019-10-30 09:00:01 +01:00
if ( module && module . prototype ) {
// REMOVE
2019-11-02 02:10:41 +01:00
let isOldType = plugin [ "on" + type ] . toString ( ) . split ( "\n" ) [ 0 ] . replace ( / /g , "" ) . split ( "," ) . length > 1 ;
2019-10-30 09:00:01 +01:00
if ( isOldType ) {
BDFDB . ModuleUtils . patch ( plugin , module . prototype , "render" , { after : e => {
let instance = e . thisObject , menu = BDFDB . ReactUtils . findDOMNode ( e . thisObject ) , returnvalue = e . returnValue ;
2019-11-02 01:46:42 +01:00
if ( instance && menu && returnvalue && typeof plugin [ ` on ${ type } ` ] === "function" ) plugin [ ` on ${ type } ` ] ( instance , menu , returnvalue ) ;
2019-10-30 09:00:01 +01:00
} } ) ;
2019-10-18 10:56:41 +02:00
}
2019-10-30 09:00:01 +01:00
else {
BDFDB . ModuleUtils . patch ( plugin , module . prototype , "render" , { after : e => {
if ( e . thisObject && e . returnValue && typeof plugin [ ` on ${ type } ` ] === "function" ) plugin [ ` on ${ type } ` ] ( { instance : e . thisObject , returnvalue : e . returnValue , methodname : "render" } ) ;
} } ) ;
}
}
2019-10-18 10:56:41 +02:00
} ;
2020-01-30 11:30:07 +01:00
InternalBDFDB . patchExportedContextMenuPlugin = function ( plugin , type , module ) {
2019-12-05 11:27:25 +01:00
if ( module && module . exports ) {
2020-01-09 13:21:40 +01:00
// REMOVE
2019-12-05 11:27:25 +01:00
let isOldType = plugin [ "on" + type ] . toString ( ) . split ( "\n" ) [ 0 ] . replace ( / /g , "" ) . split ( "," ) . length > 1 ;
if ( isOldType ) BDFDB . ModuleUtils . patch ( plugin , module . exports , "default" , { after : e => {
if ( e . returnValue && typeof plugin [ ` on ${ type } ` ] === "function" ) plugin [ ` on ${ type } ` ] ( { props : e . methodArguments [ 0 ] } , document , e . returnValue ) ;
} } ) ;
else BDFDB . ModuleUtils . patch ( plugin , module . exports , "default" , { after : e => {
2019-12-05 11:28:56 +01:00
if ( e . returnValue && typeof plugin [ ` on ${ type } ` ] === "function" ) plugin [ ` on ${ type } ` ] ( { instance : { props : e . methodArguments [ 0 ] } , returnvalue : e . returnValue , methodname : "default" } ) ;
2019-12-05 11:27:25 +01:00
} } ) ;
}
2019-12-05 11:08:22 +01:00
} ;
2020-01-30 13:37:01 +01:00
InternalBDFDB . executeExtraPatchedPatches = function ( type , e ) {
2020-01-30 15:46:30 +01:00
if ( BDFDB . ObjectUtils . is ( BDFDB . InternalData . componentPatchQueries [ type ] ) && BDFDB . ArrayUtils . is ( BDFDB . InternalData . componentPatchQueries [ type ] . query ) ) for ( let plugin of BDFDB . InternalData . componentPatchQueries [ type ] . query ) if ( e . returnvalue && typeof plugin [ ` on ${ type } ` ] === "function" ) plugin [ ` on ${ type } ` ] ( e ) ;
2020-01-30 13:37:01 +01:00
} ;
2020-01-30 11:30:07 +01:00
InternalBDFDB . patchContextMenuLib = function ( module , repatch ) {
2019-11-01 10:14:50 +01:00
if ( module && module . prototype ) {
// REMOVE
BDFDB . ModuleUtils . patch ( BDFDB , module . prototype , "componentDidMount" , { after : e => {
if ( ! e . thisObject . BDFDBforceRenderTimeout && typeof e . thisObject . render == "function" ) e . thisObject . render ( ) ;
} } ) ;
BDFDB . ModuleUtils . patch ( BDFDB , module . prototype , "componentDidUpdate" , { after : e => {
var menu = BDFDB . ReactUtils . findDOMNode ( e . thisObject ) ;
if ( menu ) {
const updater = BDFDB . ReactUtils . getValue ( e , "thisObject._reactInternalFiber.stateNode.props.onHeightUpdate" ) ;
const mrects = BDFDB . DOMUtils . getRects ( menu ) , arects = BDFDB . DOMUtils . getRects ( document . querySelector ( BDFDB . dotCN . appmount ) ) ;
if ( updater && ( mrects . top + mrects . height > arects . height ) ) updater ( ) ;
}
} } ) ;
BDFDB . ModuleUtils . patch ( BDFDB , module . prototype , "render" , { after : e => {
if ( e . thisObject . props . BDFDBcontextMenu && e . thisObject . props . children && e . returnValue && e . returnValue . props ) {
e . returnValue . props . children = e . thisObject . props . children ;
delete e . thisObject . props . value ;
delete e . thisObject . props . children ;
delete e . thisObject . props . BDFDBcontextMenu ;
}
if ( BDFDB . ReactUtils . findDOMNode ( e . thisObject ) ) {
e . thisObject . BDFDBforceRenderTimeout = true ;
BDFDB . TimeUtils . timeout ( _ => { delete e . thisObject . BDFDBforceRenderTimeout ; } , 1000 ) ;
}
if ( repatch ) {
let newmodule = BDFDB . ReactUtils . getValue ( e , "thisObject._reactInternalFiber.child.type" ) ;
2020-01-30 15:46:30 +01:00
if ( newmodule && newmodule . displayName && BDFDB . InternalData . componentPatchQueries [ newmodule . displayName ] && ! BDFDB . InternalData . componentPatchQueries [ newmodule . displayName ] . module ) {
BDFDB . InternalData . componentPatchQueries [ newmodule . displayName ] . module = newmodule ;
2019-11-01 10:14:50 +01:00
InternalBDFDB . patchContextMenuLib ( newmodule , false ) ;
2020-01-30 15:46:30 +01:00
while ( BDFDB . InternalData . componentPatchQueries [ newmodule . displayName ] . query . length ) InternalBDFDB . patchContextMenuPlugin ( BDFDB . InternalData . componentPatchQueries [ newmodule . displayName ] . query . pop ( ) , newmodule . displayName , newmodule ) ;
2019-11-01 10:14:50 +01:00
}
}
} } ) ;
}
} ;
2020-01-30 12:01:54 +01:00
InternalBDFDB . patchExportedContextMenuLib = function ( menu , type , shouldCloseOnPatch ) {
let module = BDFDB . ModuleUtils . find ( m => m == menu . type , false ) ;
if ( module && module . exports && module . exports . default ) {
2020-02-08 11:14:10 +01:00
if ( ! InternalComponents . LibraryComponents . ContextMenus [ type ] ) {
InternalComponents . LibraryComponents . ContextMenus [ type ] = module . exports . default ;
2020-01-30 12:01:54 +01:00
BDFDB . LibraryComponents . ContextMenus [ type ] = module . exports . default ;
}
2020-02-08 11:14:10 +01:00
if ( ! InternalComponents . LibraryComponents . ContextMenus . _Exports [ type ] ) {
InternalComponents . LibraryComponents . ContextMenus . _Exports [ type ] = module . exports ;
2020-01-30 12:01:54 +01:00
BDFDB . LibraryComponents . ContextMenus . _Exports [ type ] = module . exports ;
}
2020-01-30 15:46:30 +01:00
if ( BDFDB . InternalData . componentPatchQueries [ type ] && ! BDFDB . InternalData . componentPatchQueries [ type ] . module ) {
BDFDB . InternalData . componentPatchQueries [ type ] . module = module ;
while ( BDFDB . InternalData . componentPatchQueries [ type ] . query . length ) InternalBDFDB . patchExportedContextMenuPlugin ( BDFDB . InternalData . componentPatchQueries [ type ] . query . pop ( ) , type , module ) ;
2020-01-30 12:01:54 +01:00
let close = shouldCloseOnPatch && BDFDB . ReactUtils . getValue ( menu , "memoizedProps.onClose" ) ;
if ( typeof close == "function" ) close ( ) ;
}
if ( ! module . exports . default . displayName ) module . exports . default . displayName = type ;
}
} ;
2020-01-30 11:30:07 +01:00
InternalBDFDB . getContextMenuType = function ( menutype , component ) {
2020-01-14 15:08:18 +01:00
if ( menutype ) {
2020-02-08 11:14:10 +01:00
if ( menutype == "MessageContextMenu" && component && component . type != InternalComponents . LibraryComponents . ContextMenus . MessageContextMenu ) return "MessageOptionContextMenu" ;
2020-01-30 13:37:01 +01:00
else if ( menutype . endsWith ( "ContextMenu" ) ) return menutype ;
2020-02-08 11:14:10 +01:00
else if ( InternalComponents . LibraryComponents . ContextMenus . _Types . includes ( menutype ) ) {
2020-01-14 15:08:18 +01:00
if ( menutype . indexOf ( "USER_" ) == 0 ) return "UserContextMenu" ;
else if ( menutype . indexOf ( "CHANNEL_" ) == 0 ) return "ChannelContextMenu" ;
else if ( menutype . indexOf ( "GUILD_" ) == 0 ) return "GuildContextMenu" ;
2020-02-08 09:40:39 +01:00
else if ( menutype . indexOf ( "MESSAGE_" ) == 0 ) return "MessageContextMenu" ;
2020-01-14 15:08:18 +01:00
}
2020-01-07 10:43:01 +01:00
}
return null ;
} ;
2019-11-01 10:14:50 +01:00
BDFDB . DiscordConstants = BDFDB . ModuleUtils . findByProperties ( "Permissions" , "ActivityTypes" ) ;
2019-11-07 19:06:36 +01:00
var DiscordObjects = { } ;
2019-12-20 22:38:13 +01:00
DiscordObjects . Channel = BDFDB . ModuleUtils . findByPrototypes ( "getRecipientId" , "isManaged" , "getGuildId" ) ;
2019-11-12 20:42:29 +01:00
DiscordObjects . Guild = BDFDB . ModuleUtils . findByPrototypes ( "getIconURL" , "getMaxEmojiSlots" , "getRole" ) ;
2020-01-28 12:03:25 +01:00
DiscordObjects . Invite = BDFDB . ModuleUtils . findByPrototypes ( "getExpiresAt" , "isExpired" ) ;
2019-11-12 20:42:29 +01:00
DiscordObjects . Message = BDFDB . ModuleUtils . findByPrototypes ( "getReaction" , "getAuthorName" , "getChannelId" ) ;
2020-01-17 12:27:15 +01:00
DiscordObjects . Messages = BDFDB . ModuleUtils . findByPrototypes ( "jumpToMessage" , "hasAfterCached" , "forEach" ) ;
2019-11-08 13:04:16 +01:00
DiscordObjects . Timestamp = BDFDB . ModuleUtils . findByPrototypes ( "add" , "dayOfYear" , "hasAlignedHourOffset" ) ;
2019-11-12 20:42:29 +01:00
DiscordObjects . User = BDFDB . ModuleUtils . findByPrototypes ( "hasFlag" , "isLocalBot" , "isClaimed" ) ;
2019-11-07 19:06:36 +01:00
BDFDB . DiscordObjects = Object . assign ( { } , DiscordObjects ) ;
2019-11-01 10:14:50 +01:00
var LibraryRequires = { } ;
for ( let name of [ "child_process" , "electron" , "fs" , "path" , "process" , "request" ] ) {
try { LibraryRequires [ name ] = require ( name ) ; } catch ( err ) { }
}
BDFDB . LibraryRequires = Object . assign ( { } , LibraryRequires ) ;
var LibraryModules = { } ;
LibraryModules . AckUtils = BDFDB . ModuleUtils . findByProperties ( "localAck" , "bulkAck" ) ;
LibraryModules . APIUtils = BDFDB . ModuleUtils . findByProperties ( "getAPIBaseURL" ) ;
2020-01-07 11:06:15 +01:00
LibraryModules . AnalyticsUtils = BDFDB . ModuleUtils . findByProperties ( "isThrottled" , "track" ) ;
2019-11-01 10:14:50 +01:00
LibraryModules . AnimationUtils = BDFDB . ModuleUtils . findByProperties ( "spring" , "decay" ) ;
LibraryModules . BadgeUtils = BDFDB . ModuleUtils . findByProperties ( "getBadgeCountString" , "getBadgeWidthForValue" ) ;
2019-11-14 13:47:11 +01:00
LibraryModules . CategoryCollapseStore = BDFDB . ModuleUtils . findByProperties ( "getCollapsedCategories" , "isCollapsed" ) ;
LibraryModules . CategoryCollapseUtils = BDFDB . ModuleUtils . findByProperties ( "categoryCollapse" , "categoryCollapseAll" ) ;
2019-11-01 10:14:50 +01:00
LibraryModules . ChannelStore = BDFDB . ModuleUtils . findByProperties ( "getChannel" , "getChannels" ) ;
LibraryModules . ColorUtils = BDFDB . ModuleUtils . findByProperties ( "hex2int" , "hex2rgb" ) ;
LibraryModules . ContextMenuUtils = BDFDB . ModuleUtils . findByProperties ( "closeContextMenu" , "openContextMenu" ) ;
2019-11-03 15:37:26 +01:00
LibraryModules . CopyLinkUtils = BDFDB . ModuleUtils . findByProperties ( "SUPPORTS_COPY" , "copy" ) ;
2019-11-01 10:14:50 +01:00
LibraryModules . CurrentUserStore = BDFDB . ModuleUtils . findByProperties ( "getCurrentUser" ) ;
2019-12-09 22:59:55 +01:00
LibraryModules . CurrentVoiceUtils = BDFDB . ModuleUtils . findByProperties ( "getAveragePing" , "isConnected" ) ;
2020-01-05 17:03:59 +01:00
LibraryModules . DirectMessageStore = BDFDB . ModuleUtils . findByProperties ( "getPrivateChannelIds" , "getPrivateChannelTimestamps" ) ;
2019-11-21 12:07:37 +01:00
LibraryModules . DirectMessageUnreadStore = BDFDB . ModuleUtils . findByProperties ( "getUnreadPrivateChannelIds" ) ;
2020-01-09 12:47:23 +01:00
LibraryModules . DispatchApiUtils = BDFDB . ModuleUtils . findByProperties ( "dirtyDispatch" , "isDispatching" ) ;
2020-01-07 11:06:15 +01:00
LibraryModules . DispatchUtils = BDFDB . ModuleUtils . findByProperties ( "ComponentDispatch" ) ;
2019-11-01 10:14:50 +01:00
LibraryModules . DirectMessageUtils = BDFDB . ModuleUtils . findByProperties ( "addRecipient" , "openPrivateChannel" ) ;
LibraryModules . FriendUtils = BDFDB . ModuleUtils . findByProperties ( "getFriendIDs" , "getRelationships" ) ;
LibraryModules . FolderStore = BDFDB . ModuleUtils . findByProperties ( "getGuildFolderById" , "getFlattenedGuilds" ) ;
LibraryModules . FolderUtils = BDFDB . ModuleUtils . findByProperties ( "isFolderExpanded" , "getExpandedFolders" ) ;
LibraryModules . GuildBoostUtils = BDFDB . ModuleUtils . findByProperties ( "getTierName" , "getUserLevel" ) ;
LibraryModules . GuildChannelStore = BDFDB . ModuleUtils . findByProperties ( "getChannels" , "getDefaultChannel" ) ;
LibraryModules . GuildEmojiStore = BDFDB . ModuleUtils . findByProperties ( "getGuildEmoji" , "getDisambiguatedEmojiContext" ) ;
LibraryModules . GuildSettingsUtils = BDFDB . ModuleUtils . findByProperties ( "updateChannelOverrideSettings" , "updateNotificationSettings" ) ;
LibraryModules . GuildStore = BDFDB . ModuleUtils . findByProperties ( "getGuild" , "getGuilds" ) ;
LibraryModules . GuildUtils = BDFDB . ModuleUtils . findByProperties ( "transitionToGuildSync" ) ;
LibraryModules . HistoryUtils = BDFDB . ModuleUtils . findByProperties ( "transitionTo" , "replaceWith" , "getHistory" ) ; ;
LibraryModules . IconUtils = BDFDB . ModuleUtils . findByProperties ( "getGuildIconURL" , "getGuildBannerURL" ) ;
LibraryModules . InviteUtils = BDFDB . ModuleUtils . findByProperties ( "acceptInvite" , "createInvite" ) ;
2019-11-15 14:25:54 +01:00
LibraryModules . KeyCodeUtils = Object . assign ( { } , BDFDB . ModuleUtils . findByProperties ( "toCombo" , "keyToCode" ) ) ;
2020-01-30 11:30:07 +01:00
LibraryModules . KeyCodeUtils . getString = function ( keyarray ) {
2019-11-22 14:26:12 +01:00
return LibraryModules . KeyCodeUtils . toString ( [ keyarray ] . flat ( 10 ) . filter ( n => n ) . map ( keycode => [ BDFDB . DiscordConstants . KeyboardDeviceTypes . KEYBOARD _KEY , keycode , BDFDB . DiscordConstants . KeyboardEnvs . BROWSER ] ) , true ) ;
2019-11-15 21:48:30 +01:00
} ;
LibraryModules . KeyEvents = BDFDB . ModuleUtils . findByProperties ( "aliases" , "code" , "codes" ) ;
2019-11-01 10:14:50 +01:00
LibraryModules . LanguageStore = BDFDB . ModuleUtils . findByProperties ( "getLanguages" , "Messages" ) ;
LibraryModules . LastChannelStore = BDFDB . ModuleUtils . findByProperties ( "getLastSelectedChannelId" ) ;
LibraryModules . LastGuildStore = BDFDB . ModuleUtils . findByProperties ( "getLastSelectedGuildId" ) ;
LibraryModules . LoginUtils = BDFDB . ModuleUtils . findByProperties ( "login" , "logout" ) ;
LibraryModules . MemberStore = BDFDB . ModuleUtils . findByProperties ( "getMember" , "getMembers" ) ;
LibraryModules . MessagePinUtils = BDFDB . ModuleUtils . findByProperties ( "pinMessage" , "unpinMessage" ) ;
LibraryModules . MessageStore = BDFDB . ModuleUtils . findByProperties ( "getMessage" , "getMessages" ) ;
LibraryModules . MessageUtils = BDFDB . ModuleUtils . findByProperties ( "receiveMessage" , "editMessage" ) ;
2020-01-09 12:31:13 +01:00
LibraryModules . ModalUtils = BDFDB . ModuleUtils . findByProperties ( "openModal" , "hasModalOpen" ) ;
2019-11-01 10:14:50 +01:00
LibraryModules . MutedUtils = BDFDB . ModuleUtils . findByProperties ( "isGuildOrCategoryOrChannelMuted" ) ;
2019-11-11 10:23:47 +01:00
LibraryModules . NoteStore = BDFDB . ModuleUtils . findByProperties ( "getNotes" , "getNote" ) ;
2019-11-01 10:14:50 +01:00
LibraryModules . NotificationSettingsUtils = BDFDB . ModuleUtils . findByProperties ( "setDesktopType" , "setTTSType" ) ;
LibraryModules . NotificationSettingsStore = BDFDB . ModuleUtils . findByProperties ( "getDesktopType" , "getTTSType" ) ;
2019-11-15 21:48:30 +01:00
LibraryModules . PlatformUtils = BDFDB . ModuleUtils . findByProperties ( "isWindows" , "isLinux" ) ;
2019-11-01 10:14:50 +01:00
LibraryModules . PermissionUtils = BDFDB . ModuleUtils . findByProperties ( "getChannelPermissions" , "canUser" ) ;
LibraryModules . PermissionRoleUtils = BDFDB . ModuleUtils . findByProperties ( "getHighestRole" , "can" ) ;
2020-01-07 10:52:57 +01:00
LibraryModules . QuoteUtils = BDFDB . ModuleUtils . findByProperties ( "canQuote" , "createQuotedText" ) ;
2019-11-01 10:14:50 +01:00
LibraryModules . ReactionUtils = BDFDB . ModuleUtils . findByProperties ( "addReaction" , "removeReaction" ) ;
LibraryModules . SearchPageUtils = BDFDB . ModuleUtils . findByProperties ( "searchNextPage" , "searchPreviousPage" ) ;
LibraryModules . SelectChannelUtils = BDFDB . ModuleUtils . findByProperties ( "selectChannel" , "selectPrivateChannel" ) ;
LibraryModules . SettingsUtils = BDFDB . ModuleUtils . findByProperties ( "updateRemoteSettings" , "updateLocalSettings" ) ;
LibraryModules . SoundUtils = BDFDB . ModuleUtils . findByProperties ( "playSound" , "createSound" ) ;
LibraryModules . SpellCheckUtils = BDFDB . ModuleUtils . findByProperties ( "learnWord" , "toggleSpellcheck" ) ;
2019-12-03 10:04:43 +01:00
LibraryModules . SlateUtils = BDFDB . ModuleUtils . findByProperties ( "serialize" , "deserialize" ) ;
2019-12-21 00:28:23 +01:00
LibraryModules . SlateSelectionUtils = BDFDB . ModuleUtils . findByProperties ( "serialize" , "serializeSelection" ) ;
2019-11-24 11:13:45 +01:00
LibraryModules . StateStoreUtils = BDFDB . ModuleUtils . findByProperties ( "useStateFromStores" , "useStateFromStoresArray" ) ;
2019-11-01 10:14:50 +01:00
LibraryModules . StatusMetaUtils = BDFDB . ModuleUtils . findByProperties ( "getApplicationActivity" , "getStatus" ) ;
2020-01-15 14:51:50 +01:00
LibraryModules . StoreUtils = BDFDB . ModuleUtils . findByProperties ( "get" , "set" , "clear" , "remove" ) ;
2019-11-04 23:55:12 +01:00
LibraryModules . StreamUtils = BDFDB . ModuleUtils . findByProperties ( "getStreamForUser" , "getActiveStream" ) ;
2019-11-24 11:13:45 +01:00
LibraryModules . StringUtils = BDFDB . ModuleUtils . findByProperties ( "cssValueToNumber" , "upperCaseFirstChar" ) ;
2019-11-01 10:14:50 +01:00
LibraryModules . UnreadGuildUtils = BDFDB . ModuleUtils . findByProperties ( "hasUnread" , "getUnreadGuilds" ) ;
LibraryModules . UnreadChannelUtils = BDFDB . ModuleUtils . findByProperties ( "getUnreadCount" , "getOldestUnreadMessageId" ) ;
LibraryModules . UploadUtils = BDFDB . ModuleUtils . findByProperties ( "upload" , "instantBatchUpload" ) ;
2020-01-21 15:12:48 +01:00
LibraryModules . UserNameUtils = BDFDB . ModuleUtils . findByProperties ( "getName" , "getNickname" ) ;
2019-11-01 10:14:50 +01:00
LibraryModules . UserStore = BDFDB . ModuleUtils . findByProperties ( "getUser" , "getUsers" ) ;
2019-11-24 11:13:45 +01:00
LibraryModules . Utilities = BDFDB . ModuleUtils . findByProperties ( "flatMap" , "cloneDeep" ) ;
2019-11-01 10:14:50 +01:00
LibraryModules . VoiceUtils = BDFDB . ModuleUtils . findByProperties ( "getAllVoiceStates" , "getVoiceStatesForChannel" ) ;
LibraryModules . ZoomUtils = BDFDB . ModuleUtils . findByProperties ( "setZoom" , "setFontSize" ) ;
BDFDB . LibraryModules = Object . assign ( { } , LibraryModules ) ;
LibraryModules . React = BDFDB . ModuleUtils . findByProperties ( "createElement" , "cloneElement" ) ;
LibraryModules . ReactDOM = BDFDB . ModuleUtils . findByProperties ( "render" , "findDOMNode" ) ;
2019-11-04 23:05:31 +01:00
BDFDB . ReactUtils = Object . assign ( { } , LibraryModules . React , LibraryModules . ReactDOM ) ;
2020-01-20 00:21:05 +01:00
BDFDB . ReactUtils . childrenToArray = function ( parent ) {
if ( parent && parent . props && parent . props . children && ! BDFDB . ArrayUtils . is ( parent . props . children ) ) {
var child = parent . props . children ;
parent . props . children = [ ] ;
parent . props . children . push ( child ) ;
}
return parent . props . children ;
}
2019-11-04 23:05:31 +01:00
BDFDB . ReactUtils . createElement = function ( component , props ) {
if ( component && component . defaultProps ) for ( let key in component . defaultProps ) if ( props [ key ] == null ) props [ key ] = component . defaultProps [ key ] ;
try { return LibraryModules . React . createElement ( component || "div" , props || { } ) || null ; }
2020-02-08 11:33:48 +01:00
catch ( err ) { BDFDB . LogUtils . error ( "Could not create react element! " + err ) ; }
2019-11-04 23:05:31 +01:00
return null ;
} ;
BDFDB . ReactUtils . elementToReact = function ( node ) {
if ( BDFDB . ReactUtils . isValidElement ( node ) ) return node ;
else if ( ! Node . prototype . isPrototypeOf ( node ) ) return null ;
else if ( node . nodeType == Node . TEXT _NODE ) return node . nodeValue ;
2020-02-07 18:48:59 +01:00
let attributes = { } , importantStyles = [ ] ;
2019-11-04 23:05:31 +01:00
for ( let attr of node . attributes ) attributes [ attr . name ] = attr . value ;
if ( node . attributes . style ) attributes . style = BDFDB . ObjectUtils . filter ( node . style , n => node . style [ n ] && isNaN ( parseInt ( n ) ) , true ) ;
attributes . children = [ ] ;
if ( node . style && node . style . cssText ) for ( let propstr of node . style . cssText . split ( ";" ) ) if ( propstr . endsWith ( "!important" ) ) {
2020-02-07 18:38:44 +01:00
let key = propstr . split ( ":" ) [ 0 ] ;
let camelprop = key . replace ( /-([a-z]?)/g , ( m , g ) => g . toUpperCase ( ) ) ;
2020-02-07 18:48:59 +01:00
if ( attributes . style [ camelprop ] != null ) importantStyles . push ( key ) ;
2019-11-04 23:05:31 +01:00
}
for ( let child of node . childNodes ) attributes . children . push ( BDFDB . ReactUtils . elementToReact ( child ) ) ;
2020-02-07 18:38:44 +01:00
let reactEle = BDFDB . ReactUtils . createElement ( node . tagName , attributes ) ;
BDFDB . ReactUtils . forceStyle ( reactEle , importantStyles ) ;
return reactEle ;
} ;
BDFDB . ReactUtils . forceStyle = function ( reactEle , styles ) {
2020-02-07 18:48:59 +01:00
if ( ! BDFDB . ReactUtils . isValidElement ( reactEle ) || ! BDFDB . ObjectUtils . is ( reactEle . props . style ) || ! BDFDB . ArrayUtils . is ( styles ) || ! styles . length ) return ;
2020-02-07 18:38:44 +01:00
let ref = reactEle . ref ;
reactEle . ref = instance => {
if ( typeof ref == "function" ) ref ( instance ) ;
let node = BDFDB . ReactUtils . findDOMNode ( instance ) ;
2020-02-07 18:48:59 +01:00
if ( Node . prototype . isPrototypeOf ( node ) ) for ( let key of styles ) {
let propValue = reactEle . props . style [ key . replace ( /-([a-z]?)/g , ( m , g ) => g . toUpperCase ( ) ) ] ;
if ( propValue != null ) node . style . setProperty ( key , propValue , "important" ) ;
}
2020-02-07 18:38:44 +01:00
} ;
2019-11-04 23:05:31 +01:00
} ;
BDFDB . ReactUtils . findChildren = function ( nodeOrInstance , config ) {
2019-11-21 13:49:32 +01:00
if ( ! nodeOrInstance || ! BDFDB . ObjectUtils . is ( config ) || ! config . name && ! config . key && ! config . props && ! config . filter ) return [ null , - 1 ] ;
2019-11-04 23:05:31 +01:00
var instance = Node . prototype . isPrototypeOf ( nodeOrInstance ) ? BDFDB . ReactUtils . getInstance ( nodeOrInstance ) : nodeOrInstance ;
2019-11-05 10:01:25 +01:00
if ( ! BDFDB . ObjectUtils . is ( instance ) && ! BDFDB . ArrayUtils . is ( instance ) ) return [ null , - 1 ] ;
2019-11-22 22:11:37 +01:00
config . name = config . name && [ config . name ] . flat ( ) . filter ( n => n ) ;
config . key = config . key && [ config . key ] . flat ( ) . filter ( n => n ) ;
config . props = config . props && [ config . props ] . flat ( ) . filter ( n => n ) ;
2019-11-21 13:25:40 +01:00
config . filter = typeof config . filter == "function" && config . filter ;
2019-11-05 16:28:29 +01:00
var parent = firstarray = instance ;
while ( ! BDFDB . ArrayUtils . is ( firstarray ) && firstarray . props && firstarray . props . children ) firstarray = firstarray . props . children ;
2019-11-14 14:17:57 +01:00
if ( ! BDFDB . ArrayUtils . is ( firstarray ) ) {
if ( parent && parent . props ) {
parent . props . children = [ parent . props . children ] ;
firstarray = parent . props . children ;
}
else firstarray = [ ] ;
}
2019-11-05 16:28:29 +01:00
return getChildren ( instance ) ;
2019-11-04 23:05:31 +01:00
function getChildren ( children ) {
2019-11-05 16:28:29 +01:00
var result = [ firstarray , - 1 ] ;
2019-11-04 23:05:31 +01:00
if ( ! children ) return result ;
if ( ! BDFDB . ArrayUtils . is ( children ) ) {
if ( check ( children ) ) result = found ( children ) ;
else if ( children . props && children . props . children ) {
parent = children ;
result = getChildren ( children . props . children ) ;
}
2019-11-01 10:14:50 +01:00
}
2019-11-04 23:05:31 +01:00
else {
for ( let i = 0 ; result [ 1 ] == - 1 && i < children . length ; i ++ ) if ( children [ i ] ) {
if ( BDFDB . ArrayUtils . is ( children [ i ] ) ) {
2019-11-03 18:31:51 +01:00
parent = children ;
2019-11-04 23:05:31 +01:00
result = getChildren ( children [ i ] ) ;
2019-11-01 10:14:50 +01:00
}
2019-11-04 23:05:31 +01:00
else if ( check ( children [ i ] ) ) {
parent = children ;
result = found ( children [ i ] ) ;
}
else if ( children [ i ] . props && children [ i ] . props . children ) {
parent = children [ i ] ;
result = getChildren ( children [ i ] . props . children ) ;
2019-11-01 10:14:50 +01:00
}
2019-11-03 18:31:51 +01:00
}
2019-11-01 16:38:41 +01:00
}
2019-11-04 23:05:31 +01:00
return result ;
}
function found ( child ) {
if ( BDFDB . ArrayUtils . is ( parent ) ) return [ parent , parent . indexOf ( child ) ] ;
else {
parent . props . children = [ ] ;
parent . props . children . push ( child ) ;
return [ parent . props . children , 0 ] ;
2019-10-30 09:00:01 +01:00
}
2019-11-04 23:05:31 +01:00
}
function check ( instance ) {
if ( ! instance ) return false ;
let props = instance . stateNode ? instance . stateNode . props : instance . props ;
2020-01-30 23:28:43 +01:00
return instance . type && config . name && config . name . some ( name => InternalBDFDB . isInstanceCorrect ( instance , name ) ) || config . key && config . key . some ( key => instance . key == key ) || props && config . props && config . props . every ( prop => BDFDB . ArrayUtils . is ( prop ) ? ( BDFDB . ArrayUtils . is ( prop [ 1 ] ) ? prop [ 1 ] . some ( checkvalue => propCheck ( props , prop [ 0 ] , checkvalue ) ) : propCheck ( props , prop [ 0 ] , prop [ 1 ] ) ) : props [ prop ] !== undefined ) || config . filter && config . filter ( instance ) ;
2019-11-04 23:05:31 +01:00
}
function propCheck ( props , key , value ) {
2019-11-06 23:37:03 +01:00
return key != null && props [ key ] != null && value != null && ( key == "className" ? ( " " + props [ key ] + " " ) . indexOf ( " " + value + " " ) > - 1 : BDFDB . equals ( props [ key ] , value ) ) ;
2019-11-04 23:05:31 +01:00
}
} ;
2019-12-24 09:10:36 +01:00
BDFDB . ReactUtils . findConstructor = function ( nodeOrInstance , types , config = { } ) {
2019-12-01 14:20:33 +01:00
if ( ! BDFDB . ObjectUtils . is ( config ) ) return null ;
if ( ! nodeOrInstance || ! types ) return config . all ? ( config . group ? { } : [ ] ) : null ;
var instance = Node . prototype . isPrototypeOf ( nodeOrInstance ) ? BDFDB . ReactUtils . getInstance ( nodeOrInstance ) : nodeOrInstance ;
if ( ! BDFDB . ObjectUtils . is ( instance ) ) return config . all ? ( config . group ? { } : [ ] ) : null ;
2020-01-18 09:57:17 +01:00
types = types && [ types ] . flat ( 10 ) . filter ( n => typeof n == "string" ) ;
2019-12-01 14:20:33 +01:00
if ( ! types . length ) return config . all ? ( config . group ? { } : [ ] ) : null ; ;
var depth = - 1 ;
var start = performance . now ( ) ;
var maxdepth = config . unlimited ? 999999999 : ( config . depth === undefined ? 30 : config . depth ) ;
var maxtime = config . unlimited ? 999999999 : ( config . time === undefined ? 150 : config . time ) ;
2020-01-30 23:06:25 +01:00
var whitelist = config . up ? { return : true , sibling : true , default : true , _reactInternalFiber : true } : { child : true , sibling : true , default : true , _reactInternalFiber : true } ;
2019-12-01 14:20:33 +01:00
var foundconstructors = config . group ? { } : [ ] ;
var singleconstructor = getConstructor ( instance ) ;
if ( config . all ) {
for ( let i in foundconstructors ) {
if ( config . group ) for ( let j in foundconstructors [ i ] ) delete foundconstructors [ i ] [ j ] . BDFDBreactSearch ;
else delete foundconstructors [ i ] . BDFDBreactSearch ;
}
return foundconstructors ;
}
else return singleconstructor ;
function getConstructor ( instance ) {
depth ++ ;
var result = undefined ;
if ( instance && ! Node . prototype . isPrototypeOf ( instance ) && ! BDFDB . ReactUtils . getInstance ( instance ) && depth < maxdepth && performance . now ( ) - start < maxtime ) {
2019-12-21 02:11:03 +01:00
if ( instance . type && types . some ( name => ( instance . type . render && instance . type . render . displayName || instance . type . displayName || instance . type . name ) === name . split ( " _ _ " ) [ 0 ] ) ) {
2019-12-01 14:20:33 +01:00
if ( config . all === undefined || ! config . all ) result = instance . type ;
else if ( config . all ) {
if ( ! instance . type . BDFDBreactSearch ) {
instance . type . BDFDBreactSearch = true ;
if ( config . group ) {
2019-12-21 02:11:03 +01:00
if ( instance . type && ( instance . type . render && instance . type . render . displayName || instance . type . displayName || instance . type . name ) ) {
2020-01-10 11:22:38 +01:00
let group = config . name . find ( n => ( instance . type . render && instance . type . render . displayName || instance . type . displayName || instance . type . name || instance . type ) . split ( " _ _ " ) [ 0 ] == n ) || "Default" ;
if ( ! BDFDB . ArrayUtils . is ( foundinstances [ group ] ) ) foundinstances [ group ] = [ ] ;
foundinstances [ group ] . push ( instance . stateNode ) ;
2019-12-01 14:20:33 +01:00
}
}
else foundinstances . push ( instance . type ) ;
}
}
}
if ( result === undefined ) {
let keys = Object . getOwnPropertyNames ( instance ) ;
for ( let i = 0 ; result === undefined && i < keys . length ; i ++ ) {
let key = keys [ i ] ;
if ( key && whitelist [ key ] && ( typeof instance [ key ] === "object" || typeof instance [ key ] === "function" ) ) result = getConstructor ( instance [ key ] ) ;
}
}
}
depth -- ;
return result ;
}
} ;
2020-01-20 00:21:05 +01:00
BDFDB . ReactUtils . findDOMNode = function ( instance ) {
if ( Node . prototype . isPrototypeOf ( instance ) ) return instance ;
if ( ! instance || ! instance . updater || typeof instance . updater . isMounted !== "function" || ! instance . updater . isMounted ( instance ) ) return null ;
var node = LibraryModules . ReactDOM . findDOMNode ( instance ) || BDFDB . ReactUtils . getValue ( instance , "child.stateNode" ) ;
return Node . prototype . isPrototypeOf ( node ) ? node : null ;
} ;
2019-11-04 23:05:31 +01:00
BDFDB . ReactUtils . findOwner = function ( nodeOrInstance , config ) {
if ( ! BDFDB . ObjectUtils . is ( config ) ) return null ;
if ( ! nodeOrInstance || ! config . name && ! config . key && ! config . props ) return config . all ? ( config . group ? { } : [ ] ) : null ;
var instance = Node . prototype . isPrototypeOf ( nodeOrInstance ) ? BDFDB . ReactUtils . getInstance ( nodeOrInstance ) : nodeOrInstance ;
if ( ! BDFDB . ObjectUtils . is ( instance ) ) return config . all ? ( config . group ? { } : [ ] ) : null ;
2019-11-22 22:11:37 +01:00
config . name = config . name && [ config . name ] . flat ( ) . filter ( n => n ) ;
config . key = config . key && [ config . key ] . flat ( ) . filter ( n => n ) ;
config . props = config . props && [ config . props ] . flat ( ) . filter ( n => n ) ;
2019-11-04 23:05:31 +01:00
var depth = - 1 ;
var start = performance . now ( ) ;
var maxdepth = config . unlimited ? 999999999 : ( config . depth === undefined ? 30 : config . depth ) ;
var maxtime = config . unlimited ? 999999999 : ( config . time === undefined ? 150 : config . time ) ;
var whitelist = config . up ? { return : true , sibling : true , _reactInternalFiber : true } : { child : true , sibling : true , _reactInternalFiber : true } ;
var foundinstances = config . group ? { } : [ ] ;
var singleinstance = getOwner ( instance ) ;
if ( config . all ) {
for ( let i in foundinstances ) {
if ( config . group ) for ( let j in foundinstances [ i ] ) delete foundinstances [ i ] [ j ] . BDFDBreactSearch ;
else delete foundinstances [ i ] . BDFDBreactSearch ;
2019-11-01 10:14:50 +01:00
}
2019-11-04 23:05:31 +01:00
return foundinstances ;
}
else return singleinstance ;
2019-11-01 10:14:50 +01:00
2019-11-04 23:05:31 +01:00
function getOwner ( instance ) {
depth ++ ;
var result = undefined ;
if ( instance && ! Node . prototype . isPrototypeOf ( instance ) && ! BDFDB . ReactUtils . getInstance ( instance ) && depth < maxdepth && performance . now ( ) - start < maxtime ) {
let props = instance . stateNode ? instance . stateNode . props : instance . props ;
2020-01-30 23:28:43 +01:00
if ( instance . stateNode && ! Node . prototype . isPrototypeOf ( instance . stateNode ) && ( instance . type && config . name && config . name . some ( name => InternalBDFDB . isInstanceCorrect ( instance , name . split ( " _ _ " ) [ 0 ] ) ) || config . key && config . key . some ( key => instance . key == key ) || props && config . props && config . props . every ( prop => BDFDB . ArrayUtils . is ( prop ) ? ( BDFDB . ArrayUtils . is ( prop [ 1 ] ) ? prop [ 1 ] . some ( checkvalue => BDFDB . equals ( props [ prop [ 0 ] ] , checkvalue ) ) : BDFDB . equals ( props [ prop [ 0 ] ] , prop [ 1 ] ) ) : props [ prop ] !== undefined ) ) ) {
2019-11-04 23:05:31 +01:00
if ( config . all === undefined || ! config . all ) result = instance . stateNode ;
else if ( config . all ) {
2019-11-22 14:26:12 +01:00
if ( ! instance . stateNode . BDFDBreactSearch ) {
2019-11-04 23:05:31 +01:00
instance . stateNode . BDFDBreactSearch = true ;
if ( config . group ) {
2019-12-21 02:11:03 +01:00
if ( config . name && instance . type && ( instance . type . render && instance . type . render . displayName || instance . type . displayName || instance . type . name || instance . type ) ) {
2020-01-10 11:22:38 +01:00
let group = config . name . find ( n => ( instance . type . render && instance . type . render . displayName || instance . type . displayName || instance . type . name || instance . type ) . split ( " _ _ " ) [ 0 ] == n ) || "Default" ;
if ( ! BDFDB . ArrayUtils . is ( foundinstances [ group ] ) ) foundinstances [ group ] = [ ] ;
2019-11-04 23:05:31 +01:00
foundinstances [ group ] . push ( instance . stateNode ) ;
2019-11-01 10:14:50 +01:00
}
}
2019-11-04 23:05:31 +01:00
else foundinstances . push ( instance . stateNode ) ;
2019-10-18 10:56:41 +02:00
}
}
}
2019-11-04 23:05:31 +01:00
if ( result === undefined ) {
2019-11-01 10:14:50 +01:00
let keys = Object . getOwnPropertyNames ( instance ) ;
for ( let i = 0 ; result === undefined && i < keys . length ; i ++ ) {
let key = keys [ i ] ;
2019-11-04 23:05:31 +01:00
if ( key && whitelist [ key ] && ( typeof instance [ key ] === "object" || typeof instance [ key ] === "function" ) ) result = getOwner ( instance [ key ] ) ;
}
}
}
depth -- ;
return result ;
}
} ;
2019-11-05 11:25:17 +01:00
BDFDB . ReactUtils . findProps = function ( nodeOrInstance , config ) {
if ( ! BDFDB . ObjectUtils . is ( config ) ) return null ;
if ( ! nodeOrInstance || ! config . name && ! config . key ) return null ;
var instance = Node . prototype . isPrototypeOf ( nodeOrInstance ) ? BDFDB . ReactUtils . getInstance ( nodeOrInstance ) : nodeOrInstance ;
if ( ! BDFDB . ObjectUtils . is ( instance ) ) return null ;
2019-11-22 22:11:37 +01:00
config . name = config . name && [ config . name ] . flat ( ) . filter ( n => n ) ;
config . key = config . key && [ config . key ] . flat ( ) . filter ( n => n ) ;
2019-11-05 11:25:17 +01:00
var depth = - 1 ;
var start = performance . now ( ) ;
var maxdepth = config . unlimited ? 999999999 : ( config . depth === undefined ? 30 : config . depth ) ;
var maxtime = config . unlimited ? 999999999 : ( config . time === undefined ? 150 : config . time ) ;
var whitelist = config . up ? { return : true , sibling : true , _reactInternalFiber : true } : { child : true , sibling : true , _reactInternalFiber : true } ;
return findProps ( instance ) ;
function findProps ( instance ) {
depth ++ ;
var result = undefined ;
if ( instance && ! Node . prototype . isPrototypeOf ( instance ) && ! BDFDB . ReactUtils . getInstance ( instance ) && depth < maxdepth && performance . now ( ) - start < maxtime ) {
2019-12-21 02:11:03 +01:00
if ( instance . memoizedProps && ( instance . type && config . name && config . name . some ( name => ( instance . type . render && instance . type . render . displayName || instance . type . displayName || instance . type . name || instance . type ) === name . split ( " _ _ " ) [ 0 ] ) || config . key && config . key . some ( key => instance . key == key ) ) ) result = instance . memoizedProps ;
2019-11-05 11:25:17 +01:00
if ( result === undefined ) {
let keys = Object . getOwnPropertyNames ( instance ) ;
for ( let i = 0 ; result === undefined && i < keys . length ; i ++ ) {
let key = keys [ i ] ;
2019-11-05 11:30:00 +01:00
if ( key && whitelist [ key ] && ( typeof instance [ key ] === "object" || typeof instance [ key ] === "function" ) ) result = findProps ( instance [ key ] ) ;
2019-11-05 11:25:17 +01:00
}
}
}
depth -- ;
return result ;
}
} ;
2019-11-05 15:32:46 +01:00
BDFDB . ReactUtils . findValue = function ( nodeOrInstance , searchkey , config = { } ) {
2019-11-04 23:05:31 +01:00
if ( ! BDFDB . ObjectUtils . is ( config ) ) return null ;
if ( ! nodeOrInstance || typeof searchkey != "string" ) return config . all ? [ ] : null ;
var instance = Node . prototype . isPrototypeOf ( nodeOrInstance ) ? BDFDB . ReactUtils . getInstance ( nodeOrInstance ) : nodeOrInstance ;
if ( ! BDFDB . ObjectUtils . is ( instance ) ) return config . all ? [ ] : null ;
instance = instance . _reactInternalFiber || instance ;
var depth = - 1 ;
var start = performance . now ( ) ;
var maxdepth = config . unlimited ? 999999999 : ( config . depth === undefined ? 30 : config . depth ) ;
var maxtime = config . unlimited ? 999999999 : ( config . time === undefined ? 150 : config . time ) ;
var whitelist = {
props : true ,
state : true ,
stateNode : true ,
updater : true ,
prototype : true ,
type : true ,
children : config . up ? false : true ,
memoizedProps : true ,
memoizedState : true ,
child : config . up ? false : true ,
return : config . up ? true : false ,
2019-11-11 21:04:43 +01:00
sibling : config . up ? false : true
2019-11-04 23:05:31 +01:00
} ;
var blacklist = {
contextSection : true
} ;
if ( BDFDB . ObjectUtils . is ( config . whitelist ) ) Object . assign ( whitelist , config . whiteList ) ;
if ( BDFDB . ObjectUtils . is ( config . blacklist ) ) Object . assign ( blacklist , config . blacklist ) ;
var foundkeys = [ ] ;
var singlekey = getKey ( instance ) ;
if ( config . all ) return foundkeys ;
else return singlekey ;
function getKey ( instance ) {
depth ++ ;
var result = undefined ;
if ( instance && ! Node . prototype . isPrototypeOf ( instance ) && ! BDFDB . ReactUtils . getInstance ( instance ) && depth < maxdepth && performance . now ( ) - start < maxtime ) {
let keys = Object . getOwnPropertyNames ( instance ) ;
for ( let i = 0 ; result === undefined && i < keys . length ; i ++ ) {
let key = keys [ i ] ;
if ( key && ! blacklist [ key ] ) {
var value = instance [ key ] ;
if ( searchkey === key && ( config . value === undefined || BDFDB . equals ( config . value , value ) ) ) {
if ( config . all === undefined || ! config . all ) result = value ;
else if ( config . all ) {
if ( config . noCopies === undefined || ! config . noCopies ) foundkeys . push ( value ) ;
else if ( config . noCopies ) {
var copy = false ;
for ( let foundkey of foundkeys ) if ( BDFDB . equals ( value , foundkey ) ) {
copy = true ;
break ;
2019-11-01 10:14:50 +01:00
}
2019-11-04 23:05:31 +01:00
if ( ! copy ) foundkeys . push ( value ) ;
2019-11-01 10:14:50 +01:00
}
}
2019-10-18 10:56:41 +02:00
}
2019-11-04 23:05:31 +01:00
else if ( ( typeof value === "object" || typeof value === "function" ) && ( whitelist [ key ] || key [ 0 ] == "." || ! isNaN ( key [ 0 ] ) ) ) result = getKey ( value ) ;
2019-10-18 10:56:41 +02:00
}
}
2019-11-01 10:14:50 +01:00
}
2019-11-04 23:05:31 +01:00
depth -- ;
return result ;
}
} ;
BDFDB . ReactUtils . forceUpdate = function ( ... instances ) {
2020-01-10 18:35:39 +01:00
for ( let ins of instances . flat ( 10 ) . filter ( n => n ) ) if ( ins . updater && typeof ins . updater . isMounted == "function" && ins . updater . isMounted ( ins ) ) ins . forceUpdate ( ) ;
2019-11-04 23:05:31 +01:00
} ;
BDFDB . ReactUtils . getInstance = function ( node ) {
if ( ! BDFDB . ObjectUtils . is ( node ) ) return null ;
return node [ Object . keys ( node ) . find ( key => key . startsWith ( "__reactInternalInstance" ) ) ] ;
} ;
BDFDB . ReactUtils . getValue = function ( nodeOrInstance , valuepath ) {
if ( ! nodeOrInstance || ! valuepath ) return null ;
var instance = Node . prototype . isPrototypeOf ( nodeOrInstance ) ? BDFDB . ReactUtils . getInstance ( nodeOrInstance ) : nodeOrInstance ;
if ( ! BDFDB . ObjectUtils . is ( instance ) ) return null ;
var found = instance , values = valuepath . split ( "." ) . filter ( n => n ) ;
for ( value of values ) {
if ( ! found ) return null ;
found = found [ value ] ;
}
return found ;
} ;
2020-01-20 00:21:05 +01:00
BDFDB . ReactUtils . render = function ( component , node ) {
if ( ! BDFDB . ReactUtils . isValidElement ( component ) || ! Node . prototype . isPrototypeOf ( node ) ) return ;
try {
LibraryModules . ReactDOM . render ( component , node ) ;
let observer = new MutationObserver ( changes => changes . forEach ( change => {
let nodes = Array . from ( change . removedNodes ) ;
if ( nodes . indexOf ( node ) > - 1 || nodes . some ( n => n . contains ( node ) ) ) {
observer . disconnect ( ) ;
BDFDB . ReactUtils . unmountComponentAtNode ( node ) ;
}
} ) ) ;
observer . observe ( document . body , { subtree : true , childList : true } ) ;
}
2020-02-08 11:33:48 +01:00
catch ( err ) { BDFDB . LogUtils . error ( "Could not render react element! " + err ) ; }
2020-01-20 00:21:05 +01:00
} ;
2019-11-04 23:05:31 +01:00
InternalBDFDB . setDefaultProps = function ( component , defaultProps ) {
if ( BDFDB . ObjectUtils . is ( component ) ) component . defaultProps = Object . assign ( { } , component . defaultProps , defaultProps ) ;
2019-10-18 10:56:41 +02:00
} ;
BDFDB . equals = function ( mainA , mainB , sorted ) {
var i = - 1 ;
if ( sorted === undefined || typeof sorted !== "boolean" ) sorted = false ;
return equal ( mainA , mainB ) ;
function equal ( a , b ) {
i ++ ;
var result = true ;
if ( i > 1000 ) result = null ;
else {
if ( typeof a !== typeof b ) result = false ;
2020-02-05 11:29:52 +01:00
else if ( typeof a === "function" ) result = a . toString ( ) == b . toString ( ) ;
2019-10-18 10:56:41 +02:00
else if ( typeof a === "undefined" ) result = true ;
else if ( typeof a === "symbol" ) result = true ;
else if ( typeof a === "boolean" ) result = a == b ;
else if ( typeof a === "string" ) result = a == b ;
else if ( typeof a === "number" ) {
if ( isNaN ( a ) || isNaN ( b ) ) result = isNaN ( a ) == isNaN ( b ) ;
else result = a == b ;
}
else if ( ! a && ! b ) result = true ;
else if ( ! a || ! b ) result = false ;
2020-02-05 11:27:35 +01:00
else if ( typeof a === "object" ) {
2019-10-18 10:56:41 +02:00
var keysA = Object . getOwnPropertyNames ( a ) ;
var keysB = Object . getOwnPropertyNames ( b ) ;
if ( keysA . length !== keysB . length ) result = false ;
else for ( let j = 0 ; result === true && j < keysA . length ; j ++ ) {
if ( sorted ) result = equal ( a [ keysA [ j ] ] , b [ keysB [ j ] ] ) ;
else result = equal ( a [ keysA [ j ] ] , b [ keysA [ j ] ] ) ;
}
}
}
i -- ;
return result ;
}
} ;
2020-02-07 19:20:01 +01:00
let MessageRerenderTimeout ;
2020-01-31 20:29:02 +01:00
BDFDB . MessageUtils = { } ;
BDFDB . MessageUtils . rerenderAll = function ( ) {
2020-02-07 19:20:01 +01:00
BDFDB . TimeUtils . clear ( MessageRerenderTimeout ) ;
MessageRerenderTimeout = BDFDB . TimeUtils . timeout ( _ => {
let MessagesIns = BDFDB . ReactUtils . findOwner ( document . querySelector ( BDFDB . dotCN . app ) , { name : "Messages" , unlimited : true } ) ;
let MessagesPrototype = BDFDB . ReactUtils . getValue ( MessagesIns , "_reactInternalFiber.type.prototype" ) ;
if ( MessagesIns && MessagesPrototype ) {
2020-02-09 14:43:20 +01:00
let patchCancel = BDFDB . ModuleUtils . patch ( { name : "tempPatch" } , MessagesPrototype , "render" , { after : e => {
2020-02-07 19:20:01 +01:00
patchCancel ( ) ;
let [ children , index ] = BDFDB . ReactUtils . findChildren ( e . returnValue , { props : [ "message" , "channel" ] } ) ;
2020-02-09 14:43:20 +01:00
if ( index > - 1 ) for ( let ele of children ) if ( ele . props . message ) ele . props . message = new BDFDB . DiscordObjects . Message ( ele . props . message ) ;
2020-02-07 19:20:01 +01:00
} } ) ;
BDFDB . ReactUtils . forceUpdate ( MessagesIns ) ;
}
2020-02-09 14:43:20 +01:00
} , 1000 ) ;
2020-01-31 20:29:02 +01:00
} ;
2019-10-22 14:20:12 +02:00
BDFDB . UserUtils = { } ;
var myDataUser = LibraryModules . CurrentUserStore ? LibraryModules . CurrentUserStore . getCurrentUser ( ) : null ;
2020-01-07 16:39:00 +01:00
BDFDB . UserUtils . is = function ( user ) {
return user && user instanceof BDFDB . DiscordObjects . User ;
} ;
2019-10-22 14:20:12 +02:00
BDFDB . UserUtils . me = new Proxy ( myDataUser || { } , {
get : function ( list , item ) {
if ( ! myDataUser ) myDataUser = LibraryModules . CurrentUserStore . getCurrentUser ( ) ;
return myDataUser ? myDataUser [ item ] : null ;
}
} ) ;
BDFDB . UserUtils . getStatus = function ( id = BDFDB . UserUtils . me . id ) {
2019-10-18 10:56:41 +02:00
id = typeof id == "number" ? id . toFixed ( ) : id ;
2019-11-01 11:32:38 +01:00
let activity = BDFDB . UserUtils . getActivitiy ( id ) ;
return activity && activity . type == BDFDB . DiscordConstants . ActivityTypes . STREAMING ? "streaming" : LibraryModules . StatusMetaUtils . getStatus ( id ) ;
2019-10-18 10:56:41 +02:00
} ;
2019-10-22 14:20:12 +02:00
BDFDB . UserUtils . getStatusColor = function ( status ) {
2019-10-18 10:56:41 +02:00
status = typeof status == "string" ? status . toLowerCase ( ) : null ;
switch ( status ) {
2019-10-22 14:20:12 +02:00
case "online" : return BDFDB . DiscordConstants . Colors . STATUS _GREEN ;
case "mobile" : return BDFDB . DiscordConstants . Colors . STATUS _GREEN ;
case "idle" : return BDFDB . DiscordConstants . Colors . STATUS _YELLOW ;
case "dnd" : return BDFDB . DiscordConstants . Colors . STATUS _RED ;
case "playing" : return BDFDB . DiscordConstants . Colors . BRAND ;
case "listening" : return BDFDB . DiscordConstants . Colors . SPOTIFY ;
case "streaming" : return BDFDB . DiscordConstants . Colors . TWITCH ;
default : return BDFDB . DiscordConstants . Colors . STATUS _GREY ;
2019-10-18 10:56:41 +02:00
}
} ;
2019-11-01 11:32:38 +01:00
BDFDB . UserUtils . getActivitiy = function ( id = BDFDB . UserUtils . me . id ) {
for ( let activity of LibraryModules . StatusMetaUtils . getActivities ( id ) ) if ( activity . type != BDFDB . DiscordConstants . ActivityTypes . CUSTOM _STATUS ) return activity ;
return null ;
} ;
2019-10-22 14:20:12 +02:00
BDFDB . UserUtils . getAvatar = function ( id = BDFDB . UserUtils . me . id ) {
2019-10-18 10:56:41 +02:00
var user = LibraryModules . UserStore . getUser ( typeof id == "number" ? id . toFixed ( ) : id ) ;
2019-11-30 20:58:25 +01:00
if ( ! user ) return window . location . origin + "/assets/322c936a8c8be1b803cd94861bdfa868.png" ;
else return ( ( user . avatar ? "" : window . location . origin ) + LibraryModules . IconUtils . getUserAvatarURL ( user ) ) . split ( "?" ) [ 0 ] ;
2019-10-18 10:56:41 +02:00
} ;
2019-10-22 14:20:12 +02:00
BDFDB . UserUtils . can = function ( permission , id = BDFDB . UserUtils . me . id , channelid = LibraryModules . LastChannelStore . getChannelId ( ) ) {
2019-11-03 16:53:33 +01:00
if ( ! BDFDB . DiscordConstants . Permissions [ permission ] ) BDFDB . LogUtils . warn ( permission + " not found in Permissions" ) ;
2019-10-18 10:56:41 +02:00
else {
var channel = LibraryModules . ChannelStore . getChannel ( channelid ) ;
if ( channel ) return LibraryModules . PermissionUtils . canUser ( id , BDFDB . DiscordConstants . Permissions [ permission ] , channel ) ;
}
return false ;
} ;
2019-10-22 14:20:12 +02:00
BDFDB . GuildUtils = { } ;
2020-01-07 16:39:00 +01:00
BDFDB . GuildUtils . is = function ( guild ) {
return guild && guild instanceof BDFDB . DiscordObjects . Guild ;
} ;
2019-10-22 14:20:12 +02:00
BDFDB . GuildUtils . getIcon = function ( id ) {
var guild = LibraryModules . GuildStore . getGuild ( typeof id == "number" ? id . toFixed ( ) : id ) ;
if ( ! guild || ! guild . icon ) return null ;
return LibraryModules . IconUtils . getGuildIconURL ( guild ) . split ( "?" ) [ 0 ] ;
2019-10-18 10:56:41 +02:00
} ;
2019-10-22 14:20:12 +02:00
BDFDB . GuildUtils . getBanner = function ( id ) {
var guild = LibraryModules . GuildStore . getGuild ( typeof id == "number" ? id . toFixed ( ) : id ) ;
if ( ! guild || ! guild . banner ) return null ;
return LibraryModules . IconUtils . getGuildBannerURL ( guild ) . split ( "?" ) [ 0 ] ;
2019-10-18 10:56:41 +02:00
} ;
2019-11-24 22:48:57 +01:00
BDFDB . GuildUtils . getFolder = function ( id ) {
2019-11-25 09:53:30 +01:00
return BDFDB . LibraryModules . FolderStore . guildFolders . filter ( n => n . folderId ) . find ( n => n . guildIds . includes ( id ) ) ;
2019-11-24 22:48:57 +01:00
} ;
2019-10-22 14:20:12 +02:00
BDFDB . GuildUtils . getId = function ( div ) {
if ( ! Node . prototype . isPrototypeOf ( div ) || ! BDFDB . ReactUtils . getInstance ( div ) ) return ;
2019-10-23 11:10:01 +02:00
let guilddiv = BDFDB . DOMUtils . getParent ( BDFDB . dotCN . guildouter , div ) ;
2019-10-22 14:20:12 +02:00
if ( ! guilddiv ) return ;
var iconwrap = guilddiv . querySelector ( BDFDB . dotCN . guildiconwrapper ) ;
var id = iconwrap && iconwrap . href ? iconwrap . href . split ( "/" ) . slice ( - 2 ) [ 0 ] : null ;
return id && ! isNaN ( parseInt ( id ) ) ? id . toString ( ) : null ;
} ;
BDFDB . GuildUtils . getData = function ( eleOrInfoOrId ) {
if ( ! eleOrInfoOrId ) return null ;
2019-11-13 11:14:54 +01:00
let id = Node . prototype . isPrototypeOf ( eleOrInfoOrId ) ? BDFDB . GuildUtils . getId ( eleOrInfoOrId ) : ( typeof eleOrInfoOrId == "object" ? eleOrInfoOrId . id : eleOrInfoOrId ) ;
2019-10-22 14:20:12 +02:00
id = typeof id == "number" ? id . toFixed ( ) : id ;
for ( let info of BDFDB . GuildUtils . getAll ( ) ) if ( info && info . id == id ) return info ;
return null ;
} ;
BDFDB . GuildUtils . getAll = function ( ) {
2019-11-04 12:59:47 +01:00
var found = [ ] , objs = [ ] ;
2019-11-22 14:26:12 +01:00
for ( let ins of BDFDB . ReactUtils . findOwner ( document . querySelector ( BDFDB . dotCN . guilds ) , { name : [ "Guild" , "GuildIcon" ] , all : true , unlimited : true } ) ) {
2019-12-05 12:50:47 +01:00
if ( ins . props && ins . props . guild ) objs . push ( Object . assign ( new ins . props . guild . constructor ( ins . props . guild ) , { div : ins . handleContextMenu && BDFDB . ReactUtils . findDOMNode ( ins ) , instance : ins } ) ) ;
2019-11-04 12:59:47 +01:00
}
for ( let id of BDFDB . LibraryModules . FolderStore . getFlattenedGuildIds ( ) ) {
let foundobj = null ;
for ( let obj of objs ) if ( obj . id == id ) {
foundobj = obj
break ;
}
if ( foundobj ) found . push ( foundobj ) ;
else {
let guild = BDFDB . LibraryModules . GuildStore . getGuild ( id ) ;
2019-12-05 12:50:47 +01:00
found . push ( Object . assign ( new guild . constructor ( guild ) , { div : null , instance : null } ) )
2019-11-04 12:59:47 +01:00
}
2019-11-02 10:06:49 +01:00
}
2019-10-18 10:56:41 +02:00
return found ;
} ;
2019-10-22 14:20:12 +02:00
BDFDB . GuildUtils . getUnread = function ( servers ) {
2019-10-18 10:56:41 +02:00
var found = [ ] ;
2019-10-22 14:20:12 +02:00
for ( let eleOrInfoOrId of servers === undefined || ! BDFDB . ArrayUtils . is ( servers ) ? BDFDB . GuildUtils . getAll ( ) : servers ) {
2019-10-18 10:56:41 +02:00
if ( ! eleOrInfoOrId ) return null ;
2019-11-13 11:14:54 +01:00
let id = Node . prototype . isPrototypeOf ( eleOrInfoOrId ) ? BDFDB . GuildUtils . getId ( eleOrInfoOrId ) : ( typeof eleOrInfoOrId == "object" ? eleOrInfoOrId . id : eleOrInfoOrId ) ;
2019-10-18 10:56:41 +02:00
id = typeof id == "number" ? id . toFixed ( ) : id ;
2019-11-21 12:07:37 +01:00
if ( id && ( LibraryModules . UnreadGuildUtils . hasUnread ( id ) || LibraryModules . UnreadGuildUtils . getMentionCount ( id ) > 0 ) ) found . push ( eleOrInfoOrId ) ;
2019-10-18 10:56:41 +02:00
}
return found ;
} ;
2019-10-22 14:20:12 +02:00
BDFDB . GuildUtils . getPinged = function ( servers ) {
2019-10-21 12:11:46 +02:00
var found = [ ] ;
2019-10-22 14:20:12 +02:00
for ( let eleOrInfoOrId of servers === undefined || ! BDFDB . ArrayUtils . is ( servers ) ? BDFDB . GuildUtils . getAll ( ) : servers ) {
2019-10-21 12:11:46 +02:00
if ( ! eleOrInfoOrId ) return null ;
2019-11-13 11:14:54 +01:00
let id = Node . prototype . isPrototypeOf ( eleOrInfoOrId ) ? BDFDB . GuildUtils . getId ( eleOrInfoOrId ) : ( typeof eleOrInfoOrId == "object" ? eleOrInfoOrId . id : eleOrInfoOrId ) ;
2019-10-21 12:11:46 +02:00
id = typeof id == "number" ? id . toFixed ( ) : id ;
2019-11-21 12:07:37 +01:00
if ( id && LibraryModules . UnreadGuildUtils . getMentionCount ( id ) > 0 ) found . push ( eleOrInfoOrId ) ;
2019-10-21 12:11:46 +02:00
}
return found ;
} ;
2019-10-22 14:20:12 +02:00
BDFDB . GuildUtils . getMuted = function ( servers ) {
2019-10-18 10:56:41 +02:00
var found = [ ] ;
2019-10-22 14:20:12 +02:00
for ( let eleOrInfoOrId of servers === undefined || ! BDFDB . ArrayUtils . is ( servers ) ? BDFDB . GuildUtils . getAll ( ) : servers ) {
2019-10-18 10:56:41 +02:00
if ( ! eleOrInfoOrId ) return null ;
2019-11-13 11:14:54 +01:00
let id = Node . prototype . isPrototypeOf ( eleOrInfoOrId ) ? BDFDB . GuildUtils . getId ( eleOrInfoOrId ) : ( typeof eleOrInfoOrId == "object" ? eleOrInfoOrId . id : eleOrInfoOrId ) ;
2019-10-18 10:56:41 +02:00
id = typeof id == "number" ? id . toFixed ( ) : id ;
if ( id && LibraryModules . MutedUtils . isGuildOrCategoryOrChannelMuted ( id ) ) found . push ( eleOrInfoOrId ) ;
}
return found ;
} ;
2019-10-22 14:20:12 +02:00
BDFDB . GuildUtils . getSelected = function ( ) {
2019-10-18 10:56:41 +02:00
var info = LibraryModules . GuildStore . getGuild ( LibraryModules . LastGuildStore . getGuildId ( ) ) ;
2019-10-22 14:20:12 +02:00
if ( info ) return BDFDB . GuildUtils . getData ( info . id ) || Object . assign ( new info . constructor ( info ) , { div : null , instance : null } ) ;
2019-10-18 10:56:41 +02:00
else return null ;
} ;
2019-12-02 13:23:02 +01:00
BDFDB . GuildUtils . openMenu = function ( eleOrInfoOrId , e = BDFDB . InternalData . mousePosition ) {
2019-11-04 22:44:58 +01:00
if ( ! eleOrInfoOrId ) return ;
2019-11-13 11:14:54 +01:00
let id = Node . prototype . isPrototypeOf ( eleOrInfoOrId ) ? BDFDB . GuildUtils . getId ( eleOrInfoOrId ) : ( typeof eleOrInfoOrId == "object" ? eleOrInfoOrId . id : eleOrInfoOrId ) ;
2019-10-18 10:56:41 +02:00
let guild = LibraryModules . GuildStore . getGuild ( id ) ;
if ( guild ) LibraryModules . ContextMenuUtils . openContextMenu ( e , function ( e ) {
2020-02-08 11:14:10 +01:00
return BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . ContextMenus . _Exports . GuildContextMenu && InternalComponents . LibraryComponents . ContextMenus . _Exports . GuildContextMenu . default , Object . assign ( { } , e , {
2019-10-18 10:56:41 +02:00
type : BDFDB . DiscordConstants . ContextMenuTypes . GUILD _ICON _BAR ,
guild : guild ,
2019-11-21 12:07:37 +01:00
badge : LibraryModules . UnreadGuildUtils . getMentionCount ( guild . id ) ,
2019-10-18 10:56:41 +02:00
link : BDFDB . DiscordConstants . Routes . CHANNEL ( guild . id , LibraryModules . LastChannelStore . getChannelId ( guild . id ) ) ,
selected : guild . id == LibraryModules . LastGuildStore . getGuildId ( )
} ) ) ;
} ) ;
} ;
2019-10-22 14:20:12 +02:00
BDFDB . GuildUtils . markAsRead = function ( guilds ) {
if ( ! guilds ) return ;
var unreadchannels = [ ] ;
for ( let guild of BDFDB . ArrayUtils . is ( guilds ) ? guilds : ( typeof guilds == "string" || typeof guilds == "number" ? Array . of ( guilds ) : Array . from ( guilds ) ) ) {
2019-11-13 11:14:54 +01:00
let id = Node . prototype . isPrototypeOf ( guild ) ? BDFDB . GuildUtils . getId ( guild ) : ( guild && typeof guild == "object" ? guild . id : guild ) ;
let channels = id && LibraryModules . GuildChannelStore . getChannels ( id ) ;
2019-10-22 14:20:12 +02:00
if ( channels ) for ( let type in channels ) if ( BDFDB . ArrayUtils . is ( channels [ type ] ) ) for ( let channelobj of channels [ type ] ) unreadchannels . push ( channelobj . channel . id ) ;
2019-10-18 10:56:41 +02:00
}
2019-10-22 14:20:12 +02:00
if ( unreadchannels . length ) LibraryModules . AckUtils . bulkAck ( unreadchannels ) ;
2019-10-18 10:56:41 +02:00
} ;
2019-10-22 14:20:12 +02:00
BDFDB . FolderUtils = { } ;
BDFDB . FolderUtils . getId = function ( div ) {
2019-10-20 20:57:23 +02:00
if ( ! Node . prototype . isPrototypeOf ( div ) || ! BDFDB . ReactUtils . getInstance ( div ) ) return ;
2019-10-23 11:10:01 +02:00
div = BDFDB . DOMUtils . getParent ( BDFDB . dotCN . guildfolderwrapper , div ) ;
2019-10-18 10:56:41 +02:00
if ( ! div ) return ;
2019-10-22 14:20:12 +02:00
return BDFDB . ReactUtils . findValue ( div , "folderId" , { up : true } ) ;
2019-10-18 10:56:41 +02:00
} ;
2019-11-25 22:49:02 +01:00
BDFDB . FolderUtils . getDefaultName = function ( folderId ) {
let folder = BDFDB . LibraryModules . FolderStore . getGuildFolderById ( folderId ) ;
if ( ! folder ) return "" ;
let rest = 2 * BDFDB . DiscordConstants . MAX _GUILD _FOLDER _NAME _LENGTH ;
let names = [ ] , allNames = folder . guildIds . map ( guildId => ( BDFDB . LibraryModules . GuildStore . getGuild ( guildId ) || { } ) . name ) . filter ( n => n ) ;
for ( let name of allNames ) if ( name . length < rest || names . length === 0 ) {
names . push ( name ) ;
rest -= name . length ;
}
return names . join ( ", " ) + ( names . length < allNames . length ? ", ..." : "" ) ;
} ;
2019-10-22 14:20:12 +02:00
BDFDB . FolderUtils . getDiv = function ( eleOrInfoOrId ) {
2019-10-18 10:56:41 +02:00
if ( ! eleOrInfoOrId ) return null ;
2019-10-22 18:55:25 +02:00
let info = BDFDB . FolderUtils . getData ( eleOrInfoOrId ) ;
2019-10-18 10:56:41 +02:00
return info ? info . div : null ;
} ;
2019-10-22 14:20:12 +02:00
BDFDB . FolderUtils . getData = function ( eleOrInfoOrId ) {
2019-10-18 10:56:41 +02:00
if ( ! eleOrInfoOrId ) return null ;
2019-11-13 11:14:54 +01:00
let id = Node . prototype . isPrototypeOf ( eleOrInfoOrId ) ? BDFDB . FolderUtils . getId ( eleOrInfoOrId ) : ( typeof eleOrInfoOrId == "object" ? eleOrInfoOrId . id : eleOrInfoOrId ) ;
2019-10-18 10:56:41 +02:00
id = typeof id == "number" ? id . toFixed ( ) : id ;
2019-10-22 14:20:12 +02:00
for ( let info of BDFDB . FolderUtils . getAll ( ) ) if ( info && info . folderId == id ) return info ;
2019-10-18 10:56:41 +02:00
return null ;
} ;
2019-10-22 14:20:12 +02:00
BDFDB . FolderUtils . getAll = function ( ) {
2019-11-02 10:06:49 +01:00
var found = [ ] ;
2019-11-22 14:26:12 +01:00
for ( let ins of BDFDB . ReactUtils . findOwner ( document . querySelector ( BDFDB . dotCN . guildswrapper ) , { name : "GuildFolder" , all : true , unlimited : true } ) ) {
2019-11-02 10:06:49 +01:00
if ( ins . props && ins . props . folderId ) found . push ( Object . assign ( { } , ins . props , { div : BDFDB . ReactUtils . findDOMNode ( ins ) , instance : ins } ) ) ;
2019-10-18 10:56:41 +02:00
}
return found ;
} ;
2019-10-22 14:20:12 +02:00
BDFDB . ChannelUtils = { } ;
2020-01-07 16:39:00 +01:00
BDFDB . ChannelUtils . is = function ( channel ) {
return channel && channel instanceof BDFDB . DiscordObjects . Channel ;
} ;
2019-12-30 12:02:46 +01:00
BDFDB . ChannelUtils . isTextChannel = function ( channelOrId ) {
let channel = typeof channelOrId == "string" ? LibraryModules . ChannelStore . getChannel ( channelOrId ) : channelOrId ;
2019-12-28 17:58:33 +01:00
return BDFDB . ObjectUtils . is ( channel ) && ( channel . type == BDFDB . DiscordConstants . ChannelTypes . GUILD _TEXT || channel . type == BDFDB . DiscordConstants . ChannelTypes . GUILD _STORE || channel . type == BDFDB . DiscordConstants . ChannelTypes . GUILD _ANNOUNCEMENT ) ;
2019-12-28 17:39:14 +01:00
} ;
2019-10-22 14:20:12 +02:00
BDFDB . ChannelUtils . getId = function ( div ) {
2019-10-20 20:57:23 +02:00
if ( ! Node . prototype . isPrototypeOf ( div ) || ! BDFDB . ReactUtils . getInstance ( div ) ) return ;
2019-10-23 11:10:01 +02:00
div = BDFDB . DOMUtils . getParent ( BDFDB . dotCNC . categorycontainerdefault + BDFDB . dotCNC . channelcontainerdefault + BDFDB . dotCN . dmchannel , div ) ;
2019-10-18 10:56:41 +02:00
if ( ! div ) return ;
2019-10-21 10:36:00 +02:00
var info = BDFDB . ReactUtils . findValue ( div , "channel" ) ;
2019-10-18 10:56:41 +02:00
return info ? info . id . toString ( ) : null ;
} ;
2019-10-22 14:20:12 +02:00
BDFDB . ChannelUtils . getDiv = function ( eleOrInfoOrId ) {
2019-10-18 10:56:41 +02:00
if ( ! eleOrInfoOrId ) return null ;
2019-10-22 14:20:12 +02:00
let info = BDFDB . ChannelUtils . getData ( eleOrInfoOrId ) ;
2019-10-18 10:56:41 +02:00
return info ? info . div : null ;
} ;
2019-10-22 14:20:12 +02:00
BDFDB . ChannelUtils . getData = function ( eleOrInfoOrId ) {
2019-10-18 10:56:41 +02:00
if ( ! eleOrInfoOrId ) return null ;
2019-11-13 11:14:54 +01:00
let id = Node . prototype . isPrototypeOf ( eleOrInfoOrId ) ? BDFDB . ChannelUtils . getId ( eleOrInfoOrId ) : ( typeof eleOrInfoOrId == "object" ? eleOrInfoOrId . id : eleOrInfoOrId ) ;
2019-10-18 10:56:41 +02:00
id = typeof id == "number" ? id . toFixed ( ) : id ;
2019-10-22 14:20:12 +02:00
for ( let info of BDFDB . ChannelUtils . getAll ( ) ) if ( info && info . id == id ) return info ;
2019-10-18 10:56:41 +02:00
return null ;
} ;
2019-10-22 14:20:12 +02:00
BDFDB . ChannelUtils . getAll = function ( ) {
2019-11-02 10:06:49 +01:00
var found = [ ] ;
2019-11-22 14:26:12 +01:00
for ( let ins of BDFDB . ReactUtils . findOwner ( document . querySelector ( BDFDB . dotCN . channels ) , { name : [ "ChannelCategoryItem" , "ChannelItem" , "PrivateChannel" ] , all : true , unlimited : true } ) ) if ( ins . props && ! ins . props . ispin && ins . props . channel && ins . _reactInternalFiber . return ) {
2019-11-02 10:06:49 +01:00
var div = BDFDB . ReactUtils . findDOMNode ( ins ) ;
2019-10-23 11:10:01 +02:00
div = div && BDFDB . DOMUtils . containsClass ( div . parentElement , BDFDB . disCN . categorycontainerdefault , BDFDB . disCN . channelcontainerdefault , false ) ? div . parentElement : div ;
2019-11-02 10:06:49 +01:00
found . push ( Object . assign ( new ins . props . channel . constructor ( ins . props . channel ) , { div , instance : ins } ) ) ;
2019-10-22 14:20:12 +02:00
}
return found ;
} ;
BDFDB . ChannelUtils . getSelected = function ( ) {
var info = LibraryModules . ChannelStore . getChannel ( LibraryModules . LastChannelStore . getChannelId ( ) ) ;
if ( info ) return BDFDB . ChannelUtils . getData ( info . id ) || Object . assign ( new info . constructor ( info ) , { div : null , instance : null } ) ;
else return null ;
} ;
2019-12-02 13:23:02 +01:00
BDFDB . ChannelUtils . openMenu = function ( eleOrInfoOrId , e = BDFDB . InternalData . mousePosition ) {
2019-11-04 22:44:58 +01:00
if ( ! eleOrInfoOrId ) return ;
2019-11-13 11:14:54 +01:00
let id = Node . prototype . isPrototypeOf ( eleOrInfoOrId ) ? BDFDB . ChannelUtils . getId ( eleOrInfoOrId ) : ( typeof eleOrInfoOrId == "object" ? eleOrInfoOrId . id : eleOrInfoOrId ) ;
2019-10-18 10:56:41 +02:00
let channel = LibraryModules . ChannelStore . getChannel ( id ) ;
if ( channel ) {
let type = null ;
for ( let t in BDFDB . DiscordConstants . ChannelTypes ) if ( BDFDB . DiscordConstants . ChannelTypes [ t ] == channel . type ) {
type = BDFDB . DiscordConstants . ContextMenuTypes [ ( t == "GUILD_CATEGORY" ? "CHANNEL_" : "CHANNEL_LIST_" ) + t . replace ( "GUILD_" , "" ) ] ;
break ;
}
if ( type ) LibraryModules . ContextMenuUtils . openContextMenu ( e , function ( e ) {
2020-02-08 11:14:10 +01:00
return BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . ContextMenus . _Exports . ChannelContextMenu && InternalComponents . LibraryComponents . ContextMenus . _Exports . ChannelContextMenu . default , Object . assign ( { } , e , {
2019-11-28 09:48:57 +01:00
type : type ,
2019-11-28 09:32:01 +01:00
channel : channel ,
2019-10-18 10:56:41 +02:00
guild : LibraryModules . GuildStore . getGuild ( channel . guild _id ) ,
selected : channel . id == LibraryModules . LastChannelStore . getChannelId ( )
} ) ) ;
} ) ;
}
} ;
2019-11-13 11:14:54 +01:00
BDFDB . ChannelUtils . markAsRead = function ( channels ) {
if ( ! channels ) return ;
var unreadchannels = [ ] ;
for ( let channel of channels = BDFDB . ArrayUtils . is ( channels ) ? channels : ( typeof channels == "string" || typeof channels == "number" ? Array . of ( channels ) : Array . from ( channels ) ) ) {
let id = Node . prototype . isPrototypeOf ( channel ) ? BDFDB . ChannelUtils . getId ( channel ) : ( channel && typeof channel == "object" ? channel . id : channel ) ;
if ( id ) unreadchannels . push ( id ) ;
}
if ( unreadchannels . length ) LibraryModules . AckUtils . bulkAck ( unreadchannels ) ;
} ;
2019-10-22 14:20:12 +02:00
2019-10-23 11:10:01 +02:00
BDFDB . DMUtils = { } ;
2019-12-30 12:02:46 +01:00
BDFDB . DMUtils . isDMChannel = function ( channelOrId ) {
let channel = typeof channelOrId == "string" ? LibraryModules . ChannelStore . getChannel ( channelOrId ) : channelOrId ;
return BDFDB . ObjectUtils . is ( channel ) && ( channel . type == BDFDB . DiscordConstants . ChannelTypes . DM || channel . type == BDFDB . DiscordConstants . ChannelTypes . GROUP _DM ) ;
} ;
2019-10-23 11:10:01 +02:00
BDFDB . DMUtils . getIcon = function ( id ) {
2019-10-22 18:55:25 +02:00
var channel = LibraryModules . ChannelStore . getChannel ( id = typeof id == "number" ? id . toFixed ( ) : id ) ;
if ( ! channel ) return null ;
2019-11-30 20:58:25 +01:00
if ( ! channel . icon ) return channel . type == 1 ? BDFDB . UserUtils . getAvatar ( channel . recipients [ 0 ] ) : ( channel . type == 3 ? window . location . origin + LibraryModules . IconUtils . getChannelIconURL ( channel ) . split ( "?" ) [ 0 ] : null ) ;
2019-10-22 18:55:25 +02:00
return LibraryModules . IconUtils . getChannelIconURL ( channel ) . split ( "?" ) [ 0 ] ;
} ;
2019-10-23 11:10:01 +02:00
BDFDB . DMUtils . getId = function ( div ) {
2019-10-20 20:57:23 +02:00
if ( ! Node . prototype . isPrototypeOf ( div ) || ! BDFDB . ReactUtils . getInstance ( div ) ) return ;
2019-10-23 11:10:01 +02:00
let dmdiv = BDFDB . DOMUtils . getParent ( BDFDB . dotCN . guildouter , div ) ;
2019-10-18 10:56:41 +02:00
if ( ! dmdiv ) return ;
var iconwrap = dmdiv . querySelector ( BDFDB . dotCN . guildiconwrapper ) ;
var id = iconwrap && iconwrap . href ? iconwrap . href . split ( "/" ) . slice ( - 1 ) [ 0 ] : null ;
return id && ! isNaN ( parseInt ( id ) ) ? id . toString ( ) : null ;
} ;
2019-10-23 11:10:01 +02:00
BDFDB . DMUtils . getDiv = function ( eleOrInfoOrId ) {
2019-10-18 10:56:41 +02:00
if ( ! eleOrInfoOrId ) return null ;
if ( Node . prototype . isPrototypeOf ( eleOrInfoOrId ) ) {
2019-10-23 11:10:01 +02:00
var div = BDFDB . DOMUtils . getParent ( BDFDB . dotCN . guildouter , eleOrInfoOrId ) ;
2019-10-18 10:56:41 +02:00
return div ? div . parentElement : div ;
}
else {
let id = typeof eleOrInfoOrId == "object" ? eleOrInfoOrId . id : eleOrInfoOrId ;
if ( id ) {
2019-10-23 11:10:01 +02:00
var div = BDFDB . DOMUtils . getParent ( BDFDB . dotCN . guildouter , document . querySelector ( ` ${ BDFDB . dotCNS . guilds + BDFDB . dotCN . dmpill + " + * " + BDFDB . dotCN . guildiconwrapper } [href*="/channels/@me/ ${ id } "] ` ) ) ;
2019-10-18 10:56:41 +02:00
return div && BDFDB ? div . parentElement : div ;
}
}
return null ;
} ;
2019-10-23 11:10:01 +02:00
BDFDB . DMUtils . getData = function ( eleOrInfoOrId ) {
2019-10-18 10:56:41 +02:00
if ( ! eleOrInfoOrId ) return null ;
2019-11-13 11:14:54 +01:00
let id = Node . prototype . isPrototypeOf ( eleOrInfoOrId ) ? BDFDB . BDFDB . DMUtils . getId ( eleOrInfoOrId ) : ( typeof eleOrInfoOrId == "object" ? eleOrInfoOrId . id : eleOrInfoOrId ) ;
2019-10-18 10:56:41 +02:00
id = typeof id == "number" ? id . toFixed ( ) : id ;
2019-10-23 11:10:01 +02:00
for ( let info of BDFDB . DMUtils . getAll ( ) ) if ( info && info . id == id ) return info ;
2019-10-18 10:56:41 +02:00
return null ;
} ;
2019-10-23 11:10:01 +02:00
BDFDB . DMUtils . getAll = function ( ) {
2019-11-02 10:06:49 +01:00
var found = [ ] ;
2019-11-22 14:26:12 +01:00
for ( let ins of BDFDB . ReactUtils . findOwner ( document . querySelector ( BDFDB . dotCN . guilds ) , { name : "DirectMessage" , all : true , unlimited : true } ) ) {
2019-11-02 10:06:49 +01:00
if ( ins . props && ins . props . channel ) found . push ( Object . assign ( new ins . props . channel . constructor ( ins . props . channel ) , { div : BDFDB . ReactUtils . findDOMNode ( ins ) , instance : ins } ) ) ;
}
2019-10-22 14:20:12 +02:00
return found ;
} ;
2019-12-02 13:23:02 +01:00
BDFDB . DMUtils . openMenu = function ( eleOrInfoOrId , e = BDFDB . InternalData . mousePosition ) {
2019-11-28 09:32:01 +01:00
if ( ! eleOrInfoOrId ) return ;
let id = Node . prototype . isPrototypeOf ( eleOrInfoOrId ) ? BDFDB . ChannelUtils . getId ( eleOrInfoOrId ) : ( typeof eleOrInfoOrId == "object" ? eleOrInfoOrId . id : eleOrInfoOrId ) ;
let channel = LibraryModules . ChannelStore . getChannel ( id ) ;
if ( channel ) {
if ( channel . isMultiUserDM ( ) ) LibraryModules . ContextMenuUtils . openContextMenu ( e , function ( e ) {
2020-02-08 11:14:10 +01:00
return BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . ContextMenus . GroupDMContextMenu , Object . assign ( { } , e , {
2019-11-28 09:32:01 +01:00
channelId : channel . id ,
selected : channel . id == LibraryModules . LastChannelStore . getChannelId ( )
} ) ) ;
} , { noBlurEvent : true } ) ;
else LibraryModules . ContextMenuUtils . openContextMenu ( e , function ( e ) {
2020-02-08 11:14:10 +01:00
return BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . ContextMenus . _Exports . UserContextMenu && InternalComponents . LibraryComponents . ContextMenus . _Exports . UserContextMenu . default , Object . assign ( { } , e , {
2019-11-28 09:32:01 +01:00
type : BDFDB . DiscordConstants . ContextMenuTypes . USER _PRIVATE _CHANNELS ,
user : LibraryModules . UserStore . getUser ( channel . recipients [ 0 ] ) ,
channelId : channel . id ,
selected : channel . id == LibraryModules . LastChannelStore . getChannelId ( )
} ) ) ;
} ) ;
}
} ;
2019-11-13 11:14:54 +01:00
BDFDB . DMUtils . markAsRead = function ( dms ) {
if ( ! dms ) return ;
2019-10-18 10:56:41 +02:00
var unreadchannels = [ ] ;
2019-11-13 11:14:54 +01:00
for ( let dm of dms = BDFDB . ArrayUtils . is ( dms ) ? dms : ( typeof dms == "string" || typeof dms == "number" ? Array . of ( dms ) : Array . from ( dms ) ) ) {
let id = Node . prototype . isPrototypeOf ( dm ) ? BDFDB . BDFDB . DMUtils . getId ( dm ) : ( dm && typeof dm == "object" ? dm . id : dm ) ;
2019-10-18 10:56:41 +02:00
if ( id ) unreadchannels . push ( id ) ;
}
2019-11-13 11:14:54 +01:00
for ( let i in unreadchannels ) BDFDB . TimeUtils . timeout ( _ => { LibraryModules . AckUtils . ack ( unreadchannels [ i ] ) ; } , i * 1000 ) ;
2019-10-18 10:56:41 +02:00
} ;
2019-10-22 14:20:12 +02:00
BDFDB . DataUtils = { } ;
2020-01-05 15:37:33 +01:00
BDFDB . DataUtils . cached = window . BDFDB && window . BDFDB . DataUtils && window . BDFDB . DataUtils . cached || { } ;
2019-10-22 14:20:12 +02:00
BDFDB . DataUtils . save = function ( data , plugin , key , id ) {
2020-02-03 11:39:06 +01:00
let configPath , pluginName ;
2019-10-23 11:10:01 +02:00
if ( ! BDFDB . BDUtils . isBDv2 ( ) ) {
2020-02-03 11:39:06 +01:00
pluginName = typeof plugin === "string" ? plugin : plugin . name ;
configPath = LibraryRequires . path . join ( BDFDB . BDUtils . getPluginsFolder ( ) , pluginName + ".config.json" ) ;
2019-10-18 10:56:41 +02:00
}
else {
2020-02-03 11:39:06 +01:00
pluginName = typeof plugin === "string" ? plugin . toLowerCase ( ) : null ;
let contentpath = pluginName ? BDFDB . Plugins [ pluginName ] ? BDFDB . Plugins [ pluginName ] . contentPath : null : plugin . contentPath ;
2019-10-18 10:56:41 +02:00
if ( ! contentpath ) return ;
2020-02-03 11:39:06 +01:00
configPath = LibraryRequires . path . join ( contentpath , "settings.json" ) ;
2019-10-18 10:56:41 +02:00
}
2019-10-22 14:20:12 +02:00
2020-02-03 11:39:06 +01:00
let config = BDFDB . DataUtils . cached [ pluginName ] !== undefined ? BDFDB . DataUtils . cached [ pluginName ] : ( InternalBDFDB . readConfig ( configPath ) || { } ) ;
2019-10-22 14:20:12 +02:00
2020-01-05 12:00:41 +01:00
if ( key === undefined ) config = BDFDB . ObjectUtils . is ( data ) ? BDFDB . ObjectUtils . sort ( data ) : data ;
2019-10-22 14:20:12 +02:00
else {
2020-01-05 12:00:41 +01:00
if ( id === undefined ) config [ key ] = BDFDB . ObjectUtils . is ( data ) ? BDFDB . ObjectUtils . sort ( data ) : data ;
else {
if ( ! BDFDB . ObjectUtils . is ( config [ key ] ) ) config [ key ] = { } ;
config [ key ] [ id ] = BDFDB . ObjectUtils . is ( data ) ? BDFDB . ObjectUtils . sort ( data ) : data ;
}
2019-10-22 14:20:12 +02:00
}
2020-01-05 12:00:41 +01:00
let configIsObject = BDFDB . ObjectUtils . is ( config ) ;
2020-01-07 16:08:18 +01:00
if ( key !== undefined && configIsObject && BDFDB . ObjectUtils . is ( config [ key ] ) && BDFDB . ObjectUtils . isEmpty ( config [ key ] ) ) delete config [ key ] ;
2019-10-18 10:56:41 +02:00
if ( BDFDB . ObjectUtils . isEmpty ( config ) ) {
2020-02-03 11:39:06 +01:00
delete BDFDB . DataUtils . cached [ pluginName ] ;
if ( LibraryRequires . fs . existsSync ( configPath ) ) LibraryRequires . fs . unlinkSync ( configPath ) ;
2019-10-18 10:56:41 +02:00
}
else {
2020-01-05 12:00:41 +01:00
if ( configIsObject ) config = BDFDB . ObjectUtils . sort ( config ) ;
2020-02-03 11:39:06 +01:00
BDFDB . DataUtils . cached [ pluginName ] = configIsObject ? BDFDB . ObjectUtils . deepAssign ( { } , config ) : config ;
LibraryRequires . fs . writeFileSync ( configPath , JSON . stringify ( config , null , " " ) ) ;
2019-10-18 10:56:41 +02:00
}
} ;
2019-10-22 14:20:12 +02:00
BDFDB . DataUtils . load = function ( plugin , key , id ) {
2020-02-03 11:39:06 +01:00
let configPath , pluginName ;
2019-10-23 11:10:01 +02:00
if ( ! BDFDB . BDUtils . isBDv2 ( ) ) {
2020-02-03 11:39:06 +01:00
pluginName = typeof plugin === "string" ? plugin : plugin . name ;
configPath = LibraryRequires . path . join ( BDFDB . BDUtils . getPluginsFolder ( ) , pluginName + ".config.json" ) ;
2019-10-18 10:56:41 +02:00
}
else {
2020-02-03 11:39:06 +01:00
pluginName = typeof plugin === "string" ? plugin . toLowerCase ( ) : null ;
let contentpath = pluginName ? BDFDB . Plugins [ pluginName ] ? BDFDB . Plugins [ pluginName ] . contentPath : null : plugin . contentPath ;
2019-10-18 10:56:41 +02:00
if ( ! contentpath ) return { } ;
2020-02-03 11:39:06 +01:00
configPath = LibraryRequires . path . join ( contentpath , "settings.json" ) ;
2019-10-18 10:56:41 +02:00
}
2019-10-22 14:20:12 +02:00
2020-02-03 11:39:06 +01:00
let config = BDFDB . DataUtils . cached [ pluginName ] !== undefined ? BDFDB . DataUtils . cached [ pluginName ] : ( InternalBDFDB . readConfig ( configPath ) || { } ) ;
2020-01-05 12:00:41 +01:00
let configIsObject = BDFDB . ObjectUtils . is ( config ) ;
2020-02-03 11:39:06 +01:00
BDFDB . DataUtils . cached [ pluginName ] = configIsObject ? BDFDB . ObjectUtils . deepAssign ( { } , config ) : config ;
2019-10-22 14:20:12 +02:00
2020-01-05 12:00:41 +01:00
if ( key === undefined ) return config ;
else {
2020-01-07 16:10:29 +01:00
let keydata = configIsObject ? ( BDFDB . ObjectUtils . is ( config [ key ] ) || config [ key ] == undefined ? BDFDB . ObjectUtils . deepAssign ( { } , config [ key ] ) : config [ key ] ) : null ;
2020-01-05 12:00:41 +01:00
if ( id === undefined ) return keydata ;
else return ! BDFDB . ObjectUtils . is ( keydata ) || keydata [ id ] === undefined ? null : keydata [ id ] ;
}
2019-10-18 10:56:41 +02:00
} ;
2019-10-22 14:20:12 +02:00
BDFDB . DataUtils . remove = function ( plugin , key , id ) {
2020-02-03 11:39:06 +01:00
let configPath , pluginName ;
2019-10-23 11:10:01 +02:00
if ( ! BDFDB . BDUtils . isBDv2 ( ) ) {
2020-02-03 11:39:06 +01:00
pluginName = typeof plugin === "string" ? plugin : plugin . name ;
configPath = LibraryRequires . path . join ( BDFDB . BDUtils . getPluginsFolder ( ) , pluginName + ".config.json" ) ;
2019-10-18 10:56:41 +02:00
}
else {
2020-02-03 11:39:06 +01:00
pluginName = typeof plugin === "string" ? plugin . toLowerCase ( ) : null ;
let contentpath = pluginName ? BDFDB . Plugins [ pluginName ] ? BDFDB . Plugins [ pluginName ] . contentPath : null : plugin . contentPath ;
2019-10-18 10:56:41 +02:00
if ( ! contentpath ) return ;
2020-02-03 11:39:06 +01:00
configPath = LibraryRequires . path . join ( contentpath , "settings.json" ) ;
2019-10-18 10:56:41 +02:00
}
2019-10-22 14:20:12 +02:00
2020-02-03 11:39:06 +01:00
let config = BDFDB . DataUtils . cached [ pluginName ] !== undefined ? BDFDB . DataUtils . cached [ pluginName ] : ( InternalBDFDB . readConfig ( configPath ) || { } ) ;
2020-01-05 12:00:41 +01:00
let configIsObject = BDFDB . ObjectUtils . is ( config ) ;
2019-10-22 14:20:12 +02:00
2020-01-05 12:00:41 +01:00
if ( key === undefined || ! configIsObject ) config = { } ;
else {
if ( id === undefined ) delete config [ key ] ;
else if ( BDFDB . ObjectUtils . is ( config [ key ] ) ) delete config [ key ] [ id ] ;
}
2019-10-22 14:20:12 +02:00
2020-01-07 16:08:18 +01:00
if ( BDFDB . ObjectUtils . is ( config [ key ] ) && BDFDB . ObjectUtils . isEmpty ( config [ key ] ) ) delete config [ key ] ;
2019-10-18 10:56:41 +02:00
if ( BDFDB . ObjectUtils . isEmpty ( config ) ) {
2020-02-03 11:39:06 +01:00
delete BDFDB . DataUtils . cached [ pluginName ] ;
if ( LibraryRequires . fs . existsSync ( configPath ) ) LibraryRequires . fs . unlinkSync ( configPath ) ;
2019-10-18 10:56:41 +02:00
}
else {
2020-01-05 12:00:41 +01:00
if ( configIsObject ) config = BDFDB . ObjectUtils . sort ( config ) ;
2020-02-03 11:39:06 +01:00
BDFDB . DataUtils . cached [ pluginName ] = configIsObject ? BDFDB . ObjectUtils . deepAssign ( { } , config ) : config ;
LibraryRequires . fs . writeFileSync ( configPath , JSON . stringify ( config , null , " " ) ) ;
2019-10-18 10:56:41 +02:00
}
} ;
2019-10-22 14:20:12 +02:00
BDFDB . DataUtils . get = function ( plugin , key , id ) {
2019-10-23 11:10:01 +02:00
plugin = typeof plugin == "string" ? BDFDB . BDUtils . getPlugin ( plugin ) : plugin ;
2020-02-03 11:39:06 +01:00
if ( ! BDFDB . ObjectUtils . is ( plugin ) ) return id === undefined ? { } : null ;
let defaults = ( plugin . name == "$BDFDB" ? InternalBDFDB : plugin ) . defaults ;
if ( ! BDFDB . ObjectUtils . is ( defaults ) || ! defaults [ key ] ) return id === undefined ? { } : null ;
2019-10-22 14:20:12 +02:00
var oldconfig = BDFDB . DataUtils . load ( plugin , key ) , newconfig = { } , update = false ;
2020-02-03 12:02:28 +01:00
for ( let k in defaults [ key ] ) {
2019-10-18 10:56:41 +02:00
if ( oldconfig [ k ] == null ) {
2020-02-03 11:39:06 +01:00
newconfig [ k ] = BDFDB . ObjectUtils . is ( defaults [ key ] [ k ] . value ) ? BDFDB . ObjectUtils . deepAssign ( { } , defaults [ key ] [ k ] . value ) : defaults [ key ] [ k ] . value ;
2019-10-18 10:56:41 +02:00
update = true ;
}
else newconfig [ k ] = oldconfig [ k ] ;
}
2019-10-22 14:20:12 +02:00
if ( update ) BDFDB . DataUtils . save ( newconfig , plugin , key ) ;
if ( id === undefined ) return newconfig ;
else return newconfig [ id ] === undefined ? null : newconfig [ id ] ;
2019-10-18 10:56:41 +02:00
} ;
2019-10-22 14:20:12 +02:00
InternalBDFDB . readConfig = function ( path ) {
2019-10-18 10:56:41 +02:00
try { return JSON . parse ( LibraryRequires . fs . readFileSync ( path ) ) ; }
catch ( err ) { return { } ; }
} ;
2019-10-23 10:03:33 +02:00
BDFDB . ColorUtils = { } ;
BDFDB . ColorUtils . convert = function ( color , conv , type ) {
2019-11-25 13:42:12 +01:00
if ( BDFDB . ObjectUtils . is ( color ) ) {
var newcolor = { } ;
for ( let pos in color ) newcolor [ pos ] = BDFDB . ColorUtils . convert ( color [ pos ] , conv , type ) ;
return newcolor ;
2019-10-18 10:56:41 +02:00
}
else {
2019-11-25 13:42:12 +01:00
conv = conv === undefined || ! conv ? conv = "RGBCOMP" : conv . toUpperCase ( ) ;
type = type === undefined || ! type || ! [ "RGB" , "RGBA" , "RGBCOMP" , "HSL" , "HSLA" , "HSLCOMP" , "HEX" , "HEXA" , "INT" ] . includes ( type . toUpperCase ( ) ) ? BDFDB . ColorUtils . getType ( color ) : type . toUpperCase ( ) ;
if ( conv == "RGBCOMP" ) {
switch ( type ) {
case "RGBCOMP" :
if ( color . length == 3 ) return processRGB ( color ) ;
else if ( color . length == 4 ) {
let a = processA ( color . pop ( ) ) ;
return processRGB ( color ) . concat ( a ) ;
}
break ;
case "RGB" :
return processRGB ( color . replace ( /\s/g , "" ) . slice ( 4 , - 1 ) . split ( "," ) ) ;
case "RGBA" :
let comp = color . replace ( /\s/g , "" ) . slice ( 5 , - 1 ) . split ( "," ) ;
let a = processA ( comp . pop ( ) ) ;
return processRGB ( comp ) . concat ( a ) ;
case "HSLCOMP" :
if ( color . length == 3 ) return BDFDB . ColorUtils . convert ( ` hsl( ${ processHSL ( color ) . join ( "," ) } ) ` , "RGBCOMP" ) ;
else if ( color . length == 4 ) {
let a = processA ( color . pop ( ) ) ;
return BDFDB . ColorUtils . convert ( ` hsl( ${ processHSL ( color ) . join ( "," ) } ) ` , "RGBCOMP" ) . concat ( a ) ;
}
break ;
case "HSL" :
var hslcomp = processHSL ( color . replace ( /\s/g , "" ) . slice ( 4 , - 1 ) . split ( "," ) ) ;
var r , g , b , m , c , x , p , q ;
var h = hslcomp [ 0 ] / 360 , l = parseInt ( hslcomp [ 1 ] ) / 100 , s = parseInt ( hslcomp [ 2 ] ) / 100 ; m = Math . floor ( h * 6 ) ; c = h * 6 - m ; x = s * ( 1 - l ) ; p = s * ( 1 - c * l ) ; q = s * ( 1 - ( 1 - c ) * l ) ;
switch ( m % 6 ) {
case 0 : r = s , g = q , b = x ; break ;
case 1 : r = p , g = s , b = x ; break ;
case 2 : r = x , g = s , b = q ; break ;
case 3 : r = x , g = p , b = s ; break ;
case 4 : r = q , g = x , b = s ; break ;
case 5 : r = s , g = x , b = p ; break ;
}
return [ Math . round ( r * 255 ) , Math . round ( g * 255 ) , Math . round ( b * 255 ) ] ;
case "HSLA" :
var hslcomp = color . replace ( /\s/g , "" ) . slice ( 5 , - 1 ) . split ( "," ) ;
return BDFDB . ColorUtils . convert ( ` hsl( ${ hslcomp . slice ( 0 , 3 ) . join ( "," ) } ) ` , "RGBCOMP" ) . concat ( processA ( hslcomp . pop ( ) ) ) ;
case "HEX" :
var hex = /^#([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})$|^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i . exec ( color ) ;
return [ parseInt ( hex [ 1 ] + hex [ 1 ] || hex [ 4 ] , 16 ) . toString ( ) , parseInt ( hex [ 2 ] + hex [ 2 ] || hex [ 5 ] , 16 ) . toString ( ) , parseInt ( hex [ 3 ] + hex [ 3 ] || hex [ 6 ] , 16 ) . toString ( ) ] ;
case "HEXA" :
var hex = /^#([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})$|^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i . exec ( color ) ;
return [ parseInt ( hex [ 1 ] + hex [ 1 ] || hex [ 5 ] , 16 ) . toString ( ) , parseInt ( hex [ 2 ] + hex [ 2 ] || hex [ 6 ] , 16 ) . toString ( ) , parseInt ( hex [ 3 ] + hex [ 3 ] || hex [ 7 ] , 16 ) . toString ( ) , Math . floor ( BDFDB . NumberUtils . mapRange ( [ 0 , 255 ] , [ 0 , 100 ] , parseInt ( hex [ 4 ] + hex [ 4 ] || hex [ 8 ] , 16 ) . toString ( ) ) ) / 100 ] ;
case "INT" :
color = processINT ( color ) ;
return [ ( color >> 16 & 255 ) . toString ( ) , ( color >> 8 & 255 ) . toString ( ) , ( color & 255 ) . toString ( ) ] ;
default :
return null ;
}
}
else {
var rgbcomp = type == "RGBCOMP" ? color : BDFDB . ColorUtils . convert ( color , "RGBCOMP" , type ) ;
if ( rgbcomp ) switch ( conv ) {
case "RGB" :
return ` rgb( ${ processRGB ( rgbcomp . slice ( 0 , 3 ) ) . join ( "," ) } ) ` ;
case "RGBA" :
rgbcomp = rgbcomp . slice ( 0 , 4 ) ;
var a = rgbcomp . length == 4 ? processA ( rgbcomp . pop ( ) ) : 1 ;
return ` rgba( ${ processRGB ( rgbcomp ) . concat ( a ) . join ( "," ) } ) ` ;
case "HSLCOMP" :
var a = rgbcomp . length == 4 ? processA ( rgbcomp . pop ( ) ) : null ;
var hslcomp = processHSL ( BDFDB . ColorUtils . convert ( rgbcomp , "HSL" ) . replace ( /\s/g , "" ) . split ( "," ) ) ;
return a != null ? hslcomp . concat ( a ) : hslcomp ;
case "HSL" :
var r = processC ( rgbcomp [ 0 ] ) , g = processC ( rgbcomp [ 1 ] ) , b = processC ( rgbcomp [ 2 ] ) ;
var max = Math . max ( r , g , b ) , min = Math . min ( r , g , b ) , dif = max - min , h , l = max === 0 ? 0 : dif / max , s = max / 255 ;
switch ( max ) {
case min : h = 0 ; break ;
case r : h = g - b + dif * ( g < b ? 6 : 0 ) ; h /= 6 * dif ; break ;
case g : h = b - r + dif * 2 ; h /= 6 * dif ; break ;
case b : h = r - g + dif * 4 ; h /= 6 * dif ; break ;
}
return ` hsl( ${ processHSL ( [ Math . round ( h * 360 ) , l * 100 , s * 100 ] ) . join ( "," ) } ) ` ;
case "HSLA" :
var j0 = rgbcomp . length == 4 ? processA ( rgbcomp . pop ( ) ) : 1 ;
return ` hsla( ${ BDFDB . ColorUtils . convert ( rgbcomp , "HSL" ) . slice ( 4 , - 1 ) . split ( "," ) . concat ( j0 ) . join ( "," ) } ) ` ;
case "HEX" :
return ( "#" + ( 0x1000000 + ( rgbcomp [ 2 ] | rgbcomp [ 1 ] << 8 | rgbcomp [ 0 ] << 16 ) ) . toString ( 16 ) . slice ( 1 ) ) . toUpperCase ( ) ;
case "HEXA" :
return ( "#" + ( 0x1000000 + ( rgbcomp [ 2 ] | rgbcomp [ 1 ] << 8 | rgbcomp [ 0 ] << 16 ) ) . toString ( 16 ) . slice ( 1 ) + ( 0x100 + Math . round ( BDFDB . NumberUtils . mapRange ( [ 0 , 100 ] , [ 0 , 255 ] , processA ( rgbcomp [ 3 ] ) * 100 ) ) ) . toString ( 16 ) . slice ( 1 ) ) . toUpperCase ( ) ;
case "INT" :
return processINT ( rgbcomp [ 2 ] | rgbcomp [ 1 ] << 8 | rgbcomp [ 0 ] << 16 ) ;
default :
return null ;
}
2019-10-18 10:56:41 +02:00
}
}
2019-11-25 13:42:12 +01:00
return null ;
2019-10-18 10:56:41 +02:00
function processC ( c ) { if ( c == null ) { return 255 ; } else { c = parseInt ( c . toString ( ) . replace ( /[^0-9\-]/g , "" ) ) ; return isNaN ( c ) || c > 255 ? 255 : c < 0 ? 0 : c ; } } ;
function processRGB ( comp ) { return comp . map ( c => { return processC ( c ) ; } ) ; } ;
function processA ( a ) { if ( a == null ) { return 1 ; } else { a = a . toString ( ) ; a = ( a . indexOf ( "%" ) > - 1 ? 0.01 : 1 ) * parseFloat ( a . replace ( /[^0-9\.\-]/g , "" ) ) ; return isNaN ( a ) || a > 1 ? 1 : a < 0 ? 0 : a ; } } ;
function processSL ( sl ) { if ( sl == null ) { return "100%" ; } else { sl = parseFloat ( sl . toString ( ) . replace ( /[^0-9\.\-]/g , "" ) ) ; return ( isNaN ( sl ) || sl > 100 ? 100 : sl < 0 ? 0 : sl ) + "%" ; } } ;
function processHSL ( comp ) { let h = parseFloat ( comp . shift ( ) . toString ( ) . replace ( /[^0-9\.\-]/g , "" ) ) ; h = isNaN ( h ) || h > 360 ? 360 : h < 0 ? 0 : h ; return [ h ] . concat ( comp . map ( sl => { return processSL ( sl ) ; } ) ) ; } ;
function processINT ( c ) { if ( c == null ) { return 16777215 ; } else { c = parseInt ( c . toString ( ) . replace ( /[^0-9]/g , "" ) ) ; return isNaN ( c ) || c > 16777215 ? 16777215 : c < 0 ? 0 : c ; } } ;
} ;
2019-10-23 10:03:33 +02:00
BDFDB . ColorUtils . setAlpha = function ( color , a , conv ) {
2019-10-18 10:56:41 +02:00
if ( BDFDB . ObjectUtils . is ( color ) ) {
var newcolor = { } ;
2019-11-25 13:42:12 +01:00
for ( let pos in color ) newcolor [ pos ] = BDFDB . ColorUtils . setAlpha ( color [ pos ] , a , conv ) ;
2019-10-18 10:56:41 +02:00
return newcolor ;
}
2019-11-25 13:42:12 +01:00
else {
2019-10-23 11:10:01 +02:00
var comp = BDFDB . ColorUtils . convert ( color , "RGBCOMP" ) ;
if ( comp ) {
a = a . toString ( ) ;
a = ( a . indexOf ( "%" ) > - 1 ? 0.01 : 1 ) * parseFloat ( a . replace ( /[^0-9\.\-]/g , "" ) ) ;
a = isNaN ( a ) || a > 1 ? 1 : a < 0 ? 0 : a ;
comp [ 3 ] = a ;
conv = ( conv || BDFDB . ColorUtils . getType ( color ) ) . toUpperCase ( ) ;
conv = conv == "RGB" || conv == "HSL" || conv == "HEX" ? conv + "A" : conv ;
return BDFDB . ColorUtils . convert ( comp , conv ) ;
}
}
2019-11-25 13:42:12 +01:00
return null ;
2019-10-18 10:56:41 +02:00
} ;
2019-10-23 10:03:33 +02:00
BDFDB . ColorUtils . getAlpha = function ( color ) {
var comp = BDFDB . ColorUtils . convert ( color , "RGBCOMP" ) ;
2019-10-18 10:56:41 +02:00
if ( comp ) {
if ( comp . length == 3 ) return 1 ;
else if ( comp . length == 4 ) {
let a = comp [ 3 ] . toString ( ) ;
a = ( a . indexOf ( "%" ) > - 1 ? 0.01 : 1 ) * parseFloat ( a . replace ( /[^0-9\.\-]/g , "" ) ) ;
return isNaN ( a ) || a > 1 ? 1 : a < 0 ? 0 : a ;
}
}
return null ;
} ;
2019-10-23 10:03:33 +02:00
BDFDB . ColorUtils . change = function ( color , value , conv ) {
2019-10-18 10:56:41 +02:00
value = parseFloat ( value ) ;
if ( color != null && typeof value == "number" && ! isNaN ( value ) ) {
if ( BDFDB . ObjectUtils . is ( color ) ) {
var newcolor = { } ;
2019-11-25 13:42:12 +01:00
for ( let pos in color ) newcolor [ pos ] = BDFDB . ColorUtils . change ( color [ pos ] , value , conv ) ;
2019-10-18 10:56:41 +02:00
return newcolor ;
}
2019-11-25 13:42:12 +01:00
else {
var comp = BDFDB . ColorUtils . convert ( color , "RGBCOMP" ) ;
if ( comp ) {
if ( parseInt ( value ) !== value ) {
value = value . toString ( ) ;
value = ( value . indexOf ( "%" ) > - 1 ? 0.01 : 1 ) * parseFloat ( value . replace ( /[^0-9\.\-]/g , "" ) ) ;
value = isNaN ( value ) ? 0 : value ;
return BDFDB . ColorUtils . convert ( [ Math . round ( comp [ 0 ] * ( 1 + value ) ) , Math . round ( comp [ 1 ] * ( 1 + value ) ) , Math . round ( comp [ 2 ] * ( 1 + value ) ) ] , conv || BDFDB . ColorUtils . getType ( color ) ) ;
}
else return BDFDB . ColorUtils . convert ( [ Math . round ( comp [ 0 ] + value ) , Math . round ( comp [ 1 ] + value ) , Math . round ( comp [ 2 ] + value ) ] , conv || BDFDB . ColorUtils . getType ( color ) ) ;
2019-10-23 11:10:01 +02:00
}
}
2019-11-25 13:42:12 +01:00
}
return null ;
2019-10-18 10:56:41 +02:00
} ;
2019-10-23 10:03:33 +02:00
BDFDB . ColorUtils . invert = function ( color , conv ) {
2019-11-25 13:42:12 +01:00
if ( BDFDB . ObjectUtils . is ( color ) ) {
var newcolor = { } ;
for ( let pos in color ) newcolor [ pos ] = BDFDB . ColorUtils . invert ( color [ pos ] , conv ) ;
return newcolor ;
}
else {
2019-10-23 10:03:33 +02:00
var comp = BDFDB . ColorUtils . convert ( color , "RGBCOMP" ) ;
if ( comp ) return BDFDB . ColorUtils . convert ( [ 255 - comp [ 0 ] , 255 - comp [ 1 ] , 255 - comp [ 2 ] ] , conv || BDFDB . ColorUtils . getType ( color ) ) ;
2019-10-18 10:56:41 +02:00
}
return null ;
} ;
2019-10-23 10:03:33 +02:00
BDFDB . ColorUtils . compare = function ( color1 , color2 ) {
2019-10-18 10:56:41 +02:00
if ( color1 && color2 ) {
2019-10-23 10:03:33 +02:00
color1 = BDFDB . ColorUtils . convert ( color1 , "RGBA" ) ;
color2 = BDFDB . ColorUtils . convert ( color2 , "RGBA" ) ;
2019-10-18 10:56:41 +02:00
if ( color1 && color2 ) return BDFDB . equals ( color1 , color2 ) ;
}
return null ;
} ;
2019-10-23 10:03:33 +02:00
BDFDB . ColorUtils . isBright = function ( color , compare = 160 ) {
color = BDFDB . ColorUtils . convert ( color , "RGBCOMP" ) ;
2019-10-18 10:56:41 +02:00
if ( ! color ) return false ;
return parseInt ( compare ) < Math . sqrt ( 0.299 * color [ 0 ] * * 2 + 0.587 * color [ 1 ] * * 2 + 0.144 * color [ 2 ] * * 2 ) ;
} ;
2019-10-23 10:03:33 +02:00
BDFDB . ColorUtils . getType = function ( color ) {
2019-10-18 10:56:41 +02:00
if ( color != null ) {
if ( typeof color === "object" && ( color . length == 3 || color . length == 4 ) ) {
if ( isRGB ( color ) ) return "RGBCOMP" ;
else if ( isHSL ( color ) ) return "HSLCOMP" ;
}
else if ( typeof color === "string" ) {
if ( /^#[a-f\d]{3}$|^#[a-f\d]{6}$/i . test ( color ) ) return "HEX" ;
else if ( /^#[a-f\d]{4}$|^#[a-f\d]{8}$/i . test ( color ) ) return "HEXA" ;
else {
color = color . toUpperCase ( ) ;
var comp = color . replace ( /[^0-9\.\-\,\%]/g , "" ) . split ( "," ) ;
if ( color . indexOf ( "RGB(" ) == 0 && comp . length == 3 && isRGB ( comp ) ) return "RGB" ;
else if ( color . indexOf ( "RGBA(" ) == 0 && comp . length == 4 && isRGB ( comp ) ) return "RGBA" ;
else if ( color . indexOf ( "HSL(" ) == 0 && comp . length == 3 && isHSL ( comp ) ) return "HSL" ;
else if ( color . indexOf ( "HSLA(" ) == 0 && comp . length == 4 && isHSL ( comp ) ) return "HSLA" ;
}
}
else if ( typeof color === "number" && parseInt ( color ) == color && color > - 1 && color < 16777216 ) return "INT" ;
}
return null ;
function isRGB ( comp ) { return comp . slice ( 0 , 3 ) . every ( rgb => rgb . toString ( ) . indexOf ( "%" ) == - 1 && parseFloat ( rgb ) == parseInt ( rgb ) ) ; } ;
function isHSL ( comp ) { return comp . slice ( 1 , 3 ) . every ( hsl => hsl . toString ( ) . indexOf ( "%" ) == hsl . length - 1 ) ; } ;
} ;
2019-10-23 10:03:33 +02:00
BDFDB . ColorUtils . createGradient = function ( colorobj , direction = "to right" ) {
2019-10-18 10:56:41 +02:00
var sortedgradient = { } ;
var gradientstring = "linear-gradient(" + direction ;
2019-11-25 13:42:12 +01:00
for ( let pos of Object . keys ( colorobj ) . sort ( ) ) {
let color = BDFDB . ColorUtils . convert ( colorobj [ pos ] , "RGBA" ) ;
gradientstring += color ? ` , ${ color } ${ pos * 100 } % ` : ''
}
2019-10-18 10:56:41 +02:00
return gradientstring += ")" ;
} ;
2019-10-23 11:10:01 +02:00
BDFDB . ColorUtils . getSwatchColor = function ( container , number ) {
if ( ! Node . prototype . isPrototypeOf ( container ) ) return ;
2019-11-10 23:44:01 +01:00
var swatches = container . querySelector ( ` ${ BDFDB . dotCN . colorpickerswatches } [number=" ${ number } "], ${ BDFDB . dotCN . colorpickerswatch } [number=" ${ number } "] ` ) ;
2019-10-23 11:10:01 +02:00
if ( ! swatches ) return null ;
2019-11-10 23:44:01 +01:00
var ins = BDFDB . ReactUtils . getInstance ( swatches ) ;
2019-11-25 13:42:12 +01:00
if ( ins ) return BDFDB . ColorUtils . convert ( BDFDB . ReactUtils . findValue ( ins , "selectedColor" , { up : true , blacklist : { "props" : true } } ) ) ;
2019-10-23 11:10:01 +02:00
else { // REMOVE ONCE REWRITTEN
var swatch = swatches . querySelector ( ` ${ BDFDB . dotCN . colorpickerswatch + BDFDB . dotCN . colorpickerswatchselected } ` ) ;
2019-11-25 13:42:12 +01:00
return swatch ? BDFDB . ColorUtils . convert ( swatch . gradient || swatch . style . getPropertyValue ( "background-color" ) , "RGBCOMP" ) : null ;
2019-10-18 10:56:41 +02:00
}
} ;
2019-11-10 23:44:01 +01:00
BDFDB . ColorUtils . openPicker = function ( container , target , color , options = { gradient : true , alpha : true , callback : _ => { } } ) {
2019-10-23 11:10:01 +02:00
if ( ! container || ! target ) return ;
if ( typeof options . callback != "function" ) options . callback = _ => { } ;
var hexformat = options . alpha ? "HEXA" : "HEX" ;
var hexregex = options . alpha ? /^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i : /^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i ;
var isreact = BDFDB . ObjectUtils . is ( container ) && ! ! container . _reactInternalFiber ;
var isswatches = ! isreact && BDFDB . DOMUtils . containsClass ( container , "swatches" ) ;
var isgradient = color && BDFDB . ObjectUtils . is ( color ) ;
var selectedcolor = BDFDB . ColorUtils . convert ( isgradient ? color [ Object . keys ( color ) [ 0 ] ] : color , hexformat ) || ( options . alpha ? "#000000FF" : "#000000" ) ;
var [ h , s , l ] = BDFDB . ColorUtils . convert ( selectedcolor , "HSLCOMP" ) ;
var a = BDFDB . ColorUtils . getAlpha ( isgradient ? color [ Object . keys ( color ) [ 0 ] ] : color ) ;
a = a == null ? 1 : a ;
var targetrects = BDFDB . DOMUtils . getRects ( target ) ;
var colorPicker = BDFDB . DOMUtils . create ( ` <div role="dialog" class="BDFDB-colorpicker ${ BDFDB . disCNS . popoutnoarrow + BDFDB . disCNS . popoutnoshadow + BDFDB . disCNS . popout + BDFDB . disCNS . popoutbottom + BDFDB . disCNS . popoutarrowalignmenttop + BDFDB . disCN . themeundefined } " style="z-index: 2001; visibility: visible; left: ${ targetrects . left + targetrects . width / 2 } px; top: ${ targetrects . top + targetrects . height } px; transform: translateX(-50%) translateY(0%) translateZ(0px);"><div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . vertical + BDFDB . disCNS . justifystart + BDFDB . disCNS . alignstretch + BDFDB . disCNS . nowrap + BDFDB . disCN . colorpicker } " style="flex: 1 1 auto;"><div class=" ${ BDFDB . disCN . colorpickerinner } "><div class=" ${ BDFDB . disCN . colorpickersaturation } "><div class="saturation-color" style="position: absolute; top: 0px; right: 0px; bottom: 0px; left: 0px; background: ${ BDFDB . ColorUtils . convert ( [ h , "100%" , "100%" ] , "RGB" ) } !important;"><style>.saturation-white {background: -webkit-linear-gradient(to right, #fff, rgba(255,255,255,0));background: linear-gradient(to right, #fff, rgba(255,255,255,0));}.saturation-black {background: -webkit-linear-gradient(to top, #000, rgba(0,0,0,0));background: linear-gradient(to top, #000, rgba(0,0,0,0));}</style><div class="saturation-white" style="position: absolute; top: 0px; right: 0px; bottom: 0px; left: 0px;"><div class="saturation-black" style="position: absolute; top: 0px; right: 0px; bottom: 0px; left: 0px;"></div><div class="saturation-cursor" style="position: absolute; top: 55.2941%; left: 44.7368%; cursor: default;"><div style="width: 4px; height: 4px; box-shadow: rgb(255, 255, 255) 0px 0px 0px 1.5px, rgba(0, 0, 0, 0.3) 0px 0px 1px 1px inset, rgba(0, 0, 0, 0.4) 0px 0px 1px 2px; border-radius: 50%; transform: translate(-2px, -2px);"></div></div></div></div></div><div class=" ${ BDFDB . disCN . colorpickerhue } "><div style="position: absolute; top: 0px; right: 0px; bottom: 0px; left: 0px;"><div class="hue-horizontal" style="padding: 0px 2px; position: relative; height: 100%;"><style>.hue-horizontal {background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);background: -webkit-linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);}.hue-vertical {background: linear-gradient(to top, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);background: -webkit-linear-gradient(to top, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);}</style><div class="hue-cursor" style="position: absolute; left: 0%;"><div style="margin-top: -4px !important; width: 4px; border-radius: 1px; height: 8px; box-shadow: rgba(0, 0, 0, 0.6) 0px 0px 2px; background: rgb(255, 255, 255); transform: translateX(-2px);"></div></div></div></div></div><div class="alpha-bar" style="position: relative; height: 8px; margin: 16px 0 8px;"><div style="position: absolute; top: 0px; right: 0px; bottom: 0px; left: 0px;"><div class="alpha-checker" style="padding: 0px 2px; position: relative; height: 100%; background-color: transparent;"></div></div><div style="position: absolute; top: 0px; right: 0px; bottom: 0px; left: 0px;"><div class="alpha-horizontal" style="padding: 0px 2px; position: relative; height: 100%;"><div class="alpha-cursor" style="position: absolute; left: 0%;"><div style="margin-top: -4px; width: 8px; border-radius: 3px; height: 16px; box-shadow: rgba(0, 0, 0, 0.6) 0px 0px 2px; background: rgb(255, 255, 255); transform: translateX(-2px);"></div></div></div></div></div><div class="gradient-bar" style="position: relative; height: 8px; margin: 27px 2px 2px 2px; ${ ! isgradient ? " display: none;" : "" } "><div style="position: absolute; top: 0px; right: 0px; bottom: 0px; left: 0px;"><div class="alpha-checker" style="padding: 0px 2px; position: relative; height: 100%; background-color: transparent;"></div></div><div style="position: absolute; top: 0px; right: 0px; bottom: 0px; left: 0px;"><div class="gradient-horizontal" style="padding: 0px 2px; position: relative; height: 100%; background-color: ${ selectedcolor } ;"><
document . querySelector ( BDFDB . dotCN . popouts ) . appendChild ( colorPicker ) ;
2019-10-18 10:56:41 +02:00
2019-10-23 11:10:01 +02:00
var removePopout = e => {
if ( ! colorPicker . contains ( e . target ) ) {
document . removeEventListener ( "mousedown" , removePopout ) ;
colorPicker . remove ( ) ;
2019-10-18 10:56:41 +02:00
}
2019-10-23 11:10:01 +02:00
} ;
document . addEventListener ( "mousedown" , removePopout ) ;
2019-10-18 10:56:41 +02:00
2019-10-23 11:10:01 +02:00
var hexinput = colorPicker . querySelector ( BDFDB . dotCNS . colorpickerhexinput + BDFDB . dotCN . input ) ;
var satpane = colorPicker . querySelector ( ".saturation-color" ) ;
var satcursor = colorPicker . querySelector ( ".saturation-cursor" ) ;
var huepane = colorPicker . querySelector ( ".hue-horizontal" ) ;
var huecursor = colorPicker . querySelector ( ".hue-cursor" ) ;
var alphabar = colorPicker . querySelector ( ".alpha-bar" ) ;
var alphapane = colorPicker . querySelector ( ".alpha-horizontal" ) ;
var alphacursor = colorPicker . querySelector ( ".alpha-cursor" ) ;
var gradientbutton = colorPicker . querySelector ( ".gradient-button" ) ;
var gradientbar = colorPicker . querySelector ( ".gradient-bar" ) ;
var gradientpane = colorPicker . querySelector ( ".gradient-horizontal" ) ;
2019-10-18 10:56:41 +02:00
2019-10-23 11:10:01 +02:00
var sMinX , sMaxX , sMinY , sMaxY , hMinX , hMaxX , aMinX , aMaxX , gMinX , gMaxX ;
2019-10-18 10:56:41 +02:00
2019-10-23 11:10:01 +02:00
updateRects ( ) ;
2019-10-18 10:56:41 +02:00
2019-10-23 11:10:01 +02:00
if ( isgradient ) for ( let pos in color ) if ( pos > 0 && pos < 1 ) gradientpane . appendChild ( BDFDB . DOMUtils . create ( ` <div class="gradient-cursor" style="position: absolute; left: ${ pos * 100 } %;"><div style="background-color: ${ color [ pos ] } !important;"></div></div> ` ) ) ;
2019-10-18 10:56:41 +02:00
2019-10-23 11:10:01 +02:00
updateColors ( false ) ;
if ( ! options . gradient ) BDFDB . DOMUtils . remove ( colorPicker . querySelectorAll ( ".gradient-button, .gradient-bar" ) ) ;
if ( ! options . alpha ) BDFDB . DOMUtils . remove ( colorPicker . querySelectorAll ( ".alpha-bar" ) ) ;
BDFDB . ListenerUtils . addToChildren ( colorPicker , "mousedown" , ".move-corner" , e => {
var rects = BDFDB . DOMUtils . getRects ( colorPicker ) ;
var transform = getComputedStyle ( colorPicker , null ) . getPropertyValue ( "transform" ) . replace ( /[^0-9,-]/g , "" ) . split ( "," ) ;
var left = rects . left - ( transform . length > 4 ? parseFloat ( transform [ 4 ] ) : 0 ) ;
var top = rects . top - ( transform . length > 4 ? parseFloat ( transform [ 5 ] ) : 0 ) ;
var oldX = e . pageX ;
var oldY = e . pageY ;
var mouseup = _ => {
BDFDB . DOMUtils . removeLocalStyle ( "disableTextSelection" ) ;
document . removeEventListener ( "mouseup" , mouseup ) ;
document . removeEventListener ( "mousemove" , mousemove ) ;
} ;
var mousemove = e2 => {
left = left - ( oldX - e2 . pageX ) ;
top = top - ( oldY - e2 . pageY ) ;
oldX = e2 . pageX ;
oldY = e2 . pageY ;
colorPicker . style . setProperty ( "left" , left + "px" , "important" ) ;
colorPicker . style . setProperty ( "top" , top + "px" , "important" ) ;
updateRects ( ) ;
} ;
document . addEventListener ( "mouseup" , mouseup ) ;
document . addEventListener ( "mousemove" , mousemove ) ;
} ) ;
satpane . addEventListener ( "mousedown" , e => {
s = BDFDB . NumberUtils . mapRange ( [ sMinX , sMaxX ] , [ 0 , 100 ] , e . clientX ) + "%" ;
l = BDFDB . NumberUtils . mapRange ( [ sMinY , sMaxY ] , [ 100 , 0 ] , e . clientY ) + "%" ;
updateColors ( true ) ;
var mouseup = _ => {
document . removeEventListener ( "mouseup" , mouseup ) ;
document . removeEventListener ( "mousemove" , mousemove ) ;
} ;
var mousemove = e2 => {
s = BDFDB . NumberUtils . mapRange ( [ sMinX , sMaxX ] , [ 0 , 100 ] , e2 . clientX ) + "%" ;
l = BDFDB . NumberUtils . mapRange ( [ sMinY , sMaxY ] , [ 100 , 0 ] , e2 . clientY ) + "%" ;
updateColors ( true ) ;
} ;
document . addEventListener ( "mouseup" , mouseup ) ;
document . addEventListener ( "mousemove" , mousemove ) ;
} ) ;
huepane . addEventListener ( "mousedown" , e => {
h = BDFDB . NumberUtils . mapRange ( [ hMinX , hMaxX ] , [ 0 , 360 ] , e . clientX ) ;
updateColors ( true ) ;
var mouseup = _ => {
document . removeEventListener ( "mouseup" , mouseup ) ;
document . removeEventListener ( "mousemove" , mousemove ) ;
} ;
var mousemove = e2 => {
h = BDFDB . NumberUtils . mapRange ( [ hMinX , hMaxX ] , [ 0 , 360 ] , e2 . clientX ) ;
updateColors ( true ) ;
} ;
document . addEventListener ( "mouseup" , mouseup ) ;
document . addEventListener ( "mousemove" , mousemove ) ;
} ) ;
alphapane . addEventListener ( "mousedown" , e => {
a = BDFDB . NumberUtils . mapRange ( [ aMinX , aMaxX ] , [ 0 , 1 ] , e . clientX ) ;
updateColors ( true ) ;
var bubble = BDFDB . DOMUtils . create ( ` <span class=" ${ BDFDB . disCN . sliderbubble } " style="opacity: 1 !important; left: -24px !important;"></span> ` ) ;
var mouseup = _ => {
bubble . remove ( ) ;
document . removeEventListener ( "mouseup" , mouseup ) ;
document . removeEventListener ( "mousemove" , mousemove ) ;
} ;
var mousemove = e2 => {
if ( ! bubble . parentElement ) alphacursor . appendChild ( bubble ) ;
a = Math . floor ( BDFDB . NumberUtils . mapRange ( [ aMinX , aMaxX ] , [ 0 , 100 ] , e2 . clientX ) ) / 100 ;
bubble . innerText = a ;
updateColors ( true ) ;
} ;
document . addEventListener ( "mouseup" , mouseup ) ;
document . addEventListener ( "mousemove" , mousemove ) ;
} ) ;
gradientpane . addEventListener ( "mousedown" , e => {
2019-11-01 10:14:50 +01:00
BDFDB . TimeUtils . timeout ( _ => {
2019-10-23 11:10:01 +02:00
if ( BDFDB . DOMUtils . containsClass ( e . target . parentElement , "gradient-cursor" ) ) {
if ( e . which == 1 ) {
if ( ! BDFDB . DOMUtils . containsClass ( e . target . parentElement , "selected" ) ) {
BDFDB . DOMUtils . removeClass ( gradientpane . querySelectorAll ( ".gradient-cursor.selected" ) , "selected" ) ;
BDFDB . DOMUtils . addClass ( e . target . parentElement , "selected" ) ;
[ h , s , l ] = BDFDB . ColorUtils . convert ( e . target . style . getPropertyValue ( "background-color" ) , "HSLCOMP" ) ;
a = BDFDB . ColorUtils . getAlpha ( e . target . style . getPropertyValue ( "background-color" ) ) ;
updateColors ( true ) ;
}
if ( ! BDFDB . DOMUtils . containsClass ( e . target . parentElement , "edge" ) ) {
var mouseup = _ => {
document . removeEventListener ( "mouseup" , mouseup ) ;
document . removeEventListener ( "mousemove" , mousemove ) ;
} ;
var mousemove = e2 => {
e . target . parentElement . style . setProperty ( "left" , BDFDB . NumberUtils . mapRange ( [ gMinX , gMaxX ] , [ 1 , 99 ] , e2 . clientX ) + "%" ) ;
updateGradient ( ) ;
} ;
document . addEventListener ( "mouseup" , mouseup ) ;
document . addEventListener ( "mousemove" , mousemove ) ;
}
}
else if ( e . which == 3 && ! BDFDB . DOMUtils . containsClass ( e . target . parentElement , "edge" ) ) {
BDFDB . DOMUtils . remove ( e . target . parentElement ) ;
if ( BDFDB . DOMUtils . containsClass ( e . target . parentElement , "selected" ) ) {
var firstcursor = gradientpane . querySelector ( ".gradient-cursor" ) ;
BDFDB . DOMUtils . addClass ( firstcursor , "selected" ) ;
[ h , s , l ] = BDFDB . ColorUtils . convert ( firstcursor . firstElementChild . style . getPropertyValue ( "background-color" ) , "HSLCOMP" ) ;
a = BDFDB . ColorUtils . getAlpha ( firstElementChild . style . getPropertyValue ( "background-color" ) ) ;
}
updateColors ( true ) ;
}
}
else if ( gradientpane == e . target && e . which == 1 ) {
BDFDB . DOMUtils . removeClass ( gradientpane . querySelectorAll ( ".gradient-cursor.selected" ) , "selected" ) ;
var newcursor = BDFDB . DOMUtils . create ( ` <div class="gradient-cursor selected" style="position: absolute; left: ${ BDFDB . NumberUtils . mapRange ( [ gMinX , gMaxX ] , [ 1 , 99 ] , e . clientX ) } %;"><div style="background-color: rgba(0, 0, 0, 1) !important;"></div></div> ` ) ;
gradientpane . appendChild ( newcursor ) ;
[ h , s , l ] = [ 0 , "0%" , "0%" ] ;
a = 1 ;
updateColors ( true ) ;
var mouseup = _ => {
document . removeEventListener ( "mouseup" , mouseup ) ;
document . removeEventListener ( "mousemove" , mousemove ) ;
} ;
var mousemove = e2 => {
newcursor . style . setProperty ( "left" , BDFDB . NumberUtils . mapRange ( [ gMinX , gMaxX ] , [ 1 , 99 ] , e2 . clientX ) + "%" ) ;
updateGradient ( ) ;
} ;
document . addEventListener ( "mouseup" , mouseup ) ;
document . addEventListener ( "mousemove" , mousemove ) ;
}
} ) ;
} ) ;
hexinput . addEventListener ( "input" , e => {
if ( hexregex . test ( hexinput . value ) ) {
[ h , s , l , a ] = BDFDB . ColorUtils . convert ( hexinput . value , "HSLCOMP" ) ;
if ( a == null ) a = 1 ;
updateColors ( false ) ;
2019-10-18 10:56:41 +02:00
}
2019-10-23 11:10:01 +02:00
} ) ;
gradientbutton . addEventListener ( "click" , e => {
isgradient = ! isgradient ;
BDFDB . DOMUtils . toggle ( gradientbar , isgradient ) ;
BDFDB . DOMUtils . toggleClass ( gradientbutton , "selected" , isgradient ) ;
updateColors ( true ) ;
} ) ;
gradientbutton . addEventListener ( "mouseenter" , e => {
BDFDB . TooltipUtils . create ( gradientbutton , "Color Gradient" , { type : "bottom" } ) ;
} ) ;
function updateRects ( ) {
var satpanerects = BDFDB . DOMUtils . getRects ( satpane ) ;
sMinX = satpanerects . left ;
sMaxX = sMinX + satpanerects . width ;
sMinY = satpanerects . top ;
sMaxY = sMinY + satpanerects . height ;
var huepanerects = BDFDB . DOMUtils . getRects ( huepane ) ;
hMinX = huepanerects . left ;
hMaxX = hMinX + huepanerects . width ;
var alphapanerects = BDFDB . DOMUtils . getRects ( alphapane ) ;
aMinX = alphapanerects . left ;
aMaxX = aMinX + alphapanerects . width ;
var gradientpanerects = BDFDB . DOMUtils . getRects ( gradientpane ) ;
gMinX = gradientpanerects . left ;
gMaxX = gMinX + gradientpanerects . width ;
}
function updateColors ( setinput ) {
satpane . style . setProperty ( "background" , BDFDB . ColorUtils . convert ( [ h , "100%" , "100%" ] , "RGB" ) , "important" ) ;
satcursor . style . setProperty ( "left" , s , "important" ) ;
satcursor . style . setProperty ( "top" , BDFDB . NumberUtils . mapRange ( [ 0 , 100 ] , [ 100 , 0 ] , parseFloat ( l ) ) + "%" , "important" ) ;
huecursor . style . setProperty ( "left" , BDFDB . NumberUtils . mapRange ( [ 0 , 360 ] , [ 0 , 100 ] , h ) + "%" , "important" ) ;
alphapane . style . setProperty ( "background" , ` linear-gradient(to right, ${ BDFDB . ColorUtils . setAlpha ( [ h , s , l ] , 0 , "RGBA" ) } , ${ BDFDB . ColorUtils . setAlpha ( [ h , s , l ] , 1 , "RGBA" ) } ` , "important" ) ;
alphacursor . style . setProperty ( "left" , ( a * 100 ) + "%" , "important" ) ;
var hex = BDFDB . ColorUtils . convert ( [ h , s , l , a ] , hexformat ) ;
var rgb = BDFDB . ColorUtils . convert ( hex , "RGBA" ) ;
if ( isreact ) {
if ( isgradient ) {
gradientpane . querySelector ( ".gradient-cursor.selected" ) . firstElementChild . style . setProperty ( "background-color" , rgb ) ;
updateGradient ( ) ;
}
2019-11-10 23:44:01 +01:00
else {
container . setState ( {
selectedColor : rgb ,
customColor : rgb
} ) ;
if ( container . refInput ) {
container . refInput . props . value = ! rgb ? "" : ( container . state . compMode ? BDFDB . ColorUtils . convert ( rgb , "RGBCOMP" ) . slice ( 0 , 3 ) . join ( "," ) : rgb ) ;
BDFDB . ReactUtils . forceUpdate ( container . refInput ) ;
}
}
2019-10-23 11:10:01 +02:00
}
else if ( isswatches ) {
2019-11-10 23:44:01 +01:00
setSwatch ( container . querySelector ( BDFDB . dotCN . colorpickerswatch + BDFDB . dotCN . colorpickerswatchselected ) , null , false ) ;
2019-10-23 11:10:01 +02:00
if ( isgradient ) {
gradientpane . querySelector ( ".gradient-cursor.selected" ) . firstElementChild . style . setProperty ( "background-color" , rgb ) ;
updateGradient ( ) ;
}
else setSwatch ( container . querySelector ( BDFDB . dotCN . colorpickerswatch + BDFDB . dotCN . colorpickerswatch ) , rgb , true ) ;
}
if ( setinput ) hexinput . value = hex ;
options . callback ( rgb ) ;
}
function updateGradient ( ) {
gradientpane . style . removeProperty ( "background-color" ) ;
var gradient = { } ;
for ( let cursor of gradientpane . querySelectorAll ( ".gradient-cursor" ) ) gradient [ parseFloat ( cursor . style . getPropertyValue ( "left" ) ) / 100 ] = cursor . firstElementChild . style . getPropertyValue ( "background-color" ) ;
gradientpane . style . setProperty ( "background-image" , BDFDB . ColorUtils . createGradient ( gradient ) ) ;
if ( isreact ) container . setState ( {
selectedColor : gradient ,
customColor : gradient
} ) ;
else setSwatch ( container . querySelector ( BDFDB . dotCN . colorpickerswatch + BDFDB . dotCN . colorpickerswatch ) , gradient , true ) ;
2019-10-18 10:56:41 +02:00
}
} ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils = { } ;
2019-12-06 16:22:12 +01:00
BDFDB . DOMUtils . getSelection = function ( ) {
let selection = document . getSelection ( ) ;
return selection && selection . anchorNode ? selection . getRangeAt ( 0 ) . toString ( ) : "" ;
} ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . addClass = function ( eles , ... classes ) {
2019-10-18 10:56:41 +02:00
if ( ! eles || ! classes ) return ;
2019-11-22 14:26:12 +01:00
for ( let ele of [ eles ] . flat ( 10 ) . filter ( n => n ) ) {
2019-11-14 17:40:04 +01:00
if ( Node . prototype . isPrototypeOf ( ele ) ) add ( ele ) ;
2019-10-18 10:56:41 +02:00
else if ( NodeList . prototype . isPrototypeOf ( ele ) ) for ( let e of ele ) add ( e ) ;
else if ( typeof ele == "string" ) for ( let e of ele . split ( "," ) ) if ( e && ( e = e . trim ( ) ) ) for ( let n of document . querySelectorAll ( e ) ) add ( n ) ;
}
function add ( node ) {
2019-11-22 14:26:12 +01:00
if ( node && node . classList ) for ( let cla of classes ) for ( let cl of [ cla ] . flat ( 10 ) . filter ( n => n ) ) if ( typeof cl == "string" ) for ( let c of cl . split ( " " ) ) if ( c ) node . classList . add ( c ) ;
2019-10-18 10:56:41 +02:00
}
} ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . removeClass = function ( eles , ... classes ) {
2019-10-18 10:56:41 +02:00
if ( ! eles || ! classes ) return ;
2019-11-22 14:26:12 +01:00
for ( let ele of [ eles ] . flat ( 10 ) . filter ( n => n ) ) {
2019-11-14 17:40:04 +01:00
if ( Node . prototype . isPrototypeOf ( ele ) ) remove ( ele ) ;
2019-10-18 10:56:41 +02:00
else if ( NodeList . prototype . isPrototypeOf ( ele ) ) for ( let e of ele ) remove ( e ) ;
else if ( typeof ele == "string" ) for ( let e of ele . split ( "," ) ) if ( e && ( e = e . trim ( ) ) ) for ( let n of document . querySelectorAll ( e ) ) remove ( n ) ;
}
function remove ( node ) {
2019-11-22 14:26:12 +01:00
if ( node && node . classList ) for ( let cla of classes ) for ( let cl of [ cla ] . flat ( 10 ) . filter ( n => n ) ) if ( typeof cl == "string" ) for ( let c of cl . split ( " " ) ) if ( c ) node . classList . remove ( c ) ;
2019-10-18 10:56:41 +02:00
}
} ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . toggleClass = function ( eles , ... classes ) {
2019-10-18 10:56:41 +02:00
if ( ! eles || ! classes ) return ;
var force = classes . pop ( ) ;
if ( typeof force != "boolean" ) {
classes . push ( force ) ;
force = undefined ;
}
if ( ! classes . length ) return ;
2019-11-22 14:26:12 +01:00
for ( let ele of [ eles ] . flat ( 10 ) . filter ( n => n ) ) {
2019-10-18 10:56:41 +02:00
if ( ! ele ) { }
else if ( Node . prototype . isPrototypeOf ( ele ) ) toggle ( ele ) ;
else if ( NodeList . prototype . isPrototypeOf ( ele ) ) for ( let e of ele ) toggle ( e ) ;
else if ( typeof ele == "string" ) for ( let e of ele . split ( "," ) ) if ( e && ( e = e . trim ( ) ) ) for ( let n of document . querySelectorAll ( e ) ) toggle ( n ) ;
}
function toggle ( node ) {
2019-11-22 14:26:12 +01:00
if ( node && node . classList ) for ( let cla of classes ) for ( let cl of [ cla ] . flat ( 10 ) . filter ( n => n ) ) if ( typeof cl == "string" ) for ( let c of cl . split ( " " ) ) if ( c ) node . classList . toggle ( c , force ) ;
2019-10-18 10:56:41 +02:00
}
} ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . containsClass = function ( eles , ... classes ) {
2019-10-18 10:56:41 +02:00
if ( ! eles || ! classes ) return ;
var all = classes . pop ( ) ;
if ( typeof all != "boolean" ) {
classes . push ( all ) ;
all = true ;
}
if ( ! classes . length ) return ;
var contained = undefined ;
2019-10-18 14:56:41 +02:00
for ( let ele of BDFDB . ArrayUtils . is ( eles ) ? eles : Array . of ( eles ) ) {
2019-10-18 10:56:41 +02:00
if ( ! ele ) { }
else if ( Node . prototype . isPrototypeOf ( ele ) ) contains ( ele ) ;
else if ( NodeList . prototype . isPrototypeOf ( ele ) ) for ( let e of ele ) contains ( e ) ;
else if ( typeof ele == "string" ) for ( let c of ele . split ( "," ) ) if ( c && ( c = c . trim ( ) ) ) for ( let n of document . querySelectorAll ( c ) ) contains ( n ) ;
}
return contained ;
function contains ( node ) {
if ( node && node . classList ) for ( let cla of classes ) if ( typeof cla == "string" ) for ( let c of cla . split ( " " ) ) if ( c ) {
if ( contained === undefined ) contained = all ;
if ( all && ! node . classList . contains ( c ) ) contained = false ;
if ( ! all && node . classList . contains ( c ) ) contained = true ;
}
}
} ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . replaceClass = function ( eles , oldclass , newclass ) {
2019-10-18 10:56:41 +02:00
if ( ! eles || typeof oldclass != "string" || typeof newclass != "string" ) return ;
2019-11-22 14:26:12 +01:00
for ( let ele of [ eles ] . flat ( 10 ) . filter ( n => n ) ) {
2019-11-14 17:40:04 +01:00
if ( Node . prototype . isPrototypeOf ( ele ) ) replace ( ele ) ;
2019-10-18 10:56:41 +02:00
else if ( NodeList . prototype . isPrototypeOf ( ele ) ) for ( let e of ele ) replace ( e ) ;
else if ( typeof ele == "string" ) for ( let e of ele . split ( "," ) ) if ( e && ( e = e . trim ( ) ) ) for ( let n of document . querySelectorAll ( e ) ) replace ( n ) ;
}
function replace ( node ) {
if ( node && node . tagName && node . className ) node . className = node . className . replace ( new RegExp ( oldclass , "g" ) , newclass ) . trim ( ) ;
}
} ;
2019-10-27 19:48:03 +01:00
BDFDB . DOMUtils . formatClassName = function ( ... classes ) {
2019-11-22 14:26:12 +01:00
return BDFDB . ArrayUtils . removeCopies ( classes . flat ( 10 ) . filter ( n => n ) . join ( " " ) . split ( " " ) ) . join ( " " ) . trim ( ) ;
2019-10-27 19:48:03 +01:00
} ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . removeClassFromDOM = function ( ... classes ) {
2019-11-22 14:26:12 +01:00
for ( let c of classes . flat ( 10 ) . filter ( n => n ) ) if ( typeof c == "string" ) for ( let a of c . split ( "," ) ) if ( a && ( a = a . replace ( /\.|\s/g , "" ) ) ) BDFDB . DOMUtils . removeClass ( document . querySelectorAll ( "." + a ) , a ) ;
2019-10-23 11:10:01 +02:00
} ;
BDFDB . DOMUtils . show = function ( ... eles ) {
2019-10-23 12:42:11 +02:00
BDFDB . DOMUtils . toggle ( ... eles , true ) ;
2019-10-23 11:10:01 +02:00
} ;
BDFDB . DOMUtils . hide = function ( ... eles ) {
2019-10-23 12:42:11 +02:00
BDFDB . DOMUtils . toggle ( ... eles , false ) ;
2019-10-23 11:10:01 +02:00
} ;
BDFDB . DOMUtils . toggle = function ( ... eles ) {
if ( ! eles ) return ;
var force = eles . pop ( ) ;
if ( typeof force != "boolean" ) {
eles . push ( force ) ;
force = undefined ;
}
if ( ! eles . length ) return ;
2019-11-22 14:26:12 +01:00
for ( let ele of eles . flat ( 10 ) . filter ( n => n ) ) {
2019-10-27 19:48:03 +01:00
if ( Node . prototype . isPrototypeOf ( ele ) ) toggle ( ele ) ;
else if ( NodeList . prototype . isPrototypeOf ( ele ) ) for ( let node of ele ) toggle ( node ) ;
else if ( typeof ele == "string" ) for ( let c of ele . split ( "," ) ) if ( c && ( c = c . trim ( ) ) ) for ( let node of document . querySelectorAll ( c ) ) toggle ( node ) ;
2019-10-23 11:10:01 +02:00
}
function toggle ( node ) {
if ( ! node || ! Node . prototype . isPrototypeOf ( node ) ) return ;
var hidden = force === undefined ? ! BDFDB . DOMUtils . isHidden ( node ) : ! force ;
if ( hidden ) node . style . setProperty ( "display" , "none" , "important" ) ;
else node . style . removeProperty ( "display" ) ;
}
} ;
BDFDB . DOMUtils . isHidden = function ( node ) {
if ( Node . prototype . isPrototypeOf ( node ) && node . nodeType != Node . TEXT _NODE ) return getComputedStyle ( node , null ) . getPropertyValue ( "display" ) == "none" ;
} ;
BDFDB . DOMUtils . remove = function ( ... eles ) {
2019-11-22 14:26:12 +01:00
for ( let ele of eles . flat ( 10 ) . filter ( n => n ) ) {
2019-10-27 19:48:03 +01:00
if ( Node . prototype . isPrototypeOf ( ele ) ) ele . remove ( ) ;
else if ( NodeList . prototype . isPrototypeOf ( ele ) ) {
let nodes = Array . from ( ele ) ;
while ( nodes . length ) nodes . shift ( ) . remove ( ) ;
2019-10-23 11:10:01 +02:00
}
2019-10-27 19:48:03 +01:00
else if ( typeof ele == "string" ) for ( let c of ele . split ( "," ) ) if ( c && ( c = c . trim ( ) ) ) {
let nodes = Array . from ( document . querySelectorAll ( c ) ) ;
while ( nodes . length ) nodes . shift ( ) . remove ( ) ;
2019-10-23 11:10:01 +02:00
}
}
} ;
BDFDB . DOMUtils . create = function ( html ) {
if ( typeof html != "string" || ! html . trim ( ) ) return null ;
let template = document . createElement ( "template" ) ;
try { template . innerHTML = html . replace ( /(?<!pre)>[\t\r\n]+<(?!pre)/g , "><" ) ; }
catch ( err ) { template . innerHTML = html . replace ( />[\t\r\n]+<(?!pre)/g , "><" ) ; }
2019-11-06 23:57:43 +01:00
if ( template . content . childNodes . length == 1 ) return template . content . firstElementChild ;
2019-10-23 11:10:01 +02:00
else {
var wrapper = document . createElement ( "span" ) ;
var nodes = Array . from ( template . content . childNodes ) ;
while ( nodes . length ) wrapper . appendChild ( nodes . shift ( ) ) ;
return wrapper ;
}
} ;
BDFDB . DOMUtils . getParent = function ( listOrSelector , node ) {
var parent = null ;
if ( Node . prototype . isPrototypeOf ( node ) && listOrSelector ) {
var list = NodeList . prototype . isPrototypeOf ( listOrSelector ) ? listOrSelector : typeof listOrSelector == "string" ? document . querySelectorAll ( listOrSelector ) : null ;
if ( list ) for ( let listnode of list ) if ( listnode . contains ( node ) ) {
parent = listnode ;
break ;
}
}
return parent ;
} ;
BDFDB . DOMUtils . setText = function ( node , stringOrNode ) {
if ( ! node || ! Node . prototype . isPrototypeOf ( node ) ) return ;
var textnode = node . nodeType == Node . TEXT _NODE ? node : null ;
if ( ! textnode ) for ( let child of node . childNodes ) if ( child . nodeType == Node . TEXT _NODE || BDFDB . DOMUtils . containsClass ( child , "BDFDB-textnode" ) ) {
textnode = child ;
break ;
}
if ( textnode ) {
if ( Node . prototype . isPrototypeOf ( stringOrNode ) && stringOrNode . nodeType != Node . TEXT _NODE ) {
BDFDB . DOMUtils . addClass ( stringOrNode , "BDFDB-textnode" ) ;
node . replaceChild ( stringOrNode , textnode ) ;
}
else if ( Node . prototype . isPrototypeOf ( textnode ) && textnode . nodeType != Node . TEXT _NODE ) node . replaceChild ( document . createTextNode ( stringOrNode ) , textnode ) ;
else textnode . textContent = stringOrNode ;
}
else node . appendChild ( Node . prototype . isPrototypeOf ( stringOrNode ) ? stringOrNode : document . createTextNode ( stringOrNode ) ) ;
} ;
BDFDB . DOMUtils . getText = function ( node ) {
if ( ! node || ! Node . prototype . isPrototypeOf ( node ) ) return ;
for ( let child of node . childNodes ) if ( child . nodeType == Node . TEXT _NODE ) return child . textContent ;
} ;
BDFDB . DOMUtils . getRects = function ( node ) {
var rects = { } ;
if ( Node . prototype . isPrototypeOf ( node ) && node . nodeType != Node . TEXT _NODE ) {
var hidenode = node ;
while ( hidenode ) {
var hidden = BDFDB . DOMUtils . isHidden ( hidenode ) ;
if ( hidden ) {
BDFDB . DOMUtils . toggle ( hidenode , true ) ;
hidenode . BDFDBgetRectsHidden = true ;
}
hidenode = hidenode . parentElement ;
}
rects = node . getBoundingClientRect ( ) ;
hidenode = node ;
while ( hidenode ) {
if ( hidenode . BDFDBgetRectsHidden ) {
BDFDB . DOMUtils . toggle ( hidenode , false ) ;
delete hidenode . BDFDBgetRectsHidden ;
}
hidenode = hidenode . parentElement ;
}
}
return rects ;
} ;
BDFDB . DOMUtils . getHeight = function ( node ) {
if ( Node . prototype . isPrototypeOf ( node ) && node . nodeType != Node . TEXT _NODE ) {
var rects = BDFDB . DOMUtils . getRects ( node ) ;
var style = getComputedStyle ( node ) ;
return rects . height + parseInt ( style . marginTop ) + parseInt ( style . marginBottom ) ;
2019-10-18 10:56:41 +02:00
}
2019-10-23 11:10:01 +02:00
return 0 ;
2019-10-18 10:56:41 +02:00
} ;
2020-01-05 18:31:12 +01:00
BDFDB . DOMUtils . getInnerHeight = function ( node ) {
if ( Node . prototype . isPrototypeOf ( node ) && node . nodeType != Node . TEXT _NODE ) {
let rects = BDFDB . DOMUtils . getRects ( node ) ;
let style = getComputedStyle ( node ) ;
return rects . height - parseInt ( style . paddingTop ) - parseInt ( style . paddingBottom ) ;
}
return 0 ;
} ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . getWidth = function ( node ) {
if ( Node . prototype . isPrototypeOf ( node ) && node . nodeType != Node . TEXT _NODE ) {
2020-01-05 18:31:12 +01:00
let rects = BDFDB . DOMUtils . getRects ( node ) ;
let style = getComputedStyle ( node ) ;
2019-10-23 11:10:01 +02:00
return rects . width + parseInt ( style . marginLeft ) + parseInt ( style . marginRight ) ;
2019-10-18 10:56:41 +02:00
}
2019-10-23 11:10:01 +02:00
return 0 ;
2019-10-18 10:56:41 +02:00
} ;
2020-01-05 18:31:12 +01:00
BDFDB . DOMUtils . getInnerWidth = function ( node ) {
if ( Node . prototype . isPrototypeOf ( node ) && node . nodeType != Node . TEXT _NODE ) {
let rects = BDFDB . DOMUtils . getRects ( node ) ;
let style = getComputedStyle ( node ) ;
return rects . width - parseInt ( style . paddingLeft ) - parseInt ( style . paddingRight ) ;
}
return 0 ;
} ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . appendWebScript = function ( path , container ) {
if ( ! container && ! document . head . querySelector ( "bd-head bd-scripts" ) ) document . head . appendChild ( BDFDB . DOMUtils . create ( ` <bd-head><bd-scripts></bd-scripts></bd-head> ` ) ) ;
container = container || document . head . querySelector ( "bd-head bd-scripts" ) || document . head ;
container = Node . prototype . isPrototypeOf ( container ) ? container : document . head ;
BDFDB . DOMUtils . removeWebScript ( path , container ) ;
container . appendChild ( BDFDB . DOMUtils . create ( ` <script src=" ${ path } "></script> ` ) ) ;
2019-10-18 10:56:41 +02:00
} ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . removeWebScript = function ( path , container ) {
container = container || document . head . querySelector ( "bd-head bd-scripts" ) || document . head ;
container = Node . prototype . isPrototypeOf ( container ) ? container : document . head ;
BDFDB . DOMUtils . remove ( container . querySelectorAll ( ` script[src=" ${ path } "] ` ) ) ;
2019-10-18 10:56:41 +02:00
} ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . appendWebStyle = function ( path , container ) {
if ( ! container && ! document . head . querySelector ( "bd-head bd-styles" ) ) document . head . appendChild ( BDFDB . DOMUtils . create ( ` <bd-head><bd-styles></bd-styles></bd-head> ` ) ) ;
container = container || document . head . querySelector ( "bd-head bd-styles" ) || document . head ;
container = Node . prototype . isPrototypeOf ( container ) ? container : document . head ;
BDFDB . DOMUtils . removeWebStyle ( path , container ) ;
container . appendChild ( BDFDB . DOMUtils . create ( ` <link type="text/css" rel="Stylesheet" href=" ${ path } "></link> ` ) ) ;
} ;
BDFDB . DOMUtils . removeWebStyle = function ( path , container ) {
container = container || document . head . querySelector ( "bd-head bd-styles" ) || document . head ;
container = Node . prototype . isPrototypeOf ( container ) ? container : document . head ;
BDFDB . DOMUtils . remove ( container . querySelectorAll ( ` link[href=" ${ path } "] ` ) ) ;
} ;
BDFDB . DOMUtils . appendLocalStyle = function ( id , css , container ) {
if ( ! container && ! document . head . querySelector ( "bd-head bd-styles" ) ) document . head . appendChild ( BDFDB . DOMUtils . create ( ` <bd-head><bd-styles></bd-styles></bd-head> ` ) ) ;
container = container || document . head . querySelector ( "bd-head bd-styles" ) || document . head ;
container = Node . prototype . isPrototypeOf ( container ) ? container : document . head ;
BDFDB . DOMUtils . removeLocalStyle ( id , container ) ;
container . appendChild ( BDFDB . DOMUtils . create ( ` <style id=" ${ id } CSS"> ${ css . replace ( /\t|\r|\n/g , "" ) } </style> ` ) ) ;
} ;
BDFDB . DOMUtils . removeLocalStyle = function ( id , container ) {
container = container || document . head . querySelector ( "bd-head bd-styles" ) || document . head ;
container = Node . prototype . isPrototypeOf ( container ) ? container : document . head ;
BDFDB . DOMUtils . remove ( container . querySelectorAll ( ` style[id=" ${ id } CSS"] ` ) ) ;
2019-10-18 10:56:41 +02:00
} ;
BDFDB . triggerSend = function ( textarea ) {
if ( ! textarea ) return ;
2019-11-01 10:14:50 +01:00
BDFDB . TimeUtils . timeout ( _ => {
2019-10-18 10:56:41 +02:00
var e = new KeyboardEvent ( "keypress" , { key : "Enter" , code : "Enter" , which : 13 , keyCode : 13 , bubbles : true } ) ;
Object . defineProperty ( e , "keyCode" , { value : 13 } ) ;
Object . defineProperty ( e , "which" , { value : 13 } ) ;
textarea . dispatchEvent ( e ) ;
} ) ;
} ;
BDFDB . initElements = function ( container , plugin ) {
if ( ! Node . prototype . isPrototypeOf ( container ) ) return ;
var islighttheme = BDFDB . DiscordUtils . getTheme ( ) == BDFDB . disCN . themelight ;
container . querySelectorAll ( ".BDFDB-containertext" ) . forEach ( ele => {
2019-10-23 11:10:01 +02:00
if ( BDFDB . DOMUtils . containsClass ( ele . nextElementSibling , "BDFDB-collapsecontainer" ) ) {
if ( BDFDB . DOMUtils . containsClass ( ele . firstElementChild , "closed" ) ) BDFDB . DOMUtils . toggle ( ele . nextElementSibling , false ) ;
2019-10-18 19:19:38 +02:00
ele . BDFDBupdateElement = _ => {
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . toggle ( ele . nextElementSibling , BDFDB . DOMUtils . containsClass ( ele . firstElementChild , "closed" ) ) ;
BDFDB . DOMUtils . toggleClass ( ele . firstElementChild , "closed" ) ;
2019-10-18 10:56:41 +02:00
} ;
addInitEventListener ( ele , "click" , ele . BDFDBupdateElement ) ;
}
} ) ;
container . querySelectorAll ( BDFDB . dotCN . switchinner ) . forEach ( ele => {
setSwitch ( ele , false ) ;
2019-10-18 19:19:38 +02:00
ele . BDFDBupdateElement = _ => {
2019-10-18 10:56:41 +02:00
setSwitch ( ele , true ) ;
} ;
addInitEventListener ( ele , "click" , ele . BDFDBupdateElement ) ;
} ) ;
container . querySelectorAll ( BDFDB . dotCNS . checkboxwrapper + BDFDB . dotCN . checkboxinput ) . forEach ( ele => {
setCheckbox ( ele ) ;
2019-10-18 19:19:38 +02:00
ele . BDFDBupdateElement = _ => {
2019-10-18 10:56:41 +02:00
setCheckbox ( ele ) ;
} ;
addInitEventListener ( ele , "click" , ele . BDFDBupdateElement ) ;
} ) ;
container . querySelectorAll ( BDFDB . dotCN . giffavoritebutton ) . forEach ( ele => {
setGifFavButton ( ele ) ;
2019-10-18 19:19:38 +02:00
ele . BDFDBupdateElement = _ => {
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . toggleClass ( ele , BDFDB . disCN . giffavoriteselected ) ;
2019-10-18 10:56:41 +02:00
setGifFavButton ( ele ) ;
} ;
addInitEventListener ( ele , "click" , ele . BDFDBupdateElement ) ;
var id = "FAV_s" + Math . round ( Math . random ( ) * 10000000000000000 ) ;
2019-10-18 19:19:38 +02:00
addInitEventListener ( ele , "mouseenter" , _ => {
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . remove ( ` # ${ id } _tooltip ` ) ;
BDFDB . TooltipUtils . create ( ele , BDFDB . LanguageUtils . LanguageStrings [ ` GIF_TOOLTIP_ ${ BDFDB . DOMUtils . containsClass ( ele , BDFDB . disCN . giffavoriteselected ) ? "REMOVE_FROM" : "ADD_TO" } _FAVORITES ` ] , { type : "top" , id : id + "_tooltip" } ) ;
2019-10-18 10:56:41 +02:00
} ) ;
} ) ;
container . querySelectorAll ( ".file-navigator" ) . forEach ( ele => {
2019-10-18 19:19:38 +02:00
ele . BDFDBupdateElement = _ => {
2019-10-18 10:56:41 +02:00
var input = ele . querySelector ( ` input[type="file"] ` ) ;
if ( input ) input . click ( ) ;
} ;
addInitEventListener ( ele , "click" , ele . BDFDBupdateElement ) ;
} ) ;
container . querySelectorAll ( ` input[type="file"] ` ) . forEach ( ele => {
addInitEventListener ( ele , "change" , e => {
var input = ele . parentElement . parentElement . querySelector ( ` input[type="text"] ` ) ;
var file = ele . files [ 0 ] ;
if ( input && file ) input . value = file . path ;
} ) ;
} ) ;
container . querySelectorAll ( BDFDB . dotCN . input ) . forEach ( ele => {
addInitEventListener ( ele , "keydown" , e => {
e . stopPropagation ( ) ;
} ) ;
} ) ;
container . querySelectorAll ( BDFDB . dotCNS . searchbar + BDFDB . dotCN . searchbarinput ) . forEach ( ele => {
2019-10-19 11:41:39 +02:00
ele . setAttribute ( "placeholder" , BDFDB . LanguageUtils . LanguageStrings . SEARCHING ) ;
2019-10-18 10:56:41 +02:00
addInitEventListener ( ele , "keyup" , e => {
let icons = ele . parentElement . querySelectorAll ( BDFDB . dotCN . searchbaricon ) ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . toggleClass ( icons [ 0 ] , BDFDB . disCN . searchbarvisible , ele . value . length == 0 ) ;
BDFDB . DOMUtils . toggleClass ( icons [ 1 ] , BDFDB . disCN . searchbarvisible , ele . value . length ) ;
2019-10-18 10:56:41 +02:00
} ) ;
} ) ;
container . querySelectorAll ( BDFDB . dotCNS . searchbar + BDFDB . dotCN . searchbarclear ) . forEach ( ele => {
addInitEventListener ( ele , "click" , e => {
2019-10-23 11:10:01 +02:00
if ( BDFDB . DOMUtils . containsClass ( ele , BDFDB . disCN . searchbarvisible ) ) {
var input = BDFDB . DOMUtils . getParent ( BDFDB . dotCN . searchbar , ele ) . querySelector ( BDFDB . dotCN . searchbarinput ) ;
2019-10-18 10:56:41 +02:00
input . value = "" ;
input . dispatchEvent ( new Event ( "change" ) ) ;
input . dispatchEvent ( new Event ( "input" ) ) ;
input . dispatchEvent ( new Event ( "keydown" ) ) ;
input . dispatchEvent ( new Event ( "keyup" ) ) ;
input . dispatchEvent ( new Event ( "keypressed" ) ) ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . addClass ( ele . parentElement . querySelectorAll ( BDFDB . dotCN . searchbaricon ) [ 0 ] , BDFDB . disCN . searchbarvisible ) ;
BDFDB . DOMUtils . removeClass ( ele , BDFDB . disCN . searchbarvisible ) ;
2019-10-18 10:56:41 +02:00
}
} ) ;
} ) ;
container . querySelectorAll ( ".numberinput-button-up" ) . forEach ( ele => {
addInitEventListener ( ele , "click" , e => {
var input = ele . parentElement . parentElement . querySelector ( "input" ) ;
var min = parseInt ( input . getAttribute ( "min" ) ) ;
var max = parseInt ( input . getAttribute ( "max" ) ) ;
var newv = parseInt ( input . value ) + 1 ;
if ( isNaN ( max ) || ! isNaN ( max ) && newv <= max ) {
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . addClass ( ele . parentElement , "pressed" ) ;
2019-11-01 11:09:32 +01:00
BDFDB . TimeUtils . clear ( ele . parentElement . pressedTimeout ) ;
2019-10-18 10:56:41 +02:00
input . value = isNaN ( min ) || ! isNaN ( min ) && newv >= min ? newv : min ;
input . dispatchEvent ( new Event ( "change" ) ) ;
input . dispatchEvent ( new Event ( "input" ) ) ;
input . dispatchEvent ( new Event ( "keydown" ) ) ;
input . dispatchEvent ( new Event ( "keyup" ) ) ;
input . dispatchEvent ( new Event ( "keypressed" ) ) ;
2019-11-01 10:14:50 +01:00
ele . parentElement . pressedTimeout = BDFDB . TimeUtils . timeout ( _ => { BDFDB . DOMUtils . removeClass ( ele . parentElement , "pressed" ) ; } , 3000 ) ;
2019-10-18 10:56:41 +02:00
}
} ) ;
} ) ;
container . querySelectorAll ( ".numberinput-button-down" ) . forEach ( ele => {
addInitEventListener ( ele , "click" , e => {
var input = ele . parentElement . parentElement . querySelector ( "input" ) ;
var min = parseInt ( input . getAttribute ( "min" ) ) ;
var max = parseInt ( input . getAttribute ( "max" ) ) ;
var newv = parseInt ( input . value ) - 1 ;
if ( isNaN ( min ) || ! isNaN ( min ) && newv >= min ) {
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . addClass ( ele . parentElement , "pressed" ) ;
2019-11-01 11:09:32 +01:00
BDFDB . TimeUtils . clear ( ele . parentElement . pressedTimeout ) ;
2019-10-18 10:56:41 +02:00
input . value = isNaN ( max ) || ! isNaN ( max ) && newv <= max ? newv : max ;
input . dispatchEvent ( new Event ( "change" ) ) ;
input . dispatchEvent ( new Event ( "input" ) ) ;
input . dispatchEvent ( new Event ( "keydown" ) ) ;
input . dispatchEvent ( new Event ( "keyup" ) ) ;
input . dispatchEvent ( new Event ( "keypressed" ) ) ;
2019-11-01 10:14:50 +01:00
ele . parentElement . pressedTimeout = BDFDB . TimeUtils . timeout ( _ => { BDFDB . DOMUtils . removeClass ( ele . parentElement , "pressed" ) ; } , 3000 ) ;
2019-10-18 10:56:41 +02:00
}
} ) ;
} ) ;
container . querySelectorAll ( ".amount-input" ) . forEach ( ele => {
addInitEventListener ( ele , "input" , e => {
if ( BDFDB . ObjectUtils . is ( plugin ) ) {
var option = ele . getAttribute ( "option" ) ;
var newv = parseInt ( ele . value ) ;
var min = parseInt ( ele . getAttribute ( "min" ) ) ;
var max = parseInt ( ele . getAttribute ( "max" ) ) ;
if ( option && ! isNaN ( newv ) && ( isNaN ( min ) || ! isNaN ( min ) && newv >= min ) && ( isNaN ( max ) || ! isNaN ( max ) && newv <= max ) ) {
2019-10-22 14:20:12 +02:00
BDFDB . DataUtils . save ( newv , plugin , "amounts" , option ) ;
2019-10-18 10:56:41 +02:00
plugin . SettingsUpdated = true ;
}
}
} ) ;
} ) ;
container . querySelectorAll ( BDFDB . dotCNC . tabbaritem + BDFDB . dotCN . tabbarheaderitem ) . forEach ( ele => {
setTabitem ( ele , ele . parentElement . querySelector ( BDFDB . dotCNC . tabbaritem + BDFDB . dotCN . tabbarheaderitem ) == ele ? 2 : 0 ) ;
addInitEventListener ( ele , "click" , e => {
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . removeClass ( container . querySelectorAll ( BDFDB . dotCN . modaltabcontent + BDFDB . dotCN . modaltabcontentopen ) , BDFDB . disCN . modaltabcontentopen ) ;
2019-10-18 10:56:41 +02:00
ele . parentElement . querySelectorAll ( BDFDB . dotCNC . tabbaritem + BDFDB . dotCN . tabbarheaderitem ) . forEach ( ele => { setTabitem ( ele , 0 ) ; } ) ;
var tab = container . querySelector ( ` ${ BDFDB . dotCN . modaltabcontent } [tab=" ${ ele . getAttribute ( "tab" ) } "] ` ) ;
2019-10-23 11:10:01 +02:00
if ( tab ) BDFDB . DOMUtils . addClass ( tab , BDFDB . disCN . modaltabcontentopen ) ;
2019-10-18 10:56:41 +02:00
setTabitem ( ele , 2 ) ;
} ) ;
addInitEventListener ( ele , "mouseenter" , e => {
2019-10-23 11:10:01 +02:00
if ( ! BDFDB . DOMUtils . containsClass ( ele , BDFDB . disCN . settingsitemselected ) ) setTabitem ( ele , 1 ) ;
2019-10-18 10:56:41 +02:00
} ) ;
addInitEventListener ( ele , "mouseleave" , e => {
2019-10-23 11:10:01 +02:00
if ( ! BDFDB . DOMUtils . containsClass ( ele , BDFDB . disCN . settingsitemselected ) ) setTabitem ( ele , 0 ) ;
2019-10-18 10:56:41 +02:00
} ) ;
} ) ;
container . querySelectorAll ( ".BDFDB-textscrollwrapper" ) . forEach ( ele => {
var inner = ele . querySelector ( ".BDFDB-textscroll" ) ;
if ( inner ) {
2019-10-23 11:10:01 +02:00
if ( BDFDB . DOMUtils . containsClass ( ele . parentElement , BDFDB . disCN . contextmenuitemsubmenu ) ) ele . style . setProperty ( "margin-right" , "10px" ) ;
if ( BDFDB . DOMUtils . getRects ( ele ) . width > 100 ) ele . style . setProperty ( "text-overflow" , "ellipsis" , "important" ) ;
2019-10-18 10:56:41 +02:00
ele . style . setProperty ( "position" , "relative" , "important" ) ;
ele . style . setProperty ( "display" , "block" , "important" ) ;
ele . style . setProperty ( "overflow" , "hidden" , "important" ) ;
inner . style . setProperty ( "left" , "0px" , "important" ) ;
inner . style . setProperty ( "position" , "relative" , "important" ) ;
inner . style . setProperty ( "white-space" , "nowrap" , "important" ) ;
inner . style . setProperty ( "display" , "inline" , "important" ) ;
var animate , Animation ;
addInitEventListener ( ele , "mouseenter" , e => {
2019-10-23 11:10:01 +02:00
if ( BDFDB . DOMUtils . getRects ( ele ) . width < BDFDB . DOMUtils . getRects ( inner ) . width ) {
BDFDB . DOMUtils . addClass ( ele , "scrolling" ) ;
2019-10-18 10:56:41 +02:00
if ( ! Animation || ! animate ) initAnimation ( ) ;
animate ( 1 ) ;
inner . style . setProperty ( "display" , "block" , "important" ) ;
}
} ) ;
addInitEventListener ( ele , "mouseleave" , e => {
2019-10-23 11:10:01 +02:00
if ( BDFDB . DOMUtils . containsClass ( ele , "scrolling" ) ) {
BDFDB . DOMUtils . removeClass ( ele , "scrolling" ) ;
2019-10-18 10:56:41 +02:00
inner . style . setProperty ( "display" , "inline" , "important" ) ;
if ( ! Animation || ! animate ) initAnimation ( ) ;
animate ( 0 ) ;
}
} ) ;
function initAnimation ( ) {
Animation = new LibraryModules . AnimationUtils . Value ( 0 ) ;
Animation
2019-10-23 11:10:01 +02:00
. interpolate ( { inputRange : [ 0 , 1 ] , outputRange : [ 0 , ( BDFDB . DOMUtils . getRects ( inner ) . width - BDFDB . DOMUtils . getRects ( ele ) . width ) * - 1 ] } )
2019-10-18 10:56:41 +02:00
. addListener ( v => { inner . style . setProperty ( "left" , v . value + "px" , "important" ) ; } ) ;
animate = p => {
2019-10-23 11:10:01 +02:00
var w = p + parseFloat ( inner . style . getPropertyValue ( "left" ) ) / ( BDFDB . DOMUtils . getRects ( inner ) . width - BDFDB . DOMUtils . getRects ( ele ) . width ) ;
2019-10-18 10:56:41 +02:00
w = isNaN ( w ) || ! isFinite ( w ) ? p : w ;
2019-10-23 11:10:01 +02:00
w *= BDFDB . DOMUtils . getRects ( inner ) . width / ( BDFDB . DOMUtils . getRects ( ele ) . width * 2 ) ;
2019-10-18 10:56:41 +02:00
LibraryModules . AnimationUtils . parallel ( [ LibraryModules . AnimationUtils . timing ( Animation , { toValue : p , duration : Math . sqrt ( w * * 2 ) * 4000 / ( ele . getAttribute ( "speed" ) || 1 ) } ) ] ) . start ( ) ;
} ;
}
}
} ) ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . removeClass ( container . querySelectorAll ( BDFDB . dotCN . modaltabcontent ) , BDFDB . disCN . modaltabcontentopen ) ;
BDFDB . DOMUtils . addClass ( container . querySelector ( BDFDB . dotCN . modaltabcontent ) , BDFDB . disCN . modaltabcontentopen ) ;
2019-10-18 10:56:41 +02:00
2019-10-19 11:41:39 +02:00
container . querySelectorAll ( ".btn-add " + BDFDB . dotCN . buttoncontents ) . forEach ( ele => { ele . innerText = BDFDB . LanguageUtils . LanguageStrings . ADD ; } ) ;
container . querySelectorAll ( ".btn-all " + BDFDB . dotCN . buttoncontents ) . forEach ( ele => { ele . innerText = BDFDB . LanguageUtils . LanguageStrings . FORM _LABEL _ALL ; } ) ;
container . querySelectorAll ( ".btn-cancel " + BDFDB . dotCN . buttoncontents ) . forEach ( ele => { ele . innerText = BDFDB . LanguageUtils . LanguageStrings . CANCEL ; } ) ;
container . querySelectorAll ( ".btn-done " + BDFDB . dotCN . buttoncontents ) . forEach ( ele => { ele . innerText = BDFDB . LanguageUtils . LanguageStrings . DONE ; } ) ;
container . querySelectorAll ( ".btn-download " + BDFDB . dotCN . buttoncontents ) . forEach ( ele => { ele . innerText = BDFDB . LanguageUtils . LanguageStrings . DOWNLOAD ; } ) ;
container . querySelectorAll ( ".btn-ok " + BDFDB . dotCN . buttoncontents ) . forEach ( ele => { ele . innerText = BDFDB . LanguageUtils . LanguageStrings . OKAY ; } ) ;
container . querySelectorAll ( ".btn-save " + BDFDB . dotCN . buttoncontents ) . forEach ( ele => { ele . innerText = BDFDB . LanguageUtils . LanguageStrings . SAVE ; } ) ;
container . querySelectorAll ( ".btn-send " + BDFDB . dotCN . buttoncontents ) . forEach ( ele => { ele . innerText = BDFDB . LanguageUtils . LanguageStrings . SEND ; } ) ;
2019-10-29 23:12:52 +01:00
container . querySelectorAll ( ".file-navigator " + BDFDB . dotCN . buttoncontents ) . forEach ( ele => { ele . innerText = BDFDB . LanguageUtils . LibraryStrings . file _navigator _text ; } ) ;
2019-10-18 10:56:41 +02:00
if ( islighttheme ) {
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . replaceClass ( container . querySelectorAll ( BDFDB . dotCN . selectcontroldark ) , BDFDB . disCN . selectcontroldark , BDFDB . disCN . selectcontrollight ) ;
BDFDB . DOMUtils . replaceClass ( container . querySelectorAll ( BDFDB . dotCN . selectsingledark ) , BDFDB . disCN . selectsingledark , BDFDB . disCN . selectsinglelight ) ;
BDFDB . DOMUtils . replaceClass ( container . querySelectorAll ( BDFDB . dotCN . selectarrowcontainerdark ) , BDFDB . disCN . selectarrowcontainerdark , BDFDB . disCN . selectarrowcontainerlight ) ;
2019-10-18 10:56:41 +02:00
}
else {
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . replaceClass ( container . querySelectorAll ( BDFDB . dotCN . selectcontrollight ) , BDFDB . disCN . selectcontrollight , BDFDB . disCN . selectcontroldark ) ;
BDFDB . DOMUtils . replaceClass ( container . querySelectorAll ( BDFDB . dotCN . selectsinglelight ) , BDFDB . disCN . selectsinglelight , BDFDB . disCN . selectsingledark ) ;
BDFDB . DOMUtils . replaceClass ( container . querySelectorAll ( BDFDB . dotCN . selectarrowcontainerlight ) , BDFDB . disCN . selectarrowcontainerlight , BDFDB . disCN . selectarrowcontainerdark ) ;
2019-10-18 10:56:41 +02:00
}
2019-10-18 19:19:38 +02:00
var executeDelayedIfNotAppened = _ => {
2019-10-18 10:56:41 +02:00
container . querySelectorAll ( ".BDFDB-tableheader" ) . forEach ( ele => {
2019-10-23 11:10:01 +02:00
var panel = BDFDB . DOMUtils . getParent ( ".BDFDB-modal, .BDFDB-settings" , ele ) ;
2019-10-18 10:56:41 +02:00
var tableid = ele . getAttribute ( "table-id" ) ;
var text = ele . querySelector ( ".BDFDB-tableheadertext" ) ;
var columns = ele . querySelectorAll ( ".BDFDB-tableheadercolumns .BDFDB-tableheadercolumn" ) ;
if ( panel && tableid && text && columns . length ) {
let toobig = false , maxwidth = BDFDB . ObjectUtils . is ( panel [ "BDFDB-tableheader-maxwidth" ] ) ? panel [ "BDFDB-tableheader-maxwidth" ] [ tableid ] : 0 ;
if ( ! maxwidth ) {
for ( let column of columns ) {
2019-10-23 11:10:01 +02:00
let width = BDFDB . DOMUtils . getRects ( column ) . width ;
2019-10-18 10:56:41 +02:00
maxwidth = width > maxwidth ? width : maxwidth ;
}
maxwidth += 4 ;
}
if ( columns . length * maxwidth > 300 ) {
toobig = true ;
maxwidth = parseInt ( 290 / columns . length ) ;
}
else if ( maxwidth < 36 ) {
maxwidth = 36 ;
}
columns . forEach ( ( column , i ) => {
column . style . setProperty ( "flex" , ` 0 0 ${ maxwidth } px ` , "important" ) ;
if ( toobig ) {
if ( i == 0 ) column . style . setProperty ( "margin-left" , ` ${ - 1 * ( 10 + maxwidth / 2 ) } px ` , "important" ) ;
column . style . setProperty ( "margin-top" , "0" , "important" ) ;
column . style . setProperty ( "text-align" , "right" , "important" ) ;
column . style . setProperty ( "writing-mode" , "vertical-rl" , "important" ) ;
}
else column . style . setProperty ( "text-align" , "center" , "important" ) ;
} ) ;
text . style . setProperty ( "flex" , ` 0 0 ${ 556 - ( columns . length * maxwidth ) } px ` , "important" ) ;
columns [ 0 ] . parentElement . style . setProperty ( "flex" , ` 0 0 ${ columns . length * maxwidth } px ` , "important" ) ;
if ( ! BDFDB . ObjectUtils . is ( panel [ "BDFDB-tableheader-maxwidth" ] ) ) panel [ "BDFDB-tableheader-maxwidth" ] = { }
panel [ "BDFDB-tableheader-maxwidth" ] [ tableid ] = maxwidth ;
}
} ) ;
container . querySelectorAll ( ".BDFDB-tablecheckbox" ) . forEach ( ele => {
2019-10-23 11:10:01 +02:00
var panel = BDFDB . DOMUtils . getParent ( ".BDFDB-modal, .BDFDB-settings" , ele ) ;
2019-10-18 10:56:41 +02:00
var tableid = ele . getAttribute ( "table-id" ) ;
if ( panel && tableid && BDFDB . ObjectUtils . is ( panel [ "BDFDB-tableheader-maxwidth" ] ) && panel [ "BDFDB-tableheader-maxwidth" ] [ tableid ] ) {
var style = getComputedStyle ( ele ) ;
ele . style . setProperty ( "flex" , ` 0 0 ${ panel [ "BDFDB-tableheader-maxwidth" ] [ tableid ] - parseInt ( style . marginLeft ) - parseInt ( style . marginRight ) } px ` , "important" ) ;
}
} ) ;
} ;
if ( document . contains ( container ) ) executeDelayedIfNotAppened ( ) ;
2019-11-01 10:14:50 +01:00
else BDFDB . TimeUtils . timeout ( _ => { executeDelayedIfNotAppened ( ) ; } ) ;
2019-10-18 10:56:41 +02:00
function setSwitch ( switchitem , triggered ) {
if ( ! switchitem ) return ;
var checked = switchitem . checked ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . toggleClass ( switchitem . parentElement , BDFDB . disCN . switchvaluechecked , checked ) ;
BDFDB . DOMUtils . toggleClass ( switchitem . parentElement , BDFDB . disCN . switchvalueunchecked , ! checked ) ;
if ( triggered && BDFDB . ObjectUtils . is ( plugin ) && BDFDB . DOMUtils . containsClass ( switchitem , "settings-switch" ) ) {
2019-10-18 10:56:41 +02:00
let keys = switchitem . getAttribute ( "value" ) . trim ( ) . split ( " " ) . filter ( n => n ) ;
let option = keys . shift ( ) ;
if ( option ) {
2019-10-22 14:20:12 +02:00
var data = BDFDB . DataUtils . load ( plugin , option ) ;
2019-10-18 10:56:41 +02:00
var newdata = "" ;
for ( let key of keys ) newdata += ` {" ${ key } ": ` ;
newdata += checked + "}" . repeat ( keys . length ) ;
newdata = JSON . parse ( newdata ) ;
if ( BDFDB . ObjectUtils . is ( newdata ) ) BDFDB . ObjectUtils . deepAssign ( data , newdata ) ;
else data = newdata ;
2019-10-22 14:20:12 +02:00
BDFDB . DataUtils . save ( data , plugin , option ) ;
2019-10-18 10:56:41 +02:00
plugin . SettingsUpdated = true ;
}
}
} ;
function setCheckbox ( checkbox ) {
if ( ! checkbox ) return ;
var checkboxstyle = checkbox . parentElement . querySelector ( BDFDB . dotCN . checkbox ) ;
var checkboxstyleinner = checkboxstyle . querySelector ( "polyline" ) ;
if ( checkbox . checked ) {
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . addClass ( checkboxstyle , BDFDB . disCN . checkboxchecked ) ;
2019-10-18 10:56:41 +02:00
checkboxstyle . style . setProperty ( "background-color" , "rgb(67, 181, 129)" ) ;
checkboxstyle . style . setProperty ( "border-color" , "rgb(67, 181, 129)" ) ;
if ( checkboxstyleinner ) checkboxstyleinner . setAttribute ( "stroke" , "#ffffff" ) ;
}
else {
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . removeClass ( checkboxstyle , BDFDB . disCN . checkboxchecked ) ;
2019-10-18 10:56:41 +02:00
checkboxstyle . style . removeProperty ( "background-color" ) ;
checkboxstyle . style . removeProperty ( "border-color" ) ;
if ( checkboxstyleinner ) checkboxstyleinner . setAttribute ( "stroke" , "transparent" ) ;
}
} ;
function setGifFavButton ( button ) {
2019-10-23 11:10:01 +02:00
var selected = BDFDB . DOMUtils . containsClass ( button , BDFDB . disCN . giffavoriteselected ) ;
2019-10-18 10:56:41 +02:00
var icon = button . querySelector ( BDFDB . dotCN . giffavoriteicon ) ;
if ( icon ) {
icon . setAttribute ( "name" , selected ? "FavoriteFilled" : "Favorite" ) ;
icon . innerHTML = selected ? ` <path d="M0,0H24V24H0Z" fill="none"></path><path fill="currentColor" d="M12.5,17.6l3.6,2.2a1,1,0,0,0,1.5-1.1l-1-4.1a1,1,0,0,1,.3-1l3.2-2.8A1,1,0,0,0,19.5,9l-4.2-.4a.87.87,0,0,1-.8-.6L12.9,4.1a1.05,1.05,0,0,0-1.9,0l-1.6,4a1,1,0,0,1-.8.6L4.4,9a1.06,1.06,0,0,0-.6,1.8L7,13.6a.91.91,0,0,1,.3,1l-1,4.1a1,1,0,0,0,1.5,1.1l3.6-2.2A1.08,1.08,0,0,1,12.5,17.6Z"></path> ` : ` <path fill="currentColor" d="M19.6,9l-4.2-0.4c-0.4,0-0.7-0.3-0.8-0.6l-1.6-3.9c-0.3-0.8-1.5-0.8-1.8,0L9.4,8.1C9.3,8.4,9,8.6,8.6,8.7L4.4,9c-0.9,0.1-1.2,1.2-0.6,1.8L7,13.6c0.3,0.2,0.4,0.6,0.3,1l-1,4.1c-0.2,0.9,0.7,1.5,1.5,1.1l3.6-2.2c0.3-0.2,0.7-0.2,1,0l3.6,2.2c0.8,0.5,1.7-0.2,1.5-1.1l-1-4.1c-0.1-0.4,0-0.7,0.3-1l3.2-2.8C20.9,10.2,20.5,9.1,19.6,9zM12,15.4l-3.8,2.3l1-4.3l-3.3-2.9l4.4-0.4l1.7-4l1.7,4l4.4,0.4l-3.3,2.9l1,4.3L12,15.4z"></path> ` ;
}
if ( selected ) {
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . addClass ( button , BDFDB . disCN . giffavoriteshowpulse ) ;
2019-11-01 10:14:50 +01:00
BDFDB . TimeUtils . timeout ( _ => { BDFDB . DOMUtils . removeClass ( button , BDFDB . disCN . giffavoriteshowpulse ) ; } , 500 ) ;
2019-10-18 10:56:41 +02:00
}
} ;
function setTabitem ( item , state ) {
if ( ! item ) return ;
switch ( state ) {
case 0 :
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . removeClass ( item , BDFDB . disCN . settingsitemselected ) ;
2019-10-18 10:56:41 +02:00
item . style . setProperty ( "border-color" , "transparent" ) ;
item . style . setProperty ( "color" , islighttheme ? "rgba(79, 84, 92, 0.4)" : "rgba(255, 255, 255, 0.4)" ) ;
break ;
case 1 :
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . removeClass ( item , BDFDB . disCN . settingsitemselected ) ;
2019-10-18 10:56:41 +02:00
item . style . setProperty ( "border-color" , islighttheme ? "rgba(79, 84, 92, 0.6)" : "rgba(255, 255, 255, 0.6)" ) ;
item . style . setProperty ( "color" , islighttheme ? "rgba(79, 84, 92, 0.6)" : "rgba(255, 255, 255, 0.6)" ) ;
break ;
case 2 :
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . addClass ( item , BDFDB . disCN . settingsitemselected ) ;
2019-10-18 10:56:41 +02:00
item . style . setProperty ( "border-color" , islighttheme ? "rgb(79, 84, 92)" : "rgb(255, 255, 255)" ) ;
item . style . setProperty ( "color" , islighttheme ? "rgb(79, 84, 92)" : "rgb(255, 255, 255)" ) ;
break ;
}
} ;
function addInitEventListener ( ele , action , callback ) {
if ( ! ele . BDFDBupdateElementsListeners ) ele . BDFDBupdateElementsListeners = { } ;
if ( ele . BDFDBupdateElementsListeners [ action ] ) ele . removeEventListener ( action , ele . BDFDBupdateElementsListeners [ action ] ) ;
ele . BDFDBupdateElementsListeners [ action ] = callback ;
ele . addEventListener ( action , callback , true ) ;
} ;
} ;
2019-10-23 11:10:01 +02:00
// REMOVE ONCE REWRITTEN
2019-10-18 10:56:41 +02:00
BDFDB . appendModal = function ( modalwrapper ) {
if ( ! Node . prototype . isPrototypeOf ( modalwrapper ) ) return ;
2019-11-02 10:43:20 +01:00
if ( ! BDFDB . appendModal . modals || ! document . contains ( BDFDB . appendModal . modals ) ) BDFDB . appendModal . modals = BDFDB . ReactUtils . findDOMNode ( BDFDB . ReactUtils . findOwner ( document . querySelector ( BDFDB . dotCN . app ) , { name : "Modals" , unlimited : true } ) ) ;
2019-10-18 10:56:41 +02:00
if ( ! BDFDB . appendModal . modals ) return ;
2019-10-23 11:10:01 +02:00
var modal = BDFDB . DOMUtils . containsClass ( modalwrapper , BDFDB . disCN . modal ) ? modalwrapper : modalwrapper . querySelector ( BDFDB . dotCN . modal ) ;
2019-10-18 10:56:41 +02:00
var backdrop = modal ? modal . previousElementSibling : null ;
var modalOpacity = new LibraryModules . AnimationUtils . Value ( 0 ) ;
modalOpacity
. interpolate ( { inputRange : [ 0 , 1 ] , outputRange : [ 0 , 1 ] } )
. addListener ( ( value ) => { if ( modal ) modal . style . setProperty ( "opacity" , ` ${ value . value } ` ) ; } ) ;
var modalTransform = new LibraryModules . AnimationUtils . Value ( 0 ) ;
modalTransform
. interpolate ( { inputRange : [ 0 , 1 ] , outputRange : [ 0.7 , 1 ] } )
. addListener ( ( value ) => { if ( modal ) modal . style . setProperty ( "transform" , ` scale( ${ value . value } ) translateZ(0px) ` ) ; } ) ;
var backdropOpacity = new LibraryModules . AnimationUtils . Value ( 0 ) ;
backdropOpacity
. interpolate ( { inputRange : [ 0 , 1 ] , outputRange : [ 0 , 0.85 ] } )
. addListener ( ( value ) => { if ( backdrop ) {
backdrop . style . setProperty ( "opacity" , ` ${ value . value } ` ) ;
backdrop . style . setProperty ( "background-color" , "rgb(0, 0, 0)" ) ;
backdrop . style . setProperty ( "z-index" , "1000" ) ;
backdrop . style . setProperty ( "transform" , "translateZ(0px)" ) ;
} } ) ;
var animate = ( v ) => {
LibraryModules . AnimationUtils . parallel ( [
LibraryModules . AnimationUtils . timing ( modalOpacity , { toValue : v , duration : 250 , easing : LibraryModules . AnimationUtils . Easing . inOut ( LibraryModules . AnimationUtils . Easing . ease ) } ) ,
LibraryModules . AnimationUtils . timing ( modalTransform , { toValue : v , duration : 250 , easing : LibraryModules . AnimationUtils . Easing . inOut ( LibraryModules . AnimationUtils . Easing . ease ) } ) ,
LibraryModules . AnimationUtils . timing ( backdropOpacity , { toValue : v , duration : 200 , delay : 50 } ) ,
] ) . start ( ) ;
} ;
var keydown = e => {
if ( ! document . contains ( modalwrapper ) ) document . removeEventListener ( "keydown" , keydown ) ;
else if ( e . which == 27 && backdrop ) backdrop . click ( ) ;
} ;
document . addEventListener ( "keydown" , keydown ) ;
2019-10-18 19:19:38 +02:00
BDFDB . ListenerUtils . addToChildren ( modalwrapper , "click" , BDFDB . dotCNC . backdrop + BDFDB . dotCNC . modalclose + ".btn-close, .btn-save, .btn-send, .btn-cancel, .btn-ok, .btn-done" , _ => {
2019-10-18 10:56:41 +02:00
document . removeEventListener ( "keydown" , keydown ) ;
animate ( 0 ) ;
2019-11-01 10:14:50 +01:00
BDFDB . TimeUtils . timeout ( _ => { modalwrapper . remove ( ) ; } , 300 ) ;
2019-10-18 10:56:41 +02:00
} ) ;
BDFDB . appendModal . modals . appendChild ( modalwrapper ) ;
BDFDB . initElements ( modalwrapper ) ;
animate ( 1 ) ;
} ;
BDFDB . createSearchBar = function ( size = "small" ) {
if ( typeof size != "string" || ! [ "small" , "medium" , "large" ] . includes ( size . toLowerCase ( ) ) ) size = "small" ;
var sizeclass = DiscordClassModules . SearchBar [ size ] ? ( " " + BDFDB . disCN [ "searchbar" + size ] ) : "" ;
2019-10-23 11:10:01 +02:00
var searchBar = BDFDB . DOMUtils . create ( ` <div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . horizontal + BDFDB . disCNS . horizontal + BDFDB . disCNS . justifystart + BDFDB . disCNS . alignstretch + BDFDB . disCNS . nowrap + BDFDB . disCN . searchbar + sizeclass } " style="flex: 1 1 auto;"><div class=" ${ BDFDB . disCN . searchbarinner } "><input class=" ${ BDFDB . disCN . searchbarinput } " type="text" spellcheck="false" placeholder="" value=""><div tabindex="0" class=" ${ BDFDB . disCN . searchbariconlayout + sizeclass } " role="button"><div class=" ${ BDFDB . disCN . searchbariconwrap } "><svg name="Search" class=" ${ BDFDB . disCNS . searchbaricon + BDFDB . disCN . searchbarvisible } " width="18" height="18" viewBox="0 0 18 18"><g fill="none" fill-rule="evenodd"><path fill="currentColor" d="M3.60091481,7.20297313 C3.60091481,5.20983419 5.20983419,3.60091481 7.20297313,3.60091481 C9.19611206,3.60091481 10.8050314,5.20983419 10.8050314,7.20297313 C10.8050314,9.19611206 9.19611206,10.8050314 7.20297313,10.8050314 C5.20983419,10.8050314 3.60091481,9.19611206 3.60091481,7.20297313 Z M12.0057176,10.8050314 L11.3733562,10.8050314 L11.1492281,10.5889079 C11.9336764,9.67638651 12.4059463,8.49170955 12.4059463,7.20297313 C12.4059463,4.32933105 10.0766152,2 7.20297313,2 C4.32933105,2 2,4.32933105 2,7.20297313 C2,10.0766152 4.32933105,12.4059463 7.20297313,12.4059463 C8.49170955,12.4059463 9.67638651,11.9336764 10.5889079,11.1492281 L10.8050314,11.3733562 L10.8050314,12.0057176 L14.8073185,16 L16,14.8073185 L12.2102538,11.0099776 L12.0057176,10.8050314 Z"></path></g></svg><svg name="Clear" class=" ${ BDFDB . disCNS . searchbaricon + BDFDB . disCN . searchbarclear } " width="12" height="12" viewBox="0 0 12 12"><g fill="none" fill-rule="evenodd"><path d="M0 0h12v12H0"></path><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"></path></g></svg></div></div></div></div> ` ) ;
2019-10-18 10:56:41 +02:00
BDFDB . initElements ( searchBar ) ;
return searchBar ;
} ;
BDFDB . createSelectMenu = function ( inner , value , type = "" , dark = BDFDB . DiscordUtils . getTheme ( ) == BDFDB . disCN . themedark ) {
2019-10-23 11:10:01 +02:00
if ( typeof inner != "string" || ( typeof value != "string" && typeof value != "number" ) ) return BDFDB . DOMUtils . create ( ` <div></div> ` ) ;
2019-10-18 10:56:41 +02:00
var suffix = dark ? "dark" : "light" ;
return ` <div class=" ${ BDFDB . disCN . selectwrap } BDFDB-select" style="flex: 1 1 auto;"><div class=" ${ BDFDB . disCN . select } " type=" ${ type } " value=" ${ value } "><div class=" ${ BDFDB . disCNS . selectcontrol + BDFDB . disCN [ "selectcontrol" + suffix ] } "><div class=" ${ BDFDB . disCN . selectvalue } "><div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . horizontal + BDFDB . disCNS . justifystart + BDFDB . disCNS . alignbaseline + BDFDB . disCNS . nowrap + BDFDB . disCNS . selectsingle + BDFDB . disCN [ "selectsingle" + suffix ] } "> ${ inner } </div><input readonly="" tabindex="0" class=" ${ BDFDB . disCN . selectdummyinput } " value=""></div><div class=" ${ BDFDB . disCN . selectarrowzone } "><div aria-hidden="true" class=" ${ BDFDB . disCNS . selectarrowcontainer + BDFDB . disCN [ "selectarrowcontainer" + suffix ] } "><svg height="20" width="20" viewBox="0 0 20 20" aria-hidden="true" focusable="false" class=" ${ BDFDB . disCN . selectarrow } "><path d="M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"></path></svg></div></div></div></div></div> ` ;
} ;
BDFDB . openDropdownMenu = function ( e , callback , createinner , values , above = false , dark = BDFDB . DiscordUtils . getTheme ( ) == BDFDB . disCN . themedark ) {
if ( typeof callback != "function" || typeof createinner != "function" || ! values || typeof values != "object" ) return ;
2019-10-23 11:10:01 +02:00
let selectControl = ( BDFDB . DOMUtils . getParent ( BDFDB . dotCN . selectwrap , e . currentTarget ) || e . currentTarget ) . querySelector ( BDFDB . dotCN . selectcontrol ) ;
2019-10-18 10:56:41 +02:00
let selectWrap = selectControl . parentElement ;
2019-10-23 11:10:01 +02:00
if ( BDFDB . DOMUtils . containsClass ( selectWrap , BDFDB . disCN . selectisopen ) ) return ;
2019-10-18 10:56:41 +02:00
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . addClass ( selectWrap , BDFDB . disCN . selectisopen ) ;
2019-10-18 10:56:41 +02:00
var type = selectWrap . getAttribute ( "type" ) ;
var oldchoice = selectWrap . getAttribute ( "value" ) ;
var suffix = dark ? "dark" : "light" ;
var menuhtml = ` <div class=" ${ BDFDB . disCNS . selectmenuouter + BDFDB . disCN [ "selectmenuouter" + suffix ] } "><div class=" ${ BDFDB . disCN . selectmenu } "> ` ;
for ( var key in values ) menuhtml += ` <div value=" ${ key } " class=" ${ BDFDB . disCNS . selectoption + ( key == oldchoice ? BDFDB . disCN [ "selectoptionselect" + suffix ] : BDFDB . disCN [ "selectoption" + suffix ] ) } " style="flex: 1 1 auto; display: flex;"> ${ createinner ( key ) } </div> ` ;
menuhtml += ` </div></div> ` ;
2019-10-23 11:10:01 +02:00
var selectMenu = BDFDB . DOMUtils . create ( menuhtml ) ;
2019-10-18 10:56:41 +02:00
if ( above ) {
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . addClass ( selectMenu , "above-select" ) ;
2019-10-18 10:56:41 +02:00
selectMenu . style . setProperty ( "top" , "unset" , "important" ) ;
2019-10-23 11:10:01 +02:00
selectMenu . style . setProperty ( "bottom" , BDFDB . DOMUtils . getRects ( selectWrap ) . height + "px" , "important" ) ;
2019-10-18 10:56:41 +02:00
}
selectWrap . appendChild ( selectMenu ) ;
BDFDB . initElements ( selectMenu ) ;
BDFDB . ListenerUtils . addToChildren ( selectMenu , "mouseenter" , BDFDB . dotCN . selectoption + BDFDB . notCN . selectoptionselectlight + BDFDB . notCN . selectoptionselectdark , e2 => {
if ( dark ) {
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . removeClass ( e2 . currentTarget , BDFDB . disCN . selectoptiondark ) ;
BDFDB . DOMUtils . addClass ( e2 . currentTarget , BDFDB . disCN . selectoptionhoverdark ) ;
2019-10-18 10:56:41 +02:00
}
else {
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . removeClass ( e2 . currentTarget , BDFDB . disCN . selectoptionlight ) ;
BDFDB . DOMUtils . addClass ( e2 . currentTarget , BDFDB . disCN . selectoptionhoverlight ) ;
2019-10-18 10:56:41 +02:00
}
} ) ;
BDFDB . ListenerUtils . addToChildren ( selectMenu , "mouseleave" , BDFDB . dotCN . selectoption + BDFDB . notCN . selectoptionselectlight + BDFDB . notCN . selectoptionselectdark , e2 => {
if ( dark ) {
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . removeClass ( e2 . currentTarget , BDFDB . disCN . selectoptionhoverdark ) ;
BDFDB . DOMUtils . addClass ( e2 . currentTarget , BDFDB . disCN . selectoptiondark ) ;
2019-10-18 10:56:41 +02:00
}
else {
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . removeClass ( e2 . currentTarget , BDFDB . disCN . selectoptionhoverlight ) ;
BDFDB . DOMUtils . addClass ( e2 . currentTarget , BDFDB . disCN . selectoptionlight ) ;
2019-10-18 10:56:41 +02:00
}
} ) ;
BDFDB . ListenerUtils . addToChildren ( selectMenu , "mousedown" , BDFDB . dotCN . selectoption , e2 => {
2019-10-23 11:10:01 +02:00
if ( ! BDFDB . DOMUtils . getParent ( BDFDB . dotCN . giffavoritebutton , e2 . target ) ) {
2019-10-18 10:56:41 +02:00
var newchoice = e2 . currentTarget . getAttribute ( "value" ) ;
selectWrap . setAttribute ( "value" , newchoice ) ;
callback ( selectWrap , type , newchoice ) ;
}
} ) ;
var removeMenu = e2 => {
2019-10-23 11:10:01 +02:00
if ( e2 . target . parentElement != selectMenu && ! BDFDB . DOMUtils . getParent ( BDFDB . dotCN . giffavoritebutton , e2 . target ) ) {
2019-10-18 10:56:41 +02:00
document . removeEventListener ( "mousedown" , removeMenu ) ;
selectMenu . remove ( ) ;
2019-11-01 10:14:50 +01:00
BDFDB . TimeUtils . timeout ( _ => { BDFDB . DOMUtils . removeClass ( selectWrap , BDFDB . disCN . selectisopen ) ; } , 100 ) ;
2019-10-18 10:56:41 +02:00
}
} ;
document . addEventListener ( "mousedown" , removeMenu ) ;
return selectMenu ;
} ;
2019-10-30 13:27:14 +01:00
2019-10-30 13:31:49 +01:00
BDFDB . ModalUtils = { } ;
2019-10-30 13:27:14 +01:00
BDFDB . ModalUtils . open = function ( plugin , config ) {
2019-10-18 10:56:41 +02:00
if ( ! BDFDB . ObjectUtils . is ( plugin ) || ! BDFDB . ObjectUtils . is ( config ) ) return ;
2019-11-22 11:47:26 +01:00
var modal , modalInstance , headerchildren = [ ] , contentchildren = [ ] , footerchildren = [ ] , modalprops , cancels = [ ] , closeModal = _ => {
2019-10-18 10:56:41 +02:00
if ( BDFDB . ObjectUtils . is ( modalprops ) && typeof modalprops . onClose == "function" ) modalprops . onClose ( ) ;
} ;
if ( typeof config . text == "string" ) {
2020-02-08 11:14:10 +01:00
contentchildren . push ( BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . TextElement , {
color : InternalComponents . LibraryComponents . TextElement . Colors . PRIMARY ,
2019-10-29 21:05:50 +01:00
children : config . text
2019-10-18 10:56:41 +02:00
} ) ) ;
}
if ( config . children ) {
2019-11-07 15:58:58 +01:00
let selectedtab , tabbaritems = [ ] ;
2019-11-22 14:26:12 +01:00
for ( let child of [ config . children ] . flat ( 10 ) . filter ( n => n ) ) if ( LibraryModules . React . isValidElement ( child ) ) {
2020-02-08 11:14:10 +01:00
if ( child . type == InternalComponents . LibraryComponents . ModalComponents . ModalTabContent ) {
2019-11-07 15:58:58 +01:00
if ( ! tabbaritems . length ) child . props . open = true ;
2019-10-18 10:56:41 +02:00
else delete child . props . open ;
2019-11-07 15:58:58 +01:00
tabbaritems . push ( { value : child . props . tab } ) ;
2019-10-18 10:56:41 +02:00
}
contentchildren . push ( child ) ;
}
2020-02-08 11:14:10 +01:00
if ( tabbaritems . length ) headerchildren . push ( BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex , {
2019-10-18 10:56:41 +02:00
className : BDFDB . disCN . tabbarcontainer ,
2020-02-08 11:14:10 +01:00
children : BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . TabBar , {
2019-10-18 10:56:41 +02:00
className : BDFDB . disCN . tabbar ,
2019-11-07 15:58:58 +01:00
itemClassName : BDFDB . disCN . tabbaritem ,
2020-02-08 11:14:10 +01:00
type : InternalComponents . LibraryComponents . TabBar . Types . TOP ,
2019-11-07 15:58:58 +01:00
items : tabbaritems ,
2019-10-18 10:56:41 +02:00
onItemSelect : ( value , instance ) => {
2019-11-25 10:45:58 +01:00
let tabContentInstances = BDFDB . ReactUtils . findOwner ( modal , { name : "BDFDB_ModalTabContent" , all : true , unlimited : true } ) ;
for ( let ins of tabContentInstances ) {
if ( ins . props . tab == value ) ins . props . open = true ;
else delete ins . props . open ;
2019-10-18 10:56:41 +02:00
}
2019-11-25 10:45:58 +01:00
BDFDB . ReactUtils . forceUpdate ( tabContentInstances ) ;
2019-10-18 10:56:41 +02:00
}
2019-11-12 19:26:46 +01:00
} )
2019-10-18 10:56:41 +02:00
} ) ) ;
}
2019-10-18 14:56:41 +02:00
if ( BDFDB . ArrayUtils . is ( config . buttons ) ) for ( let button of config . buttons ) {
2019-11-06 12:52:14 +01:00
let contents = typeof button . contents == "string" ? button . contents : null ;
2019-10-18 10:56:41 +02:00
if ( contents ) {
2020-02-08 11:14:10 +01:00
let color = typeof button . color == "string" && InternalComponents . LibraryComponents . Button . Colors [ button . color . toUpperCase ( ) ] ;
let look = typeof button . look == "string" && InternalComponents . LibraryComponents . Button . Looks [ button . look . toUpperCase ( ) ] ;
2019-10-18 10:56:41 +02:00
let click = typeof button . click == "function" ? button . click : _ => { } ;
if ( button . cancel ) cancels . push ( click ) ;
2020-02-08 11:14:10 +01:00
footerchildren . push ( BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Button , BDFDB . ObjectUtils . exclude ( Object . assign ( { } , button , {
look : look || ( color ? InternalComponents . LibraryComponents . Button . Looks . FILLED : InternalComponents . LibraryComponents . Button . Looks . LINK ) ,
color : color || InternalComponents . LibraryComponents . Button . Colors . PRIMARY ,
2019-10-18 10:56:41 +02:00
onClick : _ => {
if ( button . close ) closeModal ( ) ;
2019-11-22 11:47:26 +01:00
if ( ! ( button . close && button . cancel ) ) click ( modal , modalInstance ) ;
2019-10-18 10:56:41 +02:00
} ,
children : contents
2019-12-18 13:58:36 +01:00
} ) , "click" , "close" , "cancel" , "contents" ) ) ) ;
2019-10-18 10:56:41 +02:00
}
}
2019-11-22 10:40:34 +01:00
contentchildren = contentchildren . filter ( n => n && ( typeof n == "string" || BDFDB . ReactUtils . isValidElement ( n ) ) ) ;
headerchildren = headerchildren . filter ( n => n && ( typeof n == "string" || BDFDB . ReactUtils . isValidElement ( n ) ) ) ;
footerchildren = footerchildren . filter ( n => n && ( typeof n == "string" || BDFDB . ReactUtils . isValidElement ( n ) ) ) ;
2019-10-18 10:56:41 +02:00
if ( contentchildren . length ) {
if ( typeof config . onClose != "function" ) config . onClose = _ => { } ;
if ( typeof config . onOpen != "function" ) config . onOpen = _ => { } ;
let name = plugin . name || ( typeof plugin . getName == "function" ? plugin . getName ( ) : null ) ;
name = typeof name == "string" ? name : null ;
2020-02-08 11:14:10 +01:00
let size = typeof config . size == "string" && InternalComponents . LibraryComponents . ModalComponents . ModalSize [ config . size . toUpperCase ( ) ] ;
2019-10-18 10:56:41 +02:00
let oldTransitionState = 0 ;
LibraryModules . ModalUtils . openModal ( props => {
modalprops = props ;
2019-11-10 18:06:24 +01:00
return BDFDB . ReactUtils . createElement ( class BDFDB _Modal extends LibraryModules . React . Component {
2019-10-18 10:56:41 +02:00
render ( ) {
2020-02-08 11:14:10 +01:00
return BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . ModalComponents . ModalRoot , {
2019-11-10 18:06:24 +01:00
className : BDFDB . DOMUtils . formatClassName ( name && ` ${ name } -modal ` , BDFDB . disCN . modalwrapper , config . className ) ,
2020-02-08 11:14:10 +01:00
size : size || InternalComponents . LibraryComponents . ModalComponents . ModalSize . SMALL ,
2019-10-18 10:56:41 +02:00
transitionState : props . transitionState ,
children : [
2020-02-08 11:14:10 +01:00
BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . ModalComponents . ModalHeader , {
2019-11-10 18:06:24 +01:00
className : BDFDB . DOMUtils . formatClassName ( config . headerClassName , headerchildren . length && BDFDB . disCN . modalheaderhassibling ) ,
separator : config . headerSeparator || false ,
2019-10-18 10:56:41 +02:00
children : [
2020-02-08 11:14:10 +01:00
BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex . Child , {
2019-10-18 10:56:41 +02:00
children : [
2020-02-08 11:14:10 +01:00
BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . FormComponents . FormTitle , {
tag : InternalComponents . LibraryComponents . FormComponents . FormTitle . Tags . H4 ,
2019-10-18 10:56:41 +02:00
children : typeof config . header == "string" ? config . header : ""
} ) ,
2020-02-08 11:14:10 +01:00
BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . TextElement , {
size : InternalComponents . LibraryComponents . TextElement . Sizes . SMALL ,
color : InternalComponents . LibraryComponents . TextElement . Colors . PRIMARY ,
2019-10-18 10:56:41 +02:00
children : typeof config . subheader == "string" ? config . subheader : ( name || "" )
} )
]
} ) ,
2020-02-08 11:14:10 +01:00
BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . ModalComponents . ModalCloseButton , {
2019-10-18 10:56:41 +02:00
onClick : closeModal
} )
]
} ) ,
2020-02-08 11:14:10 +01:00
headerchildren . length ? BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex , {
2019-11-12 19:26:46 +01:00
grow : 0 ,
2019-11-12 22:28:33 +01:00
shrink : 0 ,
2019-10-18 10:56:41 +02:00
children : headerchildren
} ) : null ,
2020-02-08 11:14:10 +01:00
BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . ModalComponents . ModalContent , {
2019-11-10 18:06:24 +01:00
className : config . contentClassName ,
scroller : config . scroller ,
2019-10-18 10:56:41 +02:00
children : contentchildren
} ) ,
2020-02-08 11:14:10 +01:00
footerchildren . length ? BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . ModalComponents . ModalFooter , {
2019-11-10 18:06:24 +01:00
className : config . footerClassName ,
2019-10-18 10:56:41 +02:00
children : footerchildren
} ) : null
]
} ) ;
}
componentDidMount ( ) {
2019-11-22 11:47:26 +01:00
modalInstance = this ;
2019-10-20 20:57:23 +02:00
modal = BDFDB . ReactUtils . findDOMNode ( this ) ;
2019-11-07 16:08:13 +01:00
modal = modal && modal . parentElement ? modal . parentElement . querySelector ( BDFDB . dotCN . modalwrapper ) : null ;
2019-10-18 10:56:41 +02:00
if ( modal && props . transitionState == 2 && props . transitionState > oldTransitionState ) config . onOpen ( modal , this ) ;
oldTransitionState = props . transitionState ;
}
componentWillUnmount ( ) {
if ( modal && props . transitionState == 4 ) {
for ( let cancel of cancels ) cancel ( modal ) ;
config . onClose ( modal , this ) ;
}
}
} , props ) ;
} , {
onCloseRequest : closeModal
} ) ;
}
} ;
2019-10-30 13:27:14 +01:00
BDFDB . ModalUtils . confirm = function ( plugin , text , callback ) {
2019-10-18 10:56:41 +02:00
if ( ! BDFDB . ObjectUtils . is ( plugin ) || typeof text != "string" ) return ;
callback = typeof callback == "function" ? callback : _ => { } ;
2019-11-10 18:06:24 +01:00
BDFDB . ModalUtils . open ( plugin , { text , header : "Are you sure?" , className : BDFDB . disCN . modalconfirmmodal , scroller : false , buttons : [
2019-10-19 11:41:39 +02:00
{ contents : BDFDB . LanguageUtils . LanguageStrings . OKAY , close : true , color : "RED" , click : callback } ,
{ contents : BDFDB . LanguageUtils . LanguageStrings . CANCEL , close : true }
2019-10-18 10:56:41 +02:00
] } ) ;
} ;
2019-11-01 10:14:50 +01:00
BDFDB . ContextMenuUtils = { } ;
BDFDB . ContextMenuUtils . open = function ( plugin , e , children ) {
2019-10-18 10:56:41 +02:00
LibraryModules . ContextMenuUtils . openContextMenu ( e , function ( e ) {
2020-02-08 11:14:10 +01:00
return BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . ContextMenus . NativeContextMenu , Object . assign ( { } , e , {
2019-10-18 10:56:41 +02:00
BDFDBcontextMenu : true ,
type : BDFDB . DiscordConstants . ContextMenuTypes . NATIVE _TEXT ,
value : "" ,
2019-11-10 18:06:24 +01:00
className : BDFDB . disCN . contextmenu ,
children : children
2019-10-18 10:56:41 +02:00
} ) ) ;
} ) ;
} ;
2019-11-01 10:14:50 +01:00
BDFDB . ContextMenuUtils . close = function ( nodeOrInstance ) {
2019-10-18 10:56:41 +02:00
if ( ! BDFDB . ObjectUtils . is ( nodeOrInstance ) ) return ;
2019-10-22 00:28:52 +02:00
var instance = BDFDB . ReactUtils . findOwner ( nodeOrInstance , { props : "closeContextMenu" , up : true } ) ;
2019-10-18 10:56:41 +02:00
if ( BDFDB . ObjectUtils . is ( instance ) && instance . props && typeof instance . props . closeContextMenu == "function" ) instance . props . closeContextMenu ( ) ;
2019-12-20 14:44:57 +01:00
else BDFDB . LibraryModules . ContextMenuUtils . closeContextMenu ( ) ;
2019-10-18 10:56:41 +02:00
} ;
2019-10-23 11:10:01 +02:00
BDFDB . createSortPopout = function ( anker , markup , callback ) {
if ( ! anker || ! markup || typeof callback != "function" || BDFDB . DOMUtils . containsClass ( anker , "popout-open" ) ) return ;
var popouts = document . querySelector ( BDFDB . dotCN . popouts ) ;
var valueinput = anker . querySelector ( BDFDB . dotCNC . quickselectvalue + BDFDB . dotCN . recentmentionsmentionfiltervalue ) ;
if ( ! popouts || ! valueinput ) return ;
BDFDB . DOMUtils . addClass ( anker , "popout-open" ) ;
var popout = BDFDB . DOMUtils . create ( markup ) ;
var ankerrects = BDFDB . DOMUtils . getRects ( anker ) ;
popout . style . setProperty ( "left" , ankerrects . left + ankerrects . width + "px" ) ;
popout . style . setProperty ( "top" , ankerrects . top + BDFDB . DOMUtils . getRects ( valueinput ) . height + "px" ) ;
BDFDB . DOMUtils . addClass ( popout . querySelector ( BDFDB . dotCN . contextmenu ) , BDFDB . DiscordUtils . getTheme ( ) ) ;
BDFDB . ListenerUtils . addToChildren ( popout , "click" , BDFDB . dotCN . contextmenuitem , e => {
valueinput . innerText = e . currentTarget . innerText ;
valueinput . setAttribute ( "option" , e . currentTarget . getAttribute ( "option" ) ) ;
document . removeEventListener ( "mousedown" , mousedown ) ;
popout . remove ( ) ;
2019-11-01 10:14:50 +01:00
BDFDB . TimeUtils . timeout ( _ => { BDFDB . DOMUtils . removeClass ( anker , "popout-open" ) ; } , 300 ) ;
2019-10-23 11:10:01 +02:00
callback ( ) ;
2019-10-18 10:56:41 +02:00
} ) ;
2019-10-23 11:10:01 +02:00
popouts . appendChild ( popout ) ;
BDFDB . initElements ( popout ) ;
var mousedown = e => {
if ( ! document . contains ( popout ) ) document . removeEventListener ( "mousedown" , mousedown ) ;
else if ( ! popout . contains ( e . target ) ) {
document . removeEventListener ( "mousedown" , mousedown ) ;
popout . remove ( ) ;
2019-11-01 10:14:50 +01:00
BDFDB . TimeUtils . timeout ( _ => { BDFDB . DOMUtils . removeClass ( anker , "popout-open" ) ; } , 300 ) ;
2019-10-23 11:10:01 +02:00
}
} ;
document . addEventListener ( "mousedown" , mousedown ) ;
} ;
// REMOVE ONCE REWRITTEN
var setSwatch = ( swatch , color , selected ) => {
if ( ! swatch ) return ;
else if ( selected ) {
BDFDB . DOMUtils . addClass ( swatch , BDFDB . disCN . colorpickerswatchselected ) ;
var iscustom = BDFDB . DOMUtils . containsClass ( swatch , BDFDB . disCN . colorpickerswatchcustom ) ;
var isgradient = color && BDFDB . ObjectUtils . is ( color ) ;
var selectedcolor = BDFDB . ObjectUtils . is ( color ) ? BDFDB . ColorUtils . createGradient ( color ) : BDFDB . ColorUtils . convert ( color , "RGBA" ) ;
var bright = selectedcolor && ! isgradient ? BDFDB . ColorUtils . isBright ( selectedcolor ) : false ;
if ( ! swatch . querySelector ( ` svg[name="Checkmark"] ` ) ) swatch . appendChild ( BDFDB . DOMUtils . create ( ` <svg class="swatch-checkmark" name="Checkmark" aria-hidden="false" width=" ${ iscustom ? 32 : 16 } " height=" ${ iscustom ? 24 : 16 } " viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><polyline stroke=" ${ bright ? "#000000" : "#ffffff" } " stroke-width="2" points="3.5 9.5 7 13 15 5"></polyline></g></svg> ` ) ) ;
if ( iscustom ) {
BDFDB . DOMUtils . removeClass ( swatch , BDFDB . disCN . colorpickerswatchnocolor ) ;
swatch . querySelector ( BDFDB . dotCN . colorpickerswatchdropperfg ) . setAttribute ( "fill" , bright ? "#000000" : "#ffffff" ) ;
if ( selectedcolor ) {
if ( isgradient ) swatch . gradient = color ;
swatch . style . setProperty ( isgradient ? "background-image" : "background-color" , selectedcolor , "important" ) ;
2019-10-18 10:56:41 +02:00
}
}
}
2019-10-23 11:10:01 +02:00
else {
delete swatch . gradient ;
2019-11-18 15:41:40 +01:00
BDFDB . DOMUtils . removeClass ( swatch , BDFDB . disCN . colorpickerswatchselected ) ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . remove ( swatch . querySelectorAll ( ".swatch-checkmark" ) ) ;
if ( BDFDB . DOMUtils . containsClass ( swatch , BDFDB . disCN . colorpickerswatchcustom ) ) {
BDFDB . DOMUtils . addClass ( swatch , BDFDB . disCN . colorpickerswatchnocolor ) ;
swatch . querySelector ( BDFDB . dotCN . colorpickerswatchdropperfg ) . setAttribute ( "fill" , "#ffffff" ) ;
swatch . style . removeProperty ( "background-color" ) ;
swatch . style . removeProperty ( "background-image" ) ;
2019-10-18 10:56:41 +02:00
}
2019-10-23 11:10:01 +02:00
}
} ;
// REMOVE ONCE REWRITTEN
BDFDB . setColorSwatches = function ( container , currentcolor ) {
if ( ! Node . prototype . isPrototypeOf ( container ) ) return ;
var swatches = container . querySelector ( ` ${ BDFDB . dotCN . colorpickerswatches } :not([number]) ` ) ;
if ( ! swatches ) return ;
swatches . setAttribute ( "number" , parseInt ( container . querySelectorAll ( ` ${ BDFDB . dotCN . colorpickerswatches } [number] ` ) . length + 1 ) ) ;
var colorlist = [ null , "rgba(82,233,30,1)" , "rgba(46,204,113,1)" , "rgba(26,188,156,1)" , "rgba(52,152,219,1)" , "rgba(52,84,219,1)" , "rgba(134,30,233,1)" , "rgba(155,89,182,1)" , "rgba(233,30,99,1)" , "rgba(233,65,30,1)" , "rgba(231,76,60,1)" , "rgba(230,126,34,1)" , "rgba(241,196,15,1)" , "rgba(199,204,205,1)" , "rgba(112,128,136,1)" , "rgba(99,99,99,1)" , "rgba(255,255,255,1)" , "rgba(59,173,20,1)" , "rgba(31,139,76,1)" , "rgba(17,128,106,1)" , "rgba(32,102,148,1)" , "rgba(32,57,148,1)" , "rgba(109,20,173,1)" , "rgba(113,54,138,1)" , "rgba(173,20,87,1)" , "rgba(173,32,20,1)" , "rgba(153,45,34,1)" , "rgba(168,67,0,1)" , "rgba(194,124,14,1)" , "rgba(151,156,159,1)" , "rgba(93,104,109,1)" , "rgba(44,44,44,1)" ] ;
var colorrows = [ colorlist . slice ( 0 , parseInt ( colorlist . length / 2 ) ) , colorlist . slice ( parseInt ( colorlist . length / 2 ) ) ] ;
colorlist . shift ( ) ;
swatches . appendChild ( BDFDB . DOMUtils . create ( ` <div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . horizontal + BDFDB . disCNS . justifystart + BDFDB . disCNS . alignstretch + BDFDB . disCNS . nowrap + BDFDB . disCN . margintop8 } " style="flex: 1 1 auto;"><div class=" ${ BDFDB . disCN . marginreset } " style="flex: 0 0 auto;"><div aria-label="" class=""><button type="button" class=" ${ BDFDB . disCNS . colorpickerswatch + BDFDB . disCNS . colorpickerswatchcustom + BDFDB . disCN . colorpickerswatchnocolor } " style="margin-left: 0;"><svg class=" ${ BDFDB . disCN . colorpickerswatchdropper } " width="14" height="14" viewBox="0 0 16 16"><g fill="none"><path d="M-4-4h24v24H-4z"/><path class=" ${ BDFDB . disCN . colorpickerswatchdropperfg } " fill="#ffffff" d="M14.994 1.006C13.858-.257 11.904-.3 10.72.89L8.637 2.975l-.696-.697-1.387 1.388 5.557 5.557 1.387-1.388-.697-.697 1.964-1.964c1.13-1.13 1.3-2.985.23-4.168zm-13.25 10.25c-.225.224-.408.48-.55.764L.02 14.37l1.39 1.39 2.35-1.174c.283-.14.54-.33.765-.55l4.808-4.808-2.776-2.776-4.813 4.803z"/></g></svg></button></div></div><div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . vertical + BDFDB . disCNS . justifystart + BDFDB . disCNS . alignstretch + BDFDB . disCNS . nowrap + BDFDB . disCN . flexmarginreset } " style="flex: 1 1 auto;"> ${ colorrows . map ( row => ` <div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . horizontal + BDFDB . disCNS . justifystart + BDFDB . disCNS . alignstretch + BDFDB . disCNS . wrap + BDFDB . disCN . colorpickerrow } "> ` + row . map ( c => ` <button type="button" class=" ${ BDFDB . disCN . colorpickerswatch + ( c ? "" : ( " " + BDFDB . disCN . colorpickerswatchnocolor ) ) } " style="background-color: ${ c } ;"></button> ` ) . join ( "" ) + ` </div> ` ) . join ( "" ) } </div></div> ` ) ) ;
if ( currentcolor && ! BDFDB . ColorUtils . compare ( currentcolor , [ 0 , 0 , 0 , 0 ] ) ) {
var selection = colorlist . indexOf ( BDFDB . ColorUtils . convert ( currentcolor , "RGBA" ) ) ;
setSwatch ( selection > - 1 ? swatches . querySelectorAll ( BDFDB . dotCNS . colorpickerrow + BDFDB . dotCN . colorpickerswatch + BDFDB . notCN . colorpickerswatchnocolor ) [ selection ] : swatches . querySelector ( BDFDB . dotCN . colorpickerswatch + BDFDB . dotCN . colorpickerswatchcustom ) , currentcolor , true ) ;
}
else setSwatch ( swatches . querySelector ( BDFDB . dotCNS . colorpickerrow + BDFDB . dotCN . colorpickerswatch + BDFDB . dotCN . colorpickerswatchnocolor ) , null , true ) ;
BDFDB . ListenerUtils . addToChildren ( swatches , "click" , BDFDB . dotCN . colorpickerswatch , e => {
2019-11-18 15:41:40 +01:00
if ( BDFDB . DOMUtils . containsClass ( swatches , BDFDB . disCN . colorpickerswatchesdisabled ) || BDFDB . DOMUtils . containsClass ( e . currentTarget , BDFDB . disCN . colorpickerswatchdisabled ) ) return ;
2019-10-23 11:10:01 +02:00
else if ( BDFDB . DOMUtils . containsClass ( e . currentTarget , BDFDB . disCN . colorpickerswatchcustom ) ) {
BDFDB . ColorUtils . openPicker ( swatches , e . currentTarget , e . currentTarget . gradient || e . currentTarget . style . getPropertyValue ( "background-color" ) ) ;
2019-10-18 10:56:41 +02:00
}
else {
2019-10-23 11:10:01 +02:00
setSwatch ( swatches . querySelector ( BDFDB . dotCN . colorpickerswatch + BDFDB . dotCN . colorpickerswatchselected ) , null , false ) ;
setSwatch ( e . currentTarget , e . currentTarget . style . getPropertyValue ( "background-color" ) , true ) ;
2019-10-18 10:56:41 +02:00
}
2019-10-23 11:10:01 +02:00
} ) ;
BDFDB . ListenerUtils . addToChildren ( swatches , "mouseenter" , BDFDB . dotCN . colorpickerswatch + BDFDB . dotCN . colorpickerswatchcustom , e => {
BDFDB . TooltipUtils . create ( e . currentTarget , BDFDB . LanguageUtils . LanguageStrings . CUSTOM _COLOR , { type : "bottom" } ) ;
} ) ;
BDFDB . ListenerUtils . addToChildren ( swatches , "mouseenter" , BDFDB . dotCNS . colorpickerrow + BDFDB . dotCN . colorpickerswatch + BDFDB . dotCN . colorpickerswatchnocolor , e => {
BDFDB . TooltipUtils . create ( e . currentTarget , BDFDB . LanguageUtils . LanguageStrings . DEFAULT , { type : "bottom" } ) ;
} ) ;
2019-10-18 10:56:41 +02:00
} ;
2019-11-01 10:14:50 +01:00
BDFDB . TimeUtils = { } ;
BDFDB . TimeUtils . interval = function ( callback , delay ) {
if ( typeof callback != "function" || typeof delay != "number" || delay < 1 ) return ;
2019-11-28 14:11:05 +01:00
else return setInterval ( _ => { BDFDB . TimeUtils . suppress ( callback , "Interval" ) ( ) ; } , delay ) ;
2019-11-01 10:14:50 +01:00
} ;
BDFDB . TimeUtils . timeout = function ( callback , delay ) {
if ( typeof callback != "function" ) return ;
2019-11-28 14:11:05 +01:00
else if ( typeof delay != "number" || delay < 1 ) return setImmediate ( _ => { BDFDB . TimeUtils . suppress ( callback , "Immediate" ) ( ) ; } ) ;
else return setTimeout ( _ => { BDFDB . TimeUtils . suppress ( callback , "Timeout" ) ( ) ; } , delay ) ;
2019-11-01 10:14:50 +01:00
} ;
2019-11-01 11:09:32 +01:00
BDFDB . TimeUtils . clear = function ( ... timeobjects ) {
2019-11-22 14:26:12 +01:00
for ( let t of timeobjects . flat ( 10 ) . filter ( n => n ) ) {
2019-11-01 11:09:32 +01:00
if ( typeof t == "number" ) {
clearInterval ( t ) ;
clearTimeout ( t ) ;
}
else if ( typeof t == "object" ) clearImmediate ( t ) ;
}
2019-11-01 10:14:50 +01:00
} ;
BDFDB . TimeUtils . suppress = function ( callback , string , name ) { return function ( ... args ) {
try { return callback ( ... args ) ; }
catch ( err ) {
if ( typeof string != "string" ) string = "" ;
BDFDB . LogUtils . error ( string + " " + err , name ) ;
}
} } ;
2019-10-23 11:10:01 +02:00
BDFDB . StringUtils = { } ;
BDFDB . StringUtils . htmlEscape = function ( string ) {
var ele = document . createElement ( "div" ) ;
ele . innerText = string ;
return ele . innerHTML ;
} ;
BDFDB . StringUtils . regEscape = function ( string ) {
2019-11-10 23:44:01 +01:00
return typeof string == "string" && string . replace ( /([\-\/\\\^\$\*\+\?\.\(\)\|\[\]\{\}])/g , "\\$1" ) ;
2019-10-23 11:10:01 +02:00
} ;
BDFDB . StringUtils . insertNRST = function ( string ) {
2019-11-10 23:44:01 +01:00
return typeof string == "string" && string . replace ( /\\r/g , "\r" ) . replace ( /\\n/g , "\n" ) . replace ( /\\t/g , "\t" ) . replace ( /\\s/g , " " ) ;
2019-10-23 11:10:01 +02:00
} ;
2019-11-10 23:44:01 +01:00
BDFDB . StringUtils . highlight = function ( string , searchstring , prefix = ` <span class=" ${ BDFDB . disCN . highlight } "> ` , suffix = ` </span> ` ) {
if ( typeof string != "string" || ! searchstring || searchstring . length < 1 ) return string ;
var offset = 0 , original = string ;
BDFDB . ArrayUtils . getAllIndexes ( string . toUpperCase ( ) , searchstring . toUpperCase ( ) ) . forEach ( index => {
2019-11-01 10:14:50 +01:00
var d1 = offset * ( prefix . length + suffix . length ) ;
index = index + d1 ;
var d2 = index + searchstring . length ;
2019-11-10 23:44:01 +01:00
var d3 = [ - 1 ] . concat ( BDFDB . ArrayUtils . getAllIndexes ( string . substring ( 0 , index ) , "<" ) ) ;
var d4 = [ - 1 ] . concat ( BDFDB . ArrayUtils . getAllIndexes ( string . substring ( 0 , index ) , ">" ) ) ;
2019-11-01 10:14:50 +01:00
if ( d3 [ d3 . length - 1 ] > d4 [ d4 . length - 1 ] ) return ;
2019-11-10 23:44:01 +01:00
string = string . substring ( 0 , index ) + prefix + string . substring ( index , d2 ) + suffix + string . substring ( d2 ) ;
2019-11-01 10:14:50 +01:00
offset ++ ;
} ) ;
2019-11-10 23:44:01 +01:00
return string || original ;
2019-11-01 10:14:50 +01:00
} ;
2019-10-23 11:10:01 +02:00
2020-01-21 12:24:42 +01:00
BDFDB . SlateUtils = { } ;
BDFDB . SlateUtils . isRichValue = function ( richValue ) {
return BDFDB . ObjectUtils . is ( richValue ) && LibraryModules . SlateUtils . deserialize ( "" ) . constructor . prototype . isPrototypeOf ( richValue ) ;
} ;
BDFDB . SlateUtils . copyRichValue = function ( string , richValue ) {
let newRichValue = LibraryModules . SlateUtils . deserialize ( string ) ;
if ( BDFDB . SlateUtils . isRichValue ( richValue ) && richValue . _map && richValue . _map . _root && BDFDB . ArrayUtils . is ( richValue . _map . _root . entries ) ) {
for ( let i in richValue . _map . _root . entries ) if ( richValue . _map . _root . entries [ i ] [ 0 ] == "selection" ) {
newRichValue . _map . _root . entries [ i ] = richValue . _map . _root . entries [ i ] ;
break ;
}
}
return newRichValue ;
} ;
BDFDB . SlateUtils . hasOpenPlainTextCodeBlock = function ( editor ) {
let richValue = BDFDB . ReactUtils . getValue ( editor , "props.richValue" ) ;
if ( ! BDFDB . SlateUtils . isRichValue ( richValue ) ) return false ;
let codeMatches = BDFDB . LibraryModules . SlateSelectionUtils . serializeSelection ( richValue . document , {
start : {
key : richValue . document . getFirstText ( ) . key ,
offset : 0
} ,
end : richValue . selection . start
} , "raw" ) . match ( /```/g ) ;
return codeMatches && codeMatches . length && codeMatches . length % 2 != 0 ;
} ;
BDFDB . SlateUtils . getCurrentWord = function ( editor ) {
let richValue = BDFDB . ReactUtils . getValue ( editor , "props.richValue" ) ;
2020-01-21 12:56:26 +01:00
if ( ! BDFDB . SlateUtils . isRichValue ( richValue ) || ! richValue . selection . isCollapsed || BDFDB . SlateUtils . hasOpenPlainTextCodeBlock ( editor ) || richValue . document . text . trim ( ) . length == 0 ) return { word : null , isAtStart : false } ;
2020-01-21 12:24:42 +01:00
if ( editor . props . useSlate ) {
if ( richValue . document . text . startsWith ( "/giphy " ) || richValue . document . text . startsWith ( "/tenor " ) ) {
let node = richValue . document . getNode ( richValue . selection . start . key ) ;
if ( node ) return {
word : node . text . substring ( 0 , richValue . selection . start . offset ) ,
isAtStart : true
}
}
let node = richValue . document . getNode ( richValue . selection . start . key ) ;
if ( node == null ) return {
word : null ,
isAtStart : false
} ;
let word = "" , atStart = false ;
let offset = richValue . selection . start . offset ;
let block = richValue . document . getClosestBlock ( node . key ) ;
while ( true ) {
if ( -- offset < 0 ) {
if ( ( node = block . getPreviousNode ( node . key ) == null ) ) {
atStart = true ;
break ;
}
if ( node . object !== "text" ) break ;
offset = node . text . length - 1 ;
}
if ( node . object !== "text" ) break ;
let prefix = node . text [ offset ] ;
if ( /(\t|\s)/ . test ( prefix ) ) break ;
word = prefix + word ;
}
return {
word : ! word ? null : word ,
isAtStart : atStart && block . type == "line" && richValue . document . nodes . get ( 0 ) === block
} ;
}
else {
2020-01-21 12:56:26 +01:00
let textarea = BDFDB . ReactUtils . findDOMNode ( editor . ref . current ) ;
if ( ! Node . prototype . isPrototypeOf ( textarea ) || textarea . tagName != "TEXTAREA" || ! textarea . value . length || /\s/ . test ( textarea . value . slice ( textarea . selectionStart , textarea . selectionEnd ) ) ) return {
2020-01-21 12:24:42 +01:00
word : null ,
isAtStart : true
} ;
2020-01-21 12:56:26 +01:00
else {
if ( textarea . selectionEnd == textarea . value . length ) {
let words = textarea . value . split ( /\s/ ) . reverse ( ) ;
return {
word : ! words [ 0 ] ? null : words [ 0 ] ,
isAtStart : words . length > 1
} ;
}
else {
let chars = textarea . value . split ( "" ) , word = "" , currentWord = "" , isCurrentWord = false , isAtStart = true ;
for ( let i in chars ) {
if ( i == textarea . selectionStart ) isCurrentWord = true ;
if ( /\s/ . test ( chars [ i ] ) ) {
word = "" ;
isAtStart = currentWord . length > 0 && isAtStart || false ;
isCurrentWord = false ;
}
else {
word += chars [ i ] ;
if ( isCurrentWord ) currentWord = word ;
}
}
return {
word : ! currentWord ? null : currentWord ,
isAtStart : isAtStart
} ;
}
}
2020-01-21 12:24:42 +01:00
}
} ;
2019-10-23 11:10:01 +02:00
BDFDB . NumberUtils = { } ;
BDFDB . NumberUtils . formatBytes = function ( bytes , sigdigits ) {
bytes = parseInt ( bytes ) ;
if ( isNaN ( bytes ) || bytes < 0 ) return "0 Bytes" ;
if ( bytes == 1 ) return "1 Byte" ;
var size = Math . floor ( Math . log ( bytes ) / Math . log ( 1024 ) ) ;
return parseFloat ( ( bytes / Math . pow ( 1024 , size ) ) . toFixed ( sigdigits < 1 ? 0 : sigdigits > 20 ? 20 : sigdigits || 2 ) ) + " " + [ "Bytes" , "KB" , "MB" , "GB" , "TB" , "PB" , "EB" , "ZB" , "YB" ] [ size ] ;
} ;
BDFDB . NumberUtils . mapRange = function ( from , to , value ) {
2019-10-18 10:56:41 +02:00
if ( parseFloat ( value ) < parseFloat ( from [ 0 ] ) ) return parseFloat ( to [ 0 ] ) ;
else if ( parseFloat ( value ) > parseFloat ( from [ 1 ] ) ) return parseFloat ( to [ 1 ] ) ;
else return parseFloat ( to [ 0 ] ) + ( parseFloat ( value ) - parseFloat ( from [ 0 ] ) ) * ( parseFloat ( to [ 1 ] ) - parseFloat ( to [ 0 ] ) ) / ( parseFloat ( from [ 1 ] ) - parseFloat ( from [ 0 ] ) ) ;
} ;
2019-10-23 11:10:01 +02:00
BDFDB . NumberUtils . generateId = function ( array ) {
array = BDFDB . ArrayUtils . is ( array ) ? array : [ ] ;
let id = Math . floor ( Math . random ( ) * 10000000000000000 ) ;
if ( array . includes ( id ) ) return BDFDB . NumberUtils . generateId ( array ) ;
else {
array . push ( id ) ;
return id ;
}
} ;
BDFDB . NumberUtils . compareVersions = function ( newv , oldv ) {
2019-10-18 10:56:41 +02:00
if ( ! newv || ! oldv ) return true ;
newv = newv . toString ( ) . replace ( /["'`]/g , "" ) . split ( /,|\./g ) . map ( n => parseInt ( n ) ) . filter ( n => ( n || n == 0 ) && ! isNaN ( n ) ) ;
oldv = oldv . toString ( ) . replace ( /["'`]/g , "" ) . split ( /,|\./g ) . map ( n => parseInt ( n ) ) . filter ( n => ( n || n == 0 ) && ! isNaN ( n ) ) ;
var length = Math . max ( newv . length , oldv . length ) ;
if ( ! length ) return true ;
if ( newv . length > oldv . length ) {
var temparray = new Array ( newv . length - oldv . length ) ;
for ( let i = 0 ; i < temparray . length ; i ++ ) temparray [ i ] = 0 ;
oldv = temparray . concat ( oldv ) ;
}
else if ( newv . length < oldv . length ) {
var temparray = new Array ( oldv . length - newv . length ) ;
for ( let i = 0 ; i < temparray . length ; i ++ ) temparray [ i ] = 0 ;
newv = temparray . concat ( newv ) ;
}
for ( let i = 0 ; i < length ; i ++ ) for ( let ioutdated = false , j = 0 ; j <= i ; j ++ ) {
if ( j == i && newv [ j ] < oldv [ j ] ) return false ;
if ( j < i ) ioutdated = newv [ j ] == oldv [ j ] ;
if ( ( j == 0 || ioutdated ) && j == i && newv [ j ] > oldv [ j ] ) return true ;
}
return false ;
} ;
2019-10-23 11:10:01 +02:00
BDFDB . NumberUtils . getVersionDifference = function ( newv , oldv ) {
2019-10-18 10:56:41 +02:00
if ( ! newv || ! oldv ) return false ;
newv = newv . toString ( ) . replace ( /["'`]/g , "" ) . split ( /,|\./g ) . map ( n => parseInt ( n ) ) . filter ( n => ( n || n == 0 ) && ! isNaN ( n ) ) ;
oldv = oldv . toString ( ) . replace ( /["'`]/g , "" ) . split ( /,|\./g ) . map ( n => parseInt ( n ) ) . filter ( n => ( n || n == 0 ) && ! isNaN ( n ) ) ;
var length = Math . max ( newv . length , oldv . length ) ;
if ( ! length ) return false ;
if ( newv . length > oldv . length ) {
var temparray = new Array ( newv . length - oldv . length ) ;
for ( let i = 0 ; i < temparray . length ; i ++ ) temparray [ i ] = 0 ;
oldv = temparray . concat ( oldv ) ;
}
else if ( newv . length < oldv . length ) {
var temparray = new Array ( oldv . length - newv . length ) ;
for ( let i = 0 ; i < temparray . length ; i ++ ) temparray [ i ] = 0 ;
newv = temparray . concat ( newv ) ;
}
var oldvvalue = 0 , newvvalue = 0 ;
for ( let i in oldv . reverse ( ) ) oldvvalue += ( oldv [ i ] * ( 10 * * i ) ) ;
for ( let i in newv . reverse ( ) ) newvvalue += ( newv [ i ] * ( 10 * * i ) ) ;
return ( newvvalue - oldvvalue ) / ( 10 * * ( length - 1 ) ) ;
} ;
BDFDB . DiscordUtils = { } ;
2019-11-30 11:29:12 +01:00
BDFDB . DiscordUtils . openLink = function ( url , inbuilt , minimized ) {
2019-11-30 11:00:58 +01:00
if ( ! inbuilt ) window . open ( url , "_blank" ) ;
2019-11-29 19:02:47 +01:00
else {
let browserWindow = new LibraryRequires . electron . remote . BrowserWindow ( {
frame : true ,
resizeable : true ,
show : true ,
2019-11-30 11:29:12 +01:00
darkTheme : BDFDB . DiscordUtils . getTheme ( ) == BDFDB . disCN . themedark ,
2019-11-29 19:02:47 +01:00
webPreferences : {
nodeIntegration : false ,
nodeIntegrationInWorker : false
}
} ) ;
browserWindow . setMenu ( null ) ;
browserWindow . loadURL ( url ) ;
2019-11-30 11:29:12 +01:00
if ( minimized ) browserWindow . minimize ( null ) ;
2019-11-29 19:02:47 +01:00
}
} ;
2019-10-18 10:56:41 +02:00
BDFDB . DiscordUtils . getFolder = function ( ) {
var built = BDFDB . DiscordUtils . getBuilt ( ) ;
built = "discord" + ( built == "stable" ? "" : built ) ;
return LibraryRequires . path . resolve ( LibraryRequires . electron . remote . app . getPath ( "appData" ) , built , BDFDB . DiscordUtils . getVersion ( ) ) ;
} ;
BDFDB . DiscordUtils . getBuilt = function ( ) {
if ( BDFDB . DiscordUtils . getBuilt . built ) return BDFDB . DiscordUtils . getBuilt . built ;
else {
var built = null ;
try { built = require ( LibraryRequires . electron . remote . app . getAppPath ( ) + "/build_info.json" ) . releaseChannel . toLowerCase ( ) ; }
catch ( err ) {
try { built = require ( LibraryRequires . electron . remote . app . getAppPath ( ) . replace ( "\app.asar" , "" ) + "/build_info.json" ) . releaseChannel . toLowerCase ( ) ; }
catch ( err ) {
var version = BDFDB . DiscordUtils . getVersion ( ) ;
if ( version ) {
version = version . split ( "." ) ;
if ( version . length == 3 && ! isNaN ( version = parseInt ( version [ 2 ] ) ) ) built = version > 300 ? "stable" : da > 200 ? "canary" : "ptb" ;
else built = "stable" ;
}
else built = "stable" ;
}
}
BDFDB . DiscordUtils . getBuilt . built = built ;
return built ;
}
} ;
BDFDB . DiscordUtils . getVersion = function ( ) {
if ( BDFDB . DiscordUtils . getBuilt . version ) return BDFDB . DiscordUtils . getBuilt . version ;
else {
var version = null ;
try { version = LibraryRequires . electron . remote . app . getVersion ( ) ; }
2019-11-01 10:14:50 +01:00
catch ( err ) { version = "" ; }
2019-10-18 10:56:41 +02:00
BDFDB . DiscordUtils . getBuilt . version = version ;
return version ;
}
} ;
2020-01-31 14:20:53 +01:00
BDFDB . DiscordUtils . isDevModeEnabled = function ( ) {
return LibraryModules . StoreUtils . get ( "UserSettingsStore" ) . developerMode ;
} ;
2019-10-18 10:56:41 +02:00
BDFDB . DiscordUtils . getTheme = function ( ) {
2020-01-31 14:20:53 +01:00
return LibraryModules . StoreUtils . get ( "UserSettingsStore" ) . theme == "dark" ? BDFDB . disCN . themedark : BDFDB . disCN . themelight ;
2019-10-18 10:56:41 +02:00
} ;
BDFDB . DiscordUtils . getMode = function ( ) {
2020-01-31 14:20:53 +01:00
return LibraryModules . StoreUtils . get ( "UserSettingsStore" ) . message _display _compact ? "compact" : "cozy" ;
2019-10-18 10:56:41 +02:00
} ;
BDFDB . DiscordUtils . getZoomFactor = function ( ) {
2019-10-23 11:10:01 +02:00
var arects = BDFDB . DOMUtils . getRects ( document . querySelector ( BDFDB . dotCN . appmount ) ) ;
2019-10-18 10:56:41 +02:00
var widthzoom = Math . round ( 100 * window . outerWidth / arects . width ) ;
var heightzoom = Math . round ( 100 * window . outerHeight / arects . height ) ;
return widthzoom < heightzoom ? widthzoom : heightzoom ;
} ;
BDFDB . DiscordUtils . getFontScale = function ( ) {
return parseInt ( document . firstElementChild . style . fontSize . replace ( "%" , "" ) ) ;
} ;
BDFDB . DiscordUtils . shake = function ( ) {
2019-10-20 20:57:23 +02:00
BDFDB . ReactUtils . getInstance ( document . querySelector ( BDFDB . dotCN . appold ) ) . return . stateNode . shake ( ) ;
2019-10-18 10:56:41 +02:00
} ;
2019-12-07 10:21:17 +01:00
BDFDB . WindowUtils = { } ;
BDFDB . WindowUtils . open = function ( plugin , url , options ) {
if ( ! BDFDB . ObjectUtils . is ( plugin ) || ! url ) return ;
if ( ! BDFDB . ArrayUtils . is ( plugin . browserWindows ) ) plugin . browserWindows = [ ] ;
let browserWindow = new LibraryRequires . electron . remote . BrowserWindow ( Object . assign ( {
show : false ,
webPreferences : {
nodeIntegration : true ,
nodeIntegrationInWorker : true
}
} , options ) ) ;
2020-01-21 14:53:15 +01:00
if ( typeof browserWindow . removeMenu == "function" ) browserWindow . removeMenu ( ) ;
else browserWindow . setMenu ( null ) ;
2019-12-07 10:21:17 +01:00
browserWindow . loadURL ( url ) ;
plugin . browserWindows . push ( browserWindow ) ;
2019-12-07 10:43:46 +01:00
return browserWindow ;
2019-12-07 10:21:17 +01:00
} ;
BDFDB . WindowUtils . close = function ( browserWindow ) {
2019-12-07 10:40:37 +01:00
if ( BDFDB . ObjectUtils . is ( browserWindow ) && ! browserWindow . isDestroyed ( ) && browserWindow . closeable ) browserWindow . close ( ) ;
2019-12-07 10:21:17 +01:00
} ;
BDFDB . WindowUtils . closeAll = function ( plugin ) {
2019-12-07 10:40:37 +01:00
if ( BDFDB . ObjectUtils . is ( plugin ) && BDFDB . ArrayUtils . is ( plugin . browserWindows ) ) {
for ( let browserWindow of plugin . browserWindows ) BDFDB . WindowUtils . close ( browserWindow ) ;
plugin . browserWindows = [ ] ;
}
2019-12-07 10:21:17 +01:00
} ;
BDFDB . WindowUtils . addListener = function ( plugin , actions , callback ) {
if ( ! BDFDB . ObjectUtils . is ( plugin ) || ! actions || typeof callback != "function" ) return ;
2019-12-07 10:26:28 +01:00
BDFDB . WindowUtils . removeListener ( plugin , actions ) ;
2019-12-07 10:21:17 +01:00
for ( let action of actions . split ( " " ) ) {
action = action . split ( "." ) ;
2019-12-07 10:40:37 +01:00
let eventname = action . shift ( ) ;
2019-12-07 10:21:17 +01:00
if ( ! eventname ) return ;
let namespace = ( action . join ( "." ) || "" ) + plugin . name ;
if ( ! BDFDB . ArrayUtils . is ( plugin . ipcListeners ) ) plugin . ipcListeners = [ ] ;
plugin . ipcListeners . push ( { eventname , namespace , callback } ) ;
LibraryRequires . electron . ipcRenderer . on ( eventname , callback ) ;
}
} ;
BDFDB . WindowUtils . removeListener = function ( plugin , actions = "" ) {
if ( ! BDFDB . ObjectUtils . is ( plugin ) || ! BDFDB . ArrayUtils . is ( plugin . ipcListeners ) ) return ;
if ( actions ) {
for ( let action of actions . split ( " " ) ) {
action = action . split ( "." ) ;
2019-12-07 10:40:37 +01:00
let eventname = action . shift ( ) ;
2019-12-07 10:21:17 +01:00
let namespace = ( action . join ( "." ) || "" ) + plugin . name ;
for ( let listener of plugin . ipcListeners ) {
let removedlisteners = [ ] ;
if ( listener . eventname == eventname && listener . namespace == namespace ) {
LibraryRequires . electron . ipcRenderer . off ( listener . eventname , listener . callback ) ;
removedlisteners . push ( listener ) ;
}
if ( removedlisteners . length ) plugin . ipcListeners = plugin . ipcListeners . filter ( listener => { return removedlisteners . indexOf ( listener ) < 0 ; } ) ;
}
}
}
else {
for ( let listener of plugin . ipcListeners ) LibraryRequires . electron . ipcRenderer . off ( listener . eventname , listener . callback ) ;
plugin . ipcListeners = [ ] ;
}
} ;
2019-10-23 11:10:01 +02:00
BDFDB . BDUtils = { } ;
BDFDB . BDUtils . getPluginsFolder = function ( ) {
2019-10-18 10:56:41 +02:00
if ( LibraryRequires . process . env . injDir ) return LibraryRequires . path . resolve ( LibraryRequires . process . env . injDir , "plugins/" ) ;
switch ( LibraryRequires . process . platform ) {
case "win32" :
return LibraryRequires . path . resolve ( LibraryRequires . process . env . appdata , "BetterDiscord/plugins/" ) ;
case "darwin" :
return LibraryRequires . path . resolve ( LibraryRequires . process . env . HOME , "Library/Preferences/BetterDiscord/plugins/" ) ;
default :
if ( LibraryRequires . process . env . XDG _CONFIG _HOME ) return LibraryRequires . path . resolve ( LibraryRequires . process . env . XDG _CONFIG _HOME , "BetterDiscord/plugins/" ) ;
else return LibraryRequires . path . resolve ( LibraryRequires . process . env . HOME , ".config/BetterDiscord/plugins/" ) ;
}
} ;
2019-10-23 11:10:01 +02:00
BDFDB . BDUtils . getThemesFolder = function ( ) {
2019-10-18 10:56:41 +02:00
if ( LibraryRequires . process . env . injDir ) return LibraryRequires . path . resolve ( LibraryRequires . process . env . injDir , "plugins/" ) ;
switch ( LibraryRequires . process . platform ) {
case "win32" :
return LibraryRequires . path . resolve ( LibraryRequires . process . env . appdata , "BetterDiscord/themes/" ) ;
case "darwin" :
return LibraryRequires . path . resolve ( LibraryRequires . process . env . HOME , "Library/Preferences/BetterDiscord/themes/" ) ;
default :
if ( LibraryRequires . process . env . XDG _CONFIG _HOME ) return LibraryRequires . path . resolve ( LibraryRequires . process . env . XDG _CONFIG _HOME , "BetterDiscord/themes/" ) ;
else return LibraryRequires . path . resolve ( LibraryRequires . process . env . HOME , ".config/BetterDiscord/themes/" ) ;
}
} ;
2019-10-23 11:10:01 +02:00
BDFDB . BDUtils . checkRepoPage = function ( usersettings = document . querySelector ( BDFDB . dotCN . layer + ` [layer-id="user-settings"] ` ) ) {
2019-10-18 10:56:41 +02:00
if ( ! usersettings ) return ;
var folderbutton = usersettings . querySelector ( BDFDB . dotCN . _repofolderbutton ) ;
if ( ! folderbutton ) return ;
var header = folderbutton . parentElement . querySelector ( "h2" ) ;
if ( header && header . innerText ) {
let headertext = header . innerText . toLowerCase ( ) ;
if ( headertext === "plugins" || headertext === "themes" ) return headertext ;
}
} ;
2019-10-23 11:10:01 +02:00
BDFDB . BDUtils . isBDv2 = function ( ) {
2019-10-18 10:56:41 +02:00
return typeof BDFDB . BDv2Api !== "undefined" ;
} ;
2020-02-03 11:39:06 +01:00
BDFDB . BDUtils . isPluginEnabled = function ( pluginName ) {
if ( ! pluginName ) return false ;
if ( ! BDFDB . BDUtils . isBDv2 ( ) ) return BdApi . isPluginEnabled ( pluginName ) ;
else return BDFDB . Plugins [ pluginName . toLowerCase ( ) ] ? BDFDB . Plugins [ pluginName . toLowerCase ( ) ] . enabled : null ;
2019-10-18 10:56:41 +02:00
} ;
2020-02-03 11:39:06 +01:00
BDFDB . BDUtils . getPlugin = function ( pluginName , hasToBeEnabled = false ) {
if ( ! hasToBeEnabled || BDFDB . BDUtils . isPluginEnabled ( pluginName ) ) return BdApi . getPlugin ( pluginName ) ;
2019-10-18 10:56:41 +02:00
return null ;
} ;
2019-10-23 11:10:01 +02:00
BDFDB . BDUtils . isThemeEnabled = function ( themename ) {
if ( ! BDFDB . BDUtils . isBDv2 ( ) ) return BdApi . isThemeEnabled ( themename )
2019-10-18 10:56:41 +02:00
else return BDFDB . Themes [ themename . toLowerCase ( ) ] ? BDFDB . Themes [ themename . toLowerCase ( ) ] . enabled : null ;
} ;
2019-10-23 11:10:01 +02:00
BDFDB . BDUtils . getTheme = function ( themename , hasToBeEnabled = false ) {
if ( window . bdthemes && ( ! hasToBeEnabled || BDFDB . BDUtils . isThemeEnabled ( themename ) ) ) return window . bdthemes [ themename ] ;
2019-10-18 10:56:41 +02:00
return null ;
} ;
2019-10-27 07:44:41 +01:00
BDFDB . BDUtils . getSettings = function ( key ) {
if ( ! window . settingsCookie ) return null ;
if ( ! key ) return window . settingsCookie ;
return window . settingsCookie [ key ] ;
} ;
2019-10-23 11:10:01 +02:00
BDFDB . BDUtils . isAutoLoadEnabled = function ( ) {
2019-10-27 07:44:41 +01:00
return BDFDB . BDUtils . getSettings ( "fork-ps-5" ) === true || BDFDB . BDUtils . isPluginEnabled ( "Restart-No-More" ) || BDFDB . BDUtils . isPluginEnabled ( "Restart No More" ) ;
2019-10-18 10:56:41 +02:00
} ;
2019-10-23 11:10:01 +02:00
( BDFDB . BDUtils . setPluginCache = function ( ) {
if ( ! BDFDB . BDUtils . isBDv2 ( ) ) return ;
2019-10-18 10:56:41 +02:00
BDFDB . Plugins = { } ;
for ( let plugin of BDFDB . BDv2Api . Plugins . listPlugins ( ) ) BDFDB . BDv2Api . Plugins . getPlugin ( plugin ) . then ( plugindata => { BDFDB . Plugins [ plugin ] = plugindata ; } ) ;
} ) ( ) ;
2019-10-23 11:10:01 +02:00
( BDFDB . BDUtils . setThemeCache = function ( ) {
if ( ! BDFDB . BDUtils . isBDv2 ( ) ) return ;
2019-10-18 10:56:41 +02:00
BDFDB . Themes = { } ;
for ( let theme of BDFDB . BDv2Api . Themes . listThemes ( ) ) BDFDB . BDv2Api . Themes . getTheme ( theme ) . then ( themedata => { BDFDB . Themes [ theme ] = themedata ; } ) ;
} ) ( ) ;
var DiscordClassModules = { } ;
DiscordClassModules . BDFDB = {
BDFDBundefined : "BDFDB_undefined" ,
2020-02-03 13:42:32 +01:00
avatarStatusHovered : "statusHovered-gF2976" ,
2019-10-28 08:54:57 +01:00
cardInner : "inner-OP_8zd" ,
cardWrapper : "card-rT4Wbb" ,
2019-10-29 21:05:50 +01:00
charCounter : "counter-uAzbKp" ,
2019-11-22 15:05:45 +01:00
changeLogIcon : "icon-vGGh7_" ,
2019-11-10 18:06:24 +01:00
changeLogModal : "changeLogModal-ny_dHC" ,
2019-11-02 01:35:16 +01:00
collapseContainer : "container-fAVkOf" ,
collapseContainerArrow : "arrow-uglXxc" ,
2019-12-18 16:15:33 +01:00
collapseContainerCollapsed : "collapsed-2BUBZm" ,
2019-11-02 01:35:16 +01:00
collapseContainerHeader : "header-2s6x-5" ,
collapseContainerInner : "inner-TkGytd" ,
2019-12-18 16:15:33 +01:00
collapseContainerMini : "container-fAVkOf containerMini-_k6Rts" ,
2019-11-02 01:35:16 +01:00
collapseContainerTitle : "title-ROsJi-" ,
2019-11-18 15:25:50 +01:00
colorPickerSwatches : "swatches" , //swatches-QxZw_N
2019-11-10 23:44:01 +01:00
colorPickerSwatchesDisabled : "disabled-2JgNxl" ,
colorPickerSwatchSingle : "single-Fbb1wB" ,
colorPickerSwatchSelected : "selected-f5IVXN" ,
2019-11-10 18:06:24 +01:00
confirmModal : "confirmModal-t-WDWJ" ,
2020-02-03 13:42:32 +01:00
dev : "dev-A7f2Rx" ,
2019-10-28 08:54:57 +01:00
favButtonContainer : "favbutton-8Fzu45" ,
2019-11-04 23:18:41 +01:00
guild : "guild-r3yAE_" ,
2019-11-26 00:29:19 +01:00
guildLowerLeftBadge : "lowerLeftBadge-zr4T_9" ,
guildUpperLeftBadge : "upperLeftBadge-e35IpL" ,
2019-11-15 21:48:30 +01:00
hotkeyResetButton : "resetButton-hI9Ax7" ,
hotkeyWrapper : "recorder-can0vx" ,
2019-10-28 08:54:57 +01:00
inputNumberButton : "button-J9muv5" ,
2020-01-20 13:15:00 +01:00
inputNumberButtonDown : "down-cOY7Qp button-J9muv5" ,
2019-10-28 08:54:57 +01:00
inputNumberButtonUp : "up-mUs_72 button-J9muv5" ,
inputNumberButtons : "buttons-our3p-" ,
inputNumberWrapper : "numberInputWrapper-j4svZS" ,
inputNumberWrapperDefault : "numberInputWrapperDefault-gRxcuK numberInputWrapper-j4svZS" ,
inputNumberWrapperMini : "numberInputWrapperMini-wtUU31 numberInputWrapper-j4svZS" ,
2020-01-17 14:12:34 +01:00
loadingIcon : "loadingIcon-cOYMPl" ,
loadingIconWrapper : "loadingIconWrapper-PsVJ9m" ,
2019-11-12 20:08:45 +01:00
lineThrough : "lineThrough-MPlPsV" ,
2019-10-28 08:54:57 +01:00
overflowEllipsis : "ellipsis-qlo9sA" ,
2019-11-07 15:29:15 +01:00
popoutWrapper : "popout-xwjvsX" ,
2019-11-06 12:52:14 +01:00
quickSelectWrapper : "quickSelectWrapper-UCfTKz" ,
quickSelectPopoutWrapper : "quickSelectPopout-u2dtIf" ,
2019-10-28 08:54:57 +01:00
modalHeaderHasSibling : "hasSiblings-fRyjyl" ,
2019-11-10 18:32:44 +01:00
modalInnerScrollerLess : "inner-YgPpF3" ,
2019-10-18 10:56:41 +02:00
modalTabContent : "tab-content" ,
2019-11-02 01:35:16 +01:00
modalTabContentOpen : "open" ,
2019-11-10 18:32:44 +01:00
modalWrapper : "modal-6GHvdM" ,
2019-11-28 12:34:57 +01:00
noticeWrapper : "noticeWrapper-8z511t" ,
2019-11-15 21:48:30 +01:00
selectWrapper : "selectWrapper-yPjeij" ,
2019-11-02 01:35:16 +01:00
settingsPanel : "settingsPanel-w2ySNR" ,
settingsPanelInner : "settingsInner-zw1xAY" ,
settingsPanelList : "settingsList-eZjkXj" ,
2019-11-04 12:00:45 +01:00
settingsPanelTitle : "title-GTF_8J" ,
2019-12-18 19:32:01 +01:00
settingsTableCard : "settingsTableCard-628t52" ,
2020-01-22 10:56:02 +01:00
settingsTableCardConfigs : "settingsTableCardConfigs-w5X9-Z" ,
settingsTableCardLabel : "settingsTableCardLabel-MElgIg" ,
2020-01-22 10:33:41 +01:00
settingsTableHeaders : "settingsTableHeaders-WKzw9_" ,
2020-01-22 13:54:03 +01:00
settingsTableHeaderVertical : "headerVertical-4MNxqk" ,
2019-12-18 19:32:01 +01:00
settingsTableList : "settingsTableList-f6sW2y" ,
2020-02-03 13:42:32 +01:00
supporter : "supporter-Z3FfwL" ,
2019-11-06 22:11:43 +01:00
svgIcon : "icon-GhnIRB" ,
2019-11-04 12:00:45 +01:00
table : "table-moqjM0" ,
2019-11-04 12:11:44 +01:00
tableBodyCell : "bodyCell-dQam9V" ,
2019-11-04 12:00:45 +01:00
tableHeader : "header-g67q9_" ,
tableHeaderCell : "headerCell-T6Fo3K" ,
tableHeaderCellSorted : "headerCellSorted-FMjMWK" ,
2019-11-04 17:28:58 +01:00
tableHeaderSortIcon : "sortIcon-WZjMja" ,
2019-11-04 12:00:45 +01:00
tableRow : "row-_9Ehcp" ,
2019-11-10 20:18:17 +01:00
tableStickyHeader : "stickyHeader-JabwjW header-g67q9_" ,
2019-11-12 20:08:45 +01:00
textScroller : "textScroller-dc9_kz" ,
2020-01-30 17:53:13 +01:00
themedPopout : "themedPopout-1TrfdI" ,
2019-11-28 11:24:46 +01:00
tooltipCustom : "tooltipCustom-hH39_Z" ,
2019-11-12 20:08:45 +01:00
underline : "underline-6nu217"
2019-10-18 10:56:41 +02:00
} ;
DiscordClassModules . BDrepo = {
bdGuild : "bd-guild" ,
bdGuildAnimatable : "bd-animatable" ,
bdGuildAudio : "bd-audio" ,
bdGuildSelected : "bd-selected" ,
bdGuildSeparator : "bd-guild-separator" ,
bdGuildUnread : "bd-unread" ,
bdGuildVideo : "bd-video" ,
bdPillSelected : "bd-selected" ,
bdPillUnread : "bd-unread" ,
bdaAuthor : "bda-author" ,
bdaControls : "bda-controls" ,
bdaDescription : "bda-description" ,
bdaDescriptionWrap : "bda-description-wrap" ,
bdaFooter : "bda-footer" ,
bdaHeader : "bda-header" ,
bdaHeaderTitle : "bda-header-title" ,
bdaLink : "bda-link" ,
bdaLinks : "bda-links" ,
bdaName : "bda-name" ,
bdaSettingsButton : "bda-settings-button" ,
bdaSlist : "bda-slist" ,
bdaVersion : "bda-version" ,
bdPfbtn : "bd-pfbtn" ,
2020-02-03 11:16:36 +01:00
bdUpdatebtn : "bd-updatebtn" ,
2019-10-18 10:56:41 +02:00
settingsOpen : "settings-open" ,
settingsClosed : "settings-closed" ,
switch : "ui-switch" ,
switchCheckbox : "ui-switch-checkbox" ,
switchChecked : "checked" ,
switchItem : "ui-switch-item" ,
switchWrapper : "ui-switch-wrapper"
} ;
2020-02-09 14:38:05 +01:00
DiscordClassModules . ChatFilter = {
blocked : "blocked-jUhayi" ,
blockedStamp : "blockedStamp-ijVeNn" ,
censored : "censored-UYfeYg" ,
censoredStamp : "censoredStamp-fb2cYb"
} ;
2019-11-28 14:11:05 +01:00
DiscordClassModules . CharCounter = {
charCounter : "charCounter-7fw40k charcounter" ,
counterAdded : "counterAdded-zz9O4t"
} ;
2019-11-28 11:33:23 +01:00
DiscordClassModules . EmojiStatistics = {
statisticsButton : "statisticsButton-nW2KoM" ,
amountCell : "amountCell-g_W6Rx" ,
iconCell : "iconCell--wniOu" ,
nameCell : "nameCell-xyXENZ"
} ;
2019-12-09 15:56:53 +01:00
DiscordClassModules . GoogleTranslateOption = {
reverseButton : "reverseButton-5S47qV" ,
translateButton : "translateButton-DhP9x8" ,
translated : "translated-5YO8i3" ,
translating : "translating-Yi-YxC"
} ;
2019-11-24 09:03:08 +01:00
DiscordClassModules . ImageGallery = {
2020-02-09 18:16:04 +01:00
details : "details-9dkFPc" ,
detailsLabel : "label-mrlccN" ,
detailsWrapper : "detailsWrapper-TE1mu5" ,
2019-11-24 09:03:08 +01:00
gallery : "gallery-JViwKR" ,
2020-02-09 18:16:04 +01:00
icon : "icon-QY6cR4" ,
2020-02-09 17:36:34 +01:00
next : "next-SHEZrz" ,
2019-11-24 09:03:08 +01:00
previous : "previous-xsNq6B" ,
2020-02-09 17:36:34 +01:00
sibling : "sibling-6vI7Pu"
2019-11-24 09:03:08 +01:00
} ;
2020-01-22 16:47:33 +01:00
DiscordClassModules . ImageZoom = {
backdrop : "lenseBackdrop-yEm7Om" ,
lense : "zoomLense-uOK8xV" ,
modal : "imageModal-8J0ttB"
} ;
2019-11-21 13:34:27 +01:00
DiscordClassModules . PinDMs = {
2019-11-24 09:03:08 +01:00
dragPreview : "dragPreview-nXiByA" ,
2019-11-21 13:34:27 +01:00
dmChannelPinned : "pinned-0lM4wD" ,
2019-11-21 13:37:03 +01:00
dmChannelPlaceholder : "placeholder-7bhR5s" ,
2020-01-05 12:30:20 +01:00
pinnedChannelsHeaderAmount : "headerAmount-_-7GrS" ,
2020-01-04 20:47:43 +01:00
pinnedChannelsHeaderArrow : "pinnedChannelsHeaderArrow-44rrTz" ,
2020-01-15 10:28:08 +01:00
pinnedChannelsHeaderCollapsed : "collapsed-3w_-ff" ,
pinnedChannelsHeaderColored : "colored-oIzG5s" ,
2019-11-21 13:34:27 +01:00
pinnedChannelsHeaderContainer : "pinnedChannelsHeaderContainer-89Gjv4" ,
2019-11-21 13:37:03 +01:00
recentPinned : "pinned-jHvFrr" ,
recentPlaceholder : "placeholder-Uff-gH" ,
2019-11-21 13:34:27 +01:00
unpinButton : "unpinButton-z3-UVO" ,
unpinIcon : "unpinIcon-79ZnEr"
2019-10-18 10:56:41 +02:00
} ;
2019-12-30 11:48:34 +01:00
DiscordClassModules . ReadAllNotificationsButton = {
button : "button-Jt-tIg" ,
frame : "frame-oXWS21" ,
2019-12-30 11:52:37 +01:00
innerFrame : "innerFrame-8Hg64E"
2019-12-30 11:48:34 +01:00
} ;
2019-11-24 21:36:52 +01:00
DiscordClassModules . ServerFolders = {
dragPreview : "dragPreview-nXiByA" ,
guildPlaceholder : "placeholder-7bhR5s" ,
2019-11-28 15:32:56 +01:00
folderContent : "content-Pph8t6 foldercontent" ,
folderContentClosed : "closed-j55_T- foldercontentclosed" ,
2019-12-18 10:24:01 +01:00
folderContentIsOpen : "folderContentIsOpen-zz6FgW foldercontentopened" ,
2019-11-24 21:36:52 +01:00
iconSwatch : "iconSwatch-_78Ghj" ,
iconSwatchInner : "iconInner-aOY-qk" ,
2019-11-25 11:51:27 +01:00
iconSwatchPreview : "preview-Bbg_24" ,
2019-11-24 21:36:52 +01:00
iconSwatchSelected : "selected-P5oePO"
} ;
2020-01-17 13:28:18 +01:00
DiscordClassModules . ShowImageDetails = {
2020-01-31 11:47:16 +01:00
details : "details-1t6Zms" ,
detailsAdded : "detailsAdded-SAy48f"
2020-01-17 13:28:18 +01:00
} ;
2020-02-01 15:30:56 +01:00
DiscordClassModules . SpellCheck = {
2020-01-15 14:51:50 +01:00
error : "error-k9z2IV" ,
overlay : "spellCheckOverlay-cNSap5"
} ;
2020-02-01 15:30:56 +01:00
DiscordClassModules . TopRolesEverywhere = {
2020-02-01 15:34:32 +01:00
badgeStyle : "badgeStyle-tFiEQ8" ,
2020-02-01 15:30:56 +01:00
chatTag : "chatTag-Y-5TDc" ,
memberTag : "memberTag-QVWzGc" ,
2020-02-01 15:34:32 +01:00
roleStyle : "roleStyle-jQ7KI2" ,
2020-02-01 15:30:56 +01:00
tag : "tag-wWVHyf"
} ;
2019-10-18 10:56:41 +02:00
DiscordClassModules . NotFound = {
_ : "" ,
badgeWrapper : "wrapper-232cHJ" ,
channelPanelTitle : "title-eS5yk3" ,
2019-10-30 10:30:46 +01:00
emoji : "emoji" ,
2019-10-18 10:56:41 +02:00
guildChannels : "container-PNkimc" ,
highlight : "highlight" ,
hoverCardButton : "button-2CgfFz" ,
loginScreen : "wrapper-3Q5DdO" ,
mention : "mention" ,
2020-02-07 10:58:13 +01:00
mentionInteractive : "interactive" ,
2020-01-30 17:53:13 +01:00
mentionWrapper : "wrapper-3WhCwL" ,
2019-11-06 14:31:16 +01:00
nameContainerNameContainer : "container-2ax-kl" ,
quickSelectPopoutOptionSelected : "selected" ,
2019-10-18 10:56:41 +02:00
select : "css-1kj8ui-container" ,
selectArrow : "css-19bqh2r" ,
selectArrowContainer : "css-bdfdb-indicatorContainer" ,
selectArrowContainerDark : "css-12qlrak-indicatorContainer" ,
selectArrowContainerLight : "css-11dkexk-indicatorContainer" ,
selectArrowZone : "css-1wy0on6" ,
selectControl : "css-bdfdb-control" ,
selectControlDark : "css-15ejc46-control" ,
selectControlLight : "css-oc2jo8-control" ,
selectDummyInput : "css-gj7qu5-dummyInput" ,
selectHasValue : "css-bdfdb-hasValue" ,
selectIsOpen : "css-bdfdb-isOpen" ,
selectIsSelected : "css-bdfdb-isSelected" ,
selectMenu : "css-1ye7vu0" ,
selectMenuOuter : "css-bdfdb-menuOuter" ,
selectMenuOuterDark : "css-ua3v5p-menu" ,
selectMenuOuterLight : "css-1ea7eys-menu" ,
selectOption : "css-bdfdb-option" ,
selectOptionDark : "css-1aymab5-option" ,
selectOptionLight : "css-ddw2o3-option" ,
selectOptionHoverDark : "css-1gnr91b-option" ,
selectOptionHoverLight : "css-qgio2y-option" ,
selectOptionSelectDark : "css-12o7ek3-option" ,
selectOptionSelectLight : "css-1kft5vg-option" ,
selectSingle : "css-bdfdb-singleValue" ,
selectSingleDark : "css-1k00wn6-singleValue" ,
selectSingleLight : "css-6nrxdk-singleValue" ,
selectValue : "css-1hwfws3" ,
splashBackground : "splashBackground-1FRCko" ,
2019-11-06 12:52:14 +01:00
stopAnimations : "stop-animations" ,
2019-10-18 10:56:41 +02:00
subtext : "subtext-3CDbHg" ,
themeDark : "theme-dark" ,
themeLight : "theme-light" ,
themeUndefined : "theme-undefined" ,
voiceDraggable : "draggable-1KoBzC"
} ;
2019-10-20 20:57:23 +02:00
DiscordClassModules . AccountDetails = BDFDB . ModuleUtils . findByProperties ( "usernameContainer" , "container" ) ;
DiscordClassModules . AccountDetailsButtons = BDFDB . ModuleUtils . findByProperties ( "button" , "enabled" , "disabled" ) ;
DiscordClassModules . Anchor = BDFDB . ModuleUtils . findByProperties ( "anchor" , "anchorUnderlineOnHover" ) ;
DiscordClassModules . AnimationContainer = BDFDB . ModuleUtils . findByProperties ( "animatorLeft" , "didRender" ) ;
DiscordClassModules . AppBase = BDFDB . ModuleUtils . findByProperties ( "container" , "base" ) ;
DiscordClassModules . AppInner = BDFDB . ModuleUtils . findByProperties ( "app" , "layers" ) ;
DiscordClassModules . AppMount = BDFDB . ModuleUtils . findByProperties ( "appMount" ) ;
DiscordClassModules . ApplicationStore = BDFDB . ModuleUtils . findByProperties ( "applicationStore" , "navigation" ) ;
2019-10-30 10:30:46 +01:00
DiscordClassModules . AppOuter = BDFDB . ModuleUtils . find ( m => typeof m . app == "string" && Object . keys ( m ) . length == 1 ) ;
2019-10-20 20:57:23 +02:00
DiscordClassModules . AuditLog = BDFDB . ModuleUtils . findByProperties ( "auditLog" ) ;
DiscordClassModules . AuthBox = BDFDB . ModuleUtils . findByProperties ( "authBox" ) ;
DiscordClassModules . Autocomplete = BDFDB . ModuleUtils . findByProperties ( "autocomplete" , "autocompleteRow" ) ;
DiscordClassModules . Avatar = BDFDB . ModuleUtils . findByProperties ( "avatar" , "mask" , "wrapper" ) ;
DiscordClassModules . AvatarIcon = BDFDB . ModuleUtils . findByProperties ( "iconActiveLarge" , "iconActiveMedium" ) ;
DiscordClassModules . Backdrop = BDFDB . ModuleUtils . findByProperties ( "backdrop" ) ;
DiscordClassModules . Badge = BDFDB . ModuleUtils . findByProperties ( "numberBadge" , "textBadge" , "iconBadge" ) ;
DiscordClassModules . BotTag = BDFDB . ModuleUtils . findByProperties ( "botTag" , "botTagInvert" ) ;
DiscordClassModules . Button = BDFDB . ModuleUtils . findByProperties ( "colorBlack" , "button" ) ;
DiscordClassModules . Call = BDFDB . ModuleUtils . findByProperties ( "callAvatarWrapper" , "video" ) ;
DiscordClassModules . CallCurrent = BDFDB . ModuleUtils . findByProperties ( "wrapper" , "fullScreen" ) ;
DiscordClassModules . CallDetails = BDFDB . ModuleUtils . findByProperties ( "container" , "hotspot" ) ;
DiscordClassModules . CallIncoming = BDFDB . ModuleUtils . findByProperties ( "incomingCall" , "container" ) ;
DiscordClassModules . CallIncomingInner = BDFDB . ModuleUtils . findByProperties ( "incomingCallInner" , "members" ) ;
DiscordClassModules . Card = BDFDB . ModuleUtils . findByProperties ( "card" , "cardBrand" ) ;
DiscordClassModules . CardStatus = BDFDB . ModuleUtils . findByProperties ( "reset" , "error" , "card" ) ;
DiscordClassModules . Category = BDFDB . ModuleUtils . findByProperties ( "wrapper" , "children" , "muted" ) ;
DiscordClassModules . CategoryContainer = BDFDB . ModuleUtils . findByProperties ( "addButtonIcon" , "containerDefault" ) ;
DiscordClassModules . ChangeLog = BDFDB . ModuleUtils . findByProperties ( "added" , "fixed" , "improved" , "progress" ) ;
DiscordClassModules . Channel = BDFDB . ModuleUtils . findByProperties ( "wrapper" , "content" , "modeSelected" ) ;
DiscordClassModules . ChannelContainer = BDFDB . ModuleUtils . findByProperties ( "actionIcon" , "containerDefault" ) ;
DiscordClassModules . ChannelLimit = BDFDB . ModuleUtils . findByProperties ( "users" , "total" , "wrapper" ) ;
2019-12-20 22:50:08 +01:00
DiscordClassModules . ChannelTextArea = BDFDB . ModuleUtils . findByProperties ( "textArea" , "buttons" ) ;
DiscordClassModules . ChannelTextAreaAttachButton = BDFDB . ModuleUtils . findByProperties ( "attachButton" , "attachWrapper" ) ;
2019-10-20 20:57:23 +02:00
DiscordClassModules . ChannelTextAreaButton = BDFDB . ModuleUtils . findByProperties ( "buttonWrapper" , "active" ) ;
2019-12-17 13:14:24 +01:00
DiscordClassModules . ChannelTextAreaCharCounter = BDFDB . ModuleUtils . findByProperties ( "characterCount" , "error" ) ;
2019-12-21 16:57:39 +01:00
DiscordClassModules . ChannelTextAreaSlate = BDFDB . ModuleUtils . findByProperties ( "slateContainer" , "placeholder" ) ;
2019-10-20 20:57:23 +02:00
DiscordClassModules . ChatWindow = BDFDB . ModuleUtils . findByProperties ( "chat" , "channelTextArea" ) ;
DiscordClassModules . Checkbox = BDFDB . ModuleUtils . findByProperties ( "checkboxWrapper" , "round" ) ;
DiscordClassModules . ColorPicker = BDFDB . ModuleUtils . findByProperties ( "colorPickerCustom" , "customColorPickerInput" ) ;
DiscordClassModules . ColorPickerInner = BDFDB . ModuleUtils . findByProperties ( "saturation" , "hue" , "wrapper" ) ;
DiscordClassModules . ContextMenu = BDFDB . ModuleUtils . findByProperties ( "contextMenu" , "itemGroup" ) ;
DiscordClassModules . ContextMenuCheckbox = BDFDB . ModuleUtils . findByProperties ( "checkboxInner" , "checkboxElement" ) ;
DiscordClassModules . CtaVerification = BDFDB . ModuleUtils . findByProperties ( "attendeeCTA" , "verificationNotice" ) ;
DiscordClassModules . Cursor = BDFDB . ModuleUtils . findByProperties ( "cursorDefault" , "userSelectNone" ) ;
DiscordClassModules . CustomStatus = BDFDB . ModuleUtils . findByProperties ( "customStatusContentIcon" , "customStatus" ) ;
2019-10-30 10:30:46 +01:00
DiscordClassModules . CustomStatusIcon = BDFDB . ModuleUtils . findByProperties ( "icon" , "emoji" ) ;
2019-10-20 20:57:23 +02:00
DiscordClassModules . DmAddPopout = BDFDB . ModuleUtils . findByProperties ( "popout" , "searchBarComponent" ) ;
DiscordClassModules . DmAddPopoutItems = BDFDB . ModuleUtils . findByProperties ( "friendSelected" , "friendWrapper" ) ;
2019-11-08 09:36:08 +01:00
DiscordClassModules . DownloadLink = BDFDB . ModuleUtils . findByProperties ( "downloadLink" ) ;
2019-10-20 20:57:23 +02:00
DiscordClassModules . Embed = BDFDB . ModuleUtils . findByProperties ( "embed" , "embedAuthorIcon" ) ;
DiscordClassModules . EmbedActions = BDFDB . ModuleUtils . findByProperties ( "iconPlay" , "iconWrapperActive" ) ;
2019-10-30 10:49:36 +01:00
DiscordClassModules . Emoji = BDFDB . ModuleUtils . find ( m => typeof m . emoji == "string" && Object . keys ( m ) . length == 1 ) ;
2019-10-20 20:57:23 +02:00
DiscordClassModules . EmojiButton = BDFDB . ModuleUtils . findByProperties ( "emojiButton" , "sprite" ) ;
DiscordClassModules . EmojiPicker = BDFDB . ModuleUtils . findByProperties ( "emojiPicker" , "categories" ) ;
DiscordClassModules . File = BDFDB . ModuleUtils . findByProperties ( "downloadButton" , "fileNameLink" ) ;
DiscordClassModules . Flex = BDFDB . ModuleUtils . findByProperties ( "alignBaseline" , "alignCenter" ) ;
DiscordClassModules . FlexChild = BDFDB . ModuleUtils . findByProperties ( "flexChild" , "flex" ) ;
DiscordClassModules . FlowerStar = BDFDB . ModuleUtils . findByProperties ( "flowerStarContainer" , "flowerStar" ) ;
DiscordClassModules . FormText = BDFDB . ModuleUtils . findByProperties ( "description" , "modeDefault" ) ;
DiscordClassModules . Friends = BDFDB . ModuleUtils . findByProperties ( "friendsColumn" , "friendsRow" ) ;
DiscordClassModules . Game = BDFDB . ModuleUtils . findByProperties ( "game" , "gameName" ) ;
DiscordClassModules . GameIcon = BDFDB . ModuleUtils . findByProperties ( "gameIcon" , "small" , "xsmall" ) ;
2019-11-04 10:40:18 +01:00
DiscordClassModules . GameLibraryTable = BDFDB . ModuleUtils . findByProperties ( "stickyHeader" , "emptyStateText" ) ;
2019-10-20 20:57:23 +02:00
DiscordClassModules . GifFavoriteButton = BDFDB . ModuleUtils . findByProperties ( "gifFavoriteButton" , "showPulse" ) ;
DiscordClassModules . GoLiveDetails = BDFDB . ModuleUtils . findByProperties ( "panel" , "gameWrapper" ) ;
DiscordClassModules . Guild = BDFDB . ModuleUtils . findByProperties ( "wrapper" , "lowerBadge" , "svg" ) ;
DiscordClassModules . GuildChannels = BDFDB . ModuleUtils . findByProperties ( "positionedContainer" , "unreadBar" ) ;
DiscordClassModules . GuildDiscovery = BDFDB . ModuleUtils . findByProperties ( "pageWrapper" , "guildCard" ) ;
2019-10-30 10:30:46 +01:00
DiscordClassModules . GuildDm = BDFDB . ModuleUtils . find ( m => typeof m . pill == "string" && Object . keys ( m ) . length == 1 ) ;
2019-10-20 20:57:23 +02:00
DiscordClassModules . GuildEdges = BDFDB . ModuleUtils . findByProperties ( "wrapper" , "edge" , "autoPointerEvents" )
DiscordClassModules . GuildFolder = BDFDB . ModuleUtils . findByProperties ( "folder" , "expandedGuilds" )
DiscordClassModules . GuildHeader = BDFDB . ModuleUtils . findByProperties ( "header" , "name" , "bannerImage" ) ;
DiscordClassModules . GuildHeaderButton = BDFDB . ModuleUtils . findByProperties ( "button" , "open" ) ;
DiscordClassModules . GuildIcon = BDFDB . ModuleUtils . findByProperties ( "acronym" , "selected" , "wrapper" ) ;
DiscordClassModules . GuildInvite = BDFDB . ModuleUtils . findByProperties ( "wrapper" , "guildIconJoined" ) ;
DiscordClassModules . GuildSettingsBanned = BDFDB . ModuleUtils . findByProperties ( "bannedUser" , "bannedUserAvatar" ) ;
2020-02-01 22:22:24 +01:00
DiscordClassModules . GuildSettingsEmoji = BDFDB . ModuleUtils . findByProperties ( "emojiRow" , "emojiAliasPlaceholder" ) ;
2019-10-20 20:57:23 +02:00
DiscordClassModules . GuildSettingsInvite = BDFDB . ModuleUtils . findByProperties ( "countdownColumn" , "inviteSettingsInviteRow" ) ;
DiscordClassModules . GuildSettingsMember = BDFDB . ModuleUtils . findByProperties ( "member" , "membersFilterPopout" ) ;
DiscordClassModules . GuildServer = BDFDB . ModuleUtils . findByProperties ( "blobContainer" , "pill" ) ;
DiscordClassModules . GuildsItems = BDFDB . ModuleUtils . findByProperties ( "guildSeparator" , "guildsError" ) ;
DiscordClassModules . GuildsWrapper = BDFDB . ModuleUtils . findByProperties ( "scrollerWrap" , "unreadMentionsBar" , "wrapper" ) ;
DiscordClassModules . HeaderBar = BDFDB . ModuleUtils . findByProperties ( "container" , "children" , "toolbar" ) ;
DiscordClassModules . HeaderBarExtras = BDFDB . ModuleUtils . findByProperties ( "headerBarLoggedOut" , "search" ) ;
DiscordClassModules . HeaderBarSearch = BDFDB . ModuleUtils . findByProperties ( "search" , "searchBar" , "open" ) ;
DiscordClassModules . HeaderBarTopic = BDFDB . ModuleUtils . findByProperties ( "topic" , "expandable" , "content" ) ;
DiscordClassModules . HomeIcon = BDFDB . ModuleUtils . findByProperties ( "homeIcon" ) ;
DiscordClassModules . HotKeyRecorder = BDFDB . ModuleUtils . findByProperties ( "editIcon" , "recording" ) ;
DiscordClassModules . HoverCard = BDFDB . ModuleUtils . findByProperties ( "card" , "active" ) ;
DiscordClassModules . IconDirection = BDFDB . ModuleUtils . findByProperties ( "directionDown" , "directionUp" ) ;
DiscordClassModules . ImageWrapper = BDFDB . ModuleUtils . findByProperties ( "clickable" , "imageWrapperBackground" ) ;
DiscordClassModules . InviteModal = BDFDB . ModuleUtils . findByProperties ( "inviteRow" , "modal" ) ;
DiscordClassModules . Item = BDFDB . ModuleUtils . findByProperties ( "item" , "side" , "header" ) ;
2019-11-20 13:31:06 +01:00
DiscordClassModules . ItemRole = BDFDB . ModuleUtils . findByProperties ( "role" , "dragged" ) ;
2019-10-20 20:57:23 +02:00
DiscordClassModules . ItemLayerContainer = BDFDB . ModuleUtils . findByProperties ( "layer" , "layerContainer" ) ;
DiscordClassModules . Input = BDFDB . ModuleUtils . findByProperties ( "inputMini" , "inputDefault" ) ;
DiscordClassModules . LayerModal = BDFDB . ModuleUtils . findByProperties ( "root" , "small" , "medium" ) ;
DiscordClassModules . Layers = BDFDB . ModuleUtils . findByProperties ( "layer" , "layers" ) ;
2019-11-05 16:04:54 +01:00
DiscordClassModules . LiveTag = BDFDB . ModuleUtils . findByProperties ( "liveLarge" , "live" ) ;
2019-10-20 20:57:23 +02:00
DiscordClassModules . Margins = BDFDB . ModuleUtils . findByProperties ( "marginBottom4" , "marginCenterHorz" ) ;
DiscordClassModules . Member = BDFDB . ModuleUtils . findByProperties ( "member" , "ownerIcon" ) ;
DiscordClassModules . MembersWrap = BDFDB . ModuleUtils . findByProperties ( "membersWrap" , "membersGroup" ) ;
2020-01-30 17:53:13 +01:00
DiscordClassModules . Message = BDFDB . ModuleUtils . findByProperties ( "message" , "mentioned" ) ;
2019-10-20 20:57:23 +02:00
DiscordClassModules . MessageAccessory = BDFDB . ModuleUtils . findByProperties ( "embedWrapper" , "gifFavoriteButton" ) ;
2020-02-06 17:27:34 +01:00
DiscordClassModules . MessageBlocked = BDFDB . ModuleUtils . findByProperties ( "blockedMessageText" , "expanded" ) ;
2020-01-30 17:53:13 +01:00
DiscordClassModules . MessageBody = BDFDB . ModuleUtils . findByProperties ( "markupRtl" , "edited" ) ;
2020-02-06 17:27:34 +01:00
DiscordClassModules . MessageDivider = BDFDB . ModuleUtils . findByProperties ( "isUnread" , "divider" ) ;
2019-10-20 20:57:23 +02:00
DiscordClassModules . MessageElements = BDFDB . ModuleUtils . findByProperties ( "messageGroupBlockedBtn" , "dividerRed" ) ;
DiscordClassModules . MessageFile = BDFDB . ModuleUtils . findByProperties ( "cancelButton" , "filenameLinkWrapper" ) ;
2020-01-31 08:59:00 +01:00
DiscordClassModules . MessageItems = BDFDB . ModuleUtils . findByProperties ( "avatar" , "botTag" , "timestampVisibleOnHover" ) ;
2020-02-07 13:57:13 +01:00
DiscordClassModules . MessageLocalBot = BDFDB . ModuleUtils . find ( m => typeof m . localBotMessage == "string" && Object . keys ( m ) . length == 1 ) ;
2019-10-20 20:57:23 +02:00
DiscordClassModules . MessageMarkup = BDFDB . ModuleUtils . findByProperties ( "markup" ) ;
2019-10-30 10:30:46 +01:00
DiscordClassModules . MessageOperations = BDFDB . ModuleUtils . find ( m => typeof m . operations == "string" && Object . keys ( m ) . length == 1 ) ;
2019-10-20 20:57:23 +02:00
DiscordClassModules . MessageSystem = BDFDB . ModuleUtils . findByProperties ( "container" , "actionAnchor" ) ;
2020-01-30 16:07:12 +01:00
DiscordClassModules . MessageToolbar = BDFDB . ModuleUtils . findByProperties ( "container" , "icon" , "isHeader" ) ;
2020-01-30 18:02:51 +01:00
DiscordClassModules . MessageToolbarItems = BDFDB . ModuleUtils . findByProperties ( "wrapper" , "button" , "separator" ) ;
2020-01-30 17:53:13 +01:00
DiscordClassModules . MessagesPopout = BDFDB . ModuleUtils . findByProperties ( "messagesPopoutWrap" , "jumpButton" ) ;
2019-10-20 20:57:23 +02:00
DiscordClassModules . MessagesWelcome = BDFDB . ModuleUtils . findByProperties ( "welcomeMessage" , "h1" ) ;
DiscordClassModules . MessagesWrap = BDFDB . ModuleUtils . findByProperties ( "messagesWrapper" , "messageGroupBlocked" ) ;
DiscordClassModules . Modal = BDFDB . ModuleUtils . findByProperties ( "modal" , "sizeLarge" ) ;
2019-10-30 10:30:46 +01:00
DiscordClassModules . ModalDivider = BDFDB . ModuleUtils . find ( m => typeof m . divider == "string" && Object . keys ( m ) . length == 1 ) ;
2019-10-20 20:57:23 +02:00
DiscordClassModules . ModalItems = BDFDB . ModuleUtils . findByProperties ( "guildName" , "checkboxContainer" ) ;
2020-01-14 15:08:18 +01:00
DiscordClassModules . ModalMiniContent = BDFDB . ModuleUtils . find ( m => typeof m . modal == "string" && typeof m . content == "string" && Object . keys ( m ) . length == 2 ) ;
2019-10-30 10:30:46 +01:00
DiscordClassModules . ModalWrap = BDFDB . ModuleUtils . find ( m => typeof m . modal == "string" && typeof m . inner == "string" && Object . keys ( m ) . length == 2 ) ;
2019-10-20 20:57:23 +02:00
DiscordClassModules . NameContainer = DiscordClassModules . ContextMenu . subMenuContext ? BDFDB . ModuleUtils . findByProperties ( "nameAndDecorators" , "name" ) : { } ;
DiscordClassModules . NameTag = BDFDB . ModuleUtils . findByProperties ( "bot" , "nameTag" ) ;
2019-10-30 10:30:46 +01:00
DiscordClassModules . Note = BDFDB . ModuleUtils . find ( m => typeof m . note == "string" && Object . keys ( m ) . length == 1 ) ;
2019-10-20 20:57:23 +02:00
DiscordClassModules . Notice = BDFDB . ModuleUtils . findByProperties ( "notice" , "noticeFacebook" ) ;
2020-01-26 18:24:26 +01:00
DiscordClassModules . Peoples = BDFDB . ModuleUtils . findByProperties ( "peopleColumn" , "tabBar" ) ;
2019-10-20 20:57:23 +02:00
DiscordClassModules . PictureInPicture = BDFDB . ModuleUtils . findByProperties ( "pictureInPicture" , "pictureInPictureWindow" ) ;
2019-10-30 10:30:46 +01:00
DiscordClassModules . PillWrapper = BDFDB . ModuleUtils . find ( m => typeof m . item == "string" && typeof m . wrapper == "string" && Object . keys ( m ) . length == 2 ) ;
2019-10-20 20:57:23 +02:00
DiscordClassModules . PrivateChannel = BDFDB . ModuleUtils . findByProperties ( "channel" , "closeButton" ) ;
DiscordClassModules . PrivateChannelList = BDFDB . ModuleUtils . findByProperties ( "privateChannels" , "searchBar" ) ;
2019-11-20 13:56:05 +01:00
DiscordClassModules . PrivateChannelListScroller = BDFDB . ModuleUtils . findByProperties ( "scroller" , "empty" ) ;
2019-10-20 20:57:23 +02:00
DiscordClassModules . Popout = BDFDB . ModuleUtils . findByProperties ( "popout" , "arrowAlignmentTop" ) ;
DiscordClassModules . PopoutActivity = BDFDB . ModuleUtils . findByProperties ( "ellipsis" , "activityActivityFeed" ) ;
DiscordClassModules . QuickMessage = BDFDB . ModuleUtils . findByProperties ( "quickMessage" , "isBlocked" ) ;
DiscordClassModules . QuickSelect = BDFDB . ModuleUtils . findByProperties ( "quickSelectArrow" , "selected" ) ;
DiscordClassModules . QuickSwitch = BDFDB . ModuleUtils . findByProperties ( "resultFocused" , "guildIconContainer" ) ;
DiscordClassModules . QuickSwitchWrap = BDFDB . ModuleUtils . findByProperties ( "container" , "miscContainer" ) ;
DiscordClassModules . Reactions = BDFDB . ModuleUtils . findByProperties ( "reactionBtn" , "reaction" ) ;
DiscordClassModules . RecentMentions = BDFDB . ModuleUtils . findByProperties ( "recentMentionsFilterPopout" , "mentionFilter" ) ;
DiscordClassModules . Role = BDFDB . ModuleUtils . findByProperties ( "roleCircle" , "roleName" ) ;
DiscordClassModules . Scrollbar = BDFDB . ModuleUtils . findByProperties ( "scrollbar" , "scrollbarGhost" ) ;
2020-01-30 17:53:13 +01:00
DiscordClassModules . Scroller = BDFDB . ModuleUtils . findByProperties ( "scrollerThemed" , "scroller" ) ;
2019-10-20 20:57:23 +02:00
DiscordClassModules . SearchBar = BDFDB . ModuleUtils . findByProperties ( "container" , "clear" ) ;
DiscordClassModules . SearchPopout = BDFDB . ModuleUtils . findByProperties ( "datePicker" , "searchResultChannelIconBackground" ) ;
DiscordClassModules . SearchPopoutWrap = BDFDB . ModuleUtils . findByProperties ( "container" , "queryContainer" ) ;
2020-01-30 17:53:13 +01:00
DiscordClassModules . SearchResults = BDFDB . ModuleUtils . findByProperties ( "messageGroupCozy" , "searchResultsWrap" ) ;
2019-10-20 20:57:23 +02:00
DiscordClassModules . Select = BDFDB . ModuleUtils . findByProperties ( "select" , "error" , "errorMessage" ) ;
DiscordClassModules . SettingsCloseButton = BDFDB . ModuleUtils . findByProperties ( "closeButton" , "keybind" ) ;
2019-11-20 14:29:26 +01:00
DiscordClassModules . SettingsItems = BDFDB . ModuleUtils . findByProperties ( "dividerMini" , "note" ) ;
2019-10-20 20:57:23 +02:00
DiscordClassModules . SettingsTable = BDFDB . ModuleUtils . findByProperties ( "headerOption" , "headerSize" ) ;
DiscordClassModules . SettingsWindow = BDFDB . ModuleUtils . findByProperties ( "contentRegion" , "standardSidebarView" ) ;
DiscordClassModules . Slider = BDFDB . ModuleUtils . findByProperties ( "slider" , "grabber" ) ;
DiscordClassModules . Spoiler = BDFDB . ModuleUtils . findByProperties ( "spoilerContainer" , "hidden" ) ;
2020-02-05 12:22:49 +01:00
DiscordClassModules . SpoilerEmbed = BDFDB . ModuleUtils . findByProperties ( "hiddenSpoilers" , "spoiler" ) ;
2019-10-20 20:57:23 +02:00
DiscordClassModules . Switch = BDFDB . ModuleUtils . findByProperties ( "switchDisabled" , "valueChecked" ) ;
2019-11-04 10:40:18 +01:00
DiscordClassModules . Table = BDFDB . ModuleUtils . findByProperties ( "stickyHeader" , "sortIcon" ) ;
2019-10-20 20:57:23 +02:00
DiscordClassModules . Text = BDFDB . ModuleUtils . findByProperties ( "defaultColor" , "defaultMarginh1" ) ;
DiscordClassModules . TextColor = BDFDB . ModuleUtils . findByProperties ( "colorStandard" , "colorMuted" , "colorError" ) ;
DiscordClassModules . TextColor2 = BDFDB . ModuleUtils . findByProperties ( "base" , "muted" , "wrapper" ) ;
DiscordClassModules . TextSize = BDFDB . ModuleUtils . findByProperties ( "size10" , "size14" , "size20" ) ;
DiscordClassModules . TextStyle = BDFDB . ModuleUtils . findByProperties ( "large" , "primary" , "selectable" ) ;
DiscordClassModules . Tip = BDFDB . ModuleUtils . findByProperties ( "pro" , "inline" ) ;
DiscordClassModules . Title = BDFDB . ModuleUtils . findByProperties ( "title" , "size18" ) ;
DiscordClassModules . TitleBar = BDFDB . ModuleUtils . findByProperties ( "titleBar" , "wordmark" ) ;
DiscordClassModules . Tooltip = BDFDB . ModuleUtils . findByProperties ( "tooltip" , "tooltipTop" ) ;
2019-11-24 11:13:45 +01:00
DiscordClassModules . TooltipGuild = BDFDB . ModuleUtils . findByProperties ( "rowIcon" , "rowGuildName" ) ;
2019-10-20 20:57:23 +02:00
DiscordClassModules . Typing = BDFDB . ModuleUtils . findByProperties ( "cooldownWrapper" , "typing" ) ;
DiscordClassModules . UnreadBar = BDFDB . ModuleUtils . findByProperties ( "active" , "bar" , "unread" ) ;
2019-12-21 11:25:13 +01:00
DiscordClassModules . UploadModal = BDFDB . ModuleUtils . findByProperties ( "uploadModal" , "bgScale" ) ;
2020-02-07 15:16:40 +01:00
DiscordClassModules . UserInfo = BDFDB . ModuleUtils . findByProperties ( "userInfo" , "discordTag" ) ;
2019-10-20 20:57:23 +02:00
DiscordClassModules . UserPopout = BDFDB . ModuleUtils . findByProperties ( "userPopout" , "headerPlaying" ) ;
DiscordClassModules . UserProfile = BDFDB . ModuleUtils . findByProperties ( "topSectionNormal" , "tabBarContainer" ) ;
DiscordClassModules . Video = BDFDB . ModuleUtils . findByProperties ( "video" , "fullScreen" ) ;
DiscordClassModules . VoiceChannel = BDFDB . ModuleUtils . findByProperties ( "avatarSpeaking" , "voiceUser" ) ;
DiscordClassModules . VoiceChannelList = BDFDB . ModuleUtils . findByProperties ( "list" , "collapsed" ) ;
DiscordClassModules . VoiceDetails = BDFDB . ModuleUtils . findByProperties ( "container" , "customStatusContainer" ) ;
DiscordClassModules . VoiceDetailsPing = BDFDB . ModuleUtils . findByProperties ( "rtcConnectionQualityBad" , "rtcConnectionQualityFine" ) ;
2019-10-18 10:56:41 +02:00
BDFDB . DiscordClassModules = Object . assign ( { } , DiscordClassModules ) ;
2019-11-21 13:34:27 +01:00
2019-10-18 10:56:41 +02:00
var DiscordClasses = {
_bdguild : [ "BDrepo" , "bdGuild" ] ,
_bdguildanimatable : [ "BDrepo" , "bdGuildAnimatable" ] ,
_bdguildaudio : [ "BDrepo" , "bdGuildAudio" ] ,
_bdguildselected : [ "BDrepo" , "bdGuildSelected" ] ,
_bdguildseparator : [ "BDrepo" , "bdGuildSeparator" ] ,
_bdguildunread : [ "BDrepo" , "bdGuildUnread" ] ,
_bdguildvideo : [ "BDrepo" , "bdGuildVideo" ] ,
_bdpillselected : [ "BDrepo" , "bdPillSelected" ] ,
_bdpillunread : [ "BDrepo" , "bdPillUnread" ] ,
2020-02-09 14:38:05 +01:00
_chatfilterblocked : [ "ChatFilter" , "blocked" ] ,
_chatfilterblockedstamp : [ "ChatFilter" , "blockedStamp" ] ,
_chatfiltercensored : [ "ChatFilter" , "censored" ] ,
_chatfiltercensoredstamp : [ "ChatFilter" , "censoredStamp" ] ,
2019-11-28 14:11:05 +01:00
_charcountercounter : [ "CharCounter" , "charCounter" ] ,
_charcountercounteradded : [ "CharCounter" , "counterAdded" ] ,
2019-11-28 11:33:23 +01:00
_emojistatisticsstatisticsbutton : [ "EmojiStatistics" , "statisticsButton" ] ,
_emojistatisticsamountcell : [ "EmojiStatistics" , "amountCell" ] ,
_emojistatisticsiconcell : [ "EmojiStatistics" , "iconCell" ] ,
_emojistatisticsnamecell : [ "EmojiStatistics" , "nameCell" ] ,
2020-02-09 18:16:04 +01:00
_imagegallerydetails : [ "ImageGallery" , "details" ] ,
_imagegallerydetailslabel : [ "ImageGallery" , "detailsLabel" ] ,
_imagegallerydetailswrapper : [ "ImageGallery" , "detailsWrapper" ] ,
2019-11-24 09:03:08 +01:00
_imagegallerygallery : [ "ImageGallery" , "gallery" ] ,
2020-02-09 17:36:34 +01:00
_imagegalleryicon : [ "ImageGallery" , "icon" ] ,
2019-11-24 09:03:08 +01:00
_imagegallerynext : [ "ImageGallery" , "next" ] ,
2020-02-09 17:36:34 +01:00
_imagegalleryprevious : [ "ImageGallery" , "previous" ] ,
_imagegallerysibling : [ "ImageGallery" , "sibling" ] ,
2020-01-22 16:47:33 +01:00
_imagezoombackdrop : [ "ImageZoom" , "backdrop" ] ,
_imagezoomimagemodal : [ "ImageZoom" , "modal" ] ,
_imagezoomlense : [ "ImageZoom" , "lense" ] ,
2019-12-09 15:56:53 +01:00
_googletranslateoptionreversebutton : [ "GoogleTranslateOption" , "reverseButton" ] ,
_googletranslateoptiontranslatebutton : [ "GoogleTranslateOption" , "translateButton" ] ,
_googletranslateoptiontranslated : [ "GoogleTranslateOption" , "translated" ] ,
_googletranslateoptiontranslating : [ "GoogleTranslateOption" , "translating" ] ,
2019-11-21 13:34:27 +01:00
_pindmsdragpreview : [ "PinDMs" , "dragPreview" ] ,
_pindmsdmchannelpinned : [ "PinDMs" , "dmChannelPinned" ] ,
_pindmsdmchannelplaceholder : [ "PinDMs" , "dmChannelPlaceholder" ] ,
2020-01-05 12:30:20 +01:00
_pindmspinnedchannelsheaderamount : [ "PinDMs" , "pinnedChannelsHeaderAmount" ] ,
2020-01-04 20:47:43 +01:00
_pindmspinnedchannelsheaderarrow : [ "PinDMs" , "pinnedChannelsHeaderArrow" ] ,
2020-01-15 10:28:08 +01:00
_pindmspinnedchannelsheadercollapsed : [ "PinDMs" , "pinnedChannelsHeaderCollapsed" ] ,
_pindmspinnedchannelsheadercolored : [ "PinDMs" , "pinnedChannelsHeaderColored" ] ,
2019-11-21 13:34:27 +01:00
_pindmspinnedchannelsheadercontainer : [ "PinDMs" , "pinnedChannelsHeaderContainer" ] ,
_pindmsrecentpinned : [ "PinDMs" , "recentPinned" ] ,
2019-11-21 13:37:03 +01:00
_pindmsrecentplaceholder : [ "PinDMs" , "recentPlaceholder" ] ,
2019-11-21 13:34:27 +01:00
_pindmsunpinbutton : [ "PinDMs" , "unpinButton" ] ,
_pindmsunpinicon : [ "PinDMs" , "unpinIcon" ] ,
2019-12-30 11:48:34 +01:00
_readallnotificationsbuttonbutton : [ "ReadAllNotificationsButton" , "button" ] ,
_readallnotificationsbuttonframe : [ "ReadAllNotificationsButton" , "frame" ] ,
_readallnotificationsbuttoninner : [ "ReadAllNotificationsButton" , "innerFrame" ] ,
2019-11-24 21:36:52 +01:00
_serverfoldersdragpreview : [ "ServerFolders" , "dragPreview" ] ,
_serverfoldersfoldercontent : [ "ServerFolders" , "folderContent" ] ,
_serverfoldersfoldercontentclosed : [ "ServerFolders" , "folderContentClosed" ] ,
2019-12-18 10:24:01 +01:00
_serverfoldersfoldercontentisopen : [ "ServerFolders" , "folderContentIsOpen" ] ,
2019-11-24 21:36:52 +01:00
_serverfoldersguildplaceholder : [ "ServerFolders" , "guildPlaceholder" ] ,
_serverfoldersiconswatch : [ "ServerFolders" , "iconSwatch" ] ,
_serverfoldersiconswatchinner : [ "ServerFolders" , "iconSwatchInner" ] ,
2019-11-25 11:51:27 +01:00
_serverfoldersiconswatchpreview : [ "ServerFolders" , "iconSwatchPreview" ] ,
2019-11-24 21:36:52 +01:00
_serverfoldersiconswatchselected : [ "ServerFolders" , "iconSwatchSelected" ] ,
2020-02-01 15:30:56 +01:00
_showimagedetailsdetails : [ "ShowImageDetails" , "details" ] ,
_spellcheckerror : [ "SpellCheck" , "error" ] ,
_spellcheckoverlay : [ "SpellCheck" , "overlay" ] ,
2020-02-01 15:34:32 +01:00
_toproleseverywherebadgestyle : [ "TopRolesEverywhere" , "badgeStyle" ] ,
2020-02-01 15:30:56 +01:00
_toproleseverywherechattag : [ "TopRolesEverywhere" , "chatTag" ] ,
_toproleseverywheremembertag : [ "TopRolesEverywhere" , "memberTag" ] ,
2020-02-01 15:49:53 +01:00
_toproleseverywhererolestyle : [ "TopRolesEverywhere" , "roleStyle" ] ,
2020-02-01 15:30:56 +01:00
_toproleseverywheretag : [ "TopRolesEverywhere" , "tag" ] ,
2019-10-18 10:56:41 +02:00
_repoauthor : [ "BDrepo" , "bdaAuthor" ] ,
_repocheckbox : [ "BDrepo" , "switchCheckbox" ] ,
_repocheckboxchecked : [ "BDrepo" , "switchChecked" ] ,
_repocheckboxinner : [ "BDrepo" , "switch" ] ,
_repocheckboxitem : [ "BDrepo" , "switchItem" ] ,
_repocheckboxwrap : [ "BDrepo" , "switchWrapper" ] ,
_repocontrols : [ "BDrepo" , "bdaControls" ] ,
_repodescription : [ "BDrepo" , "bdaDescription" ] ,
_repodescriptionwrap : [ "BDrepo" , "bdaDescriptionWrap" ] ,
_repofolderbutton : [ "BDrepo" , "bdPfbtn" ] ,
_repofooter : [ "BDrepo" , "bdaFooter" ] ,
_repoheader : [ "BDrepo" , "bdaHeader" ] ,
_repoheadertitle : [ "BDrepo" , "bdaHeaderTitle" ] ,
_repolist : [ "BDrepo" , "bdaSlist" ] ,
_repolink : [ "BDrepo" , "bdaLink" ] ,
_repolinks : [ "BDrepo" , "bdaLinks" ] ,
_reponame : [ "BDrepo" , "bdaName" ] ,
_reposettingsbutton : [ "BDrepo" , "bdaSettingsButton" ] ,
_reposettingsopen : [ "BDrepo" , "settingsOpen" ] ,
_reposettingsclosed : [ "BDrepo" , "settingsClosed" ] ,
2020-02-03 11:16:36 +01:00
_repoupdatebutton : [ "BDrepo" , "bdUpdatebtn" ] ,
2019-10-18 10:56:41 +02:00
_repoversion : [ "BDrepo" , "bdaVersion" ] ,
accountinfo : [ "AccountDetails" , "container" ] ,
accountinfoavatar : [ "AccountDetails" , "avatar" ] ,
accountinfoavatarwrapper : [ "AccountDetails" , "avatarWrapper" ] ,
accountinfobutton : [ "AccountDetailsButtons" , "button" ] ,
accountinfobuttondisabled : [ "AccountDetailsButtons" , "disabled" ] ,
accountinfobuttonenabled : [ "AccountDetailsButtons" , "enabled" ] ,
accountinfodetails : [ "AccountDetails" , "usernameContainer" ] ,
accountinfonametag : [ "AccountDetails" , "nameTag" ] ,
alignbaseline : [ "Flex" , "alignBaseline" ] ,
aligncenter : [ "Flex" , "alignCenter" ] ,
alignend : [ "Flex" , "alignEnd" ] ,
alignstart : [ "Flex" , "alignStart" ] ,
alignstretch : [ "Flex" , "alignStretch" ] ,
anchor : [ "Anchor" , "anchor" ] ,
anchorunderlineonhover : [ "Anchor" , "anchorUnderlineOnHover" ] ,
2019-10-18 22:50:44 +02:00
animationcontainerbottom : [ "AnimationContainer" , "animatorBottom" ] ,
animationcontainerleft : [ "AnimationContainer" , "animatorLeft" ] ,
animationcontainerright : [ "AnimationContainer" , "animatorRight" ] ,
animationcontainertop : [ "AnimationContainer" , "animatorTop" ] ,
animationcontainerrender : [ "AnimationContainer" , "didRender" ] ,
animationcontainerscale : [ "AnimationContainer" , "scale" ] ,
animationcontainertranslate : [ "AnimationContainer" , "translate" ] ,
2019-10-18 10:56:41 +02:00
app : [ "AppOuter" , "app" ] ,
appcontainer : [ "AppBase" , "container" ] ,
appmount : [ "AppMount" , "appMount" ] ,
applayers : [ "AppInner" , "layers" ] ,
applicationstore : [ "ApplicationStore" , "applicationStore" ] ,
appold : [ "AppInner" , "app" ] ,
auditlog : [ "AuditLog" , "auditLog" ] ,
2020-01-03 13:56:35 +01:00
auditlogoverflowellipsis : [ "AuditLog" , "overflowEllipsis" ] ,
2019-10-18 10:56:41 +02:00
auditloguserhook : [ "AuditLog" , "userHook" ] ,
authbox : [ "AuthBox" , "authBox" ] ,
autocomplete : [ "Autocomplete" , "autocomplete" ] ,
autocompletecontent : [ "Autocomplete" , "content" ] ,
autocompletecontenttitle : [ "Autocomplete" , "contentTitle" ] ,
autocompletedescription : [ "Autocomplete" , "description" ] ,
autocompletedescriptiondiscriminator : [ "Autocomplete" , "descriptionDiscriminator" ] ,
autocompletedescriptionusername : [ "Autocomplete" , "descriptionUsername" ] ,
autocompleteicon : [ "Autocomplete" , "icon" ] ,
autocompleteiconforeground : [ "Autocomplete" , "iconForeground" ] ,
autocompleteinner : [ "Autocomplete" , "autocompleteInner" ] ,
autocompleterow : [ "Autocomplete" , "autocompleteRow" ] ,
autocompleterowhorizontal : [ "Autocomplete" , "autocompleteRowHorizontal" ] ,
autocompleterowvertical : [ "Autocomplete" , "autocompleteRowVertical" ] ,
autocompleteselectable : [ "Autocomplete" , "selectable" ] ,
autocompleteselected : [ "Autocomplete" , "selectorSelected" ] ,
autocompleteselector : [ "Autocomplete" , "selector" ] ,
avatar : [ "Avatar" , "avatar" ] ,
avatarcursordefault : [ "Avatar" , "cursorDefault" ] ,
avataricon : [ "AvatarIcon" , "icon" ] ,
avatariconactivelarge : [ "AvatarIcon" , "iconActiveLarge" ] ,
avatariconactivemedium : [ "AvatarIcon" , "iconActiveMedium" ] ,
avatariconactivemini : [ "AvatarIcon" , "iconActiveMini" ] ,
avatariconactivesmall : [ "AvatarIcon" , "iconActiveSmall" ] ,
avatariconactivexlarge : [ "AvatarIcon" , "iconActiveXLarge" ] ,
avatariconinactive : [ "AvatarIcon" , "iconInactive" ] ,
avatariconsizelarge : [ "AvatarIcon" , "iconSizeLarge" ] ,
avatariconsizemedium : [ "AvatarIcon" , "iconSizeMedium" ] ,
avatariconsizemini : [ "AvatarIcon" , "iconSizeMini" ] ,
avatariconsizesmol : [ "AvatarIcon" , "iconSizeSmol" ] ,
avatariconsizesmall : [ "AvatarIcon" , "iconSizeSmall" ] ,
avatariconsizexlarge : [ "AvatarIcon" , "iconSizeXLarge" ] ,
avatarmask : [ "Avatar" , "mask" ] ,
avatarnoicon : [ "AvatarIcon" , "noIcon" ] ,
avatarpointer : [ "Avatar" , "pointer" ] ,
avatarpointerevents : [ "Avatar" , "pointerEvents" ] ,
2020-02-03 13:42:32 +01:00
avatarstatushovered : [ "BDFDB" , "avatarStatusHovered" ] ,
2019-10-18 10:56:41 +02:00
avatarwrapper : [ "Avatar" , "wrapper" ] ,
backdrop : [ "Backdrop" , "backdrop" ] ,
badgewrapper : [ "NotFound" , "badgeWrapper" ] ,
2020-02-03 13:42:32 +01:00
bdfdbdev : [ "BDFDB" , "dev" ] ,
bdfdbsupporter : [ "BDFDB" , "supporter" ] ,
2019-10-18 10:56:41 +02:00
bottag : [ "BotTag" , "botTag" ] ,
bottaginvert : [ "BotTag" , "botTagInvert" ] ,
bottagmember : [ "Member" , "botTag" ] ,
bottagnametag : [ "NameTag" , "bot" ] ,
bottagregular : [ "BotTag" , "botTagRegular" ] ,
button : [ "Button" , "button" ] ,
buttoncolorblack : [ "Button" , "colorBlack" ] ,
buttoncolorbrand : [ "Button" , "colorBrand" ] ,
buttoncolorgreen : [ "Button" , "colorGreen" ] ,
buttoncolorgrey : [ "Button" , "colorGrey" ] ,
buttoncolorlink : [ "Button" , "colorLink" ] ,
buttoncolorprimary : [ "Button" , "colorPrimary" ] ,
buttoncolorred : [ "Button" , "colorRed" ] ,
buttoncolortransparent : [ "Button" , "colorTransparent" ] ,
buttoncolorwhite : [ "Button" , "colorWhite" ] ,
buttoncoloryellow : [ "Button" , "colorYellow" ] ,
buttoncontents : [ "Button" , "contents" ] ,
buttondisabledoverlay : [ "Button" , "disabledButtonOverlay" ] ,
buttondisabledwrapper : [ "Button" , "disabledButtonWrapper" ] ,
buttonfullwidth : [ "Button" , "fullWidth" ] ,
buttongrow : [ "Button" , "grow" ] ,
buttonhashover : [ "Button" , "hasHover" ] ,
buttonhoverblack : [ "Button" , "hoverBlack" ] ,
buttonhoverbrand : [ "Button" , "hoverBrand" ] ,
buttonhovergreen : [ "Button" , "hoverGreen" ] ,
buttonhovergrey : [ "Button" , "hoverGrey" ] ,
buttonhoverlink : [ "Button" , "hoverLink" ] ,
buttonhoverprimary : [ "Button" , "hoverPrimary" ] ,
buttonhoverred : [ "Button" , "hoverRed" ] ,
buttonhovertransparent : [ "Button" , "hoverTransparent" ] ,
buttonhoverwhite : [ "Button" , "hoverWhite" ] ,
buttonhoveryellow : [ "Button" , "hoverYellow" ] ,
buttonlookblank : [ "Button" , "lookBlank" ] ,
buttonlookfilled : [ "Button" , "lookFilled" ] ,
buttonlookghost : [ "Button" , "lookGhost" ] ,
buttonlookinverted : [ "Button" , "lookInverted" ] ,
buttonlooklink : [ "Button" , "lookLink" ] ,
buttonlookoutlined : [ "Button" , "lookOutlined" ] ,
buttonsizeicon : [ "Button" , "sizeIcon" ] ,
buttonsizelarge : [ "Button" , "sizeLarge" ] ,
buttonsizemax : [ "Button" , "sizeMax" ] ,
buttonsizemedium : [ "Button" , "sizeMedium" ] ,
buttonsizemin : [ "Button" , "sizeMin" ] ,
buttonsizesmall : [ "Button" , "sizeSmall" ] ,
buttonsizexlarge : [ "Button" , "sizeXlarge" ] ,
buttonspinner : [ "Button" , "spinner" ] ,
buttonspinneritem : [ "Button" , "spinnerItem" ] ,
buttonsubmitting : [ "Button" , "submitting" ] ,
callavatarvideo : [ "Call" , "callAvatarVideo" ] ,
callavatarvoice : [ "Call" , "callAvatarVoice" ] ,
callavatarwrapper : [ "Call" , "callAvatarWrapper" ] ,
callcurrentcontainer : [ "CallCurrent" , "wrapper" ] ,
callcurrentdetails : [ "CallDetails" , "container" ] ,
callcurrentvideo : [ "Video" , "video" ] ,
callincoming : [ "CallIncoming" , "incomingCall" ] ,
callincomingcontainer : [ "CallIncoming" , "container" ] ,
callincominginner : [ "CallIncomingInner" , "incomingCallInner" ] ,
callmembers : [ "CallIncomingInner" , "members" ] ,
callselected : [ "Call" , "selected" ] ,
callvideo : [ "Call" , "video" ] ,
card : [ "Card" , "card" ] ,
cardbrand : [ "Card" , "cardBrand" ] ,
cardbrandoutline : [ "Card" , "cardBrandOutline" ] ,
carddanger : [ "Card" , "cardDanger" ] ,
carddangeroutline : [ "Card" , "cardDangerOutline" ] ,
cardprimary : [ "Card" , "cardPrimary" ] ,
cardprimaryeditable : [ "Card" , "cardPrimaryEditable" ] ,
cardprimaryoutline : [ "Card" , "cardPrimaryOutline" ] ,
cardprimaryoutlineeditable : [ "Card" , "cardPrimaryOutlineEditable" ] ,
cardsuccess : [ "Card" , "cardSuccess" ] ,
cardsuccessoutline : [ "Card" , "cardSuccessOutline" ] ,
cardwarning : [ "Card" , "cardWarning" ] ,
cardwarningoutline : [ "Card" , "cardWarningOutline" ] ,
categoryaddbutton : [ "CategoryContainer" , "addButton" ] ,
categoryaddbuttonicon : [ "CategoryContainer" , "addButtonIcon" ] ,
categorychildren : [ "Category" , "children" ] ,
categoryclickable : [ "Category" , "clickable" ] ,
categorycollapsed : [ "Category" , "collapsed" ] ,
categorycontainerdefault : [ "CategoryContainer" , "containerDefault" ] ,
categoryforcevisible : [ "CategoryContainer" , "forceVisible" ] ,
categoryicon : [ "Category" , "icon" ] ,
categoryiconvisibility : [ "CategoryContainer" , "iconVisibility" ] ,
categorymuted : [ "Category" , "muted" ] ,
categoryname : [ "Category" , "name" ] ,
categorywrapper : [ "Category" , "wrapper" ] ,
changelogadded : [ "ChangeLog" , "added" ] ,
2019-11-10 18:32:44 +01:00
changelogcontainer : [ "ChangeLog" , "container" ] ,
2019-10-18 10:56:41 +02:00
changelogfixed : [ "ChangeLog" , "fixed" ] ,
2019-11-22 15:05:45 +01:00
changelogicon : [ "BDFDB" , "changeLogIcon" ] ,
2019-10-18 10:56:41 +02:00
changelogimproved : [ "ChangeLog" , "improved" ] ,
changelogprogress : [ "ChangeLog" , "added" ] ,
changelogtitle : [ "ChangeLog" , "title" ] ,
channelactionicon : [ "ChannelContainer" , "actionIcon" ] ,
channelchildicon : [ "ChannelContainer" , "iconItem" ] ,
channelchildiconbase : [ "ChannelContainer" , "iconBase" ] ,
channelchildren : [ "Channel" , "children" ] ,
channelcontainerdefault : [ "ChannelContainer" , "containerDefault" ] ,
channelcontent : [ "Channel" , "content" ] ,
channeldisabled : [ "ChannelContainer" , "disabled" ] ,
channelheaderchannelname : [ "ChatWindow" , "channelName" ] ,
channelheaderchildren : [ "HeaderBar" , "children" ] ,
channelheaderdivider : [ "HeaderBar" , "divider" ] ,
channelheaderheaderbar : [ "HeaderBar" , "container" ] ,
channelheaderheaderbarthemed : [ "HeaderBar" , "themed" ] ,
channelheaderheaderbartitle : [ "HeaderBar" , "title" ] ,
channelheadericon : [ "HeaderBar" , "icon" ] ,
channelheadericonbadge : [ "HeaderBar" , "iconBadge" ] ,
channelheadericonclickable : [ "HeaderBar" , "clickable" ] ,
channelheadericonselected : [ "HeaderBar" , "selected" ] ,
channelheadericonwrapper : [ "HeaderBar" , "iconWrapper" ] ,
channelheadertitle : [ "ChatWindow" , "title" ] ,
channelheadertitlewrapper : [ "ChatWindow" , "titleWrapper" ] ,
channelheadersearch : [ "HeaderBarExtras" , "search" ] ,
channelheadersearchbar : [ "HeaderBarSearch" , "searchBar" ] ,
channelheadersearchicon : [ "HeaderBarSearch" , "icon" ] ,
channelheadersearchinner : [ "HeaderBarSearch" , "search" ] ,
channelheadertoolbar : [ "HeaderBar" , "toolbar" ] ,
channelheadertoolbar2 : [ "HeaderBarExtras" , "toolbar" ] ,
channelheadertopic : [ "HeaderBarTopic" , "topic" ] ,
channelheadertopicexpandable : [ "HeaderBarTopic" , "expandable" ] ,
channelicon : [ "Channel" , "icon" ] ,
channeliconvisibility : [ "ChannelContainer" , "iconVisibility" ] ,
channelmentionsbadge : [ "ChannelContainer" , "mentionsBadge" ] ,
channelmodeconnected : [ "Channel" , "modeConnected" ] ,
channelmodelocked : [ "Channel" , "modeLocked" ] ,
channelmodemuted : [ "Channel" , "modeMuted" ] ,
channelmodeselected : [ "Channel" , "modeSelected" ] ,
channelmodeunread : [ "Channel" , "modeUnread" ] ,
channelname : [ "Channel" , "name" ] ,
channelpanel : [ "AppBase" , "activityPanel" ] ,
channelpaneltitle : [ "NotFound" , "channelPanelTitle" ] ,
channelpanels : [ "AppBase" , "panels" ] ,
channels : [ "AppBase" , "sidebar" ] ,
channelselected : [ "ChannelContainer" , "selected" ] ,
channelsscroller : [ "GuildChannels" , "scroller" ] ,
channelsunreadbar : [ "GuildChannels" , "unreadBar" ] ,
channelsunreadbarcontainer : [ "GuildChannels" , "positionedContainer" ] ,
channelsunreadbarbottom : [ "GuildChannels" , "unreadBottom" ] ,
channelsunreadbarunread : [ "GuildChannels" , "unread" ] ,
channelsunreadbartop : [ "GuildChannels" , "unreadTop" ] ,
channelunread : [ "Channel" , "unread" ] ,
channeluserlimit : [ "ChannelLimit" , "wrapper" ] ,
channeluserlimitcontainer : [ "ChannelContainer" , "userLimit" ] ,
channeluserlimittotal : [ "ChannelLimit" , "total" ] ,
channeluserlimitusers : [ "ChannelLimit" , "users" ] ,
channelwrapper : [ "Channel" , "wrapper" ] ,
2019-10-29 21:05:50 +01:00
charcounter : [ "BDFDB" , "charCounter" ] ,
2019-10-18 10:56:41 +02:00
chat : [ "ChatWindow" , "chat" ] ,
chatbase : [ "AppBase" , "base" ] ,
2019-10-18 22:41:29 +02:00
chatcontent : [ "ChatWindow" , "chatContent" ] ,
chatform : [ "ChatWindow" , "form" ] ,
chatinner : [ "ChatWindow" , "content" ] ,
2019-10-18 10:56:41 +02:00
chatspacer : [ "AppBase" , "content" ] ,
checkbox : [ "Checkbox" , "checkbox" ] ,
checkboxchecked : [ "Checkbox" , "checked" ] ,
checkboxcontainer : [ "ModalItems" , "checkboxContainer" ] ,
checkboxinput : [ "Checkbox" , "input" ] ,
checkboxinputdefault : [ "Checkbox" , "inputDefault" ] ,
checkboxinputdisabled : [ "Checkbox" , "inputDisabled" ] ,
checkboxround : [ "Checkbox" , "round" ] ,
checkboxwrapper : [ "Checkbox" , "checkboxWrapper" ] ,
checkboxwrapperdisabled : [ "Checkbox" , "checkboxWrapperDisabled" ] ,
2019-11-02 01:35:16 +01:00
collapsecontainer : [ "BDFDB" , "collapseContainer" ] ,
collapsecontainerarrow : [ "BDFDB" , "collapseContainerArrow" ] ,
collapsecontainercollapsed : [ "BDFDB" , "collapseContainerCollapsed" ] ,
collapsecontainerheader : [ "BDFDB" , "collapseContainerHeader" ] ,
collapsecontainerinner : [ "BDFDB" , "collapseContainerInner" ] ,
2019-12-18 16:15:33 +01:00
collapsecontainermini : [ "BDFDB" , "collapseContainerMini" ] ,
2019-11-02 01:35:16 +01:00
collapsecontainertitle : [ "BDFDB" , "collapseContainerTitle" ] ,
2019-10-18 10:56:41 +02:00
colorbase : [ "TextColor2" , "base" ] ,
colorerror : [ "TextColor" , "colorError" ] ,
colormuted : [ "TextColor" , "colorMuted" ] ,
colormuted2 : [ "TextColor2" , "muted" ] ,
colorpicker : [ "ColorPicker" , "colorPickerCustom" ] ,
colorpickerhexinput : [ "ColorPicker" , "customColorPickerInput" ] ,
colorpickerhue : [ "ColorPickerInner" , "hue" ] ,
colorpickerinner : [ "ColorPickerInner" , "wrapper" ] ,
colorpickerrow : [ "ColorPicker" , "colorPickerRow" ] ,
colorpickersaturation : [ "ColorPickerInner" , "saturation" ] ,
colorpickerswatch : [ "ColorPicker" , "colorPickerSwatch" ] ,
colorpickerswatches : [ "BDFDB" , "colorPickerSwatches" ] ,
colorpickerswatchesdisabled : [ "BDFDB" , "colorPickerSwatchesDisabled" ] ,
colorpickerswatchcustom : [ "ColorPicker" , "custom" ] ,
colorpickerswatchdefault : [ "ColorPicker" , "default" ] ,
colorpickerswatchdisabled : [ "ColorPicker" , "disabled" ] ,
colorpickerswatchdropper : [ "ColorPicker" , "colorPickerDropper" ] ,
colorpickerswatchdropperfg : [ "ColorPicker" , "colorPickerDropperFg" ] ,
colorpickerswatchnocolor : [ "ColorPicker" , "noColor" ] ,
colorpickerswatchselected : [ "BDFDB" , "colorPickerSwatchSelected" ] ,
colorpickerswatchsingle : [ "BDFDB" , "colorPickerSwatchSingle" ] ,
colorstandard : [ "TextColor" , "colorStandard" ] ,
2019-11-03 17:04:09 +01:00
contentcolumn : [ "SettingsWindow" , "contentColumn" ] ,
2019-10-18 10:56:41 +02:00
contentregion : [ "SettingsWindow" , "contentRegion" ] ,
contextmenu : [ "ContextMenu" , "contextMenu" ] ,
contextmenucheckbox : [ "ContextMenuCheckbox" , "checkbox" ] ,
contextmenucheckbox2 : [ "ContextMenu" , "checkbox" ] ,
contextmenucheckboxdisabled : [ "ContextMenuCheckbox" , "disabled" ] ,
contextmenucheckboxinner : [ "ContextMenuCheckbox" , "checkboxInner" ] ,
contextmenucheckboxelement : [ "ContextMenuCheckbox" , "checkboxElement" ] ,
contextmenuhint : [ "ContextMenu" , "hint" ] ,
contextmenuitem : [ "ContextMenu" , "item" ] ,
contextmenuitembrand : [ "ContextMenu" , "brand" ] ,
contextmenuitemclickable : [ "ContextMenu" , "clickable" ] ,
contextmenuitemdanger : [ "ContextMenu" , "danger" ] ,
contextmenuitemdisabled : [ "ContextMenu" , "disabled" ] ,
contextmenuitemgroup : [ "ContextMenu" , "itemGroup" ] ,
contextmenuitemtoggle : [ "ContextMenu" , "itemToggle" ] ,
contextmenuitemselected : [ "ContextMenu" , "selected" ] ,
contextmenuitemslider : [ "ContextMenu" , "itemSlider" ] ,
contextmenuitemsubmenu : [ "ContextMenu" , "itemSubMenu" ] ,
contextmenuitemsubmenucaret : [ "ContextMenu" , "caret" ] ,
contextmenulabel : [ "ContextMenu" , "label" ] ,
contextmenuscroller : [ "ContextMenu" , "scroller" ] ,
contextmenuslider : [ "ContextMenu" , "slider" ] ,
contextmenusubcontext : [ "ContextMenu" , "subMenuContext" ] ,
cursordefault : [ "Cursor" , "cursorDefault" ] ,
cursorpointer : [ "Cursor" , "cursorPointer" ] ,
2019-10-18 22:41:29 +02:00
customstatus : [ "CustomStatus" , "customStatus" ] ,
customstatuscontenticon : [ "CustomStatus" , "customStatusContentIcon" ] ,
2019-10-30 10:30:46 +01:00
customstatusemoji : [ "CustomStatusIcon" , "emoji" ] ,
customstatusicon : [ "CustomStatusIcon" , "icon" ] ,
2019-10-18 10:56:41 +02:00
defaultcolor : [ "Text" , "defaultColor" ] ,
description : [ "FormText" , "description" ] ,
directioncolumn : [ "Flex" , "directionColumn" ] ,
directiondown : [ "IconDirection" , "directionDown" ] ,
directionleft : [ "IconDirection" , "directionLeft" ] ,
directionright : [ "IconDirection" , "directionRight" ] ,
directionrow : [ "Flex" , "directionRow" ] ,
directionrowreverse : [ "Flex" , "directionRowReverse" ] ,
directionup : [ "IconDirection" , "directionUp" ] ,
directiontransition : [ "IconDirection" , "transition" ] ,
disabled : [ "SettingsItems" , "disabled" ] ,
discriminator : [ "NameTag" , "discriminator" ] ,
divider : [ "ModalDivider" , "divider" ] ,
dividerdefault : [ "SettingsItems" , "dividerDefault" ] ,
dividermini : [ "SettingsItems" , "dividerMini" ] ,
modaldivider : [ "ModalDivider" , "divider" ] , // REMOVE
modaldividerdefault : [ "SettingsItems" , "dividerDefault" ] , // REMOVE
modaldividermini : [ "SettingsItems" , "dividerMini" ] , // REMOVE
dmchannel : [ "PrivateChannel" , "channel" ] ,
2019-10-30 10:30:46 +01:00
dmchannelactivity : [ "PrivateChannel" , "activity" ] ,
dmchannelactivityemoji : [ "PrivateChannel" , "activityEmoji" ] ,
dmchannelactivitytext : [ "PrivateChannel" , "activityText" ] ,
2019-10-18 10:56:41 +02:00
dmchannelclose : [ "PrivateChannel" , "closeButton" ] ,
dmchannelheader : [ "PrivateChannelList" , "header" ] ,
2020-01-04 20:47:43 +01:00
dmchannelheadercontainer : [ "PrivateChannelList" , "privateChannelsHeaderContainer" ] ,
dmchannelheadertext : [ "PrivateChannelList" , "headerText" ] ,
2019-10-18 10:56:41 +02:00
dmchannels : [ "PrivateChannelList" , "privateChannels" ] ,
2019-11-20 13:56:05 +01:00
dmchannelsempty : [ "PrivateChannelListScroller" , "empty" ] ,
dmchannelsscroller : [ "PrivateChannelListScroller" , "scroller" ] ,
2019-10-18 10:56:41 +02:00
dmpill : [ "GuildDm" , "pill" ] ,
downloadlink : [ "DownloadLink" , "downloadLink" ] ,
ellipsis : [ "PopoutActivity" , "ellipsis" ] ,
embed : [ "Embed" , "embed" ] ,
embedauthor : [ "Embed" , "embedAuthor" ] ,
embedauthoricon : [ "Embed" , "embedAuthorIcon" ] ,
embedauthorname : [ "Embed" , "embedAuthorName" ] ,
embedauthornamelink : [ "Embed" , "embedAuthorNameLink" ] ,
embedcentercontent : [ "Embed" , "centerContent" ] ,
embeddescription : [ "Embed" , "embedDescription" ] ,
embedfield : [ "Embed" , "embedField" ] ,
embedfieldname : [ "Embed" , "embedFieldName" ] ,
embedfields : [ "Embed" , "embedFields" ] ,
embedfieldvalue : [ "Embed" , "embedFieldValue" ] ,
embedfooter : [ "Embed" , "embedFooter" ] ,
embedfootericon : [ "Embed" , "embedFooterIcon" ] ,
embedfooterseparator : [ "Embed" , "embedFooterSeparator" ] ,
embedfootertext : [ "Embed" , "embedFooterText" ] ,
2019-11-08 11:54:30 +01:00
embedfull : [ "Embed" , "embedFull" ] ,
2019-10-18 10:56:41 +02:00
embedgiftag : [ "Embed" , "embedGIFTag" ] ,
2019-11-08 11:54:30 +01:00
embedgrid : [ "Embed" , "grid" ] ,
embedhasthumbnail : [ "Embed" , "hasThumbnail" ] ,
2019-10-18 10:56:41 +02:00
embedhiddenspoiler : [ "Embed" , "hiddenSpoiler" ] ,
embediframe : [ "Embed" , "embedIframe" ] ,
embedimage : [ "Embed" , "embedImage" ] ,
embedlink : [ "Embed" , "embedLink" ] ,
embedmargin : [ "Embed" , "embedMargin" ] ,
2019-11-08 12:11:47 +01:00
embedmedia : [ "Embed" , "embedMedia" ] ,
2019-10-18 10:56:41 +02:00
embedprovider : [ "Embed" , "embedProvider" ] ,
embedspoilerattachment : [ "Embed" , "spoilerAttachment" ] ,
embedspoilerembed : [ "Embed" , "spoilerEmbed" ] ,
embedspotify : [ "Embed" , "embedSpotify" ] ,
embedthumbnail : [ "Embed" , "embedThumbnail" ] ,
embedtitle : [ "Embed" , "embedTitle" ] ,
embedtitlelink : [ "Embed" , "embedTitleLink" ] ,
embedvideo : [ "Embed" , "embedVideo" ] ,
embedvideoaction : [ "Embed" , "embedVideoAction" ] ,
embedvideoactions : [ "Embed" , "embedVideoActions" ] ,
embedvideoimagecomponent : [ "Embed" , "embedVideoImageComponent" ] ,
embedvideoimagecomponentinner : [ "Embed" , "embedVideoImageComponentInner" ] ,
embedwrapper : [ "MessageAccessory" , "embedWrapper" ] ,
2019-10-30 10:30:46 +01:00
emoji : [ "Emoji" , "emoji" ] ,
emojiold : [ "NotFound" , "emoji" ] ,
2019-10-18 22:41:29 +02:00
emojibutton : [ "EmojiButton" , "emojiButton" ] ,
emojibuttonhovered : [ "EmojiButton" , "emojiButtonHovered" ] ,
2019-10-18 22:56:09 +02:00
emojibuttonnormal : [ "EmojiButton" , "emojiButtonNormal" ] ,
2019-10-18 22:41:29 +02:00
emojibuttonsprite : [ "EmojiButton" , "sprite" ] ,
2019-10-18 10:56:41 +02:00
emojipicker : [ "EmojiPicker" , "emojiPicker" ] ,
emojipickerbutton : [ "Reactions" , "reactionBtn" ] ,
emojipickercategories : [ "EmojiPicker" , "categories" ] ,
emojipickercategory : [ "EmojiPicker" , "category" ] ,
emojipickerdisabled : [ "EmojiPicker" , "disabled" ] ,
emojipickerdiversityselector : [ "EmojiPicker" , "diversitySelector" ] ,
emojipickeremojiitem : [ "EmojiPicker" , "emojiItem" ] ,
emojipickerheader : [ "EmojiPicker" , "header" ] ,
emojipickeritem : [ "EmojiPicker" , "item" ] ,
emojipickerpopout : [ "EmojiPicker" , "popout" ] ,
emojipickerpremiumpromo : [ "EmojiPicker" , "premiumPromo" ] ,
emojipickerpremiumpromoclose : [ "EmojiPicker" , "premiumPromoClose" ] ,
emojipickerpremiumpromodescription : [ "EmojiPicker" , "premiumPromoDescription" ] ,
emojipickerpremiumpromoimage : [ "EmojiPicker" , "premiumPromoImage" ] ,
emojipickerpremiumpromotitle : [ "EmojiPicker" , "premiumPromoTitle" ] ,
emojipickerrow : [ "EmojiPicker" , "row" ] ,
emojipickersearchbar : [ "EmojiPicker" , "searchBar" ] ,
emojipickerscroller : [ "EmojiPicker" , "scroller" ] ,
emojipickerscrollerwrap : [ "EmojiPicker" , "scrollerWrap" ] ,
emojipickerselected : [ "EmojiPicker" , "selected" ] ,
emojipickerspriteitem : [ "EmojiPicker" , "spriteItem" ] ,
emojipickerstickyheader : [ "EmojiPicker" , "stickyHeader" ] ,
2019-10-24 00:07:15 +02:00
favbuttoncontainer : [ "BDFDB" , "favButtonContainer" ] ,
2019-10-18 10:56:41 +02:00
fileattachment : [ "File" , "attachment" ] ,
fileattachmentinner : [ "File" , "attachmentInner" ] ,
filecancelbutton : [ "File" , "cancelButton" ] ,
filedownloadbutton : [ "File" , "downloadButton" ] ,
filename : [ "File" , "filename" ] ,
filenamelink : [ "File" , "fileNameLink" ] ,
filenamelinkwrapper : [ "File" , "filenameLinkWrapper" ] ,
filenamewrapper : [ "File" , "filenameWrapper" ] ,
flex : [ "FlexChild" , "flex" ] ,
flex2 : [ "Flex" , "flex" ] ,
flexcenter : [ "Flex" , "flexCenter" ] ,
flexchild : [ "FlexChild" , "flexChild" ] ,
flexmarginreset : [ "FlexChild" , "flexMarginReset" ] ,
flexspacer : [ "Flex" , "spacer" ] ,
flowerstar : [ "FlowerStar" , "flowerStar" ] ,
flowerstarchild : [ "FlowerStar" , "childContainer" ] ,
flowerstarcontainer : [ "FlowerStar" , "flowerStarContainer" ] ,
formtext : [ "FormText" , "formText" ] ,
friends : [ "Friends" , "container" ] ,
friendscolumn : [ "Friends" , "friendsColumn" ] ,
friendscolumnnamewrap : [ "Friends" , "friendsColumnName" ] ,
2020-01-27 14:55:13 +01:00
friendsdiscordtag : [ "Friends" , "discordTag" ] ,
2019-10-18 10:56:41 +02:00
friendsrow : [ "Friends" , "friendsRow" ] ,
friendstable : [ "Friends" , "friendsTable" ] ,
friendstableheader : [ "Friends" , "friendsTableHeader" ] ,
friendsusername : [ "Friends" , "username" ] ,
game : [ "Game" , "game" ] ,
gameicon : [ "GameIcon" , "gameIcon" ] ,
gameiconlarge : [ "GameIcon" , "large" ] ,
gameiconmedium : [ "GameIcon" , "medium" ] ,
gameiconsmall : [ "GameIcon" , "small" ] ,
gameiconxsmall : [ "GameIcon" , "xsmall" ] ,
2019-11-04 10:40:18 +01:00
gamelibrarytable : [ "GameLibraryTable" , "table" ] ,
gamelibrarytableheader : [ "GameLibraryTable" , "header" ] ,
gamelibrarytableheadercell : [ "GameLibraryTable" , "headerCell" ] ,
gamelibrarytableheadercellsorted : [ "GameLibraryTable" , "headerCellSorted" ] ,
gamelibrarytablerow : [ "GameLibraryTable" , "row" ] ,
gamelibrarytablerowwrapper : [ "GameLibraryTable" , "rowWrapper" ] ,
gamelibrarytablestickyheader : [ "GameLibraryTable" , "stickyHeader" ] ,
2019-10-18 10:56:41 +02:00
gamename : [ "Game" , "gameName" ] ,
gamenameinput : [ "Game" , "gameNameInput" ] ,
giffavoritebutton : [ "MessageAccessory" , "gifFavoriteButton" ] ,
giffavoritecolor : [ "GifFavoriteButton" , "gifFavoriteButton" ] ,
giffavoriteicon : [ "GifFavoriteButton" , "icon" ] ,
giffavoriteshowpulse : [ "GifFavoriteButton" , "showPulse" ] ,
giffavoritesize : [ "GifFavoriteButton" , "size" ] ,
giffavoriteselected : [ "GifFavoriteButton" , "selected" ] ,
2019-11-06 12:52:14 +01:00
goliveactions : [ "GoLiveDetails" , "actions" ] ,
2019-10-18 10:56:41 +02:00
golivebody : [ "GoLiveDetails" , "body" ] ,
goliveclickablegamewrapper : [ "GoLiveDetails" , "clickableGameWrapper" ] ,
golivegameicon : [ "GoLiveDetails" , "gameIcon" ] ,
golivegamename : [ "GoLiveDetails" , "gameName" ] ,
golivegamewrapper : [ "GoLiveDetails" , "gameWrapper" ] ,
2019-11-08 12:19:19 +01:00
goliveinfo : [ "GoLiveDetails" , "info" ] ,
2019-10-18 10:56:41 +02:00
golivepanel : [ "GoLiveDetails" , "panel" ] ,
2019-10-18 22:41:29 +02:00
green : [ "TextStyle" , "statusGreen" ] ,
grey : [ "TextStyle" , "statusGrey" ] ,
2019-11-04 23:18:41 +01:00
guild : [ "BDFDB" , "guild" ] ,
2019-10-18 10:56:41 +02:00
guildbadgebase : [ "Badge" , "base" ] ,
guildbadgeicon : [ "Badge" , "icon" ] ,
guildbadgeiconbadge : [ "Badge" , "iconBadge" ] ,
guildbadgeiconbadge2 : [ "GuildsItems" , "iconBadge" ] ,
guildbadgenumberbadge : [ "Badge" , "numberBadge" ] ,
guildbadgetextbadge : [ "Badge" , "textBadge" ] ,
guildbuttoncontainer : [ "GuildsItems" , "circleButtonMask" ] ,
guildbuttoninner : [ "GuildsItems" , "circleIconButton" ] ,
guildbuttonicon : [ "GuildsItems" , "circleIcon" ] ,
guildbuttonpill : [ "GuildsItems" , "pill" ] ,
guildbuttonselected : [ "GuildsItems" , "selected" ] ,
guildchannels : [ "NotFound" , "guildChannels" ] ,
guildcontainer : [ "GuildServer" , "blobContainer" ] ,
guilddiscovery : [ "GuildDiscovery" , "pageWrapper" ] ,
guildedge : [ "GuildEdges" , "edge" ] ,
guildedgehalf : [ "GuildEdges" , "half" ] ,
guildedgehigher : [ "GuildEdges" , "higher" ] ,
guildedgemiddle : [ "GuildEdges" , "middle" ] ,
guildedgewrapper : [ "GuildEdges" , "wrapper" ] ,
guildserror : [ "GuildsItems" , "guildsError" ] ,
guildserrorinner : [ "GuildsItems" , "errorInner" ] ,
guildfolder : [ "GuildFolder" , "folder" ] ,
guildfolderexpandendbackground : [ "GuildFolder" , "expandedFolderBackground" ] ,
guildfolderexpandendbackgroundcollapsed : [ "GuildFolder" , "collapsed" ] ,
guildfolderexpandendbackgroundhover : [ "GuildFolder" , "hover" ] ,
guildfolderexpandedguilds : [ "GuildFolder" , "expandedGuilds" ] ,
guildfolderguildicon : [ "GuildFolder" , "guildIcon" ] ,
guildfoldericonwrapper : [ "GuildFolder" , "folderIconWrapper" ] ,
guildfoldericonwrapperclosed : [ "GuildFolder" , "closedFolderIconWrapper" ] ,
guildfoldericonwrapperexpanded : [ "GuildFolder" , "expandedFolderIconWrapper" ] ,
guildfolderwrapper : [ "GuildFolder" , "wrapper" ] ,
guildheader : [ "GuildHeader" , "container" ] ,
guildheaderbannerimage : [ "GuildHeader" , "bannerImage" ] ,
guildheaderbannerimagecontainer : [ "GuildHeader" , "animatedContainer" ] ,
guildheaderbannervisible : [ "GuildHeader" , "bannerVisible" ] ,
guildheaderbutton : [ "GuildHeaderButton" , "button" ] ,
guildheaderbuttonopen : [ "GuildHeaderButton" , "open" ] ,
guildheaderclickable : [ "GuildHeader" , "clickable" ] ,
guildheaderhasbanner : [ "GuildHeader" , "hasBanner" ] ,
guildheadericoncontainer : [ "GuildHeader" , "guildIconContainer" ] ,
guildheadericonbgtiernone : [ "GuildHeader" , "iconBackgroundTierNone" ] ,
guildheadericonbgtierone : [ "GuildHeader" , "iconBackgroundTierOne" ] ,
guildheadericonbgtierthree : [ "GuildHeader" , "iconBackgroundTierThree" ] ,
guildheadericonbgtiertwo : [ "GuildHeader" , "iconBackgroundTierTwo" ] ,
guildheadericonpremiumgem : [ "GuildHeader" , "premiumGuildIconGem" ] ,
guildheadericontiernone : [ "GuildHeader" , "iconTierNone" ] ,
guildheadericontierone : [ "GuildHeader" , "iconTierOne" ] ,
guildheadericontierthree : [ "GuildHeader" , "iconTierThree" ] ,
guildheadericontiertwo : [ "GuildHeader" , "iconTierTwo" ] ,
guildheaderheader : [ "GuildHeader" , "header" ] ,
guildheadername : [ "GuildHeader" , "name" ] ,
guildicon : [ "GuildIcon" , "icon" ] ,
guildiconacronym : [ "GuildIcon" , "acronym" ] ,
guildiconchildwrapper : [ "GuildIcon" , "childWrapper" ] ,
guildiconselected : [ "GuildIcon" , "selected" ] ,
guildiconwrapper : [ "GuildIcon" , "wrapper" ] ,
guildinner : [ "Guild" , "wrapper" ] ,
guildinnerwrapper : [ "GuildsItems" , "listItemWrapper" ] ,
guildlowerbadge : [ "Guild" , "lowerBadge" ] ,
2019-11-26 00:29:19 +01:00
guildlowerleftbadge : [ "BDFDB" , "guildLowerLeftBadge" ] ,
2019-10-18 10:56:41 +02:00
guildouter : [ "GuildsItems" , "listItem" ] ,
guildpill : [ "GuildServer" , "pill" ] ,
guildpillitem : [ "PillWrapper" , "item" ] ,
guildpillwrapper : [ "PillWrapper" , "wrapper" ] ,
guildplaceholder : [ "GuildsItems" , "dragInner" ] ,
guildplaceholdermask : [ "GuildsItems" , "placeholderMask" ] ,
guilds : [ "AppBase" , "guilds" ] ,
guildseparator : [ "GuildsItems" , "guildSeparator" ] ,
guildserror : [ "GuildsItems" , "guildsError" ] ,
guildsettingsbannedcard : [ "GuildSettingsBanned" , "bannedUser" ] ,
guildsettingsbanneddiscrim : [ "GuildSettingsBanned" , "discrim" ] ,
guildsettingsbannedusername : [ "GuildSettingsBanned" , "username" ] ,
2020-02-02 09:17:20 +01:00
guildsettingsemojicard : [ "GuildSettingsEmoji" , "emojiRow" ] ,
2019-10-18 10:56:41 +02:00
guildsettingsinvitecard : [ "GuildSettingsInvite" , "inviteSettingsInviteRow" ] ,
guildsettingsinvitechannelname : [ "GuildSettingsInvite" , "channelName" ] ,
guildsettingsinviteusername : [ "GuildSettingsInvite" , "username" ] ,
guildsettingsmembercard : [ "GuildSettingsMember" , "member" ] ,
guildsettingsmembername : [ "GuildSettingsMember" , "name" ] ,
guildsettingsmembernametag : [ "GuildSettingsMember" , "nameTag" ] ,
guildsscroller : [ "GuildsWrapper" , "scroller" ] ,
guildsscrollerwrap : [ "GuildsWrapper" , "scrollerWrap" ] ,
guildsvg : [ "Guild" , "svg" ] ,
guildswrapper : [ "GuildsWrapper" , "wrapper" ] ,
guildswrapperunreadmentionsbar : [ "GuildsWrapper" , "unreadMentionsBar" ] ,
guildswrapperunreadmentionsbarbottom : [ "GuildsWrapper" , "unreadMentionsIndicatorBottom" ] ,
guildswrapperunreadmentionsbartop : [ "GuildsWrapper" , "unreadMentionsIndicatorTop" ] ,
guildupperbadge : [ "Guild" , "upperBadge" ] ,
2019-11-26 00:29:19 +01:00
guildupperleftbadge : [ "BDFDB" , "guildUpperLeftBadge" ] ,
2019-10-18 10:56:41 +02:00
h1 : [ "Text" , "h1" ] ,
h1defaultmargin : [ "Text" , "defaultMarginh1" ] ,
h2 : [ "Text" , "h2" ] ,
h2defaultmargin : [ "Text" , "defaultMarginh2" ] ,
h3 : [ "Text" , "h3" ] ,
h3defaultmargin : [ "Text" , "defaultMarginh3" ] ,
h4 : [ "Text" , "h4" ] ,
h4defaultmargin : [ "Text" , "defaultMarginh4" ] ,
h5 : [ "Text" , "h5" ] ,
h5defaultmargin : [ "Text" , "defaultMarginh5" ] ,
headertitle : [ "Text" , "title" ] ,
height12 : [ "UserPopout" , "height12" ] ,
height16 : [ "File" , "height16" ] ,
height24 : [ "Title" , "height24" ] ,
height36 : [ "Notice" , "height36" ] ,
highlight : [ "NotFound" , "highlight" ] ,
homebuttonicon : [ "HomeIcon" , "homeIcon" ] ,
homebuttonpill : [ "HomeIcon" , "pill" ] ,
horizontal : [ "FlexChild" , "horizontal" ] ,
horizontal2 : [ "NotFound" , "_" ] ,
horizontalreverse : [ "FlexChild" , "horizontalReverse" ] ,
horizontalreverse2 : [ "NotFound" , "_" ] ,
hotkeybase : [ "NotFound" , "_" ] ,
hotkeybutton : [ "HotKeyRecorder" , "button" ] ,
hotkeybutton2 : [ "NotFound" , "_" ] ,
hotkeycontainer : [ "HotKeyRecorder" , "container" ] ,
hotkeycontainer2 : [ "NotFound" , "_" ] ,
hotkeydisabled : [ "HotKeyRecorder" , "disabled" ] ,
hotkeydisabled2 : [ "NotFound" , "_" ] ,
hotkeyediticon : [ "HotKeyRecorder" , "editIcon" ] ,
hotkeyhasvalue : [ "HotKeyRecorder" , "hasValue" ] ,
hotkeyinput : [ "HotKeyRecorder" , "input" ] ,
hotkeyinput2 : [ "HotKeyRecorder" , "input" ] ,
hotkeylayout : [ "HotKeyRecorder" , "layout" ] ,
hotkeylayout2 : [ "HotKeyRecorder" , "layout" ] ,
hotkeyrecording : [ "HotKeyRecorder" , "recording" ] ,
2019-11-15 21:48:30 +01:00
hotkeyresetbutton : [ "BDFDB" , "hotkeyResetButton" ] ,
2019-10-18 10:56:41 +02:00
hotkeyshadowpulse : [ "HotKeyRecorder" , "shadowPulse" ] ,
hotkeytext : [ "HotKeyRecorder" , "text" ] ,
2019-11-15 21:48:30 +01:00
hotkeywrapper : [ "BDFDB" , "hotkeyWrapper" ] ,
2019-10-18 10:56:41 +02:00
hovercard : [ "HoverCard" , "card" ] ,
hovercardbutton : [ "NotFound" , "hoverCardButton" ] ,
2019-10-24 15:54:18 +02:00
hovercardinner : [ "BDFDB" , "cardInner" ] ,
hovercardwrapper : [ "BDFDB" , "cardWrapper" ] ,
2019-10-18 10:56:41 +02:00
icon : [ "EmbedActions" , "icon" ] ,
iconactionswrapper : [ "EmbedActions" , "wrapper" ] ,
iconexternal : [ "EmbedActions" , "iconExternal" ] ,
iconexternalmargins : [ "EmbedActions" , "iconExternalMargins" ] ,
iconplay : [ "EmbedActions" , "iconPlay" ] ,
iconwrapper : [ "EmbedActions" , "iconWrapper" ] ,
iconwrapperactive : [ "EmbedActions" , "iconWrapperActive" ] ,
imageaccessory : [ "ImageWrapper" , "imageAccessory" ] ,
imageclickable : [ "ImageWrapper" , "clickable" ] ,
imageerror : [ "ImageWrapper" , "imageError" ] ,
imageplaceholder : [ "ImageWrapper" , "imagePlaceholder" ] ,
imageplaceholderoverlay : [ "ImageWrapper" , "imagePlaceholderOverlay" ] ,
imagewrapper : [ "ImageWrapper" , "imageWrapper" ] ,
imagewrapperbackground : [ "ImageWrapper" , "imageWrapperBackground" ] ,
imagewrapperinner : [ "ImageWrapper" , "imageWrapperInner" ] ,
imagezoom : [ "ImageWrapper" , "imageZoom" ] ,
itemlayer : [ "ItemLayerContainer" , "layer" ] ,
itemlayercontainer : [ "ItemLayerContainer" , "layerContainer" ] ,
2019-11-21 12:20:04 +01:00
itemlayerdisabledpointerevents : [ "ItemLayerContainer" , "disabledPointerEvents" ] ,
2019-10-18 10:56:41 +02:00
input : [ "Input" , "input" ] ,
inputdefault : [ "Input" , "inputDefault" ] ,
inputdisabled : [ "Input" , "disabled" ] ,
inputeditable : [ "Input" , "editable" ] ,
inputerror : [ "Input" , "error" ] ,
2019-10-27 19:48:03 +01:00
inputerrormessage : [ "Input" , "errorMessage" ] ,
2019-10-18 10:56:41 +02:00
inputfocused : [ "Input" , "focused" ] ,
inputmini : [ "Input" , "inputMini" ] ,
2019-10-27 19:48:03 +01:00
inputprefix : [ "Input" , "inputPrefix" ] ,
2019-10-18 10:56:41 +02:00
inputsuccess : [ "Input" , "success" ] ,
inputwrapper : [ "Input" , "inputWrapper" ] ,
2019-10-25 16:26:49 +02:00
inputnumberbutton : [ "BDFDB" , "inputNumberButton" ] ,
inputnumberbuttondown : [ "BDFDB" , "inputNumberButtonDown" ] ,
inputnumberbuttonup : [ "BDFDB" , "inputNumberButtonUp" ] ,
inputnumberbuttons : [ "BDFDB" , "inputNumberButtons" ] ,
inputnumberwrapper : [ "BDFDB" , "inputNumberWrapper" ] ,
2019-10-28 08:54:57 +01:00
inputnumberwrapperdefault : [ "BDFDB" , "inputNumberWrapperDefault" ] ,
2019-10-25 16:26:49 +02:00
inputnumberwrappermini : [ "BDFDB" , "inputNumberWrapperMini" ] ,
2019-10-18 22:41:29 +02:00
invite : [ "GuildInvite" , "wrapper" ] ,
invitebutton : [ "GuildInvite" , "button" ] ,
invitebuttoncontent : [ "GuildInvite" , "buttonContent" ] ,
invitebuttonicon : [ "GuildInvite" , "buttonIcon" ] ,
invitebuttoninner : [ "GuildInvite" , "buttonInner" ] ,
invitebuttonsize : [ "GuildInvite" , "buttonSize" ] ,
invitechannelname : [ "GuildInvite" , "channelName" ] ,
invitecontent : [ "GuildInvite" , "content" ] ,
invitecursordefault : [ "GuildInvite" , "cursorDefault" ] ,
inviteguilddetail : [ "GuildInvite" , "guildDetail" ] ,
inviteguildicon : [ "GuildInvite" , "guildIcon" ] ,
inviteguildiconexpired : [ "GuildInvite" , "guildIconExpired" ] ,
inviteguildiconimage : [ "GuildInvite" , "guildIconImage" ] ,
inviteguildiconimagejoined : [ "GuildInvite" , "guildIconImageJoined" ] ,
inviteguildiconjoined : [ "GuildInvite" , "guildIconJoined" ] ,
inviteguildinfo : [ "GuildInvite" , "guildInfo" ] ,
inviteguildname : [ "GuildInvite" , "guildName" ] ,
inviteguildnameexpired : [ "GuildInvite" , "guildNameExpired" ] ,
inviteguildnamejoined : [ "GuildInvite" , "guildNameJoined" ] ,
inviteheader : [ "GuildInvite" , "header" ] ,
invitehighbackgroundopacity : [ "GuildInvite" , "highBackgroundOpacity" ] ,
inviteiconsizeoverride : [ "GuildInvite" , "iconSizeOverride" ] ,
invitelowbackgroundopacity : [ "GuildInvite" , "lowBackgroundOpacity" ] ,
invitemediumbackgroundopacity : [ "GuildInvite" , "mediumBackgroundOpacity" ] ,
2019-10-18 10:56:41 +02:00
invitemodal : [ "InviteModal" , "modal" ] ,
invitemodalinviterow : [ "InviteModal" , "inviteRow" ] ,
invitemodalinviterowname : [ "InviteModal" , "inviteRowName" ] ,
invitemodalwrapper : [ "InviteModal" , "wrapper" ] ,
2019-10-18 22:41:29 +02:00
inviteonlinecount : [ "GuildInvite" , "onlineCount" ] ,
inviteresolving : [ "GuildInvite" , "resolving" ] ,
inviteresolvingbackground : [ "GuildInvite" , "resolvingBackground" ] ,
invitestatus : [ "GuildInvite" , "status" ] ,
invitestatusoffline : [ "GuildInvite" , "statusOffline" ] ,
invitestatusonline : [ "GuildInvite" , "statusOnline" ] ,
inviteuserselectnone : [ "GuildInvite" , "userSelectNone" ] ,
2019-10-18 10:56:41 +02:00
justifycenter : [ "Flex" , "justifyCenter" ] ,
justifyend : [ "Flex" , "justifyEnd" ] ,
justifystart : [ "Flex" , "justifyStart" ] ,
large : [ "TextStyle" , "large" ] ,
layermodal : [ "LayerModal" , "root" ] ,
layermodallarge : [ "LayerModal" , "large" ] ,
layermodalmedium : [ "LayerModal" , "medium" ] ,
layermodalsmall : [ "LayerModal" , "small" ] ,
layer : [ "Layers" , "layer" ] ,
layerbase : [ "Layers" , "baseLayer" ] ,
layers : [ "Layers" , "layers" ] ,
layersbg : [ "Layers" , "bg" ] ,
2019-11-12 20:08:45 +01:00
linethrough : [ "BDFDB" , "lineThrough" ] ,
2019-11-12 19:04:16 +01:00
listavatar : [ "UserProfile" , "listAvatar" ] ,
2019-11-12 19:56:35 +01:00
listdiscriminator : [ "UserProfile" , "listDiscriminator" ] ,
listname : [ "UserProfile" , "listName" ] ,
listrow : [ "UserProfile" , "listRow" ] ,
2019-11-12 19:04:16 +01:00
listrowcontent : [ "UserProfile" , "listRowContent" ] ,
listscroller : [ "UserProfile" , "listScroller" ] ,
2019-10-18 10:56:41 +02:00
livetag : [ "LiveTag" , "live" ] ,
2019-11-05 08:30:31 +01:00
livetaggrey : [ "LiveTag" , "grey" ] ,
2019-10-18 10:56:41 +02:00
livetaglarge : [ "LiveTag" , "liveLarge" ] ,
livetagsmall : [ "LiveTag" , "liveSmall" ] ,
2020-01-17 14:12:34 +01:00
loadingicon : [ "BDFDB" , "loadingIcon" ] ,
loadingiconwrapper : [ "BDFDB" , "loadingIconWrapper" ] ,
2019-10-18 10:56:41 +02:00
loginscreen : [ "NotFound" , "loginScreen" ] ,
marginbottom4 : [ "Margins" , "marginBottom4" ] ,
marginbottom8 : [ "Margins" , "marginBottom8" ] ,
marginbottom20 : [ "Margins" , "marginBottom20" ] ,
marginbottom40 : [ "Margins" , "marginBottom40" ] ,
marginbottom60 : [ "Margins" , "marginBottom60" ] ,
margincenterhorz : [ "Margins" , "marginCenterHorz" ] ,
marginleft4 : [ "Autocomplete" , "marginLeft4" ] ,
marginleft8 : [ "Autocomplete" , "marginLeft8" ] ,
marginreset : [ "Margins" , "marginReset" ] ,
margintop4 : [ "Margins" , "marginTop4" ] ,
margintop8 : [ "Margins" , "marginTop8" ] ,
margintop20 : [ "Margins" , "marginTop20" ] ,
margintop40 : [ "Margins" , "marginTop40" ] ,
margintop60 : [ "Margins" , "marginTop60" ] ,
medium : [ "TextStyle" , "medium" ] ,
member : [ "Member" , "member" ] ,
2019-12-18 09:36:29 +01:00
memberactivity : [ "Member" , "activity" ] ,
2019-10-18 10:56:41 +02:00
membericon : [ "Member" , "icon" ] ,
2019-10-18 22:41:29 +02:00
memberoffline : [ "Member" , "offline" ] ,
2019-10-18 10:56:41 +02:00
memberownericon : [ "Member" , "ownerIcon" ] ,
memberpremiumicon : [ "Member" , "premiumIcon" ] ,
members : [ "MembersWrap" , "members" ] ,
membersgroup : [ "MembersWrap" , "membersGroup" ] ,
memberswrap : [ "MembersWrap" , "membersWrap" ] ,
memberusername : [ "Member" , "roleColor" ] ,
mention : [ "NotFound" , "mention" ] ,
2020-02-07 10:58:13 +01:00
mentioninteractive : [ "NotFound" , "mentionInteractive" ] ,
2020-01-30 17:53:13 +01:00
mentionwrapper : [ "NotFound" , "mentionWrapper" ] ,
message : [ "Message" , "message" ] ,
2019-10-18 10:56:41 +02:00
messageaccessory : [ "MessageAccessory" , "container" ] ,
2020-01-31 08:59:00 +01:00
messageavatar : [ "MessageItems" , "avatar" ] ,
2020-01-30 17:53:13 +01:00
messagebackgroundflash : [ "Message" , "backgroundFlash" ] ,
2019-10-18 10:56:41 +02:00
messagebarbase : [ "MessageElements" , "barBase" ] ,
messagebarbuttonalt : [ "MessageElements" , "barButtonAlt" ] ,
messagebarbuttonbase : [ "MessageElements" , "barButtonBase" ] ,
messagebarbuttonicon : [ "MessageElements" , "barButtonIcon" ] ,
messagebarbuttonmain : [ "MessageElements" , "barButtonMain" ] ,
messagebarhasmore : [ "MessageElements" , "hasMore" ] ,
messagebarjumptopresentbar : [ "MessageElements" , "jumpToPresentBar" ] ,
messagebarloadingmore : [ "MessageElements" , "loadingMore" ] ,
messagebarnewmessagesbar : [ "MessageElements" , "newMessagesBar" ] ,
messagebarspan : [ "MessageElements" , "span" ] ,
messagebarspinner : [ "MessageElements" , "spinner" ] ,
messagebarspinneritem : [ "MessageElements" , "spinnerItem" ] ,
2020-01-30 17:53:13 +01:00
messagebeforegroup : [ "Message" , "beforeGroup" ] ,
2020-02-06 17:27:34 +01:00
messageblockedaction : [ "MessageBlocked" , "blockedAction" ] ,
messageblockedcontainer : [ "MessageBlocked" , "container" ] ,
messageblockedexpanded : [ "MessageBlocked" , "expanded" ] ,
messageblockedicon : [ "MessageBlocked" , "blockedIcon" ] ,
messageblockedsystemmessage : [ "MessageBlocked" , "blockedSystemMessage" ] ,
messageblockedtext : [ "MessageBlocked" , "blockedMessageText" ] ,
2020-02-06 16:23:23 +01:00
messageblockquotecontainer : [ "MessageMarkup" , "blockquoteContainer" ] ,
messageblockquotedivider : [ "MessageMarkup" , "blockquoteDivider" ] ,
2020-01-31 08:59:00 +01:00
messagebottag : [ "MessageItems" , "botTag" ] ,
messagebottagcompact : [ "MessageItems" , "botTagCompact" ] ,
messagebottagcozy : [ "MessageItems" , "botTagCozy" ] ,
messagebuttoncontainer : [ "MessageItems" , "buttonContainer" ] ,
2020-01-30 17:53:13 +01:00
messagebuttons : [ "Message" , "buttons" ] ,
messagechanneltextarea : [ "Message" , "channelTextArea" ] ,
2020-01-31 08:59:00 +01:00
messageclickoverride : [ "MessageItems" , "clickOverride" ] ,
messageclickoverridedisableinteraction : [ "MessageItems" , "disableInteraction" ] ,
messagecompact : [ "MessageItems" , "compact" ] ,
2020-02-07 10:58:13 +01:00
messagecontainer : [ "Message" , "container" ] ,
messagecontaineritems : [ "MessageItems" , "container" ] ,
2020-02-06 16:23:23 +01:00
messagecozy : [ "MessageItems" , "cozy" ] ,
messagecozymessage : [ "Message" , "cozyMessage" ] ,
2020-01-30 17:53:13 +01:00
messagedisableinteraction : [ "Message" , "disableInteraction" ] ,
2019-10-18 22:41:29 +02:00
messagedivider : [ "Message" , "divider" ] ,
2020-01-31 08:59:00 +01:00
messagedividerhascontent : [ "Message" , "hasContent" ] ,
2019-10-18 22:41:29 +02:00
messageedited : [ "MessageBody" , "edited" ] ,
2020-02-07 10:58:13 +01:00
messageediting : [ "Message" , "editing" ] ,
2020-01-30 17:53:13 +01:00
messagegroupstart : [ "Message" , "groupStart" ] ,
2019-10-18 10:56:41 +02:00
messagegroupblocked : [ "MessageElements" , "messageGroupBlocked" ] ,
messagegroupblockedbtn : [ "MessageElements" , "messageGroupBlockedBtn" ] ,
messagegroupblockedrevealed : [ "MessageElements" , "revealed" ] ,
2020-02-06 16:23:23 +01:00
messageheader : [ "MessageItems" , "header" ] ,
2020-02-06 16:28:03 +01:00
messageheaderclickable : [ "MessageItems" , "clickableHeader" ] ,
2020-02-07 13:57:13 +01:00
messagelocalbot : [ "Message" , "localBot" ] ,
messagelocalbotoperations : [ "MessageLocalBot" , "localBotMessage" ] ,
2019-10-18 10:56:41 +02:00
messagemarkup : [ "MessageMarkup" , "markup" ] ,
2020-02-06 16:28:03 +01:00
messagemarkupcompact : [ "MessageBody" , "compact" ] ,
messagemarkupcontainercompact : [ "MessageBody" , "containerCompact" ] ,
messagemarkupcontainercozy : [ "MessageBody" , "containerCozy" ] ,
2020-01-30 17:53:13 +01:00
messagemarkupisfailed : [ "MessageBody" , "isFailed" ] ,
2020-02-06 16:28:03 +01:00
messagemarkupissending : [ "MessageBody" , "isSending" ] ,
2020-01-01 20:30:23 +01:00
messagemarkuprtl : [ "MessageBody" , "markupRtl" ] ,
2020-01-30 17:53:13 +01:00
messagementioned : [ "Message" , "mentioned" ] ,
2019-10-18 22:41:29 +02:00
messageoperations : [ "MessageOperations" , "operations" ] ,
2020-01-30 17:53:13 +01:00
messageselected : [ "Message" , "selected" ] ,
2019-10-18 10:56:41 +02:00
messages : [ "MessagesWrap" , "messages" ] ,
2019-10-18 22:41:29 +02:00
messagesdivider : [ "MessagesWrap" , "divider" ] ,
2019-10-18 10:56:41 +02:00
messagespopout : [ "MessagesPopout" , "messagesPopout" ] ,
messagespopoutactionbuttons : [ "MessagesPopout" , "actionButtons" ] ,
messagespopoutbody : [ "MessagesPopout" , "body" ] ,
messagespopoutbottom : [ "MessagesPopout" , "bottom" ] ,
messagespopoutchannelname : [ "MessagesPopout" , "channelName" ] ,
messagespopoutchannelseparator : [ "MessagesPopout" , "channelSeparator" ] ,
2020-02-01 17:34:12 +01:00
messagespopoutclosebutton : [ "MessagesPopout" , "closeIcon" ] ,
2019-10-18 10:56:41 +02:00
messagespopoutemptyplaceholder : [ "MessagesPopout" , "emptyPlaceholder" ] ,
messagespopoutfooter : [ "MessagesPopout" , "footer" ] ,
messagespopoutguildname : [ "MessagesPopout" , "guildName" ] ,
2020-01-30 17:53:13 +01:00
messagespopoutgroupcozy : [ "MessagesPopout" , "messageGroupCozy" ] ,
messagespopoutgroupwrapper : [ "MessagesPopout" , "messageGroupWrapper" ] ,
2019-10-18 10:56:41 +02:00
messagespopouthasmore : [ "MessagesPopout" , "hasMore" ] ,
messagespopouthasmorebutton : [ "MessagesPopout" , "hasMoreButton" ] ,
messagespopoutheader : [ "MessagesPopout" , "header" ] ,
messagespopoutimage : [ "MessagesPopout" , "image" ] ,
messagespopoutjumpbutton : [ "MessagesPopout" , "jumpButton" ] ,
messagespopoutloading : [ "MessagesPopout" , "loading" ] ,
messagespopoutloadingmore : [ "MessagesPopout" , "loadingMore" ] ,
messagespopoutloadingplaceholder : [ "MessagesPopout" , "loadingPlaceholder" ] ,
2020-01-30 17:53:13 +01:00
messagespopoutscroller : [ "MessagesPopout" , "scroller" ] ,
2019-10-18 10:56:41 +02:00
messagespopoutscrollingfooterwrap : [ "MessagesPopout" , "scrollingFooterWrap" ] ,
messagespopoutspinner : [ "MessagesPopout" , "spinner" ] ,
messagespopouttitle : [ "MessagesPopout" , "title" ] ,
messagespopoutvisible : [ "MessagesPopout" , "visible" ] ,
messagespopoutwrap : [ "MessagesPopout" , "messagesPopoutWrap" ] ,
2019-10-18 22:41:29 +02:00
messagesscrollerwrapper : [ "MessagesWrap" , "scrollerWrap" ] ,
messageswelcomemessage : [ "MessagesWelcome" , "welcomeMessage" ] ,
messageswelcomemessageheader : [ "MessagesWelcome" , "h1" ] ,
2019-10-18 10:56:41 +02:00
messageswrapper : [ "MessagesWrap" , "messagesWrapper" ] ,
2020-02-06 17:27:34 +01:00
messageswrapperplaceholder : [ "MessagesWrap" , "placeholder" ] ,
2020-02-07 10:58:13 +01:00
messagesystem : [ "Message" , "systemMessage" ] ,
2020-01-31 08:59:00 +01:00
messagesystemaccessories : [ "MessageItems" , "systemMessageAccessories" ] ,
2020-02-07 10:58:13 +01:00
messagesystemcontainer : [ "MessageSystem" , "container" ] ,
2019-10-18 10:56:41 +02:00
messagesystemcontent : [ "MessageSystem" , "content" ] ,
2019-10-18 22:41:29 +02:00
messagesystemicon : [ "MessageSystem" , "icon" ] ,
2020-02-06 17:27:34 +01:00
messagesystemiconcontainer : [ "MessageSystem" , "iconContainer" ] ,
2020-02-07 10:58:13 +01:00
messagesystemiconsize : [ "MessageSystem" , "iconSize" ] ,
2020-02-06 17:27:34 +01:00
messagetimedivider : [ "MessageDivider" , "divider" ] ,
messagetimedividercontent : [ "MessageDivider" , "content" ] ,
messagetimedividerhascontent : [ "MessageDivider" , "hasContent" ] ,
messagetimedividerisunread : [ "MessageDivider" , "isUnread" ] ,
messagetimedividerunreadpill : [ "MessageDivider" , "unreadPill" ] ,
messagetimedividerunreadpillcap : [ "MessageDivider" , "unreadPillCap" ] ,
messagetimedividerunreadpillcapstroke : [ "MessageDivider" , "unreadPillCapStroke" ] ,
2020-01-31 08:59:00 +01:00
messagetimestampasiancompact : [ "MessageItems" , "asianCompactTimeStamp" ] ,
messagetimestampbase : [ "MessageItems" , "timestampBase" ] ,
messagetimestampcompact : [ "MessageItems" , "timestampCompact" ] ,
messagetimestampcozy : [ "MessageItems" , "timestampCozy" ] ,
messagetimestampcozyalt : [ "MessageItems" , "timestampCozyAlt" ] ,
messagetimestamplatin12compact : [ "MessageItems" , "latin12CompactTimeStamp" ] ,
messagetimestamplatin24compact : [ "MessageItems" , "latin24CompactTimeStamp" ] ,
2020-02-07 10:58:13 +01:00
messagetimestampseparator : [ "MessageItems" , "separator" ] ,
2019-10-18 22:41:29 +02:00
messagetimestampsystem : [ "MessageSystem" , "timestamp" ] ,
2020-01-31 08:59:00 +01:00
messagetimestamptooltip : [ "MessageItems" , "timestampTooltip" ] ,
messagetimestampvisibleonhover : [ "MessageItems" , "timestampVisibleOnHover" ] ,
2020-01-30 18:02:51 +01:00
messagetoolbar : [ "MessageToolbar" , "container" ] ,
messagetoolbarbutton : [ "MessageToolbarItems" , "button" ] ,
messagetoolbarbuttondisabled : [ "MessageToolbarItems" , "disabled" ] ,
messagetoolbarbuttonselected : [ "MessageToolbarItems" , "selected" ] ,
2020-02-06 17:27:34 +01:00
messagetoolbaremojibutton : [ "MessageToolbar" , "emojiButton" ] ,
messagetoolbaremojiseparator : [ "MessageToolbar" , "emojiSeparator" ] ,
2020-01-30 16:07:12 +01:00
messagetoolbaricon : [ "MessageToolbar" , "icon" ] ,
2020-01-30 18:02:51 +01:00
messagetoolbarinner : [ "MessageToolbarItems" , "wrapper" ] ,
2020-01-30 16:07:12 +01:00
messagetoolbarisheader : [ "MessageToolbar" , "isHeader" ] ,
2020-01-30 18:02:51 +01:00
messagetoolbarseparator : [ "MessageToolbarItems" , "separator" ] ,
2019-10-18 10:56:41 +02:00
messageuploadcancel : [ "MessageFile" , "cancelButton" ] ,
2020-01-31 08:59:00 +01:00
messageusername : [ "MessageItems" , "username" ] ,
2019-10-18 10:56:41 +02:00
modal : [ "ModalWrap" , "modal" ] ,
modalclose : [ "Modal" , "close" ] ,
2019-11-10 18:06:24 +01:00
modalchangelogmodal : [ "BDFDB" , "changeLogModal" ] ,
modalconfirmmodal : [ "BDFDB" , "confirmModal" ] ,
2019-10-18 10:56:41 +02:00
modalcontent : [ "Modal" , "content" ] ,
modalfooter : [ "Modal" , "footer" ] ,
modalguildname : [ "ModalItems" , "guildName" ] ,
modalheader : [ "Modal" , "header" ] ,
modalheaderhassibling : [ "BDFDB" , "modalHeaderHasSibling" ] ,
modalinner : [ "ModalWrap" , "inner" ] ,
modalmini : [ "ModalMiniContent" , "modal" ] ,
modalminicontent : [ "ModalMiniContent" , "content" ] ,
modalminitext : [ "HeaderBarTopic" , "content" ] ,
modalseparator : [ "Modal" , "separator" ] ,
modalsizelarge : [ "Modal" , "sizeLarge" ] ,
modalsizemedium : [ "Modal" , "sizeMedium" ] ,
modalsizesmall : [ "Modal" , "sizeSmall" ] ,
modalsub : [ "Modal" , "modal" ] ,
modalsubinner : [ "Modal" , "inner" ] ,
2019-11-10 18:32:44 +01:00
modalsubinnerscrollerless : [ "BDFDB" , "modalInnerScrollerLess" ] ,
2019-10-18 10:56:41 +02:00
modaltabcontent : [ "BDFDB" , "modalTabContent" ] ,
modaltabcontentopen : [ "BDFDB" , "modalTabContentOpen" ] ,
2019-11-07 16:08:13 +01:00
modalwrapper : [ "BDFDB" , "modalWrapper" ] ,
2019-10-18 10:56:41 +02:00
modedefault : [ "FormText" , "modeDefault" ] ,
modedisabled : [ "FormText" , "modeDisabled" ] ,
modeselectable : [ "FormText" , "modeSelectable" ] ,
namecontainer : [ "NameContainer" , "container" ] ,
2019-10-18 22:41:29 +02:00
namecontaineravatar : [ "NameContainer" , "avatar" ] ,
2019-11-20 15:53:05 +01:00
namecontainerchildren : [ "NameContainer" , "children" ] ,
2019-10-18 10:56:41 +02:00
namecontainerclickable : [ "NameContainer" , "clickable" ] ,
namecontainercontent : [ "NameContainer" , "content" ] ,
namecontainerlayout : [ "NameContainer" , "layout" ] ,
namecontainername : [ "NameContainer" , "name" ] ,
namecontainernamecontainer : [ "NotFound" , "nameContainerNameContainer" ] ,
namecontainernamewrapper : [ "NameContainer" , "nameAndDecorators" ] ,
namecontainerselected : [ "NameContainer" , "selected" ] ,
2019-10-18 22:41:29 +02:00
namecontainersubtext : [ "NameContainer" , "subText" ] ,
2019-10-18 10:56:41 +02:00
nametag : [ "NameTag" , "nameTag" ] ,
nochannel : [ "ChatWindow" , "noChannel" ] ,
notice : [ "Notice" , "notice" ] ,
noticebrand : [ "Notice" , "noticeBrand" ] ,
noticebutton : [ "Notice" , "button" ] ,
noticedanger : [ "Notice" , "noticeDanger" ] ,
noticedefault : [ "Notice" , "noticeDefault" ] ,
noticedismiss : [ "Notice" , "dismiss" ] ,
noticefacebook : [ "Notice" , "noticeFacebook" ] ,
noticeicon : [ "Notice" , "icon" ] ,
noticeiconandroid : [ "Notice" , "iconAndroid" ] ,
noticeiconapple : [ "Notice" , "iconApple" ] ,
noticeiconwindows : [ "Notice" , "iconWindows" ] ,
noticeinfo : [ "Notice" , "noticeInfo" ] ,
noticeplatformicon : [ "Notice" , "platformIcon" ] ,
noticepremium : [ "Notice" , "noticePremium" ] ,
noticepremiumaction : [ "Notice" , "premiumAction" ] ,
noticepremiumlogo : [ "Notice" , "premiumLogo" ] ,
noticepremiumtext : [ "Notice" , "premiumText" ] ,
noticerichpresence : [ "Notice" , "noticeRichPresence" ] ,
noticespotify : [ "Notice" , "noticeSpotify" ] ,
noticestreamer : [ "Notice" , "noticeStreamerMode" ] ,
noticesuccess : [ "Notice" , "noticeSuccess" ] ,
noticesurvey : [ "Notice" , "noticeSurvey" ] ,
2019-11-28 12:34:57 +01:00
noticewrapper : [ "BDFDB" , "noticeWrapper" ] ,
2019-10-18 10:56:41 +02:00
note : [ "SettingsItems" , "note" ] ,
nowrap : [ "Flex" , "noWrap" ] ,
overflowellipsis : [ "BDFDB" , "overflowEllipsis" ] ,
2020-01-26 18:24:26 +01:00
peoples : [ "Peoples" , "container" ] ,
peoplesbadge : [ "Peoples" , "badge" ] ,
peoplesnowplayingcolumn : [ "Peoples" , "nowPlayingColumn" ] ,
peoplespeoplecolumn : [ "Peoples" , "peopleColumn" ] ,
peoplestabbar : [ "Peoples" , "tabBar" ] ,
2019-10-18 10:56:41 +02:00
pictureinpicture : [ "PictureInPicture" , "pictureInPicture" ] ,
pictureinpicturewindow : [ "PictureInPicture" , "pictureInPictureWindow" ] ,
popout : [ "Popout" , "popout" ] ,
2019-10-23 15:24:40 +02:00
popoutarrowalignmentmiddle : [ "Popout" , "arrowAlignmentMiddle" ] ,
2020-01-30 17:53:13 +01:00
popoutarrowalignmenttop : [ "Popout" , "arrowAlignmentTop" ] ,
2019-10-18 10:56:41 +02:00
popoutbottom : [ "Popout" , "popoutBottom" ] ,
popoutbottomleft : [ "Popout" , "popoutBottomLeft" ] ,
popoutbottomright : [ "Popout" , "popoutBottomRight" ] ,
popoutinvert : [ "Popout" , "popoutInvert" ] ,
popoutleft : [ "Popout" , "popoutLeft" ] ,
popoutnoarrow : [ "Popout" , "noArrow" ] ,
popoutnoshadow : [ "Popout" , "noShadow" ] ,
2019-10-23 15:24:40 +02:00
popoutright : [ "Popout" , "popoutRight" ] ,
2019-10-18 10:56:41 +02:00
popouts : [ "Popout" , "popouts" ] ,
2020-01-30 17:53:13 +01:00
popoutthemedpopout : [ "BDFDB" , "themedPopout" ] ,
2019-10-18 10:56:41 +02:00
popouttop : [ "Popout" , "popoutTop" ] ,
popouttopleft : [ "Popout" , "popoutTopLeft" ] ,
popouttopright : [ "Popout" , "popoutTopRight" ] ,
2019-11-07 15:29:15 +01:00
popoutwrapper : [ "BDFDB" , "popoutWrapper" ] ,
2019-10-18 10:56:41 +02:00
primary : [ "TextStyle" , "primary" ] ,
2019-10-18 22:41:29 +02:00
quickmessage : [ "QuickMessage" , "quickMessage" ] ,
quickmessagepopout : [ "UserPopout" , "quickMessage" ] ,
2019-10-18 10:56:41 +02:00
quickselect : [ "QuickSelect" , "quickSelect" ] ,
quickselectarrow : [ "QuickSelect" , "quickSelectArrow" ] ,
quickselectclick : [ "QuickSelect" , "quickSelectClick" ] ,
quickselectlabel : [ "QuickSelect" , "quickSelectLabel" ] ,
quickselectpopout : [ "QuickSelect" , "quickSelectPopout" ] ,
quickselectpopoutoption : [ "QuickSelect" , "quickSelectPopoutOption" ] ,
2019-11-06 14:31:16 +01:00
quickselectpopoutoptionselected : [ "NotFound" , "quickSelectPopoutOptionSelected" ] ,
2019-10-18 10:56:41 +02:00
quickselectpopoutscroll : [ "QuickSelect" , "quickSelectPopoutScroll" ] ,
2019-11-06 12:52:14 +01:00
quickselectpopoutwrapper : [ "BDFDB" , "quickSelectPopoutWrapper" ] ,
2019-10-18 10:56:41 +02:00
quickselectscroller : [ "QuickSelect" , "quickSelectScroller" ] ,
quickselectselected : [ "QuickSelect" , "selected" ] ,
quickselectvalue : [ "QuickSelect" , "quickSelectValue" ] ,
2019-11-06 12:52:14 +01:00
quickselectwrapper : [ "BDFDB" , "quickSelectWrapper" ] ,
2019-10-18 10:56:41 +02:00
quickswitcher : [ "QuickSwitchWrap" , "quickswitcher" ] ,
quickswitchresult : [ "QuickSwitch" , "result" ] ,
quickswitchresultfocused : [ "QuickSwitch" , "resultFocused" ] ,
quickswitchresultguildicon : [ "QuickSwitch" , "guildIcon" ] ,
quickswitchresultmatch : [ "QuickSwitch" , "match" ] ,
quickswitchresultmisccontainer : [ "QuickSwitchWrap" , "miscContainer" ] ,
quickswitchresultname : [ "QuickSwitch" , "name" ] ,
quickswitchresultnote : [ "QuickSwitch" , "note" ] ,
quickswitchresultusername : [ "QuickSwitch" , "username" ] ,
recentmentionsfilterpopout : [ "RecentMentions" , "recentMentionsFilterPopout" ] ,
recentmentionsheader : [ "RecentMentions" , "header" ] ,
recentmentionsmentionfilter : [ "RecentMentions" , "mentionFilter" ] ,
recentmentionsmentionfilterlabel : [ "RecentMentions" , "label" ] ,
recentmentionsmentionfiltervalue : [ "RecentMentions" , "value" ] ,
recentmentionspopout : [ "RecentMentions" , "recentMentionsPopout" ] ,
2020-01-30 17:53:13 +01:00
recentmentionstabbar : [ "RecentMentions" , "tabBar" ] ,
recentmentionstabbaritem : [ "RecentMentions" , "tabBarItem" ] ,
recentmentionstabbarwrapper : [ "RecentMentions" , "headerTabBarWrapper" ] ,
2019-10-18 22:41:29 +02:00
red : [ "TextStyle" , "statusRed" ] ,
2019-10-18 10:56:41 +02:00
reset : [ "CardStatus" , "reset" ] ,
2019-10-18 22:41:29 +02:00
scrollbar : [ "Scrollbar" , "scrollbar" ] ,
scrollbardefault : [ "Scrollbar" , "scrollbarDefault" ] ,
scrollbarghost : [ "Scrollbar" , "scrollbarGhost" ] ,
scrollbarghosthairline : [ "Scrollbar" , "scrollbarGhostHairline" ] ,
2019-10-18 10:56:41 +02:00
scroller : [ "Scroller" , "scroller" ] ,
scrollerfade : [ "Scroller" , "scrollerFade" ] ,
scrollersystempad : [ "Scroller" , "systemPad" ] ,
scrollerthemed : [ "Scroller" , "scrollerThemed" ] ,
2019-10-18 22:41:29 +02:00
scrollerthemedwithtrack : [ "Scroller" , "themedWithTrack" ] ,
2019-10-18 10:56:41 +02:00
scrollerthemeghost : [ "Scroller" , "themeGhost" ] ,
scrollerthemeghosthairline : [ "Scroller" , "themeGhostHairline" ] ,
scrollerthemeghosthairlinechannels : [ "Scroller" , "themeGhostHairlineChannels" ] ,
scrollerwrap : [ "Scroller" , "scrollerWrap" ] ,
searchbar : [ "SearchBar" , "container" ] ,
searchbarclear : [ "SearchBar" , "clear" ] ,
searchbarclose : [ "SearchBar" , "close" ] ,
searchbaricon : [ "SearchBar" , "icon" ] ,
searchbariconlayout : [ "SearchBar" , "iconLayout" ] ,
searchbariconwrap : [ "SearchBar" , "iconContainer" ] ,
searchbarinner : [ "SearchBar" , "inner" ] ,
searchbarinput : [ "SearchBar" , "input" ] ,
searchbarlarge : [ "SearchBar" , "large" ] ,
searchbarmedium : [ "SearchBar" , "medium" ] ,
searchbarsmall : [ "SearchBar" , "small" ] ,
searchbartag : [ "SearchBar" , "tag" ] ,
searchbarvisible : [ "SearchBar" , "visible" ] ,
searchpopout : [ "SearchPopoutWrap" , "container" ] ,
searchpopoutanswer : [ "SearchPopout" , "answer" ] ,
searchpopoutdatepicker : [ "SearchPopout" , "datePicker" ] ,
searchpopoutdatepickerhint : [ "SearchPopout" , "datePickerHint" ] ,
searchpopoutdmaddpopout : [ "DmAddPopout" , "popout" ] ,
2020-02-05 12:43:04 +01:00
searchpopoutddmadddiscordtag : [ "DmAddPopoutItems" , "discordTag" ] ,
2019-10-18 10:56:41 +02:00
searchpopoutddmaddfriend : [ "DmAddPopoutItems" , "friend" ] ,
searchpopoutddmaddfriendwrapper : [ "DmAddPopoutItems" , "friendWrapper" ] ,
2020-02-05 12:47:20 +01:00
searchpopoutddmaddnickname : [ "DmAddPopoutItems" , "nickname" ] ,
2019-10-18 10:56:41 +02:00
searchpopoutdisplayavatar : [ "SearchPopout" , "displayAvatar" ] ,
searchpopoutdisplayusername : [ "SearchPopout" , "displayUsername" ] ,
searchpopoutdisplayednick : [ "SearchPopout" , "displayedNick" ] ,
searchpopoutfilter : [ "SearchPopout" , "filter" ] ,
searchpopoutheader : [ "SearchPopout" , "header" ] ,
searchpopouthint : [ "SearchPopout" , "hint" ] ,
searchpopouthintvalue : [ "SearchPopout" , "hintValue" ] ,
searchpopoutlinksource : [ "SearchPopout" , "linkSource" ] ,
searchpopoutnontext : [ "SearchPopout" , "nonText" ] ,
searchpopoutoption : [ "SearchPopout" , "option" ] ,
searchpopoutplusicon : [ "SearchPopout" , "plusIcon" ] ,
searchpopoutresultchannel : [ "SearchPopout" , "resultChannel" ] ,
searchpopoutresultsgroup : [ "SearchPopout" , "resultsGroup" ] ,
searchpopoutsearchclearhistory : [ "SearchPopout" , "searchClearHistory" ] ,
searchpopoutsearchlearnmore : [ "SearchPopout" , "searchLearnMore" ] ,
searchpopoutsearchoption : [ "SearchPopout" , "searchOption" ] ,
searchpopoutsearchresultchannelcategory : [ "SearchPopout" , "searchResultChannelCategory" ] ,
searchpopoutsearchresultchannelicon : [ "SearchPopout" , "searchResultChannelIcon" ] ,
searchpopoutsearchresultchanneliconbackground : [ "SearchPopout" , "searchResultChannelIconBackground" ] ,
searchpopoutselected : [ "SearchPopout" , "selected" ] ,
searchpopoutuser : [ "SearchPopout" , "user" ] ,
2020-01-30 17:53:13 +01:00
searchresultsafter : [ "SearchResults" , "after" ] ,
searchresultsalt : [ "SearchResults" , "alt" ] ,
searchresultsbefore : [ "SearchResults" , "before" ] ,
2019-10-18 10:56:41 +02:00
searchresultschannelname : [ "SearchResults" , "channelName" ] ,
2020-01-30 17:53:13 +01:00
searchresultschannelSeparator : [ "SearchResults" , "channelSeparator" ] ,
searchresultsexpanded : [ "SearchResults" , "expanded" ] ,
2020-01-30 17:57:21 +01:00
searchresultsgroupcozy : [ "SearchResults" , "messageGroupCozy" ] ,
2020-01-30 17:53:13 +01:00
searchresultshit : [ "SearchResults" , "hit" ] ,
2019-10-18 10:56:41 +02:00
searchresultspagination : [ "SearchResults" , "pagination" ] ,
2020-01-30 17:53:13 +01:00
searchresultspaginationbutton : [ "SearchResults" , "paginationButton" ] ,
2019-10-18 10:56:41 +02:00
searchresultspaginationdisabled : [ "SearchResults" , "disabled" ] ,
2020-01-30 17:53:13 +01:00
searchresultspaginationicon : [ "SearchResults" , "icon" ] ,
2019-10-18 10:56:41 +02:00
searchresultssearchheader : [ "SearchResults" , "searchHeader" ] ,
searchresultswrap : [ "SearchResults" , "searchResultsWrap" ] ,
select : [ "NotFound" , "select" ] ,
selectable : [ "TextStyle" , "selectable" ] ,
selectarrow : [ "NotFound" , "selectArrow" ] ,
selectarrowcontainer : [ "NotFound" , "selectArrowContainer" ] ,
selectarrowcontainerdark : [ "NotFound" , "selectArrowContainerDark" ] ,
selectarrowcontainerlight : [ "NotFound" , "selectArrowContainerLight" ] ,
selectarrowzone : [ "NotFound" , "selectArrowZone" ] ,
selectcontrol : [ "NotFound" , "selectControl" ] ,
selectcontroldark : [ "NotFound" , "selectControlDark" ] ,
selectcontrollight : [ "NotFound" , "selectControlLight" ] ,
selectdummyinput : [ "NotFound" , "selectDummyInput" ] ,
selecthasvalue : [ "NotFound" , "selectHasValue" ] ,
selectisopen : [ "NotFound" , "selectIsOpen" ] ,
selectmenu : [ "NotFound" , "selectMenu" ] ,
selectmenuouter : [ "NotFound" , "selectMenuOuter" ] ,
selectmenuouterdark : [ "NotFound" , "selectMenuOuterDark" ] ,
selectmenuouterlight : [ "NotFound" , "selectMenuOuterLight" ] ,
selectoption : [ "NotFound" , "selectOption" ] ,
selectoptiondark : [ "NotFound" , "selectOptionDark" ] ,
selectoptionlight : [ "NotFound" , "selectOptionLight" ] ,
selectoptionhoverdark : [ "NotFound" , "selectOptionHoverDark" ] ,
selectoptionhoverlight : [ "NotFound" , "selectOptionHoverLight" ] ,
selectoptionselectdark : [ "NotFound" , "selectOptionSelectDark" ] ,
selectoptionselectlight : [ "NotFound" , "selectOptionSelectLight" ] ,
selectselected : [ "NotFound" , "selectIsSelected" ] ,
selectsingle : [ "NotFound" , "selectSingle" ] ,
selectsingledark : [ "NotFound" , "selectSingleDark" ] ,
selectsinglelight : [ "NotFound" , "selectSingleLight" ] ,
selectvalue : [ "NotFound" , "selectValue" ] ,
selectwrap : [ "Select" , "select" ] ,
2019-11-15 13:14:49 +01:00
selectwrapper : [ "BDFDB" , "selectWrapper" ] ,
2019-10-18 10:56:41 +02:00
settingsclosebutton : [ "SettingsCloseButton" , "closeButton" ] ,
settingsclosebuttoncontainer : [ "SettingsCloseButton" , "container" ] ,
settingsheader : [ "Item" , "header" ] ,
settingsitem : [ "Item" , "item" ] ,
2019-11-20 13:31:06 +01:00
settingsitemdragged : [ "ItemRole" , "dragged" ] ,
settingsitemdlock : [ "ItemRole" , "lock" ] ,
settingsitemrole : [ "ItemRole" , "role" ] ,
settingsitemroleinner : [ "ItemRole" , "roleInner" ] ,
2019-10-18 10:56:41 +02:00
settingsitemselected : [ "Item" , "selected" ] ,
settingsitemthemed : [ "Item" , "themed" ] ,
2019-11-02 01:35:16 +01:00
settingspanel : [ "BDFDB" , "settingsPanel" ] ,
settingspanelinner : [ "BDFDB" , "settingsPanelInner" ] ,
settingspanellist : [ "BDFDB" , "settingsPanelList" ] ,
settingspaneltitle : [ "BDFDB" , "settingsPanelTitle" ] ,
2019-10-18 10:56:41 +02:00
settingsseparator : [ "Item" , "separator" ] ,
settingstabbar : [ "Friends" , "tabBar" ] ,
settingstabbarbadge : [ "Friends" , "badge" ] ,
settingstabbartoppill : [ "Item" , "topPill" ] ,
2019-11-08 15:53:36 +01:00
settingstableheader : [ "SettingsTable" , "header" ] ,
settingstableheadername : [ "SettingsTable" , "headerName" ] ,
settingstableheaderoption : [ "SettingsTable" , "headerOption" ] ,
2020-01-22 10:33:41 +01:00
settingstableheaders : [ "BDFDB" , "settingsTableHeaders" ] ,
2019-11-08 15:53:36 +01:00
settingstableheadersize : [ "SettingsTable" , "headerSize" ] ,
2020-01-22 13:54:03 +01:00
settingstableheadervertical : [ "BDFDB" , "settingsTableHeaderVertical" ] ,
2019-12-18 19:32:01 +01:00
settingstablecard : [ "BDFDB" , "settingsTableCard" ] ,
2020-01-22 10:56:02 +01:00
settingstablecardconfigs : [ "BDFDB" , "settingsTableCardConfigs" ] ,
settingstablecardlabel : [ "BDFDB" , "settingsTableCardLabel" ] ,
2019-12-18 19:32:01 +01:00
settingstablelist : [ "BDFDB" , "settingsTableList" ] ,
2019-10-18 10:56:41 +02:00
sidebarregion : [ "SettingsWindow" , "sidebarRegion" ] ,
size10 : [ "TextSize" , "size10" ] ,
size12 : [ "TextSize" , "size12" ] ,
size14 : [ "TextSize" , "size14" ] ,
size16 : [ "TextSize" , "size16" ] ,
size20 : [ "TextSize" , "size20" ] ,
size24 : [ "TextSize" , "size24" ] ,
size32 : [ "TextSize" , "size32" ] ,
slider : [ "Slider" , "slider" ] ,
sliderbar : [ "Slider" , "bar" ] ,
sliderbarfill : [ "Slider" , "barFill" ] ,
sliderbubble : [ "Slider" , "bubble" ] ,
sliderdisabled : [ "Slider" , "disabled" ] ,
slidergrabber : [ "Slider" , "grabber" ] ,
sliderinput : [ "Slider" , "input" ] ,
slidermark : [ "Slider" , "mark" ] ,
slidermarkdash : [ "Slider" , "markDash" ] ,
slidermarkdashsimple : [ "Slider" , "markDashSimple" ] ,
slidermarkvalue : [ "Slider" , "markValue" ] ,
slidermini : [ "Slider" , "mini" ] ,
slidertrack : [ "Slider" , "track" ] ,
spoilercontainer : [ "Spoiler" , "spoilerContainer" ] ,
2020-02-05 12:22:49 +01:00
spoilerembed : [ "SpoilerEmbed" , "spoiler" ] ,
spoilerembedhidden : [ "SpoilerEmbed" , "hiddenSpoilers" ] ,
spoilerembedinline : [ "SpoilerEmbed" , "inline" ] ,
2019-10-18 10:56:41 +02:00
spoilerhidden : [ "Spoiler" , "hidden" ] ,
spoilertext : [ "Spoiler" , "spoilerText" ] ,
spoilerwarning : [ "Spoiler" , "spoilerWarning" ] ,
small : [ "TextStyle" , "small" ] ,
splashbackground : [ "NotFound" , "splashBackground" ] ,
standardsidebarview : [ "SettingsWindow" , "standardSidebarView" ] ,
status : [ "Avatar" , "status" ] ,
2019-11-06 12:52:14 +01:00
stopanimations : [ "NotFound" , "stopAnimations" ] ,
2019-10-18 10:56:41 +02:00
subtext : [ "NotFound" , "subtext" ] ,
2019-11-06 22:11:43 +01:00
svgicon : [ "BDFDB" , "svgIcon" ] ,
2019-10-18 10:56:41 +02:00
switch : [ "Switch" , "switch" ] ,
switchdisabled : [ "Switch" , "switchDisabled" ] ,
switchenabled : [ "Switch" , "switchEnabled" ] ,
switchinner : [ "Switch" , "checkbox" ] ,
switchinnerdisabled : [ "Switch" , "checkboxDisabled" ] ,
switchinnerenabled : [ "Switch" , "checkboxEnabled" ] ,
switchsize : [ "Switch" , "size" ] ,
switchsizedefault : [ "Switch" , "sizeDefault" ] ,
switchsizemini : [ "Switch" , "sizeMini" ] ,
switchthemeclear : [ "Switch" , "themeClear" ] ,
switchthemedefault : [ "Switch" , "themeDefault" ] ,
switchvalue : [ "Switch" , "value" ] ,
switchvaluechecked : [ "Switch" , "valueChecked" ] ,
switchvalueunchecked : [ "Switch" , "valueUnchecked" ] ,
systempad : [ "Scroller" , "systemPad" ] ,
tabbar : [ "UserProfile" , "tabBar" ] ,
tabbarcontainer : [ "UserProfile" , "tabBarContainer" ] ,
tabbarheader : [ "RecentMentions" , "tabBar" ] ,
tabbarheadercontainer : [ "RecentMentions" , "headerTabBarWrapper" ] ,
tabbarheaderitem : [ "RecentMentions" , "tabBarItem" ] ,
tabbaritem : [ "UserProfile" , "tabBarItem" ] ,
2019-11-04 11:11:33 +01:00
tabbartop : [ "Item" , "top" ] ,
2019-11-04 12:00:45 +01:00
table : [ "BDFDB" , "table" ] ,
2019-11-04 12:11:44 +01:00
tablebodycell : [ "BDFDB" , "tableBodyCell" ] ,
2019-11-04 12:00:45 +01:00
tableheader : [ "BDFDB" , "tableHeader" ] ,
tableheadercell : [ "BDFDB" , "tableHeaderCellSorted" ] ,
tableheadercellsorted : [ "BDFDB" , "tableHeaderCell" ] ,
2019-11-04 17:28:58 +01:00
tableheadersorticon : [ "BDFDB" , "tableHeaderSortIcon" ] ,
2019-11-04 12:00:45 +01:00
tablerow : [ "BDFDB" , "tableRow" ] ,
tablestickyheader : [ "BDFDB" , "tableStickyHeader" ] ,
2019-10-18 10:56:41 +02:00
textarea : [ "ChannelTextArea" , "textArea" ] ,
2019-12-20 22:50:08 +01:00
textareaattachbutton : [ "ChannelTextAreaAttachButton" , "attachButton" ] ,
textareaattachbuttoninner : [ "ChannelTextAreaAttachButton" , "attachButtonInner" ] ,
textareaattachbuttonplus : [ "ChannelTextAreaAttachButton" , "attachButtonPlus" ] ,
textareaattachwrapper : [ "ChannelTextAreaAttachButton" , "attachWrapper" ] ,
2019-10-18 10:56:41 +02:00
textareabutton : [ "ChannelTextAreaButton" , "button" ] ,
textareabuttonactive : [ "ChannelTextAreaButton" , "active" ] ,
2019-11-07 13:45:41 +01:00
textareabuttonpulse : [ "ChannelTextAreaButton" , "pulseButton" ] ,
2019-10-18 10:56:41 +02:00
textareabuttonwrapper : [ "ChannelTextAreaButton" , "buttonWrapper" ] ,
2019-12-17 13:14:24 +01:00
textareacharcounter : [ "ChannelTextAreaCharCounter" , "characterCount" ] ,
textareacharcountererror : [ "ChannelTextAreaCharCounter" , "error" ] ,
2019-10-18 22:41:29 +02:00
textareadisabled : [ "ChannelTextArea" , "textAreaDisabled" ] ,
2020-02-06 17:27:34 +01:00
textareafontsize12padding : [ "ChannelTextArea" , "fontSize12Padding" ] ,
textareafontsize14padding : [ "ChannelTextArea" , "fontSize14Padding" ] ,
textareafontsize15padding : [ "ChannelTextArea" , "fontSize15Padding" ] ,
textareafontsize16padding : [ "ChannelTextArea" , "fontSize16Padding" ] ,
textareafontsize18padding : [ "ChannelTextArea" , "fontSize18Padding" ] ,
textareafontsize20padding : [ "ChannelTextArea" , "fontSize20Padding" ] ,
textareafontsize24padding : [ "ChannelTextArea" , "fontSize24Padding" ] ,
2019-12-11 11:25:24 +01:00
textareahasautocomplete : [ "ChannelTextArea" , "hasAutocomplete" ] ,
2019-10-18 10:56:41 +02:00
textareaicon : [ "ChannelTextAreaButton" , "icon" ] ,
2019-11-07 13:45:41 +01:00
textareaiconpulse : [ "ChannelTextAreaButton" , "pulseIcon" ] ,
2019-10-18 10:56:41 +02:00
textareainner : [ "ChannelTextArea" , "inner" ] ,
textareainnerdisabled : [ "ChannelTextArea" , "innerDisabled" ] ,
textareapickerbutton : [ "ChannelTextArea" , "button" ] ,
2019-10-24 13:24:48 +02:00
textareapickerbuttoncontainer : [ "ChannelTextArea" , "buttonContainer" ] ,
2019-10-18 10:56:41 +02:00
textareapickerbuttons : [ "ChannelTextArea" , "buttons" ] ,
2019-12-11 11:25:24 +01:00
textareascrollablecontainer : [ "ChannelTextArea" , "scrollableContainer" ] ,
2020-02-06 17:27:34 +01:00
textareaslate : [ "ChannelTextArea" , "textAreaSlate" ] ,
textareaslatemarkup : [ "ChannelTextAreaSlate" , "slateTextArea" ] ,
2019-12-21 16:57:39 +01:00
textareaslatecontainer : [ "ChannelTextAreaSlate" , "slateContainer" ] ,
textareaslateplaceholder : [ "ChannelTextAreaSlate" , "placeholder" ] ,
2019-12-20 22:50:08 +01:00
textareauploadinput : [ "ChannelTextAreaAttachButton" , "uploadInput" ] ,
2019-12-11 11:25:24 +01:00
textareawebkit : [ "ChannelTextArea" , "webkit" ] ,
2019-10-18 10:56:41 +02:00
textareawrapall : [ "ChannelTextArea" , "channelTextArea" ] ,
textareawrapchat : [ "ChatWindow" , "channelTextArea" ] ,
textareawrapdisabled : [ "ChannelTextArea" , "channelTextAreaDisabled" ] ,
textlink : [ "Notice" , "textLink" ] ,
textrow : [ "PopoutActivity" , "textRow" ] ,
2019-11-10 20:18:17 +01:00
textscroller : [ "BDFDB" , "textScroller" ] ,
2019-10-18 10:56:41 +02:00
themedark : [ "NotFound" , "themeDark" ] ,
themeghosthairline : [ "Scroller" , "themeGhostHairline" ] ,
themelight : [ "NotFound" , "themeLight" ] ,
themeundefined : [ "NotFound" , "themeUndefined" ] ,
2019-10-18 22:41:29 +02:00
tip : [ "Tip" , "tip" ] ,
tipblock : [ "Tip" , "block" ] ,
tippro : [ "Tip" , "pro" ] ,
tipinline : [ "Tip" , "inline" ] ,
2019-10-18 10:56:41 +02:00
title : [ "SettingsItems" , "title" ] ,
titlebar : [ "TitleBar" , "titleBar" ] ,
2019-11-08 12:28:27 +01:00
titlebarmac : [ "TitleBar" , "typeMacOS" ] ,
titlebarmacbutton : [ "TitleBar" , "macButton" ] ,
titlebarmacbuttonclose : [ "TitleBar" , "macButtonClose" ] ,
titlebarmacbuttonmin : [ "TitleBar" , "macButtonMinimize" ] ,
titlebarmacbuttonmax : [ "TitleBar" , "macButtonMaximize" ] ,
titlebarmacbuttons : [ "TitleBar" , "macButtons" ] ,
titlebarmacwithframe : [ "TitleBar" , "typeMacOSWithFrame" ] ,
titlebarwinbutton : [ "TitleBar" , "winButton" ] ,
titlebarwinbuttonclose : [ "TitleBar" , "winButtonClose" ] ,
titlebarwinbuttonminmax : [ "TitleBar" , "winButtonMinMax" ] ,
titlebarwindows : [ "TitleBar" , "typeWindows" ] ,
titlebarwithframe : [ "TitleBar" , "withFrame" ] ,
titlebarwordmark : [ "TitleBar" , "wordmark" ] ,
titlebarwordmarkmac : [ "TitleBar" , "wordmarkMacOS" ] ,
titlebarwordmarkwindows : [ "TitleBar" , "wordmarkWindows" ] ,
2019-10-18 10:56:41 +02:00
titledefault : [ "SettingsItems" , "titleDefault" ] ,
titlemini : [ "SettingsItems" , "titleMini" ] ,
titlesize10 : [ "UserPopout" , "size10" ] ,
titlesize12 : [ "UserPopout" , "size12" ] ,
titlesize14 : [ "UserPopout" , "size14" ] ,
titlesize16 : [ "UserPopout" , "size16" ] ,
titlesize18 : [ "Title" , "size18" ] ,
tooltip : [ "Tooltip" , "tooltip" ] ,
2019-11-24 11:13:45 +01:00
tooltipactivityicon : [ "TooltipGuild" , "activityIcon" ] ,
2019-10-18 10:56:41 +02:00
tooltipblack : [ "Tooltip" , "tooltipBlack" ] ,
tooltipbottom : [ "Tooltip" , "tooltipBottom" ] ,
tooltipbrand : [ "Tooltip" , "tooltipBrand" ] ,
2019-11-28 11:24:46 +01:00
tooltipcustom : [ "BDFDB" , "tooltipCustom" ] ,
2019-10-18 10:56:41 +02:00
tooltipgreen : [ "Tooltip" , "tooltipGreen" ] ,
tooltipgrey : [ "Tooltip" , "tooltipGrey" ] ,
2019-11-24 11:13:45 +01:00
tooltipguildnametext : [ "TooltipGuild" , "guildNameText" ] ,
tooltipguildnametextlimitedsize : [ "TooltipGuild" , "guildNameTextLimitedSize" ] ,
2019-10-18 10:56:41 +02:00
tooltipleft : [ "Tooltip" , "tooltipLeft" ] ,
2019-11-24 11:13:45 +01:00
tooltiplistitem : [ "GuildsItems" , "listItemTooltip" ] ,
2019-10-18 10:56:41 +02:00
tooltippointer : [ "Tooltip" , "tooltipPointer" ] ,
tooltipred : [ "Tooltip" , "tooltipRed" ] ,
tooltipright : [ "Tooltip" , "tooltipRight" ] ,
2019-11-24 11:13:45 +01:00
tooltiprow : [ "TooltipGuild" , "row" ] ,
tooltiprowguildname : [ "TooltipGuild" , "rowGuildName" ] ,
tooltiprowicon : [ "TooltipGuild" , "rowIcon" ] ,
2019-10-18 10:56:41 +02:00
tooltiptop : [ "Tooltip" , "tooltipTop" ] ,
tooltipyellow : [ "Tooltip" , "tooltipYellow" ] ,
typing : [ "Typing" , "typing" ] ,
2020-01-21 15:12:48 +01:00
typingcooldownwrapper : [ "Typing" , "cooldownWrapper" ] ,
typingtext : [ "Typing" , "text" ] ,
2019-11-12 20:08:45 +01:00
underline : [ "BDFDB" , "underline" ] ,
2019-10-18 10:56:41 +02:00
unreadbar : [ "UnreadBar" , "bar" ] ,
unreadbaractive : [ "UnreadBar" , "active" ] ,
unreadbarcontainer : [ "UnreadBar" , "container" ] ,
unreadbaricon : [ "UnreadBar" , "icon" ] ,
unreadbarmention : [ "UnreadBar" , "mention" ] ,
unreadbartext : [ "UnreadBar" , "text" ] ,
unreadbarunread : [ "UnreadBar" , "unread" ] ,
2019-12-21 11:25:13 +01:00
uploadmodal : [ "UploadModal" , "uploadModal" ] ,
2020-02-07 15:16:40 +01:00
userinfo : [ "UserInfo" , "userInfo" ] ,
userinfoavatar : [ "UserInfo" , "avatar" ] ,
userinfodiscordtag : [ "UserInfo" , "discordTag" ] ,
userinfodiscriminator : [ "UserInfo" , "discriminator" ] ,
userinfohovered : [ "UserInfo" , "hovered" ] ,
userinfosubtext : [ "UserInfo" , "subtext" ] ,
userinfotext : [ "UserInfo" , "text" ] ,
userinfousername : [ "UserInfo" , "username" ] ,
2019-10-18 10:56:41 +02:00
userpopout : [ "UserPopout" , "userPopout" ] ,
2019-10-18 22:41:29 +02:00
userpopoutavatarhint : [ "UserPopout" , "avatarHint" ] ,
userpopoutavatarhintinner : [ "UserPopout" , "avatarHintInner" ] ,
2019-10-18 10:56:41 +02:00
userpopoutavatarwrapper : [ "UserPopout" , "avatarWrapper" ] ,
2019-10-18 22:41:29 +02:00
userpopoutavatarwrappernormal : [ "UserPopout" , "avatarWrapperNormal" ] ,
userpopoutbody : [ "UserPopout" , "body" ] ,
userpopoutbodyinner : [ "UserPopout" , "bodyInner" ] ,
userpopoutbodytitle : [ "UserPopout" , "bodyTitle" ] ,
2019-10-18 10:56:41 +02:00
userpopoutcustomstatus : [ "UserPopout" , "customStatus" ] ,
2019-10-30 10:30:46 +01:00
userpopoutcustomstatusemoji : [ "UserPopout" , "customStatusEmoji" ] ,
userpopoutcustomstatussoloemoji : [ "UserPopout" , "customStatusSoloEmoji" ] ,
userpopoutcustomstatustext : [ "UserPopout" , "customStatusText" ] ,
2019-10-18 22:41:29 +02:00
userpopoutendbodysection : [ "UserPopout" , "endBodySection" ] ,
userpopoutfooter : [ "UserPopout" , "footer" ] ,
2019-10-18 10:56:41 +02:00
userpopoutheader : [ "UserPopout" , "header" ] ,
userpopoutheaderbottagwithnickname : [ "UserPopout" , "headerBotTagWithNickname" ] ,
userpopoutheadernamewrapper : [ "UserPopout" , "headerNameWrapper" ] ,
userpopoutheadernickname : [ "UserPopout" , "headerName" ] ,
userpopoutheadernormal : [ "UserPopout" , "headerNormal" ] ,
userpopoutheaderplaying : [ "UserPopout" , "headerPlaying" ] ,
userpopoutheaderspotify : [ "UserPopout" , "headerSpotify" ] ,
userpopoutheaderstreaming : [ "UserPopout" , "headerStreaming" ] ,
userpopoutheadertag : [ "UserPopout" , "headerTag" ] ,
userpopoutheadertagnonickname : [ "UserPopout" , "headerTagNoNickname" ] ,
userpopoutheadertagusernamenonickname : [ "UserPopout" , "headerTagUsernameNoNickname" ] ,
userpopoutheadertagwithnickname : [ "UserPopout" , "headerTagWithNickname" ] ,
userpopoutheadertext : [ "UserPopout" , "headerText" ] ,
2019-10-18 22:41:29 +02:00
userpopoutheadertop : [ "UserPopout" , "headerTop" ] ,
userpopoutprotip : [ "UserPopout" , "protip" ] ,
2019-10-18 10:56:41 +02:00
userpopoutrole : [ "Role" , "role" ] ,
userpopoutrolecircle : [ "Role" , "roleCircle" ] ,
userpopoutrolelist : [ "UserPopout" , "rolesList" ] ,
userpopoutrolename : [ "Role" , "roleName" ] ,
2019-10-18 22:41:29 +02:00
userpopoutroles : [ "Role" , "root" ] ,
2019-10-18 10:56:41 +02:00
userprofile : [ "UserProfile" , "root" ] ,
userprofilebody : [ "UserProfile" , "body" ] ,
userprofilebottag : [ "UserProfile" , "botTag" ] ,
userprofilecustomstatus : [ "UserProfile" , "customStatusText" ] ,
userprofilecustomstatusemoji : [ "UserProfile" , "customStatusEmoji" ] ,
userprofileheader : [ "UserProfile" , "header" ] ,
userprofileheaderfill : [ "UserProfile" , "headerFill" ] ,
userprofileheaderinfo : [ "UserProfile" , "headerInfo" ] ,
userprofilelistavatar : [ "UserProfile" , "listAvatar" ] ,
userprofilelistguildavatarwithouticon : [ "UserProfile" , "guildAvatarWithoutIcon" ] ,
userprofilenametag : [ "UserProfile" , "nameTag" ] ,
userprofiletopsectionnormal : [ "UserProfile" , "topSectionNormal" ] ,
userprofiletopsectionplaying : [ "UserProfile" , "topSectionPlaying" ] ,
userprofiletopsectionspotify : [ "UserProfile" , "topSectionSpotify" ] ,
userprofiletopsectionstreaming : [ "UserProfile" , "topSectionStreaming" ] ,
userprofiletopsectionxbox : [ "UserProfile" , "topSectionXbox" ] ,
userprofileusername : [ "UserProfile" , "username" ] ,
username : [ "NameTag" , "username" ] ,
usernote : [ "Note" , "note" ] ,
usernotepopout : [ "UserPopout" , "note" ] ,
usernoteprofile : [ "UserProfile" , "note" ] ,
vertical : [ "Flex" , "vertical" ] ,
voiceavatar : [ "VoiceChannel" , "avatar" ] ,
voiceavatarcontainer : [ "VoiceChannel" , "avatarContainer" ] ,
voiceavatarlarge : [ "VoiceChannel" , "avatarLarge" ] ,
voiceavatarsmall : [ "VoiceChannel" , "avatarSmall" ] ,
voiceavatarspeaking : [ "VoiceChannel" , "avatarSpeaking" ] ,
voiceclickable : [ "VoiceChannel" , "clickable" ] ,
voicecontent : [ "VoiceChannel" , "content" ] ,
voicedetails : [ "VoiceDetails" , "container" ] ,
voicedetailsactive : [ "VoiceDetailsPing" , "active" ] ,
voicedetailschannel : [ "VoiceDetails" , "channel" ] ,
voicedetailscustomstatuscontainer : [ "VoiceDetails" , "customStatusContainer" ] ,
voicedetailshotspot : [ "VoiceDetails" , "hotspot" ] ,
voicedetailsinactive : [ "VoiceDetailsPing" , "inactive" ] ,
voicedetailsinner : [ "VoiceDetails" , "inner" ] ,
voicedetailslabelwrapper : [ "VoiceDetailsPing" , "labelWrapper" ] ,
voicedetailsping : [ "VoiceDetailsPing" , "ping" ] ,
voicedetailsqualityaverage : [ "VoiceDetailsPing" , "rtcConnectionQualityAverage" ] ,
voicedetailsqualitybad : [ "VoiceDetailsPing" , "rtcConnectionQualityBad" ] ,
voicedetailsqualityfine : [ "VoiceDetailsPing" , "rtcConnectionQualityFine" ] ,
voicedetailsstatus : [ "VoiceDetailsPing" , "rtcConnectionStatus" ] ,
voicedetailsstatusconnected : [ "VoiceDetailsPing" , "rtcConnectionStatusConnected" ] ,
voicedetailsstatusconnecting : [ "VoiceDetailsPing" , "rtcConnectionStatusConnecting" ] ,
voicedetailsstatuserror : [ "VoiceDetailsPing" , "rtcConnectionStatusError" ] ,
voicedetailsstatuswithpopout : [ "VoiceDetails" , "statusWithPopout" ] ,
voicedraggable : [ "NotFound" , "voiceDraggable" ] ,
voiceflipped : [ "VoiceChannel" , "flipped" ] ,
voiceicon : [ "VoiceChannel" , "icon" ] ,
voiceicons : [ "VoiceChannel" , "icons" ] ,
voiceiconspacing : [ "VoiceChannel" , "iconSpacing" ] ,
voicelist : [ "VoiceChannel" , "list" ] ,
voicelist2 : [ "VoiceChannelList" , "list" ] ,
voicelistcollapsed : [ "VoiceChannel" , "listCollapse" ] ,
voicelistcollapsed2 : [ "VoiceChannelList" , "collapsed" ] ,
voicelistdefault : [ "VoiceChannel" , "listDefault" ] ,
voiceliveicon : [ "VoiceChannel" , "liveIcon" ] ,
voicename : [ "VoiceChannel" , "username" ] ,
voicenamefont : [ "VoiceChannel" , "usernameFont" ] ,
voicenamespeaking : [ "VoiceChannel" , "usernameSpeaking" ] ,
voiceselected : [ "VoiceChannel" , "selected" ] ,
voiceuser : [ "VoiceChannel" , "voiceUser" ] ,
voiceuserlarge : [ "VoiceChannel" , "userLarge" ] ,
voiceusersmall : [ "VoiceChannel" , "userSmall" ] ,
2019-10-18 22:41:29 +02:00
weightbold : [ "TextStyle" , "weightBold" ] ,
weightlight : [ "TextStyle" , "weightLight" ] ,
weightmedium : [ "TextStyle" , "weightMedium" ] ,
weightnormal : [ "TextStyle" , "weightNormal" ] ,
weightsemibold : [ "TextStyle" , "weightSemiBold" ] ,
white : [ "TextStyle" , "white" ] ,
whitney : [ "TextStyle" , "whitney" ] ,
2019-10-18 10:56:41 +02:00
wrap : [ "Flex" , "wrap" ] ,
2019-10-18 22:41:29 +02:00
wrapreverse : [ "Flex" , "wrapReverse" ] ,
yellow : [ "TextStyle" , "statusYellow" ]
2019-10-18 10:56:41 +02:00
} ;
BDFDB . DiscordClasses = Object . assign ( { } , DiscordClasses ) ;
InternalBDFDB . getDiscordClass = ( item , selector ) => {
var classname = DiscordClassModules . BDFDB . BDFDBundefined ;
if ( DiscordClasses [ item ] === undefined ) {
2019-11-03 16:53:33 +01:00
BDFDB . LogUtils . warn ( item + " not found in DiscordClasses" ) ;
2019-10-18 10:56:41 +02:00
return classname ;
}
2019-10-18 14:56:41 +02:00
else if ( ! BDFDB . ArrayUtils . is ( DiscordClasses [ item ] ) || DiscordClasses [ item ] . length != 2 ) {
2019-11-03 16:53:33 +01:00
BDFDB . LogUtils . warn ( item + " is not an Array of Length 2 in DiscordClasses" ) ;
2019-10-18 10:56:41 +02:00
return classname ;
}
else if ( DiscordClassModules [ DiscordClasses [ item ] [ 0 ] ] === undefined ) {
2019-11-03 16:53:33 +01:00
BDFDB . LogUtils . warn ( DiscordClasses [ item ] [ 0 ] + " not found in DiscordClassModules" ) ;
2019-10-18 10:56:41 +02:00
return classname ;
}
else if ( DiscordClassModules [ DiscordClasses [ item ] [ 0 ] ] [ DiscordClasses [ item ] [ 1 ] ] === undefined ) {
2019-11-03 16:53:33 +01:00
BDFDB . LogUtils . warn ( DiscordClasses [ item ] [ 1 ] + " not found in " + DiscordClasses [ item ] [ 0 ] + " in DiscordClassModules" ) ;
2019-10-18 10:56:41 +02:00
return classname ;
}
else {
classname = DiscordClassModules [ DiscordClasses [ item ] [ 0 ] ] [ DiscordClasses [ item ] [ 1 ] ] ;
if ( selector ) {
classname = classname . split ( " " ) . filter ( n => n . indexOf ( "da-" ) != 0 ) . join ( selector ? "." : " " ) ;
classname = classname || DiscordClassModules . BDFDB . BDFDBundefined ;
}
return classname ;
}
} ;
BDFDB . disCN = new Proxy ( DiscordClasses , {
get : function ( list , item ) {
return InternalBDFDB . getDiscordClass ( item , false ) . replace ( "#" , "" ) ;
}
} ) ;
BDFDB . disCNS = new Proxy ( DiscordClasses , {
get : function ( list , item ) {
return InternalBDFDB . getDiscordClass ( item , false ) . replace ( "#" , "" ) + " " ;
}
} ) ;
BDFDB . disCNC = new Proxy ( DiscordClasses , {
get : function ( list , item ) {
return InternalBDFDB . getDiscordClass ( item , false ) . replace ( "#" , "" ) + "," ;
}
} ) ;
BDFDB . dotCN = new Proxy ( DiscordClasses , {
get : function ( list , item ) {
let classname = InternalBDFDB . getDiscordClass ( item , true ) ;
return ( classname . indexOf ( "#" ) == 0 ? "" : "." ) + classname ;
}
} ) ;
BDFDB . dotCNS = new Proxy ( DiscordClasses , {
get : function ( list , item ) {
let classname = InternalBDFDB . getDiscordClass ( item , true ) ;
return ( classname . indexOf ( "#" ) == 0 ? "" : "." ) + classname + " " ;
}
} ) ;
BDFDB . dotCNC = new Proxy ( DiscordClasses , {
get : function ( list , item ) {
let classname = InternalBDFDB . getDiscordClass ( item , true ) ;
return ( classname . indexOf ( "#" ) == 0 ? "" : "." ) + classname + "," ;
}
} ) ;
BDFDB . notCN = new Proxy ( DiscordClasses , {
get : function ( list , item ) {
return ` :not(. ${ InternalBDFDB . getDiscordClass ( item , true ) . split ( "." ) [ 0 ] } ) ` ;
}
} ) ;
BDFDB . notCNS = new Proxy ( DiscordClasses , {
get : function ( list , item ) {
return ` :not(. ${ InternalBDFDB . getDiscordClass ( item , true ) . split ( "." ) [ 0 ] } ) ` ;
}
} ) ;
BDFDB . notCNC = new Proxy ( DiscordClasses , {
get : function ( list , item ) {
return ` :not(. ${ InternalBDFDB . getDiscordClass ( item , true ) . split ( "." ) [ 0 ] } ), ` ;
}
} ) ;
2019-10-25 11:30:50 +02:00
var LanguageStrings = LibraryModules . LanguageStore && LibraryModules . LanguageStore . _proxyContext ? Object . assign ( { } , LibraryModules . LanguageStore . _proxyContext . defaultMessages ) : { } ;
2019-10-19 11:41:39 +02:00
BDFDB . LanguageUtils = { } ;
BDFDB . LanguageUtils . languages = {
2019-12-09 15:56:53 +01:00
"$discord" : { name : "Discord (English))" , id : "en" , ownlang : "English" , integrated : false , dic : false } ,
"af" : { name : "Afrikaans" , id : "af" , ownlang : "Afrikaans" , integrated : false , dic : true } ,
"sq" : { name : "Albanian" , id : "sq" , ownlang : "Shqiptar" , integrated : false , dic : false } ,
"am" : { name : "Amharic" , id : "am" , ownlang : "አማርኛ" , integrated : false , dic : false } ,
"ar" : { name : "Arabic" , id : "ar" , ownlang : "اللغة العربية" , integrated : false , dic : false } ,
"hy" : { name : "Armenian" , id : "hy" , ownlang : "Հայերեն" , integrated : false , dic : false } ,
"az" : { name : "Azerbaijani" , id : "az" , ownlang : "آذربایجان دیلی" , integrated : false , dic : false } ,
2019-12-10 13:21:59 +01:00
"ba" : { name : "Bashkir" , id : "ba" , ownlang : "Башҡорт" , integrated : false , dic : false } ,
2019-12-09 15:56:53 +01:00
"eu" : { name : "Basque" , id : "eu" , ownlang : "Euskara" , integrated : false , dic : false } ,
"be" : { name : "Belarusian" , id : "be" , ownlang : "Беларуская" , integrated : false , dic : false } ,
"bn" : { name : "Bengali" , id : "bn" , ownlang : "বাংলা" , integrated : false , dic : false } ,
"bs" : { name : "Bosnian" , id : "bs" , ownlang : "Босански" , integrated : false , dic : false } ,
"bg" : { name : "Bulgarian" , id : "bg" , ownlang : "български" , integrated : true , dic : false } ,
"my" : { name : "Burmese" , id : "my" , ownlang : "မြန်မာစာ" , integrated : false , dic : false } ,
"ca" : { name : "Catalan" , id : "ca" , ownlang : "Català" , integrated : false , dic : false } ,
"ceb" : { name : "Cebuano" , id : "ceb" , ownlang : "Bisaya" , integrated : false , dic : false } ,
2019-12-10 13:21:59 +01:00
"ny" : { name : "Chichewa" , id : "ny" , ownlang : "Nyanja" , integrated : false , dic : false } ,
2020-01-12 22:08:37 +01:00
"zh" : { name : "Chinese" , id : "zh" , ownlang : "中文" , integrated : false , dic : false } ,
2019-12-09 15:56:53 +01:00
"zh-HK" : { name : "Chinese (Hong Kong)" , id : "zh-HK" , ownlang : "香港中文" , integrated : false , dic : false } ,
"zh-CN" : { name : "Chinese (Simplified)" , id : "zh-CN" , ownlang : "简体中文" , integrated : false , dic : false } ,
"zh-TW" : { name : "Chinese (Traditional)" , id : "zh-TW" , ownlang : "繁體中文" , integrated : true , dic : false } ,
"co" : { name : "Corsican" , id : "co" , ownlang : "Corsu" , integrated : false , dic : false } ,
"hr" : { name : "Croatian" , id : "hr" , ownlang : "Hrvatski" , integrated : true , dic : false } ,
"cs" : { name : "Czech" , id : "cs" , ownlang : "Čeština" , integrated : true , dic : false } ,
"da" : { name : "Danish" , id : "da" , ownlang : "Dansk" , integrated : true , dic : true } ,
"nl" : { name : "Dutch" , id : "nl" , ownlang : "Nederlands" , integrated : true , dic : true } ,
"en" : { name : "English" , id : "en" , ownlang : "English" , integrated : false , dic : true } ,
"en-GB" : { name : "English (UK)" , id : "en-GB" , ownlang : "English (UK)" , integrated : true , dic : true } ,
"en-US" : { name : "English (US)" , id : "en-US" , ownlang : "English (US)" , integrated : true , dic : true } ,
"eo" : { name : "Esperanto" , id : "eo" , ownlang : "Esperanto" , integrated : false , dic : false } ,
"et" : { name : "Estonian" , id : "et" , ownlang : "Eesti" , integrated : false , dic : false } ,
"fil" : { name : "Filipino" , id : "fil" , ownlang : "Wikang Filipino" , integrated : false , dic : false } ,
"fi" : { name : "Finnish" , id : "fi" , ownlang : "Suomi" , integrated : true , dic : false } ,
"fr" : { name : "French" , id : "fr" , ownlang : "Français" , integrated : true , dic : true } ,
"fr-CA" : { name : "French (Canadian)" , id : "fr-CA" , ownlang : "Français Canadien" , integrated : false , dic : false } ,
"fy" : { name : "Frisian" , id : "fy" , ownlang : "Frysk" , integrated : false , dic : false } ,
"gl" : { name : "Galician" , id : "gl" , ownlang : "Galego" , integrated : false , dic : false } ,
"ka" : { name : "Georgian" , id : "ka" , ownlang : "ქართული" , integrated : false , dic : false } ,
"de" : { name : "German" , id : "de" , ownlang : "Deutsch" , integrated : true , dic : true } ,
"de-AT" : { name : "German (Austria)" , id : "de-AT" , ownlang : "Österreichisch Deutsch" , integrated : false , dic : false } ,
"de-CH" : { name : "German (Switzerland)" , id : "de-CH" , ownlang : "Schweizerdeutsch" , integrated : false , dic : false } ,
"el" : { name : "Greek" , id : "el" , ownlang : "Ελληνικά" , integrated : false , dic : false } ,
"gu" : { name : "Gujarati" , id : "gu" , ownlang : "ગુજરાતી" , integrated : false , dic : false } ,
"ht" : { name : "Haitian Creole" , id : "ht" , ownlang : "Kreyòl Ayisyen" , integrated : false , dic : false } ,
"ha" : { name : "Hausa" , id : "ha" , ownlang : "حَوْسَ" , integrated : false , dic : false } ,
"haw" : { name : "Hawaiian" , id : "haw" , ownlang : "ʻ Ōlelo Hawaiʻ i" , integrated : false , dic : false } ,
2019-12-10 13:21:59 +01:00
"he" : { name : "Hebrew" , id : "he" , ownlang : "עברית" , integrated : false , dic : false } ,
2019-12-10 13:41:27 +01:00
"iw" : { name : "Hebrew (Israel)" , id : "iw" , ownlang : "עברית" , integrated : false , dic : false } ,
2019-12-09 15:56:53 +01:00
"hi" : { name : "Hindi" , id : "hi" , ownlang : "हिन्दी" , integrated : false , dic : false } ,
"hmn" : { name : "Hmong" , id : "hmn" , ownlang : "lol Hmongb" , integrated : false , dic : false } ,
"hu" : { name : "Hungarian" , id : "hu" , ownlang : "Magyar" , integrated : false , dic : false } ,
"is" : { name : "Icelandic" , id : "is" , ownlang : "Íslenska" , integrated : false , dic : false } ,
"ig" : { name : "Igbo" , id : "ig" , ownlang : "Asụsụ Igbo" , integrated : false , dic : false } ,
"id" : { name : "Indonesian" , id : "id" , ownlang : "Bahasa Indonesia" , integrated : false , dic : false } ,
"ga" : { name : "Irish" , id : "ga" , ownlang : "Gaeilge" , integrated : false , dic : false } ,
"it" : { name : "Italian" , id : "it" , ownlang : "Italiano" , integrated : true , dic : true } ,
"ja" : { name : "Japanese" , id : "ja" , ownlang : "日本語" , integrated : true , dic : false } ,
2019-12-10 13:21:59 +01:00
"jv" : { name : "Javanese" , id : "jv" , ownlang : "ꦧꦱꦗꦮ" , integrated : false , dic : false } ,
"jw" : { name : "Javanese (Javanese)" , id : "jw" , ownlang : "ꦧꦱꦗꦮ" , integrated : false , dic : false } ,
2019-12-09 15:56:53 +01:00
"kn" : { name : "Kannada" , id : "kn" , ownlang : "ಕನ್ನಡ" , integrated : false , dic : false } ,
"kk" : { name : "Kazakh" , id : "kk" , ownlang : "Қазақ Tі лі " , integrated : false , dic : false } ,
"km" : { name : "Khmer" , id : "km" , ownlang : "ភាសាខ្មែរ" , integrated : false , dic : false } ,
"ko" : { name : "Korean" , id : "ko" , ownlang : "한국어" , integrated : true , dic : false } ,
"ku" : { name : "Kurdish" , id : "ku" , ownlang : "کوردی" , integrated : false , dic : false } ,
"ky" : { name : "Kyrgyz" , id : "ky" , ownlang : "кыргызча" , integrated : false , dic : false } ,
"lo" : { name : "Lao" , id : "lo" , ownlang : "ພາສາລາວ" , integrated : false , dic : false } ,
"la" : { name : "Latin" , id : "la" , ownlang : "Latina" , integrated : false , dic : false } ,
"lv" : { name : "Latvian" , id : "lv" , ownlang : "Latviešu" , integrated : false , dic : false } ,
"lt" : { name : "Lithuanian" , id : "lt" , ownlang : "Lietuvių" , integrated : false , dic : false } ,
"lb" : { name : "Luxembourgish" , id : "lb" , ownlang : "Lëtzebuergesch" , integrated : false , dic : false } ,
"mk" : { name : "Macedonian" , id : "mk" , ownlang : "Mа ке до нс ки" , integrated : false , dic : false } ,
"mg" : { name : "Malagasy" , id : "mg" , ownlang : "Malagasy" , integrated : false , dic : false } ,
"ms" : { name : "Malay" , id : "ms" , ownlang : "بهاس ملايو" , integrated : false , dic : false } ,
"ml" : { name : "Malayalam" , id : "ml" , ownlang : "മലയാളം" , integrated : false , dic : false } ,
"mt" : { name : "Maltese" , id : "mt" , ownlang : "Malti" , integrated : false , dic : false } ,
"mi" : { name : "Maori" , id : "mi" , ownlang : "te Reo Māori" , integrated : false , dic : false } ,
"mr" : { name : "Marathi" , id : "mr" , ownlang : "मराठी" , integrated : false , dic : false } ,
2019-12-10 13:21:59 +01:00
"mhr" : { name : "Mari" , id : "mhr" , ownlang : "марий йылме" , integrated : false , dic : false } ,
2019-12-09 15:56:53 +01:00
"mn" : { name : "Mongolian" , id : "mn" , ownlang : "Монгол Хэл" , integrated : false , dic : false } ,
"my" : { name : "Myanmar (Burmese)" , id : "my" , ownlang : "မြန်မာл Хэл" , integrated : false , dic : false } ,
"ne" : { name : "Nepali" , id : "ne" , ownlang : "नेपाली" , integrated : false , dic : false } ,
"no" : { name : "Norwegian" , id : "no" , ownlang : "Norsk" , integrated : true , dic : false } ,
2019-12-10 13:21:59 +01:00
"pap" : { name : "Papiamento" , id : "pap" , ownlang : "Papiamentu" , integrated : false , dic : false } ,
2019-12-09 15:56:53 +01:00
"ps" : { name : "Pashto" , id : "ps" , ownlang : "پښتو" , integrated : false , dic : false } ,
"fa" : { name : "Persian" , id : "fa" , ownlang : "فارسی" , integrated : false , dic : false } ,
"pl" : { name : "Polish" , id : "pl" , ownlang : "Polski" , integrated : true , dic : true } ,
"pt" : { name : "Portuguese" , id : "pt" , ownlang : "Português" , integrated : false , dic : true } ,
"pt-BR" : { name : "Portuguese (Brazil)" , id : "pt-BR" , ownlang : "Português do Brasil" , integrated : true , dic : true } ,
"pt-PT" : { name : "Portuguese (Portugal)" , id : "pt-PT" , ownlang : "Português do Portugal" , integrated : false , dic : false } ,
"pa" : { name : "Punjabi" , id : "pa" , ownlang : "पंजाबी" , integrated : false , dic : false } ,
"ro" : { name : "Romanian" , id : "ro" , ownlang : "Română" , integrated : false , dic : false } ,
"ru" : { name : "Russian" , id : "ru" , ownlang : "Pу с с кий" , integrated : true , dic : true } ,
"sm" : { name : "Samoan" , id : "sm" , ownlang : "Gagana Sāmoa" , integrated : false , dic : false } ,
"gd" : { name : "Scottish Gaelic" , id : "gd" , ownlang : "Gàidhlig" , integrated : false , dic : false } ,
"sr" : { name : "Serbian" , id : "sr" , ownlang : "Српски" , integrated : false , dic : false } ,
2019-12-10 13:21:59 +01:00
"st" : { name : "Sesotho" , id : "st" , ownlang : "Sesotho" , integrated : false , dic : false } ,
2019-12-09 15:56:53 +01:00
"sn" : { name : "Shona" , id : "sn" , ownlang : "Shona" , integrated : false , dic : false } ,
"sd" : { name : "Sindhi" , id : "sd" , ownlang : "سنڌي" , integrated : false , dic : false } ,
"si" : { name : "Sinhala" , id : "si" , ownlang : "සිංහල" , integrated : false , dic : false } ,
"sk" : { name : "Slovak" , id : "sk" , ownlang : "Slovenčina" , integrated : false , dic : false } ,
"sl" : { name : "Slovenian" , id : "sl" , ownlang : "Slovenščina" , integrated : false , dic : false } ,
"so" : { name : "Somali" , id : "so" , ownlang : "Soomaali" , integrated : false , dic : false } ,
"es" : { name : "Spanish" , id : "es" , ownlang : "Español" , integrated : true , dic : true } ,
"es-419" : { name : "Spanish (Latin America)" , id : "es-419" , ownlang : "Español latinoamericano" , integrated : false , dic : false } ,
2019-12-10 13:21:59 +01:00
"su" : { name : "Sundanese" , id : "su" , ownlang : "Basa Sunda" , integrated : false , dic : false } ,
2019-12-09 15:56:53 +01:00
"sw" : { name : "Swahili" , id : "sw" , ownlang : "Kiswahili" , integrated : false , dic : false } ,
"sv" : { name : "Swedish" , id : "sv" , ownlang : "Svenska" , integrated : true , dic : true } ,
2019-12-10 13:21:59 +01:00
"tl" : { name : "Tagalog" , id : "tl" , ownlang : "Wikang Tagalog" , integrated : false , dic : false } ,
2019-12-09 15:56:53 +01:00
"tg" : { name : "Tajik" , id : "tg" , ownlang : "тоҷикӣ" , integrated : false , dic : false } ,
"ta" : { name : "Tamil" , id : "ta" , ownlang : "தமிழ்" , integrated : false , dic : false } ,
2019-12-10 13:21:59 +01:00
"tt" : { name : "Tatar" , id : "tt" , ownlang : "татарча" , integrated : false , dic : false } ,
2019-12-09 15:56:53 +01:00
"te" : { name : "Telugu" , id : "te" , ownlang : "తెలుగు" , integrated : false , dic : false } ,
"th" : { name : "Thai" , id : "th" , ownlang : "ภาษาไทย" , integrated : false , dic : false } ,
"tr" : { name : "Turkish" , id : "tr" , ownlang : "Türkçe" , integrated : true , dic : false } ,
2019-12-10 13:21:59 +01:00
"udm" : { name : "Udmurt" , id : "udm" , ownlang : "удмурт кыл" , integrated : false , dic : false } ,
2019-12-09 15:56:53 +01:00
"uk" : { name : "Ukrainian" , id : "uk" , ownlang : "Yкр а їнс ький" , integrated : true , dic : false } ,
"ur" : { name : "Urdu" , id : "ur" , ownlang : "اُردُو" , integrated : false , dic : false } ,
"uz" : { name : "Uzbek" , id : "uz" , ownlang : "اوزبیک" , integrated : false , dic : false } ,
"vi" : { name : "Vietnamese" , id : "vi" , ownlang : "Tiếng Việt Nam" , integrated : false , dic : false } ,
"cy" : { name : "Welsh" , id : "cy" , ownlang : "Cymraeg" , integrated : false , dic : false } ,
"xh" : { name : "Xhosa" , id : "xh" , ownlang : "Xhosa" , integrated : false , dic : false } ,
"yi" : { name : "Yiddish" , id : "yi" , ownlang : "ייִדיש ייִדיש" , integrated : false , dic : false } ,
"yo" : { name : "Yoruba" , id : "yo" , ownlang : "Èdè Yorùbá" , integrated : false , dic : false } ,
"zu" : { name : "Zulu" , id : "zu" , ownlang : "Zulu" , integrated : false , dic : false }
2019-10-19 11:41:39 +02:00
} ;
InternalBDFDB . LibraryStrings = {
"hr" : {
toast _plugin _started : "{{var0}} je započeo." ,
toast _plugin _stopped : "{{var0}} zaustavljen." ,
toast _plugin _translated : "prijevod na {{var0}}." ,
file _navigator _text : "Pregledajte datoteku" ,
btn _all _text : "Sve" //REMOVE
} ,
"da" : {
toast _plugin _started : "{{var0}} er startet." ,
toast _plugin _stopped : "{{var0}} er stoppet." ,
toast _plugin _translated : "oversat til {{var0}}." ,
file _navigator _text : "Gennemse fil" ,
btn _all _text : "Alle"
} ,
"de" : {
toast _plugin _started : "{{var0}} wurde gestartet." ,
toast _plugin _stopped : "{{var0}} wurde gestoppt." ,
toast _plugin _translated : "auf {{var0}} übersetzt." ,
file _navigator _text : "Datei durchsuchen" ,
btn _all _text : "Alle"
} ,
"es" : {
toast _plugin _started : "{{var0}} se guilddiv iniciado." ,
toast _plugin _stopped : "{{var0}} se guilddiv detenido." ,
toast _plugin _translated : "traducido a {{var0}}." ,
file _navigator _text : "Buscar archivo" ,
btn _all _text : "Todo"
} ,
"fr" : {
toast _plugin _started : "{{var0}} a été démarré." ,
toast _plugin _stopped : "{{var0}} a été arrêté." ,
toast _plugin _translated : "traduit en {{var0}}." ,
file _navigator _text : "Parcourir le fichier" ,
btn _all _text : "Tout"
} ,
"it" : {
toast _plugin _started : "{{var0}} è stato avviato." ,
toast _plugin _stopped : "{{var0}} è stato interrotto." ,
toast _plugin _translated : "tradotto in {{var0}}." ,
file _navigator _text : "Sfoglia file" ,
btn _all _text : "Tutto"
} ,
"nl" : {
toast _plugin _started : "{{var0}} is gestart." ,
toast _plugin _stopped : "{{var0}} is gestopt." ,
toast _plugin _translated : "vertaald naar {{var0}}." ,
file _navigator _text : "Bestand zoeken" ,
btn _all _text : "Alle"
} ,
"no" : {
toast _plugin _started : "{{var0}} er startet." ,
toast _plugin _stopped : "{{var0}} er stoppet." ,
toast _plugin _translated : "oversatt til {{var0}}." ,
file _navigator _text : "Bla gjennom fil" ,
btn _all _text : "Alle"
} ,
"pl" : {
toast _plugin _started : "{{var0}} został uruchomiony." ,
toast _plugin _stopped : "{{var0}} został zatrzymany." ,
toast _plugin _translated : "przetłumaczono na {{var0}}." ,
file _navigator _text : "Przeglądać plik" ,
btn _all _text : "Wszystkie"
} ,
"pt-BR" : {
toast _plugin _started : "{{var0}} foi iniciado." ,
toast _plugin _stopped : "{{var0}} foi interrompido." ,
toast _plugin _translated : "traduzido para {{var0}}." ,
file _navigator _text : "Procurar arquivo" ,
btn _all _text : "Todo"
} ,
"fi" : {
toast _plugin _started : "{{var0}} on käynnistetty." ,
toast _plugin _stopped : "{{var0}} on pysäytetty." ,
toast _plugin _translated : "käännetty osoitteeseen {{var0}}." ,
file _navigator _text : "Selaa tiedostoa" ,
btn _all _text : "Kaikki"
} ,
"sv" : {
toast _plugin _started : "{{var0}} har startats." ,
toast _plugin _stopped : "{{var0}} har blivit stoppad." ,
toast _plugin _translated : "översatt till {{var0}}." ,
file _navigator _text : "Bläddra i fil" ,
btn _all _text : "All"
} ,
"tr" : {
toast _plugin _started : "{{var0}} başlatı ldı ." ,
toast _plugin _stopped : "{{var0}} durduruldu." ,
toast _plugin _translated : "{{var0}} olarak çevrildi." ,
file _navigator _text : "Dosyaya gözat" ,
btn _all _text : "Her"
} ,
"cs" : {
toast _plugin _started : "{{var0}} byl spuštěn." ,
toast _plugin _stopped : "{{var0}} byl zastaven." ,
toast _plugin _translated : "přeložen do {{var0}}." ,
file _navigator _text : "Procházet soubor" ,
btn _all _text : "Vše"
} ,
"bg" : {
toast _plugin _started : "{{var0}} е стартиран." ,
toast _plugin _stopped : "{{var0}} е спрян." ,
toast _plugin _translated : "преведена на {{var0}}." ,
file _navigator _text : "Прегледайте файла" ,
btn _all _text : "Bс ичко "
} ,
"ru" : {
toast _plugin _started : "{{var0}} запущен." ,
toast _plugin _stopped : "{{var0}} остановлен." ,
toast _plugin _translated : "переведен на {{var0}}." ,
file _navigator _text : "Просмотр файла" ,
btn _all _text : "В с е "
} ,
"uk" : {
toast _plugin _started : "{{var0}} було запущено." ,
toast _plugin _stopped : "{{var0}} було зупинено." ,
toast _plugin _translated : "перекладено {{var0}}." ,
file _navigator _text : "Перегляньте файл" ,
btn _all _text : "В с е "
} ,
"ja" : {
toast _plugin _started : "{{var0}}が開始されました." ,
toast _plugin _stopped : "{{var0}}が停止しました." ,
toast _plugin _translated : "は{{var0}}に翻訳されました." ,
file _navigator _text : "ファイルを参照" ,
btn _all _text : "すべて"
} ,
"zh-TW" : {
toast _plugin _started : "{{var0}}已經啟動." ,
toast _plugin _stopped : "{{var0}}已停止." ,
toast _plugin _translated : "翻譯為{{var0}}." ,
file _navigator _text : "瀏覽文件" ,
btn _all _text : "所有"
} ,
"ko" : {
toast _plugin _started : "{{var0}} 시작되었습니다." ,
toast _plugin _stopped : "{{var0}} 중지되었습니다." ,
toast _plugin _translated : "{{var0}} 로 번역되었습니다." ,
file _navigator _text : "파일 찾아보기" ,
btn _all _text : "모든"
} ,
"default" : {
toast _plugin _started : "{{var0}} has been started." ,
toast _plugin _stopped : "{{var0}} has been stopped." ,
toast _plugin _translated : "translated to {{var0}}." ,
file _navigator _text : "Browse File" ,
btn _all _text : "All"
}
2019-11-06 14:41:45 +01:00
} ;
BDFDB . LanguageUtils . getLanguage = function ( ) {
2019-12-09 13:20:52 +01:00
var lang = document . querySelector ( "html" ) . lang || "en" ;
if ( lang == "en-GB" || lang == "en-US" ) lang = "en" ;
2019-11-06 14:41:45 +01:00
var langids = lang . split ( "-" ) ;
var langid = langids [ 0 ] ;
var langid2 = langids [ 1 ] || "" ;
lang = langid2 && langid . toUpperCase ( ) !== langid2 . toUpperCase ( ) ? langid + "-" + langid2 : langid ;
2019-12-09 13:20:52 +01:00
return BDFDB . LanguageUtils . languages [ lang ] || BDFDB . LanguageUtils . languages [ langid ] || BDFDB . LanguageUtils . languages [ "en" ] ;
2019-11-06 14:41:45 +01:00
} ;
BDFDB . LanguageUtils . LanguageStrings = new Proxy ( LanguageStrings , {
get : function ( list , item ) {
var stringobj = LibraryModules . LanguageStore . Messages [ item ] ;
if ( ! stringobj ) BDFDB . LogUtils . warn ( item + " not found in BDFDB.LanguageUtils.LanguageStrings" ) ;
else {
if ( stringobj && typeof stringobj == "object" && typeof stringobj . format == "function" ) return BDFDB . LanguageUtils . LanguageStringsFormat ( item ) ;
else return stringobj ;
}
return "" ;
}
} ) ;
BDFDB . LanguageUtils . LanguageStringsCheck = new Proxy ( LanguageStrings , {
get : function ( list , item ) {
return ! ! LibraryModules . LanguageStore . Messages [ item ] ;
}
} ) ;
BDFDB . LanguageUtils . LanguageStringsFormat = function ( item , ... values ) {
if ( item ) {
var stringobj = LibraryModules . LanguageStore . Messages [ item ] ;
if ( stringobj && typeof stringobj == "object" && typeof stringobj . format == "function" ) {
let i = 0 , returnvalue , formatvars = { } ;
while ( ! returnvalue && i < 10 ) {
i ++ ;
try { returnvalue = stringobj . format ( formatvars ) ; }
catch ( err ) {
returnvalue = null ;
formatvars [ err . toString ( ) . split ( "for: " ) [ 1 ] ] = values . shift ( ) || "undefined" ;
}
}
if ( returnvalue ) {
if ( BDFDB . ArrayUtils . is ( returnvalue ) ) {
let newstring = "" ;
for ( let ele of returnvalue ) {
if ( typeof ele == "string" ) newstring += BDFDB . StringUtils . htmlEscape ( ele ) ;
else if ( BDFDB . ObjectUtils . is ( ele ) && ele . props ) newstring += ` < ${ ele . type } > ${ BDFDB . StringUtils . htmlEscape ( ele . props . children [ 0 ] . toString ( ) ) } </ ${ ele . type } > `
}
return newstring ;
}
return returnvalue ;
}
else {
BDFDB . LogUtils . warn ( item + " failed to format string in BDFDB.LanguageUtils.LanguageStrings" ) ;
return "" ;
}
}
else return BDFDB . LanguageUtils . LanguageStrings [ item ] ;
}
else BDFDB . LogUtils . warn ( item + " enter a valid key to format the string in BDFDB.LanguageUtils.LanguageStrings" ) ;
return "" ;
} ;
BDFDB . LanguageUtils . LibraryStrings = new Proxy ( InternalBDFDB . LibraryStrings . default , {
get : function ( list , item ) {
let languageid = BDFDB . LanguageUtils . getLanguage ( ) . id ;
if ( InternalBDFDB . LibraryStrings [ languageid ] && InternalBDFDB . LibraryStrings [ languageid ] [ item ] ) return InternalBDFDB . LibraryStrings [ languageid ] [ item ] ;
else if ( InternalBDFDB . LibraryStrings . default [ item ] ) return InternalBDFDB . LibraryStrings . default [ item ] ;
else BDFDB . LogUtils . warn ( item + " not found in BDFDB.LanguageUtils.LibraryStrings" ) ;
return "" ;
}
} ) ;
BDFDB . LanguageUtils . LibraryStringsCheck = new Proxy ( LanguageStrings , {
get : function ( list , item ) {
return ! ! InternalBDFDB . LibraryStrings . default [ item ] ;
}
} ) ;
BDFDB . LanguageUtils . LibraryStringsFormat = function ( item , ... values ) {
if ( item && values . length ) {
let languageid = BDFDB . LanguageUtils . getLanguage ( ) . id , string = null ;
if ( InternalBDFDB . LibraryStrings [ languageid ] && InternalBDFDB . LibraryStrings [ languageid ] [ item ] ) string = InternalBDFDB . LibraryStrings [ languageid ] [ item ] ;
else if ( InternalBDFDB . LibraryStrings . default [ item ] ) string = InternalBDFDB . LibraryStrings . default [ item ] ;
if ( string ) {
for ( let i = 0 ; i < values . length ; i ++ ) if ( typeof values [ i ] == "string" ) string = string . replace ( new RegExp ( ` {{var ${ i } }} ` , "g" ) , values [ i ] ) ;
return string ;
}
else BDFDB . LogUtils . warn ( item + " not found in BDFDB.LanguageUtils.LibraryStrings" ) ;
}
else BDFDB . LogUtils . warn ( item + " enter a valid key and at least one value to format the string in BDFDB.LanguageUtils.LibraryStrings" ) ;
return "" ;
} ;
2019-12-07 11:30:05 +01:00
var initDiscordLanguageInterval = BDFDB . TimeUtils . interval ( _ => {
2019-11-06 14:41:45 +01:00
if ( document . querySelector ( "html" ) . lang ) {
BDFDB . TimeUtils . clear ( initDiscordLanguageInterval ) ;
var language = BDFDB . LanguageUtils . getLanguage ( ) ;
BDFDB . LanguageUtils . languages . $discord . name = ` Discord ( ${ language . name } ) ` ;
BDFDB . LanguageUtils . languages . $discord . id = language . id ;
2019-12-07 16:45:40 +01:00
BDFDB . LanguageUtils . languages . $discord . google = language . google ;
2019-11-06 14:41:45 +01:00
BDFDB . LanguageUtils . languages . $discord . ownlang = language . ownlang ;
}
} , 100 ) ;
2020-02-08 11:14:10 +01:00
var InternalComponents = { NativeSubComponents : { } , LibraryComponents : { } } , reactInitialized = LibraryModules . React && LibraryModules . React . Component ;
InternalComponents . NativeSubComponents . Button = BDFDB . ModuleUtils . findByProperties ( "Colors" , "Hovers" , "Looks" ) ;
InternalComponents . NativeSubComponents . Checkbox = BDFDB . ModuleUtils . findByName ( "Checkbox" ) ;
InternalComponents . NativeSubComponents . ContextMenuItem = BDFDB . ModuleUtils . findByString ( "default.item" , "default.hint" , "danger" , "brand" ) ;
InternalComponents . NativeSubComponents . ContextMenuSliderItem = BDFDB . ModuleUtils . findByName ( "SliderMenuItem" ) ;
InternalComponents . NativeSubComponents . ContextMenuToggleItem = BDFDB . ModuleUtils . findByName ( "ToggleMenuItem" ) ;
InternalComponents . NativeSubComponents . FavButton = BDFDB . ModuleUtils . findByName ( "GIFFavButton" ) ;
InternalComponents . NativeSubComponents . KeybindRecorder = BDFDB . ModuleUtils . findByName ( "KeybindRecorder" ) ;
InternalComponents . NativeSubComponents . PopoutContainer = BDFDB . ModuleUtils . findByName ( "Popout" ) ;
InternalComponents . NativeSubComponents . QuickSelect = BDFDB . ModuleUtils . findByName ( "QuickSelectWrapper" ) ;
InternalComponents . NativeSubComponents . RadioGroup = BDFDB . ModuleUtils . findByName ( "RadioGroup" ) ;
InternalComponents . NativeSubComponents . SearchBar = BDFDB . ModuleUtils . find ( m => m && m . displayName == "SearchBar" && m . defaultProps . placeholder == BDFDB . LanguageUtils . LanguageStrings . SEARCH ) ;
InternalComponents . NativeSubComponents . Select = BDFDB . ModuleUtils . findByName ( "SelectTempWrapper" ) ;
InternalComponents . NativeSubComponents . Slider = BDFDB . ModuleUtils . findByName ( "Slider" ) ;
InternalComponents . NativeSubComponents . SvgIcon = BDFDB . ModuleUtils . findByProperties ( "Gradients" , "Names" ) ;
InternalComponents . NativeSubComponents . Switch = BDFDB . ModuleUtils . findByName ( "Switch" ) ;
InternalComponents . NativeSubComponents . TabBar = BDFDB . ModuleUtils . findByName ( "TabBar" ) ;
InternalComponents . NativeSubComponents . Table = BDFDB . ModuleUtils . findByName ( "Table" ) ;
InternalComponents . NativeSubComponents . TextArea = BDFDB . ModuleUtils . findByName ( "TextArea" ) ;
InternalComponents . NativeSubComponents . TextInput = BDFDB . ModuleUtils . findByName ( "TextInput" ) ;
InternalComponents . NativeSubComponents . TooltipContainer = BDFDB . ModuleUtils . findByName ( "Tooltip" ) ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . Anchor = BDFDB . ModuleUtils . findByName ( "Anchor" ) ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . Animations = Object . assign ( { } , BDFDB . ModuleUtils . findByProperties ( "Controller" , "Spring" ) ) ;
2019-11-26 00:29:19 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . AutocompleteComponents = Object . assign ( { } , BDFDB . ModuleUtils . findByName ( "Autocomplete" ) ) ;
2019-12-19 14:46:58 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . AutocompleteComponents . Menu = BDFDB . ModuleUtils . findByName ( "Autocomplete" ) ;
2019-12-21 01:14:53 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . Avatar = ( BDFDB . ModuleUtils . findByProperties ( "AnimatedAvatar" ) || { } ) . default ;
2019-11-12 19:11:52 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . BadgeComponents = Object . assign ( { } , BDFDB . ModuleUtils . findByProperties ( "IconBadge" , "NumberBadge" ) ) ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . BadgeComponents . AnimationContainer = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.BadgeComponents.AnimationContainer" ) || reactInitialized && class BDFDB _BadgeContainer extends LibraryModules . React . Component {
2019-11-26 00:29:19 +01:00
componentDidMount ( ) { BDFDB . ReactUtils . forceUpdate ( this ) ; }
componentWillAppear ( e ) { if ( typeof e == "function" ) e ( ) ; }
componentWillEnter ( e ) { if ( typeof e == "function" ) e ( ) ; }
componentWillLeave ( e ) { if ( typeof e == "function" ) this . timeoutId = setTimeout ( e , 300 ) ; }
componentWillUnmount ( ) { clearTimeout ( this . timeoutId ) }
render ( ) {
2020-02-08 11:14:10 +01:00
return BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Animations . animated . div , {
2019-11-26 00:29:19 +01:00
className : this . props . className ,
style : this . props . animatedStyle ,
children : this . props . children
} ) ;
}
} ;
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . BotTag = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.BotTag" ) || reactInitialized && class BDFDB _BotTag extends LibraryModules . React . Component {
2019-11-11 08:45:32 +01:00
handleClick ( e ) { if ( typeof this . props . onClick == "function" ) this . props . onClick ( e , this ) ; }
handleContextMenu ( e ) { if ( typeof this . props . onContextMenu == "function" ) this . props . onContextMenu ( e , this ) ; }
2019-11-06 14:41:45 +01:00
render ( ) {
return BDFDB . ReactUtils . createElement ( "span" , {
className : BDFDB . DOMUtils . formatClassName ( this . props . invertColor ? BDFDB . disCN . bottaginvert : BDFDB . disCN . bottagregular , this . props . className ) ,
style : this . props . style ,
2019-11-11 08:45:32 +01:00
onClick : this . handleClick . bind ( this ) ,
onContextMenu : this . handleContextMenu . bind ( this ) ,
2019-11-06 14:41:45 +01:00
children : this . props . tag || BDFDB . LanguageUtils . LanguageStrings . BOT _TAG _BOT
} ) ;
}
2019-11-12 19:44:00 +01:00
} ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . Button = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.Button" ) || reactInitialized && class BDFDB _Button extends LibraryModules . React . Component {
2019-11-07 13:45:41 +01:00
handleClick ( e ) { if ( typeof this . props . onClick == "function" ) this . props . onClick ( e , this ) ; }
handleContextMenu ( e ) { if ( typeof this . props . onContextMenu == "function" ) this . props . onContextMenu ( e , this ) ; }
handleMouseDown ( e ) { if ( typeof this . props . onMouseDown == "function" ) this . props . onMouseDown ( e , this ) ; }
handleMouseUp ( e ) { if ( typeof this . props . onMouseUp == "function" ) this . props . onMouseUp ( e , this ) ; }
handleMouseEnter ( e ) { if ( typeof this . props . onMouseEnter == "function" ) this . props . onMouseEnter ( e , this ) ; }
handleMouseLeave ( e ) { if ( typeof this . props . onMouseLeave == "function" ) this . props . onMouseLeave ( e , this ) ; }
2019-11-06 14:41:45 +01:00
render ( ) {
2019-11-07 13:45:41 +01:00
let processingAndListening = ( this . props . disabled || this . props . submitting ) && ( null != this . props . onMouseEnter || null != this . props . onMouseLeave ) ;
let props = BDFDB . ObjectUtils . exclude ( this . props , "look" , "color" , "hover" , "size" , "fullWidth" , "grow" , "disabled" , "submitting" , "type" , "style" , "wrapperClassName" , "className" , "innerClassName" , "onClick" , "onContextMenu" , "onMouseDown" , "onMouseUp" , "onMouseEnter" , "onMouseLeave" , "children" , "rel" ) ;
let button = BDFDB . ReactUtils . createElement ( "button" , Object . assign ( { } , ! this . props . disabled && ! this . props . submitting && props , {
2020-02-08 11:14:10 +01:00
className : BDFDB . DOMUtils . formatClassName ( this . props . className , BDFDB . disCN . button , this . props . look != null ? this . props . look : InternalComponents . LibraryComponents . Button . Looks . FILLED , this . props . color != null ? this . props . color : InternalComponents . LibraryComponents . Button . Colors . BRAND , this . props . hover , this . props . size != null ? this . props . size : InternalComponents . LibraryComponents . Button . Sizes . MEDIUM , processingAndListening && this . props . wrapperClassName , this . props . fullWidth && BDFDB . disCN . buttonfullwidth , ( this . props . grow === undefined || this . props . grow ) && BDFDB . disCN . buttongrow , this . props . hover && this . props . hover !== InternalComponents . LibraryComponents . Button . Hovers . DEFAULT && BDFDB . disCN . buttonhashover , this . props . submitting && BDFDB . disCN . buttonsubmitting ) ,
2019-11-07 13:45:41 +01:00
onClick : ( this . props . disabled || this . props . submitting ) ? e => { return e . preventDefault ( ) ; } : this . handleClick . bind ( this ) ,
onContextMenu : ( this . props . disabled || this . props . submitting ) ? e => { return e . preventDefault ( ) ; } : this . handleContextMenu . bind ( this ) ,
onMouseUp : ! this . props . disabled && this . handleMouseDown . bind ( this ) ,
onMouseDown : ! this . props . disabled && this . handleMouseUp . bind ( this ) ,
onMouseEnter : this . handleMouseEnter . bind ( this ) ,
onMouseLeave : this . handleMouseLeave . bind ( this ) ,
2019-11-07 18:06:31 +01:00
type : this . props . type === "undefined" ? "button" : this . props . type ,
2019-11-07 13:45:41 +01:00
disabled : this . props . disabled ,
style : this . props . style ,
rel : this . props . rel ,
children : [
2020-02-08 11:14:10 +01:00
this . props . submitting && ! this . props . disabled ? BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Spinner , {
type : InternalComponents . LibraryComponents . Spinner . Type . PULSING _ELLIPSIS ,
2019-11-07 13:45:41 +01:00
className : BDFDB . disCN . buttonspinner ,
itemClassName : BDFDB . disCN . buttonspinneritem
} ) : null ,
BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . buttoncontents , this . props . innerClassName ) ,
children : this . props . children
} )
]
} ) ) ;
return ! processingAndListening ? button : BDFDB . ReactUtils . createElement ( "span" , {
2020-02-08 11:14:10 +01:00
className : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . buttondisabledwrapper , this . props . wrapperClassName , this . props . size != null ? this . props . size : InternalComponents . LibraryComponents . Button . Sizes . MEDIUM , this . props . fullWidth && BDFDB . disCN . buttonfullwidth , ( this . props . grow === undefined || this . props . grow ) && BDFDB . disCN . buttongrow ) ,
2019-11-07 13:45:41 +01:00
children : [
button ,
BDFDB . ReactUtils . createElement ( "span" , {
onMouseEnter : this . handleMouseEnter . bind ( this ) ,
onMouseLeave : this . handleMouseLeave . bind ( this ) ,
className : BDFDB . disCN . buttondisabledoverlay
} )
]
} ) ;
2019-11-06 14:41:45 +01:00
}
2019-11-12 19:44:00 +01:00
} ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . Card = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.Card" ) || reactInitialized && class BDFDB _Card extends LibraryModules . React . Component {
2019-11-06 14:41:45 +01:00
render ( ) {
2020-02-08 11:14:10 +01:00
return BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex , BDFDB . ObjectUtils . exclude ( Object . assign ( { } , this . props , {
2019-11-25 10:45:58 +01:00
className : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . hovercardwrapper , this . props . backdrop && BDFDB . disCN . hovercard , this . props . className ) ,
2019-11-06 14:41:45 +01:00
onMouseEnter : e => { if ( typeof this . props . onMouseEnter == "function" ) this . props . onMouseEnter ( e , this ) ; } ,
onMouseLeave : e => { if ( typeof this . props . onMouseLeave == "function" ) this . props . onMouseLeave ( e , this ) ; } ,
onClick : e => { if ( typeof this . props . onClick == "function" ) this . props . onClick ( e , this ) ; } ,
onContextMenu : e => { if ( typeof this . props . onContextMenu == "function" ) this . props . onContextMenu ( e , this ) ; } ,
children : [
2020-02-08 11:14:10 +01:00
! this . props . noRemove ? BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . CardRemoveButton , {
2019-11-06 14:41:45 +01:00
onClick : e => {
if ( typeof this . props . onRemove == "function" ) this . props . onRemove ( e , this ) ;
BDFDB . ListenerUtils . stopEvent ( e ) ;
}
2020-01-15 21:46:41 +01:00
} ) : null ,
typeof this . props . children == "string" ? BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . TextElement , {
className : BDFDB . disCN . hovercardinner ,
color : BDFDB . LibraryComponents . TextElement . Colors . PRIMARY ,
2020-01-17 22:03:45 +01:00
children : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . TextScroller , { children : this . props . children } )
2020-01-15 21:46:41 +01:00
} ) : this . props . children
] . flat ( 10 ) . filter ( n => n )
2019-11-25 10:45:58 +01:00
} ) , "backdrop" , "noRemove" ) ) ;
2019-11-06 14:41:45 +01:00
}
2019-11-12 19:44:00 +01:00
} ;
2020-02-08 11:14:10 +01:00
InternalBDFDB . setDefaultProps ( InternalComponents . LibraryComponents . Card , { backdrop : true , noRemove : false } ) ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . CardRemoveButton = BDFDB . ModuleUtils . findByName ( "RemoveButton" ) ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . ChannelTextAreaButton = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.ChannelTextAreaButton" ) || reactInitialized && class BDFDB _ChannelTextAreaButton extends LibraryModules . React . Component {
2019-11-07 13:45:41 +01:00
render ( ) {
2020-02-08 11:14:10 +01:00
return BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Button , {
look : InternalComponents . LibraryComponents . Button . Looks . BLANK ,
size : InternalComponents . LibraryComponents . Button . Sizes . NONE ,
2019-11-07 13:45:41 +01:00
"aria-label" : this . props . label ,
tabIndex : this . props . tabIndex ,
className : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . textareabuttonwrapper , this . props . isActive && BDFDB . disCN . textareabuttonactive ) ,
innerClassName : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . textareabutton , this . props . className , this . props . pulse && BDFDB . disCN . textareaattachbuttonplus ) ,
onClick : this . props . onClick ,
onContextMenu : this . props . onContextMenu ,
onMouseEnter : this . props . onMouseEnter ,
onMouseLeave : this . props . onMouseLeave ,
2020-02-08 11:14:10 +01:00
children : BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . SvgIcon , {
2019-11-07 13:45:41 +01:00
name : this . props . iconName ,
iconSVG : this . props . iconSVG ,
className : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . textareaicon , this . props . iconClassName , this . props . pulse && BDFDB . disCN . textareaiconpulse )
} )
} ) ;
}
2019-11-12 19:44:00 +01:00
} ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . CharCounter = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.CharCounter" ) || reactInitialized && class BDFDB _CharCounter extends LibraryModules . React . Component {
2019-11-06 14:41:45 +01:00
getCounterString ( ) {
2019-11-28 14:11:05 +01:00
let input = this . refElement || { } , string = "" ;
if ( BDFDB . DOMUtils . containsClass ( this . refElement , BDFDB . disCN . textarea ) ) {
2019-12-21 10:06:51 +01:00
let instance = BDFDB . ReactUtils . findOwner ( input , { name : "ChannelEditorContainer" , up : true } ) ;
2019-11-28 14:11:05 +01:00
if ( instance ) string = instance . props . textValue ;
else string = input . value || input . textContent || "" ;
}
else string = input . value || input . textContent || "" ;
2019-12-06 16:22:12 +01:00
let start = input . selectionStart || 0 , end = input . selectionEnd || 0 , selectlength = end - start , selection = BDFDB . DOMUtils . getSelection ( ) ;
2020-01-07 23:20:12 +01:00
let select = ! selectlength && ! selection ? 0 : ( selectlength || selection . length ) ;
select = ! select ? 0 : ( select > string . length ? ( end || start ? string . length - ( string . length - end - start ) : string . length ) : select ) ;
2019-11-10 19:11:53 +01:00
let children = [
2020-01-07 23:20:12 +01:00
typeof this . props . renderPrefix == "function" && this . props . renderPrefix ( string . length ) ,
` ${ string . length } ${ ! this . props . max ? "" : "/" + this . props . max } ${ ! select ? "" : " (" + select + ")" } ` ,
typeof this . props . renderSuffix == "function" && this . props . renderSuffix ( string . length )
2019-11-10 19:01:44 +01:00
] . filter ( n => n ) ;
2020-02-08 11:14:10 +01:00
return children . length == 1 ? children [ 0 ] : BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex , {
align : InternalComponents . LibraryComponents . Flex . Align . CENTER ,
2019-11-10 19:11:53 +01:00
children : children
} ) ;
2019-11-06 14:41:45 +01:00
}
updateCounter ( ) {
if ( ! this . refElement ) return ;
BDFDB . TimeUtils . clear ( this . updateTimeout ) ;
this . updateTimeout = BDFDB . TimeUtils . timeout ( this . forceUpdateCounter . bind ( this ) , 100 ) ;
}
forceUpdateCounter ( ) {
if ( ! this . refElement ) return ;
this . props . children = this . getCounterString ( ) ;
BDFDB . ReactUtils . forceUpdate ( this ) ;
}
handleSelection ( ) {
if ( ! this . refElement ) return ;
2019-11-28 14:11:05 +01:00
let mousemove = _ => {
2019-11-06 14:41:45 +01:00
BDFDB . TimeUtils . timeout ( this . forceUpdateCounter . bind ( this ) , 10 ) ;
} ;
2019-11-28 14:11:05 +01:00
let mouseup = _ => {
2019-11-06 14:41:45 +01:00
document . removeEventListener ( "mousemove" , mousemove ) ;
document . removeEventListener ( "mouseup" , mouseup ) ;
2019-11-28 14:11:05 +01:00
if ( this . refElement . selectionEnd - this . refElement . selectionStart ) BDFDB . TimeUtils . timeout ( _ => {
2019-11-06 14:41:45 +01:00
document . addEventListener ( "click" , click ) ;
} ) ;
} ;
2019-11-28 14:11:05 +01:00
let click = _ => {
2019-11-06 14:41:45 +01:00
var contexttype = BDFDB . ReactUtils . getValue ( document . querySelector ( BDFDB . dotCN . contextmenu ) , "return.stateNode.props.type" ) ;
if ( ! contexttype || ! contexttype . startsWith ( "CHANNEL_TEXT_AREA" ) ) this . forceUpdateCounter ( ) ;
BDFDB . TimeUtils . timeout ( this . forceUpdateCounter . bind ( this ) , 100 ) ;
document . removeEventListener ( "mousemove" , mousemove ) ;
document . removeEventListener ( "mouseup" , mouseup ) ;
document . removeEventListener ( "click" , click ) ;
} ;
document . addEventListener ( "mousemove" , mousemove ) ;
document . addEventListener ( "mouseup" , mouseup ) ;
}
componentDidMount ( ) {
if ( this . props . refClass ) {
let node = BDFDB . ReactUtils . findDOMNode ( this ) ;
2019-12-03 10:04:43 +01:00
if ( node && node . parentElement ) {
2019-11-06 14:41:45 +01:00
this . refElement = node . parentElement . querySelector ( this . props . refClass ) ;
if ( this . refElement ) {
2019-11-28 14:11:05 +01:00
if ( ! this . _updateCounter ) this . _updateCounter = _ => {
2019-11-06 14:41:45 +01:00
if ( ! document . contains ( node ) ) BDFDB . ListenerUtils . multiRemove ( this . refElement , "keydown click change" , this . _updateCounter ) ;
else this . updateCounter ( ) ;
} ;
2019-11-28 14:11:05 +01:00
if ( ! this . _handleSelection ) this . _handleSelection = _ => {
2019-11-06 14:41:45 +01:00
if ( ! document . contains ( node ) ) BDFDB . ListenerUtils . multiRemove ( this . refElement , "mousedown" , this . _handleSelection ) ;
else this . handleSelection ( ) ;
} ;
BDFDB . ListenerUtils . multiRemove ( this . refElement , "mousedown" , this . _handleSelection ) ;
BDFDB . ListenerUtils . multiAdd ( this . refElement , "mousedown" , this . _handleSelection ) ;
2020-01-21 19:21:27 +01:00
if ( this . refElement . tagName == "INPUT" || this . refElement . tagName == "TEXTAREA" ) {
2019-11-28 14:11:05 +01:00
BDFDB . ListenerUtils . multiRemove ( this . refElement , "keydown click change" , this . _updateCounter ) ;
BDFDB . ListenerUtils . multiAdd ( this . refElement , "keydown click change" , this . _updateCounter ) ;
}
else {
if ( ! this . _mutationObserver ) this . _mutationObserver = new MutationObserver ( changes => {
if ( ! document . contains ( node ) ) this . _mutationObserver . disconnect ( ) ;
else this . updateCounter ( ) ;
} ) ;
else this . _mutationObserver . disconnect ( ) ;
this . _mutationObserver . observe ( this . refElement , { childList : true , subtree : true } ) ;
}
2019-11-06 14:41:45 +01:00
this . updateCounter ( ) ;
}
else BDFDB . LogUtils . warn ( "could not find referenceElement for BDFDB_CharCounter" ) ;
}
}
else BDFDB . LogUtils . warn ( "refClass can not be undefined for BDFDB_CharCounter" ) ;
}
2020-01-21 19:21:27 +01:00
render ( ) {
let string = this . getCounterString ( ) ;
BDFDB . TimeUtils . timeout ( _ => { if ( string != this . getCounterString ( ) ) BDFDB . ReactUtils . forceUpdate ( this ) ; } ) ;
2019-11-10 19:01:44 +01:00
return BDFDB . ReactUtils . createElement ( "div" , BDFDB . ObjectUtils . exclude ( Object . assign ( { } , this . props , {
2019-11-06 14:41:45 +01:00
className : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . charcounter , this . props . className ) ,
2020-01-21 19:21:27 +01:00
children : string
2019-11-10 19:01:44 +01:00
} ) , "parsing" , "max" , "refClass" , "renderPrefix" , "renderSuffix" ) ) ;
2019-11-06 14:41:45 +01:00
}
2019-11-12 19:44:00 +01:00
} ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . Checkbox = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.Checkbox" ) || reactInitialized && class BDFDB _Checkbox extends LibraryModules . React . Component {
2019-12-18 19:32:01 +01:00
handleChange ( ) {
this . props . value = ! this . props . value ;
if ( typeof this . props . onChange == "function" ) this . props . onChange ( this . props . value , this ) ;
BDFDB . ReactUtils . forceUpdate ( this ) ;
}
render ( ) {
2020-02-08 11:14:10 +01:00
return BDFDB . ReactUtils . createElement ( InternalComponents . NativeSubComponents . Checkbox , Object . assign ( { } , this . props , { onChange : this . handleChange . bind ( this ) } ) ) ;
2019-12-18 19:32:01 +01:00
}
} ;
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . Clickable = BDFDB . ModuleUtils . findByName ( "Clickable" ) ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . CollapseContainer = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.CollapseContainer" ) || reactInitialized && class BDFDB _CollapseContainer extends LibraryModules . React . Component {
2019-11-06 14:41:45 +01:00
render ( ) {
2019-12-18 16:39:37 +01:00
if ( ! BDFDB . ObjectUtils . is ( this . props . collapseStates ) ) this . props . collapseStates = { } ;
this . props . collapsed = this . props . collapsed && ( this . props . collapseStates [ this . props . title ] || this . props . collapseStates [ this . props . title ] == undefined ) ;
this . props . collapseStates [ this . props . title ] = this . props . collapsed ;
2019-11-06 14:41:45 +01:00
return BDFDB . ReactUtils . createElement ( "div" , {
2019-12-18 16:15:33 +01:00
className : BDFDB . DOMUtils . formatClassName ( this . props . collapsed && BDFDB . disCN . collapsecontainercollapsed , this . props . mini ? BDFDB . disCN . collapsecontainermini : BDFDB . disCN . collapsecontainer , this . props . className ) ,
2019-11-06 14:41:45 +01:00
id : this . props . id ,
children : [
2020-02-08 11:14:10 +01:00
this . props . dividertop ? BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . FormComponents . FormDivider , {
2019-11-06 14:41:45 +01:00
className : this . props . mini ? BDFDB . disCN . marginbottom8 : BDFDB . disCN . marginbottom20
} ) : null ,
2020-02-08 11:14:10 +01:00
BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex , {
2019-11-06 14:41:45 +01:00
className : BDFDB . disCNS . collapsecontainerheader + BDFDB . disCN . cursorpointer ,
2020-02-08 11:14:10 +01:00
align : InternalComponents . LibraryComponents . Flex . Align . CENTER ,
2019-11-06 14:41:45 +01:00
onClick : e => {
this . props . collapsed = ! this . props . collapsed ;
2019-12-18 16:39:37 +01:00
this . props . collapseStates [ this . props . title ] = this . props . collapsed ;
2019-11-06 14:41:45 +01:00
if ( typeof this . props . onClick == "function" ) this . props . onClick ( this . props . collapsed , this ) ;
2019-12-18 12:47:20 +01:00
BDFDB . ReactUtils . forceUpdate ( this ) ;
2019-11-06 14:41:45 +01:00
} ,
children : [
BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . collapsecontainerarrow
} ) ,
2020-02-08 11:14:10 +01:00
BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . FormComponents . FormTitle , {
tag : InternalComponents . LibraryComponents . FormComponents . FormTitle . Tags . H2 ,
2019-11-06 14:41:45 +01:00
className : BDFDB . disCNS . collapsecontainertitle + BDFDB . disCN . cursorpointer ,
children : this . props . title
} )
]
} ) ,
! this . props . collapsed ? BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . collapsecontainerinner ,
children : this . props . children
} ) : null ,
2020-02-08 11:14:10 +01:00
this . props . dividerbottom ? BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . FormComponents . FormDivider , {
2019-11-06 14:41:45 +01:00
className : this . props . mini ? BDFDB . disCN . margintop8 : BDFDB . disCN . margintop20
} ) : null
]
} ) ;
}
2019-11-12 19:44:00 +01:00
} ;
2020-02-08 11:14:10 +01:00
InternalBDFDB . setDefaultProps ( InternalComponents . LibraryComponents . CollapseContainer , { collapsed : true , mini : true } ) ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . ColorSwatches = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.ColorSwatches" ) || reactInitialized && class BDFDB _ColorSwatches extends LibraryModules . React . Component {
2019-11-06 14:41:45 +01:00
constructor ( props ) {
super ( props ) ;
props . selectedColor = BDFDB . ObjectUtils . is ( props . color ) ? props . color : BDFDB . ColorUtils . convert ( props . color , "RGBA" ) ;
props . colors = ( BDFDB . ArrayUtils . is ( props . colors ) ? props . colors : [ null , 5433630 , 3066993 , 1752220 , 3447003 , 3429595 , 8789737 , 10181046 , 15277667 , 15286558 , 15158332 , 15105570 , 15844367 , 13094093 , 7372936 , 6513507 , 16777215 , 3910932 , 2067276 , 1146986 , 2123412 , 2111892 , 7148717 , 7419530 , 11342935 , 11345940 , 10038562 , 11027200 , 12745742 , 9936031 , 6121581 , 2894892 ] ) . map ( c => BDFDB . ColorUtils . convert ( c , "RGBA" ) ) ;
props . colorRows = props . colors . length ? [ props . colors . slice ( 0 , parseInt ( props . colors . length / 2 ) ) , props . colors . slice ( parseInt ( props . colors . length / 2 ) ) ] : [ ] ;
props . customColor = props . selectedColor != null ? ( props . colors . indexOf ( props . selectedColor ) > - 1 ? null : props . selectedColor ) : null ;
props . customSelected = ! ! props . customColor ;
2019-11-10 23:44:01 +01:00
props . pickerConfig = BDFDB . ObjectUtils . is ( props . pickerConfig ) ? props . pickerConfig : { gradient : true , alpha : true , callback : _ => { } } ;
2019-11-06 14:41:45 +01:00
this . state = props ;
var swatches = this ;
this . ColorSwatch = class ColorSwatch extends LibraryModules . React . Component {
render ( ) {
let usewhite = ! BDFDB . ColorUtils . isBright ( this . props . color ) ;
2019-11-10 23:44:01 +01:00
let swatch = BDFDB . ReactUtils . createElement ( "button" , {
2019-11-06 14:41:45 +01:00
type : "button" ,
2019-11-10 23:44:01 +01:00
className : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . colorpickerswatch , this . props . isSingle && BDFDB . disCN . colorpickerswatchsingle , this . props . isDisabled && BDFDB . disCN . colorpickerswatchdisabled , this . props . isSelected && BDFDB . disCN . colorpickerswatchselected , this . props . isCustom && BDFDB . disCN . colorpickerswatchcustom , this . props . color == null && BDFDB . disCN . colorpickerswatchnocolor ) ,
number : this . props . number ,
2019-11-06 14:41:45 +01:00
disabled : this . props . isDisabled ,
onClick : _ => {
if ( ! this . props . isSelected ) {
let color = this . props . isCustom && this . props . color == null ? "rgba(0,0,0,1)" : this . props . color ;
swatches . setState ( {
selectedColor : color ,
customColor : this . props . isCustom ? color : swatches . state . customColor ,
customSelected : this . props . isCustom
} ) ;
}
if ( this . props . isCustom || this . props . isSingle ) {
let swatch = BDFDB . ReactUtils . findDOMNode ( this ) ;
if ( swatch ) BDFDB . ColorUtils . openPicker ( swatches , swatch , this . props . color , swatches . state . pickerConfig ) ;
} ;
} ,
style : Object . assign ( { } , this . props . style , {
background : BDFDB . ObjectUtils . is ( this . props . color ) ? BDFDB . ColorUtils . createGradient ( this . props . color ) : BDFDB . ColorUtils . convert ( this . props . color , "RGBA" )
} ) ,
children : [
2020-02-08 11:14:10 +01:00
this . props . isCustom || this . props . isSingle ? BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . SvgIcon , {
2019-11-06 14:41:45 +01:00
className : BDFDB . disCN . colorpickerswatchdropper ,
foreground : BDFDB . disCN . colorpickerswatchdropperfg ,
2020-02-08 11:14:10 +01:00
name : InternalComponents . LibraryComponents . SvgIcon . Names . DROPPER ,
2019-11-06 14:41:45 +01:00
width : this . props . isCustom ? 14 : 10 ,
height : this . props . isCustom ? 14 : 10 ,
color : usewhite ? BDFDB . DiscordConstants . Colors . WHITE : BDFDB . DiscordConstants . Colors . BLACK
} ) : null ,
2020-02-08 11:14:10 +01:00
this . props . isSelected && ! this . props . isSingle ? BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . SvgIcon , {
name : InternalComponents . LibraryComponents . SvgIcon . Names . CHECKMARK ,
2019-11-06 14:41:45 +01:00
width : this . props . isCustom ? 32 : 16 ,
height : this . props . isCustom ? 24 : 16 ,
color : usewhite ? BDFDB . DiscordConstants . Colors . WHITE : BDFDB . DiscordConstants . Colors . BLACK
} ) : null
]
} ) ;
2020-02-08 11:14:10 +01:00
return this . props . isCustom || this . props . isSingle || this . props . color == null ? BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . TooltipContainer , {
2019-11-10 23:44:01 +01:00
text : this . props . isCustom || this . props . isSingle ? BDFDB . LanguageUtils . LanguageStrings . CUSTOM _COLOR : BDFDB . LanguageUtils . LanguageStrings . DEFAULT ,
2019-11-11 13:54:30 +01:00
tooltipConfig : { type : this . props . isSingle ? "top" : "bottom" } ,
2019-11-10 23:44:01 +01:00
children : swatch
} ) : swatch ;
2019-11-06 14:41:45 +01:00
}
}
}
renderRow ( colors ) {
2020-02-08 11:14:10 +01:00
return BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex , {
2019-11-06 14:41:45 +01:00
className : BDFDB . disCN . colorpickerrow ,
2020-02-08 11:14:10 +01:00
wrap : InternalComponents . LibraryComponents . Flex . Wrap . WRAP ,
2019-11-06 14:41:45 +01:00
children : colors . map ( color => {
return BDFDB . ReactUtils . createElement ( this . ColorSwatch , {
color : color ,
isCustom : false ,
isSelected : ! this . state . customSelected && color === this . state . selectedColor ,
isDisabled : this . state . disabled
} )
} )
} ) ;
}
render ( ) {
2019-11-10 23:44:01 +01:00
let customSwatch = BDFDB . ReactUtils . createElement ( this . ColorSwatch , {
number : ! this . state . colors . length ? ( this . props . number != null ? this . props . number : 0 ) : null ,
color : this . state . customColor ,
isSingle : ! this . state . colors . length ,
isCustom : this . state . colors . length ,
isSelected : this . state . customSelected ,
isDisabled : this . state . disabled ,
style : { margin : 0 }
} ) ;
2020-02-08 11:14:10 +01:00
return ! this . state . colors . length ? customSwatch : BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex , {
2019-11-07 13:45:41 +01:00
className : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . colorpickerswatches , this . state . disabled && BDFDB . disCN . colorpickerswatchesdisabled ) ,
2019-11-06 14:41:45 +01:00
number : this . props . number != null ? this . props . number : 0 ,
children : [
2020-02-08 11:14:10 +01:00
BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex . Child , {
2019-11-06 14:41:45 +01:00
className : BDFDB . disCN . marginreset ,
shrink : 0 ,
grow : 0 ,
2019-11-10 23:44:01 +01:00
children : customSwatch
2019-11-06 14:41:45 +01:00
} ) ,
2020-02-08 11:14:10 +01:00
BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex , {
direction : InternalComponents . LibraryComponents . Flex . Direction . VERTICAL ,
2019-11-06 14:41:45 +01:00
className : BDFDB . disCN . flexmarginreset ,
grow : 1 ,
children : [
this . renderRow ( this . state . colorRows [ 0 ] ) ,
this . renderRow ( this . state . colorRows [ 1 ] )
]
2019-11-18 15:25:50 +01:00
} )
2019-11-06 14:41:45 +01:00
]
2019-11-18 15:25:50 +01:00
} ) ;
2019-11-06 14:41:45 +01:00
}
2019-11-12 19:44:00 +01:00
} ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . Connectors = Object . assign ( { } , BDFDB . ModuleUtils . findByProperties ( "Router" , "Link" ) ) ;
2019-12-01 16:57:25 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . ContextMenuItems = { } ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:24:50 +01:00
InternalComponents . LibraryComponents . ContextMenuItems . Group = BDFDB . ModuleUtils . findByString ( ` "div",{className ` , ` default.itemGroup} ` ) ;
InternalComponents . LibraryComponents . ContextMenuItems . Hint = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.ContextMenuItems.Hint" ) || reactInitialized && class BDFDB _ContextMenuItemHint extends LibraryModules . React . Component {
render ( ) {
let hintIsString = typeof this . props . hint == "string" ;
return BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . contextmenuhint ,
style : hintIsString ? {
width : 42 ,
maxWidth : 42 ,
marginLeft : 8
} : { } ,
children : hintIsString ? BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . TextScroller , {
speed : 2 ,
children : this . props . hint
} ) : ( this . props . hint || null )
} ) ;
}
} ;
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . ContextMenuItems . Item = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.ContextMenuItems.Item" ) || reactInitialized && class BDFDB _ContextMenuItem extends LibraryModules . React . Component {
2019-11-06 14:41:45 +01:00
render ( ) {
2020-01-30 16:26:17 +01:00
let hintIsString = typeof this . props . hint == "string" ;
2020-02-08 11:14:10 +01:00
return BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Clickable , {
2019-11-07 13:45:41 +01:00
className : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . contextmenuitem , ! this . props . disabled && BDFDB . disCN . contextmenuitemclickable , this . props . danger && BDFDB . disCN . contextmenuitemdanger , this . props . disabled && BDFDB . disCN . contextmenuitemdisabled , this . props . brand && BDFDB . disCN . contextmenuitembrand , this . props . className ) ,
2019-11-06 14:41:45 +01:00
style : this . props . style ,
role : "menuitem" ,
onClick : this . props . disabled || typeof this . props . action != "function" ? null : this . props . action ,
children : [
BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . contextmenulabel ,
children : this . props . label
} ) ,
2020-02-08 11:24:50 +01:00
BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . ContextMenuItems . Hint , { hint : this . props . hint } ) ,
2019-11-06 14:41:45 +01:00
this . props . children
]
} ) ;
}
2019-11-12 19:44:00 +01:00
} ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . ContextMenuItems . Slider = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.ContextMenuItems.Slider" ) || reactInitialized && class BDFDB _ContextMenuSliderItem extends LibraryModules . React . Component {
2019-11-14 20:31:01 +01:00
handleValueChange ( value ) {
let newvalue = BDFDB . ArrayUtils . is ( this . props . edges ) && this . props . edges . length == 2 ? BDFDB . NumberUtils . mapRange ( [ 0 , 100 ] , this . props . edges , value ) : value ;
if ( typeof this . props . digits == "number" ) newvalue = Math . round ( newvalue * Math . pow ( 10 , this . props . digits ) ) / Math . pow ( 10 , this . props . digits ) ;
this . props . defaultValue = newvalue ;
if ( typeof this . props . onValueChange == "function" ) this . props . onValueChange ( newvalue , this ) ;
2019-12-18 12:47:20 +01:00
BDFDB . ReactUtils . forceUpdate ( this ) ;
2019-11-14 20:31:01 +01:00
}
handleValueRender ( value ) {
let newvalue = BDFDB . ArrayUtils . is ( this . props . edges ) && this . props . edges . length == 2 ? BDFDB . NumberUtils . mapRange ( [ 0 , 100 ] , this . props . edges , value ) : value ;
if ( typeof this . props . digits == "number" ) newvalue = Math . round ( newvalue * Math . pow ( 10 , this . props . digits ) ) / Math . pow ( 10 , this . props . digits ) ;
if ( typeof this . props . renderLabel == "function" ) this . props . label = this . props . renderLabel ( newvalue ) ;
if ( typeof this . props . onValueRender == "function" ) {
let tempreturn = this . props . onValueRender ( newvalue , this ) ;
if ( tempreturn != undefined ) newvalue = tempreturn ;
}
return newvalue ;
}
render ( ) {
let defaultValue = BDFDB . ArrayUtils . is ( this . props . edges ) && this . props . edges . length == 2 ? BDFDB . NumberUtils . mapRange ( this . props . edges , [ 0 , 100 ] , this . props . defaultValue ) : this . props . defaultValue ;
if ( typeof this . props . digits == "number" ) defaultValue = Math . round ( defaultValue * Math . pow ( 10 , this . props . digits ) ) / Math . pow ( 10 , this . props . digits ) ;
2020-02-08 11:14:10 +01:00
return BDFDB . ReactUtils . createElement ( InternalComponents . NativeSubComponents . ContextMenuSliderItem , BDFDB . ObjectUtils . exclude ( Object . assign ( { } , this . props , {
2019-11-14 20:31:01 +01:00
defaultValue : defaultValue ,
label : typeof this . props . renderLabel == "function" ? this . props . renderLabel ( this . props . defaultValue ) : this . props . label ,
onValueChange : this . handleValueChange . bind ( this ) ,
onValueRender : this . handleValueRender . bind ( this )
} ) , "digits" , "edges" , "renderLabel" ) ) ;
}
} ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . ContextMenuItems . Sub = BDFDB . ModuleUtils . findByName ( "FluxContainer(SubMenuItem)" ) ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . ContextMenuItems . Toggle = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.ContextMenuItems.Toggle" ) || reactInitialized && class BDFDB _ContextMenuToggleItem extends LibraryModules . React . Component {
2019-11-06 14:41:45 +01:00
handleToggle ( ) {
this . props . active = ! this . props . active ;
2019-11-14 20:31:01 +01:00
if ( typeof this . props . action == "function" ) this . props . action ( this . props . active ) ;
2019-12-18 12:47:20 +01:00
BDFDB . ReactUtils . forceUpdate ( this ) ;
2019-11-06 14:41:45 +01:00
}
render ( ) {
2020-02-08 11:14:10 +01:00
return BDFDB . ReactUtils . createElement ( InternalComponents . NativeSubComponents . ContextMenuToggleItem , Object . assign ( { } , this . props , { action : this . handleToggle . bind ( this ) } ) ) ;
2019-11-06 14:41:45 +01:00
}
2019-11-12 19:44:00 +01:00
} ;
2019-11-06 14:41:45 +01:00
2020-01-30 15:46:30 +01:00
var ComponentTypeData = { } ;
2020-02-08 09:40:39 +01:00
ComponentTypeData . NormalContextMenus = [ "DeveloperContextMenu" , "GuildRoleContextMenu" , "NativeContextMenu" , "ScreenshareContextMenu" , "UserSettingsCogContextMenu" ] ;
2020-01-30 15:46:30 +01:00
ComponentTypeData . FluxContextMenus = [ "ApplicationContextMenu" , "GroupDMContextMenu" ] ;
2020-02-08 09:40:39 +01:00
ComponentTypeData . NonRenderContextMenus = [ "ChannelContextMenu" , "GuildContextMenu" , "MessageContextMenu" , "SlateContextMenu" , "UserContextMenu" ] ;
2020-01-30 15:46:30 +01:00
ComponentTypeData . ObservedContextMenus = [ ] ;
ComponentTypeData . ExtraPatchedComponents = [ "MessageOptionContextMenu" , "MessageOptionToolbar" ] ;
ComponentTypeData . QueuedComponents = [ ] . concat ( ComponentTypeData . NonRenderContextMenus , ComponentTypeData . ObservedContextMenus , ComponentTypeData . ExtraPatchedComponents ) ;
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . ContextMenus = { } ;
InternalComponents . LibraryComponents . ContextMenus . _Exports = { } ;
2019-12-05 11:08:22 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . ContextMenus . _Types = Object . entries ( BDFDB . DiscordConstants . ContextMenuTypes ) . map ( n => n [ 1 ] ) ;
2019-12-05 11:08:22 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . ContextMenus . ApplicationContextMenu = BDFDB . ModuleUtils . findByName ( "FluxContainer(ApplicationContextMenu)" ) ;
2019-12-05 11:08:22 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . ContextMenus . ChannelContextMenu = BDFDB . ModuleUtils . findByString ( "Error - no such ctx menu type" , BDFDB . DiscordConstants . ContextMenuTypes . CHANNEL _LIST _TEXT ) ;
InternalComponents . LibraryComponents . ContextMenus . _Exports . ChannelContextMenu = ( BDFDB . ModuleUtils . findByString ( "Error - no such ctx menu type" , BDFDB . DiscordConstants . ContextMenuTypes . CHANNEL _LIST _TEXT , false ) || { } ) . exports ;
2019-12-05 11:08:22 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . ContextMenus . DeveloperContextMenu = BDFDB . ModuleUtils . findByName ( "DeveloperContextMenu" ) ;
2019-12-05 11:08:22 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . ContextMenus . GroupDMContextMenu = BDFDB . ModuleUtils . findByName ( "FluxContainer(GroupDMContextMenu)" ) ;
2019-12-05 11:08:22 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . ContextMenus . GuildContextMenu = BDFDB . ModuleUtils . findByString ( "Error - no such ctx menu type" , BDFDB . DiscordConstants . ContextMenuTypes . GUILD _CHANNEL _LIST ) ;
InternalComponents . LibraryComponents . ContextMenus . _Exports . GuildContextMenu = ( BDFDB . ModuleUtils . findByString ( "Error - no such ctx menu type" , BDFDB . DiscordConstants . ContextMenuTypes . GUILD _CHANNEL _LIST , false ) || { } ) . exports ;
2019-12-05 11:08:22 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . ContextMenus . GuildRoleContextMenu = BDFDB . ModuleUtils . findByName ( "GuildRoleContextMenu" ) ;
2019-12-05 11:08:22 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . ContextMenus . MessageContextMenu = BDFDB . ModuleUtils . findByString ( "message" , "target" , BDFDB . DiscordConstants . ContextMenuTypes . MESSAGE _MAIN ) ;
InternalComponents . LibraryComponents . ContextMenus . _Exports . MessageContextMenu = ( BDFDB . ModuleUtils . findByString ( "message" , "target" , BDFDB . DiscordConstants . ContextMenuTypes . MESSAGE _MAIN , false ) || { } ) . exports ;
2019-12-05 11:08:22 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . ContextMenus . NativeContextMenu = BDFDB . ModuleUtils . findByName ( "NativeContextMenu" ) ;
2019-12-05 11:08:22 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . ContextMenus . ScreenshareContextMenu = BDFDB . ModuleUtils . findByName ( "ScreenshareContextMenu" ) ;
2019-12-05 11:08:22 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . ContextMenus . SlateContextMenu = BDFDB . ModuleUtils . findByName ( "SlateContextMenu" ) ;
InternalComponents . LibraryComponents . ContextMenus . _Exports . SlateContextMenu = BDFDB . ModuleUtils . findByName ( "SlateContextMenu" , false ) ;
2020-01-14 00:06:07 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . ContextMenus . UserContextMenu = BDFDB . ModuleUtils . findByString ( "Error - no such ctx menu type" , BDFDB . DiscordConstants . ContextMenuTypes . USER _CHANNEL _MEMBERS ) ;
InternalComponents . LibraryComponents . ContextMenus . _Exports . UserContextMenu = ( BDFDB . ModuleUtils . findByString ( "Error - no such ctx menu type" , BDFDB . DiscordConstants . ContextMenuTypes . USER _CHANNEL _MEMBERS , false ) || { } ) . exports ;
2019-12-05 11:08:22 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . ContextMenus . UserSettingsCogContextMenu = BDFDB . ModuleUtils . findByName ( "UserSettingsCogContextMenu" ) ;
2019-12-05 09:10:14 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . DiscordTag = BDFDB . ModuleUtils . findByName ( "DiscordTag" ) ;
2020-01-27 14:02:09 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . FavButton = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.FavButton" ) || reactInitialized && class BDFDB _FavButton extends LibraryModules . React . Component {
2019-11-06 14:41:45 +01:00
handleClick ( ) {
this . props . isFavorite = ! this . props . isFavorite ;
if ( typeof this . props . onClick == "function" ) this . props . onClick ( this . props . isFavorite , this ) ;
2019-12-18 12:47:20 +01:00
BDFDB . ReactUtils . forceUpdate ( this ) ;
2019-11-06 14:41:45 +01:00
}
render ( ) {
return BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . favbuttoncontainer ,
2020-02-08 11:14:10 +01:00
children : BDFDB . ReactUtils . createElement ( InternalComponents . NativeSubComponents . FavButton , Object . assign ( { } , this . props , { onClick : this . handleClick . bind ( this ) } ) )
2019-11-06 14:41:45 +01:00
} ) ;
}
2019-11-12 19:44:00 +01:00
} ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . FileButton = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.FileButton" ) || reactInitialized && class BDFDB _FileButton extends LibraryModules . React . Component {
2019-11-10 23:44:01 +01:00
render ( ) {
2020-01-18 16:32:03 +01:00
let filter = this . props . filter && [ this . props . filter ] . flat ( 10 ) . filter ( n => typeof n == "string" ) || [ ] ;
2020-02-08 11:14:10 +01:00
return BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Button , BDFDB . ObjectUtils . exclude ( Object . assign ( { } , this . props , {
2019-11-10 23:44:01 +01:00
onClick : e => { e . currentTarget . querySelector ( "input" ) . click ( ) ; } ,
children : [
BDFDB . LanguageUtils . LibraryStrings . file _navigator _text ,
BDFDB . ReactUtils . createElement ( "input" , {
type : "file" ,
2020-01-18 16:32:03 +01:00
accept : filter . length && ( filter . join ( "/*," ) + "/*" ) ,
2019-11-10 23:44:01 +01:00
style : { display : "none" } ,
onChange : e => {
let file = e . currentTarget . files [ 0 ] ;
2020-01-16 17:33:59 +01:00
if ( this . refInput && file && ( ! filter . length || filter . some ( n => file . type . indexOf ( n ) == 0 ) ) ) {
2019-12-18 14:42:01 +01:00
this . refInput . props . value = ` ${ this . props . mode == "url" ? "url('" : "" } ${ this . props . useFilepath ? file . path : ` data: ${ file . type } ;base64, ${ BDFDB . LibraryRequires . fs . readFileSync ( file . path ) . toString ( "base64" ) } ` } ${ this . props . mode ? "')" : "" } ` ;
2019-11-10 23:44:01 +01:00
BDFDB . ReactUtils . forceUpdate ( this . refInput ) ;
2019-11-25 12:20:51 +01:00
this . refInput . handleChange ( this . refInput . props . value ) ;
2019-11-10 23:44:01 +01:00
}
}
} )
]
2020-01-18 16:32:03 +01:00
} ) , "filter" , "mode" , "useFilepath" ) ) ;
2019-11-10 23:44:01 +01:00
}
2019-11-12 19:44:00 +01:00
} ;
2019-11-10 23:44:01 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . Flex = BDFDB . ModuleUtils . findByProperties ( "Wrap" , "Direction" , "Child" ) ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . FormComponents = Object . assign ( { } , BDFDB . ModuleUtils . findByProperties ( "FormSection" , "FormText" ) ) ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . FormComponents . FormItem = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.FormComponents.FormItem" ) || reactInitialized && class BDFDB _FormItem extends LibraryModules . React . Component {
2019-11-06 14:41:45 +01:00
render ( ) {
return BDFDB . ReactUtils . createElement ( "div" , {
className : this . props . className ,
style : this . props . style ,
children : [
2020-02-08 11:14:10 +01:00
BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex , {
align : InternalComponents . LibraryComponents . Flex . Align . BASELINE ,
2019-11-06 14:41:45 +01:00
children : [
2020-02-08 11:14:10 +01:00
this . props . title != null || this . props . error != null ? BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex . Child , {
2019-11-06 14:41:45 +01:00
wrap : true ,
2020-02-08 11:14:10 +01:00
children : BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . FormComponents . FormTitle , {
tag : this . props . tag || InternalComponents . LibraryComponents . FormComponents . FormTitle . Tags . H5 ,
2019-11-06 14:41:45 +01:00
disabled : this . props . disabled ,
required : this . props . required ,
error : this . props . error ,
className : this . props . titleClassName ,
children : this . props . title
} )
2019-11-14 17:40:04 +01:00
} ) : null
2019-11-22 14:26:12 +01:00
] . concat ( [ this . props . titlechildren ] . flat ( 10 ) ) . filter ( n => n )
2019-11-06 14:41:45 +01:00
} ) ,
] . concat ( this . props . children )
} ) ;
}
2019-11-12 19:44:00 +01:00
} ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . GuildComponents = Object . assign ( { } , BDFDB . ModuleUtils . findByProperties ( "Separator" , "DragPlaceholder" ) ) ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . GuildComponents . Badge = BDFDB . ModuleUtils . findByName ( "GuildBadge" ) ;
2019-11-24 11:13:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . GuildComponents . BlobMask = BDFDB . ModuleUtils . findByName ( "BlobMask" ) ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . GuildComponents . Guild = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.GuildComponents.Guild" ) || reactInitialized && class BDFDB _Guild extends LibraryModules . React . Component {
2019-11-06 14:41:45 +01:00
constructor ( props ) {
super ( props ) ;
this . state = { hovered : false } ;
}
handleMouseEnter ( e ) {
if ( ! this . props . sorting ) this . setState ( { hovered : true } ) ;
if ( typeof this . props . onMouseEnter == "function" ) this . props . onMouseEnter ( e , this ) ;
}
handleMouseLeave ( e ) {
if ( ! this . props . sorting ) this . setState ( { hovered : false } ) ;
if ( typeof this . props . onMouseLeave == "function" ) this . props . onMouseLeave ( e , this ) ;
}
handleMouseDown ( e ) {
if ( ! this . props . unavailable && this . props . guild && this . props . selectedChannelId ) LibraryModules . DirectMessageUtils . preload ( this . props . guild . id , this . props . selectedChannelId ) ;
2019-12-02 13:07:58 +01:00
if ( e . button == 0 && typeof this . props . onMouseDown == "function" ) this . props . onMouseDown ( e , this ) ;
2019-11-25 09:43:26 +01:00
}
handleMouseUp ( e ) {
2019-12-02 13:07:58 +01:00
if ( e . button == 0 && typeof this . props . onMouseUp == "function" ) this . props . onMouseUp ( e , this ) ;
2019-11-25 09:43:26 +01:00
}
handleClick ( e ) {
if ( typeof this . props . onClick == "function" ) this . props . onClick ( e , this ) ;
}
2019-11-06 14:41:45 +01:00
handleContextMenu ( e ) {
2019-12-02 13:23:02 +01:00
if ( this . props . menu ) BDFDB . GuildUtils . openMenu ( this . props . guild , e ) ;
2019-11-06 14:41:45 +01:00
if ( typeof this . props . onContextMenu == "function" ) this . props . onContextMenu ( e , this ) ;
}
setRef ( e ) {
if ( typeof this . props . setRef == "function" ) this . props . setRef ( this . props . guild . id , e )
}
2019-11-25 21:06:05 +01:00
componentDidMount ( ) {
2019-11-25 21:15:48 +01:00
let node = BDFDB . ReactUtils . findDOMNode ( this ) ;
if ( node ) for ( let child of node . querySelectorAll ( "a" ) ) child . setAttribute ( "draggable" , false ) ;
2019-11-25 21:06:05 +01:00
}
2019-11-06 14:41:45 +01:00
render ( ) {
2019-11-24 22:16:05 +01:00
if ( ! this . props . guild ) return null ;
2019-12-01 14:20:33 +01:00
this . props . guildId = this . props . guild . id ;
2019-11-06 14:41:45 +01:00
this . props . selectedChannelId = LibraryModules . LastChannelStore . getChannelId ( this . props . guild . id ) ;
this . props . selected = this . props . state ? LibraryModules . LastGuildStore . getGuildId ( ) == this . props . guild . id : false ;
this . props . unread = this . props . state ? LibraryModules . UnreadGuildUtils . hasUnread ( this . props . guild . id ) : false ;
2019-11-21 12:07:37 +01:00
this . props . badge = this . props . state ? LibraryModules . UnreadGuildUtils . getMentionCount ( this . props . guild . id ) : 0 ;
2019-11-06 14:41:45 +01:00
this . props . audio = this . props . state ? ( LibraryModules . ChannelStore . getChannel ( LibraryModules . LastChannelStore . getVoiceChannelId ( ) ) || { } ) . guild _id == this . props . guild . id : false ;
this . props . video = this . props . state ? ( LibraryModules . StreamUtils . getActiveStream ( ) || { } ) . guildId == this . props . guild . id : false ;
2019-12-09 22:59:55 +01:00
this . props . screenshare = this . props . state ? ! ! LibraryModules . StreamUtils . getAllApplicationStreams ( ) . filter ( stream => stream . guildId == this . props . guild . id ) [ 0 ] : false ;
this . props . isCurrentUserInThisGuildVoice = this . props . state ? ! LibraryModules . CurrentVoiceUtils . isDisabled ( ) && LibraryModules . CurrentVoiceUtils . getGuildId ( ) == this . props . guild . id : false ;
2019-12-04 18:20:57 +01:00
this . props . animatable = this . props . state ? LibraryModules . IconUtils . hasAnimatedGuildIcon ( this . props . guild ) : false ;
2019-11-06 14:41:45 +01:00
var isDraggedGuild = this . props . draggingGuildId === this . props . guild . id ;
var Guild = isDraggedGuild ? BDFDB . ReactUtils . createElement ( "div" , {
2020-02-08 11:14:10 +01:00
children : BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . GuildComponents . DragPlaceholder , { } )
2019-11-06 14:41:45 +01:00
} ) : BDFDB . ReactUtils . createElement ( "div" , {
2019-11-22 11:25:45 +01:00
className : BDFDB . disCN . guildcontainer ,
2020-02-08 11:14:10 +01:00
children : BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . GuildComponents . BlobMask , {
2019-11-06 14:41:45 +01:00
selected : this . state . isDropHovering || this . props . selected || this . state . hovered ,
2020-02-08 11:14:10 +01:00
upperBadge : this . props . unavailable ? InternalComponents . LibraryComponents . GuildComponents . renderUnavailableBadge ( ) : InternalComponents . LibraryComponents . GuildComponents . renderIconBadge ( this . props . audio , this . props . video , this . props . screenshare ) ,
lowerBadge : this . props . badge > 0 ? InternalComponents . LibraryComponents . GuildComponents . renderMentionBadge ( this . props . badge ) : null ,
lowerBadgeWidth : InternalComponents . LibraryComponents . BadgeComponents . getBadgeWidthForValue ( this . props . badge ) ,
children : BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . NavItem , {
2019-11-06 14:41:45 +01:00
to : {
pathname : BDFDB . DiscordConstants . Routes . CHANNEL ( this . props . guild . id , this . props . selectedChannelId ) ,
state : {
analyticsSource : {
page : BDFDB . DiscordConstants . AnalyticsPages . GUILD _CHANNEL ,
section : BDFDB . DiscordConstants . AnalyticsSections . CHANNEL _LIST ,
object : BDFDB . DiscordConstants . AnalyticsObjects . CHANNEL
}
}
} ,
name : this . props . guild . name ,
onMouseEnter : this . handleMouseEnter . bind ( this ) ,
onMouseLeave : this . handleMouseLeave . bind ( this ) ,
onMouseDown : this . handleMouseDown . bind ( this ) ,
2019-11-25 09:43:26 +01:00
onMouseUp : this . handleMouseUp . bind ( this ) ,
onClick : this . handleClick . bind ( this ) ,
2019-11-06 14:41:45 +01:00
onContextMenu : this . handleContextMenu . bind ( this ) ,
icon : this . props . guild . getIconURL ( this . state . hovered && this . props . animatable ? "gif" : "jpg" ) ,
selected : this . props . selected || this . state . hovered
} )
} )
} ) ;
if ( this . props . draggable && typeof this . props . connectDragSource == "function" ) Guild = this . props . connectDragSource ( Guild ) ;
var children = [
2020-02-08 11:14:10 +01:00
this . props . list || this . props . pill ? BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . GuildComponents . Pill , {
2019-11-06 14:41:45 +01:00
hovered : ! isDraggedGuild && this . state . hovered ,
selected : ! isDraggedGuild && this . props . selected ,
unread : ! isDraggedGuild && this . props . unread ,
className : BDFDB . disCN . guildpill
} ) : null ,
2020-02-08 11:14:10 +01:00
! this . props . tooltip ? Guild : BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . TooltipContainer , {
2019-11-24 11:13:45 +01:00
tooltipConfig : Object . assign ( { type : "right" } , this . props . tooltipConfig , { guild : this . props . list && this . props . guild } ) ,
2019-11-06 14:41:45 +01:00
children : Guild
} )
2019-11-24 22:48:57 +01:00
] . filter ( n => n ) ;
2020-02-08 11:14:10 +01:00
return this . props . list ? InternalComponents . LibraryComponents . GuildComponents . renderListItem ( BDFDB . ReactUtils . createElement ( BDFDB . ReactUtils . Fragment , {
2019-11-06 14:41:45 +01:00
children : children
} ) , null != this . props . setRef ? this . setRef : null ) : BDFDB . ReactUtils . createElement ( "div" , {
2019-11-22 11:25:45 +01:00
className : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . guild , this . props . className ) ,
2019-11-06 14:41:45 +01:00
children : children
} ) ;
}
2019-11-12 19:44:00 +01:00
} ;
2020-02-08 11:14:10 +01:00
InternalBDFDB . setDefaultProps ( InternalComponents . LibraryComponents . GuildComponents . Guild , { menu : true , tooltip : true , list : false , state : false , draggable : false , sorting : false } ) ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . GuildComponents . Icon = BDFDB . ModuleUtils . findByName ( "GuildIconWrapper" ) ;
2019-11-12 19:04:16 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . GuildComponents . Pill = BDFDB . ModuleUtils . findByString ( "opacity:1,height:" , "20:8" , "default.item" ) ;
2019-11-14 22:03:53 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . HeaderBarComponents = Object . assign ( { } , BDFDB . ModuleUtils . findByName ( "HeaderBarContainer" ) ) ;
2020-01-03 15:10:08 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . KeybindRecorder = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.KeybindRecorder" ) || reactInitialized && class BDFDB _KeybindRecorder extends LibraryModules . React . Component {
2019-11-15 14:11:07 +01:00
handleChange ( arrays ) {
2019-11-15 21:48:30 +01:00
if ( typeof this . props . onChange == "function" ) this . props . onChange ( arrays . map ( platformkey => LibraryModules . KeyEvents . codes [ BDFDB . LibraryModules . KeyCodeUtils . codeToKey ( platformkey ) ] || platformkey [ 1 ] ) , this ) ;
}
handleReset ( ) {
this . props . defaultValue = [ ] ;
let recorder = BDFDB . ReactUtils . findOwner ( this , { name : "KeybindRecorder" } ) ;
if ( recorder ) recorder . setState ( { codes : [ ] } ) ;
if ( typeof this . props . onChange == "function" ) this . props . onChange ( [ ] , this ) ;
if ( typeof this . props . onReset == "function" ) this . props . onReset ( this ) ;
2019-11-15 14:11:07 +01:00
}
render ( ) {
2020-02-08 11:14:10 +01:00
return BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex , {
2019-11-15 21:48:30 +01:00
className : BDFDB . disCN . hotkeywrapper ,
2020-02-08 11:14:10 +01:00
direction : InternalComponents . LibraryComponents . Flex . Direction . HORIZONTAL ,
align : InternalComponents . LibraryComponents . Flex . Align . CENTER ,
2019-11-15 21:48:30 +01:00
children : [
2020-02-08 11:14:10 +01:00
BDFDB . ReactUtils . createElement ( InternalComponents . NativeSubComponents . KeybindRecorder , BDFDB . ObjectUtils . exclude ( Object . assign ( { } , this . props , {
2019-11-22 14:26:12 +01:00
defaultValue : [ this . props . defaultValue ] . flat ( 10 ) . filter ( n => n ) . map ( keycode => [ BDFDB . DiscordConstants . KeyboardDeviceTypes . KEYBOARD _KEY , keycode , BDFDB . DiscordConstants . KeyboardEnvs . BROWSER ] ) ,
2019-11-15 21:48:30 +01:00
onChange : this . handleChange . bind ( this )
} ) , "reset" , "onReset" ) ) ,
2020-02-08 11:14:10 +01:00
this . props . reset || this . props . onReset ? BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . TooltipContainer , {
2019-12-21 11:45:18 +01:00
text : BDFDB . LanguageUtils . LanguageStrings . REMOVE _KEYBIND ,
tooltipConfig : { type : "top" } ,
2020-02-08 11:14:10 +01:00
children : BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Clickable , {
2019-12-21 11:45:18 +01:00
className : BDFDB . disCN . hotkeyresetbutton ,
onClick : this . handleReset . bind ( this ) ,
2020-02-08 11:14:10 +01:00
children : BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . SvgIcon , {
2019-12-21 11:45:18 +01:00
iconSVG : ` <svg height="20" width="20" viewBox="0 0 20 20"><path fill="currentColor" d="M 14.348 14.849 c -0.469 0.469 -1.229 0.469 -1.697 0 l -2.651 -3.030 -2.651 3.029 c -0.469 0.469 -1.229 0.469 -1.697 0 -0.469 -0.469 -0.469 -1.229 0 -1.697l2.758 -3.15 -2.759 -3.152 c -0.469 -0.469 -0.469 -1.228 0 -1.697 s 1.228 -0.469 1.697 0 l 2.652 3.031 2.651 -3.031 c 0.469 -0.469 1.228 -0.469 1.697 0 s 0.469 1.229 0 1.697l -2.758 3.152 2.758 3.15 c 0.469 0.469 0.469 1.229 0 1.698 z"></path></svg> ` ,
} )
2019-11-15 21:48:30 +01:00
} )
} ) : null
] . filter ( n => n )
} ) ;
2019-11-15 14:11:07 +01:00
}
} ;
2019-11-15 13:23:57 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . LazyImage = BDFDB . ModuleUtils . findByName ( "LazyImage" ) ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . ListHeader = BDFDB . ModuleUtils . findByName ( "ListSectionItem" ) ;
2019-11-20 14:40:38 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . ListItem = BDFDB . ModuleUtils . findByName ( "ListItem" ) ;
2019-11-20 14:40:38 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . ListRow = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.ListRow" ) || reactInitialized && class BDFDB _ListRow extends LibraryModules . React . Component {
2019-11-12 19:44:00 +01:00
render ( ) {
return BDFDB . ReactUtils . createElement ( "div" , {
2019-11-12 19:50:45 +01:00
className : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . listrow , this . props . className ) ,
2019-11-12 19:44:00 +01:00
children : [
this . props . prefix ,
BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . listrowcontent ,
2019-11-22 11:25:45 +01:00
style : { flex : "1 1 auto" } ,
2019-11-12 19:44:00 +01:00
children : [
BDFDB . ReactUtils . createElement ( "div" , {
2019-11-12 19:58:03 +01:00
className : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . listname , this . props . labelClassName ) ,
2019-11-22 11:25:45 +01:00
style : { flex : "1 1 auto" } ,
2019-11-12 19:44:00 +01:00
children : this . props . label
} ) ,
2020-02-08 11:14:10 +01:00
typeof this . props . note == "string" ? BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . FormComponents . FormText , {
type : InternalComponents . LibraryComponents . FormComponents . FormText . Types . DESCRIPTION ,
2019-11-12 19:50:45 +01:00
children : this . props . note
} ) : null
2019-11-12 19:44:00 +01:00
] . filter ( n => n )
2019-11-22 11:25:45 +01:00
} ) ,
this . props . suffix
2019-11-12 19:44:00 +01:00
] . filter ( n => n )
} ) ;
}
} ;
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . MessageGroup = BDFDB . ModuleUtils . findByName ( "ChannelMessage" ) ;
2019-11-07 17:09:30 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . MessagesPopoutComponents = Object . assign ( { } , BDFDB . ModuleUtils . findByProperties ( "Header" , "EmptyStateBottom" ) ) ;
2019-11-07 14:34:37 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . MemberRole = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.MemberRole" ) || reactInitialized && class BDFDB _MemberRole extends LibraryModules . React . Component {
2019-11-11 09:45:40 +01:00
handleClick ( e ) { if ( typeof this . props . onClick == "function" ) this . props . onClick ( e , this ) ; }
handleContextMenu ( e ) { if ( typeof this . props . onContextMenu == "function" ) this . props . onContextMenu ( e , this ) ; }
2019-11-11 08:45:32 +01:00
render ( ) {
let color = BDFDB . ColorUtils . convert ( this . props . role . colorString || BDFDB . DiscordConstants . Colors . PRIMARY _DARK _300 , "RGB" ) ;
return BDFDB . ReactUtils . createElement ( "li" , {
className : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . userpopoutrole , this . props . className ) ,
style : { borderColor : BDFDB . ColorUtils . setAlpha ( color , 0.6 ) } ,
2019-11-11 09:45:40 +01:00
onClick : this . handleClick . bind ( this ) ,
onContextMenu : this . handleContextMenu . bind ( this ) ,
2019-11-11 08:45:32 +01:00
children : [
! this . props . noCircle ? BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . userpopoutrolecircle ,
style : { backgroundColor : color }
} ) : null ,
BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . userpopoutrolename ,
children : this . props . role . name
} )
] . filter ( n => n )
} ) ;
}
2019-11-12 19:44:00 +01:00
} ;
2019-11-11 08:45:32 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . ModalComponents = Object . assign ( { } , BDFDB . ModuleUtils . findByProperties ( "ModalContent" , "ModalFooter" ) ) ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . ModalComponents . ModalContent = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.ModalComponents.ModalContent" ) || reactInitialized && class BDFDB _ModalContent extends LibraryModules . React . Component {
2019-11-10 18:06:24 +01:00
render ( ) {
2020-02-08 11:14:10 +01:00
return this . props . scroller || this . props . scroller === undefined ? BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . ScrollerVertical , {
2019-11-10 18:06:24 +01:00
outerClassName : BDFDB . disCN . modalcontent ,
2019-11-10 18:32:44 +01:00
className : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . modalsubinner , this . props . className ) ,
2020-02-08 11:14:10 +01:00
theme : InternalComponents . LibraryComponents . ScrollerVertical . Themes . GHOST _HAIRLINE ,
2019-11-10 18:06:24 +01:00
ref : this . props . scrollerRef ,
children : this . props . children
2020-02-08 11:14:10 +01:00
} ) : BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex , {
2019-11-10 18:06:24 +01:00
className : BDFDB . disCN . modalcontent ,
2020-02-08 11:14:10 +01:00
direction : InternalComponents . LibraryComponents . Flex . Direction . VERTICAL ,
align : InternalComponents . LibraryComponents . Flex . Align . STRETCH ,
children : BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex , {
2019-11-10 18:32:44 +01:00
className : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . modalsubinner , BDFDB . disCN . modalsubinnerscrollerless , this . props . className ) ,
2020-02-08 11:14:10 +01:00
direction : InternalComponents . LibraryComponents . Flex . Direction . VERTICAL ,
align : InternalComponents . LibraryComponents . Flex . Align . STRETCH ,
2019-11-10 18:06:24 +01:00
children : this . props . children
} )
} ) ;
}
2019-11-12 19:44:00 +01:00
} ;
2019-11-10 18:06:24 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . ModalComponents . ModalTabContent = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.ModalComponents.ModalTabContent" ) || reactInitialized && class BDFDB _ModalTabContent extends LibraryModules . React . Component {
2019-11-06 14:41:45 +01:00
render ( ) {
let childprops = Object . assign ( { } , this . props ) ;
BDFDB . ObjectUtils . delete ( childprops , "open" ) ;
2020-02-08 11:14:10 +01:00
return BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex , Object . assign ( { tab : "unnamed" } , childprops , {
2019-11-07 13:45:41 +01:00
className : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . modaltabcontent , this . props . open && BDFDB . disCN . modaltabcontentopen , this . props . className ) ,
2020-02-08 11:14:10 +01:00
direction : InternalComponents . LibraryComponents . Flex . Direction . VERTICAL ,
align : InternalComponents . LibraryComponents . Flex . Align . STRETCH ,
2019-11-06 14:41:45 +01:00
style : Object . assign ( { } , childprops . style , {
2019-11-12 19:26:46 +01:00
display : this . props . open ? null : "none"
2019-11-06 14:41:45 +01:00
} )
} ) ) ;
}
2019-11-12 19:44:00 +01:00
} ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . NavItem = BDFDB . ModuleUtils . findByName ( "NavItem" ) ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . Popout = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.Popout" ) || reactInitialized && class BDFDB _Popout extends LibraryModules . React . Component {
2019-11-07 10:52:58 +01:00
componentWillUnmount ( ) {
2019-11-08 10:27:53 +01:00
delete this . props . containerInstance . popout ;
2019-11-07 10:52:58 +01:00
if ( typeof this . props . onClose == "function" ) this . props . onClose ( this . props . containerInstance , this ) ;
}
2019-11-06 14:41:45 +01:00
render ( ) {
let pos = typeof this . props . position == "string" ? this . props . position . toLowerCase ( ) : null ;
let position = pos && DiscordClasses [ "popout" + pos ] ? BDFDB . disCN [ "popout" + pos ] : BDFDB . disCN . popouttop ;
let arrow = ! this . props . arrow ? BDFDB . disCN . popoutnoarrow : ( pos && pos . indexOf ( "top" ) > - 1 && pos != "top" ? BDFDB . disCN . popoutarrowalignmenttop : BDFDB . disCN . popoutarrowalignmentmiddle ) ;
return BDFDB . ReactUtils . createElement ( "div" , {
2019-11-07 15:29:15 +01:00
className : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . popoutwrapper , BDFDB . disCN . popout , position , this . props . invert && pos && pos != "bottom" && BDFDB . disCN . popoutinvert , arrow , ! this . props . shadow && BDFDB . disCN . popoutnoshadow ) ,
2019-11-06 14:41:45 +01:00
id : this . props . id ,
2019-11-07 21:10:52 +01:00
onClick : e => { e . stopPropagation ( ) ; } ,
2019-11-06 14:41:45 +01:00
style : Object . assign ( { } , this . props . style , {
position : this . props . isChild ? "relative" : "absolute"
} ) ,
children : BDFDB . ReactUtils . createElement ( "div" , {
2019-11-09 13:15:38 +01:00
className : BDFDB . DOMUtils . formatClassName ( this . props . className , ( this . props . themed || this . props . themed === undefined ) && BDFDB . disCN . popoutthemedpopout ) ,
2019-11-07 21:10:52 +01:00
style : BDFDB . ObjectUtils . extract ( this . props , "padding" , "height" , "maxHeight" , "minHeight" , "width" , "maxWidth" , "minWidth" ) ,
2019-11-06 14:41:45 +01:00
children : this . props . children
} )
} ) ;
}
2019-11-12 19:44:00 +01:00
} ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . PopoutContainer = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.PopoutContainer" ) || reactInitialized && class BDFDB _PopoutContainer extends LibraryModules . React . Component {
2019-11-06 14:41:45 +01:00
handleRender ( e ) {
2020-02-08 11:14:10 +01:00
return this . popout = BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Popout , BDFDB . ObjectUtils . exclude ( Object . assign ( { } , this . props , {
2019-11-06 14:41:45 +01:00
className : this . props . popoutClassName ,
2019-11-07 21:10:52 +01:00
containerInstance : this ,
2019-11-06 14:41:45 +01:00
isChild : true ,
position : e . position ,
style : this . props . popoutStyle ,
2019-11-07 21:10:52 +01:00
onClose : typeof this . props . onClose == "function" ? this . props . onClose . bind ( this ) : _ => { } ,
2019-11-06 14:41:45 +01:00
children : typeof this . props . renderPopout == "function" ? this . props . renderPopout ( this ) : null
2019-11-07 21:10:52 +01:00
} ) , "popoutStyle" , "popoutClassName" ) ) ;
2019-11-06 14:41:45 +01:00
}
componentDidMount ( ) {
let basepopout = BDFDB . ReactUtils . findOwner ( this , { name : "BasePopout" } ) ;
if ( ! basepopout || ! basepopout . handleClick ) return ;
this . handleClick = basepopout . handleClick ;
2019-11-07 10:52:58 +01:00
this . close = basepopout . close ;
2019-11-06 14:41:45 +01:00
this . domElementRef = basepopout . domElementRef ;
}
render ( ) {
2019-11-07 21:10:52 +01:00
let child = ( BDFDB . ArrayUtils . is ( this . props . children ) ? this . props . children [ 0 ] : this . props . children ) || BDFDB . ReactUtils . createElement ( "div" , { style : { height : "100%" , width : "100%" } } ) ;
2019-11-07 13:45:41 +01:00
child . props . className = BDFDB . DOMUtils . formatClassName ( child . props . className , this . props . className ) ;
let childClick = child . props . onClick , childContextMenu = child . props . onContextMenu ;
child . props . onClick = ( e , childthis ) => {
if ( ! this . domElementRef . current || this . domElementRef . current . contains ( e . target ) ) {
if ( ( this . props . openOnClick || this . props . openOnClick === undefined ) && typeof this . handleClick == "function" ) this . handleClick ( ) ;
if ( typeof this . props . onClick == "function" ) this . props . onClick ( e , this ) ;
if ( typeof childClick == "function" ) childClick ( e , childthis ) ;
}
else e . stopPropagation ( ) ;
} ;
child . props . onContextMenu = ( e , childthis ) => {
if ( ! this . domElementRef . current || this . domElementRef . current . contains ( e . target ) ) {
if ( this . props . openOnContextMenu && typeof this . handleClick == "function" ) this . handleClick ( ) ;
if ( typeof this . props . onContextMenu == "function" ) this . props . onContextMenu ( e , this ) ;
if ( typeof childContextMenu == "function" ) childContextMenu ( e , childthis ) ;
}
else e . stopPropagation ( ) ;
} ;
return BDFDB . ReactUtils . createElement ( LibraryModules . React . Fragment , {
2020-02-08 11:14:10 +01:00
children : BDFDB . ReactUtils . createElement ( InternalComponents . NativeSubComponents . PopoutContainer , Object . assign ( { } , this . props , {
2019-11-07 13:45:41 +01:00
children : _ => { return child ; } ,
2019-11-11 13:54:30 +01:00
renderPopout : this . handleRender . bind ( this )
2019-11-06 14:41:45 +01:00
} ) )
} ) ;
}
2019-11-12 19:44:00 +01:00
} ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . QuickSelect = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.QuickSelect" ) || reactInitialized && class BDFDB _QuickSelect extends LibraryModules . React . Component {
2019-11-09 13:15:38 +01:00
handleChange ( option ) {
this . props . value = option ;
if ( typeof this . props . onChange == "function" ) this . props . onChange ( option . value || option . key , this ) ;
2019-12-18 12:47:20 +01:00
BDFDB . ReactUtils . forceUpdate ( this ) ;
2019-11-06 14:41:45 +01:00
}
render ( ) {
2019-11-08 12:45:11 +01:00
let options = ( BDFDB . ArrayUtils . is ( this . props . options ) ? this . props . options : [ { } ] ) . filter ( n => n ) ;
2019-11-09 12:26:10 +01:00
let selectedOption = BDFDB . ObjectUtils . is ( this . props . value ) ? this . props . value : ( options [ 0 ] || { } ) ;
2020-02-08 11:14:10 +01:00
return this . props . nativeComponent ? BDFDB . ReactUtils . createElement ( InternalComponents . NativeSubComponents . QuickSelect , Object . assign ( { } , this . props , {
2019-11-06 14:41:45 +01:00
className : BDFDB . DOMUtils . formatClassName ( this . props . className , BDFDB . disCN . quickselectwrapper ) ,
popoutClassName : BDFDB . DOMUtils . formatClassName ( this . props . popoutClassName , BDFDB . disCN . quickselectpopoutwrapper ) ,
2019-11-07 15:29:15 +01:00
popoutProps : { position : "bottom" , zIndexBoost : 1000 } ,
2019-11-09 12:26:10 +01:00
value : selectedOption ,
2019-11-08 12:45:11 +01:00
options : options ,
2019-12-18 19:32:01 +01:00
renderOption : typeof this . props . renderOption == "function" ? this . props . renderOption : option => option . label ,
2019-11-06 14:41:45 +01:00
onChange : this . handleChange . bind ( this )
2020-02-08 11:14:10 +01:00
} ) ) : BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . PopoutContainer , Object . assign ( { } , this . props , {
2019-11-09 12:26:10 +01:00
children : BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . DOMUtils . formatClassName ( this . props . className , BDFDB . disCN . quickselectwrapper ) ,
2020-02-08 11:14:10 +01:00
children : BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex , {
2019-11-09 12:26:10 +01:00
className : BDFDB . disCN . quickselect ,
2020-02-08 11:14:10 +01:00
align : InternalComponents . LibraryComponents . Flex . Align . CENTER ,
2019-11-09 12:26:10 +01:00
children : [
BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . quickselectlabel ,
children : this . props . label
} ) ,
2020-02-08 11:14:10 +01:00
BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex , {
align : InternalComponents . LibraryComponents . Flex . Align . CENTER ,
2019-11-09 12:26:10 +01:00
className : BDFDB . disCN . quickselectclick ,
children : [
BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . quickselectvalue ,
children : typeof this . props . renderValue == "function" ? this . props . renderValue ( this . props . value ) : this . props . value . label
} ) ,
BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . quickselectarrow
} )
]
} )
]
} )
} ) ,
2019-11-09 13:15:38 +01:00
popoutClassName : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . quickselectpopout , this . props . popoutClassName , BDFDB . disCN . contextmenu , BDFDB . disCN . quickselectpopoutwrapper , this . props . scroller && BDFDB . disCN . quickselectpopoutscroll ) ,
themed : false ,
2019-11-09 12:55:14 +01:00
animation : BDFDB . LibraryComponents . PopoutContainer . Animation . TRANSLATE ,
2019-11-09 12:26:10 +01:00
position : BDFDB . LibraryComponents . PopoutContainer . Positions . BOTTOM ,
align : BDFDB . LibraryComponents . PopoutContainer . Align . RIGHT ,
renderPopout : instance => {
let items = options . map ( option => {
2019-11-09 13:15:38 +01:00
let selected = option . value && option . value === selectedOption . value || option . key && option . key === selectedOption . key ;
2020-02-08 11:14:10 +01:00
return typeof this . props . renderOption == "function" ? this . props . renderOption ( option ) : BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . ContextMenuItem , {
2019-11-09 12:26:10 +01:00
className : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . quickselectpopoutoption , selected && BDFDB . disCN . quickselectpopoutoptionselected ) ,
2019-11-09 13:17:56 +01:00
action : selected ? null : _ => {
2019-11-09 12:26:10 +01:00
instance . close ( ) ;
this . handleChange . bind ( this ) ( option )
} ,
2019-11-09 13:15:38 +01:00
label : option . label
2019-11-09 12:26:10 +01:00
} ) ;
} ) ;
2020-02-08 11:14:10 +01:00
return this . props . scroller ? BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . ScrollerVertical , {
2019-11-09 12:26:10 +01:00
className : BDFDB . disCN . quickselectscroller ,
children : items
} ) : items ;
}
2019-11-08 12:45:11 +01:00
} ) ) ;
2019-11-06 14:41:45 +01:00
}
2019-11-12 19:44:00 +01:00
} ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . QuickSwitchComponents = Object . assign ( { } , BDFDB . ModuleUtils . findByProperties ( "Channel" , "GroupDM" , "Header" ) ) ;
2020-02-07 12:12:32 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . QuickSwitchComponents . Menu = BDFDB . ModuleUtils . findByName ( "QuickSwitcher" ) ;
2020-02-07 12:12:32 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . RadioGroup = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.RadioGroup" ) || reactInitialized && class BDFDB _RadioGroup extends LibraryModules . React . Component {
2020-01-17 10:59:41 +01:00
handleChange ( value ) {
this . props . value = value . value ;
if ( typeof this . props . onChange == "function" ) this . props . onChange ( value , this ) ;
BDFDB . ReactUtils . forceUpdate ( this ) ;
}
render ( ) {
2020-02-08 11:14:10 +01:00
return BDFDB . ReactUtils . createElement ( InternalComponents . NativeSubComponents . RadioGroup , Object . assign ( { } , this . props , {
2020-01-17 10:59:41 +01:00
onChange : this . handleChange . bind ( this )
} ) ) ;
}
} ;
2020-01-17 10:45:58 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . ScrollerHorizontal = BDFDB . ModuleUtils . findByName ( "HorizontalScroller" ) ;
2019-11-07 17:31:01 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . ScrollerVertical = BDFDB . ModuleUtils . findByName ( "VerticalScroller" ) ;
2019-11-07 17:31:01 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . SearchBar = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.SearchBar" ) || reactInitialized && class BDFDB _SearchBar extends LibraryModules . React . Component {
2019-11-06 14:59:55 +01:00
handleChange ( query ) {
this . props . query = query ;
if ( typeof this . props . onChange == "function" ) this . props . onChange ( query , this ) ;
2019-12-18 12:47:20 +01:00
BDFDB . ReactUtils . forceUpdate ( this ) ;
2019-11-06 14:59:55 +01:00
}
handleClear ( ) {
this . props . query = "" ;
2019-11-06 21:44:01 +01:00
if ( this . props . changeOnClear && typeof this . props . onChange == "function" ) this . props . onChange ( "" , this ) ;
if ( typeof this . props . onClear == "function" ) this . props . onClear ( this ) ;
2019-12-18 12:47:20 +01:00
BDFDB . ReactUtils . forceUpdate ( this ) ;
2019-11-06 14:59:55 +01:00
}
render ( ) {
let props = Object . assign ( { } , this . props , {
onChange : this . handleChange . bind ( this ) ,
onClear : this . handleClear . bind ( this )
} ) ;
if ( typeof props . query != "string" ) props . query = "" ;
2020-02-08 11:14:10 +01:00
return BDFDB . ReactUtils . createElement ( InternalComponents . NativeSubComponents . SearchBar , props ) ;
2019-11-06 14:59:55 +01:00
}
2019-11-12 19:44:00 +01:00
} ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . Select = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.Select" ) || reactInitialized && class BDFDB _Select extends LibraryModules . React . Component {
2019-11-06 14:41:45 +01:00
handleChange ( value ) {
this . props . value = value ;
if ( typeof this . props . onChange == "function" ) this . props . onChange ( value , this ) ;
2019-12-18 12:47:20 +01:00
BDFDB . ReactUtils . forceUpdate ( this ) ;
2019-11-06 14:41:45 +01:00
}
render ( ) {
2020-02-08 11:14:10 +01:00
return BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex , {
2019-11-15 21:48:30 +01:00
className : BDFDB . disCN . selectwrapper ,
2020-02-08 11:14:10 +01:00
direction : InternalComponents . LibraryComponents . Flex . Direction . HORIZONTAL ,
align : InternalComponents . LibraryComponents . Flex . Align . CENTER ,
children : BDFDB . ReactUtils . createElement ( InternalComponents . NativeSubComponents . Select , Object . assign ( { } , this . props , {
2019-11-15 21:48:30 +01:00
onChange : this . handleChange . bind ( this )
} ) )
} ) ;
2019-11-06 14:41:45 +01:00
}
2019-11-12 19:44:00 +01:00
} ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . SettingsPanel = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.SettingsPanel" ) || reactInitialized && class BDFDB _SettingsPanel extends LibraryModules . React . Component {
2019-11-06 14:41:45 +01:00
render ( ) {
2020-02-08 11:14:10 +01:00
return this . props . children ? BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex , {
direction : InternalComponents . LibraryComponents . Flex . Direction . VERTICAL ,
2019-11-06 14:41:45 +01:00
grow : 1 ,
children : [
2020-02-08 11:14:10 +01:00
typeof this . props . title == "string" ? BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . FormComponents . FormTitle , {
2019-11-06 14:41:45 +01:00
className : BDFDB . disCN . settingspaneltitle ,
2020-02-08 11:14:10 +01:00
tag : InternalComponents . LibraryComponents . FormComponents . FormTitle . Tags . H2 ,
2019-11-06 14:41:45 +01:00
children : this . props . title
} ) : null ,
2020-02-08 11:14:10 +01:00
typeof this . props . title == "string" ? BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . FormComponents . FormDivider , {
2019-11-06 14:41:45 +01:00
className : BDFDB . disCNS . margintop4 + BDFDB . disCN . marginbottom8
} ) : null ,
2020-02-08 11:14:10 +01:00
BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex , {
2019-11-06 14:41:45 +01:00
className : BDFDB . disCN . settingspanelinner ,
2020-02-08 11:14:10 +01:00
direction : InternalComponents . LibraryComponents . Flex . Direction . VERTICAL ,
2019-11-06 14:41:45 +01:00
children : this . props . children
} )
]
} ) : null ;
}
2019-11-12 19:44:00 +01:00
} ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . SettingsPanelInner = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.SettingsPanelInner" ) || reactInitialized && class BDFDB _SettingsPanelInner extends LibraryModules . React . Component {
2019-11-06 14:41:45 +01:00
render ( ) {
2020-02-08 11:14:10 +01:00
return this . props . children ? BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex , {
2020-01-17 22:03:45 +01:00
className : this . props . className ,
2020-02-08 11:14:10 +01:00
direction : InternalComponents . LibraryComponents . Flex . Direction . VERTICAL ,
2019-11-06 14:41:45 +01:00
children : [
2020-02-08 11:14:10 +01:00
! this . props . first ? BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . FormComponents . FormDivider , {
2019-11-06 14:41:45 +01:00
className : BDFDB . disCN . marginbottom8
} ) : null ,
2020-02-08 11:14:10 +01:00
typeof this . props . title == "string" ? BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . FormComponents . FormTitle , {
2019-11-06 14:41:45 +01:00
className : BDFDB . disCN . marginbottom4 ,
2020-02-08 11:14:10 +01:00
tag : InternalComponents . LibraryComponents . FormComponents . FormTitle . Tags . H3 ,
2019-11-06 14:41:45 +01:00
children : this . props . title
} ) : null ,
2020-02-08 11:14:10 +01:00
BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex , {
2019-11-06 14:41:45 +01:00
className : BDFDB . disCN . settingspanellist ,
2020-02-08 11:14:10 +01:00
direction : InternalComponents . LibraryComponents . Flex . Direction . VERTICAL ,
2019-11-06 14:41:45 +01:00
children : this . props . children
} ) ,
2020-02-08 11:14:10 +01:00
! this . props . last ? BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . FormComponents . FormDivider , {
2019-11-06 14:41:45 +01:00
className : BDFDB . disCN . marginbottom20
} ) : null
]
} ) : null ;
}
2019-11-12 19:44:00 +01:00
} ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . SettingsItem = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.SettingsItem" ) || reactInitialized && class BDFDB _SettingsItem extends LibraryModules . React . Component {
2019-11-06 14:41:45 +01:00
handleChange ( value ) {
if ( typeof this . props . onChange == "function" ) this . props . onChange ( value , this ) ;
}
render ( ) {
if ( typeof this . props . type != "string" || ! [ "BUTTON" , "SELECT" , "SWITCH" , "TEXTINPUT" ] . includes ( this . props . type . toUpperCase ( ) ) ) return null ;
2020-02-08 11:14:10 +01:00
let childcomponent = InternalComponents . LibraryComponents [ this . props . type ] ;
2019-11-06 14:41:45 +01:00
if ( ! childcomponent ) return null ;
if ( this . props . mini && childcomponent . Sizes ) this . props . size = childcomponent . Sizes . MINI || childcomponent . Sizes . MIN ;
2020-02-08 11:14:10 +01:00
return BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex , {
2019-11-07 13:45:41 +01:00
className : BDFDB . DOMUtils . formatClassName ( this . props . className , this . props . disabled && BDFDB . disCN . disabled ) ,
2019-11-06 14:41:45 +01:00
id : this . props . id ,
2020-02-08 11:14:10 +01:00
direction : InternalComponents . LibraryComponents . Flex . Direction . VERTICAL ,
align : InternalComponents . LibraryComponents . Flex . Align . STRETCH ,
2019-11-15 12:54:50 +01:00
grow : this . props . grow ,
stretch : this . props . stretch ,
2019-11-06 14:41:45 +01:00
children : [
2020-02-08 11:14:10 +01:00
this . props . dividertop ? BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . FormComponents . FormDivider , {
2020-02-03 16:00:06 +01:00
className : this . props . mini ? BDFDB . disCN . marginbottom4 : BDFDB . disCN . marginbottom8
2019-11-06 14:41:45 +01:00
} ) : null ,
2020-02-08 11:14:10 +01:00
BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex , {
align : InternalComponents . LibraryComponents . Flex . Align . CENTER ,
2019-11-06 14:41:45 +01:00
children : [
2020-02-08 11:14:10 +01:00
this . props . label ? BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex . Child , {
children : BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . SettingsLabel , {
2019-11-06 14:41:45 +01:00
mini : this . props . mini ,
label : this . props . label
} )
2019-11-15 12:40:49 +01:00
} ) : null ,
this . props . labelchildren ,
2020-02-08 11:14:10 +01:00
BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex . Child , {
2019-11-06 14:41:45 +01:00
grow : 0 ,
shrink : this . props . basis ? 0 : 1 ,
basis : this . props . basis ,
wrap : true ,
2019-11-15 12:54:50 +01:00
children : BDFDB . ReactUtils . createElement ( childcomponent , BDFDB . ObjectUtils . exclude ( Object . assign ( BDFDB . ObjectUtils . exclude ( this . props , "className" , "id" , "type" ) , this . props . childProps , { onChange : this . handleChange . bind ( this ) } ) , "grow" , "stretch" , "basis" , "dividerbottom" , "dividertop" , "label" , "labelchildren" , "mini" , "note" , "childProps" ) )
2019-11-06 14:41:45 +01:00
} )
2019-11-22 14:26:12 +01:00
] . flat ( 10 ) . filter ( n => n )
2019-11-06 14:41:45 +01:00
} ) ,
2020-02-08 11:14:10 +01:00
typeof this . props . note == "string" ? BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex . Child , {
2019-11-06 14:41:45 +01:00
className : BDFDB . disCN . note ,
2020-02-08 11:14:10 +01:00
children : BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . FormComponents . FormText , {
2019-11-06 14:41:45 +01:00
disabled : this . props . disabled ,
2020-02-08 11:14:10 +01:00
type : InternalComponents . LibraryComponents . FormComponents . FormText . Types . DESCRIPTION ,
children : BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . TextScroller , { speed : 2 , children : this . props . note } )
2019-11-06 14:41:45 +01:00
} )
} ) : null ,
2020-02-08 11:14:10 +01:00
this . props . dividerbottom ? BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . FormComponents . FormDivider , {
2020-02-03 16:00:06 +01:00
className : this . props . mini ? BDFDB . disCN . margintop4 : BDFDB . disCN . margintop8
2019-11-06 14:41:45 +01:00
} ) : null
]
} ) ;
}
2019-11-12 19:44:00 +01:00
} ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . SettingsLabel = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.SettingsLabel" ) || reactInitialized && class BDFDB _SettingsLabel extends LibraryModules . React . Component {
2019-11-06 14:41:45 +01:00
render ( ) {
2020-02-08 11:14:10 +01:00
return BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . TextScroller , {
2019-11-06 14:41:45 +01:00
className : BDFDB . DOMUtils . formatClassName ( this . props . mini ? BDFDB . disCN . titlemini : BDFDB . disCN . titledefault , BDFDB . disCN . cursordefault ) ,
2019-11-10 20:12:16 +01:00
speed : 2 ,
2019-11-06 14:41:45 +01:00
children : this . props . label
} ) ;
}
2019-11-12 19:44:00 +01:00
} ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . SettingsList = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.SettingsList" ) || reactInitialized && class BDFDB _SettingsList extends LibraryModules . React . Component {
2019-12-18 19:32:01 +01:00
componentDidMount ( ) {
let list = BDFDB . ReactUtils . findDOMNode ( this ) ;
if ( list && ! this . props . maxWidth ) {
let headers = Array . from ( list . querySelectorAll ( BDFDB . dotCN . settingstableheader ) ) ;
headers . shift ( ) ;
2020-01-22 11:49:04 +01:00
if ( BDFDB . DOMUtils . getRects ( headers [ 0 ] ) . width == 0 ) BDFDB . TimeUtils . timeout ( _ => { this . resizeList ( list , headers ) ; } ) ;
2020-01-20 14:06:01 +01:00
else this . resizeList ( list , headers ) ;
2019-12-18 19:58:10 +01:00
}
}
2020-01-20 14:06:01 +01:00
resizeList ( list , headers ) {
2020-01-22 13:54:03 +01:00
let maxWidth = 0 , biggestWidth = 0 ;
2019-12-18 19:58:10 +01:00
if ( ! maxWidth ) {
for ( let header of headers ) {
header . style = "" ;
let width = BDFDB . DOMUtils . getRects ( header ) . width ;
maxWidth = width > maxWidth ? width : maxWidth ;
2019-12-18 19:32:01 +01:00
}
2019-12-18 19:58:10 +01:00
maxWidth += 4 ;
2020-01-22 13:54:03 +01:00
biggestWidth = maxWidth ;
2019-12-18 19:58:10 +01:00
}
if ( headers . length * maxWidth > 300 ) {
2020-01-22 13:54:03 +01:00
this . props . vertical = true ;
2019-12-18 19:58:10 +01:00
maxWidth = parseInt ( 290 / headers . length ) ;
2019-12-18 19:32:01 +01:00
}
2020-01-22 13:54:03 +01:00
else if ( maxWidth < 36 ) {
maxWidth = 36 ;
biggestWidth = maxWidth ;
}
2019-12-18 19:58:10 +01:00
this . props . maxWidth = maxWidth ;
2020-01-22 13:54:03 +01:00
this . props . biggestWidth = biggestWidth ;
2020-01-20 14:06:01 +01:00
this . props . fullWidth = BDFDB . DOMUtils . getRects ( list ) . width ;
2019-12-18 19:58:10 +01:00
BDFDB . ReactUtils . forceUpdate ( this ) ;
2019-12-18 19:32:01 +01:00
}
render ( ) {
this . props . settings = BDFDB . ArrayUtils . is ( this . props . settings ) ? this . props . settings : [ ] ;
this . props . renderLabel = typeof this . props . renderLabel == "function" ? this . props . renderLabel : data => data . label ;
2020-01-22 10:56:02 +01:00
let labelWidth = this . props . maxWidth && this . props . fullWidth && ( this . props . fullWidth - 20 - ( this . props . maxWidth * this . props . settings . length ) ) ;
2020-01-20 14:12:36 +01:00
let configWidth = this . props . maxWidth && this . props . maxWidth * this . props . settings . length ;
2020-01-22 13:54:03 +01:00
let isHeaderClickable = typeof this . props . onHeaderClick == "function" || typeof this . props . onHeaderContextMenu == "function" ;
2019-12-18 19:32:01 +01:00
return BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . settingstablelist , this . props . className ) ,
children : [
2020-02-08 11:14:10 +01:00
BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex , {
2020-01-22 10:56:02 +01:00
className : BDFDB . disCN . settingstableheaders ,
2020-02-08 11:14:10 +01:00
align : InternalComponents . LibraryComponents . Flex . Align . STRETCH ,
2020-01-22 13:54:03 +01:00
style : this . props . vertical && this . props . biggestWidth ? {
marginTop : this . props . biggestWidth - 25 || 0
} : { } ,
2019-12-18 19:32:01 +01:00
children : [ ] . concat ( this . props . title || "" , this . props . settings ) . map ( ( setting , i ) => BDFDB . ReactUtils . createElement ( "div" , {
2020-01-22 14:01:16 +01:00
className : BDFDB . DOMUtils . formatClassName ( i == 0 ? BDFDB . disCN . settingstableheadername : BDFDB . disCN . settingstableheaderoption , i != 0 && this . props . vertical && BDFDB . disCN . settingstableheadervertical , BDFDB . disCN . settingstableheader , BDFDB . disCN . settingstableheadersize , BDFDB . disCN . primary , BDFDB . disCN . weightbold , isHeaderClickable && BDFDB . disCN . cursorpointer ) ,
2020-01-20 14:32:09 +01:00
onClick : _ => { if ( typeof this . props . onHeaderClick == "function" ) this . props . onHeaderClick ( setting , this ) ; } ,
2020-01-22 10:59:13 +01:00
onContextMenu : _ => { if ( typeof this . props . onHeaderContextMenu == "function" ) this . props . onHeaderContextMenu ( setting , this ) ; } ,
2019-12-18 19:32:01 +01:00
style : i != 0 && this . props . maxWidth ? {
maxWidth : this . props . maxWidth ,
width : this . props . maxWidth ,
flex : ` 0 0 ${ this . props . maxWidth } px `
2020-01-22 13:54:03 +01:00
} : { } ,
children : BDFDB . ReactUtils . createElement ( "span" , {
children : setting
} )
2019-12-18 19:32:01 +01:00
} ) )
} ) ,
2020-02-08 11:14:10 +01:00
( BDFDB . ArrayUtils . is ( this . props . data ) ? this . props . data : [ { } ] ) . filter ( n => n ) . map ( data => BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Card , BDFDB . ObjectUtils . exclude ( Object . assign ( { } , this . props , {
2020-01-20 14:06:01 +01:00
className : BDFDB . DOMUtils . formatClassName ( [ this . props . cardClassName , data . className ] . filter ( n => n ) . join ( " " ) . indexOf ( BDFDB . disCN . card ) == - 1 && BDFDB . disCN . cardprimaryoutline , BDFDB . disCN . settingstablecard , this . props . cardClassName , data . className ) ,
2019-12-18 20:39:34 +01:00
cardId : data . key ,
2019-12-18 19:32:01 +01:00
backdrop : false ,
2020-01-20 14:06:01 +01:00
style : Object . assign ( { } , this . props . cardStyle , data . style ) ,
2019-12-18 19:32:01 +01:00
children : [
2020-02-08 11:14:10 +01:00
BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex , {
2020-01-22 10:56:02 +01:00
className : BDFDB . disCN . settingstablecardlabel ,
2020-02-08 11:14:10 +01:00
align : InternalComponents . LibraryComponents . Flex . Align . CENTER ,
2020-01-20 14:06:01 +01:00
grow : 0 ,
shrink : 0 ,
2020-01-20 14:12:36 +01:00
basis : labelWidth || "auto" ,
style : { maxWidth : labelWidth || null } ,
2019-12-18 19:32:01 +01:00
children : this . props . renderLabel ( data )
} ) ,
2020-02-08 11:14:10 +01:00
BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex , {
2020-01-22 10:56:02 +01:00
className : BDFDB . disCN . settingstablecardconfigs ,
2020-02-08 11:14:10 +01:00
justify : InternalComponents . LibraryComponents . Flex . Justify . AROUND ,
align : InternalComponents . LibraryComponents . Flex . Align . CENTER ,
2019-12-18 19:32:01 +01:00
grow : 0 ,
shrink : 0 ,
2020-01-20 14:12:36 +01:00
basis : configWidth || "auto" ,
style : { maxWidth : configWidth || null } ,
2020-02-08 11:14:10 +01:00
children : this . props . settings . map ( setting => BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex . Child , {
2019-12-18 19:32:01 +01:00
className : BDFDB . disCN . checkboxcontainer ,
grow : 0 ,
shrink : 0 ,
wrap : true ,
2020-02-08 11:14:10 +01:00
children : BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Checkbox , {
2020-01-22 13:54:03 +01:00
disabled : data . disabled ,
2019-12-18 20:39:34 +01:00
cardId : data . key ,
settingId : setting ,
2020-02-08 11:14:10 +01:00
shape : InternalComponents . LibraryComponents . Checkbox . Shapes . ROUND ,
type : InternalComponents . LibraryComponents . Checkbox . Types . INVERTED ,
2019-12-18 19:32:01 +01:00
value : data [ setting ] ,
onChange : this . props . onCheckboxChange
} )
} ) ) . flat ( 10 ) . filter ( n => n )
} )
]
2020-01-20 14:06:01 +01:00
} ) , "title" , "data" , "settings" , "renderLabel" , "cardClassName" , "cardStyle" , "onCheckboxChange" , "maxWidth" , "fullWidth" ) ) )
2019-12-18 19:32:01 +01:00
]
} ) ;
}
} ;
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . SettingsSaveItem = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.SettingsSaveItem" ) || reactInitialized && class BDFDB _SettingsSaveItem extends LibraryModules . React . Component {
2019-11-06 14:41:45 +01:00
saveSettings ( value ) {
if ( ! BDFDB . ArrayUtils . is ( this . props . keys ) || ! BDFDB . ObjectUtils . is ( this . props . plugin ) ) return ;
let keys = this . props . keys . filter ( n => n ) ;
let option = keys . shift ( ) ;
if ( BDFDB . ObjectUtils . is ( this . props . plugin ) && option ) {
let data = BDFDB . DataUtils . load ( this . props . plugin , option ) ;
let newdata = "" ;
for ( let key of keys ) newdata += ` {" ${ key } ": ` ;
value = value != null && value . value != null ? value . value : value ;
let marker = typeof value == "string" ? ` " ` : ` ` ;
newdata += ( marker + value + marker ) + "}" . repeat ( keys . length ) ;
newdata = JSON . parse ( newdata ) ;
2020-01-05 12:00:41 +01:00
BDFDB . DataUtils . save ( BDFDB . ObjectUtils . is ( newdata ) ? BDFDB . ObjectUtils . deepAssign ( { } , data , newdata ) : newdata , this . props . plugin , option ) ;
2019-11-06 14:41:45 +01:00
this . props . plugin . SettingsUpdated = true ;
}
if ( typeof this . props . onChange == "function" ) this . props . onChange ( value , this ) ;
}
render ( ) {
if ( typeof this . props . type != "string" || ! [ "SELECT" , "SWITCH" , "TEXTINPUT" ] . includes ( this . props . type . toUpperCase ( ) ) ) return null ;
2020-02-08 11:14:10 +01:00
return BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . SettingsItem , BDFDB . ObjectUtils . exclude ( Object . assign ( { } , this . props , {
2019-11-06 14:41:45 +01:00
onChange : this . saveSettings . bind ( this )
2019-11-15 12:54:50 +01:00
} ) , "keys" , "plugin" ) ) ;
2019-11-06 14:41:45 +01:00
}
2019-11-12 19:44:00 +01:00
} ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . SettingsSwitch = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.SettingsSwitch" ) || reactInitialized && class BDFDB _SettingsSwitch extends LibraryModules . React . Component { // REMOVE
2019-11-06 14:41:45 +01:00
render ( ) {
2020-02-08 11:14:10 +01:00
return BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . SettingsSaveItem , Object . assign ( { keys : [ ] } , this . props , {
2019-11-06 14:41:45 +01:00
type : "Switch"
} ) ) ;
}
2019-11-12 19:44:00 +01:00
} ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . Slider = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.Slider" ) || reactInitialized && class BDFDB _Slider extends LibraryModules . React . Component {
2020-01-16 16:28:24 +01:00
handleValueChange ( value ) {
let newvalue = BDFDB . ArrayUtils . is ( this . props . edges ) && this . props . edges . length == 2 ? BDFDB . NumberUtils . mapRange ( [ 0 , 100 ] , this . props . edges , value ) : value ;
if ( typeof this . props . digits == "number" ) newvalue = Math . round ( newvalue * Math . pow ( 10 , this . props . digits ) ) / Math . pow ( 10 , this . props . digits ) ;
this . props . defaultValue = newvalue ;
if ( typeof this . props . onValueChange == "function" ) this . props . onValueChange ( newvalue , this ) ;
BDFDB . ReactUtils . forceUpdate ( this ) ;
}
handleValueRender ( value ) {
let newvalue = BDFDB . ArrayUtils . is ( this . props . edges ) && this . props . edges . length == 2 ? BDFDB . NumberUtils . mapRange ( [ 0 , 100 ] , this . props . edges , value ) : value ;
if ( typeof this . props . digits == "number" ) newvalue = Math . round ( newvalue * Math . pow ( 10 , this . props . digits ) ) / Math . pow ( 10 , this . props . digits ) ;
if ( typeof this . props . onValueRender == "function" ) {
let tempreturn = this . props . onValueRender ( newvalue , this ) ;
if ( tempreturn != undefined ) newvalue = tempreturn ;
}
return newvalue ;
}
render ( ) {
let defaultValue = BDFDB . ArrayUtils . is ( this . props . edges ) && this . props . edges . length == 2 ? BDFDB . NumberUtils . mapRange ( this . props . edges , [ 0 , 100 ] , this . props . defaultValue ) : this . props . defaultValue ;
if ( typeof this . props . digits == "number" ) defaultValue = Math . round ( defaultValue * Math . pow ( 10 , this . props . digits ) ) / Math . pow ( 10 , this . props . digits ) ;
2020-02-08 11:14:10 +01:00
return BDFDB . ReactUtils . createElement ( InternalComponents . NativeSubComponents . Slider , BDFDB . ObjectUtils . exclude ( Object . assign ( { } , this . props , {
2020-01-16 16:37:59 +01:00
initialValue : defaultValue ,
2020-01-16 16:28:24 +01:00
onValueChange : this . handleValueChange . bind ( this ) ,
onValueRender : this . handleValueRender . bind ( this )
} ) , "digits" , "edges" ) ) ;
}
} ;
2020-01-16 16:20:41 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . Spinner = BDFDB . ModuleUtils . findByName ( "Spinner" ) ;
2019-11-07 13:45:41 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . SvgIcon = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.SvgIcon" ) || reactInitialized && class BDFDB _Icon extends LibraryModules . React . Component {
2020-01-03 15:10:08 +01:00
render ( ) {
2020-02-08 11:14:10 +01:00
if ( this . props . name ) return BDFDB . ReactUtils . createElement ( InternalComponents . NativeSubComponents . SvgIcon , this . props ) ;
2020-01-03 15:10:08 +01:00
else if ( this . props . iconSVG ) {
let icon = BDFDB . ReactUtils . elementToReact ( BDFDB . DOMUtils . create ( this . props . iconSVG ) ) ;
2020-01-03 19:49:56 +01:00
icon . props . className = BDFDB . DOMUtils . formatClassName ( ! this . props . nativeClass && BDFDB . disCN . svgicon , icon . props . class , this . props . className ) ;
2020-01-03 15:23:07 +01:00
icon . props . style = Object . assign ( { } , icon . props . style , this . props . style ) ;
2020-01-03 15:10:08 +01:00
return icon ;
}
return null ;
}
} ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . Switch = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.Switch" ) || reactInitialized && class BDFDB _Switch extends LibraryModules . React . Component {
2019-11-06 14:41:45 +01:00
handleChange ( ) {
this . props . value = ! this . props . value ;
if ( typeof this . props . onChange == "function" ) this . props . onChange ( this . props . value , this ) ;
2019-12-18 12:47:20 +01:00
BDFDB . ReactUtils . forceUpdate ( this ) ;
2019-11-06 14:41:45 +01:00
}
render ( ) {
2020-02-08 11:14:10 +01:00
return BDFDB . ReactUtils . createElement ( InternalComponents . NativeSubComponents . Switch , Object . assign ( { } , this . props , { onChange : this . handleChange . bind ( this ) } ) ) ;
2019-11-06 14:41:45 +01:00
}
2019-11-12 19:44:00 +01:00
} ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . TabBar = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.TabBar" ) || reactInitialized && class BDFDB _TabBar extends LibraryModules . React . Component {
2019-11-06 14:41:45 +01:00
handleItemSelect ( item ) {
2019-11-07 15:58:58 +01:00
this . props . selectedItem = item ;
2019-11-06 14:41:45 +01:00
if ( typeof this . props . onItemSelect == "function" ) this . props . onItemSelect ( item , this ) ;
2019-12-18 12:47:20 +01:00
BDFDB . ReactUtils . forceUpdate ( this ) ;
2019-11-06 14:41:45 +01:00
}
render ( ) {
2019-11-08 12:45:11 +01:00
let items = ( BDFDB . ArrayUtils . is ( this . props . items ) ? this . props . items : [ { } ] ) . filter ( n => n ) ;
2020-02-08 11:14:10 +01:00
return BDFDB . ReactUtils . createElement ( InternalComponents . NativeSubComponents . TabBar , BDFDB . ObjectUtils . exclude ( Object . assign ( { } , this . props , {
2019-11-08 12:56:32 +01:00
selectedItem : this . props . selectedItem || ( items [ 0 ] || { } ) . value ,
2019-11-07 15:58:58 +01:00
onItemSelect : this . handleItemSelect . bind ( this ) ,
children : items . map ( data => {
2020-02-08 11:14:10 +01:00
return BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . TabBar . Item , {
2019-11-07 15:58:58 +01:00
className : this . props . itemClassName ,
itemType : this . props . type ,
id : data . value ,
children : data . label || data . value ,
"aria-label" : data . label || data . value
} )
} )
2019-11-08 12:45:11 +01:00
} ) , "itemClassName" , "items" ) ) ;
2019-11-06 14:41:45 +01:00
}
2019-11-12 19:44:00 +01:00
} ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . Table = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.Table" ) || reactInitialized && class BDFDB _Table extends LibraryModules . React . Component {
2019-11-06 14:41:45 +01:00
render ( ) {
2020-02-08 11:14:10 +01:00
return BDFDB . ReactUtils . createElement ( InternalComponents . NativeSubComponents . Table , Object . assign ( { } , this . props , {
2019-11-06 14:41:45 +01:00
className : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . table , this . props . className ) ,
headerClassName : BDFDB . DOMUtils . formatClassName ( this . props . stickyHeader ? BDFDB . disCN . tablestickyheader : BDFDB . disCN . tableheader , this . props . headerClassName ) ,
headerCellClassName : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . tableheadercell , this . props . headerCellClassName ) ,
sortedHeaderCellClassName : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . tableheadercellsorted , this . props . sortedHeaderCellClassName ) ,
bodyCellClassName : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . tablebodycell , this . props . bodyCellClassName ) ,
rowClassName : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . tablerow , this . props . rowClassName ) ,
onSort : ( sortKey , sortDirection ) => {
2020-02-08 11:14:10 +01:00
this . props . sortDirection = this . props . sortKey != sortKey && sortDirection == InternalComponents . LibraryComponents . Table . SortDirection . ASCENDING && this . props . columns . filter ( n => n . key == sortKey ) [ 0 ] . reverse ? InternalComponents . LibraryComponents . Table . SortDirection . DESCENDING : sortDirection ;
2019-11-06 14:41:45 +01:00
this . props . sortKey = sortKey ;
this . props . data = BDFDB . ArrayUtils . keySort ( this . props . data , this . props . sortKey ) ;
2020-02-08 11:14:10 +01:00
if ( this . props . sortDirection == InternalComponents . LibraryComponents . Table . SortDirection . DESCENDING ) this . props . data . reverse ( ) ;
2019-11-06 14:41:45 +01:00
if ( typeof this . props . onSort == "function" ) this . props . onSort ( this . props . sortKey , this . props . sortDirection ) ;
2019-12-18 12:47:20 +01:00
BDFDB . ReactUtils . forceUpdate ( this ) ;
2019-11-06 14:41:45 +01:00
}
} ) ) ;
}
2019-11-12 19:44:00 +01:00
} ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . TextArea = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.TextArea" ) || reactInitialized && class BDFDB _TextArea extends LibraryModules . React . Component {
2019-11-10 17:16:01 +01:00
handleChange ( e ) {
this . props . value = e ;
if ( typeof this . props . onChange == "function" ) this . props . onChange ( e , this ) ;
2019-12-18 12:47:20 +01:00
BDFDB . ReactUtils . forceUpdate ( this ) ;
2019-11-10 17:16:01 +01:00
}
2019-11-10 23:44:01 +01:00
handleBlur ( e ) { if ( typeof this . props . onBlur == "function" ) this . props . onBlur ( e , this ) ; }
handleFocus ( e ) { if ( typeof this . props . onFocus == "function" ) this . props . onFocus ( e , this ) ; }
2019-11-10 17:16:01 +01:00
render ( ) {
2020-02-08 11:14:10 +01:00
return BDFDB . ReactUtils . createElement ( InternalComponents . NativeSubComponents . TextArea , Object . assign ( { } , this . props , {
2019-11-10 17:16:01 +01:00
onChange : this . handleChange . bind ( this ) ,
onBlur : this . handleBlur . bind ( this ) ,
2019-11-10 17:19:49 +01:00
onFocus : this . handleFocus . bind ( this )
} ) ) ;
2019-11-10 17:16:01 +01:00
}
2019-11-12 19:44:00 +01:00
} ;
2019-11-10 17:16:01 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . TextElement = BDFDB . ModuleUtils . findByName ( "Text" ) ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . TextGradientElement = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.TextGradientElement" ) || reactInitialized && class BDFDB _TextGradientElement extends LibraryModules . React . Component {
2019-12-01 17:57:07 +01:00
render ( ) {
if ( this . props . gradient && this . props . children ) return BDFDB . ReactUtils . createElement ( "span" , {
children : this . props . children ,
ref : instance => {
let ele = BDFDB . ReactUtils . findDOMNode ( instance ) ;
if ( ele ) {
ele . style . setProperty ( "background-image" , this . props . gradient , "important" ) ;
ele . style . setProperty ( "color" , "transparent" , "important" ) ;
ele . style . setProperty ( "-webkit-background-clip" , "text" , "important" ) ;
}
}
} ) ;
return this . props . children || null ;
}
} ;
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . TextInput = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.TextInput" ) || reactInitialized && class BDFDB _TextInput extends LibraryModules . React . Component {
2019-11-06 14:41:45 +01:00
handleChange ( e ) {
e = BDFDB . ObjectUtils . is ( e ) ? e . currentTarget . value : e ;
this . props . value = e ;
if ( typeof this . props . onChange == "function" ) this . props . onChange ( e , this ) ;
2019-12-18 12:47:20 +01:00
BDFDB . ReactUtils . forceUpdate ( this ) ;
2019-11-06 14:41:45 +01:00
}
2019-11-10 23:44:01 +01:00
handleInput ( e ) { if ( typeof this . props . onInput == "function" ) this . props . onInput ( BDFDB . ObjectUtils . is ( e ) ? e . currentTarget . value : e , this ) ; }
handleKeyDown ( e ) { if ( typeof this . props . onKeyDown == "function" ) this . props . onKeyDown ( e , this ) ; }
handleBlur ( e ) { if ( typeof this . props . onBlur == "function" ) this . props . onBlur ( e , this ) ; }
handleFocus ( e ) { if ( typeof this . props . onFocus == "function" ) this . props . onFocus ( e , this ) ; }
handleMouseEnter ( e ) { if ( typeof this . props . onMouseEnter == "function" ) this . props . onMouseEnter ( e , this ) ; }
handleMouseLeave ( e ) { if ( typeof this . props . onMouseLeave == "function" ) this . props . onMouseLeave ( e , this ) ; }
2019-11-06 14:41:45 +01:00
handleNumberButton ( ins , value ) {
BDFDB . TimeUtils . clear ( ins . pressedTimeout ) ;
ins . pressedTimeout = BDFDB . TimeUtils . timeout ( _ => {
delete this . props . focused ;
BDFDB . ReactUtils . forceUpdate ( this ) ;
} , 1000 ) ;
this . props . focused = true ;
this . handleChange . bind ( this ) ( value ) ;
this . handleInput . bind ( this ) ( value ) ;
2019-10-19 11:41:39 +02:00
}
2019-11-06 14:41:45 +01:00
componentDidMount ( ) {
let input = BDFDB . ReactUtils . findDOMNode ( this ) ;
if ( ! input ) return ;
input = input . querySelector ( "input" ) || input ;
if ( input && ! input . patched ) {
input . addEventListener ( "keydown" , e => {
this . handleKeyDown . bind ( this ) ( e ) ;
e . stopImmediatePropagation ( ) ;
} ) ;
input . patched = true ;
2019-10-19 11:41:39 +02:00
}
2019-11-10 23:44:01 +01:00
if ( this . props . type == "color" ) {
let swatchinstance = BDFDB . ReactUtils . findOwner ( this , { name : "BDFDB_ColorSwatches" } ) ;
if ( swatchinstance ) swatchinstance . refInput = this ;
}
else if ( this . props . type == "file" ) {
let navigatorinstance = BDFDB . ReactUtils . findOwner ( this , { name : "BDFDB_FileButton" } ) ;
if ( navigatorinstance ) navigatorinstance . refInput = this ;
}
2019-10-19 11:41:39 +02:00
}
2019-11-06 14:41:45 +01:00
render ( ) {
2019-12-18 13:33:44 +01:00
let inputchildren = [
BDFDB . ReactUtils . createElement ( "input" , BDFDB . ObjectUtils . exclude ( Object . assign ( { } , this . props , {
2020-02-08 11:14:10 +01:00
className : BDFDB . DOMUtils . formatClassName ( this . props . size && InternalComponents . LibraryComponents . TextInput . Sizes [ this . props . size . toUpperCase ( ) ] && BDFDB . disCN [ "input" + this . props . size . toLowerCase ( ) ] || BDFDB . disCN . inputdefault , this . props . inputClassName , this . props . focused && BDFDB . disCN . inputfocused , this . props . error || this . props . errorMessage ? BDFDB . disCN . inputerror : ( this . props . success && BDFDB . disCN . inputsuccess ) , this . props . disabled && BDFDB . disCN . inputdisabled , this . props . editable && BDFDB . disCN . inputeditable ) ,
2019-12-18 13:33:44 +01:00
type : this . props . type == "color" || this . props . type == "file" ? "text" : this . props . type ,
onChange : this . handleChange . bind ( this ) ,
onInput : this . handleInput . bind ( this ) ,
onKeyDown : this . handleKeyDown . bind ( this ) ,
onBlur : this . handleBlur . bind ( this ) ,
onFocus : this . handleFocus . bind ( this ) ,
onMouseEnter : this . handleMouseEnter . bind ( this ) ,
onMouseLeave : this . handleMouseLeave . bind ( this ) ,
maxLength : this . props . type == "file" ? false : this . props . maxLength ,
ref : this . props . inputRef
2019-12-18 14:42:01 +01:00
} ) , "errorMessage" , "focused" , "error" , "success" , "inputClassName" , "inputPrefix" , "size" , "editable" , "inputRef" , "style" , "mode" , "filter" , "useFilepath" ) ) ,
2020-02-08 11:14:10 +01:00
this . props . type == "color" ? BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex . Child , {
2020-01-27 12:35:20 +01:00
wrap : true ,
2020-02-08 11:14:10 +01:00
children : BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . ColorSwatches , {
2020-01-27 10:32:22 +01:00
colors : [ ] ,
compMode : this . props . mode == "comp" ,
color : this . props . value && this . props . mode == "comp" ? BDFDB . ColorUtils . convert ( this . props . value . split ( "," ) , "RGB" ) : this . props . value ,
pickerConfig : { gradient : false , alpha : this . props . mode != "comp" }
} )
2019-11-10 23:44:01 +01:00
} ) : null ,
2020-02-08 11:14:10 +01:00
this . props . type == "file" ? BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . FileButton , {
2019-12-18 14:42:01 +01:00
filter : this . props . filter ,
2020-01-16 17:33:59 +01:00
mode : this . props . mode ,
2019-12-18 14:42:01 +01:00
useFilepath : this . props . useFilepath ,
2019-11-10 23:44:01 +01:00
} ) : null
] . filter ( n => n ) ;
2019-12-18 13:33:44 +01:00
return BDFDB . ReactUtils . createElement ( "div" , {
2020-02-08 11:14:10 +01:00
className : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . inputwrapper , this . props . type == "number" && ( this . props . size && InternalComponents . LibraryComponents . TextInput . Sizes [ this . props . size . toUpperCase ( ) ] && BDFDB . disCN [ "inputnumberwrapper" + this . props . size . toLowerCase ( ) ] || BDFDB . disCN . inputnumberwrapperdefault ) , this . props . className ) ,
2019-12-18 13:33:44 +01:00
style : this . props . style ,
2019-12-18 13:17:52 +01:00
children : [
2019-12-18 13:33:44 +01:00
this . props . inputPrefix ? BDFDB . ReactUtils . createElement ( "span" , {
className : BDFDB . disCN . inputprefix
} ) : null ,
this . props . type == "number" ? BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . inputnumberbuttons ,
children : [
BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . inputnumberbuttonup ,
onClick : e => {
2019-12-18 14:42:01 +01:00
let min = parseInt ( this . props . min ) ;
let max = parseInt ( this . props . max ) ;
let newv = parseInt ( this . props . value ) + 1 || min || 0 ;
2019-12-18 13:33:44 +01:00
if ( isNaN ( max ) || ! isNaN ( max ) && newv <= max ) this . handleNumberButton . bind ( this ) ( e . _targetInst , isNaN ( min ) || ! isNaN ( min ) && newv >= min ? newv : min ) ;
}
} ) ,
BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . inputnumberbuttondown ,
onClick : e => {
2019-12-18 14:42:01 +01:00
let min = parseInt ( this . props . min ) ;
let max = parseInt ( this . props . max ) ;
let newv = parseInt ( this . props . value ) - 1 || min || 0 ;
2019-12-18 13:33:44 +01:00
if ( isNaN ( min ) || ! isNaN ( min ) && newv >= min ) this . handleNumberButton . bind ( this ) ( e . _targetInst , isNaN ( max ) || ! isNaN ( max ) && newv <= max ? newv : max ) ;
}
} )
]
} ) : null ,
2020-02-08 11:14:10 +01:00
inputchildren . length == 1 ? inputchildren [ 0 ] : BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex , {
align : InternalComponents . LibraryComponents . Flex . Align . CENTER ,
children : inputchildren . map ( ( child , i ) => i != 0 ? BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Flex . Child , { shrink : 0 , children : child } ) : child )
2019-12-18 13:33:44 +01:00
} ) ,
this . props . errorMessage ? BDFDB . ReactUtils . createElement ( "div" , {
2019-12-18 13:17:52 +01:00
className : BDFDB . disCN . inputerrormessage ,
children : this . props . errorMessage
2019-12-18 13:33:44 +01:00
} ) : null
] . filter ( n => n )
} ) ;
2019-10-19 11:41:39 +02:00
}
2019-11-12 19:44:00 +01:00
} ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . TextScroller = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.TextScroller" ) || reactInitialized && class BDFDB _TextScroller extends LibraryModules . React . Component {
2019-11-06 14:41:45 +01:00
render ( ) {
return BDFDB . ReactUtils . createElement ( "div" , {
2019-11-10 20:18:17 +01:00
className : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . textscroller , this . props . className ) ,
2019-11-06 14:41:45 +01:00
style : Object . assign ( { } , this . props . style , {
position : "relative" ,
display : "block" ,
overflow : "hidden"
} ) ,
ref : instance => {
let ele = BDFDB . ReactUtils . findDOMNode ( instance ) ;
2020-01-05 18:31:12 +01:00
if ( ele && ele . parentElement ) {
2020-01-06 20:12:42 +01:00
let maxwidth = BDFDB . DOMUtils . getInnerWidth ( ele . parentElement ) ;
if ( maxwidth > 50 ) ele . style . setProperty ( "max-width" , ` ${ maxwidth } px ` ) ;
2020-01-05 18:31:12 +01:00
let Animation = new LibraryModules . AnimationUtils . Value ( 0 ) ;
2019-11-06 14:41:45 +01:00
Animation
2020-01-05 18:31:12 +01:00
. interpolate ( { inputRange : [ 0 , 1 ] , outputRange : [ 0 , ( BDFDB . DOMUtils . getRects ( ele . firstElementChild ) . width - BDFDB . DOMUtils . getRects ( ele ) . width ) * - 1 ] } )
. addListener ( v => { ele . firstElementChild . style . setProperty ( "left" , v . value + "px" , "important" ) ; } ) ;
2019-11-06 14:41:45 +01:00
this . scroll = p => {
2020-01-05 18:31:12 +01:00
let w = p + parseFloat ( ele . firstElementChild . style . getPropertyValue ( "left" ) ) / ( BDFDB . DOMUtils . getRects ( ele . firstElementChild ) . width - BDFDB . DOMUtils . getRects ( ele ) . width ) ;
2019-11-06 14:41:45 +01:00
w = isNaN ( w ) || ! isFinite ( w ) ? p : w ;
2020-01-05 18:31:12 +01:00
w *= BDFDB . DOMUtils . getRects ( ele . firstElementChild ) . width / ( BDFDB . DOMUtils . getRects ( ele ) . width * 2 ) ;
2019-11-06 14:41:45 +01:00
LibraryModules . AnimationUtils . parallel ( [ LibraryModules . AnimationUtils . timing ( Animation , { toValue : p , duration : Math . sqrt ( w * * 2 ) * 4000 / ( parseInt ( this . props . speed ) || 1 ) } ) ] ) . start ( ) ;
}
}
} ,
2020-01-07 14:31:05 +01:00
onClick : e => {
if ( typeof this . props . onClick == "function" ) this . props . onClick ( e , this ) ;
} ,
2019-11-06 14:41:45 +01:00
onMouseEnter : e => {
2020-01-05 11:12:24 +01:00
if ( BDFDB . DOMUtils . getRects ( e . currentTarget ) . width < BDFDB . DOMUtils . getRects ( e . currentTarget . firstElementChild ) . width ) {
2019-11-06 14:41:45 +01:00
this . scrolling = true ;
2020-01-05 11:12:24 +01:00
e . currentTarget . firstElementChild . style . setProperty ( "display" , "block" , "important" ) ;
2019-11-06 14:41:45 +01:00
this . scroll ( 1 ) ;
}
} ,
onMouseLeave : e => {
if ( this . scrolling ) {
delete this . scrolling ;
2020-01-05 11:12:24 +01:00
e . currentTarget . firstElementChild . style . setProperty ( "display" , "inline" , "important" ) ;
2019-11-06 14:41:45 +01:00
this . scroll ( 0 ) ;
}
} ,
children : BDFDB . ReactUtils . createElement ( "div" , {
style : {
left : "0" ,
position : "relative" ,
display : "inline" ,
whiteSpace : "nowrap"
} ,
children : this . props . children
} )
} ) ;
}
2019-11-12 19:44:00 +01:00
} ;
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . TooltipContainer = BDFDB . ReactUtils . getValue ( window . BDFDB , "LibraryComponents.TooltipContainer" ) || reactInitialized && class BDFDB _TooltipContainer extends LibraryModules . React . Component {
2019-11-06 14:41:45 +01:00
render ( ) {
let child = ( BDFDB . ArrayUtils . is ( this . props . children ) ? this . props . children [ 0 ] : this . props . children ) || BDFDB . ReactUtils . createElement ( "div" , { } ) ;
child . props . className = BDFDB . DOMUtils . formatClassName ( child . props . className , this . props . className ) ;
let childMouseEnter = child . props . onMouseEnter , childMouseLeave = child . props . onMouseLeave , childClick = child . props . onClick , childContextMenu = child . props . onContextMenu ;
2019-11-06 22:33:27 +01:00
let shown = false ;
2019-11-06 14:41:45 +01:00
child . props . onMouseEnter = ( e , childthis ) => {
2019-11-06 22:33:27 +01:00
if ( ! shown ) {
shown = true ;
BDFDB . TooltipUtils . create ( e . currentTarget , this . props . text , Object . assign ( { } , this . props . tooltipConfig ) ) ;
if ( typeof this . props . onMouseEnter == "function" ) this . props . onMouseEnter ( e , this ) ;
if ( typeof childMouseEnter == "function" ) childMouseEnter ( e , childthis ) ;
}
2019-11-06 14:41:45 +01:00
} ;
child . props . onMouseLeave = ( e , childthis ) => {
2019-11-06 22:33:27 +01:00
shown = false ;
2019-11-06 14:41:45 +01:00
if ( typeof this . props . onMouseLeave == "function" ) this . props . onMouseLeave ( e , this ) ;
2019-11-13 13:44:05 +01:00
if ( typeof childMouseLeave == "function" ) childMouseLeave ( e , childthis ) ;
2019-11-06 14:41:45 +01:00
} ;
child . props . onClick = ( e , childthis ) => {
if ( typeof this . props . onClick == "function" ) this . props . onClick ( e , this ) ;
if ( typeof childClick == "function" ) childClick ( e , childthis ) ;
} ;
child . props . onContextMenu = ( e , childthis ) => {
if ( typeof this . props . onContextMenu == "function" ) this . props . onContextMenu ( e , this ) ;
if ( typeof childContextMenu == "function" ) childContextMenu ( e , childthis ) ;
} ;
return BDFDB . ReactUtils . createElement ( LibraryModules . React . Fragment , {
children : child
} ) ;
}
2019-11-12 19:44:00 +01:00
} ;
2019-11-06 14:41:45 +01:00
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . UserSummaryItem = BDFDB . ModuleUtils . findByName ( "UserSummaryItem" ) ;
2019-11-24 11:13:45 +01:00
2020-02-08 11:14:10 +01:00
for ( let type in InternalComponents . NativeSubComponents ) if ( InternalComponents . LibraryComponents [ type ] ) for ( let key in InternalComponents . NativeSubComponents [ type ] ) if ( key != "displayName" && key != "name" && ( typeof InternalComponents . NativeSubComponents [ type ] [ key ] != "function" || key . charAt ( 0 ) == key . charAt ( 0 ) . toUpperCase ( ) ) ) InternalComponents . LibraryComponents [ type ] [ key ] = InternalComponents . NativeSubComponents [ type ] [ key ] ;
BDFDB . LibraryComponents = Object . assign ( { } , InternalComponents . LibraryComponents ) ;
2019-10-18 10:56:41 +02:00
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . appendLocalStyle ( "BDFDB" , `
2020-02-03 13:42:32 +01:00
@ import url ( https : //mwittrien.github.io/BetterDiscordAddons/Themes/SupporterBadge.css);
2019-11-22 15:05:45 +01:00
$ { BDFDB . dotCN . changelogicon } {
2019-11-07 15:13:41 +01:00
display : inline - block ;
background : currentColor ;
- webkit - mask : url ( 'data:image/svg+xml; utf8, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 510 510"><path fill="currentColor" d="M267.75,12.75c-89.25,0-168.3,48.45-209.1,122.4L0,76.5v165.75h165.75 l-71.4-71.4c33.15-63.75,96.9-107.1,173.4-107.1C372.3,63.75,459,150.45,459,255s-86.7,191.25-191.25,191.25 c-84.15,0-153-53.55-181.05-127.5H33.15c28.05,102,122.4,178.5,234.6,178.5C402.9,497.25,510,387.6,510,255 C510,122.4,400.35,12.75,267.75,12.75z M229.5,140.25V270.3l119.85,71.4l20.4-33.15l-102-61.2v-107.1H229.5z"></path></svg>' ) center / contain no - repeat ;
cursor : pointer ;
margin : 0 4 px 0 3 px ;
}
2020-01-17 14:14:01 +01:00
$ { BDFDB . dotCN . loadingiconwrapper } {
position : absolute ;
bottom : 0 ;
right : 0 ;
z - index : 1000 ;
animation : loadingwrapper - fade 3 s infinite ease ;
}
$ { BDFDB . dotCNS . loadingiconwrapper + BDFDB . dotCN . loadingicon } {
margin : 0 5 px ;
}
@ keyframes loadingwrapper - fade {
from { opacity : 0.1 ; }
50 % { opacity : 0.9 ; }
to { opacity : 0.1 ; }
}
2019-11-02 01:35:16 +01:00
$ { BDFDB . dotCN . settingspanelinner } {
padding - left : 15 px ;
padding - right : 5 px ;
}
$ { BDFDB . dotCN . settingspanellist } {
padding - left : 15 px ;
}
2019-12-18 16:15:33 +01:00
$ { BDFDB . dotCN . collapsecontainer } {
margin - bottom : 20 px ;
}
$ { BDFDB . dotCN . collapsecontainermini } {
margin - bottom : 8 px ;
}
2019-11-02 01:35:16 +01:00
$ { BDFDB . dotCN . collapsecontainerinner } {
padding - left : 15 px ;
}
$ { BDFDB . dotCNS . settingspanelinner + BDFDB . dotCN . collapsecontainerheader } {
margin - left : - 16 px ;
}
$ { BDFDB . dotCN . collapsecontainerarrow } {
background : url ( data : image / svg + xml ; base64 , PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxOS4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iQ2FscXVlXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSItOTUwIDUzMiAxOCAxOCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAtOTUwIDUzMiAxOCAxODsiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4NCgkuc3Qwe2ZpbGw6bm9uZTt9DQoJLnN0MXtmaWxsOm5vbmU7c3Ryb2tlOiNGRkZGRkY7c3Ryb2tlLXdpZHRoOjEuNTtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTS05MzIsNTMydjE4aC0xOHYtMThILTkzMnoiLz4NCjxwb2x5bGluZSBjbGFzcz0ic3QxIiBwb2ludHM9Ii05MzYuNiw1MzguOCAtOTQxLDU0My4yIC05NDUuNCw1MzguOCAiLz4NCjwvc3ZnPg0K ) center / cover no - repeat ;
height : 16 px ;
width : 16 px ;
transition : transform . 3 s ease ;
transform : rotate ( 0 ) ;
}
$ { BDFDB . dotCNS . collapsecontainercollapsed + BDFDB . dotCN . collapsecontainerarrow } {
transform : rotate ( - 90 deg ) ;
}
2019-10-18 10:56:41 +02:00
$ { BDFDB . dotCN . overflowellipsis } {
overflow : hidden ;
text - overflow : ellipsis ;
}
2019-11-12 20:08:45 +01:00
$ { BDFDB . dotCN . underline } {
text - decoration : underline ;
}
$ { BDFDB . dotCN . linethrough } {
text - decoration : line - through ;
}
2019-10-18 10:56:41 +02:00
2020-02-03 15:39:16 +01:00
$ { BDFDB . dotCN . avatarwrapper + BDFDB . dotCN . messageavatar } {
overflow : visible ;
border - radius : 0 ;
}
2019-10-24 00:07:15 +02:00
$ { BDFDB . dotCN . favbuttoncontainer } {
2019-10-28 08:54:57 +01:00
display : flex ;
position : relative ;
2019-10-24 00:07:15 +02:00
}
2019-10-24 09:49:22 +02:00
$ { BDFDB . dotCN . cursordefault } {
cursor : default ! important ;
}
$ { BDFDB . dotCN . cursorpointer } {
cursor : pointer ! important ;
}
2019-10-24 00:07:15 +02:00
2019-11-15 21:48:30 +01:00
$ { BDFDB . dotCNS . selectwrapper + BDFDB . dotCN . selectwrap } {
2019-11-15 13:14:49 +01:00
flex : 1 1 auto ;
}
2019-11-15 21:48:30 +01:00
$ { BDFDB . dotCN . selectwrapper } [ class *= "css-" ] [ class *= "-container" ] > [ class *= "css-" ] [ class *= "-menu" ] {
2019-10-24 00:07:15 +02:00
z - index : 3 ;
2019-10-23 17:17:45 +02:00
}
2019-10-24 15:54:18 +02:00
2019-11-15 21:48:30 +01:00
$ { BDFDB . dotCNS . hotkeywrapper + BDFDB . dotCN . hotkeycontainer } {
flex : 1 1 auto ;
}
$ { BDFDB . dotCN . hotkeyresetbutton } {
cursor : pointer ;
margin - left : 5 px ;
}
$ { BDFDB . dotCNS . hotkeyresetbutton + BDFDB . dotCN . svgicon } : hover {
color : $ { BDFDB . DiscordConstants . Colors . STATUS _RED } ;
}
2020-01-17 22:03:45 +01:00
$ { BDFDB . dotCNC . hovercardwrapper + BDFDB . dotCN . hovercardinner } {
min - height : 28 px ;
}
$ { BDFDB . dotCN . hovercardinner } {
width : 100 % ;
padding - right : 5 px ;
display : flex ;
align - items : center ;
z - index : 1 ;
}
2019-10-24 15:54:18 +02:00
$ { BDFDB . dotCNS . hovercardwrapper + BDFDB . dotCN . hovercardbutton } {
position : absolute ;
2019-12-18 19:32:01 +01:00
top : - 6 px ;
right : - 6 px ;
2019-10-24 15:54:18 +02:00
opacity : 0 ;
}
2020-01-17 22:03:45 +01:00
$ { BDFDB . dotCN . hovercardwrapper + BDFDB . dotCNS . hovercard + BDFDB . dotCN . hovercardbutton } {
right : - 25 px ;
2019-10-24 15:54:18 +02:00
}
$ { BDFDB . dotCN . hovercardwrapper } : hover $ { BDFDB . dotCN . hovercardbutton } {
opacity : 1 ;
}
2019-11-04 12:00:45 +01:00
$ { BDFDB . dotCN . table } {
width : 100 % ;
}
$ { BDFDB . dotCN . tableheader } {
2019-11-04 12:11:44 +01:00
padding : 0 px 12 px 8 px 0 ;
2019-11-04 12:59:47 +01:00
margin - bottom : 5 px ;
2019-11-04 12:00:45 +01:00
font - size : 12 px ;
font - weight : 600 ;
box - sizing : border - box ;
background - color : var ( -- background - primary ) ;
border - bottom : 1 px solid var ( -- background - modifier - accent ) ;
}
2019-11-04 12:30:26 +01:00
$ { BDFDB . dotCN . tablestickyheader } : first - child {
2019-11-04 12:00:45 +01:00
position : absolute ;
2019-11-04 20:36:17 +01:00
width : 100 % ;
2019-11-04 12:00:45 +01:00
}
2019-11-04 12:30:26 +01:00
$ { BDFDB . dotCNS . modalsubinner + BDFDB . dotCN . tablestickyheader } : first - child {
padding - left : 20 px ;
}
2019-11-04 12:00:45 +01:00
$ { BDFDB . dotCN . tableheadercell } {
text - transform : uppercase ;
2019-11-04 12:30:26 +01:00
color : var ( -- interactive - normal ) ;
}
$ { BDFDB . dotCN . tableheadercell } ,
$ { BDFDB . dotCN . tablebodycell } {
2019-11-04 12:00:45 +01:00
border - left : 1 px solid var ( -- background - modifier - accent ) ;
box - sizing : border - box ;
padding : 0 12 px ;
}
2019-11-04 12:30:26 +01:00
$ { BDFDB . dotCN . tableheadercell } : first - child ,
$ { BDFDB . dotCN . tablebodycell } : first - child {
2019-11-04 12:00:45 +01:00
border - left : none ;
padding - left : 0 ;
}
$ { BDFDB . dotCN . tableheadercellsorted } ,
$ { BDFDB . dotCN . tableheadercellsorted } : hover {
color : var ( -- interactive - active ) ;
}
2019-11-04 17:28:58 +01:00
$ { BDFDB . dotCN . tableheadersorticon } {
width : 18 px ;
height : 18 px ;
margin - left : 4 px ;
}
2019-11-04 12:00:45 +01:00
$ { BDFDB . dotCN . tablerow } {
position : relative ;
display : flex ;
2019-11-04 12:59:47 +01:00
margin - bottom : 5 px ;
2019-11-04 12:00:45 +01:00
align - items : center ;
color : var ( -- header - secondary ) ;
}
2019-11-04 12:59:47 +01:00
$ { BDFDB . dotCN . tablebodycell } {
font - size : 15 px ;
}
2019-11-04 12:00:45 +01:00
2019-12-18 19:32:01 +01:00
$ { BDFDB . dotCNS . settingstablelist + BDFDB . dotCN . checkboxcontainer } : before {
display : none ;
}
2020-01-22 14:20:47 +01:00
$ { BDFDB . dotCNS . settingstablelist + BDFDB . dotCN . settingstableheader } {
min - height : 10 px ;
}
$ { BDFDB . dotCNS . settingstablelist + BDFDB . dotCN . settingstableheaderoption } {
width : unset ;
}
2020-01-22 13:54:03 +01:00
$ { BDFDB . dotCN . settingstableheadervertical } {
position : relative ;
}
$ { BDFDB . dotCN . settingstableheadervertical } > span {
position : absolute ;
bottom : 50 % ;
2020-01-22 14:20:47 +01:00
right : calc ( 50 % - 5 px ) ;
2020-01-22 13:54:03 +01:00
margin - bottom : - 5 px ;
writing - mode : vertical - rl ;
}
2019-12-18 19:32:01 +01:00
$ { BDFDB . dotCN . settingstablecard } {
height : 60 px ;
2020-01-22 10:56:02 +01:00
padding : 0 10 px ;
2019-12-18 19:32:01 +01:00
margin - bottom : 10 px ;
}
2020-01-22 10:56:02 +01:00
$ { BDFDB . dotCNS . settingstablecard + BDFDB . dotCN . settingstablecardlabel } {
padding - right : 10 px ;
}
$ { BDFDB . dotCNS . settingstablecard + BDFDB . dotCN . settingstablecardlabel } ,
$ { BDFDB . dotCNS . settingstablecard + BDFDB . dotCN . settingstablecardconfigs } {
margin : 0 ;
}
2020-01-22 10:33:41 +01:00
$ { BDFDB . dotCN . settingstableheaders } {
margin - right : 10 px ;
}
2019-12-18 19:32:01 +01:00
2019-11-09 13:15:38 +01:00
$ { BDFDB . dotCNS . themelight + BDFDB . dotCN . quickselectpopoutwrapper } ,
$ { BDFDB . dotCNS . themedark + BDFDB . dotCN . quickselectpopoutwrapper } {
2019-11-06 12:52:14 +01:00
border - radius : 4 px ;
padding : 6 px 8 px ;
cursor : default ;
background - color : var ( -- background - floating ) ;
box - sizing : border - box ;
box - shadow : var ( -- elevation - high ) ;
}
2019-11-09 13:15:38 +01:00
$ { BDFDB . dotCNS . quickselectpopoutwrapper + BDFDB . dotCN . quickselectpopoutoption } {
2019-11-06 12:52:14 +01:00
white - space : nowrap ;
text - overflow : ellipsis ;
overflow : hidden ;
align - items : center ;
position : relative ;
font - weight : 500 ;
box - sizing : border - box ;
margin - top : 2 px ;
margin - bottom : 2 px ;
padding : 0 8 px ;
font - size : 14 px ;
line - height : 18 px ;
min - height : 32 px ;
border - radius : 2 px ;
color : var ( -- interactive - normal ) ;
}
2019-11-09 13:15:38 +01:00
$ { BDFDB . dotCNS . quickselectpopoutwrapper + BDFDB . dotCN . quickselectpopoutoption } : hover {
2019-11-06 12:52:14 +01:00
color : var ( -- interactive - hover ) ;
background - color : var ( -- background - modifier - hover ) ;
}
2019-11-09 13:15:38 +01:00
$ { BDFDB . dotCNS . quickselectpopoutwrapper + BDFDB . dotCN . quickselectpopoutoption + BDFDB . dotCN . quickselectpopoutoptionselected } {
2019-11-06 14:31:16 +01:00
color : var ( -- interactive - active ) ;
background - color : var ( -- background - modifier - selected ) ;
}
2019-11-06 12:52:14 +01:00
2019-10-30 14:57:15 +01:00
$ { BDFDB . dotCN . charcounter } {
color : var ( -- channels - default ) ;
}
2019-10-28 08:54:57 +01:00
$ { BDFDB . dotCN . inputnumberwrapper } {
position : relative ;
}
2019-10-28 10:31:04 +01:00
$ { BDFDB . dotCN . inputnumberbuttons } : hover + $ { BDFDB . dotCN . input + BDFDB . notCN . inputfocused + BDFDB . notCN . inputerror + BDFDB . notCN . inputsuccess + BDFDB . notCN . inputdisabled } : not ( : focus ) {
2019-10-28 09:25:12 +01:00
border - color : # 040405 ;
2019-10-25 16:26:49 +02:00
}
2019-10-28 08:54:57 +01:00
$ { BDFDB . dotCNS . inputnumberwrapperdefault + BDFDB . dotCN . input } {
2019-10-25 16:26:49 +02:00
padding - right : 25 px ;
}
2019-10-28 08:54:57 +01:00
$ { BDFDB . dotCNS . inputnumberwrappermini + BDFDB . dotCN . input } {
2019-10-25 16:26:49 +02:00
padding - left : 6 px ;
padding - right : 17 px ;
}
$ { BDFDB . dotCNS . inputnumberwrapper + BDFDB . dotCN . input } : : - webkit - inner - spin - button ,
$ { BDFDB . dotCNS . inputnumberwrapper + BDFDB . dotCN . input } : : - webkit - outer - spin - button {
- webkit - appearance : none ! important ;
}
2019-10-28 08:54:57 +01:00
$ { BDFDB . dotCN . inputnumberbuttons } {
2019-10-25 16:26:49 +02:00
position : absolute ;
display : flex ;
flex - direction : column ;
align - items : center ;
justify - content : space - around ;
height : 110 % ;
2019-10-28 09:25:12 +01:00
top : - 2 % ;
2019-10-25 16:26:49 +02:00
}
2019-10-28 08:54:57 +01:00
$ { BDFDB . dotCNS . inputnumberwrapperdefault + BDFDB . dotCN . inputnumberbuttons } {
right : 8 px ;
}
$ { BDFDB . dotCNS . inputnumberwrappermini + BDFDB . dotCN . inputnumberbuttons } {
2019-10-25 16:26:49 +02:00
right : 4 px ;
}
2019-10-28 08:54:57 +01:00
$ { BDFDB . dotCN . inputnumberbutton } {
2019-10-25 16:26:49 +02:00
cursor : pointer ;
border : transparent solid 5 px ;
border - top - width : 2.5 px ;
display : inline - block ;
}
2019-10-28 08:54:57 +01:00
$ { BDFDB . dotCNS . themelight + BDFDB . dotCN . inputnumberbutton } {
2019-10-25 16:26:49 +02:00
border - bottom - color : # dcddde ;
}
2019-10-28 08:54:57 +01:00
$ { BDFDB . dotCNS . themelight + BDFDB . dotCN . inputnumberbutton } : hover {
2019-10-25 16:26:49 +02:00
border - bottom - color : # 4 f545c ;
}
2019-10-28 08:54:57 +01:00
$ { BDFDB . dotCNS . themedark + BDFDB . dotCN . inputnumberbutton } {
2019-10-25 16:26:49 +02:00
border - bottom - color : # 72767 d ;
}
2019-10-28 08:54:57 +01:00
$ { BDFDB . dotCNS . themedark + BDFDB . dotCN . inputnumberbutton } : hover {
2019-10-25 16:26:49 +02:00
border - bottom - color : # f6f6f7 ;
}
2019-10-28 08:54:57 +01:00
$ { BDFDB . dotCN . inputnumberbuttondown } {
2019-10-25 16:26:49 +02:00
transform : rotate ( 180 deg ) ;
}
2019-11-10 23:44:01 +01:00
$ { BDFDB . dotCN . colorpickerswatches + BDFDB . dotCN . colorpickerswatchesdisabled } {
cursor : no - drop ;
filter : grayscale ( 70 % ) brightness ( 50 % ) ;
}
$ { BDFDB . dotCN . colorpickerswatchsingle } {
height : 30 px ;
width : 30 px ;
}
2019-11-26 00:29:19 +01:00
$ { BDFDB . dotCN . guildupperleftbadge } {
top : 0 ;
}
$ { BDFDB . dotCN . guildlowerleftbadge } {
bottom : 0 ;
}
$ { BDFDB . dotCNC . guildlowerleftbadge + BDFDB . dotCN . guildupperleftbadge } {
pointer - events : none ;
position : absolute ;
left : 0 ;
}
2019-11-06 22:11:43 +01:00
$ { BDFDB . dotCN . svgicon } {
color : var ( -- interactive - normal ) ;
}
$ { BDFDB . dotCN . svgicon } : hover {
color : var ( -- interactive - hover ) ;
}
$ { BDFDB . dotCN . svgicon } : active {
color : var ( -- interactive - active ) ;
}
2019-11-07 15:29:15 +01:00
2019-11-10 18:32:44 +01:00
$ { BDFDB . dotCN . modalsubinnerscrollerless } {
padding - bottom : 10 px ;
overflow : visible ;
}
2019-11-12 19:26:46 +01:00
$ { BDFDB . dotCN . modaltabcontent } {
margin - top : 10 px ;
}
2019-11-12 20:39:10 +01:00
$ { BDFDB . dotCNS . listscroller + BDFDB . dotCN . modaltabcontent } {
margin - top : 0 ;
}
2019-11-07 16:08:13 +01:00
$ { BDFDB . dotCNS . modalwrapper + BDFDB . dotCN . modalheader + BDFDB . dotCN . modalheaderhassibling } {
padding - bottom : 10 px ;
}
$ { BDFDB . dotCNS . modalwrapper + BDFDB . dotCN . tabbarcontainer } {
background : rgba ( 0 , 0 , 0 , 0.1 ) ;
2019-11-12 19:26:46 +01:00
border : none ;
2019-11-07 16:08:13 +01:00
box - shadow : 0 2 px 3 px 0 rgba ( 0 , 0 , 0 , 0.05 ) ;
}
$ { BDFDB . dotCNS . themedark + BDFDB . dotCNS . modalwrapper + BDFDB . dotCN . tabbarcontainer } {
background : rgba ( 0 , 0 , 0 , 0.2 ) ;
box - shadow : 0 2 px 3 px 0 rgba ( 0 , 0 , 0 , 0.1 ) ;
}
2020-01-30 17:53:13 +01:00
$ { BDFDB . dotCN . popoutthemedpopout } {
background - color : # fff ;
border : 1 px solid hsla ( 0 , 0 % , 74.9 % , . 3 ) ;
- webkit - box - shadow : 0 2 px 10 px 0 rgba ( 0 , 0 , 0 , . 1 ) ;
box - shadow : 0 2 px 10 px 0 rgba ( 0 , 0 , 0 , . 1 ) ;
- webkit - box - sizing : border - box ;
box - sizing : border - box ;
border - radius : 5 px ;
display : - webkit - box ;
display : - ms - flexbox ;
display : flex ;
- webkit - box - orient : vertical ;
- webkit - box - direction : normal ;
- ms - flex - direction : column ;
flex - direction : column ;
}
$ { BDFDB . dotCNS . themedark + BDFDB . dotCN . popoutthemedpopout } {
2019-11-07 15:13:41 +01:00
background - color : # 2 f3136 ;
border : 1 px solid rgba ( 28 , 36 , 43 , . 6 ) ;
2020-01-30 17:53:13 +01:00
- webkit - box - shadow : 0 2 px 10 px 0 rgba ( 0 , 0 , 0 , 20 % ) ;
2019-11-07 15:13:41 +01:00
box - shadow : 0 2 px 10 px 0 rgba ( 0 , 0 , 0 , . 2 ) ;
}
2019-10-23 17:17:45 +02:00
2019-11-11 09:16:30 +01:00
# bd - settingspane - container . ui - form - title {
display : inline - block ;
2019-10-18 10:56:41 +02:00
}
2019-11-11 09:16:30 +01:00
# bd - settingspane - container $ { BDFDB . dotCN . _repofolderbutton } {
position : static ;
margin - bottom : 0 ;
border - radius : 5 px ;
display : inline - block ;
margin - left : 10 px ;
2019-10-18 10:56:41 +02:00
}
2020-02-03 11:16:36 +01:00
# bd - settingspane - container $ { BDFDB . dotCN . _repoupdatebutton } [ style ] {
2019-11-11 09:16:30 +01:00
display : none ! important ;
2019-10-18 10:56:41 +02:00
}
2020-02-03 11:16:36 +01:00
# bd - settingspane - container $ { BDFDB . dotCNS . _repolist + BDFDB . dotCN . _repofooter } button + button {
margin - left : 10 px ;
}
2019-11-07 16:08:13 +01:00
2019-11-28 12:34:57 +01:00
$ { BDFDB . dotCN . noticewrapper } {
transition : height 0.5 s ease ! important ;
border - radius : 0 ! important ;
}
$ { BDFDB . dotCNS . noticewrapper + BDFDB . dotCN . noticeplatformicon } {
margin - top : - 7 px ;
}
$ { BDFDB . dotCNS . noticewrapper + BDFDB . dotCN . noticeplatformicon } svg {
max - height : 28 px ;
}
2019-11-22 15:14:32 +01:00
$ { BDFDB . dotCN . noticesurvey } {
background - color : # 222 ;
}
2019-11-28 11:24:46 +01:00
$ { BDFDB . dotCN . tooltip + BDFDB . dotCNS . tooltipcustom + BDFDB . dotCN . tooltippointer } {
border - top - color : inherit ! important ;
}
2020-01-14 15:08:18 +01:00
$ { BDFDB . dotCNC . layermodallarge + BDFDB . dotCN . modalsizelarge } {
2019-11-22 15:14:32 +01:00
max - height : 95 vh ;
}
@ media only screen and ( max - height : 900 px ) {
$ { BDFDB . dotCNC . layermodalmedium + BDFDB . dotCN . modalsizemedium } {
max - height : 75 vh ;
}
}
2019-11-11 09:16:30 +01:00
/*OLD*/
2019-11-07 16:08:13 +01:00
. BDFDB - modal $ { BDFDB . dotCN . modalheader + BDFDB . dotCN . modalheaderhassibling } {
padding - bottom : 10 px ;
}
. BDFDB - modal $ { BDFDB . dotCN . tabbarcontainer } {
background : rgba ( 0 , 0 , 0 , 0.1 ) ;
border : none ! important ;
box - shadow : 0 2 px 3 px 0 rgba ( 0 , 0 , 0 , 0.05 ) ;
}
$ { BDFDB . dotCN . themedark } . BDFDB - modal $ { BDFDB . dotCN . tabbarcontainer } {
background : rgba ( 0 , 0 , 0 , 0.2 ) ;
box - shadow : 0 2 px 3 px 0 rgba ( 0 , 0 , 0 , 0.1 ) ;
}
2019-11-11 09:16:30 +01:00
2019-10-18 10:56:41 +02:00
# pluginNotice # outdatedPlugins span {
- webkit - app - region : no - drag ;
color : # FFF ;
cursor : pointer ;
}
# pluginNotice # outdatedPlugins span : hover {
text - decoration : underline ;
}
. BDFDB - itemlayercontainer , . BDFDB - itemlayer {
z - index : 3002 ;
}
. toasts {
position : fixed ;
display : flex ;
top : 0 ;
flex - direction : column ;
align - items : center ;
justify - content : flex - end ;
pointer - events : none ;
z - index : 4000 ;
}
@ keyframes toast - up {
from {
transform : translateY ( 0 ) ;
opacity : 0 ;
}
}
. toast {
animation : toast - up 300 ms ease ;
transform : translateY ( - 10 px ) ;
background - color : # 36393 F ;
padding : 10 px ;
border - radius : 5 px ;
box - shadow : 0 0 0 1 px rgba ( 32 , 34 , 37 , . 6 ) , 0 2 px 10 px 0 rgba ( 0 , 0 , 0 , . 2 ) ;
font - weight : 500 ;
color : # fff ;
user - select : text ;
font - size : 14 px ;
opacity : 1 ;
margin - top : 10 px ;
pointer - events : auto ;
}
@ keyframes toast - down {
to {
transform : translateY ( 0 px ) ;
opacity : 0 ;
}
}
. toast . closing {
animation : toast - down 200 ms ease ;
animation - fill - mode : forwards ;
opacity : 1 ;
transform : translateY ( - 10 px ) ;
}
. toast . toast - inner {
display : flex ;
align - items : center ;
}
. toast . toast - avatar {
margin - right : 5 px ;
width : 25 px ;
height : 25 px ;
background - size : cover ;
background - position : center ;
border - radius : 50 % ;
}
. toast . icon {
padding - left : 30 px ;
background - position : 6 px 50 % ;
background - size : 20 px 20 px ;
background - repeat : no - repeat ;
}
. toast . toast - brand {
background - color : # 7289 DA ;
}
. toast . toast - brand . icon {
background - image : url ( data : image / svg + xml ; base64 , PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIHhtbDpzcGFjZT0icHJlc2VydmUiIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iNTEycHgiIGhlaWdodD0iNTEycHgiIHZpZXdCb3g9IjI3IDI3IDExNSAxMTUiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDkwIDkwOyI + PHBhdGggZmlsbD0id2hpdGUiIGQ9Ik0xMTEuMywxMjQuMWMwLDAtMy40LTQuMS02LjMtNy43YzEyLjYtMy41LDE3LjQtMTEuMywxNy40LTExLjMgYy00LDIuNi03LjcsNC40LTExLjEsNS42Yy00LjgsMi05LjUsMy4zLTE0LDQuMWMtOS4yLDEuNy0xNy42LDEuMy0yNC45LTAuMWMtNS41LTEtMTAuMi0yLjUtMTQuMS00LjFjLTIuMi0wLjgtNC42LTEuOS03LjEtMy4zIGMtMC4zLTAuMi0wLjYtMC4zLTAuOS0wLjVjLTAuMS0wLjEtMC4zLTAuMi0wLjQtMC4yYy0xLjctMS0yLjYtMS42LTIuNi0xLjZzNC42LDcuNiwxNi44LDExLjJjLTIuOSwzLjYtNi40LDcuOS02LjQsNy45IGMtMjEuMi0wLjYtMjkuMy0xNC41LTI5LjMtMTQuNWMwLTMwLjYsMTMuOC01NS40LDEzLjgtNTUuNGMxMy44LTEwLjMsMjYuOS0xMCwyNi45LTEwbDEsMS4xQzUyLjgsNTAuMyw0NSw1Ny45LDQ1LDU3LjkgczIuMS0xLjIsNS43LTIuN2MxMC4zLTQuNSwxOC40LTUuNywyMS44LTZjMC41LTAuMSwxLjEtMC4yLDEuNi0wLjJjNS45LTAuNywxMi41LTAuOSwxOS40LTAuMmM5LjEsMSwxOC45LDMuNywyOC45LDkuMSBjMCwwLTcuNS03LjItMjMuOS0xMi4xbDEuMy0xLjVjMCwwLDEzLjEtMC4zLDI2LjksMTBjMCwwLDEzLjgsMjQuOCwxMy44LDU1LjRDMTQwLjYsMTA5LjYsMTMyLjUsMTIzLjUsMTExLjMsMTI0LjF6IE0xMDEuNyw3OS43Yy01LjQsMC05LjgsNC43LTkuOCwxMC41YzAsNS44LDQuNCwxMC41LDkuOCwxMC41YzUuNCwwLDkuOC00LjcsOS44LTEwLjUgQzExMS41LDg0LjQsMTA3LjEsNzkuNywxMDEuNyw3OS43eiBNNjYuNyw3OS43Yy01LjQsMC05LjgsNC43LTkuOCwxMC41YzAsNS44LDQuNCwxMC41LDkuOCwxMC41YzUuNCwwLDkuOC00LjcsOS44LTEwLjUgQzc2LjUsODQuNCw3Mi4xLDc5LjcsNjYuNyw3OS43eiIvPjwvc3ZnPg == ) ;
}
. toast . toast - danger ,
. toast . toast - error {
background - color : # F04747 ;
}
. toast . toast - danger . icon ,
. toast . toast - error . icon {
background - image : url ( data : image / svg + xml ; base64 , PHN2ZyBmaWxsPSIjRkZGRkZGIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTEyIDJDNi40NyAyIDIgNi40NyAyIDEyczQuNDcgMTAgMTAgMTAgMTAtNC40NyAxMC0xMFMxNy41MyAyIDEyIDJ6bTUgMTMuNTlMMTUuNTkgMTcgMTIgMTMuNDEgOC40MSAxNyA3IDE1LjU5IDEwLjU5IDEyIDcgOC40MSA4LjQxIDcgMTIgMTAuNTkgMTUuNTkgNyAxNyA4LjQxIDEzLjQxIDEyIDE3IDE1LjU5eiIvPiAgICA8cGF0aCBkPSJNMCAwaDI0djI0SDB6IiBmaWxsPSJub25lIi8 + PC9zdmc + ) ;
}
. toast . toast - default {
background - color : # F26522 ;
}
. toast . toast - default . icon {
padding - left : 10 px ;
}
. toast . toast - facebook {
background - color : # 355089 ;
}
. toast . toast - facebook . icon {
background - image : url ( data : image / svg + xml ; base64 , PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIGlkPSJDYXBhXzEiIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iNTEycHgiIGhlaWdodD0iNTEycHgiIHZpZXdCb3g9Ii01IC01IDEwMCAxMDAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDkwIDkwOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI + PGc + PHBhdGggaWQ9IkZhY2Vib29rX194MjhfYWx0X3gyOV8iIGQ9Ik05MCwxNS4wMDFDOTAsNy4xMTksODIuODg0LDAsNzUsMEgxNUM3LjExNiwwLDAsNy4xMTksMCwxNS4wMDF2NTkuOTk4ICAgQzAsODIuODgxLDcuMTE2LDkwLDE1LjAwMSw5MEg0NVY1NkgzNFY0MWgxMXYtNS44NDRDNDUsMjUuMDc3LDUyLjU2OCwxNiw2MS44NzUsMTZINzR2MTVINjEuODc1QzYwLjU0OCwzMSw1OSwzMi42MTEsNTksMzUuMDI0VjQxICAgaDE1djE1SDU5djM0aDE2YzcuODg0LDAsMTUtNy4xMTksMTUtMTUuMDAxVjE1LjAwMXoiIGZpbGw9IndoaXRlIi8 + PC9nPjxnPjwvZz48Zz48L2c + PGc + PC9nPjxnPjwvZz48Zz48L2c + PGc + PC9nPjxnPjwvZz48Zz48L2c + PGc + PC9nPjxnPjwvZz48Zz48L2c + PGc + PC9nPjxnPjwvZz48Zz48L2c + PGc + PC9nPjwvc3ZnPg == ) ;
}
. toast . toast - info {
background - color : # 4 A90E2 ;
}
. toast . toast - info . icon {
background - image : url ( data : image / svg + xml ; base64 , PHN2ZyBmaWxsPSIjRkZGRkZGIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPiAgICA8cGF0aCBkPSJNMTIgMkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptMSAxNWgtMnYtNmgydjZ6bTAtOGgtMlY3aDJ2MnoiLz48L3N2Zz4 = ) ;
}
. toast . toast - premium {
background - color : # 202225 ;
}
. toast . toast - premium . icon {
background - image : url ( data : image / svg + xml ; base64 , PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDMiIGhlaWdodD0iMjYiPiAgPHBhdGggZmlsbD0iI0ZGRiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNOTYuMjgyNiA4LjYwMjc4ODI0bC0xLjIxNTUgOC4zOTAzNTI5NmMtLjI3NzUgMS45ODI2Mjc0LTIuNDY1NSAyLjkwMzMzMzMtNC40NzkgMi45MDMzMzMzLTEuODc1IDAtMy43MTU1LS45MjA3MDU5LTMuNDcyNS0yLjcyNTkyMTZsMS4yMTU1LTguNTY3NzY0NjZjLjI3NzUtMS44NzY1ODgyNCAyLjQ2NTUtMi44MzI0NzA2IDQuNDc5LTIuODMyNDcwNiAyLjAxNCAwIDMuNzUuOTU1ODgyMzYgMy40NzI1IDIuODMyNDcwNk05My43NzIxLjAwMzkyNTVsLjAwMDUtLjAwNDA3ODQ0aC0xMy4wODRjLS4zMzQgMC0uNjE4LjI1MDMxMzcyLS42NjYuNTg3Mjk0MTJsLS42MzY1IDQuNDMyMjM1M2MtLjA1OTUuNDE0NDcwNTguMjU2Ljc4NjExNzY0LjY2NjUuNzg2MTE3NjRoMi4zODk1Yy4yNCAwIC40MDQ1LjI0OTgwMzkyLjMxLjQ3NTY0NzA2LS4yOTguNzEyMTk2MDctLjUxNTUgMS40ODYwNzg0My0uNjM2IDIuMzIxNjQ3MDZsLTEuMjE1NSA4LjU2Nzc2NDY2Yy0uNzk5IDUuNzM1Mjk0MiAzLjg4OSA4LjYwMjQzMTQgOC45OTMgOC42MDI0MzE0IDUuMzQ3NSAwIDEwLjU5MDUtMi44NjcxMzcyIDExLjM4OS04LjYwMjQzMTRsMS4yMTUtOC41Njc3NjQ2NmMuNzgzLTUuNjIyMTE3NjUtMy43Mzk1LTguNDg4MjM1My04LjcyNTUtOC41OTg4NjI3NW0tNzguNTk1MjUgMTEuNzI4NjUxbC4wNjcgNC4xNTg5ODA0Yy4wMDE1LjA4NTEzNzItLjA1NS4xNjA1ODgyLS4xMzYuMTgxNDkwMmgtLjAwMDVsLTEuMzg1NS01LjAxNjQ3MDZjLS4wMDItLjAwNzY0NzEtLjAwNS0uMDE0Nzg0My0uMDA4LS4wMjI0MzE0TDkuNDE0MzUuNzcwNzcyNTNjLS4xMDYtLjI1Mjg2Mjc1LS4zNDk1LS40MTY1MDk4LS42MTk1LS40MTY1MDk4aC00Ljg3MjVjLS4zMzYgMC0uNjIwNS4yNTIzNTI5NC0uNjY3LjU5MTM3MjU0TC4wMDY4NSAyNC42MzcyNDMxYy0uMDU3LjQxMzQ1MS4yNTc1Ljc4MjAzOTMuNjY2NS43ODIwMzkzaDQuODU0Yy4zMzY1IDAgLjYyMTUtLjI1MzM3MjYuNjY3NS0uNTkyOTAybDEuMjcyLTkuNDEyNTA5OGMuMDAxNS0uMDA5MTc2NS4wMDItLjAxODM1My4wMDItLjAyNzUyOTRsLS4wNjk1LTQuODM2NTA5OC4xMzg1LS4wMzUxNzY1IDEuNDU1NSA1LjAxNjQ3MDZjLjAwMjUuMDA3MTM3Mi4wMDUuMDEzNzY0Ny4wMDc1LjAyMDkwMmw0LjAyMTUgOS40NTM4MDM5Yy4xMDY1LjI1MDgyMzUuMzQ5NS40MTM0NTEuNjE3NS40MTM0NTFoNS4yNTY1Yy4zMzYgMCAuNjIwNS0uMjUyMzUzLjY2Ny0uNTkxODgyNGwzLjI0OTUtMjMuNjkxNjA3ODRjLjA1NjUtLjQxMjk0MTE4LS4yNTgtLjc4MTUyOTQyLS42NjctLjc4MTUyOTQyaC00LjgyMDVjLS4zMzYgMC0uNjIwNS4yNTE4NDMxNC0uNjY3LjU5MDg2Mjc1bC0xLjQ4IDEwLjc1ODkwMmMtLjAwMS4wMDkxNzY0LS4wMDE1LjAxODg2MjctLjAwMTUuMDI4NTQ5bTkuMzk0IDEzLjY4NjYwMzloNC44NTVjLjMzNiAwIC42MjA1LS4yNTIzNTI5LjY2Ny0uNTkxMzcyNmwzLjI0OS0yMy42OTIxMTc2Yy4wNTY1LS40MTI5NDEyLS4yNTgtLjc4MTUyOTQ0LS42NjctLjc4MTUyOTQ0aC00Ljg1NWMtLjMzNiAwLS42MjA1LjI1MjM1Mjk0LS42NjcuNTkxMzcyNTVsLTMuMjQ5IDIzLjY5MjExNzY4Yy0uMDU2NS40MTI5NDEyLjI1OC43ODE1Mjk0LjY2Ny43ODE1Mjk0TTM2LjYyMTE1LjkwNjA3NDVsLS42MzYgNC40MzIyMzUzYy0uMDU5NS40MTQ0NzA2LjI1NTUuNzg2MTE3NjUuNjY2Ljc4NjExNzY1aDUuMDgwNWMuNDA4NSAwIC43MjMuMzY3NTY4NjMuNjY3NS43ODA1MDk4bC0yLjM5MzUgMTcuNzM0MDM5MjVjLS4wNTU1LjQxMjQzMTMuMjU4NS43OC42NjcuNzhoNC45MjU1Yy4zMzY1IDAgLjYyMS0uMjUyODYyOC42NjctLjU5MjkwMmwyLjQ0NC0xOC4xMDg3NDUxYy4wNDYtLjMzOTUyOTQuMzMwNS0uNTkyOTAxOTUuNjY3LS41OTI5MDE5NWg1LjQ2MjVjLjMzNCAwIC42MTgtLjI0OTgwMzkyLjY2Ni0uNTg3Mjk0MTJsLjYzNy00LjQzMjIzNTNjLjA1OTUtLjQxNDQ3MDU4LS4yNTU1LS43ODYxMTc2NC0uNjY2NS0uNzg2MTE3NjRoLTE4LjE4NzVjLS4zMzQ1IDAtLjYxOC4yNTAzMTM3LS42NjY1LjU4NzI5NDFNNzEuMDM4NyA5LjA5ODM2ODZjLS4xNzQgMS40NTE0MTE3Ny0xLjI4NDUgMi45MDI4MjM1Ny0zLjE5NSAyLjkwMjgyMzU3aC0yLjg2OTVjLS40MSAwLS43MjQ1LS4zNjk2MDc5LS42NjctLjc4MzA1ODlsLjYwNzUtNC4zNjE4ODIzM2MuMDQ3LS4zMzg1MDk4LjMzMTUtLjU5MDM1Mjk0LjY2Ny0uNTkwMzUyOTRoMy4wNjFjMS44NDA1IDAgMi41Njk1IDEuMzEwMTk2MDggMi4zOTYgMi44MzI0NzA2TTY5LjMzNzIuMzU0MjExNzZoLTkuMjQwNWMtLjMzNiAwLS42MjA1LjI1MjM1Mjk0LS42NjcuNTkxMzcyNTRsLTMuMjQ5IDIzLjY5MjExNzdjLS4wNTY1LjQxMjk0MTEuMjU4Ljc4MTUyOTQuNjY3Ljc4MTUyOTRoNC45MjM1Yy4zMzY1IDAgLjYyMTUtLjI1MzM3MjYuNjY3NS0uNTkyOTAybC45NTYtNy4wNzY1ODgyYy4wMjMtLjE2OTc2NDcuMTY1LS4yOTYxOTYxLjMzMzUtLjI5NjE5NjFoLjYzM2MuMTE0NSAwIC4yMjE1LjA1OTY0NzEuMjgzNS4xNTgwMzkybDQuNzAyIDcuNDkxMDU4OGMuMTI0LjE5NzI5NDIuMzM3NS4zMTY1ODgzLjU2NzUuMzE2NTg4M2g2LjA4MWMuNTQ1IDAgLjg2NDUtLjYyNTAxOTYuNTUyLTEuMDgwMjc0NWwtNC45MzQ1LTcuMTkxODA0Yy0uMTE4LS4xNzI4MjM1LS4wNTc1LS40MTI0MzEzLjEyOC0uNTA0NzA1OCAzLjE1MDUtMS41Njk2ODYzIDQuOTc5NS0zLjE3ODExNzcgNS41ODMtNy42NTAxMTc3LjY5MzUtNS44NzcwMTk2LTIuOTE3LTguNjM4MTE3NjMtNy45ODY1LTguNjM4MTE3NjMiLz48L3N2Zz4 = ) ;
background - size : 63 px 16 px ;
padding - left : 73 px ;
}
. toast . toast - spotify {
background - color : # 1 DB954 ;
}
. toast . toast - spotify . icon {
background - image : url ( data : image / svg + xml ; base64 , PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI / Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0 + CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCAwIDUwOC41MiA1MDguNTIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDUwOC41MiA1MDguNTI7IiB4bWw6c3BhY2U9InByZXNlcnZlIiB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4Ij4KPGc + Cgk8Zz4KCQk8Zz4KCQkJPHBhdGggZD0iTTI1NC4yNiwwQzExMy44NDUsMCwwLDExMy44NDUsMCwyNTQuMjZzMTEzLjg0NSwyNTQuMjYsMjU0LjI2LDI1NC4yNiAgICAgczI1NC4yNi0xMTMuODQ1LDI1NC4yNi0yNTQuMjZTMzk0LjY3NSwwLDI1NC4yNiwweiBNMzcxLjY5Niw0MDMuMjg4Yy0zLjE3OCw1LjgxNi05LjEyMiw5LjA1OC0xNS4yODcsOS4wNTggICAgIGMtMi44NiwwLTUuNzIxLTAuNjY3LTguNDIyLTIuMTI5Yy00MC43MTMtMjIuNDM4LTg2Ljk1Ny0zNC4yOTMtMTMzLjY3Ny0zNC4yOTNjLTI4LDAtNTUuNjUxLDQuMTYzLTgyLjEyNiwxMi4zNjMgICAgIGMtOS4yMTcsMi44Ni0xOS4wMDYtMi4yODgtMjEuODM1LTExLjUzN2MtMi44Ni05LjE4NSwyLjI4OC0yOC43LDExLjUzNy0zMS41OTJjMjkuODQ0LTkuMjQ5LDYwLjk1OS0xMy45MjEsOTIuNDU1LTEzLjkyMSAgICAgYzUyLjU2OCwwLDEwNC42NiwxMy4zNDksMTUwLjUyMiwzOC42MTZDMzczLjMxNywzNzQuNDYxLDM3Ni40LDM5NC44NjYsMzcxLjY5Niw0MDMuMjg4eiBNNDA0LjAxOSwzMDcuNTI3ICAgICBjLTMuNjIzLDcuMDI0LTEwLjc0MiwxOC4zMzgtMTguMDg0LDE4LjMzOGMtMy4yMSwwLTYuMzg4LTAuNjk5LTkuMzc2LTIuMzJjLTUwLjQ3MS0yNi4xODktMTA1LjA0MS0zOS40NzQtMTYyLjIxOC0zOS40NzQgICAgIGMtMzEuNDk2LDAtNjIuNzcsNC4xMzItOTIuOTY0LDEyLjQ1OWMtMTAuOTAxLDIuOTU2LTIyLjA4OS0zLjQwMS0yNS4wNDUtMTQuMzAyYy0yLjkyNC0xMC45MDEsMy40NjQtMjkuNDMxLDE0LjMzNC0zMi4zODYgICAgIGMzMy42ODktOS4xODUsNjguNTg3LTEzLjg1NywxMDMuNjc0LTEzLjg1N2M2Mi44OTgsMCwxMjUuNDQ1LDE1LjI1NiwxODAuOTM4LDQ0LjExNCAgICAgQzQwNS4yOSwyODUuMjQ4LDQwOS4xOTksMjk3LjUxNiw0MDQuMDE5LDMwNy41Mjd6IE00MTcuNTI2LDIzMC44MzZjLTMuNDY0LDAtNy4wMjQtMC43OTUtMTAuMzYxLTIuNDQ3ICAgICBjLTYwLjIyOC0zMC4wMzQtMTI1LjA5Ni00NS4yMjYtMTkyLjc2MS00NS4yMjZjLTM1LjI3OSwwLTcwLjQzLDQuMjkxLTEwNC41MzMsMTIuNzEzYy0xMi41MjIsMy4wODMtMjUuMTQtNC41MTMtMjguMjIzLTE3LjAwNCAgICAgYy0zLjExNS0xMi40NTksNC41MTMtMjcuNTU1LDE3LjAwNC0zMC42MzhjMzcuNzI2LTkuMzc2LDc2LjY1OS0xNC4xMTEsMTE1LjcyLTE0LjExMWM3NC45NzUsMCwxNDYuODY3LDE2Ljg3NywyMTMuNTc4LDUwLjEyMSAgICAgYzExLjUzNyw1Ljc1MywxNi4yNDEsMTkuNzM3LDEwLjQ4OCwzMS4yNDJDNDM0LjMwOCwyMjMuNjUzLDQyNi4xMDgsMjMwLjgzNiw0MTcuNTI2LDIzMC44MzZ6IiBmaWxsPSIjRkZGRkZGIi8 + CgkJPC9nPgoJPC9nPgo8L2c + CjxnPgo8L2c + CjxnPgo8L2c + CjxnPgo8L2c + CjxnPgo8L2c + CjxnPgo8L2c + CjxnPgo8L2c + CjxnPgo8L2c + CjxnPgo8L2c + CjxnPgo8L2c + CjxnPgo8L2c + CjxnPgo8L2c + CjxnPgo8L2c + CjxnPgo8L2c + CjxnPgo8L2c + CjxnPgo8L2c + Cjwvc3ZnPgo = ) ;
}
. toast . toast - streamermode {
background - color : # 593695 ;
}
. toast . toast - streamermode . icon {
background - image : url ( data : image / svg + xml ; base64 , PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIGlkPSJDYXBhXzEiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSItMjUgLTI1IDU0MiA1NDIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ5MiA0OTI7IiB4bWw6c3BhY2U9InByZXNlcnZlIiB3aWR0aD0iNTEycHgiIGhlaWdodD0iNTEycHgiPjxwYXRoIGQ9Ik00ODguMywxNDIuNXYyMDMuMWMwLDE1LjctMTcsMjUuNS0zMC42LDE3LjdsLTg0LjYtNDguOHYxMy45YzAsNDEuOC0zMy45LDc1LjctNzUuNyw3NS43SDc1LjdDMzMuOSw0MDQuMSwwLDM3MC4yLDAsMzI4LjQgICBWMTU5LjljMC00MS44LDMzLjktNzUuNyw3NS43LTc1LjdoMjIxLjhjNDEuOCwwLDc1LjcsMzMuOSw3NS43LDc1Ljd2MTMuOWw4NC42LTQ4LjhDNDcxLjMsMTE3LDQ4OC4zLDEyNi45LDQ4OC4zLDE0Mi41eiIgZmlsbD0iI0ZGRkZGRiIvPjwvc3ZnPg == ) ;
}
. toast . toast - success {
background - color : # 43 B581 ;
}
. toast . toast - success . icon {
background - image : url ( data : image / svg + xml ; base64 , PHN2ZyBmaWxsPSIjRkZGRkZGIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPiAgICA8cGF0aCBkPSJNMTIgMkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptLTIgMTVsLTUtNSAxLjQxLTEuNDFMMTAgMTQuMTdsNy41OS03LjU5TDE5IDhsLTkgOXoiLz48L3N2Zz4 = ) ;
}
. toast . toast - warning ,
. toast . toast - warn {
background - color : # FFA600 ;
}
. toast . toast - warning . icon ,
. toast . toast - warn . icon {
background - image : url ( data : image / svg + xml ; base64 , PHN2ZyBmaWxsPSIjRkZGRkZGIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPiAgICA8cGF0aCBkPSJNMSAyMWgyMkwxMiAyIDEgMjF6bTEyLTNoLTJ2LTJoMnYyem0wLTRoLTJ2LTRoMnY0eiIvPjwvc3ZnPg == ) ;
}
. BDFDB - quickSelectPopout {
min - width : 210 px ! important ;
position : relative ! important ;
width : auto ! important ;
}
. BDFDB - modal . BDFDB - settings - inner . BDFDB - containertext ,
. BDFDB - settings . BDFDB - settings - inner . BDFDB - containertext {
margin - left : - 18 px ;
}
. BDFDB - modal . BDFDB - containerarrow ,
. BDFDB - settings . BDFDB - containerarrow {
background : url ( data : image / svg + xml ; base64 , PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxOS4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iQ2FscXVlXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSItOTUwIDUzMiAxOCAxOCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAtOTUwIDUzMiAxOCAxODsiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4NCgkuc3Qwe2ZpbGw6bm9uZTt9DQoJLnN0MXtmaWxsOm5vbmU7c3Ryb2tlOiNGRkZGRkY7c3Ryb2tlLXdpZHRoOjEuNTtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTS05MzIsNTMydjE4aC0xOHYtMThILTkzMnoiLz4NCjxwb2x5bGluZSBjbGFzcz0ic3QxIiBwb2ludHM9Ii05MzYuNiw1MzguOCAtOTQxLDU0My4yIC05NDUuNCw1MzguOCAiLz4NCjwvc3ZnPg0K ) ;
height : 16 px ;
width : 16 px ;
display : inline - block ;
position : relative ;
top : 2 px ;
transition : transform . 3 s ease ;
transform : rotate ( 0 ) ;
}
. BDFDB - modal . BDFDB - containerarrow . closed ,
. BDFDB - settings . BDFDB - containerarrow . closed {
transform : rotate ( - 90 deg ) ;
}
. BDFDB - settings . BDFDB - settings - inner {
padding - left : 15 px ;
padding - right : 5 px ;
}
. BDFDB - settings . BDFDB - settings - inner - list {
padding - left : 15 px ;
}
. inputNumberWrapper . numberinput - buttons - zone : hover + $ { BDFDB . dotCN . input } {
border - color : black ;
}
. inputNumberWrapper . numberinput - buttons - zone : hover + $ { BDFDB . dotCN . input } : focus ,
. inputNumberWrapper . numberinput - buttons - zone . pressed + $ { BDFDB . dotCN . input } {
border - color : # 7289 da ;
}
. inputNumberWrapper {
position : relative ! important ;
}
. inputNumberWrapper $ { BDFDB . dotCN . input } [ type = number ] {
padding - right : 25 px ;
}
. inputNumberWrapper . inputNumberWrapperMini $ { BDFDB . dotCN . input } [ type = number ] {
padding - left : 6 px ;
padding - right : 17 px ;
}
. inputNumberWrapper $ { BDFDB . dotCN . input } [ type = number ] : : - webkit - inner - spin - button ,
. inputNumberWrapper $ { BDFDB . dotCN . input } [ type = number ] : : - webkit - outer - spin - button {
- webkit - appearance : none ;
}
. inputNumberWrapper . numberinput - buttons - zone {
cursor : pointer ;
position : absolute ;
display : flex ;
flex - direction : column ;
align - items : center ;
justify - content : space - around ;
height : 110 % ;
right : 8 px ;
top : - 5 % ;
}
. inputNumberWrapper . inputNumberWrapperMini . numberinput - buttons - zone {
right : 4 px ;
}
. inputNumberWrapper . numberinput - button - up {
border - color : transparent transparent # 999 transparent ;
border - style : solid ;
border - width : 2.5 px 5 px 5 px 5 px ;
display : inline - block ;
}
. inputNumberWrapper . numberinput - button - up : hover {
border - bottom - color : # 666 ;
}
$ { BDFDB . dotCN . themelight } . inputNumberWrapper . numberinput - button - up {
border - bottom - color : # dcddde ;
}
$ { BDFDB . dotCN . themelight } . inputNumberWrapper . numberinput - button - up : hover {
border - bottom - color : # 4 f545c ;
}
$ { BDFDB . dotCN . themedark } . inputNumberWrapper . numberinput - button - up {
border - bottom - color : # 72767 d ;
}
$ { BDFDB . dotCN . themedark } . inputNumberWrapper . numberinput - button - up : hover {
border - bottom - color : # f6f6f7 ;
}
. inputNumberWrapper . numberinput - button - down {
border - color : # 999 transparent transparent transparent ;
border - style : solid ;
border - width : 5 px 5 px 2.5 px 5 px ;
display : inline - block ;
}
. inputNumberWrapper . numberinput - button - down : hover {
border - top - color : # 666 ;
}
$ { BDFDB . dotCN . themelight } . inputNumberWrapper . numberinput - button - down {
border - top - color : # dcddde ;
}
$ { BDFDB . dotCN . themelight } . inputNumberWrapper . numberinput - button - down : hover {
border - top - color : # 4 f545c ;
}
$ { BDFDB . dotCN . themedark } . inputNumberWrapper . numberinput - button - down {
border - top - color : # 72767 d ;
}
$ { BDFDB . dotCN . themedark } . inputNumberWrapper . numberinput - button - down : hover {
border - top - color : # f6f6f7 ;
}
. BDFDB - select $ { BDFDB . dotCN . select } {
position : relative ;
box - sizing : border - box ;
}
. BDFDB - select $ { BDFDB . dotCN . selectcontrol } {
- webkit - box - align : center ;
align - items : center ;
display : flex ;
flex - wrap : wrap ;
- webkit - box - pack : justify ;
justify - content : space - between ;
min - height : 40 px ;
position : relative ;
box - sizing : border - box ;
border - radius : 3 px ;
border - style : solid ;
border - width : 1 px ;
transition : border 0.15 s ease 0 s ;
outline : 0 px ! important ;
}
. BDFDB - select $ { BDFDB . dotCN . selectcontrollight } {
background - color : rgba ( 79 , 84 , 92 , 0.02 ) ;
background - color : rgba ( 79 , 84 , 92 , 0.02 ) ;
}
. BDFDB - select $ { BDFDB . dotCN . selectcontroldark } {
background - color : rgba ( 0 , 0 , 0 , 0.1 ) ;
border - color : rgba ( 0 , 0 , 0 , 0.3 ) ;
}
. BDFDB - select $ { BDFDB . dotCN . selectvalue } {
- webkit - box - align : center ;
align - items : center ;
display : flex ;
flex - wrap : wrap ;
position : relative ;
box - sizing : border - box ;
flex : 1 1 0 % ;
padding : 2 px 8 px ;
overflow : hidden ;
}
. BDFDB - select $ { BDFDB . dotCN . selectsingle } {
margin - left : 2 px ;
margin - right : 2 px ;
max - width : calc ( 100 % - 8 px ) ;
width : calc ( 100 % - 8 px ) ;
position : absolute ;
text - overflow : ellipsis ;
white - space : nowrap ;
top : 50 % ;
transform : translateY ( - 50 % ) ;
box - sizing : border - box ;
opacity : 1 ;
overflow : hidden ;
}
. BDFDB - select $ { BDFDB . dotCN . selectsinglelight } {
color : rgb ( 32 , 34 , 37 ) ;
}
. BDFDB - select $ { BDFDB . dotCN . selectsingledark } {
color : rgb ( 246 , 246 , 247 ) ;
}
. BDFDB - select $ { BDFDB . dotCN . selectdummyinput } {
font - size : inherit ;
width : 1 px ;
color : transparent ;
left : - 100 px ;
opacity : 0 ;
position : relative ;
transform : scale ( 0 ) ;
background : 0 px center ;
border - width : 0 px ;
border - style : initial ;
border - color : initial ;
border - image : initial ;
outline : 0 px ;
padding : 0 px ;
}
. BDFDB - select $ { BDFDB . dotCN . selectarrowzone } {
- webkit - box - align : center ;
align - items : center ;
align - self : stretch ;
display : flex ;
flex - shrink : 0 ;
box - sizing : border - box ;
}
. BDFDB - select $ { BDFDB . dotCN . selectarrowcontainer } {
display : flex ;
box - sizing : border - box ;
cursor : pointer ;
opacity : 0.3 ;
padding : 8 px 8 px 8 px 0 px ;
transition : color 150 ms ease 0 s ;
}
. BDFDB - select $ { BDFDB . dotCN . selectarrowcontainerlight } {
color : rgb ( 32 , 34 , 37 ) ;
}
. BDFDB - select $ { BDFDB . dotCN . selectarrowcontainerdark } {
color : rgb ( 246 , 246 , 247 ) ;
}
. BDFDB - select $ { BDFDB . dotCN . selectarrow } {
display : inline - block ;
fill : currentcolor ;
line - height : 1 ;
stroke : currentcolor ;
stroke - width : 0 ;
}
. BDFDB - select $ { BDFDB . dotCN . selectmenuouter } {
top : 100 % ;
margin - bottom : - 1 px ;
margin - top : - 1 px ;
position : absolute ;
width : 100 % ;
z - index : 100 ;
box - sizing : border - box ;
border - radius : 0 px 0 px 3 px 3 px ;
border - width : 1 px ;
border - style : solid ;
border - image : initial ;
}
. BDFDB - select $ { BDFDB . dotCN . selectmenuouter } . above - select {
border - radius : 3 px 3 px 0 0 ;
}
. BDFDB - select $ { BDFDB . dotCN . selectmenuouterlight } {
background - color : rgb ( 255 , 255 , 255 ) ;
border - color : rgb ( 185 , 187 , 190 ) ;
color : rgb ( 32 , 34 , 37 ) ;
}
. BDFDB - select $ { BDFDB . dotCN . selectmenuouterdark } {
background - color : rgb ( 47 , 49 , 54 ) ;
border - color : rgb ( 32 , 34 , 37 ) ;
color : rgb ( 246 , 246 , 247 ) ;
}
. BDFDB - select $ { BDFDB . dotCN . selectmenu } {
max - height : 300 px ;
overflow - y : auto ;
position : relative ;
box - sizing : border - box ;
padding : 0 px ;
}
. BDFDB - select $ { BDFDB . dotCN . selectmenu } : : - webkit - scrollbar {
width : 8 px ;
}
. BDFDB - select $ { BDFDB . dotCN . selectmenu } : : - webkit - scrollbar - thumb {
background - color : rgba ( 0 , 0 , 0 , 0.4 ) ;
background - clip : padding - box ;
border - color : transparent ;
border - radius : 4 px ;
}
. BDFDB - select $ { BDFDB . dotCN . selectmenu } : : - webkit - scrollbar - track - piece {
background - color : transparent ;
border - color : transparent ;
}
. BDFDB - select $ { BDFDB . dotCN . selectoption } {
cursor : pointer ;
display : flex ;
font - size : inherit ;
width : 100 % ;
user - select : none ;
- webkit - tap - highlight - color : rgba ( 0 , 0 , 0 , 0 ) ;
box - sizing : border - box ;
- webkit - box - align : center ;
align - items : center ;
min - height : 40 px ;
padding : 8 px 12 px ;
}
. BDFDB - select $ { BDFDB . dotCN . selectoptionlight } {
background - color : transparent ;
color : rgb ( 32 , 34 , 37 ) ;
}
. BDFDB - select $ { BDFDB . dotCN . selectoptiondark } {
background - color : transparent ;
color : rgb ( 246 , 246 , 247 ) ;
}
. BDFDB - select $ { BDFDB . dotCN . selectoptionhoverlight } {
background - color : rgb ( 246 , 246 , 247 ) ;
color : rgb ( 32 , 34 , 37 ) ;
}
. BDFDB - select $ { BDFDB . dotCN . selectoptionhoverdark } {
background - color : rgba ( 0 , 0 , 0 , 0.1 ) ;
color : rgb ( 246 , 246 , 247 ) ;
}
. BDFDB - select $ { BDFDB . dotCN . selectoptionselectlight } {
background - color : rgb ( 220 , 221 , 222 ) ;
color : rgb ( 32 , 34 , 37 ) ;
}
. BDFDB - select $ { BDFDB . dotCN . selectoptionselectdark } {
background - color : rgba ( 0 , 0 , 0 , 0.2 ) ;
color : rgb ( 246 , 246 , 247 ) ;
}
. BDFDB - settings $ { BDFDB . dotCN . hovercard } ,
. BDFDB - settings $ { BDFDB . dotCNS . hovercard + BDFDB . dotCN . hovercardinner } {
width : 550 px ;
min - height : 28 px ;
}
. BDFDB - settingsmodal . BDFDB - settings {
margin - bottom : 20 px ;
}
. BDFDB - settingsmodal . BDFDB - settings $ { BDFDB . dotCN . hovercard } ,
. BDFDB - settingsmodal . BDFDB - settings $ { BDFDB . dotCNS . hovercard + BDFDB . dotCN . hovercardinner } {
width : 520 px ;
}
. BDFDB - settings $ { BDFDB . dotCN . hovercard } : before {
z - index : 50 ;
left : - 10 px ;
}
. BDFDB - settings $ { BDFDB . dotCNS . hovercard + BDFDB . dotCN . hovercardinner } {
overflow : hidden ;
display : flex ;
align - items : center ;
position : relative ;
z - index : 100 ;
}
. BDFDB - settings $ { BDFDB . dotCNS . hovercard + BDFDB . dotCN . hovercardbutton } {
opacity : 0 ;
position : absolute ;
right : - 31 px ;
top : - 12 px ;
z - index : 200 ;
2019-10-24 15:54:18 +02:00
}
2019-10-18 10:56:41 +02:00
. BDFDB - settings $ { BDFDB . dotCN . hovercard } : hover $ { BDFDB . dotCN . hovercardbutton } {
opacity : 1 ;
}
. BDFDB - modal $ { BDFDB . dotCN . checkboxcontainer } ,
. BDFDB - settings $ { BDFDB . dotCN . checkboxcontainer } {
display : flex ;
align - items : center ;
flex - direction : column ;
margin - right : 5 px ;
margin - left : 5 px ;
}
. BDFDB - modal $ { BDFDB . dotCN . checkboxcontainer } : before ,
. BDFDB - settings $ { BDFDB . dotCN . checkboxcontainer } : before {
display : none ;
}
. BDFDB - modal $ { BDFDB . dotCN . colorpickerswatches + BDFDB . dotCN . colorpickerswatchesdisabled } ,
. BDFDB - settings $ { BDFDB . dotCN . colorpickerswatches + BDFDB . dotCN . colorpickerswatchesdisabled } {
cursor : no - drop ;
filter : grayscale ( 70 % ) brightness ( 50 % ) ;
}
. BDFDB - modal $ { BDFDB . dotCN . colorpickerswatch + BDFDB . notCN . colorpickerswatchnocolor + BDFDB . notCN . colorpickerswatchdefault + BDFDB . notCN . colorpickerswatchdisabled } ,
. BDFDB - settings $ { BDFDB . dotCN . colorpickerswatch + BDFDB . notCN . colorpickerswatchnocolor + BDFDB . notCN . colorpickerswatchdefault + BDFDB . notCN . colorpickerswatchdisabled } {
overflow : hidden ;
}
. BDFDB - colorpicker . gradient - bar . gradient - cursor > div : after ,
. BDFDB - modal $ { BDFDB . dotCN . colorpickerswatch + BDFDB . notCN . colorpickerswatchnocolor + BDFDB . notCN . colorpickerswatchdefault + BDFDB . notCN . colorpickerswatchdisabled } : after ,
. BDFDB - settings $ { BDFDB . dotCN . colorpickerswatch + BDFDB . notCN . colorpickerswatchnocolor + BDFDB . notCN . colorpickerswatchdefault + BDFDB . notCN . colorpickerswatchdisabled } : after {
content : "" ;
position : absolute ;
top : 0 ;
right : 0 ;
bottom : 0 ;
left : 0 ;
z - index : - 1 ;
}
. BDFDB - modal $ { BDFDB . dotCN . colorpickerswatch + BDFDB . notCN . colorpickerswatchdefault } : after ,
. BDFDB - settings $ { BDFDB . dotCN . colorpickerswatch + BDFDB . notCN . colorpickerswatchdefault } : after {
border - radius : 3 px ;
}
. BDFDB - modal $ { BDFDB . dotCN . colorpickerswatch + BDFDB . dotCN . colorpickerswatchcustom + BDFDB . notCN . colorpickerswatchdefault } : after ,
. BDFDB - settings $ { BDFDB . dotCN . colorpickerswatch + BDFDB . dotCN . colorpickerswatchcustom + BDFDB . notCN . colorpickerswatchdefault } : after {
border - radius : 5 px ;
}
. BDFDB - colorpicker . alpha - checker ,
. BDFDB - colorpicker . gradient - bar . gradient - cursor > div : after ,
. BDFDB - modal $ { BDFDB . dotCN . colorpickerswatch + BDFDB . notCN . colorpickerswatchnocolor + BDFDB . notCN . colorpickerswatchdefault + BDFDB . notCN . colorpickerswatchdisabled } : after ,
. BDFDB - settings $ { BDFDB . dotCN . colorpickerswatch + BDFDB . notCN . colorpickerswatchnocolor + BDFDB . notCN . colorpickerswatchdefault + BDFDB . notCN . colorpickerswatchdisabled } : after {
2019-10-18 19:19:38 +02:00
background : url ( 'data:image/svg+xml; utf8, <svg xmlns="http://www.w3.org/2000/svg" width="8" height="8"><rect x="0" y="0" width="4" height="4" fill="black"></rect><rect x="0" y="4" width="4" height="4" fill="white"></rect><rect x="4" y="0" width="4" height="4" fill="white"></rect><rect x="4" y="4" width="4" height="4" fill="black"></rect></svg>' ) center repeat
2019-10-18 10:56:41 +02:00
}
. BDFDB - modal $ { BDFDB . dotCN . colorpickerswatches + BDFDB . dotCN . colorpickerswatchesdisabled } $ { BDFDB . dotCN . colorpickerswatch } ,
. BDFDB - settings $ { BDFDB . dotCN . colorpickerswatches + BDFDB . dotCN . colorpickerswatchesdisabled } $ { BDFDB . dotCN . colorpickerswatch } {
cursor : no - drop ;
}
. BDFDB - modal $ { BDFDB . dotCN . colorpickerswatch + BDFDB . dotCN . colorpickerswatchcustom } [ style *= "background" ] ,
. BDFDB - settings $ { BDFDB . dotCN . colorpickerswatch + BDFDB . dotCN . colorpickerswatchcustom } [ style *= "background" ] {
border : none ;
}
$ { BDFDB . dotCNS . themelight + BDFDB . dotCN . colorpickersaturation } > div > div > div > div {
box - shadow : rgb ( 200 , 200 , 200 ) 0 px 0 px 0 px 1.5 px , rgba ( 0 , 0 , 0 , 0.6 ) 0 px 0 px 1 px 1 px inset , rgba ( 0 , 0 , 0 , 0.6 ) 0 px 0 px 1 px 2 px ! important ;
}
$ { BDFDB . dotCNS . themelight + BDFDB . dotCN . colorpickerhue } > div > div > div > div ,
$ { BDFDB . dotCN . themelight } . BDFDB - colorpicker . alpha - bar > div > div > div > div {
background : rgb ( 200 , 200 , 200 ) ! important ;
box - shadow : rgba ( 0 , 0 , 0 , 1 ) 0 px 0 px 2 px ! important ;
}
. BDFDB - colorpicker . gradient - button {
cursor : pointer ;
opacity : 0.3 ;
transition : all 200 ms ease ;
}
. BDFDB - colorpicker . gradient - button : hover {
opacity : 0.6 ;
}
. BDFDB - colorpicker . gradient - button . selected ,
. BDFDB - colorpicker . gradient - button . selected : hover {
opacity : 1 ;
}
$ { BDFDB . dotCN . themelight } . BDFDB - colorpicker . gradient - button {
color : # 4 f545c ;
}
$ { BDFDB . dotCN . themedark } . BDFDB - colorpicker . gradient - button {
color : # fff ;
}
. BDFDB - colorpicker . alpha - checker ,
. BDFDB - colorpicker . alpha - horizontal ,
. BDFDB - colorpicker . gradient - horizontal {
border - radius : 3 px ;
}
. BDFDB - colorpicker . alpha - bar . alpha - cursor ,
. BDFDB - colorpicker . gradient - bar . gradient - cursor {
position : absolute ;
}
. BDFDB - colorpicker . gradient - bar . gradient - cursor > div {
height : 8 px ;
width : 8 px ;
margin - top : - 15 px ;
border : 1 px solid rgb ( 128 , 128 , 128 ) ;
border - radius : 3 px ;
transform : translateX ( - 5 px ) ;
transform - style : preserve - 3 d ;
}
. BDFDB - colorpicker . gradient - bar . gradient - cursor > div : after {
border - radius : 3 px ;
transform : translateZ ( - 1 px ) ;
}
. BDFDB - colorpicker . gradient - bar . gradient - cursor > div : before {
content : "" ;
position : absolute ;
border : 3 px solid transparent ;
border - top - width : 5 px ;
border - top - color : rgb ( 128 , 128 , 128 ) ;
width : 0 ;
height : 0 ;
top : 100 % ;
left : - 50 % ;
transform : translateX ( 5 px ) ;
}
. BDFDB - colorpicker . gradient - bar . gradient - cursor . edge > div : before {
border - right - width : 0 ;
border - left - width : 5 px ;
}
2019-11-06 12:52:14 +01:00
. BDFDB - colorpicker . gradient - bar . gradient - cursor . edge ~ . gradient - cursor . edge > div : before {
2019-10-18 10:56:41 +02:00
border - right - width : 5 px ;
border - left - width : 0 ;
}
$ { BDFDB . dotCN . themelight } . BDFDB - colorpicker . gradient - bar . gradient - cursor . selected > div {
border - color : rgb ( 55 , 55 , 55 ) ;
}
$ { BDFDB . dotCN . themelight } . BDFDB - colorpicker . gradient - bar . gradient - cursor . selected > div : before {
border - top - color : rgb ( 55 , 55 , 55 ) ;
}
$ { BDFDB . dotCN . themedark } . BDFDB - colorpicker . gradient - bar . gradient - cursor . selected > div {
border - color : rgb ( 200 , 200 , 200 ) ;
}
$ { BDFDB . dotCN . themedark } . BDFDB - colorpicker . gradient - bar . gradient - cursor . selected > div : before {
border - top - color : rgb ( 200 , 200 , 200 ) ;
}
. BDFDB - modal $ { BDFDB . dotCN . inputdefault } . valid {
background - color : rgba ( 67 , 181 , 129 , 0.5 ) ;
}
. BDFDB - modal $ { BDFDB . dotCN . inputdefault } . valid : hover {
border - color : rgb ( 27 , 141 , 89 ) ;
}
. BDFDB - modal $ { BDFDB . dotCN . inputdefault } . valid : focus {
border - color : rgb ( 67 , 181 , 129 ) ;
}
. BDFDB - modal $ { BDFDB . dotCN . inputdefault } . valid : : placeholder {
color : rgba ( 67 , 181 , 129 , 0.7 ) ;
}
. BDFDB - modal $ { BDFDB . dotCN . inputdefault } . invalid {
background - color : rgba ( 241 , 71 , 71 , 0.5 ) ;
}
. BDFDB - modal $ { BDFDB . dotCN . inputdefault } . invalid : hover {
border - color : rgb ( 201 , 31 , 31 ) ;
}
. BDFDB - modal $ { BDFDB . dotCN . inputdefault } . invalid : focus {
border - color : rgb ( 241 , 71 , 71 ) ;
}
. BDFDB - modal $ { BDFDB . dotCN . inputdefault } . invalid : : placeholder {
color : rgba ( 241 , 71 , 71 , 0.7 ) ;
}
. BDFDB - modal $ { BDFDB . dotCN . inputdefault } : disabled {
color : # 555555 ;
cursor : no - drop ;
background - color : rgba ( 0 , 0 , 0 , 0.5 ) ;
}
/* REMOVE */
. BDFDB - modal $ { BDFDB . dotCN . modaltabcontent + BDFDB . dotCN . modaltabcontentopen } {
display : flex ;
flex - direction : column ;
flex - wrap : nowrap ;
justify - content : flex - start ;
align - items : stretch ;
}
. BDFDB - modal $ { BDFDB . dotCN . modaltabcontent + BDFDB . notCN . modaltabcontentopen } {
display : none ;
}
/* REMOVE */
. BDFDB - modal * $ { BDFDB . notCN . modalsubinner } > $ { BDFDB . dotCN . modaltabcontent + BDFDB . dotCN . modaltabcontentopen + BDFDB . notCN . modalsubinner } > * {
padding : 0 20 px 0 12 px ;
}
. colorpicker - modal . colorpicker - container {
padding : 10 px 10 px 10 px 30 px ;
overflow : hidden ;
display : initial ;
margin : auto ;
}
. colorpicker - modal . colorpicker - color ,
. colorpicker - modal . colorpicker - slider ,
. colorpicker - modal . colorpicker - controls {
float : left ;
margin - right : 20 px ;
}
. colorpicker - modal . colorpicker - inputs {
text - align : center ;
width : 150 px ;
padding : 3 px 3 px 3 px 10 px ;
margin - top : 87 px ;
}
. colorpicker - modal . colorpicker - pickerpane ,
. colorpicker - modal . colorpicker - black ,
. colorpicker - modal . colorpicker - white ,
. colorpicker - modal . colorpicker - color {
position : relative ;
top : 0 px ;
left : 0 px ;
height : 308 px ;
width : 308 px ;
}
. colorpicker - modal . colorpicker - pickercursor {
position : absolute ;
height : 14 px ;
width : 14 px ;
}
. colorpicker - modal . colorpicker - pickercursor svg {
position : relative ;
height : 14 px ;
width : 14 px ;
}
. colorpicker - modal . colorpicker - sliderpane ,
. colorpicker - modal . colorpicker - slider {
position : relative ;
top : 0 px ;
left : 0 px ;
height : 308 px ;
width : 20 px ;
}
. colorpicker - modal . colorpicker - slidercursor {
position : absolute ;
left : - 6 px ;
height : 12 px ;
width : 32 px ;
}
. colorpicker - modal . colorpicker - slidercursor svg {
position : relative ;
height : 12 px ;
width : 32 px ;
}
. colorpicker - modal [ class ^= "colorpicker-preview-" ] {
background - color : # 808080 ;
border : 3 px solid transparent ;
height : 65 px ;
width : 80 px ;
float : left ;
}
. colorpicker - modal . colorpicker - preview - 0 {
border - radius : 5 px 0 0 5 px ;
border - right : none ;
}
. colorpicker - modal . colorpicker - preview - 2 {
border - radius : 0 5 px 5 px 0 ;
border - left : none ;
} ` );
2019-10-18 19:19:38 +02:00
BDFDB . ListenerUtils . add ( BDFDB , document , "click.BDFDBPluginClick" , ".bd-settingswrap .bd-refresh-button, .bd-settingswrap .bd-switch-checkbox" , _ => {
2019-10-23 11:10:01 +02:00
BDFDB . BDUtils . setPluginCache ( ) ;
BDFDB . BDUtils . setThemeCache ( ) ;
2019-10-18 10:56:41 +02:00
} ) ;
var KeyDownTimeouts = { } ;
BDFDB . ListenerUtils . add ( BDFDB , document , "keydown.BDFDBPressedKeys" , e => {
2019-11-03 16:53:33 +01:00
if ( ! BDFDB . InternalData . pressedKeys . includes ( e . which ) ) {
2019-11-01 11:09:32 +01:00
BDFDB . TimeUtils . clear ( KeyDownTimeouts [ e . which ] ) ;
2019-11-03 16:53:33 +01:00
BDFDB . InternalData . pressedKeys . push ( e . which ) ;
KeyDownTimeouts [ e . which ] = BDFDB . TimeUtils . timeout ( _ => {
BDFDB . ArrayUtils . remove ( BDFDB . InternalData . pressedKeys , e . which , true ) ;
} , 60000 ) ;
2019-10-18 10:56:41 +02:00
}
} ) ;
BDFDB . ListenerUtils . add ( BDFDB , document , "keyup.BDFDBPressedKeys" , e => {
2019-11-01 11:09:32 +01:00
BDFDB . TimeUtils . clear ( KeyDownTimeouts [ e . which ] ) ;
2019-11-03 16:53:33 +01:00
BDFDB . ArrayUtils . remove ( BDFDB . InternalData . pressedKeys , e . which , true ) ;
2019-10-18 10:56:41 +02:00
} ) ;
BDFDB . ListenerUtils . add ( BDFDB , document , "mousedown.BDFDBMousePosition" , e => {
2019-11-03 16:53:33 +01:00
BDFDB . InternalData . mousePosition = e ;
2019-10-18 10:56:41 +02:00
} ) ;
BDFDB . ListenerUtils . add ( BDFDB , window , "focus.BDFDBPressedKeysReset" , e => {
2019-11-03 16:53:33 +01:00
BDFDB . InternalData . pressedKeys = [ ] ;
2019-10-18 10:56:41 +02:00
} ) ;
2019-11-15 11:37:05 +01:00
BDFDB . patchedModules = {
2020-02-07 19:28:20 +01:00
before : {
MessageContent : "type" ,
} ,
2019-11-14 17:40:04 +01:00
after : {
V2C _ContentColumn : "render" ,
V2C _PluginCard : "render" ,
V2C _ThemeCard : "render" ,
2020-02-07 19:40:53 +01:00
Mention : "default" ,
2020-02-04 09:17:14 +01:00
Message : "default" ,
2020-02-03 14:02:28 +01:00
MessageHeader : "default" ,
MemberListItem : "componentDidMount" ,
2019-11-14 17:40:04 +01:00
UserPopout : "componentDidMount" ,
UserProfile : "componentDidMount" ,
2020-01-31 10:41:46 +01:00
DiscordTag : "default"
2019-11-14 17:40:04 +01:00
}
2019-10-18 10:56:41 +02:00
} ;
2020-02-03 11:39:06 +01:00
InternalBDFDB . processV2CContentColumn = function ( e ) {
2019-11-11 10:48:30 +01:00
if ( window . PluginUpdates && window . PluginUpdates . plugins && e . instance . props . title == "Plugins" ) {
2019-11-03 18:31:51 +01:00
let [ children , index ] = BDFDB . ReactUtils . findChildren ( e . returnvalue , { key : "folder-button" } ) ;
2020-02-08 11:14:10 +01:00
if ( index > - 1 ) children . splice ( index + 1 , 0 , BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . TooltipContainer , {
2019-11-06 13:22:10 +01:00
text : "Only checks for updates of plugins, which support the updatecheck. Rightclick for a list of supported plugins. (Listed ≠ Outdated)" ,
2019-11-03 18:31:51 +01:00
tooltipConfig : {
selector : "update-button-tooltip" ,
style : "max-width: 420px"
} ,
children : BDFDB . ReactUtils . createElement ( "button" , {
className : ` ${ BDFDB . disCN . _repofolderbutton } bd-updatebtn ` ,
onClick : _ => { BDFDB . PluginUtils . checkAllUpdates ( ) ; } ,
onContextMenu : e => {
if ( window . PluginUpdates && window . PluginUpdates . plugins && ! document . querySelector ( ".update-list-tooltip" ) ) {
var pluginnames = [ ] ;
for ( let url in window . PluginUpdates . plugins ) pluginnames . push ( window . PluginUpdates . plugins [ url ] . name ) ;
BDFDB . TooltipUtils . create ( e . currentTarget , pluginnames . sort ( ) . join ( ", " ) , { type : "bottom" , selector : "update-list-tooltip" , style : "max-width: 420px" } ) ;
}
} ,
children : "Check for Updates"
} )
} ) ) ;
2019-10-18 10:56:41 +02:00
}
} ;
2020-02-03 11:39:06 +01:00
InternalBDFDB . _processCard = function ( e , data ) {
2019-11-03 19:21:41 +01:00
if ( e . instance . state && ! e . instance . state . settings ) {
let [ children , index ] = BDFDB . ReactUtils . findChildren ( e . returnvalue , { props : [ [ "className" , BDFDB . disCN . _repoauthor ] ] } ) ;
if ( index > - 1 ) {
let author = children [ index ] . props . children ;
if ( author && ( author == "DevilBro" || author . indexOf ( "DevilBro," ) == 0 ) ) {
2020-02-03 12:49:03 +01:00
let settings = BDFDB . DataUtils . get ( BDFDB , "settings" ) ;
2020-02-08 11:14:10 +01:00
children . splice ( index , 1 , BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Anchor , {
2019-11-03 19:21:41 +01:00
className : BDFDB . disCN . _repoauthor ,
children : "DevilBro" ,
onClick : e => {
BDFDB . ListenerUtils . stopEvent ( e ) ;
if ( BDFDB . UserUtils . me . id == "278543574059057154" ) return ;
let DMid = LibraryModules . ChannelStore . getDMFromUserId ( "278543574059057154" )
if ( DMid ) LibraryModules . SelectChannelUtils . selectPrivateChannel ( DMid ) ;
else LibraryModules . DirectMessageUtils . openPrivateChannel ( BDFDB . UserUtils . me . id , "278543574059057154" ) ;
2019-10-18 10:56:41 +02:00
let close = document . querySelector ( BDFDB . dotCNS . settingsclosebuttoncontainer + BDFDB . dotCN . settingsclosebutton ) ;
if ( close ) close . click ( ) ;
2019-11-03 19:21:41 +01:00
}
} ) ) ;
if ( author != "DevilBro" ) children . splice ( index + 1 , author . split ( "DevilBro" ) . slice ( 1 ) . join ( "DevilBro" ) ) ;
if ( data . changelog ) {
[ children , index ] = BDFDB . ReactUtils . findChildren ( e . returnvalue , { props : [ [ "className" , BDFDB . disCN . _repoversion ] ] } ) ;
2020-02-08 11:14:10 +01:00
if ( index > - 1 ) children [ index ] . props . children = [ children [ index ] . props . children , BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . TooltipContainer , {
2019-11-03 19:21:41 +01:00
text : BDFDB . LanguageUtils . LanguageStrings . CHANGE _LOG ,
children : BDFDB . ReactUtils . createElement ( "span" , {
2019-11-22 15:05:45 +01:00
className : BDFDB . disCN . changelogicon ,
2019-11-03 19:21:41 +01:00
children : " " ,
style : { whiteSpace : "pre" } ,
onClick : _ => { BDFDB . PluginUtils . openChangeLog ( data ) ; }
} )
} ) ] ;
}
[ children , index ] = BDFDB . ReactUtils . findChildren ( e . returnvalue , { props : [ [ "className" , BDFDB . disCN . _repolinks ] ] } ) ;
if ( index > - 1 ) {
2019-11-06 23:17:08 +01:00
if ( children [ index ] . props . children . filter ( n => n ) . length ) children [ index ] . props . children . push ( " | " ) ;
2019-11-03 19:21:41 +01:00
children [ index ] . props . children . push ( BDFDB . ReactUtils . createElement ( "a" , {
2019-11-06 23:17:08 +01:00
className : ` ${ BDFDB . disCN . _repolink } ` ,
2019-11-03 19:21:41 +01:00
target : "_blank" ,
children : "Support Server" ,
onClick : e => {
BDFDB . ListenerUtils . stopEvent ( e ) ;
let switchguild = _ => {
LibraryModules . GuildUtils . transitionToGuildSync ( "410787888507256842" ) ;
let close = document . querySelector ( BDFDB . dotCNS . settingsclosebuttoncontainer + BDFDB . dotCN . settingsclosebutton ) ;
if ( close ) close . click ( ) ;
} ;
if ( LibraryModules . GuildStore . getGuild ( "410787888507256842" ) ) switchguild ( ) ;
else LibraryModules . InviteUtils . acceptInvite ( "Jx3TjNS" ) . then ( _ => { switchguild ( ) ; } ) ;
}
} ) ) ;
2020-02-03 12:49:03 +01:00
if ( settings . addSupportLinks ) {
children [ index ] . props . children . push ( " | " ) ;
children [ index ] . props . children . push ( BDFDB . ReactUtils . createElement ( "a" , {
className : ` ${ BDFDB . disCN . _repolink } ` ,
target : "_blank" ,
href : "https://www.paypal.me/MircoWittrien" ,
children : "PayPal"
} ) ) ;
children [ index ] . props . children . push ( " | " ) ;
children [ index ] . props . children . push ( BDFDB . ReactUtils . createElement ( "a" , {
className : ` ${ BDFDB . disCN . _repolink } ` ,
target : "_blank" ,
href : "https://www.patreon.com/MircoWittrien" ,
children : "Patreon"
} ) ) ;
}
2019-10-18 10:56:41 +02:00
}
2020-02-03 12:49:03 +01:00
if ( BDFDB . ObjectUtils . toArray ( BDFDB . myPlugins ) . some ( n => n == data ) ) {
[ children , index ] = BDFDB . ReactUtils . findChildren ( e . returnvalue , { props : [ [ "className" , BDFDB . disCN . _repofooter ] ] } ) ;
if ( index == - 1 ) {
let footer = BDFDB . ReactUtils . createElement ( "div" , { className : BDFDB . disCN . _repofooter , children : [ ] } ) ;
e . returnvalue . props . children . push ( footer ) ;
children = footer . props . children ;
}
else {
children [ index ] . props . children = [ children [ index ] . props . children ] . flat ( ) ;
children = children [ index ] . props . children ;
}
children . splice ( children . length - 1 , 0 , BDFDB . ReactUtils . createElement ( "button" , {
className : BDFDB . disCNS . _reposettingsbutton ,
children : "Library Settings" ,
onClick : event => {
let wrapper = BDFDB . DOMUtils . getParent ( BDFDB . dotCN . _reposettingsclosed , event . currentTarget ) ;
if ( wrapper ) {
let settingsPanel = InternalBDFDB . createLibrarySettings ( ) ;
if ( settingsPanel ) {
BDFDB . DOMUtils . addClass ( wrapper , BDFDB . disCN . _reposettingsopen ) ;
BDFDB . DOMUtils . removeClass ( wrapper , BDFDB . disCN . _reposettingsclosed ) ;
let children = [ ] ;
while ( wrapper . childElementCount ) {
children . push ( wrapper . firstChild ) ;
wrapper . firstChild . remove ( ) ;
}
let closebutton = BDFDB . DOMUtils . create ( ` <div style="float: right; cursor: pointer;"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" style="width: 18px; height: 18px;"><g class="background" fill="none" fill-rule="evenodd"><path d="M0 0h12v12H0"></path><path class="fill" fill="#dcddde" 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"></path></g></svg></div> ` ) ;
wrapper . appendChild ( closebutton ) ;
closebutton . addEventListener ( "click" , _ => {
BDFDB . DOMUtils . removeClass ( wrapper , BDFDB . disCN . _reposettingsopen ) ;
BDFDB . DOMUtils . addClass ( wrapper , BDFDB . disCN . _reposettingsclosed ) ;
while ( wrapper . childElementCount ) wrapper . firstChild . remove ( ) ;
while ( children . length ) wrapper . appendChild ( children . shift ( ) ) ;
} ) ;
wrapper . appendChild ( settingsPanel ) ;
}
2020-02-03 11:39:06 +01:00
}
}
2020-02-03 12:49:03 +01:00
} ) ) ;
2020-02-03 11:07:48 +01:00
}
2020-02-03 12:49:03 +01:00
}
2020-02-03 11:07:48 +01:00
}
2019-10-18 10:56:41 +02:00
}
} ;
2020-02-03 11:39:06 +01:00
InternalBDFDB . processV2CPluginCard = function ( e ) { InternalBDFDB . _processCard ( e , e . instance . props . plugin ) ; } ;
InternalBDFDB . processV2CThemeCard = function ( e ) { InternalBDFDB . _processCard ( e , e . instance . props . theme ) ; } ;
InternalBDFDB . createLibrarySettings = function ( ) {
if ( ! window . BDFDB || typeof BDFDB != "object" || ! BDFDB . loaded ) return ;
let settings = BDFDB . DataUtils . get ( BDFDB , "settings" ) ;
let settingspanel , settingsitems = [ ] ;
2020-02-03 16:00:06 +01:00
let bdToastSetting = BDFDB . BDUtils . getSettings ( "fork-ps-2" ) ;
2020-02-03 11:39:06 +01:00
for ( let key in settings ) settingsitems . push ( BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . SettingsSaveItem , {
className : BDFDB . disCN . marginbottom8 ,
type : "Switch" ,
plugin : BDFDB ,
2020-02-03 16:00:06 +01:00
disabled : key == "showToasts" && bdToastSetting ,
2020-02-03 11:39:06 +01:00
keys : [ "settings" , key ] ,
label : InternalBDFDB . defaults . settings [ key ] . description ,
2020-02-03 16:00:06 +01:00
note : key == "showToasts" && bdToastSetting && "Disable BBDs general 'Show Toast' setting before disabling this" ,
dividerbottom : true ,
value : settings [ key ] || key == "showToasts" && bdToastSetting
2020-02-03 11:39:06 +01:00
} ) ) ;
return settingspanel = BDFDB . PluginUtils . createSettingsPanel ( BDFDB , settingsitems ) ;
} ;
2020-02-04 09:17:14 +01:00
let MessageHeaderRender = ( BDFDB . ModuleUtils . findByName ( "MessageHeader" , false ) || { exports : { } } ) . exports . default ;
if ( MessageHeaderRender ) InternalBDFDB . processMessage = function ( e ) {
if ( BDFDB . ReactUtils . getValue ( e , "instance.props.childrenHeader.type.type.displayName" ) == "MessageHeader" && ! e . instance . props . childrenHeader . type . type . _ _isBDFDBpatched ) {
e . instance . props . childrenHeader . type . type = MessageHeaderRender ;
}
} ;
2019-10-18 10:56:41 +02:00
2020-02-03 13:42:32 +01:00
const BDFDB _Patrons = [
"363785301195358221"
] ;
2020-02-03 14:02:28 +01:00
InternalBDFDB . _processAvatarRender = function ( user , avatar ) {
2020-02-03 14:12:46 +01:00
if ( BDFDB . ReactUtils . isValidElement ( avatar ) && BDFDB . ObjectUtils . is ( user ) ) {
2020-02-03 15:10:28 +01:00
let changed = false ;
2020-02-03 15:39:16 +01:00
if ( avatar . type == "img" ) avatar = BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . Avatar , Object . assign ( { } , avatar . props , {
className : BDFDB . DOMUtils . formatClassName ( ( avatar . props . className || "" ) . replace ( BDFDB . disCN . avatar , "" ) ) ,
size : BDFDB . LibraryComponents . Avatar . Sizes . SIZE _40
2020-02-03 15:45:54 +01:00
} ) ) ;
2020-02-03 14:02:28 +01:00
avatar . props [ "user_by_BDFDB" ] = user . id ;
2020-02-03 15:10:28 +01:00
if ( BDFDB _Patrons . includes ( user . id ) && BDFDB . DataUtils . get ( BDFDB , "settings" , "showSupportBadges" ) ) {
changed = true ;
avatar . props . className = BDFDB . DOMUtils . formatClassName ( avatar . props . className , BDFDB . disCN . bdfdbsupporter ) ;
}
if ( user . id == "278543574059057154" ) {
changed = true ;
avatar . props . className = BDFDB . DOMUtils . formatClassName ( avatar . props . className , BDFDB . disCN . bdfdbdev ) ;
}
if ( changed ) return avatar ;
2020-02-03 14:02:28 +01:00
}
} ;
InternalBDFDB . _processAvatarMount = function ( user , avatar ) {
2020-02-03 14:12:46 +01:00
if ( Node . prototype . isPrototypeOf ( avatar ) && BDFDB . ObjectUtils . is ( user ) ) {
2019-10-18 10:56:41 +02:00
avatar . setAttribute ( "user_by_BDFDB" , user . id ) ;
2020-02-03 13:42:32 +01:00
if ( BDFDB _Patrons . includes ( user . id ) && BDFDB . DataUtils . get ( BDFDB , "settings" , "showSupportBadges" ) ) BDFDB . DOMUtils . addClass ( avatar , BDFDB . disCN . bdfdbsupporter ) ;
if ( user . id == "278543574059057154" ) BDFDB . DOMUtils . addClass ( avatar , BDFDB . disCN . bdfdbdev ) ;
2020-02-03 14:02:28 +01:00
let status = avatar . querySelector ( BDFDB . dotCN . avatarpointerevents ) ;
2019-10-18 10:56:41 +02:00
if ( status ) {
2020-02-03 13:42:32 +01:00
status . addEventListener ( "mouseenter" , _ => { BDFDB . DOMUtils . addClass ( avatar , BDFDB . disCN . avatarstatushovered ) } ) ;
status . addEventListener ( "mouseleave" , _ => { BDFDB . DOMUtils . removeClass ( avatar , BDFDB . disCN . avatarstatushovered ) } ) ;
2019-10-18 10:56:41 +02:00
}
}
} ;
2020-02-03 14:02:28 +01:00
InternalBDFDB . processMessageHeader = function ( e ) {
if ( e . instance . props . message && e . instance . props . message . author ) {
2020-02-03 14:38:24 +01:00
let avatarWrapper = BDFDB . ReactUtils . getValue ( e , "returnvalue.props.children.0" ) ;
2020-02-03 14:02:28 +01:00
if ( avatarWrapper && avatarWrapper . props && typeof avatarWrapper . props . children == "function" ) {
let renderChildren = avatarWrapper . props . children ;
avatarWrapper . props . children = ( ... args ) => {
let renderedChildren = renderChildren ( ... args ) ;
2020-02-03 15:10:28 +01:00
return InternalBDFDB . _processAvatarRender ( e . instance . props . message . author , renderedChildren ) || renderedChildren ;
2020-02-03 14:06:34 +01:00
} ;
2020-02-03 14:02:28 +01:00
}
}
} ;
InternalBDFDB . processMemberListItem = function ( e ) {
InternalBDFDB . _processAvatarMount ( e . instance . props . user , e . node . querySelector ( BDFDB . dotCN . avatarwrapper ) ) ;
} ;
2020-02-03 11:39:06 +01:00
InternalBDFDB . processUserPopout = function ( e ) {
2020-02-03 14:02:28 +01:00
InternalBDFDB . _processAvatarMount ( e . instance . props . user , e . node . querySelector ( BDFDB . dotCN . userpopoutavatarwrapper ) ) ;
2019-10-18 10:56:41 +02:00
} ;
2020-02-03 11:39:06 +01:00
InternalBDFDB . processUserProfile = function ( e ) {
2020-02-03 14:02:28 +01:00
InternalBDFDB . _processAvatarMount ( e . instance . props . user , e . node . querySelector ( BDFDB . dotCN . avatarwrapper ) ) ;
2019-10-18 10:56:41 +02:00
} ;
2020-02-03 11:39:06 +01:00
InternalBDFDB . processDiscordTag = function ( e ) {
2020-01-31 10:41:46 +01:00
if ( e . instance && e . instance . props && e . instance . props . user && e . returnvalue ) e . returnvalue . props . user = e . instance . props . user ;
2019-10-18 10:56:41 +02:00
} ;
2020-02-07 19:28:20 +01:00
InternalBDFDB . processMessageContent = function ( e ) {
if ( BDFDB . ArrayUtils . is ( e . instance . props . content ) ) for ( let ele of e . instance . props . content ) {
if ( BDFDB . ReactUtils . isValidElement ( ele ) && typeof ele . props . render == "function" && BDFDB . ReactUtils . getValue ( ele , "props.children.type.displayName" ) == "Mention" ) {
let userId = BDFDB . ReactUtils . getValue ( ele . props . render ( ) , "props.userId" ) ;
if ( userId && ! ele . props . children . props . userId ) ele . props . children . props . userId = userId ;
}
}
} ;
2020-02-07 19:40:53 +01:00
InternalBDFDB . processMention = function ( e ) {
delete e . returnvalue . props . userId ;
} ;
2019-10-18 10:56:41 +02:00
2019-10-22 12:17:08 +02:00
InternalBDFDB . patchPlugin ( BDFDB ) ;
2019-10-23 11:10:01 +02:00
2020-02-08 11:14:10 +01:00
if ( InternalComponents . LibraryComponents . GuildComponents . BlobMask ) {
2019-11-26 11:19:13 +01:00
let newBadges = [ "lowerLeftBadge" , "upperLeftBadge" ] ;
2020-02-08 11:14:10 +01:00
BDFDB . ModuleUtils . patch ( BDFDB , InternalComponents . LibraryComponents . GuildComponents . BlobMask . prototype , "render" , {
2019-11-26 11:19:13 +01:00
before : e => {
2020-02-08 11:14:10 +01:00
e . thisObject . props = Object . assign ( { } , InternalComponents . LibraryComponents . GuildComponents . BlobMask . defaultProps , e . thisObject . props ) ;
for ( let type of newBadges ) if ( ! e . thisObject . state [ ` ${ type } Mask ` ] ) e . thisObject . state [ ` ${ type } Mask ` ] = new InternalComponents . LibraryComponents . Animations . Controller ( { spring : 0 } ) ;
2019-11-26 11:19:13 +01:00
} ,
after : e => {
let [ children , index ] = BDFDB . ReactUtils . findChildren ( e . returnValue , { name : "TransitionGroup" } ) ;
if ( index > - 1 ) {
children [ index ] . props . children . push ( ! e . thisObject . props . lowerLeftBadge ? null : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . BadgeComponents . AnimationContainer , {
className : BDFDB . disCN . guildlowerleftbadge ,
key : "lower-left-badge" ,
animatedStyle : e . thisObject . getLowerLeftBadgeStyles ( ) ,
children : e . thisObject . props . lowerLeftBadge
} ) ) ;
children [ index ] . props . children . push ( ! e . thisObject . props . upperLeftBadge ? null : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . BadgeComponents . AnimationContainer , {
className : BDFDB . disCN . guildupperleftbadge ,
key : "upper-left-badge" ,
animatedStyle : e . thisObject . getUpperLeftBadgeStyles ( ) ,
children : e . thisObject . props . upperLeftBadge
} ) ) ;
}
[ children , index ] = BDFDB . ReactUtils . findChildren ( e . returnValue , { name : "mask" } ) ;
if ( index > - 1 ) {
2020-02-08 11:14:10 +01:00
children [ index ] . props . children . push ( BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Animations . animated . rect , {
2019-11-28 09:08:00 +01:00
x : - 4 ,
2019-11-26 11:19:13 +01:00
y : - 4 ,
2019-11-26 11:22:52 +01:00
width : e . thisObject . props . upperLeftBadgeWidth + 8 ,
2019-11-26 11:19:13 +01:00
height : 24 ,
rx : 12 ,
ry : 12 ,
transform : e . thisObject . getLeftBadgePositionInterpolation ( e . thisObject . state . upperLeftBadgeMask , - 1 ) ,
fill : "black"
} ) ) ;
2020-02-08 11:14:10 +01:00
children [ index ] . props . children . push ( BDFDB . ReactUtils . createElement ( InternalComponents . LibraryComponents . Animations . animated . rect , {
2019-11-28 09:08:00 +01:00
x : - 4 ,
2019-11-26 11:19:13 +01:00
y : 28 ,
2019-11-26 11:22:52 +01:00
width : e . thisObject . props . lowerLeftBadgeWidth + 8 ,
2019-11-26 11:19:13 +01:00
height : 24 ,
rx : 12 ,
ry : 12 ,
transform : e . thisObject . getLeftBadgePositionInterpolation ( e . thisObject . state . lowerLeftBadgeMask ) ,
fill : "black"
} ) ) ;
}
}
} ) ;
2020-02-08 11:14:10 +01:00
BDFDB . ModuleUtils . patch ( BDFDB , InternalComponents . LibraryComponents . GuildComponents . BlobMask . prototype , "componentDidMount" , {
2019-11-26 11:19:13 +01:00
after : e => {
for ( let type of newBadges ) e . thisObject . state [ ` ${ type } Mask ` ] . update ( {
2019-11-28 08:55:02 +01:00
spring : e . thisObject . props [ type ] != null ? 1 : 0 ,
immediate : true
2019-11-26 11:19:13 +01:00
} ) . start ( ) ;
}
} ) ;
2020-02-08 11:14:10 +01:00
BDFDB . ModuleUtils . patch ( BDFDB , InternalComponents . LibraryComponents . GuildComponents . BlobMask . prototype , "componentWillUnmount" , {
2019-11-26 11:19:13 +01:00
after : e => {
2019-11-28 08:55:02 +01:00
for ( let type of newBadges ) if ( e . thisObject . state [ ` ${ type } Mask ` ] ) e . thisObject . state [ ` ${ type } Mask ` ] . destroy ( ) ;
2019-11-26 11:19:13 +01:00
}
} ) ;
2020-02-08 11:14:10 +01:00
BDFDB . ModuleUtils . patch ( BDFDB , InternalComponents . LibraryComponents . GuildComponents . BlobMask . prototype , "componentDidUpdate" , {
2019-11-26 11:19:13 +01:00
after : e => {
2019-11-28 08:55:02 +01:00
for ( let type of newBadges ) if ( e . thisObject . props [ type ] != null && e . methodArguments [ 0 ] [ type ] == null ) {
e . thisObject . state [ ` ${ type } Mask ` ] . update ( {
spring : 1 ,
immediate : ! document . hasFocus ( ) ,
config : { friction : 30 , tension : 900 , mass : 1 }
} ) . start ( ) ;
}
else if ( e . thisObject . props [ type ] == null && e . methodArguments [ 0 ] [ type ] != null ) {
e . thisObject . state [ ` ${ type } Mask ` ] . update ( {
spring : 0 ,
immediate : ! document . hasFocus ( ) ,
config : { duration : 150 , friction : 10 , tension : 100 , mass : 1 }
} ) . start ( ) ;
2019-11-26 11:19:13 +01:00
}
}
} ) ;
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . GuildComponents . BlobMask . prototype . getLeftBadgePositionInterpolation = function ( e , t ) {
2019-11-26 11:19:13 +01:00
return void 0 === t && ( t = 1 ) , e . animated . spring . to ( [ 0 , 1 ] , [ 20 , 0 ] ) . to ( function ( e ) {
2019-11-28 08:55:02 +01:00
return "translate(" + e * - 1 + " " + e * t + ")" ;
2019-11-26 11:19:13 +01:00
} ) ;
} ;
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . GuildComponents . BlobMask . prototype . getLowerLeftBadgeStyles = function ( ) {
2019-11-26 12:21:05 +01:00
var e = this . state . lowerLeftBadgeMask . animated . spring ;
2019-11-26 11:19:13 +01:00
return {
opacity : e . to ( [ 0 , . 5 , 1 ] , [ 0 , 0 , 1 ] ) ,
transform : e . to ( function ( e ) {
2019-11-28 08:55:02 +01:00
return "translate(" + - 1 * ( 16 - 16 * e ) + "px, " + ( 16 - 16 * e ) + "px)" ;
2019-11-26 11:19:13 +01:00
} )
2019-11-28 08:55:02 +01:00
} ;
2019-11-26 11:19:13 +01:00
} ;
2020-02-08 11:14:10 +01:00
InternalComponents . LibraryComponents . GuildComponents . BlobMask . prototype . getUpperLeftBadgeStyles = function ( ) {
2019-11-26 12:21:05 +01:00
var e = this . state . upperLeftBadgeMask . animated . spring ;
2019-11-26 11:19:13 +01:00
return {
opacity : e . to ( [ 0 , . 5 , 1 ] , [ 0 , 0 , 1 ] ) ,
transform : e . to ( function ( e ) {
2019-11-28 08:55:02 +01:00
return "translate(" + - 1 * ( 16 - 16 * e ) + "px, " + - 1 * ( 16 - 16 * e ) + "px)" ;
2019-11-26 11:19:13 +01:00
} )
2019-11-28 08:55:02 +01:00
} ;
2019-11-26 11:19:13 +01:00
} ;
2019-11-26 11:42:37 +01:00
let extraDefaultProps = { } ;
for ( let type of newBadges ) extraDefaultProps [ ` ${ type } Width ` ] = 16 ;
2020-02-08 11:14:10 +01:00
InternalBDFDB . setDefaultProps ( InternalComponents . LibraryComponents . GuildComponents . BlobMask , extraDefaultProps ) ;
2019-11-26 11:19:13 +01:00
}
2019-10-23 13:33:53 +02:00
2019-10-23 11:10:01 +02:00
BDFDB . ModuleUtils . patch ( BDFDB , LibraryModules . GuildStore , "getGuild" , { after : e => {
if ( e . returnValue && e . methodArguments [ 0 ] == "410787888507256842" && ! e . returnValue . banner ) {
e . returnValue . banner = " data : image / png ; base64 , iVBORw0KGgoAAAANSUhEUgAABkAAAAMgCAIAAAD0ojkNAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89 + bN / rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz / SMBAPh + PDwrIsAHvgABeNMLCADATZvAMByH / w / qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf + bTAICd + Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA / g88wAAKCRFRHgg / P9eM4Ors7ONo62Dl8t6r8G / yJiYuP + 5 c + rcEAAAOF0ftH + LC + zGoA7BoBt / qIl7gRoXgugdfeLZrIPQLUAoOnaV / Nw + H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl / AV / 1 s + X48 / Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H / LcL //wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAcFtJREFUeNrs/Xm8JldBJ/7XqXq2u/a+Zukk3ensG0kISxIWJwgBESGADOogouDoqDCiKLJ8BREXRMVhBv0hg8wXHUW+oARCwEDIQkL2felOdzq9r3dfnq3O748OGCFLd5J7u+6t9/ulgXT3fer2p85zq54P55wKq1atSgAAAACgqFIRAAAAAFBkCiwAAAAACk2BBQAAAEChKbAAAAAAKDQFFgAAAACFpsACAAAAoNAUWAAAAAAUmgILAAAAgEJTYAEAAABQaAosAAAAAApNgQUAAABAoSmwAAAAACg0BRYAAAAAhabAAgAAAKDQFFgAAAAAFJoCCwAAAIBCU2ABAAAAUGgKLAAAAAAKTYEFAAAAQKEpsAAAAAAoNA
}
} } ) ;
BDFDB . ModuleUtils . patch ( BDFDB , LibraryModules . IconUtils , "getGuildBannerURL" , { instead : e => {
return e . methodArguments [ 0 ] . id == "410787888507256842" ? e . methodArguments [ 0 ] . banner : e . callOriginalMethod ( ) ;
} } ) ;
2019-10-22 18:55:25 +02:00
2020-02-08 11:14:10 +01:00
for ( let type of ComponentTypeData . NormalContextMenus ) InternalBDFDB . patchContextMenuLib ( InternalComponents . LibraryComponents . ContextMenus [ type ] , false ) ;
2020-01-30 15:46:30 +01:00
for ( let type of ComponentTypeData . FluxContextMenus ) {
if ( ! BDFDB . InternalData . componentPatchQueries [ type ] ) BDFDB . InternalData . componentPatchQueries [ type ] = { query : [ ] , module : null } ;
2020-02-08 11:14:10 +01:00
InternalBDFDB . patchContextMenuLib ( InternalComponents . LibraryComponents . ContextMenus [ type ] , true ) ;
2019-12-05 09:10:14 +01:00
}
2020-01-30 15:46:30 +01:00
for ( let type of ComponentTypeData . QueuedComponents ) if ( ! BDFDB . InternalData . componentPatchQueries [ type ] ) BDFDB . InternalData . componentPatchQueries [ type ] = { query : [ ] , module : null } ;
if ( ComponentTypeData . NonRenderContextMenus . length ) BDFDB . ModuleUtils . patch ( BDFDB , LibraryModules . ContextMenuUtils , "openContextMenu" , { before : e => {
2020-01-07 10:46:01 +01:00
let menu = e . methodArguments [ 1 ] ( ) ;
2020-01-14 15:08:18 +01:00
if ( BDFDB . ObjectUtils . is ( menu ) ) {
2020-01-30 11:30:07 +01:00
let type = InternalBDFDB . getContextMenuType ( menu . type && menu . type . displayName || menu . props && menu . props . type , menu ) ;
2020-01-30 15:46:30 +01:00
if ( type && ComponentTypeData . NonRenderContextMenus . includes ( type ) ) InternalBDFDB . patchExportedContextMenuLib ( menu , type , false ) ;
2020-01-07 10:43:01 +01:00
}
} } ) ;
2020-01-30 15:46:30 +01:00
if ( ComponentTypeData . ObservedContextMenus . length ) BDFDB . ObserverUtils . connect ( BDFDB , BDFDB . dotCN . appmount + " > * > " + BDFDB . dotCN . itemlayercontainer , { name : "contextMenuObserver" , instance : ( new MutationObserver ( changes => { changes . forEach ( change => { change . addedNodes . forEach ( node => {
2020-01-30 12:01:54 +01:00
let menu = node && node . nodeType != Node . TEXT _NODE && ( BDFDB . ReactUtils . getInstance ( node . querySelector ( BDFDB . dotCN . contextmenu ) ) || { } ) . return ;
2020-01-30 11:30:07 +01:00
if ( BDFDB . ObjectUtils . is ( menu ) ) {
let type = InternalBDFDB . getContextMenuType ( menu . type && menu . type . displayName || menu . props && menu . props . type , menu ) ;
2020-01-30 15:46:30 +01:00
if ( type && ComponentTypeData . ObservedContextMenus . includes ( type ) ) InternalBDFDB . patchExportedContextMenuLib ( menu , type , true ) ;
2020-01-30 11:30:07 +01:00
}
} ) ; } ) ; } ) ) } , { childList : true } ) ;
2020-01-30 15:46:30 +01:00
BDFDB . ModuleUtils . patch ( BDFDB , BDFDB . ReactUtils . getValue ( BDFDB . ModuleUtils . findByString ( "renderReactions" , "canAddNewReactions" , "showMoreUtilities" , false ) , "exports.default" ) , "type" , { after : e => {
let [ children , index ] = BDFDB . ReactUtils . findChildren ( e . returnValue , { filter : c => c && c . props && c . props . showMoreUtilities != undefined && c . props . showEmojiPicker != undefined && c . props . setPopout != undefined } ) ;
if ( index > - 1 ) BDFDB . ModuleUtils . patch ( BDFDB , children [ index ] , "type" , { after : e2 => {
let [ children2 , index2 ] = BDFDB . ReactUtils . findChildren ( e2 . returnValue , { name : "Popout" } ) ;
2020-02-03 10:22:24 +01:00
let popoutWrapper = children2 [ index2 ] ;
2020-01-30 16:51:44 +01:00
InternalBDFDB . executeExtraPatchedPatches ( "MessageOptionToolbar" , { instance : { props : Object . assign ( { } , e2 . methodArguments [ 0 ] , { hasMorePopout : index2 > - 1 } ) } , returnvalue : e2 . returnValue , methodname : "default" } ) ;
2020-02-03 10:22:24 +01:00
if ( popoutWrapper && typeof popoutWrapper . props . renderPopout == "function" ) {
let renderPopout = popoutWrapper . props . renderPopout ;
popoutWrapper . props . renderPopout = ( ... args ) => {
2020-01-30 15:46:30 +01:00
let renderedPopout = renderPopout ( ... args ) ;
BDFDB . ModuleUtils . patch ( BDFDB , renderedPopout , "type" , { after : e3 => { InternalBDFDB . executeExtraPatchedPatches ( "MessageOptionContextMenu" , { instance : { props : e3 . methodArguments [ 0 ] } , returnvalue : e3 . returnValue , methodname : "default" } ) ; } } ) ;
return renderedPopout ;
2020-01-30 13:37:01 +01:00
}
2020-01-30 15:46:30 +01:00
}
2020-01-30 13:37:01 +01:00
} } ) ;
2020-01-30 15:46:30 +01:00
} } ) ;
2019-10-18 10:56:41 +02:00
2019-10-20 20:57:23 +02:00
BDFDB . ModuleUtils . forceAllUpdates ( BDFDB ) ;
2019-10-18 10:56:41 +02:00
2019-10-18 11:50:38 +02:00
InternalBDFDB . addContextListeners ( BDFDB ) ;
2019-10-18 10:56:41 +02:00
2019-10-22 14:20:12 +02:00
if ( BDFDB . UserUtils . me . id == "278543574059057154" ) {
2019-11-03 16:53:33 +01:00
for ( let module in DiscordClassModules ) if ( ! DiscordClassModules [ module ] ) BDFDB . LogUtils . warn ( module + " not initialized in DiscordClassModules" ) ;
2019-11-07 19:13:53 +01:00
for ( let obj in DiscordObjects ) if ( ! DiscordObjects [ obj ] ) BDFDB . LogUtils . warn ( obj + " not initialized in DiscordObjects" ) ;
2019-11-03 16:53:33 +01:00
for ( let require in LibraryRequires ) if ( ! LibraryRequires [ require ] ) BDFDB . LogUtils . warn ( require + " not initialized in LibraryRequires" ) ;
for ( let module in LibraryModules ) if ( ! LibraryModules [ module ] ) BDFDB . LogUtils . warn ( module + " not initialized in LibraryModules" ) ;
2020-02-08 11:14:10 +01:00
for ( let component in InternalComponents . NativeSubComponents ) if ( ! InternalComponents . NativeSubComponents [ component ] ) BDFDB . LogUtils . warn ( component + " not initialized in NativeSubComponents" ) ;
for ( let component in InternalComponents . LibraryComponents ) if ( ! InternalComponents . LibraryComponents [ component ] ) BDFDB . LogUtils . warn ( component + " not initialized in LibraryComponents" ) ;
2019-10-18 10:56:41 +02:00
2019-10-20 20:57:23 +02:00
BDFDB . ModuleUtils . DevFuncs = { } ;
2019-10-28 08:54:57 +01:00
BDFDB . ModuleUtils . DevFuncs . generateClassId = function ( index ) {
let chars = "0123456789ABCDEFGHIJKMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_" . split ( "" ) ;
let id = "" ;
while ( id . length < 6 ) id += chars [ Math . floor ( Math . random ( ) * chars . length ) ] ;
return id ;
} ;
2019-10-20 20:57:23 +02:00
BDFDB . ModuleUtils . DevFuncs . findByIndex = function ( index ) {
2019-11-18 13:46:07 +01:00
return InternalBDFDB . getWebModuleReq ( ) . c [ index ] ;
2019-10-18 10:56:41 +02:00
} ;
2019-10-20 20:57:23 +02:00
BDFDB . ModuleUtils . DevFuncs . findPropAny = function ( strings ) {
2019-10-18 14:56:41 +02:00
strings = BDFDB . ArrayUtils . is ( strings ) ? strings : Array . from ( arguments ) ;
2019-11-01 10:16:54 +01:00
var req = InternalBDFDB . getWebModuleReq ( ) ; window . t = { "$filter" : ( prop => strings . every ( string => prop . toLowerCase ( ) . indexOf ( string . toLowerCase ( ) ) > - 1 ) ) } ;
2019-10-18 10:56:41 +02:00
for ( let i in req . c ) if ( req . c . hasOwnProperty ( i ) ) {
let m = req . c [ i ] . exports ;
if ( m && typeof m == "object" ) for ( let j in m ) if ( window . t . $filter ( j ) ) window . t [ j + "_" + i ] = m ;
if ( m && typeof m == "object" && typeof m . default == "object" ) for ( let j in m . default ) if ( window . t . $filter ( j ) ) window . t [ j + "_default_" + i ] = m . default ;
}
console . clear ( ) ;
console . log ( window . t ) ;
} ;
2019-10-20 20:57:23 +02:00
BDFDB . ModuleUtils . DevFuncs . findPropFunc = function ( strings ) {
2019-10-18 14:56:41 +02:00
strings = BDFDB . ArrayUtils . is ( strings ) ? strings : Array . from ( arguments ) ;
2019-11-01 10:16:54 +01:00
var req = InternalBDFDB . getWebModuleReq ( ) ; window . t = { "$filter" : ( prop => strings . every ( string => prop . toLowerCase ( ) . indexOf ( string . toLowerCase ( ) ) > - 1 ) ) } ;
2019-10-18 10:56:41 +02:00
for ( let i in req . c ) if ( req . c . hasOwnProperty ( i ) ) {
let m = req . c [ i ] . exports ;
if ( m && typeof m == "object" ) for ( let j in m ) if ( window . t . $filter ( j ) && typeof m [ j ] != "string" ) window . t [ j + "_" + i ] = m ;
if ( m && typeof m == "object" && typeof m . default == "object" ) for ( let j in m . default ) if ( window . t . $filter ( j ) && typeof m . default [ j ] != "string" ) window . t [ j + "_default_" + i ] = m . default ;
}
console . clear ( ) ;
console . log ( window . t ) ;
} ;
2019-10-20 20:57:23 +02:00
BDFDB . ModuleUtils . DevFuncs . findPropStringLib = function ( strings ) {
2019-10-18 14:56:41 +02:00
strings = BDFDB . ArrayUtils . is ( strings ) ? strings : Array . from ( arguments ) ;
2019-11-01 10:16:54 +01:00
var req = InternalBDFDB . getWebModuleReq ( ) ; window . t = { "$filter" : ( prop => strings . every ( string => prop . toLowerCase ( ) . indexOf ( string . toLowerCase ( ) ) > - 1 ) ) } ;
2019-10-18 10:56:41 +02:00
for ( let i in req . c ) if ( req . c . hasOwnProperty ( i ) ) {
let m = req . c [ i ] . exports ;
if ( m && typeof m == "object" ) for ( let j in m ) if ( window . t . $filter ( j ) && typeof m [ j ] == "string" && /^[A-z0-9]+\-[A-z0-9_-]{6}$/ . test ( m [ j ] ) ) window . t [ j + "_" + i ] = m ;
if ( m && typeof m == "object" && typeof m . default == "object" ) for ( let j in m . default ) if ( window . t . $filter ( j ) && typeof m . default [ j ] == "string" && /^[A-z0-9]+\-[A-z0-9_-]{6}$/ . test ( m . default [ j ] ) ) window . t [ j + "_default_" + i ] = m . default ;
}
console . clear ( ) ;
console . log ( window . t ) ;
} ;
2019-10-20 20:57:23 +02:00
BDFDB . ModuleUtils . DevFuncs . findNameAny = function ( strings ) {
2019-10-18 14:56:41 +02:00
strings = BDFDB . ArrayUtils . is ( strings ) ? strings : Array . from ( arguments ) ;
2019-11-01 10:16:54 +01:00
var req = InternalBDFDB . getWebModuleReq ( ) ; window . t = { "$filter" : ( modu => strings . some ( string => typeof modu . displayName == "string" && modu . displayName . toLowerCase ( ) . indexOf ( string . toLowerCase ( ) ) > - 1 || modu . name == "string" && modu . name . toLowerCase ( ) . indexOf ( string . toLowerCase ( ) ) > - 1 ) ) } ;
2019-10-18 10:56:41 +02:00
for ( let i in req . c ) if ( req . c . hasOwnProperty ( i ) ) {
let m = req . c [ i ] . exports ;
if ( m && ( typeof m == "object" || typeof m == "function" ) && window . t . $filter ( m ) ) window . t [ ( m . displayName || m . name ) + "_" + i ] = m ;
if ( m && ( typeof m == "object" || typeof m == "function" ) && m . default && ( typeof m . default == "object" || typeof m . default == "function" ) && window . t . $filter ( m . default ) ) window . t [ ( m . default . displayName || m . default . name ) + "_" + i ] = m . default ;
}
console . clear ( ) ;
console . log ( window . t ) ;
} ;
2019-10-20 20:57:23 +02:00
BDFDB . ModuleUtils . DevFuncs . findCodeAny = function ( strings ) {
2019-10-18 14:56:41 +02:00
strings = BDFDB . ArrayUtils . is ( strings ) ? strings : Array . from ( arguments ) ;
2019-11-01 10:16:54 +01:00
var req = InternalBDFDB . getWebModuleReq ( ) ; window . t = { "$filter" : ( prop => strings . every ( string => prop . toLowerCase ( ) . indexOf ( string . toLowerCase ( ) ) > - 1 ) ) } ;
2019-10-18 10:56:41 +02:00
for ( let i in req . c ) if ( req . c . hasOwnProperty ( i ) ) {
let m = req . c [ i ] . exports ;
if ( m && typeof m == "object" ) for ( let j in m ) {
let f = m [ j ] ;
if ( typeof f == "function" && window . t . $filter ( f . toString ( ) ) ) window . t [ j + "_module_" + i ] = { string : f . toString ( ) , func : f , module : m } ;
}
if ( m && typeof m == "object" && typeof m . default == "object" ) for ( let j in m . default ) {
let f = m . default [ j ] ;
if ( typeof f == "function" && window . t . $filter ( f . toString ( ) ) ) window . t [ j + "_default_" + i ] = { string : f . toString ( ) , func : f , module : m . default } ;
}
}
for ( let i in req . m ) {
let f = req . m [ i ] ;
if ( typeof f == "function" && window . t . $filter ( f . toString ( ) ) ) window . t [ "funtion_" + i ] = { string : f . toString ( ) , func : f } ;
}
console . clear ( ) ;
console . log ( window . t ) ;
} ;
2019-10-20 20:57:23 +02:00
BDFDB . ModuleUtils . DevFuncs . getAllModules = function ( ) {
2019-11-01 10:16:54 +01:00
var req = InternalBDFDB . getWebModuleReq ( ) ; window . t = { } ;
2019-10-18 10:56:41 +02:00
for ( let i in req . c ) if ( req . c . hasOwnProperty ( i ) ) {
let m = req . c [ i ] . exports ;
if ( m && typeof m == "object" ) window . t [ i ] = m ;
}
console . clear ( ) ;
console . log ( window . t ) ;
} ;
2019-10-20 20:57:23 +02:00
BDFDB . ModuleUtils . DevFuncs . getAllStringLibs = function ( ) {
2019-11-01 10:16:54 +01:00
var req = InternalBDFDB . getWebModuleReq ( ) ; window . t = [ ] ;
2019-10-18 10:56:41 +02:00
for ( let i in req . c ) if ( req . c . hasOwnProperty ( i ) ) {
let m = req . c [ i ] . exports ;
2019-10-18 14:56:41 +02:00
if ( m && typeof m == "object" && ! BDFDB . ArrayUtils . is ( m ) && Object . keys ( m ) . length ) {
2019-10-18 10:56:41 +02:00
var string = true , stringlib = false ;
for ( let j in m ) {
if ( typeof m [ j ] != "string" ) string = false ;
if ( typeof m [ j ] == "string" && /^[A-z0-9]+\-[A-z0-9_-]{6}$/ . test ( m [ j ] ) ) stringlib = true ;
}
if ( string && stringlib ) window . t . push ( m ) ;
}
2019-10-18 14:56:41 +02:00
if ( m && typeof m == "object" && m . default && typeof m . default == "object" && ! BDFDB . ArrayUtils . is ( m . default ) && Object . keys ( m . default ) . length ) {
2019-10-18 10:56:41 +02:00
var string = true , stringlib = false ;
for ( let j in m . default ) {
if ( typeof m . default [ j ] != "string" ) string = false ;
if ( typeof m . default [ j ] == "string" && /^[A-z0-9]+\-[A-z0-9_-]{6}$/ . test ( m . default [ j ] ) ) stringlib = true ;
}
if ( string && stringlib ) window . t . push ( m . default ) ;
}
}
console . clear ( ) ;
console . log ( window . t ) ;
} ;
2019-10-20 20:57:23 +02:00
BDFDB . ModuleUtils . DevFuncs . listen = function ( strings ) {
2019-10-18 14:56:41 +02:00
strings = BDFDB . ArrayUtils . is ( strings ) ? strings : Array . from ( arguments ) ;
2019-10-20 20:57:23 +02:00
BDFDB . ModuleUtils . DevFuncs . listenstop ( ) ;
BDFDB . ModuleUtils . DevFuncs . listen . p = BDFDB . ModuleUtils . patch ( "WebpackSearch" , BDFDB . ModuleUtils . findByProperties ( strings ) , strings [ 0 ] , { after : e => {
2019-10-18 10:56:41 +02:00
console . log ( e ) ;
} } ) ;
} ;
2019-10-20 20:57:23 +02:00
BDFDB . ModuleUtils . DevFuncs . listenstop = function ( ) {
2019-10-23 12:08:05 +02:00
if ( typeof BDFDB . ModuleUtils . DevFuncs . listen . p == "function" ) BDFDB . ModuleUtils . DevFuncs . listen . p ( ) ;
2019-10-18 10:56:41 +02:00
} ;
2019-11-01 10:16:54 +01:00
BDFDB . ModuleUtils . DevFuncs . req = InternalBDFDB . getWebModuleReq ( ) ;
2019-10-18 10:56:41 +02:00
}
2019-11-07 19:21:10 +01:00
for ( let obj in DiscordObjects ) if ( ! DiscordObjects [ obj ] ) {
2019-11-07 19:06:36 +01:00
DiscordObjects [ obj ] = function ( ) { } ;
BDFDB . DiscordObjects [ obj ] = function ( ) { } ;
}
2020-02-08 11:14:10 +01:00
for ( let component in InternalComponents . NativeSubComponents ) if ( ! InternalComponents . NativeSubComponents [ component ] ) InternalComponents . NativeSubComponents [ component ] = "div" ;
for ( let component in InternalComponents . LibraryComponents ) if ( ! InternalComponents . LibraryComponents [ component ] ) {
InternalComponents . LibraryComponents [ component ] = "div" ;
2019-10-18 10:56:41 +02:00
BDFDB . LibraryComponents [ component ] = "div" ;
}
BDFDB . loadMessage = BDFDB . PluginUtils . init ;
BDFDB . unloadMessage = BDFDB . PluginUtils . clear ;
BDFDB . createSettingsPanel = BDFDB . PluginUtils . createSettingsPanel ;
2019-10-19 11:41:39 +02:00
2019-10-18 10:56:41 +02:00
BDFDB . addObserver = BDFDB . ObserverUtils . connect ;
BDFDB . killObservers = BDFDB . ObserverUtils . disconnect ;
2019-10-19 11:41:39 +02:00
2019-10-18 10:56:41 +02:00
BDFDB . addEventListener = BDFDB . ListenerUtils . add ;
BDFDB . removeEventListener = BDFDB . ListenerUtils . remove ;
BDFDB . addChildEventListener = BDFDB . ListenerUtils . addToChildren ;
BDFDB . copyEvent = BDFDB . ListenerUtils . copyEvent ;
BDFDB . stopEvent = BDFDB . ListenerUtils . stopEvent ;
2019-10-19 11:41:39 +02:00
2019-10-18 10:56:41 +02:00
BDFDB . showToast = BDFDB . NotificationUtils . toast ;
BDFDB . showDesktopNotification = BDFDB . NotificationUtils . desktop ;
BDFDB . createNotificationsBar = BDFDB . NotificationUtils . notice ;
2019-10-19 11:41:39 +02:00
2019-10-18 12:10:53 +02:00
BDFDB . createTooltip = ( string , ele , config ) => { return BDFDB . TooltipUtils . create ( ele , string , config ) ; } ;
2019-10-18 10:56:41 +02:00
BDFDB . updateTooltipPosition = BDFDB . TooltipUtils . update ;
2019-10-19 11:41:39 +02:00
2019-10-18 10:56:41 +02:00
BDFDB . isObject = BDFDB . ObjectUtils . is ;
BDFDB . sortObject = BDFDB . ObjectUtils . sort ;
BDFDB . reverseObject = BDFDB . ObjectUtils . reverse ;
BDFDB . filterObject = BDFDB . ObjectUtils . filter ;
BDFDB . mapObject = BDFDB . ObjectUtils . map ;
BDFDB . isObjectEmpty = BDFDB . ObjectUtils . isEmpty ;
2019-10-19 11:41:39 +02:00
2019-10-22 14:20:12 +02:00
BDFDB . sortArrayByKey = BDFDB . ArrayUtils . keySort ;
BDFDB . numSortArray = BDFDB . ArrayUtils . numSort ;
BDFDB . removeFromArray = BDFDB . ArrayUtils . remove ;
BDFDB . getAllIndexes = BDFDB . ArrayUtils . getAllIndexes ;
BDFDB . removeCopiesFromArray = BDFDB . ArrayUtils . removeCopies ;
2019-10-21 12:11:46 +02:00
BDFDB . React = Object . assign ( { } , BDFDB . ReactUtils ) ;
2019-10-21 10:36:00 +02:00
BDFDB . getKeyInformation = ( config ) => { return BDFDB . ReactUtils . findValue ( config . node || config . instance , config . key , config ) ; } ;
2019-10-20 20:57:23 +02:00
BDFDB . getReactInstance = BDFDB . ReactUtils . getInstance ;
2019-10-21 12:11:46 +02:00
BDFDB . getOwnerInstance = ( config ) => { return BDFDB . ReactUtils . findOwner ( config . node || config . instance , config ) ; } ;
BDFDB . ReactUtils . getOwner = BDFDB . ReactUtils . findOwner ;
2019-10-21 17:06:50 +02:00
BDFDB . getContextMenuGroupAndIndex = ( startchildren , names ) => { return BDFDB . ReactUtils . findChildren ( startchildren , { name : names , props : [ [ "label" , names ] ] } ) ; } ;
2019-10-20 20:57:23 +02:00
BDFDB . getReactValue = BDFDB . ReactUtils . getValue ;
2019-10-20 21:11:35 +02:00
BDFDB . WebModules = Object . assign ( { } , BDFDB . ModuleUtils ) ;
2019-10-20 20:57:23 +02:00
BDFDB . WebModules . patch = ( module , modulefunctions , plugin , patchfunctions ) => { return BDFDB . ModuleUtils . patch ( plugin , module , modulefunctions , patchfunctions ) } ;
2019-10-22 14:20:12 +02:00
BDFDB . ModuleUtils . initiateProcess = InternalBDFDB . initiateProcess ;
BDFDB . WebModules . initiateProcess = InternalBDFDB . initiateProcess ;
2019-10-20 20:57:23 +02:00
2019-10-22 14:20:12 +02:00
BDFDB . myData = BDFDB . UserUtils . me ;
BDFDB . getUserStatus = BDFDB . UserUtils . getStatus ;
BDFDB . getUserStatusColor = BDFDB . UserUtils . getStatusColor ;
BDFDB . getUserAvatar = BDFDB . UserUtils . getAvatar ;
BDFDB . isUserAllowedTo = BDFDB . UserUtils . can ;
BDFDB . getGuildIcon = BDFDB . GuildUtils . getIcon ;
BDFDB . getGuildBanner = BDFDB . GuildUtils . getBanner ;
BDFDB . getServerDiv = BDFDB . GuildUtils . getDiv ;
BDFDB . getServerData = BDFDB . GuildUtils . getData ;
BDFDB . readServerList = BDFDB . GuildUtils . getAll ;
BDFDB . readUnreadServerList = BDFDB . GuildUtils . getUnread ;
BDFDB . readPingedServerList = BDFDB . GuildUtils . getPinged ;
BDFDB . readMutedServerList = BDFDB . GuildUtils . getMuted ;
BDFDB . getSelectedServer = BDFDB . GuildUtils . getSelected ;
BDFDB . openGuildContextMenu = BDFDB . GuildUtils . openMenu ;
BDFDB . markGuildAsRead = BDFDB . GuildUtils . markAsRead ;
BDFDB . getFolderID = BDFDB . FolderUtils . getId ;
BDFDB . getFolderDiv = BDFDB . FolderUtils . getDiv ;
BDFDB . getChannelDiv = BDFDB . ChannelUtils . getDiv ;
BDFDB . getSelectedChannel = BDFDB . ChannelUtils . getSelected ;
BDFDB . openChannelContextMenu = BDFDB . ChannelUtils . openMenu ;
BDFDB . markChannelAsRead = BDFDB . ChannelUtils . markAsRead ;
2019-10-23 11:10:01 +02:00
BDFDB . DmUtils = BDFDB . DMUtils ;
BDFDB . getDmDiv = BDFDB . DMUtils . getDiv ;
BDFDB . getChannelIcon = BDFDB . DMUtils . getIcon ;
BDFDB . readDmList = BDFDB . DMUtils . getAll ;
2019-10-22 14:20:12 +02:00
BDFDB . saveAllData = ( data , plugin , key ) => { BDFDB . DataUtils . save ( data , plugin , key ) } ;
BDFDB . saveData = ( id , data , plugin , key ) => { BDFDB . DataUtils . save ( data , plugin , key , id ) } ;
BDFDB . loadAllData = ( plugin , key ) => { return BDFDB . DataUtils . load ( plugin , key ) } ;
BDFDB . loadData = ( id , plugin , key ) => { return BDFDB . DataUtils . load ( plugin , key , id ) } ;
BDFDB . removeAllData = ( plugin , key ) => { BDFDB . DataUtils . remove ( plugin , key ) } ;
BDFDB . removeData = ( id , plugin , key ) => { BDFDB . DataUtils . remove ( plugin , key , id ) } ;
BDFDB . getAllData = ( plugin , key ) => { return BDFDB . DataUtils . get ( plugin , key ) } ;
BDFDB . getData = ( id , plugin , key ) => { return BDFDB . DataUtils . get ( plugin , key , id ) } ;
2019-10-19 11:41:39 +02:00
2019-10-23 10:03:33 +02:00
BDFDB . colorCONVERT = BDFDB . ColorUtils . convert ;
BDFDB . colorSETALPHA = BDFDB . ColorUtils . setAlpha ;
BDFDB . colorGETALPHA = BDFDB . ColorUtils . getAlpha ;
BDFDB . colorCHANGE = BDFDB . ColorUtils . change ;
BDFDB . colorINV = BDFDB . ColorUtils . invert ;
BDFDB . colorCOMPARE = BDFDB . ColorUtils . compare ;
BDFDB . colorISBRIGHT = BDFDB . ColorUtils . isBright ;
BDFDB . colorTYPE = BDFDB . ColorUtils . getType ;
BDFDB . colorGRADIENT = BDFDB . ColorUtils . createGradient ;
2019-10-23 11:10:01 +02:00
BDFDB . getSwatchColor = BDFDB . ColorUtils . getSwatchColor ;
BDFDB . openColorPicker = BDFDB . ColorUtils . openPicker ;
BDFDB . addClass = BDFDB . DOMUtils . addClass ;
BDFDB . removeClass = BDFDB . DOMUtils . removeClass ;
BDFDB . toggleClass = BDFDB . DOMUtils . toggleClass ;
BDFDB . containsClass = BDFDB . DOMUtils . containsClass ;
BDFDB . replaceClass = BDFDB . DOMUtils . replaceClass ;
BDFDB . removeClasses = BDFDB . DOMUtils . removeClassFromDOM ;
BDFDB . toggleEles = BDFDB . DOMUtils . toggle ;
BDFDB . isEleHidden = BDFDB . DOMUtils . isHidden ;
BDFDB . removeEles = BDFDB . DOMUtils . remove ;
BDFDB . htmlToElement = BDFDB . DOMUtils . create ;
BDFDB . getParentEle = BDFDB . DOMUtils . getParent ;
BDFDB . setInnerText = BDFDB . DOMUtils . setText ;
BDFDB . getInnerText = BDFDB . DOMUtils . getText ;
BDFDB . getRects = BDFDB . DOMUtils . getRects ;
BDFDB . getTotalHeight = BDFDB . DOMUtils . getHeight ;
BDFDB . getTotalWidth = BDFDB . DOMUtils . getWidth ;
BDFDB . appendLocalStyle = BDFDB . DOMUtils . appendLocalStyle ;
BDFDB . removeLocalStyle = BDFDB . DOMUtils . removeLocalStyle ;
BDFDB . encodeToHTML = BDFDB . StringUtils . htmlEscape ;
BDFDB . regEscape = BDFDB . StringUtils . regEscape ;
BDFDB . insertNRST = BDFDB . StringUtils . insertNRST ;
2019-11-01 10:14:50 +01:00
BDFDB . highlightText = BDFDB . StringUtils . highlight ;
2019-10-23 11:10:01 +02:00
2019-10-23 11:25:28 +02:00
BDFDB . formatBytes = BDFDB . NumberUtils . formatBytes ;
2019-10-23 11:10:01 +02:00
BDFDB . mapRange = BDFDB . NumberUtils . mapRange ;
2019-10-23 10:03:33 +02:00
2019-10-18 10:56:41 +02:00
BDFDB . getDiscordTheme = BDFDB . DiscordUtils . getTheme ;
BDFDB . getDiscordMode = BDFDB . DiscordUtils . getMode ;
BDFDB . getDiscordZoomFactor = BDFDB . DiscordUtils . getZoomFactor ;
BDFDB . getDiscordFontScale = BDFDB . DiscordUtils . getFontScale ;
2019-10-19 11:41:39 +02:00
2019-10-30 13:27:14 +01:00
BDFDB . openModal = BDFDB . ModalUtils . open ;
BDFDB . openConfirmModal = BDFDB . ModalUtils . confirm ;
2019-11-01 10:14:50 +01:00
BDFDB . openContextMenu = BDFDB . ContextMenuUtils . open ;
BDFDB . closeContextMenu = BDFDB . ContextMenuUtils . close ;
2019-10-23 11:10:01 +02:00
BDFDB . BdUtils = BDFDB . BDUtils ;
BDFDB . getPluginsFolder = BDFDB . BDUtils . getPluginsFolder ;
BDFDB . getThemesFolder = BDFDB . BDUtils . getThemesFolder ;
BDFDB . isPluginEnabled = BDFDB . BDUtils . isPluginEnabled ;
BDFDB . getPlugin = BDFDB . BDUtils . getPlugin ;
BDFDB . isThemeEnabled = BDFDB . BDUtils . isThemeEnabled ;
BDFDB . getTheme = BDFDB . BDUtils . getTheme ;
BDFDB . isRestartNoMoreEnabled = BDFDB . BDUtils . isAutoLoadEnabled ;
2019-10-19 11:41:39 +02:00
BDFDB . languages = BDFDB . LanguageUtils . languages ;
BDFDB . getDiscordLanguage = BDFDB . LanguageUtils . getLanguage ;
BDFDB . LanguageStrings = BDFDB . LanguageUtils . LanguageStrings ;
BDFDB . LanguageStringsCheck = BDFDB . LanguageUtils . LanguageStringsCheck ;
BDFDB . LanguageStringsFormat = BDFDB . LanguageUtils . LanguageStringsFormat ;
2019-11-28 14:11:05 +01:00
BDFDB . getLibraryStrings = _ => {
2019-10-24 10:48:18 +02:00
let languageid = BDFDB . LanguageUtils . getLanguage ( ) . id ;
2019-10-19 11:41:39 +02:00
if ( InternalBDFDB . LibraryStrings [ languageid ] ) return InternalBDFDB . LibraryStrings [ languageid ] ;
return InternalBDFDB . LibraryStrings . default ;
} ;
2019-11-05 16:08:43 +01:00
BDFDB . loaded = true ;
2020-01-05 14:33:08 +01:00
2019-12-01 12:16:38 +01:00
window . BDFDB = BDFDB ;
2019-11-05 16:08:43 +01:00
InternalBDFDB . reloadLib = _ => {
var libraryScript = document . querySelector ( "head script#BDFDBLibraryScript" ) ;
if ( libraryScript ) libraryScript . remove ( ) ;
libraryScript = document . createElement ( "script" ) ;
libraryScript . setAttribute ( "id" , "BDFDBLibraryScript" ) ;
libraryScript . setAttribute ( "type" , "text/javascript" ) ;
libraryScript . setAttribute ( "src" , "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js" ) ;
libraryScript . setAttribute ( "date" , performance . now ( ) ) ;
document . head . appendChild ( libraryScript ) ;
} ;
var libKeys = Object . keys ( BDFDB ) . length - 10 , crashInterval = BDFDB . TimeUtils . interval ( _ => {
2019-11-07 10:27:34 +01:00
if ( ! window . BDFDB || typeof BDFDB != "object" || Object . keys ( BDFDB ) . length < libKeys || ! BDFDB . InternalData . loadid ) {
2019-11-05 16:08:43 +01:00
BDFDB . LogUtils . warn ( "Reloading library due to internal error." ) ;
BDFDB . TimeUtils . clear ( crashInterval ) ;
InternalBDFDB . reloadLib ( ) ;
}
2019-11-07 10:27:34 +01:00
else if ( BDFDB . InternalData . loadid != loadid ) {
2019-11-05 16:08:43 +01:00
BDFDB . TimeUtils . clear ( crashInterval ) ;
}
else if ( ! BDFDB . InternalData . creationTime || performance . now ( ) - BDFDB . InternalData . creationTime > 18000000 ) {
BDFDB . TimeUtils . clear ( crashInterval ) ;
InternalBDFDB . reloadLib ( ) ;
}
} , 10000 ) ;
2020-01-07 21:24:44 +01:00
} ) ( ) ;