2020-02-27 08:44:03 +01:00
//META{"name":"RepoControls","authorId":"278543574059057154","invite":"Jx3TjNS","donate":"https://www.paypal.me/MircoWittrien","patreon":"https://www.patreon.com/MircoWittrien","website":"https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/RepoControls","source":"https://raw.githubusercontent.com/mwittrien/BetterDiscordAddons/master/Plugins/RepoControls/RepoControls.plugin.js"}*//
2018-10-11 10:21:26 +02:00
2020-02-10 21:39:51 +01:00
var RepoControls = ( _ => {
2020-03-15 10:21:23 +01:00
let searchTimeout ;
2020-02-10 21:39:51 +01:00
return class RepoControls {
getName ( ) { return "RepoControls" ; }
2019-01-09 10:26:58 +01:00
2020-03-28 07:42:52 +01:00
getVersion ( ) { return "1.3.9" ; }
2019-01-09 10:26:58 +01:00
2020-02-10 21:39:51 +01:00
getAuthor ( ) { return "DevilBro" ; }
2019-01-09 10:26:58 +01:00
2020-03-28 07:42:52 +01:00
getDescription ( ) { return "NO LONGER NEEDED" ; }
2018-10-11 10:21:26 +02:00
2020-02-10 21:39:51 +01:00
//legacy
load ( ) { }
2018-10-11 10:21:26 +02:00
2020-02-10 21:39:51 +01:00
start ( ) {
if ( ! window . BDFDB ) window . BDFDB = { myPlugins : { } } ;
if ( window . BDFDB && window . BDFDB . myPlugins && typeof window . BDFDB . myPlugins == "object" ) window . BDFDB . myPlugins [ this . getName ( ) ] = this ;
let libraryScript = document . querySelector ( "head script#BDFDBLibraryScript" ) ;
if ( ! libraryScript || ( performance . now ( ) - libraryScript . getAttribute ( "date" ) ) > 600000 ) {
if ( libraryScript ) libraryScript . remove ( ) ;
libraryScript = document . createElement ( "script" ) ;
libraryScript . setAttribute ( "id" , "BDFDBLibraryScript" ) ;
libraryScript . setAttribute ( "type" , "text/javascript" ) ;
libraryScript . setAttribute ( "src" , "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js" ) ;
libraryScript . setAttribute ( "date" , performance . now ( ) ) ;
libraryScript . addEventListener ( "load" , _ => { this . initialize ( ) ; } ) ;
document . head . appendChild ( libraryScript ) ;
}
else if ( window . BDFDB && typeof BDFDB === "object" && BDFDB . loaded ) this . initialize ( ) ;
this . startTimeout = setTimeout ( _ => {
try { return this . initialize ( ) ; }
catch ( err ) { console . error ( ` %c[ ${ this . getName ( ) } ]%c ` , "color: #3a71c1; font-weight: 700;" , "" , "Fatal Error: Could not initiate plugin! " + err ) ; }
} , 30000 ) ;
2018-10-11 10:21:26 +02:00
}
2020-02-10 21:39:51 +01:00
initialize ( ) {
if ( window . BDFDB && typeof BDFDB === "object" && BDFDB . loaded ) {
if ( this . started ) return ;
BDFDB . PluginUtils . init ( this ) ;
2020-03-28 07:42:52 +01:00
BDFDB . ModalUtils . open ( this , {
header : this . name ,
subheader : "Delete?" ,
text : ` This plugin is no longer needed, because BBD includes the features now natively, click " ${ BDFDB . LanguageUtils . LanguageStrings . DELETE } " to delete all remaining files created by this plugin. ` ,
buttons : [ {
color : "RED" ,
contents : BDFDB . LanguageUtils . LanguageStrings . DELETE ,
close : true ,
click : _ => {
BDFDB . LibraryRequires . fs . unlink ( BDFDB . LibraryRequires . path . join ( BDFDB . BDUtils . getPluginsFolder ( ) , ` ${ this . name } .config.json ` ) , _ => { } ) ;
BDFDB . LibraryRequires . fs . unlink ( BDFDB . LibraryRequires . path . join ( BDFDB . BDUtils . getPluginsFolder ( ) , ` ${ this . name } .plugin.js ` ) , _ => { } ) ;
}
} ] ,
onClose : _ => {
BDFDB . BDUtils . disablePlugin ( this . name ) ;
}
} ) ;
2020-02-10 21:39:51 +01:00
}
else console . error ( ` %c[ ${ this . getName ( ) } ]%c ` , "color: #3a71c1; font-weight: 700;" , "" , "Fatal Error: Could not load BD functions!" ) ;
2018-10-11 10:21:26 +02:00
}
2020-02-10 21:39:51 +01:00
stop ( ) {
if ( window . BDFDB && typeof BDFDB === "object" && BDFDB . loaded ) {
this . stopping = true ;
2019-10-22 11:37:23 +02:00
2020-02-10 21:39:51 +01:00
BDFDB . PluginUtils . clear ( this ) ;
}
2018-10-11 10:21:26 +02:00
}
}
2020-02-10 21:39:51 +01:00
} ) ( ) ;