Monday, November 08, 2010 at 12:05 AM.

system.verbs.builtins.radio.userInterface.editorBox

on editorBox (initialtext = "", ctrows = user.radio.prefs.browserBasedEditorSize, ctcols=70) {
	<<Changes
		<<8/5/03; 5:01:54 PM by JES
			<<Added support for Mozilla rich text editor.
		<<1/26/02; 2:42:35 AM by JES
			<<Added optional parameter, ctcols -- defaults to 70. Specifies the width of the editing box.
		<<12/23/01; 11:31:30 PM by JES
			<<Default value for ctrows is the value of user.radio.prefs.browserBasedEditorSize.
		<<8/31/01; 7:10:29 PM by JES
			<<Don't escape // and @ to un-hot URLs and email addresses, because since this code is called through a macro, they won't get hotted-up anyway.
		<<8/31/01; 2:18:26 AM by JES
			<<Pass the URL of the WYSIWYG toolbar graphic to html.editor.get. 
		<<8/28/01; 3:03:04 PM by JES
			<<If html.editor.get returns the empty string, then return a plain HTML textarea.
		<<5/10/01; 8:05:46 PM by DW
			<<Created. A handy-dandy all-purpose editor box. 
			<<Keep the complex code all in one place.
	initialtext = xml.entityEncode (initialtext);
	<<bundle //8/31/01 JES: commented out URL/email un-hotting code.
		<<initialtext = string.replaceAll (initialtext, "//", "\\//") //PBS 02/16/01: prevent URLs from getting hot
		<<initialtext = string.replaceAll (initialtext, "@", "\\@") //PBS 02/16/01: prevent email address from getting hot
	local (htmltext = "");
	if defined (html.editor.get) {
		htmltext = html.editor.get (initialtext, "itemtext", ctrows, toolabrImgUrl: radio.images.systemImageUrl ("toolbars/htmlEditor"), cols:ctcols, baseUrl:"/system/images/toolbars/mozillaEditor/");
		try { //trigger addition of the onload event handler to the <body> tag in pta^.template by radio.webserver.pageFilter
			html.getPageTableAddress ()^.flEditingFormOnPage = true}};
	if htmltext == "" { //add a regular textarea
		htmltext = "<textarea name=\"itemtext\" rows=\"" + ctrows + "\" cols=\"" + ctcols + "\" wrap=\"soft\">" + initialtext + "</textarea>"};
	return (htmltext)}



This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.