Re: ops 3 and wysiwyg editors (TinyMCE)

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

Re: ops 3 and wysiwyg editors (TinyMCE)

ampatspell
Hello
I haven't had a time to look deeper into this all for OPS 3.0 branch, but
yesterday i got
"TinyMCE -> TagGlue -> html2markup xslt -> markup2html xslt -> processor
what generates (in ugly StringBuffer way) xhtml String without root node"
process working for 2.8

I'll write about it.

As for 3.0 i hope i will have a time to look deeper into this all.

best,
Arnis

> --- "ampatspell." <[hidden email]> wrote:
>> Does anyone tryed to integrate HTML editor into ops 3?
>> My problem is Ajax based form submission. the editor doesn't return data
>> edited in textarea as long the form isn't submitted in standard way.
>> Could someone point me to some info?
>
> Hi Arnis,
>
> We haven't started working on an HTML editor widget here, and would be
> happy to integrate your code if you can share it with us! The constraint
> you are talking about ("the editor doesn't return data edited in textarea
> as long the form isn't submitted in standard way") is specific to the HTML
> editor widget you are using? I.e. you can't access the data entered by the
> user through JavaScript?
>
> I am thinking out loud here, but one way integration could be done is:
> 1) Developer is adding appearance="xxforms:html" on his <xforms:textarea>
> to indicate he wants the control to be rendered as an HTML editor.
> 2) Stylesheet (xforms-to-ajax-xhtml.xsl) generates the HTML editor
> control, plus maybe a hidden textarea.
> 3) xforms.js needs to be modified to be aware of this new control. I am
> not sure what is the best way to do this; this will depend on how you can
> interact with the HTML editor widget in JavaScript. Ideally you can
> interact with the HTML editor widget as you would with a regular textarea.
> If this is the case, you can adapt the current code dealing with textareas
> to work as well with the HTML editor widget.
>
> Is this somewhat similar to what you are doing?
>
> Alex
>
> --
> Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/
>
>



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: ops 3 and wysiwyg editors (TinyMCE)

ampatspell
Hello agan,
here's description of my approach:

http://adm.celotajs.lv/prj/sic/trc/wiki/WYSIWYG

i don't say it's good/bad, it's what i managed to make.

best,
Arnis

p.s. as usual, i hope it'll be usefull for someone :)

> --- "ampatspell." <[hidden email]> wrote:
>> Does anyone tryed to integrate HTML editor into ops 3?
>> My problem is Ajax based form submission. the editor doesn't return data
>> edited in textarea as long the form isn't submitted in standard way.
>> Could someone point me to some info?
>
> Hi Arnis,
>
> We haven't started working on an HTML editor widget here, and would be
> happy to integrate your code if you can share it with us! The constraint
> you are talking about ("the editor doesn't return data edited in textarea
> as long the form isn't submitted in standard way") is specific to the HTML
> editor widget you are using? I.e. you can't access the data entered by the
> user through JavaScript?
>
> I am thinking out loud here, but one way integration could be done is:
> 1) Developer is adding appearance="xxforms:html" on his <xforms:textarea>
> to indicate he wants the control to be rendered as an HTML editor.
> 2) Stylesheet (xforms-to-ajax-xhtml.xsl) generates the HTML editor
> control, plus maybe a hidden textarea.
> 3) xforms.js needs to be modified to be aware of this new control. I am
> not sure what is the best way to do this; this will depend on how you can
> interact with the HTML editor widget in JavaScript. Ideally you can
> interact with the HTML editor widget as you would with a regular textarea.
> If this is the case, you can adapt the current code dealing with textareas
> to work as well with the HTML editor widget.
>
> Is this somewhat similar to what you are doing?
>
> Alex
>
> --
> Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/
>
>



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: ops 3 and wysiwyg editors (TinyMCE)

Alessandro  Vernet
Administrator
--- [hidden email] wrote:

> Hello agan,
> here's description of my approach:
>
> http://adm.celotajs.lv/prj/sic/trc/wiki/WYSIWYG

Neat!

I like the fact that TinyMCE can render a text area as an HTML editor
based on an attribute on the <textarea> element. Kudos to TinyMCE for
this! From what I see you have to call their initialization code with
mode: "specific_textarea" (reference: http://tinyurl.com/cwldk) and
specify which attribute should be checked by TinyMCE with
textarea_trigger: "gaga" (reference: http://tinyurl.com/azdg9). This will
render all the textarea with a gaga="true" attribute as HTML editors. I
have mixed feelings about this last part as it forces you to generate
invalid HTML as there are really no HTML attribute you could reuse for
this. But I guess it does the trick anyway.

At the end of your post, you mention that you would like to have the XHTML
entered by the user in the instance, instead of the escaped XHTML. This is
not possible directly as the value of a text area control can only be text
in XForms. However you could submit in XForms the instance to a service
that parses the content of that node and returns the XHTML as XML and
store that in another instance. For an example, see the
<xforms:submission> element in the new Flickr Spell example.

Here is the source code (view.xhtml):
http://www.orbeon.com/ops/goto-source/flickr-spell/view.xhtml

And here is the running example:
http://www.orbeon.com/ops/goto-example/flickr-spell

Alex

--
Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: ops 3 and wysiwyg editors (TinyMCE)

ampatspell
Hello!
about invalid html - yes, i agree - it's not right.
as you mentioned, mode: "exact" needs to be used and imo it's easy to.
I'm still in 2.8 but after some days i'll try to make working code for 3
using service.

best,
Arnis

> --- [hidden email] wrote:
>
>> Hello agan,
>> here's description of my approach:
>>
>> http://adm.celotajs.lv/prj/sic/trc/wiki/WYSIWYG
>
> Neat!
>
> I like the fact that TinyMCE can render a text area as an HTML editor
> based on an attribute on the <textarea> element. Kudos to TinyMCE for
> this! From what I see you have to call their initialization code with
> mode: "specific_textarea" (reference: http://tinyurl.com/cwldk) and
> specify which attribute should be checked by TinyMCE with
> textarea_trigger: "gaga" (reference: http://tinyurl.com/azdg9). This will
> render all the textarea with a gaga="true" attribute as HTML editors. I
> have mixed feelings about this last part as it forces you to generate
> invalid HTML as there are really no HTML attribute you could reuse for
> this. But I guess it does the trick anyway.
>
> At the end of your post, you mention that you would like to have the XHTML
> entered by the user in the instance, instead of the escaped XHTML. This is
> not possible directly as the value of a text area control can only be text
> in XForms. However you could submit in XForms the instance to a service
> that parses the content of that node and returns the XHTML as XML and
> store that in another instance. For an example, see the
> <xforms:submission> element in the new Flickr Spell example.
>
> Here is the source code (view.xhtml):
> http://www.orbeon.com/ops/goto-source/flickr-spell/view.xhtml
>
> And here is the running example:
> http://www.orbeon.com/ops/goto-example/flickr-spell
>
> Alex
>
> --
> Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/
>
>



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws