Thread: [Xsltforms-support] TinyMCE integration in rev. 512
Brought to you by:
alain-couthures
From: Alain C. <ala...@ag...> - 2011-10-28 15:06:09
|
Hello, Rev. 512 is about TinyMCE integration and an unmodified copy of this library has been added in the SF repositories. Instead of an integration at control level, it's an integration at node level: specific types are defined to indicate that TinyMCE is to be used and that, eventually, some specific configuration is to be set. I posted a question at the XML Schema mailing list about using an extra attribute for the restriction element and about using annotation/appinfo to store specific configuration. I was pleased to receive this answer from Michael Kay: "As far as I can see, both seem perfectly reasonable uses of the extensibility points provided in XSD.". External components integration in XSLTForms could be based on this in the future! TinyMCE automatic discovery mechanism is inhibited (mode: "none") because it was in conflict with onload treatments in XSLTForms. There are currently those limitations: * using setvalue action to externally force the RTE control value will compromise the use of the Undo capability * only the incremental mode is supported because the loss of focus is not, apparently, dispatched by TinyMCE Please have a look at the test case below (check the path for TinyMCE script file before testing). Thank you for your feedbacks! -Alain ------------------------------------------------------------------------ <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsltforms="http://www.agencexml.com/xsltforms" xmlns:rte="http://www.agencexml.com/xsltforms/rte"> <head> <title>TinyMCE Support</title> <style type="text/css"> .large-textarea textarea { font-family: Courier, sans-serif; height: 10em; width: 500px; } </style> <script type="text/javascript" src="/xsltforms/scripts/tinymce_3.4.6/tiny_mce.js">/* */</script> <model xmlns="http://www.w3.org/2002/xforms"> <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.agencexml.com/xsltforms/rte"> <simpleType name="standardHTML1"> <restriction base="xsd:string" xsltforms:rte="TinyMCE"/> </simpleType> <simpleType name="standardHTML2"> <restriction base="xsd:string" xsltforms:rte="TinyMCE"/> <annotation> <appinfo> { theme : "advanced", skin : "o2k7", plugins : "lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave", theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, } </appinfo> </annotation> </simpleType> </schema> <instance id="main"> <data xmlns=""> <richtext1><p>Paragraph <i>number one</i></p></richtext1> <richtext2><p>Paragraph <i>number two</i></p></richtext2> </data> </instance> <bind nodeset="richtext1" type="rte:standardHTML1"/> <bind nodeset="richtext2" type="rte:standardHTML2"/> </model> </head> <body> <group xmlns="http://www.w3.org/2002/xforms"> <trigger> <label>Hello World1!</label> <setvalue ev:event="DOMActivate" ref="richtext1" value="'Hello <strong>World1</strong>!'"/> </trigger> <textarea ref="richtext1" class="large-textarea"/> <output value="richtext1"/> </group> <group xmlns="http://www.w3.org/2002/xforms"> <trigger> <label>Hello World2!</label> <setvalue ev:event="DOMActivate" ref="richtext2" value="'Hello <strong>World2</strong>!'"/> </trigger> <textarea ref="richtext2" class="large-textarea"/> <output value="richtext2"/> </group> </body> </html> |