Bones
Code Helper
Posts: 131
Bones said 0 great things
|
Post by Bones on Jan 23, 2011 22:05:33 GMT -8
Place it directly below the posting request code
<script type="text/javascript"> <!-- /* Patch - Add UBBC and smiley support to SoCal "Posting Request Form/Template V2" - Eton */ /* Install directly below the "Posting Request Form/Template V2" code */
if(document.postForm && document.getElementById('requestform') && document.getElementById('requestform').getElementsByTagName('textarea').length){ c=document.getElementsByName('color')[0].parentNode.parentNode.parentNode c.removeAttribute('style') c.nextSibling.removeAttribute('style') function add(open, end) { if("undefined"==typeof activeTA){alert(lfields);return void(0);} var tArea = activeTA; var sct = tArea.scrollTop; var open = open ? open : ""; var end = end ? end : ""; var sl; if (isIE) { tArea.focus(); var curSelect = document.selection.createRange(); if (arguments[2]) { curSelect.text = open + arguments[2] + "]" + curSelect.text + end; } else { curSelect.text = open + curSelect.text + end; } } else if (!isIE && typeof tArea.selectionStart != "undefined") { var selStart = tArea.value.substr(0, tArea.selectionStart); var selEnd = tArea.value.substr(tArea.selectionEnd, tArea.value.length); var curSelection = tArea.value.replace(selStart, "").replace(selEnd, ""); if (arguments[2]) { sl = selStart + open + arguments[2] + "]" + curSelection + end; tArea.value = sl + selEnd; } else { sl = selStart + open + curSelection + end; tArea.value = sl + selEnd; } tArea.setSelectionRange(sl.length, sl.length); tArea.focus(); tArea.scrollTop = sct; } else { tArea.value += arguments[2] ? open + arguments[2] + "]" + end : open + end; } } d=document.getElementById('requestform').getElementsByTagName('textarea') var lfields="" for(c=0;c<d.length;c++){ d[c].onfocus=function(event){var thiss=(event.target||event.srcElement);activeTA=thiss} e=d[c].parentNode.previousSibling.lastChild.lastChild.data lfields+='"'+e+'"\n' } lfields='Please click on the text area in one of the following fields first\n'+lfields } /--> </script>
|
|