// initialize quicktips Ext.QuickTips.init(); Ext.namespace('Perlmonks'); Perlmonks.HtmlEditor = Ext.extend( Ext.form.HtmlEditor, { enableAlignments: false, enableLinks: false, enablePMLinks: false, createToolbar : function(editor){ Perlmonks.HtmlEditor.superclass.createToolbar.call(this, editor); this.tb.items.item('backcolor').hide(); }, setValue : function(v){ v = v.replace(/\n/g, String.fromCharCode(222)); while ( v.match(/(.+?)<\/code>/i) ) { v = v.replace(/(.+?)<\/code>/ig, escapeCode(RegExp.$1)); } while ( v.match(/(.+?)<\/c>/i) ) { v = v.replace(/(.+?)<\/c>/ig, escapeCode(RegExp.$1)); } v = v.replace(new RegExp(String.fromCharCode(222), 'g'), "\n"); Perlmonks.HtmlEditor.superclass.setValue.call(this, v); }, getValue : function(){ var v = Perlmonks.HtmlEditor.superclass.getValue.call(this); v = v.replace(/\n/g, String.fromCharCode(222)); while ( v.match(/
(.+?)<\/pre>/) )
		{
			v = v.replace(/
(.+?)<\/pre>/g, deEscapeCode(RegExp.$1));
		}

		v = v.replace(new RegExp(String.fromCharCode(222), 'g'), "\n");

		return v;
	},
	
	getDocMarkup : function(){
        return '';
    }
	

});

function deEscapeCode (txt)
{
	txt = txt.replace(/</g, '<'); txt = txt.replace(/>/g, '>');
	txt = txt.replace(/
/g, "\n"); return String.format("{0}", txt); } function escapeCode (txt) { txt = txt.replace(//g, '>'); return String.format('
{0}
', txt); } function find_my_ta () { var a = document.getElementsByTagName('textarea'); for (var i=0; i