BetterDiscordAddons/Plugins/BDFDB.min.js

1 line
500 KiB
JavaScript
Raw Normal View History

2019-12-18 14:42:01 +01:00
(c=>{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']);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']);var d={'myPlugins':Object['assign']({},window['BDFDB']&&window['BDFDB']['myPlugins']),'InternalData':Object['assign']({'pressedKeys':[],'mousePosition':{'pageX':0x0,'pageY':0x0},'patchMenuQueries':{}},window['BDFDB']&&window['BDFDB']['InternalData'],{'creationTime':performance['now']()}),'BDv2Api':window['BDFDB']&&window['BDFDB']['BDv2Api']||undefined,'name':'$BDFDB'};var e=Math['round'](Math['random']()*0x2386f26fc10000),f={};d['InternalData']['loadid']=e;d['LogUtils']={};d['LogUtils']['log']=function(g,h){if(typeof g!='string')g='';if(typeof h!='string'||h=='$BDFDB')h='BDFDB';console['log']('%c['+h+']','color:\x20#3a71c1;\x20font-weight:\x20700;',g['trim']());};d['LogUtils']['warn']=function(i,j){if(typeof i!='string')i='';if(typeof j!='string'||j=='$BDFDB')j='BDFDB';console['warn']('%c['+j+']','color:\x20#3a71c1;\x20font-weight:\x20700;',i['trim']());};d['LogUtils']['error']=function(k,l){if(typeof k!='string')k='';if(typeof l!='string'||l=='$BDFDB')l='BDFDB';console['error']('%c['+l+']','color:\x20#3a71c1;\x20font-weight:\x20700;','Fatal\x20Error:\x20'+k['trim']());};d['LogUtils']['log']('Loading\x20library.');d['PluginUtils']={};d['PluginUtils']['init']=function(m){m['name']=m['name']||(typeof m['getName']=='function'?m['getName']():null);m['version']=m['version']||(typeof m['getVersion']=='function'?m['getVersion']():null);m['author']=m['author']||(typeof m['getAuthor']=='function'?m['getAuthor']():null);m['description']=m['description']||(typeof m['getDescription']=='function'?m['getDescription']():null);if(m['patchModules']){m['patchedModules']={'after':m['patchModules']};delete m['patchModules'];}m['patchedModules']=d['ObjectUtils']['filter'](m['patchedModules'],n=>f2['Patchtypes']['includes'](n),!![]);f['clearStartTimeout'](m);var o=d['LanguageUtils']['LibraryStringsFormat']('toast_plugin_started','v'+m['version']);d['LogUtils']['log'](o,m['name']);if(!d['BDUtils']['getSettings']('fork-ps-2'))d['NotificationUtils']['toast'](m['name']+'\x20'+o,{'nopointer':!![],'selector':'plugin-started-toast'});var p=typeof m['getRawUrl']=='function'&&typeof m['getRawUrl']()=='string'?m['getRawUrl']():'https://mwittrien.github.io/BetterDiscordAddons/Plugins/'+m['name']+'/'+m['name']+'.plugin.js';d['PluginUtils']['checkUpdate'](m['name'],p);if(d['ObjectUtils']['is'](m['classes']))f['addPluginClasses'](m);if(typeof m['initConstructor']==='function')d['TimeUtils']['suppress'](m['initConstructor']['bind'](m),'Could\x20not\x20initiate\x20constructor!',m['name'])();if(typeof m['css']==='string')d['DOMUtils']['appendLocalStyle'](m['name'],m['css']);f['patchPlugin'](m);f['addOnSettingsClosedListener'](m);f['addOnSwitchListener'](m);f['addContextListeners'](m);d['PluginUtils']['translate'](m);d['PluginUtils']['checkChangeLog'](m);if(!window['PluginUpdates']||typeof window['PluginUpdates']!=='object')window['PluginUpdates']={'plugins':{}};window['PluginUpdates']['plugins'][p]={'name':m['name'],'raw':p,'version':m['version']};if(typeof window['PluginUpdates']['interval']==='undefined')window['PluginUpdates']['interval']=d['TimeUtils']['interval'](c=>{d['PluginUtils']['checkAllUpdates']();},0x3e8*0x3c*0x3c*0x2);m['started']=!![];delete m['stopping'];for(let