[Openerp-community] WYSIWYG in OpenERP

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

[Openerp-community] WYSIWYG in OpenERP

Eric Caudal - www.elico-corp.com
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.

It is based on 2 modules
- web_display: This module provides a  new widget to display HTML tags.
You need to add in your view's field widget="text_WYSIWYG" to see the result as HTML instead of text.

- web_html_wysiwyg: This module provides a WYSIWYG editor (based on CKeditor).
You need to add the following code in the views for which you want to turn the classic textareas into powerful WYSIWYG editors.
<html>
    <a onclick=<a class="moz-txt-link-rfc2396E" href="javascript:toggle_ckeditor();">"javascript:toggle_ckeditor();" class="wysiwyg_button wysiwyg_button_off oe_button">WYSIWYG on</a>
</html>

Using both modules in combination in your views allows you to enable or disable the WYSIWYG editors anytime.

You can grab the code at our launchpad address: https://code.launchpad.net/~openerp-community/openobject-addons/elico-6.0
and hopefully soon at http://apps.openerp.com

Enjoy

--
Eric CAUDAL
openerp
Eric CAUDAL, Elico Corp, Shanghai.
[hidden email]
Cell: + 86 186 2136 1670. Skype: elico.corp
Premium Certified Training Partner - OpenERP Ready Partner.

Premium CTP
http://www.openerp.net.cn

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] WYSIWYG in OpenERP

Stefan Rijnhart (Therp)
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: [hidden email]
tel: +31 (0) 614478606
http://therp.nl
https://twitter.com/therp_stefan

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] WYSIWYG in OpenERP

Eric Caudal - www.elico-corp.com
Hi Stefan,
Thanks for reporting: last minute naming change ... I corrected it
This is a project in Launchpad where people can post bug indeed :)

We will publish an example and a video soon

Best regards
Eric CAUDAL
openerp
Eric CAUDAL, Elico Corp, Shanghai.
[hidden email]
Cell: + 86 186 2136 1670. Skype: elico.corp
Premium Certified Training Partner - OpenERP Ready Partner.

Premium CTP
http://www.openerp.net.cn

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: [hidden email]
tel: +31 (0) 614478606
http://therp.nl
https://twitter.com/therp_stefan


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] WYSIWYG in OpenERP

Stefan Rijnhart (Therp)
On 05/11/2012 12:02 PM, Eric Caudal wrote:
Hi Stefan,
Thanks for reporting: last minute naming change ... I corrected it

Hi Eric,

thanks!

This is a project in Launchpad where people can post bug indeed :)

Yes indeed, but you know what I mean ;-) Don't want to spam the community list too often...

Stefan.

-- 
Therp - Maatwerk in open ontwikkeling

Stefan Rijnhart - Ontwerp en implementatie

mail: [hidden email]
tel: +31 (0) 614478606
http://therp.nl
https://twitter.com/therp_stefan

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] WYSIWYG in OpenERP

Eric Caudal - www.elico-corp.com
In reply to this post by Eric Caudal - www.elico-corp.com
A second one would be for the email system in html mode
Eric CAUDAL
openerp
Eric CAUDAL, Elico Corp, Shanghai.
[hidden email]
Cell: + 86 186 2136 1670. Skype: elico.corp
Premium Certified Training Partner - OpenERP Ready Partner.

Premium CTP
http://www.openerp.net.cn

On 05/11/2012 03:06 PM, Ferdinand Gassauer wrote:
On 05/11/2012 03:05 AM, Eric Caudal wrote:
You dreamt about it and we did it!
great news
just an idea
the very first and general needed module would be to integrate this into wiki


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] WYSIWYG in OpenERP

Eric Caudal - www.elico-corp.com
In reply to this post by Eric Caudal - www.elico-corp.com
Hi Jean Sébastien:
It would be interesting to know how you have it in 6.1.
Best regards
Eric CAUDAL
openerp
Eric CAUDAL, Elico Corp, Shanghai.
[hidden email]
Cell: + 86 186 2136 1670. Skype: elico.corp
Premium Certified Training Partner - OpenERP Ready Partner.

Premium CTP
http://www.openerp.net.cn

On 05/11/2012 03:44 PM, Jean Sébastien HEDERER wrote:
Humm, this works since OpenERP 5.0. There was ever a type of tag for this

 


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] WYSIWYG in OpenERP

Eric Caudal - www.elico-corp.com
In reply to this post by Stefan Rijnhart (Therp)
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=<a class="moz-txt-link-rfc2396E" href="javascript:toggle_ckeditor();">"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 :)


Eric CAUDAL
openerp
Eric CAUDAL, Elico Corp, Shanghai.
[hidden email]
Cell: + 86 186 2136 1670. Skype: elico.corp
Premium Certified Training Partner - OpenERP Ready Partner.

Premium CTP
http://www.openerp.net.cn

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: [hidden email]
tel: +31 (0) 614478606
http://therp.nl
https://twitter.com/therp_stefan


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] WYSIWYG in OpenERP

Gustavo Adrian Marino
Hi Eric:
Great contribution! Thanks
Let me add a fix: As shipped the .js are not loaded in v6.1 because I guess your are using an old flag "web_preload". It works only if you force load with --load=web,web_display_html,web_wysiwyg
and an improvement: On web_wysiwyg, apply full editing only to text with the widget=text_WYSIWYG
Attached the patch

Best regards

2012/5/11 Eric Caudal <[hidden email]>
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 :)




openerp
Eric CAUDAL, Elico Corp, Shanghai.
[hidden email]
Cell: + 86 186 2136 1670. Skype: elico.corp
Premium Certified Training Partner - OpenERP Ready Partner.

Premium CTP
http://www.openerp.net.cn

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: [hidden email]
tel: +31 (0) 614478606
http://therp.nl
https://twitter.com/therp_stefan


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp




--

Gustavo Adrian Marino

Mobile: +54 911 5498 2515

Email: [hidden email]

Skype: gustavo.adrian.marino

 

 



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp

elico.diff (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] WYSIWYG in OpenERP

vivek poddar

Hi,

Eric I am really thrilled by your effort but I will need a small favour, First is this module work on V6.1 and second I have never installed the web module so pls tell me in short how to install it.

Thank you in advance!


On Sun, May 13, 2012 at 10:05 PM, Gustavo Adrian Marino <[hidden email]> wrote:
Hi Eric:
Great contribution! Thanks
Let me add a fix: As shipped the .js are not loaded in v6.1 because I guess your are using an old flag "web_preload". It works only if you force load with --load=web,web_display_html,web_wysiwyg
and an improvement: On web_wysiwyg, apply full editing only to text with the widget=text_WYSIWYG
Attached the patch

Best regards


2012/5/11 Eric Caudal <[hidden email]>
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 :)




openerp
Eric CAUDAL, Elico Corp, Shanghai.
[hidden email]
Cell: + 86 186 2136 1670. Skype: elico.corp
Premium Certified Training Partner - OpenERP Ready Partner.

Premium CTP
http://www.openerp.net.cn

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: [hidden email]
tel: +31 (0) 614478606
http://therp.nl
https://twitter.com/therp_stefan


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp




--

Gustavo Adrian Marino

Mobile: +54 911 5498 2515

Email: [hidden email]

Skype: gustavo.adrian.marino

 

 



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp




--

         -*- Vivek Poddar -*-             
                                                   
 Technical consultant (OpenERP)  
                                                   
Blog:http://vivekimsit.blogspot.in/  



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] WYSIWYG in OpenERP

Yannick Gouin
In reply to this post by Gustavo Adrian Marino
Hi everybody and thanks for your comments and improvements.

So now, as Gustavo suggested it, we apply full editing only to the fields with the widget="text_WYSIWYG". If you have installed the addon web_display_html, those fields will have the WYSWIG editor  on "edit" mode, and will display HTML code on "read only" mode.

We also approved the HTML sanitization, by removing the dangerous tags and dom events (before displaying, not before saving into the database). So no script, iframe, applet, embed, onclick, onload, etc.... when you display the HTML.
If you want more "freedom" (like allowing the embed, to be able to add videos to your wiki pages) you can edit the web_display_html.js file (web_display_html/static/src/js/).

In attachments, the modified versions.


Best regards,
GOUIN Yannick


openerp
Yannick GOUIN, Elico Corp, Shanghai.
[hidden email]
Cell: + 86 135 2077 1954. Skype: yannick.gouin
Premium Certified Training Partner - OpenERP Ready Partner.

Premium CTP
http://www.openerp.net.cn


-------- Original Message --------
Subject: Re: [Openerp-community] WYSIWYG in OpenERP
Date: Sun, 13 May 2012 13:35:42 -0300
From: Gustavo Adrian Marino [hidden email]
To: Eric Caudal [hidden email]
CC: [hidden email]


Hi Eric:
Great contribution! Thanks
Let me add a fix: As shipped the .js are not loaded in v6.1 because I guess your are using an old flag "web_preload". It works only if you force load with --load=web,web_display_html,web_wysiwyg
and an improvement: On web_wysiwyg, apply full editing only to text with the widget=text_WYSIWYG
Attached the patch

Best regards

2012/5/11 Eric Caudal <[hidden email]>
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 :)




openerp
Eric CAUDAL, Elico Corp, Shanghai.
[hidden email]
Cell: + 86 186 2136 1670. Skype: elico.corp
Premium Certified Training Partner - OpenERP Ready Partner.

Premium
                          CTP
http://www.openerp.net.cn

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: [hidden email]
tel: +31 (0) 614478606
http://therp.nl
https://twitter.com/therp_stefan


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp




--

Gustavo Adrian Marino

Mobile: +54 911 5498 2515

Email: [hidden email]

Skype: gustavo.adrian.marino


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp

web_display_html.tar.gz (79K) Download Attachment
web_wysiwyg.tar.gz (1M) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] WYSIWYG in OpenERP

Jean Sébastien HEDERER
In reply to this post by Eric Caudal - www.elico-corp.com
Hi,

You're right, "text_html" tag is not complete in 6.1.  In my mind, you
should reuse this tag instead of text_WYSIWYG



 

--

Cordialement
Jean-Sébastien Hederer
Conseil, intégration, hébergement de systèmes informatiques spécialisé en
solutions logiciel libre de gestion d'entreprise
Spécialiste OpenERP, OpenDAS et Magento
Agence Pays de Loire
9, rue Alfred Kastler
CS50743
44307 Nantes Cedex 3
Mob.: 06 69 56 21 49
Tél.: 09 80 08 25 41
Fax.: 09 80 08 25 49
Support commercial ASPerience: 09 80 08 25 47
Support technique ASPerience: 09 80 08 25 48
*********************************************************************
Ce courriel et les documents qui sont attachés peuvent contenir des
informations confidentielles. Si vous n'êtes pas le destinataire escompté,
merci d'en informer l'expéditeur immédiatement et de détruire ce courriel
ainsi que tous les documents attachés de votre système informatique. Toute
divulgation, distribution ou copie du présent courriel et des documents
attachés sans autorisation préalable de son émetteur est interdite.
This e-mail and any attached documents may contain confidential or
proprietary information. If you are not the intended recipient, please
advise the sender immediately and delete this e-mai land all attached
documents from your computer system. Any unauthorised disclosure,
distribution or copying hereof is prohibited."
**********************************************************************
<hr>

----------------Message d'origine-----------------
De: "Eric Caudal" <[hidden email]>
Copie à: "Jean Sébastien HEDERER" <[hidden email]>,
"openerp-community" <[hidden email]>
Date: Sat, 12 May 2012 09:21:15 +0800
-------------------------------------------------
 
 
>



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] WYSIWYG in OpenERP

Robin Bahadur
In reply to this post by vivek poddar
Hi Vivek,

To load web server side module you can specify them at the time of server starting like this
$ ./openerp-server.py --load=web,web_display_html,web_wysiwyg

Best Regards
Robin Bahadur
Technical Consultant (OpenERP)


On Mon, May 14, 2012 at 12:30 AM, vivek poddar <[hidden email]> wrote:

Hi,

Eric I am really thrilled by your effort but I will need a small favour, First is this module work on V6.1 and second I have never installed the web module so pls tell me in short how to install it.

Thank you in advance!



On Sun, May 13, 2012 at 10:05 PM, Gustavo Adrian Marino <[hidden email]> wrote:
Hi Eric:
Great contribution! Thanks
Let me add a fix: As shipped the .js are not loaded in v6.1 because I guess your are using an old flag "web_preload". It works only if you force load with --load=web,web_display_html,web_wysiwyg
and an improvement: On web_wysiwyg, apply full editing only to text with the widget=text_WYSIWYG
Attached the patch

Best regards


2012/5/11 Eric Caudal <[hidden email]>
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 :)




openerp
Eric CAUDAL, Elico Corp, Shanghai.
[hidden email]
Cell: + 86 186 2136 1670. Skype: elico.corp
Premium Certified Training Partner - OpenERP Ready Partner.

Premium CTP
http://www.openerp.net.cn

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: [hidden email]
tel: +31 (0) 614478606
http://therp.nl
https://twitter.com/therp_stefan


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp




--

Gustavo Adrian Marino

Mobile: +54 911 5498 2515

Email: [hidden email]

Skype: gustavo.adrian.marino

 

 



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp




--

         -*- Vivek Poddar -*-             
                                                   
 Technical consultant (OpenERP)  
                                                   
Blog:http://vivekimsit.blogspot.in/  



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp