Phil (Login mrpip) Forum Owner | Re: formatting | February 13 2006, 8:58 PM |
Its been a year or so that I've looked at the code and looks to hard to repeat so I've coped it as is from here.
Edit, add your code between where it says <!-- YOUR CONTENT BEGINS HERE ----> and <!-- END YOUR CONTENT HERE----->
Code: <script language="Javascript"><!--
if (location.href.indexOf("post") != -1){
document.write('<div id="showimage" style="position:absolute; width:172px; left:10; top:270;"><table border="0" width="172" style="background-color:ButtonFace; border-top: 1px solid ThreeDLightShadow; border-right: 1px solid ThreeDDarkShadow; border-bottom: 1px solid ThreeDDarkShadow; border-left: 1px solid ThreeDLightShadow;" cellspacing="0" cellpadding="0"><tr><td width="100%"><table border="0" width="100%" style="background-color:ButtonFace; border-top: 1px solid ThreeDHighlight; border-right: 1px solid ThreeDShadow; border-bottom: 1px solid ThreeDShadow; border-left: 1px solid ThreeDHighlight;" cellspacing="0" cellpadding="2"><tr><td width="100%">')
document.write('<table border="0" width="100%" cellspacing="0" cellpadding="0"><tr><td id="dragbar" style="cursor:move;background-color:ActiveCaption" width="100%"><ilayer width="100%" onSelectStart="return false">')
document.write('<layer width="100%" onMouseover="dragswitch=1;if (ns4) drag_dropns(showimage)" onMouseout="dragswitch=0"><font face="Verdana" style="cursor:move; background-color:ActiveCaption; color:CaptionText; font-size:10pt;"><b>')
document.write('Formatting</b></font></layer></ilayer></td><td width="1" style="background-color:ActiveCaption">[<a title="show/hide" id="exp1090916711_link" href="javascript: void(0);" onclick="toggle(this, \'exp1090916711\');" style="text-decoration: none; color: CaptionText;">−</a>]</td></tr><tr><td width="100%" colspan="2" align="center" style="background-color:ButtonFace;"><div id="exp1090916711" style="padding: 5px;">')
<!-- YOUR CONTENT BEGINS HERE ---->
document.write('<img src="http://www.network54.com/Realm/mrpip/eicon/angry.gif" border="0" width="16" height="16" alt="Angry" title="Angry" style="cursor:pointer;" onclick="Emoticons(this.src)" /> ')
document.write('<img src="http://www.network54.com/Realm/mrpip/eicon/angryfire.gif" border="0" width="16" height="16" alt="Angry Fire" title="Angry Fire" style="cursor:pointer;" onclick="Emoticons(this.src)" /> ')
document.write('<img src="http://www.network54.com/Realm/mrpip/eicon/biggrin.gif" border="0" width="16" height="16" alt="Big Grin" title="Big Grin" style="cursor:pointer;" onclick="Emoticons(this.src)" /> ')
document.write('<img src="http://www.network54.com/Realm/mrpip/eicon/crying.gif" border="0" width="16" height="16" alt="Crying" title="Crying" style="cursor:pointer;" onclick="Emoticons(this.src)" /> ')
document.write('<img src="http://www.network54.com/Realm/mrpip/eicon/disgust.gif" border="0" width="16" height="16" alt="Disgust" title="Disgust" style="cursor:pointer;" onclick="Emoticons(this.src)" /> ')
document.write('<img src="http://www.network54.com/Realm/mrpip/eicon/furious.gif" border="0" width="16" height="16" alt="Furious" title="Furious" style="cursor:pointer;" onclick="Emoticons(this.src)" /><br>')
document.write('<img src="http://www.network54.com/Realm/mrpip/eicon/hmph.gif" border="0" width="16" height="16" alt="Hmph" title="Hmph" style="cursor:pointer;" onclick="Emoticons(this.src)" /> ')
document.write('<img src="http://www.network54.com/Realm/mrpip/eicon/laughing.gif" border="0" width="16" height="16" alt="Laughing" title="Laughing" style="cursor:pointer;" onclick="Emoticons(this.src)" /> ')
document.write('<img src="http://www.network54.com/Realm/mrpip/eicon/liplick.gif" border="0" width="16" height="16" alt="Lick Lips" title="Lick Lips" style="cursor:pointer;" onclick="Emoticons(this.src)" /> ')
document.write('<img src="http://www.network54.com/Realm/mrpip/eicon/lookaround.gif" border="0" width="16" height="16" alt="Look around" title="Look around" style="cursor:pointer;" onclick="Emoticons(this.src)" /> ')
document.write('<img src="http://www.network54.com/Realm/mrpip/eicon/mad.gif" border="0" width="16" height="16" alt="Mad" title="Mad" style="cursor:pointer;" onclick="Emoticons(this.src)" /> ')
document.write('<img src="http://www.network54.com/Realm/mrpip/eicon/rolleyes.gif" border="0" width="16" height="16" alt="Roll eyes" title="Roll eyes" style="cursor:pointer;" onclick="Emoticons(this.src)" /><br>')
document.write('<img src="http://www.network54.com/Realm/mrpip/eicon/sad.gif" border="0" width="16" height="16" alt="Sad" title="Sad" style="cursor:pointer;" onclick="Emoticons(this.src)" /> ')
document.write('<img src="http://www.network54.com/Realm/mrpip/eicon/shades.gif" border="0" width="16" height="16" alt="Shades" title="Shades" style="cursor:pointer;" onclick="Emoticons(this.src)" /> ')
document.write('<img src="http://www.network54.com/Realm/mrpip/eicon/shocked.gif" border="0" width="16" height="16" alt="Shocked" title="Shocked" style="cursor:pointer;" onclick="Emoticons(this.src)" /> ')
document.write('<img src="http://www.network54.com/Realm/mrpip/eicon/smile.gif" border="0" width="16" height="16" alt="Smile" title="Smile" style="cursor:pointer;" onclick="Emoticons(this.src)" /> ')
document.write('<img src="http://www.network54.com/Realm/mrpip/eicon/tongue.gif" border="0" width="16" height="16" alt="Tongue" title="Tongue" style="cursor:pointer;" onclick="Emoticons(this.src)" /> ')
document.write('<img src="http://www.network54.com/Realm/mrpip/eicon/wink.gif" border="0" width="16" height="16" alt="Wink" title="Wink" style="cursor:pointer;" onclick="Emoticons(this.src)" /><br />')
document.write("<img src='http://www.network54.com/Realm/mrpip/gone.gif' border=0 width=1 height=8><br>")
document.write("<img src='http://www.network54.com/Realm/mrpip/btns/bold.gif' border=0 width=23 height=22 title='Bold' alt='Bold' style=cursor:pointer; onclick='doFTxt("+'"'+"Bold"+'"'+")'>")
document.write("<img src='http://www.network54.com/Realm/mrpip/btns/italicize.gif' border=0 width=23 height=22 title='Italic' alt='Italic' style=cursor:pointer; onclick='doFTxt("+'"'+"Italic"+'"'+")'>")
document.write("<img src='http://www.network54.com/Realm/mrpip/btns/underline.gif' border=0 width=23 height=22 title='Underline' alt='Underline' style=cursor:pointer; onclick='doFTxt("+'"'+"Underline"+'"'+")'>")
document.write("<img src='http://www.network54.com/Realm/mrpip/btns/strike.gif' border=0 width=23 height=22 title='Strikethrough' alt='Strikethrough' style=cursor:pointer; onclick='FTxt("+'"'+"<s>TEXT</s> "+'"'+")'>")
document.write("<img src='http://www.network54.com/Realm/mrpip/btns/sup.gif' border=0 width=23 height=22 title='Superscript' alt='Superscript' style=cursor:pointer; onclick='FTxt("+'"'+"<sup>TEXT</sup> "+'"'+")'>")
document.write("<img src='http://www.network54.com/Realm/mrpip/btns/sub.gif' border=0 width=23 height=22 title='Subscript' alt='Subscript' style=cursor:pointer; onclick='FTxt("+'"'+"<sub>TEXT</sub> "+'"'+")'><br />")
document.write("<img src='http://www.network54.com/Realm/mrpip/btns/center.gif' border=0 width=23 height=22 title='Align Center' alt='Align Center' style=cursor:pointer; onclick='FTxt("+'"'+"<center>TEXT</center> "+'"'+")'>")
document.write("<img src='http://www.network54.com/Realm/mrpip/btns/hr.gif' border=0 width=23 height=22 title='Horizonal Line' alt='Horizonal Line' style=cursor:pointer; onclick='doFTxt("+'"'+"HRule"+'"'+")'>")
document.write("<img src='http://www.network54.com/Realm/mrpip/btns/list.gif' border=0 width=23 height=22 title='Bulleted List' alt='Bulleted List' style=cursor:pointer; onclick='doFTxt("+'"'+"UList"+'"'+")'>")
document.write("<img src='http://www.network54.com/Realm/mrpip/btns/listorder.gif' border=0 width=23 height=22 title='Numbered List' alt='Numbered List' style=cursor:pointer; onclick='doFTxt("+'"'+"OList"+'"'+")'>")
document.write("<img src='http://www.network54.com/Realm/mrpip/btns/pre.gif' border=0 width=23 height=22 title='Preformat Text' alt='Preformat Text' style=cursor:pointer; onclick='FTxt("+'"'+"<pre>TEXT</pre>"+'"'+")'>")
document.write("<img src='http://www.network54.com/Realm/mrpip/btns/quote.gif' border=0 width=23 height=22 title='Insert Quote' alt='Insert Quote' style=cursor:pointer; onclick='doFTxt("+'"'+"Quote"+'"'+")'><br>")
document.write("<img src='http://www.network54.com/Realm/mrpip/btns/url.gif' border=0 width=23 height=22 title='Insert Hyperlink' alt='Insert Hyperlink' style=cursor:pointer; onclick='doFTxt("+'"'+"InsertUrl"+'"'+")'>")
document.write("<img src='http://www.network54.com/Realm/mrpip/btns/img.gif' border=0 width=23 height=22 title='Insert Image' alt='Insert Image' style=cursor:pointer; onclick='doFTxt("+'"'+"InsertImage"+'"'+")'>")
document.write("<img src='http://www.network54.com/Realm/mrpip/btns/object.gif' border=0 width=23 height=22 title='Insert Object' alt='Insert Object' style=cursor:pointer; onclick='doFTxt("+'"'+"InsertObject"+'"'+")'>")
document.write("<img src='http://www.network54.com/Realm/mrpip/btns/code.gif' border=0 width=23 height=22 title='HTML Coder...' alt='HTML Coder...' style=cursor:pointer; onclick='window.open(\"http://homepages.slingshot.co.nz/~mrpip/hform/html2ascii.html\",\"coderingw\",\"toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=0,width=650,height=400\")'>")
document.write("<img src='http://www.network54.com/Realm/mrpip/gone.gif' border=0 width=23 height=1>")
document.write("<img src='http://www.network54.com/Realm/mrpip/btns/cchar.gif' border=0 width=23 height=22 title='Message Length' alt='Message Length' style=cursor:pointer; onclick='CheckLength()'><br>")
document.write("<img src='http://www.network54.com/Realm/mrpip/gone.gif' border=0 width=1 height=8><br>")
document.write("<select class='defaulttext' onChange='if(this.options[this.selectedIndex].value){fontcolor(this.options[this.selectedIndex].value);this.options.selectedIndex=0;}'><option selected> Color<option VALUE='#000000'>Black<option value='blue'>Blue<option value='red'>Red")
document.write("<option value='purple'>Purple<option value='orange'>Orange<option value='yellow'>Yellow<option value='gray'>Gray<option value='green'>Green</select>")
document.write("<select class='defaulttext' onChange='if(this.options[this.selectedIndex].value){fontsize(this.options[this.selectedIndex].value);this.options.selectedIndex=0;}'><option selected> Size<option value='1'>Smallest<option value='2'>Smaller<option value='3'>Small<option value='4'>Medium")
document.write("<option value='5'>Large<option value='6'>Larger<option value='7'>Largest</select> ")
document.write("<select class='defaulttext' onChange='if(this.options[this.selectedIndex].value){extchars(this.options[this.selectedIndex].value);this.options.selectedIndex=0;}'><option selected>ExtChar<option value='…'> … <option value='•'> • ")
document.write("<option value='™'> ™ <option value='¢'> ¢ <option value='£'> £ <option value='©'> © <option value='ª'> ª ")
document.write("<option value='«'> « <option value='®'> ® <option value='°'> ° <option value='±'> ± <option value='²'> ² ")
document.write("<option value='³'> ³ <option value='¹'> ¹ <option value='»'> » <option value='¼'> ¼ ")
document.write("<option value='½'> ½ <option value='¾'> ¾ <option value='×'> × <option value='÷'> ÷ </select><br>")
document.write("<img src='http://www.network54.com/Realm/mrpip/gone.gif' border=0 width=1 height=8><br>")
document.write("<img src='http://www.network54.com/Realm/mrpip/btns/spchk.gif' border=0 width=23 height=22 title='Spell Checker' alt='Spell Checker' style=cursor:pointer; onclick='window.open(\"http://www.spellcheck.net/\")'>")
document.write("<img src='http://www.network54.com/Realm/mrpip/btns/thesaurus.gif' border=0 width=23 height=22 title='Thesaurus' alt='Thesaurus' style=cursor:pointer; onclick='window.open(\"http://www.thesaurus.com/\")'>")
document.write("<img src='http://www.network54.com/Realm/mrpip/gone.gif' border=0 width=69 height=1>")
if (document.referrer){if ((document.referrer.indexOf("thread?forumid") != -1)||(document.referrer.indexOf("message?forumid") != -1)){
document.write("<img src='http://www.network54.com/Realm/mrpip/btns/overview.gif' border=0 width=23 height=22 title='Topic Overview' alt='Topic Overview' style=cursor:pointer; onclick='threadviewer(document.referrer)'>")}
else {document.write("<img src='http://www.network54.com/Realm/mrpip/gone.gif' border=0 width=23 height=1>")}}
<!-- END YOUR CONTENT HERE----->
document.write("</div></td></tr></table></td></tr></table></td></tr></table></div>")
}
// FUNCTIONS -->
var ns4=document.layers; var ie4=document.all; var ns6=document.getElementById&&!document.all; var dragswitch=0; var nsx; var nsy; var nstemp;
function drag_dropns(name){if (!ns4) return; temp=eval(name); temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP);
temp.onmousedown=gons; temp.onmousemove=dragns; temp.onmouseup=stopns;}
function gons(e){temp.captureEvents(Event.MOUSEMOVE); nsx=e.x; nsy=e.y;}
function dragns(e){if (dragswitch==1){temp.moveBy(e.x-nsx,e.y-nsy); return false}}
function stopns(){temp.releaseEvents(Event.MOUSEMOVE)}
function drag_drop(e){if (ie4&&dragapproved){crossobj.style.left=tempx+event.clientX-offsetx; crossobj.style.top=tempy+event.clientY-offsety; return false} else if (ns6&&dragapproved){crossobj.style.left=tempx+e.clientX-offsetx; crossobj.style.top=tempy+e.clientY-offsety; return false;}}
function initializedrag(e){crossobj=ns6? document.getElementById("showimage") : document.all.showimage; var firedobj=ns6? e.target : event.srcElement; var topelement=ns6? "HTML" : "BODY";
while (firedobj.tagName!=topelement&&firedobj.id!="dragbar"){firedobj=ns6? firedobj.parentNode : firedobj.parentElement}
if (firedobj.id=="dragbar"){offsetx=ie4? event.clientX : e.clientX; offsety=ie4? event.clientY : e.clientY; tempx=parseInt(crossobj.style.left); tempy=parseInt(crossobj.style.top); dragapproved=true; document.onmousemove=drag_drop;}}
document.onmousedown=initializedrag; document.onmouseup=new Function("dragapproved=false")
function Emoticons(thisimage){
if(document.getElementById("textEdit")!=null){setFocus();doFormat("InsertImage",thisimage)}
else if(document.forms[0].message.type=="hidden"){alert("Unable to edit message in \"Preview Mode\"!")}
else document.forms[0].message.value += thisimage + " ";document.forms[0].message.focus()
}
function extchars(asymbol){if(document.getElementById("textEdit")!=null){setFocus();var sel=getSelection().createRange(); sel.pasteHTML(asymbol); sel.select()}
else{FTxt(asymbol)}
}
function doFTxt(thisText){if(document.getElementById("textEdit")!=null){
setFocus();
if (thisText=="Bold") {doFormat("bold")}
else if (thisText=="Italic") {doFormat("italic")}
else if (thisText=="Underline") {doFormat("underline")}
else if (thisText=="HRule") {doFormat("InsertHorizontalRule")}
else if (thisText=="UList") {doFormat("insertunorderedlist")}
else if (thisText=="OList") {doFormat("insertorderedlist")}
else if ((thisText=="InsertObject")||(thisText=="InsertImage")) {insert_object()}
else if (thisText=="InsertUrl") {createLink()}
else if (thisText=="Quote") {doexect('<table align="center" width="70%" style="background-color:white; border-style:solid; border-width:1px; border-color:#A9AB9A; font-size:8pt;"><tr><td><b>Quote:</b><br>','</td></tr></table>\n')}
}
else{if(document.forms[0].message.type=="hidden"){alert("Unable to edit message")}
else{var newTxt="";
if (thisText=="Bold"){newTxt="<b>TEXT</b> "}
else if (thisText=="Italic"){newTxt="<i>TEXT</i> "}
else if (thisText=="Underline"){newTxt="<u>TEXT</u> "}
else if (thisText=="HRule"){newTxt="<hr>"}
else if (thisText=="UList"){newTxt="<ul><li>TEXT <li>TEXT <li>TEXT </ul> "}
else if (thisText=="OList"){newTxt="<ol><li>TEXT <li>TEXT <li>TEXT </ol> "}
else if (thisText=="InsertObject") {aobject()}
else if (thisText=="InsertUrl") {
var thisUrl=prompt("Enter the complete URL for the site you wish to link to.", "http://");
var thisUrlTitle=prompt("Now enter a title for the url you are referencing to. Caution: if using url as title, remove \"http://\" from address!", "url title");
newTxt="<a href=\""+thisUrl+"\" target=\"_blank\">"+thisUrlTitle+"</a>";}
else if (thisText=="InsertImage") {newTxt="<img src=\"IMAGE2URL\">"}
else if (thisText=="Quote"){newTxt="<table align=center width=70% class=QuoteBox><tr><td><b>Quote:</b><br>TEXT</td></tr></table> "}
if(newTxt != ""){document.forms[0].message.value += newTxt;document.forms[0].message.focus()}}
}}
function doexec(txt1,txt2){
var sEdit=textEdit.document.selection.createRange();
if (sEdit.htmlText.length > 0) {
var txtsel=txt1+sEdit.htmlText+txt2;
var Edit=textEdit.document.selection.createRange();
Edit.pasteHTML(txtsel); Edit.select(); textEdit.focus()}
}
function doexect(txt1,txt2){
var sEdit=textEdit.document.selection.createRange();
if (sEdit.htmlText.length = 0) {sEdit.htmlText="TEXT"}
var txtsel=txt1+sEdit.htmlText+txt2;
var Edit=textEdit.document.selection.createRange();
Edit.pasteHTML(txtsel); Edit.select(); textEdit.focus()
}
function FTxt(thisText){if(document.forms[0].message.type=="hidden"){alert("Unable to edit message")}
else{document.forms[0].message.value += thisText;document.forms[0].message.focus()}
}
function fontcolor(thiscolor){
if(document.getElementById("textEdit")!=null){setFocus();doFormat("ForeColor",thiscolor)}
else{if(document.forms[0].message.type=="hidden"){alert("Unable to edit message")}
else{document.forms[0].message.value += "<font color=\"" + thiscolor + "\">TEXT</font>"; document.forms[0].message.focus();}
}}
function fontsize(thissize){
if(document.getElementById("textEdit")!=null){setFocus();doFormat("FontSize",thissize)}
else{if(document.forms[0].message.type=="hidden"){alert("Unable to edit message")}
else{document.forms[0].message.value += "<font size=\"" + thissize + "\">TEXT</font>"; document.forms[0].message.focus();}
}}
function CheckLength(){if(document.forms[0].message.type=="hidden"){alert("Unable to check message length")}
else{
var MessageMax = "\"Unknown\"";
MessageLength = document.forms[0].message.value.length;
message = "";
if (MessageMax !=0){message = "Post:\nThe maximum allowed length is " + MessageMax + " characters.";}
else{message = "";}
alert(message + "\nSo far, you have used " + MessageLength + " characters.");
}}
function threadviewer(VTUrl){window.open(VTUrl, "viewer", "toolbar=0 , location=0, directories=0, status=0, menubar=0, scrollbars=1, resizable=1, left=5, width=700, height=400")}
function amyDialog(){var url; var name; var type;}
function aobject(){amyDialog.url = ""; amyDialog.name = ""; amyDialog.type = ""; url = "http://www.network54.com/Apps/dialog.php3? url=/Browser/"; var arr = showModalDialog( url, amyDialog, "font-family:Verdana; font-size:12; dialogWidth:50em; dialogHeight:36em");
if(arr){str = amyDialog.url; if (amyDialog.type == 'votelets') document.forms[0].message.value += 'votelet://' + amyDialog.url + ' '; else document.forms[0].message.value += 'http://www.network54.com' + str + ' ';}}
// --></script> |
 Spread Firefox!
 |
| |
|