Rich text editing widget ?

42 views
Skip to first unread message

Damien Accorsi

unread,
Apr 17, 2012, 5:29:09 AM4/17/12
to turbo...@googlegroups.com
Hello,

I'd like to include a rich text editing widget in some forms. The
widgets I found are base on tw2 or it's tw.tinymce which is based on a
2007 Tiny MCE release! (this is the v2.0.9 while TinyMCE is now at 3.4.9)

Anybody having a more recent widget? Or a tutorial for parametering that
old widget (and this old release of TinyMCE)?

Damien

Alessandro Molina

unread,
Apr 17, 2012, 5:52:40 AM4/17/12
to turbo...@googlegroups.com
In tgapp-smallpress I used CKEditor, there isn't a TW widget available.
Making one should be really easy if you use the tw.tinymce code and
just replace the javascript.

https://bitbucket.org/_amol_/tgapp-smallpress/src/8eb270c613ee/smallpress/templates/edit.html

> --
> You received this message because you are subscribed to the Google Groups
> "TurboGears" group.
> To post to this group, send email to turbo...@googlegroups.com.
> To unsubscribe from this group, send email to
> turbogears+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/turbogears?hl=en.
>

Damien Accorsi

unread,
Apr 17, 2012, 8:54:43 AM4/17/12
to turbo...@googlegroups.com, Alessandro Molina
I'll try to reuse this. Thanks Alessandro.

Damien

NiL

unread,
Apr 17, 2012, 9:07:20 AM4/17/12
to turbo...@googlegroups.com
Hi

I used a simple InputField, and injected the tinyMCE js (latest release)

tinymce = JSLink(modname="my.project",
               filename='public/javascript/tiny_mce.js',
               )

tinymce.inject()

Damien Accorsi

unread,
Apr 17, 2012, 9:24:53 AM4/17/12
to turbo...@googlegroups.com
On 04/17/2012 03:07 PM, NiL wrote:
> Hi
>
> I used a simple InputField, and injected the tinyMCE js (latest release)
>
> tinymce = JSLink(modname="my.project",
> filename='public/javascript/tiny_mce.js',
> )
>
> tinymce.inject()
>

Does this work out of the box ?! Would it be so simple to build a rich
text widget ?!

NiL

unread,
Apr 17, 2012, 10:58:26 AM4/17/12
to turbo...@googlegroups.com
you would have to tinyMCE.init({..... your fields

follow tinymce doc, but mostly, yes that's it

Artur Gavkaliuk

unread,
Apr 18, 2012, 4:26:55 AM4/18/12
to turbo...@googlegroups.com
TinyMCE class accepts javascript named parameter.
So to use newest version do the following:

localTinyMCE = JSLink(
    init = js_function('tinyMCE.init'),
    link = '/javascript/tiny_mce/tiny_mce_src.js',
)
widget = TinyMCE(widget_id, mce_options = dict(
        ...
    ), javascript=[localTinyMCE])
 

Вівторок, 17 квітня 2012 р. 12:29:09 UTC+3 користувач lebouquetin написав:
Вівторок, 17 квітня 2012 р. 12:29:09 UTC+3 користувач lebouquetin написав:
Вівторок, 17 квітня 2012 р. 12:29:09 UTC+3 користувач lebouquetin написав:

Artur Gavkaliuk

unread,
Apr 18, 2012, 4:30:21 AM4/18/12
to turbo...@googlegroups.com
TinyMCE widget accepts javascript positional argument.
So put latest TinyMCE source into your public/javascript/tiny_mce directory and create widget in following way:

localTinyMCE = JSLink(
    init = js_function('tinyMCE.init'),
    link = '/javascript/tiny_mce/tiny_mce_src.js',
    )
widget = TinyMCE(widget_id, mce_options = dict(
        ...
    ), javascript=[localTinyMCE])

Вівторок, 17 квітня 2012 р. 12:29:09 UTC+3 користувач lebouquetin написав:
Hello,
Reply all
Reply to author
Forward
0 new messages