BetterDiscordAddons/Plugins/BDFDB.min.js

1 line
485 KiB
JavaScript
Raw Normal View History

2020-07-17 11:38:54 +02:00
(a=>{if(window['BDFDB']&&window['BDFDB']['ListenerUtils']&&typeof window['BDFDB']['ListenerUtils']['remove']=='function')window['BDFDB']['ListenerUtils']['remove'](window['BDFDB']);if(window['BDFDB']&&window['BDFDB']['StoreChangeUtils']&&typeof window['BDFDB']['StoreChangeUtils']['remove']=='function')window['BDFDB']['StoreChangeUtils']['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']);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']);const b={'myPlugins':Object['assign']({},window['BDFDB']&&window['BDFDB']['myPlugins']),'InternalData':Object['assign']({'pressedKeys':[],'mousePosition':{'pageX':0x0,'pageY':0x0},'componentPatchQueries':{}},window['BDFDB']&&window['BDFDB']['InternalData'],{'creationTime':performance['now']()}),'name':'BDFDB'};const c={'name':'BDFDB','started':!![],'patchPriority':0x0};const d=Math['round'](Math['random']()*0x2386f26fc10000),e='278543574059057154',f='410787888507256842';b['InternalData']['loadId']=d;if(typeof Array['prototype']['flat']!='function')Array['prototype']['flat']=function(){return this;};c['defaults']={'settings':{'showToasts':{'value':!![],'description':'Show\x20Plugin\x20start\x20and\x20stop\x20Toasts'},'showSupportBadges':{'value':!![],'description':'Show\x20little\x20Badges\x20for\x20Users\x20who\x20support\x20my\x20Patreon'}}};b['LogUtils']={};b['LogUtils']['log']=function(F,G){console['log']('%c['+(typeof G=='string'&&G||'BDFDB')+']','color:\x20#3a71c1;\x20font-weight:\x20700;',(typeof F=='string'&&F||'')['trim']());};b['LogUtils']['warn']=function(F,G){console['warn']('%c['+(typeof G=='string'&&G||'BDFDB')+']','color:\x20#3a71c1;\x20font-weight:\x20700;',(typeof F=='string'&&F||'')['trim']());};b['LogUtils']['error']=function(F,G){console['error']('%c['+(typeof G=='string'&&G||'BDFDB')+']','color:\x20#3a71c1;\x20font-weight:\x20700;','Fatal\x20Error:\x20'+(typeof F=='string'&&F||'')['trim']());};b['LogUtils']['log']('Loading\x20library.');b['PluginUtils']={};b['PluginUtils']['init']=b['loadMessage']=function(F){F['name']=F['name']||(typeof F['getName']=='function'?F['getName']():null);F['version']=F['version']||(typeof F['getVersion']=='function'?F['getVersion']():null);F['author']=F['author']||(typeof F['getAuthor']=='function'?F['getAuthor']():null);F['description']=F['description']||(typeof F['getDescription']=='function'?F['getDescription']():null);if(typeof F['getSettingsPanel']!='function')F['getSettingsPanel']=J=>{return F['started']&&b['PluginUtils']['createSettingsPanel'](F,[]);};let G=b['LanguageUtils']['LibraryStringsFormat']('toast_plugin_started','v'+F['version']);b['LogUtils']['log'](G,F['name']);if(!b['BDUtils']['getSettings'](b['BDUtils']['settingsIds']['showToasts'])&&b['DataUtils']['get'](b,'settings','showToasts'))b['NotificationUtils']['toast'](F['name']+'\x20'+G,{'nopointer':!![],'selector':'plugin-started-toast'});let H=typeof F['getRawUrl']=='function'&&typeof F['getRawUrl']()=='string'?F['getRawUrl']():'https://mwittrien.github.io/BetterDiscordAddons/Plugins/'+F['name']+'/'+F['name']+'.plugin.js';b['PluginUtils']['checkUpdate'](F['name'],H);if(typeof F['initConstructor']==='function')b['TimeUtils']['suppress'](F['initConstructor']['bind'](F),'Could\x20not\x20initiate\x20constructor!',F['name'])();if(typeof F['css']==='string')b['DOMUtils']['appendLocalStyle'](F['name'],F['css']);c['patchPlugin'](F);c['addSpecialListeners'](F);b['PluginUtils']['translate'](F);b['PluginUtils']['checkChangeLog'](F);if(!window['PluginUpda