var is_nav = ((clientPC.indexOf('mozilla')!=-1) && (clientPC.indexOf('spoofer')==-1)
&& (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera')==-1)
&& (clientPC.indexOf('webtv')==-1) && (clientPC.indexOf('hotjava')==-1)
- && (clientPC.indexOf('khtml')==-1));
+ && (clientPC.indexOf('khtml')==-1) && (clientPC.indexOf('gecko')==-1));
if(!document.selection && !is_nav) {
document.write("<form name='infoform' id='infoform'>"+
"<input size=80 id='infobox' name='infobox' value='"+
}
function escapeQuotes(text) {
-
- text=text.replace(/'/g,"\\'");
- text=text.replace(/\n/g,"\\n");
+ var re=new RegExp("'","g");
+ text=text.replace(re,"\\'");
+ re=new RegExp("\\n","g");
+ text=text.replace(re,"\\n");
return text;
}
} else {
document.selection.createRange().text = tagOpen + theSelection + tagClose;
}
- // Mozilla
- } else if(txtarea.selectionStart || txtarea.selectionStart == '0') {
+ // Mozilla -- disabled because it induces a scrolling bug which makes it virtually unusable
+ } else if(false && txtarea.selectionStart || txtarea.selectionStart == '0') {
var startPos = txtarea.selectionStart;
var endPos = txtarea.selectionEnd;
var myText = (txtarea.value).substring(startPos, endPos);
// Append at the end: Some people find that annoying
//txtarea.value += tagOpen + sampleText + tagClose;
//txtarea.focus();
- tagOpen=tagOpen.replace(/\n/g,"");
- tagClose=tagClose.replace(/\n/g,"");
+ var re=new RegExp("\\n","g");
+ tagOpen=tagOpen.replace(re,"");
+ tagClose=tagClose.replace(re,"");
document.infoform.infobox.value=tagOpen+sampleText+tagClose;
txtarea.focus();
}