inherit
Beware the ever changing head
33588
0
Nov 18, 2023 0:32:44 GMT -8
Ross
19,039
November 2004
elindir
|
Post by Ross on Sept 18, 2005 6:30:03 GMT -8
Global FooterThis will add a drop down menu to add font to a post, it works in the same way as the color drop down menu. List the fonts in the green bit, enclosing each font in " quotes and seperating each font with a comma. <script type="text/javascript"> <!-- /* drop down font menu by elindir */
var font=["Verdana","Times New Roman","Comic Sans MS","Arial","Courier New","Tahoma","Century","Autumn","Lucida Console","Rockwell","Scibble","Trebuchet"];
function aF(font){add("[font=", "[/font]", font);} var td=document.getElementsByTagName("td"); for(e=0;e<td.length;e++) if(document.postForm && td[e].width=="70%" && td[e].className=="windowbg2" && td[e].previousSibling.innerHTML.match(/Add Tags/)){ var dropBox='<select onChange="aF(this.options[this.selectedIndex].value); this.selectedIndex=0;"><option value="">Font</option>'; for(j=0;j<font.length;j++) { dropBox+='<option value="'+font[j]+'">'+font[j]+'</option>'; } dropBox+='</select>'; td[e].innerHTML+=dropBox; } //--> </script>[/size] modifications:
changed td[e].innerHTML.match(/\[b\]/) to td[e].previousSibling.innerHTML.match(/Add Tags/) to prevent an issue caused when modifying a post that contained the use of the bold tag - 6th November 06
|
|