Post by Todge on Aug 18, 2009 12:14:06 GMT -8
This will put a 'Thesarus' button next the 'Post Reply' button in the quick reply area and the 'Reset' button in the posting area..
If you highlight a word in the reply area that you have typed and click that button 'Thesaurus.com' should open in a new page giving you options for your chosen word..
Put it in your Global Footer..
Edited to work in Safari
If you highlight a word in the reply area that you have typed and click that button 'Thesaurus.com' should open in a new page giving you options for your chosen word..
Put it in your Global Footer..
<script type="text/javascript">
<!--
/*
Thesaurus Button...
by Todge
Copyright © 2009
Please keep this header intact
*/
if(location.href.match(/=display(.)+thread=/) || document.postForm)
{
function getWord()
{
var txt = '';
if(window.getSelection)
{
txt = window.getSelection();
}
else if(document.getSelection)
{
txt = document.getSelection();
}
else if(document.selection)
{
txt = document.selection.createRange().text;
}
else return;
window.open('http://thesaurus.reference.com/browse/'+txt);
}
function getWordFF()
{
if(document.postForm)
{
var tArea = document.postForm.message;
}
else
{
var tArea = document.getElementById("qreply");
}
var txt = '';
if (tArea.selectionStart!= undefined) {
txt = tArea.value.substr(tArea.selectionStart, tArea.selectionEnd - tArea.selectionStart);
}
else return;
window.open('http://thesaurus.reference.com/browse/'+txt);
}
var thesaurus = document.createElement('input');
with (thesaurus) { type="button"; value="Thesaurus"; name="thesaurus";}
if(navigator.userAgent.toLowerCase().match(/(firefox|opera|safari)/))
{
thesaurus.onclick = getWordFF;
}
else
{
thesaurus.onclick = getWord;
}
if(document.postForm)
{
document.postForm.nextaction.parentNode.appendChild(document.createTextNode(' '));
document.postForm.nextaction.parentNode.appendChild(thesaurus);
}
else
{
var QR = document.forms;
for(q=0; q<QR.length; q++)
{
if(QR[q].method == 'post')
{
QR[q].message.id = 'qreply';
QR[q].insertBefore(thesaurus,QR[q].lastChild);
QR[q].insertBefore(document.createTextNode(' '),QR[q].lastChild);
}}}}
// -->
</script>
Edited to work in Safari