Last active
April 19, 2017 04:37
-
-
Save darkconsole/5426e2fcac097c44d978855291bdfa5f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//META{"name":"DccServerUI"}*// | |
function DccServerUI() { | |
var $this = this; | |
// Name = what it shows above the channel list at the top. | |
// Colour1 = the sidebar colour | |
// Colour2 = the textbox colour | |
// everything is case sensitive dont be dumb. | |
this.Servers = [ | |
{ Name: "distrust.us", Colour1: "#684141", Colour2: "#442B2B" }, | |
{ Name: "Avorion", Colour1: "#1A284A", Colour2: "#152038" }, | |
{ Name: "LoversLab", Colour1: "#9D7999", Colour2: "#725A70" } | |
]; | |
// if you dont know what you're doing, there is nothing for you below | |
// this slightly insulting comment. | |
this.UpdateColours = function(){ | |
var ServerName = document | |
.querySelector('.guild-header header span') | |
.textContent; | |
for(var Iter = 0; Iter < $this.Servers.length; Iter++) { | |
if($this.Servers[Iter].Name == ServerName) { | |
jQuery('.guilds-wrapper') | |
.css({ | |
'background-color': $this.Servers[Iter].Colour1 | |
}); | |
jQuery('.channel-textarea-inner') | |
.css({ | |
'background-color': $this.Servers[Iter].Colour2 | |
}) | |
break; | |
} | |
} | |
return false; | |
}; | |
}; | |
DccServerUI.prototype.load = function() { | |
}; | |
DccServerUI.prototype.unload = function() { | |
}; | |
DccServerUI.prototype.start = function() { | |
jQuery('#app-mount') | |
.delegate('.channels-wrap','DOMSubtreeModified',this.UpdateColours); | |
return; | |
}; | |
DccServerUI.prototype.stop = function() { | |
}; | |
DccServerUI.prototype.update = function() { | |
}; | |
DccServerUI.prototype.getName = function() { | |
return "DCC Server UI"; | |
}; | |
DccServerUI.prototype.getDescription = function() { | |
return "Change the colour of the UI based on what server you are on. Stop talking on the wrong server."; | |
}; | |
DccServerUI.prototype.getVersion = function() { | |
return "1.0"; | |
}; | |
DccServerUI.prototype.getAuthor = function() { | |
return "darkconsole"; | |
}; | |
DccServerUI.prototype.onSwitch = function() { | |
this.UpdateColours(); | |
return; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment