Quote:
Originally Posted by Simon Lloyd
i thought that but i use both firefox and IE and when quoting a post using the quote button or typing anything in the reply box it will be entirely replaced by the canned reply when you click canned reply,
Like i said if its a pain don't waste your time over it!
|
I've tested this in firefox:
template cr_js:
Code:
<script language="javascript" type="text/javascript">
function storeCaret (textEl) {
if (textEl.createTextRange)
textEl.caretPos = document.selection.createRange().duplicate();
}
function insertAtCaret (text) {
text = text.replace(/\\"/ig, "\"");
var textb = text;
text = text.replace(/ \<br\>/ig, "");
var o = document.getElementById("{$editorid}_iframe");
if (o) {
document.getElementById("{$editorid}_iframe").contentWindow.document.body.innerHTML += textb;
}
if (document.vbform.message.createTextRange && document.vbform.message.caretPos) {
var caretPos = document.vbform.message.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
}
else
document.vbform.message.value += text;
document.vbform.message.focus();
setCursorPosition(document.vbform.message,document.vbform.message.value.lastIndexOf(text)+3,1);
}
function setCursorPosition(oInput,oStart,oEnd) {
if( oInput.setSelectionRange ) {
oInput.setSelectionRange(oStart,oEnd);
}
else if( oInput.createTextRange ) {
var range = oInput.createTextRange();
range.collapse(true);
range.moveEnd('character',oEnd);
range.moveStart('character',oStart);
range.select();
}
}
function showOutput(){
if (o) {
document.getElementById("{$editorid}_iframe").contentWindow.document.body.innerHTML += textb;
}
document.getElementById('msgOutput').innerHTML += document.vbform.message.value;
}
</script>