2019-05-01 21:02:25 +02:00
|
|
|
if(global['BDFDB']&&typeof BDFDB['removeEventListener']=='function')BDFDB['removeEventListener'](BDFDB);if(global['BDFDB']&&BDFDB['WebModules']&&typeof BDFDB['WebModules']['unpatchall']=='function')BDFDB['WebModules']['unpatchall'](BDFDB);var BDFDB={'myPlugins':BDFDB&&BDFDB['myPlugins']?BDFDB['myPlugins']:{},'BDv2Api':BDFDB&&BDFDB['BDv2Api']?BDFDB['BDv2Api']:undefined,'creationTime':performance['now'](),'cachedData':{},'pressedKeys':[],'mousePosition':{'pageX':0x0,'pageY':0x0},'name':'$BDFDB'};(()=>{BDFDB['isLibraryOutdated']=function(){return performance['now']()-BDFDB['creationTime']>0x927c0;};BDFDB['loadMessage']=function(c){BDFDB['clearStarttimout'](c);c['name']=c['name']||c['getName']();c['version']=c['version']||c['getVersion']();c['author']=c['author']||c['getAuthor']();c['description']=c['description']||c['getDescription']();var d=BDFDB['getLibraryStrings']()['toast_plugin_started']['replace']('{{oldversion}}','v'+c['version']);console['log']('%c['+c['name']+']%c','color:\x20#3a71c1;\x20font-weight:\x20700;','',d);if(!(settingsCookie['fork-ps-2']&&settingsCookie['fork-ps-2']===!![]))BDFDB['showToast'](c['name']+'\x20'+d,{'nopointer':!![],'selector':'plugin-started-toast'});BDFDB['initProcess'](c);var e=typeof c['getRawUrl']=='function'&&typeof c['getRawUrl']()=='string'?c['getRawUrl']():'https://mwittrien.github.io/BetterDiscordAddons/Plugins/'+c['name']+'/'+c['name']+'.plugin.js';BDFDB['checkUpdate'](c['name'],e);if(typeof c['initConstructor']==='function'){try{c['initConstructor']();}catch(f){console['log']('%c['+c['name']+']%c','color:\x20#3a71c1;\x20font-weight:\x20700;','','Fatal\x20Error:\x20Could\x20not\x20initiate\x20constructor!');}}if(typeof c['css']==='string')BDFDB['appendLocalStyle'](c['name'],c['css']);BDFDB['WebModules']['patchModules'](c);BDFDB['addOnSwitchListener'](c);BDFDB['addSettingsButtonListener'](c);BDFDB['addContextListener'](c);BDFDB['translatePlugin'](c);BDFDB['checkChangeLog'](c);if(!global['window']['PluginUpdates']||typeof global['window']['PluginUpdates']!=='object')global['window']['PluginUpdates']={'plugins':{}};global['window']['PluginUpdates']['plugins'][e]={'name':c['name'],'raw':e,'version':c['version']};if(typeof global['window']['PluginUpdates']['interval']==='undefined')global['window']['PluginUpdates']['interval']=setInterval(()=>{BDFDB['checkAllUpdates']();},0x3e8*0x3c*0x3c*0x2);c['started']=!![];for(let g in BDFDB['myPlugins'])if(!BDFDB['myPlugins'][g]['started']&&typeof BDFDB['myPlugins'][g]['initialize']=='function')BDFDB['myPlugins'][g]['initialize']();};BDFDB['unloadMessage']=function(h){BDFDB['clearStarttimout'](h);h['name']=h['name']||h['getName']();h['version']=h['version']||h['getVersion']();h['author']=h['author']||h['getAuthor']();h['description']=h['description']||h['getDescription']();delete BDFDB['myPlugins'][h['name']];var i=BDFDB['getLibraryStrings']()['toast_plugin_stopped']['replace']('{{oldversion}}','v'+h['version']);console['log']('%c['+h['name']+']%c','color:\x20#3a71c1;\x20font-weight:\x20700;','',i);if(!(settingsCookie['fork-ps-2']&&settingsCookie['fork-ps-2']===!![]))BDFDB['showToast'](h['name']+'\x20'+i,{'nopointer':!![],'selector':'plugin-stopped-toast'});var j=typeof h['getRawUrl']=='function'&&typeof h['getRawUrl']()=='string'?h['getRawUrl']():'https://mwittrien.github.io/BetterDiscordAddons/Plugins/'+h['name']+'/'+h['name']+'.plugin.js';if(typeof h['css']==='string')BDFDB['removeLocalStyle'](h['name']);BDFDB['WebModules']['unpatchall'](h);BDFDB['removeOnSwitchListener'](h);BDFDB['removeSettingsButtonListener'](h);BDFDB['removeEventListener'](h);BDFDB['removeEles']('.'+h['name']+'-modal,\x20.'+h['name']['toLowerCase']()+'-modal,\x20.'+h['name']+'-settingsmodal,\x20.'+h['name']['toLowerCase']()+'-settingsmodal');if(!BDFDB['isObjectEmpty'](h['observers'])){for(let k in h['observers'])for(let l of h['observers'][k])l['disconnect']();delete h['observers'];}delete global['window']['PluginUpdates']['plugins'][j];if(BDFDB['isObjectEmpty'](global['window']['PluginUpdates']['plugins']))BDFDB['removeEles']('#bd-settingspane-container\x20.bd-updatebtn'+
|