rem: /* Spellbound */ try { editor._setupSpellBound(); } catch(e) { gRTSE.sendReport(e); }  /* Loading Config */ editor.config=new RTSE_Config(); editor.config.load();  /* Getting Right buttons */ var theme=this.config.get('themeType','none'); if( theme=='none' ) theme=doc.location.href.replace(/^https?:\/\/(www|sh|rvb|panics)/i,'$1'); switch(theme) { case 'sh': document.getElementById('submit').image='chrome: document.getElementById('preview').image='chrome: break; case 'panics': document.getElementById('submit').image='chrome: document.getElementById('preview').image='chrome: break; }  /* Smilies */ try { editor.smilies.load(); } catch(e) { gRTSE.sendReport(e); }  /* Adding things if a sponsor */ if( this.config.get('sponsor','false')=='true' ) { document.getElementById('defaultSmiliesToolbar').hidden=false; document.getElementById('color').hidden=false; }  /* Adding Seperators (don't add in XUL for some reason...) */ var sep=document.createElement('toolbarseparator'); document.getElementById('toolbar').insertBefore(sep,document.getElementById('cut'));  /* Adding specific content */ var type=doc.getElementById('rtseType'); if(!type) return(false); type=type.value; var submit=document.getElementById('submit'); var form=doc.forms.namedItem('post'); var xul=doc.getElementById('rtseXULeditor').contentDocument.wrappedJSObject;  /* Copying value of old body and title */ if( form.elements.namedItem('oldTitle') ) { if( form.elements.namedItem('oldTitle').value!='' ) document.getElementById('title').value=form.elements.namedItem('oldTitle').value; document.getElementById('title').hidden=false; var removeTitle=function() { if( this.value=='Please Specify a Title ' ) this.value=''; }; document.getElementById('title').addEventListener('focus',removeTitle,false); document.getElementById('title').addEventListener('click',removeTitle,false); } if( form.elements.namedItem('oldBody') ) document.getElementById('body').value=form.elements.namedItem('oldBody').value;  switch(type) { case 'freply': var button=RTSE_evaluateXPath(doc,' button.setAttribute('onclick',''); button.addEventListener('click',function() { var text=RTSE_evaluateXPath(doc,' text=editor.HTMLParse(text.innerHTML); xul.getElementById('body').value+='[quote]'+text+'[/quote]\n\n'; editor._focus(); },false); break; case 'journal': /* Adding content */ var parent=document.getElementById('toolbar'); var elm=document.createElement('toolbarseparator'); parent.appendChild(elm); elm=document.createElement('toolbarbutton'); elm.setAttribute('label','Visible to All'); elm.setAttribute('id','friendsOnly'); elm.setAttribute('command','cmd_friendsOnly'); elm.setAttribute('type','checkbox'); parent.appendChild(elm); if( form.elements.namedItem('oldFriendsOnly') ) { if( form.elements.namedItem('oldFriendsOnly').value=='1' ) document.getElementById('friendsOnly').checked=true; else document.getElementById('friendsOnly').checked=false; }  var text=editor.protectedJournalText(); text=text.replace(/\[/g,'\\['); text=text.replace(/\]/g,'\\]'); text=text.replace(/\?/g,'\\?'); text=text.split('\n'); var exp; for( var i=(text.length-1); (i>=0 && text[i]!='\n'); --i ) { text[i]=text[i].replace(/\n/g,''); exp=new RegExp(text[i],'gi'); document.getElementById('body').value=document.getElementById('body').value.replace(exp,''); } while( document.getElementById('body').value[0]=='\n' ) document.getElementById('body').value=document.getElementById('body').value.substring(1); break; case 'rmessage': var button=document.createElement('toolbarbutton'); button.setAttribute('label','New Conversation'); button.setAttribute('oncommand','editor.newConv();'); document.getElementById('toolbar').appendChild(button); break; case 'bmessage': var parent=document.getElementById('toolbar').parentNode; var elm=document.createElement('label'); elm.setAttribute('value','To:'); elm.setAttribute('control','toUser'); elm.setAttribute('style','font-size:12pt;'); parent.parentNode.insertBefore(elm,parent); elm=document.createElement('textbox'); elm.setAttribute('multiline','false'); elm.setAttribute('maxlength','40'); elm.setAttribute('id','toUser'); parent.parentNode.insertBefore(elm,parent); break; default: break; }  editor.smilies.deconvert(); editor.extraBB.deconvert();  return(true); }, 
add: editor.smilies._addToMenu(); }, 
context: 	load: function() {		/* Runs at load for editor.xul */		var doc=window.parent.document;		if(!doc) return false;		/* Spellbound */		try {			editor._setupSpellBound();		} catch(e) {			gRTSE.sendReport(e);		}		/* Loading Config */		editor.config=new RTSE_Config();		editor.config.load();		/* Getting Right buttons */		var theme=this.config.get('themeType','none');		if( theme=='none' )			theme=doc.location.href.replace(/^https?:\/\/(www|sh|rvb|panics)/i,'$1');		switch(theme) {			case 'sh':			 document.getElementById('submit').image='chrome://rtse/skin/images/editor/sh_submit.png';			 document.getElementById('preview').image='chrome://rtse/skin/images/editor/sh_preview.png';			 break;			case 'panics':			 document.getElementById('submit').image='chrome://rtse/skin/images/editor/panics_submit.png';			 document.getElementById('preview').image='chrome://rtse/skin/images/editor/panics_preview.png';			 break;		}			 				/* Smilies */		try {			editor.smilies.load();		} catch(e) {			gRTSE.sendReport(e);		}		/* Adding things if a sponsor */		if( this.config.get('sponsor','false')=='true' ) {			document.getElementById('defaultSmiliesToolbar').hidden=false;			document.getElementById('color').hidden=false;		}		/* Adding Seperators (don't add in XUL for some reason...) */		var sep=document.createElement('toolbarseparator');		document.getElementById('toolbar').insertBefore(sep,document.getElementById('cut'));		/* Adding specific content */		var type=doc.getElementById('rtseType');		if(!type) return(false);		type=type.value;		var submit=document.getElementById('submit');		var form=doc.forms.namedItem('post');		var xul=doc.getElementById('rtseXULeditor').contentDocument.wrappedJSObject;		/* Copying value of old body and title */		if( form.elements.namedItem('oldTitle') ) {			if( form.elements.namedItem('oldTitle').value!='' )				document.getElementById('title').value=form.elements.namedItem('oldTitle').value;			document.getElementById('title').hidden=false;			var removeTitle=function() {				if( this.value=='Please Specify a Title ' )					this.value='';			};			document.getElementById('title').addEventListener('focus',removeTitle,false);			document.getElementById('title').addEventListener('click',removeTitle,false);					}		if( form.elements.namedItem('oldBody') )			document.getElementById('body').value=form.elements.namedItem('oldBody').value;				switch(type) {			case 'freply':			 var button=RTSE_evaluateXPath(doc,'//td/table/tbody/tr/td/input[@class="submit" and @type="button"]')[0];			 button.setAttribute('onclick','');			 button.addEventListener('click',function() {				var text=RTSE_evaluateXPath(doc,'//td[@class="comment"]/table/tbody/tr/td[2]/table/tbody/tr[2]/td')[0];				text=editor.HTMLParse(text.innerHTML);				xul.getElementById('body').value+='[quote]'+text+'[/quote]\n\n';				editor._focus();			 },false);			 break;			case 'journal':			 /* Adding content */			 var parent=document.getElementById('toolbar');			 var elm=document.createElement('toolbarseparator');			 parent.appendChild(elm);			 elm=document.createElement('toolbarbutton');			 elm.setAttribute('label','Visible to All');			 elm.setAttribute('id','friendsOnly');			 elm.setAttribute('command','cmd_friendsOnly');			 elm.setAttribute('type','checkbox');		 				 parent.appendChild(elm);			 if( form.elements.namedItem('oldFriendsOnly') ) {				if( form.elements.namedItem('oldFriendsOnly').value=='1' )					document.getElementById('friendsOnly').checked=true;				else					document.getElementById('friendsOnly').checked=false;			 }			 // journal protection removal			 var text=editor.protectedJournalText();			 text=text.replace(/\[/g,'\\[');			 text=text.replace(/\]/g,'\\]');			 text=text.replace(/\?/g,'\\?');			 text=text.split('\n');			 var exp;			 for( var i=(text.length-1); (i>=0 && text[i]!='\n'); --i ) {			 	text[i]=text[i].replace(/\n/g,'');			 	exp=new RegExp(text[i],'gi');			 	document.getElementById('body').value=document.getElementById('body').value.replace(exp,'');			 }			 while( document.getElementById('body').value[0]=='\n' )			 	document.getElementById('body').value=document.getElementById('body').value.substring(1);			 break;			case 'rmessage':			 var button=document.createElement('toolbarbutton');			 button.setAttribute('label','New Conversation');			 button.setAttribute('oncommand','editor.newConv();');			 document.getElementById('toolbar').appendChild(button);			 break;			case 'bmessage':			 var parent=document.getElementById('toolbar').parentNode;			 var elm=document.createElement('label');			 elm.setAttribute('value','To:');			 elm.setAttribute('control','toUser');			 elm.setAttribute('style','font-size:12pt;');			 parent.parentNode.insertBefore(elm,parent);			 elm=document.createElement('textbox');			 elm.setAttribute('multiline','false');			 elm.setAttribute('maxlength','40');			 elm.setAttribute('id','toUser');			 parent.parentNode.insertBefore(elm,parent);			 break;			default:			 break;			 		}				editor.smilies.deconvert();		editor.extraBB.deconvert();				return(true);	},
meta: 760	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/760/589d184b592cfe5b37065a3b07c6d069f8855551/editor.js/clean/chrome/content/editor.js