Post by Michael on Apr 13, 2009 11:45:18 GMT -8
Code Name: Super Cool On/Off Icons
Preview: wimg.co.uk/zhyrBR.png
Definition: This code is rather smart - it'll automatically generate your On/Off icons dependent on the board name. If the board name is 2 words in length, then it'll take the first letter of the first word & the 1st letter of the 2nd word. It'll make the 2nd letter capitalised.
If there's only one word, then it'll do the above, but with the 1st & 2nd letter of the first word.
Placement: Global Footer
<style>
.on_lower {
color: #EE9966;
}
.off, .off_lower, .on {
font-family: "Century Gothic";
font-size: 20px;
}
.off, .off_lower {
color: #AAAAAA;
}
</style>
<script>
/*
Super Cool On/Off Icons
Created By Wrighty
Do Not: Rip, Repost or Claim
*/
var MOD = {
d: document.getElementsByTagName('td'),
init: function(){
if(location.href.match(/(action=home|board=)/) || !location.href.match(/action=/)){
this.hunt();
}
},
hunt: function(){
for(a = 0; a < this.d.length; a++){
if(this.d.innerHTML.match(/\[(\s|\*)\]/) && this.d.className == 'windowbg'){
var s = (this.d.innerHTML.match(/\[\*\]/)? 'on' : 'off');
this.d.innerHTML = this.create(this.d[a+1].getElementsByTagName('b')[0].innerHTML, s);
}
}
},
create: function(x, y){
z = x.split(/\s/);
if(z.length > 1){
return '<span class = "' + y + '"><span class = "' + y + '_lower">' + z[0].charAt(0).toLowerCase() + '</span>' + z[1].charAt(0).toUpperCase() + '</span>';
}else{
return '<span class = "' + y + '"><span class = "' + y + '_lower">' + z[0].charAt(0).toLowerCase() + '</span>' + z[0].charAt(1).toUpperCase() + '</span>';
}
}
};
MOD.init();
</script>
What to Edit: Just edit the CSS at the top. There are parts for the 'on' and 'off' part.
You can also colour each letter individually. The '_lower' one is the lowercase letter. Currently it will look like the preview.
Preview: wimg.co.uk/zhyrBR.png
Definition: This code is rather smart - it'll automatically generate your On/Off icons dependent on the board name. If the board name is 2 words in length, then it'll take the first letter of the first word & the 1st letter of the 2nd word. It'll make the 2nd letter capitalised.
If there's only one word, then it'll do the above, but with the 1st & 2nd letter of the first word.
Placement: Global Footer
<style>
.on_lower {
color: #EE9966;
}
.off, .off_lower, .on {
font-family: "Century Gothic";
font-size: 20px;
}
.off, .off_lower {
color: #AAAAAA;
}
</style>
<script>
/*
Super Cool On/Off Icons
Created By Wrighty
Do Not: Rip, Repost or Claim
*/
var MOD = {
d: document.getElementsByTagName('td'),
init: function(){
if(location.href.match(/(action=home|board=)/) || !location.href.match(/action=/)){
this.hunt();
}
},
hunt: function(){
for(a = 0; a < this.d.length; a++){
if(this.d.innerHTML.match(/\[(\s|\*)\]/) && this.d.className == 'windowbg'){
var s = (this.d.innerHTML.match(/\[\*\]/)? 'on' : 'off');
this.d.innerHTML = this.create(this.d[a+1].getElementsByTagName('b')[0].innerHTML, s);
}
}
},
create: function(x, y){
z = x.split(/\s/);
if(z.length > 1){
return '<span class = "' + y + '"><span class = "' + y + '_lower">' + z[0].charAt(0).toLowerCase() + '</span>' + z[1].charAt(0).toUpperCase() + '</span>';
}else{
return '<span class = "' + y + '"><span class = "' + y + '_lower">' + z[0].charAt(0).toLowerCase() + '</span>' + z[0].charAt(1).toUpperCase() + '</span>';
}
}
};
MOD.init();
</script>
What to Edit: Just edit the CSS at the top. There are parts for the 'on' and 'off' part.
You can also colour each letter individually. The '_lower' one is the lowercase letter. Currently it will look like the preview.