Salut tout le monde.
Vous aviez remarqué que le champ html faisait apparaitre un textarea avec 3 ou 4 boutons?
En fouinant un peu, j'ai vu qu'OpenERP utilisait cleditor mais qu'il ne mettaient que quelques boutons à notre disposition.
Je viens donc de faire un module qui vous permettra de passer des paramètres à cleditor dans votre vue XML pour faire apparaitre les options de cleditor :
Les paramètres :
- 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; "
Exemple dans une vue :
Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 <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>" />
Rappel : dans une vue XML il ne faut pas oublier de convertir les caractères spéciaux : <> en < >
C'est un module qui surcharge le cleditor d'OpenERP.
Téléchargement ici :tg_cleditor
Partager