Title: Eric CAUDAL
Hi Stefan,
a simple example in product form:
Original code is :
<page string="Descriptions">
<separator string="Description"/>
<field colspan="4" name="description"
nolabel="1"/>
<separator string="Sale
Description"/>
<field colspan="4"
name="description_sale" nolabel="1"/>
<separator string="Purchase
Description"/>
<field colspan="4"
name="description_purchase" nolabel="1"/>
</page>
New code would be :
<page string="Descriptions">
<html>
<a _onclick_="_javascript_:toggle_ckeditor();"
class="wysiwyg_button wysiwyg_button_off oe_button">WYSIWYG
on</a>
</html>
<separator string="Description"/>
<field colspan="4" name="description"
widget="text_WYSIWYG" nolabel="1"/>
<separator string="Sale
Description"/>
<field colspan="4"
name="description_sale" nolabel="1"/>
<separator string="Purchase
Description"/>
<field colspan="4"
name="description_purchase" nolabel="1"/>
</page>
Upgrade the module and Voilà!
About sanitizing: I agree that we did the minimum and it needs much
better protection against injections. That will be soon in our next
version :)
On 05/11/2012 04:50 PM, Stefan Rijnhart wrote:
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: [email protected]
tel: +31 (0) 614478606
http://therp.nl
https://twitter.com/therp_stefan
_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-community
More help : https://help.launchpad.net/ListHelp
|
_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-community
More help : https://help.launchpad.net/ListHelp