/* * WYMEditor ( XHTML wysiwig editor ) * http://files.wymeditor.org/wymeditor-1.0.0b2/examples/ */ package form.elements; import form.Form; import form.FormElement; class RichtextWym extends FormElement { public var width:Float; public var height:Float; public var allowImages:Bool; public var allowTables:Bool; public var editorStyles:String; public var containersItems:String; public var classesItems:String; public function new(name:String, label:String, ?value:String, ?required:Bool=false, ?attibutes:String="") { super(); this.name = name; this.label = label; this.value = value; this.required = required; this.attributes = attibutes; width = 500; height = 300; allowImages = true; allowTables = false; editorStyles = ""; containersItems = ""; classesItems = ""; } override public function render():String { var n = form.name + "_" +name; editorStyles = StringTools.replace(editorStyles, "\n", " "); editorStyles = StringTools.replace(editorStyles, "\r", " "); var str:StringBuf = new StringBuf(); str.add("\n "); str.add(""); if (!isValid()) str.add(" required"); return str.toString(); } public function toString() :String { return render(); } }