2019-02-26 19:16:42 +01: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')c['initConstructor']();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(!window['PluginUpdates']||typeof window['PluginUpdates']!=='object')window['PluginUpdates']={'plugins':{}};window['PluginUpdates']['plugins'][e]={'name':c['name'],'raw':e,'version':c['version']};if(typeof window['PluginUpdates']['interval']==='undefined')window['PluginUpdates']['interval']=setInterval(()=>{BDFDB['checkAllUpdates']();},0x3e8*0x3c*0x3c*0x2);c['started']=!![];for(let f in BDFDB['myPlugins'])if(!BDFDB['myPlugins'][f]['started']&&typeof BDFDB['myPlugins'][f]['initialize']=='function')BDFDB['myPlugins'][f]['initialize']();};BDFDB['unloadMessage']=function(g){BDFDB['clearStarttimout'](g);g['name']=g['name']||g['getName']();g['version']=g['version']||g['getVersion']();g['author']=g['author']||g['getAuthor']();g['description']=g['description']||g['getDescription']();delete BDFDB['myPlugins'][g['name']];var h=BDFDB['getLibraryStrings']()['toast_plugin_stopped']['replace']('{{oldversion}}','v'+g['version']);console['log']('%c['+g['name']+']%c','color:\x20#3a71c1;\x20font-weight:\x20700;','',h);if(!(settingsCookie['fork-ps-2']&&settingsCookie['fork-ps-2']===!![]))BDFDB['showToast'](g['name']+'\x20'+h,{'nopointer':!![],'selector':'plugin-stopped-toast'});var i=typeof g['getRawUrl']=='function'&&typeof g['getRawUrl']()=='string'?g['getRawUrl']():'https://mwittrien.github.io/BetterDiscordAddons/Plugins/'+g['name']+'/'+g['name']+'.plugin.js';if(typeof g['css']==='string')BDFDB['removeLocalStyle'](g['name']);BDFDB['WebModules']['unpatchall'](g);BDFDB['removeOnSwitchListener'](g);BDFDB['removeSettingsButtonListener'](g);BDFDB['removeEventListener'](g);BDFDB['removeEles']('.'+g['name']+'-modal,\x20.'+g['name']['toLowerCase']()+'-modal,\x20.'+g['name']+'-settingsmodal,\x20.'+g['name']['toLowerCase']()+'-settingsmodal');if(!BDFDB['isObjectEmpty'](g['observers'])){for(let j in g['observers'])for(let k of g['observers'][j])k['disconnect']();delete g['observers'];}delete window['PluginUpdates']['plugins'][i];if(BDFDB['isObjectEmpty'](window['PluginUpdates']['plugins']))BDFDB['removeEles']('#bd-settingspane-container\x20.bd-updatebtn'+BDFDB['dotCN']['_repofolderbutton']);delete g['started'];};BDFDB['translatePlugin']=function(l){if(typeof l['setLabelsByLanguage']==='function'||typeof l['changeLanguageStrings']==='function'){if(document['querySelector']('html')['lang'])n();els
|