Post by Peter on Oct 31, 2004 19:12:06 GMT
Created by Squall
<script>
/*
Easy Filters - Created by Squall. All Rights Reserved.
This script cannot be modified and/or reposted outside of SSD, without permission of its creator.
This header must remain intact, else copyright will be in violation.
*/
if(location.href.match(/(=createcategory$|cat=)/i)){
var TA = document.getElementsByTagName("TABLE")
for(t=0;t<TA.length;t++){
with(TA[t]){
if(width=="100%" && cellSpacing=="1" && className.match(/bordercolor/) && align=="center" && cellPadding=="4"){
var titleRow = insertRow(2)
var titleCell = titleRow.insertCell(0)
titleCell.className = "titlebg"
titleCell.innerHTML = "<font size=2 class=text1><b>Add Category Name Filters</b></font>"
var contentRow = insertRow(3)
var contentCell = contentRow.insertCell(0)
contentCell.className = "windowbg"
contentCell.innerHTML = '<table border="0" width="100%"><tr><td width="50%"><b>Glow Filter</b></td><td width="50%"><b>Shadow Filter</b></td></tr><tr><td>Insert Glow Color(HEX is best): <input type="input" name="glowColor"></td><td>Insert Shadow Color(Hex is best): <input type="input" name="shadowColor"></td></tr><tr><td>Insert Glow Strength: <input type="input" name="glowStrength" value="3"></td><td>Insert Shadow Direction(Left, Right, Up, Down): <input type="input" name="shadowDir"></td></tr><tr><td><input type="checkbox" name="useGlowFilter" onClick="javascript:useGlow()">Use Glow Filter</td><td><input type="checkbox" name="useShadowFilter" onClick="javascript:useShadow()">Use Shadow Filter</td></tr></table>'
}
}
}
function useGlow(){
var glowFilter = document.getElementsByName("useGlowFilter")[0]
var catName = document.getElementsByName("catname")[0]
var glowColor = document.getElementsByName("glowColor")[0]
var glowStrength = document.getElementsByName("glowStrength")[0]
var filterCode = "<span style='FILTER: Glow(Color=" + glowColor.value + ", Strength=" + glowStrength.value + "); width=300'>" + catName.value + "</span>"
if(glowFilter.checked){
if(glowStrength.value.match(/(\d+)/) && glowColor.value.match(/((\d+)|(\w+))/i)){
catName.value=filterCode
} else {
alert("Please recheck the Hex Color and Strength of your Glow Filter. They do not match the correct syntax")
}
}else{
catName.value = catName.value.replace("<span style='FILTER: Glow(Color=" + glowColor.value + ", Strength=" + glowStrength.value + "); width=300'>","")
catName.value = catName.value.replace("</span>","")
}
}
function useShadow(){
var shadowFilter = document.getElementsByName("useShadowFilter")[0]
var catName = document.getElementsByName("catname")[0]
var shadowColor = document.getElementsByName("shadowColor")[0]
var shadowDir = document.getElementsByName("shadowDir")[0]
var filterCode = "<span style='FILTER: Shadow(Color=" + shadowColor.value + ", Direction=" + shadowDir.value + ");width:200px'>" + catName.value + "</span>"
if(shadowFilter.checked){
if(shadowColor.value.match(/((\d+)|(\w+))/i) && shadowDir.value.match(/(\w+)/i)){
catName.value=filterCode
} else {
alert("Please recheck the Hex Color, Strength, and Direction of your Shadow Filter. They do not match the correct syntax")
}
}else{
catName.value = catName.value.replace("<span style='FILTER: Shadow(Color=" + shadowColor.value + ", Direction=" + shadowDir.value + ");width:200px'>","")
catName.value = catName.value.replace("</span>","")
}
}
}
</script>
Alright, what this script does, it adds a new row to the Create Category and Edit Category tables. Two filters are in it, Glow and Shadow. You just put in a couple things, press a checkbox, and it adds the filter to the category name, automatically.
Preview:
squall.elixant.com/ssd/scripts/filter.jpg
Main Footer
<script>
/*
Easy Filters - Created by Squall. All Rights Reserved.
This script cannot be modified and/or reposted outside of SSD, without permission of its creator.
This header must remain intact, else copyright will be in violation.
*/
if(location.href.match(/(=createcategory$|cat=)/i)){
var TA = document.getElementsByTagName("TABLE")
for(t=0;t<TA.length;t++){
with(TA[t]){
if(width=="100%" && cellSpacing=="1" && className.match(/bordercolor/) && align=="center" && cellPadding=="4"){
var titleRow = insertRow(2)
var titleCell = titleRow.insertCell(0)
titleCell.className = "titlebg"
titleCell.innerHTML = "<font size=2 class=text1><b>Add Category Name Filters</b></font>"
var contentRow = insertRow(3)
var contentCell = contentRow.insertCell(0)
contentCell.className = "windowbg"
contentCell.innerHTML = '<table border="0" width="100%"><tr><td width="50%"><b>Glow Filter</b></td><td width="50%"><b>Shadow Filter</b></td></tr><tr><td>Insert Glow Color(HEX is best): <input type="input" name="glowColor"></td><td>Insert Shadow Color(Hex is best): <input type="input" name="shadowColor"></td></tr><tr><td>Insert Glow Strength: <input type="input" name="glowStrength" value="3"></td><td>Insert Shadow Direction(Left, Right, Up, Down): <input type="input" name="shadowDir"></td></tr><tr><td><input type="checkbox" name="useGlowFilter" onClick="javascript:useGlow()">Use Glow Filter</td><td><input type="checkbox" name="useShadowFilter" onClick="javascript:useShadow()">Use Shadow Filter</td></tr></table>'
}
}
}
function useGlow(){
var glowFilter = document.getElementsByName("useGlowFilter")[0]
var catName = document.getElementsByName("catname")[0]
var glowColor = document.getElementsByName("glowColor")[0]
var glowStrength = document.getElementsByName("glowStrength")[0]
var filterCode = "<span style='FILTER: Glow(Color=" + glowColor.value + ", Strength=" + glowStrength.value + "); width=300'>" + catName.value + "</span>"
if(glowFilter.checked){
if(glowStrength.value.match(/(\d+)/) && glowColor.value.match(/((\d+)|(\w+))/i)){
catName.value=filterCode
} else {
alert("Please recheck the Hex Color and Strength of your Glow Filter. They do not match the correct syntax")
}
}else{
catName.value = catName.value.replace("<span style='FILTER: Glow(Color=" + glowColor.value + ", Strength=" + glowStrength.value + "); width=300'>","")
catName.value = catName.value.replace("</span>","")
}
}
function useShadow(){
var shadowFilter = document.getElementsByName("useShadowFilter")[0]
var catName = document.getElementsByName("catname")[0]
var shadowColor = document.getElementsByName("shadowColor")[0]
var shadowDir = document.getElementsByName("shadowDir")[0]
var filterCode = "<span style='FILTER: Shadow(Color=" + shadowColor.value + ", Direction=" + shadowDir.value + ");width:200px'>" + catName.value + "</span>"
if(shadowFilter.checked){
if(shadowColor.value.match(/((\d+)|(\w+))/i) && shadowDir.value.match(/(\w+)/i)){
catName.value=filterCode
} else {
alert("Please recheck the Hex Color, Strength, and Direction of your Shadow Filter. They do not match the correct syntax")
}
}else{
catName.value = catName.value.replace("<span style='FILTER: Shadow(Color=" + shadowColor.value + ", Direction=" + shadowDir.value + ");width:200px'>","")
catName.value = catName.value.replace("</span>","")
}
}
}
</script>
Alright, what this script does, it adds a new row to the Create Category and Edit Category tables. Two filters are in it, Glow and Shadow. You just put in a couple things, press a checkbox, and it adds the filter to the category name, automatically.
Preview:
squall.elixant.com/ssd/scripts/filter.jpg
Main Footer