Hi all,
Sometimes ago I worked to pass parameters to cleditor to get this :
Now, I made it a module that overrides openerp's cleditor :
Cleditor enhanced :
Allows to pass parameters to cleditor as examples below :
- editor_width (string) : "500" or "30%%"
- editor_height (string) : "500" or "30%%"
- editor_controls (string) : "bold italic underline strikethrough subscript superscript | font size style | color highlight removeformat | bullets numbering | outdent indent | alignleft center alignright justify | undo redo | rule image link unlink | cut copy paste pastetext | print source"
- editor_colors (string) : short Css colors space separated : "FFF FCC FC9 FF9 FFC 9F9 9FF CFF CCF FCF " ...
- editor_fonts (string) : font name comma separated : "Arial,Arial Black,Comic Sans MS,Courier New,Narrow,Garamond" ...
- editor_sizes (string) : font size comma separated : "1,2,3,4,5,6,7"
- editor_docType (string) : '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">'
- editor_styles (string pairs as array name/tag) : "Paragraph,<p>;Header 1,<h1>"
- editor_useCSS (string but not managed to make it work)
- editor_docCSSFile (string but not managed to make it work)
- editor_bodyStyle (string) : "margin:4px; color:#4c4c4c; font-size:13px; "
Example:
<field name="content"
placeholder="e.g. Once upon a time..."
widget="html"
class="oe_edit_only"
options='{"safe": True}'
editor_width="100%%"
editor_height="500"
editor_controls="bold italic underline strikethrough subscript superscript | font size style | color highlight removeformat | bullets numbering | outdent indent | alignleft center alignright justify | undo redo | rule image link unlink | cut copy paste pastetext | print source"
editor_styles="Paragraph,<p>;Header 1,<h1>"
/>
editor_styles has to be writen like this : style_name1,tag1;style_name2,tag2;style_name3,tag3; ...etc
(each pair name,tag = semicolon separated)
Download link : tg_cleditor
Best regard
You should publish this to OpenERP Apps.
Ok Fabrice, but how to ???
Here: https://apps.openerp.com/admin/#view_type=form&model=loempia.repo&menu_id=148&action=137 (You have to be logged in at accounts.openerp.com)
@Fabrice Thanks. Do I have to create a bzr account first ? Is there some doc somewhere ?
You have to create a launchpad.net account an push your branch there as specified in the link. Launchpad;s doc is here: https://help.launchpad.net/
Thank you.
Thierry, great job man!