This question has been flagged
8 Replies
5568 Views

Hi all,

Sometimes ago I worked to pass parameters to cleditor to get this :

cleditor enhanced

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,&lt;p&gt;;Header 1,&lt;h1&gt;"
       />

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

Avatar
Discard

You should publish this to OpenERP Apps.

Author

Ok Fabrice, but how to ???

Author

@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/

Author

Thank you.

Thierry, great job man!

Best Answer

I just found it, searching for how to add tables into cleditor. So downloaded your plugin/addon, installed and ..... nothing happend. Why ?

It doesn't work with Odoo v8.0 ?

I can't see additional icons at all :(

Do I have to change anything in files ?

Avatar
Discard