2020-03-31 19:23:05 +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']()}),'BDv2Api':window['BDFDB']&&window['BDFDB']['BDv2Api']||undefined,'name':'BDFDB'};const c={'name':'BDFDB','patchPriority':0x0};const d=Math['round'](Math['random']()*0x2386f26fc10000);b['InternalData']['loadId']=d;var e=![];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(A,B){console['log']('%c['+(typeof B=='string'&&B||'BDFDB')+']','color:\x20#3a71c1;\x20font-weight:\x20700;',(typeof A=='string'&&A||'')['trim']());};b['LogUtils']['warn']=function(A,B){console['warn']('%c['+(typeof B=='string'&&B||'BDFDB')+']','color:\x20#3a71c1;\x20font-weight:\x20700;',(typeof A=='string'&&A||'')['trim']());};b['LogUtils']['error']=function(A,B){console['error']('%c['+(typeof B=='string'&&B||'BDFDB')+']','color:\x20#3a71c1;\x20font-weight:\x20700;','Fatal\x20Error:\x20'+(typeof A=='string'&&A||'')['trim']());};b['LogUtils']['log']('Loading\x20library.');b['PluginUtils']={};b['PluginUtils']['init']=function(A){A['name']=A['name']||(typeof A['getName']=='function'?A['getName']():null);A['version']=A['version']||(typeof A['getVersion']=='function'?A['getVersion']():null);A['author']=A['author']||(typeof A['getAuthor']=='function'?A['getAuthor']():null);A['description']=A['description']||(typeof A['getDescription']=='function'?A['getDescription']():null);c['clearStartTimeout'](A);let B=b['LanguageUtils']['LibraryStringsFormat']('toast_plugin_started','v'+A['version']);b['LogUtils']['log'](B,A['name']);if(!b['BDUtils']['getSettings']('fork-ps-2')&&b['DataUtils']['get'](b,'settings','showToasts'))b['NotificationUtils']['toast'](A['name']+'\x20'+B,{'nopointer':!![],'selector':'plugin-started-toast'});let C=typeof A['getRawUrl']=='function'&&typeof A['getRawUrl']()=='string'?A['getRawUrl']():'https://mwittrien.github.io/BetterDiscordAddons/Plugins/'+A['name']+'/'+A['name']+'.plugin.js';b['PluginUtils']['checkUpdate'](A['name'],C);if(b['ObjectUtils']['is'](A['classes']))c['addPluginClasses'](A);if(typeof A['initConstructor']==='function')b['TimeUtils']['suppress'](A['initConstructor']['bind'](A),'Could\x20not\x20initiate\x20constructor!',A['name'])();if(typeof A['css']==='string')b['DOMUtils']['appendLocalStyle'](A['name'],A['css']);c['patchPlugin'](A);c['addSpecialListeners'](A);b['PluginUtils']['translate'](A);b['PluginUtils']['checkChangeLog'](A);if(!window['PluginUpdates']||typeof window['PluginUpdates']!=='object')window['PluginUpdates']={'plugin
|