BetterDiscordAddons/Plugins/BDFDB.min.js

2 lines
499 KiB
JavaScript
Raw Normal View History

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