BetterDiscordAddons/Plugins/BDFDB.min.js

1 line
488 KiB
JavaScript
Raw Normal View History

2020-07-19 11:28:17 +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(G,H){console['log']('%c['+(typeof H=='string'&&H||'BDFDB')+']','color:\x20#3a71c1;\x20font-weight:\x20700;',(typeof G=='string'&&G||'')['trim']());};b['LogUtils']['warn']=function(G,H){console['warn']('%c['+(typeof H=='string'&&H||'BDFDB')+']','color:\x20#3a71c1;\x20font-weight:\x20700;',(typeof G=='string'&&G||'')['trim']());};b['LogUtils']['error']=function(G,H){console['error']('%c['+(typeof H=='string'&&H||'BDFDB')+']','color:\x20#3a71c1;\x20font-weight:\x20700;','Fatal\x20Error:\x20'+(typeof G=='string'&&G||'')['trim']());};b['LogUtils']['log']('Loading\x20library.');b['PluginUtils']={};b['PluginUtils']['init']=b['loadMessage']=function(G){G['name']=G['name']||(typeof G['getName']=='function'?G['getName']():null);G['version']=G['version']||(typeof G['getVersion']=='function'?G['getVersion']():null);G['author']=G['author']||(typeof G['getAuthor']=='function'?G['getAuthor']():null);G['description']=G['description']||(typeof G['getDescription']=='function'?G['getDescription']():null);if(typeof G['getSettingsPanel']!='function')G['getSettingsPanel']=K=>{return G['started']&&b['PluginUtils']['createSettingsPanel'](G,[]);};let H=b['LanguageUtils']['LibraryStringsFormat']('toast_plugin_started','v'+G['version']);b['LogUtils']['log'](H,G['name']);if(!b['BDUtils']['getSettings'](b['BDUtils']['settingsIds']['showToasts'])&&b['DataUtils']['get'](b,'settings','showToasts'))b['NotificationUtils']['toast'](G['name']+'\x20'+H,{'nopointer':!![],'selector':'plugin-started-toast'});let I=typeof G['getRawUrl']=='function'&&typeof G['getRawUrl']()=='string'?G['getRawUrl']():'https://mwittrien.github.io/BetterDiscordAddons/Plugins/'+G['name']+'/'+G['name']+'.plugin.js';b['PluginUtils']['checkUpdate'](G['name'],I);if(typeof G['initConstructor']==='function')b['TimeUtils']['suppress'](G['initConstructor']['bind'](G),'Could\x20not\x20initiate\x20constructor!',G['name'])();if(typeof G['css']==='string')b['DOMUtils']['appendLocalStyle'](G['name'],G['css']);c['patchPlugin'](G);c['addSpecialListeners'](G);b['PluginUtils']['translate'](G);b['PluginUtils']['checkChangeLog'](G);if(!window['PluginUpda