openerp-community team mailing list archive
-
openerp-community team
-
Mailing list archive
-
Message #01032
Re: WYSIWYG in OpenERP
On 05/11/2012 03:05 AM, Eric Caudal wrote:
You dreamt about it and we did it!
We have developed 2 new modules for OpenERP 6.1 that allows you to
include WYSIWYG capabilities in all your forms.
Hi Eric,
thank you for this great effort. You are right, I did dream about it and
I tried out your modules immediately.
It seems that the javascript functions that allow the functionality
described are misnamed. According to the OpenERP web addons
functionality as I understand it, the functions need to be equal to the
module names. I got the display module working with the folowing patch:
=== modified file 'web_display_html/static/src/js/web_displayHTML.js'
--- web_display_html/static/src/js/web_displayHTML.js 2012-05-10
08:38:07 +0000
+++ web_display_html/static/src/js/web_displayHTML.js 2012-05-11
08:20:54 +0000
@@ -2,7 +2,7 @@
* OpenERP web_displayHTML
*---------------------------------------------------------*/
-openerp.web_displayHTML = function (openerp) {
+openerp.web_display_html = function (openerp) {
openerp.web.form.widgets.add('text_WYSIWYG',
'openerp.web.form.FieldText');
openerp.web.page.readonly.add('text_WYSIWYG',
'openerp.web_displayHTML.FieldWYSIWYGReadonly');
How to get the editor working I have not yet been able to figure out.
Can you explain more clearly how I should be able to add the HTML code
that you mentioned to the view?
With regards to the display module, I am a bit concerned about HTML
sanitizing. Stripping the script tags may not be enough. As this is
hardly a problem specific to your modules, more elaborate sanitation
routines in Javascript can be found that you may be able to copy in to
your module.
The community list does not actually seem the right place for bug
filing, so maybe you can open a dedicated Launchpad project for your
modules?
Thanks again for sharing the modules!
Cheers,
Stefan.
--
Therp - Maatwerk in open ontwikkeling
Stefan Rijnhart - Ontwerp en implementatie
mail: stefan@xxxxxxxx
tel: +31 (0) 614478606
http://therp.nl
https://twitter.com/therp_stefan
Follow ups
References