Post by Ady on Feb 7, 2006 17:26:35 GMT
<script type="text/javascript">
/*
Auto-Skin hack for ProBoards by Ady Smith,
Keep this comment inside the script at all times!
Email ady@smashrocket.com for any questions.
*/
var name = ""; // Edit the Skin Name
var logo = ""; // Edit the Skin Logo
var font = ""; // Edit the Skin Font
var bgcolor = ""; // Edit the Skin Background Color
var bgimage = ""; // Edit the Skin Background Image
var text = ""; // Edit the Skin Text Color
var link = ""; // Edit the Skin Link Color
var alink = ""; // Edit the Skin Active Link Color
var vlink = ""; // Edit the Skin Visited Link Color
var titlebg = ""; // Edit the Skin Title Background Color
var titletext = ""; // Edit the Skin Title Text Color
var catbg = ""; // Edit the Skin Category Background Color
var cattext = ""; // Edit the Skin Category Text Color
var newstitlebg = ""; // Edit the Skin News Title Background Color
var newstitletext = ""; // Edit the Skin News Title Text Color
var newsbg = ""; // Edit the Skin News Background Color
var newstext = ""; // Edit the Skin News Text Color
var windowbg = ""; // Edit the Skin Window Background Color 1
var windowbg2 = ""; // Edit the Skin Window Background Color 2
var boardhighlight = ""; // Edit the Skin Board Highlight Color
var messagehighlight = ""; // Edit the Skin Thread Highlight Color
var bordercolor = ""; // Edit the Skin Border Color
var popupbg = ""; // Edit the Skin Popup Background Color
var popuptext = ""; // Edit the Skin Popup Text Color
var popuptitlebg = ""; // Edit the Skin Popup Title Background Color
var popuptitletext = ""; // Edit the Skin Popup Title Text Color
function cskin()
{
document.prefs.name.value = document.prefs.name.value = ""+name+"";
document.prefs.logo.value = document.prefs.logo.value = ""+logo+"";
document.prefs.font.value = document.prefs.font.value = ""+font+"";
document.prefs.bgcolor.value = document.prefs.bgcolor.value = ""+bgcolor+"";
document.prefs.bgimage.value = document.prefs.bgimage.value = ""+bgimage+"";
document.prefs.text.value = document.prefs.text.value = ""+text+"";
document.prefs.link.value = document.prefs.link.value = ""+link+"";
document.prefs.alink.value = document.prefs.alink.value = ""+alink+"";
document.prefs.vlink.value = document.prefs.vlink.value = ""+vlink+"";
document.prefs.titlebg.value = document.prefs.titlebg.value = ""+titlebg+"";
document.prefs.titletext.value = document.prefs.titletext.value = ""+titletext+"";
document.prefs.catbg.value = document.prefs.catbg.value = ""+catbg+"";
document.prefs.cattext.value = document.prefs.cattext.value = ""+cattext+"";
document.prefs.newstitlebg.value = document.prefs.newstitlebg.value = ""+newstitlebg+"";
document.prefs.newstitletext.value = document.prefs.newstitletext.value = ""+newstitletext+"";
document.prefs.newsbg.value = document.prefs.newsbg.value = ""+newsbg+"";
document.prefs.newstext.value = document.prefs.newstext.value = ""+newstext+"";
document.prefs.windowbg.value = document.prefs.windowbg.value = ""+windowbg+"";
document.prefs.windowbg2.value = document.prefs.windowbg2.value = ""+windowbg2+"";
document.prefs.boardhighlight.value = document.prefs.boardhighlight.value = ""+boardhighlight+"";
document.prefs.messagehighlight.value = document.prefs.messagehighlight.value = ""+messagehighlight+"";
document.prefs.bordercolor.value = document.prefs.bordercolor.value = ""+bordercolor+"";
document.prefs.popupbg.value = document.prefs.popupbg.value = ""+popupbg+"";
document.prefs.popuptext.value = document.prefs.popuptext.value = ""+popuptext+"";
document.prefs.popuptitlebg.value = document.prefs.popuptitlebg.value = ""+popuptitlebg+"";
document.prefs.popuptitletext.value = document.prefs.popuptitletext.value = ""+popuptitletext+"";
}
if( location.href.match(/action=skinsmodify2/i) )
{ document.write('<center><input class="button" type="button" name="skin" value="Change Skin" onClick="cskin()"></center>') }
</script>
This is my first proper JavaScript code, what it does is makes things easier for skin designers when they want to give out their skins. Instead of telling them to change each individual input box when you change a skin's colors, they can just click on the button labelled "Change Skin" at the top of the page and it'll change to the variables you set. Pretty simple.