Programmatically transforming textareas

305 views
Skip to first unread message

Ramon

unread,
May 4, 2011, 9:24:34 AM5/4/11
to ace-d...@googlegroups.com
Hey, I see that the new version of Ace allows replacement/transformation of textareas. Great - that's less work to change textareas in forms to ace editors. However, how do you do it programmatically?

I tried ace.transformTextarea(...) but I get a transformTextarea is not a function.

Brion Vibber

unread,
May 4, 2011, 2:16:04 PM5/4/11
to ace-d...@googlegroups.com
On Wed, May 4, 2011 at 6:24 AM, Ramon <ramon...@gmail.com> wrote:
Hey, I see that the new version of Ace allows replacement/transformation of textareas. Great - that's less work to change textareas in forms to ace editors. However, how do you do it programmatically?

I tried ace.transformTextarea(...) but I get a transformTextarea is not a function.

The textarea replacement function doesn't seem to be in the main build; you need to load from the build/textarea/src tree insted of build/src. I had some trouble with that interface as it seems to be deliberately fiddling with the namespacing to keep the Ace code out of the way of whatever's on the page (it's meant for use as a bookmarklet...?).

For my MediaWiki gadget embedding Ace for editing JS and CSS subpages, I ended up doing the textarea replacement myself: http://www.mediawiki.org/wiki/MediaWiki:Gadget-CodeEditor.js
 
-- brion vibber (brion @ pobox.com / brion @ wikimedia.org)

Ramon Tayag

unread,
May 4, 2011, 10:57:16 PM5/4/11
to ace-d...@googlegroups.com
I see. Thanks Brion!

Ramon Tayag

Fabian Jakobs

unread,
May 6, 2011, 4:42:58 AM5/6/11
to ace-d...@googlegroups.com
I would like to pull this functionality directly into Ace. Could you
open a github issue to remind me doing it?

Best, Fabian

On Thursday, May 5, 2011, Ramon Tayag <ra...@tayag.net> wrote:
> I see. Thanks Brion!Ramon Tayag

> --
> You received this message because you are subscribed to the Google Groups "Ajax.org Cloud9 Editor (Ace)" group.
> To post to this group, send email to ace-d...@googlegroups.com.
> To unsubscribe from this group, send email to ace-discuss...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/ace-discuss?hl=en.
>

Brion Vibber

unread,
May 6, 2011, 1:03:49 PM5/6/11
to ace-d...@googlegroups.com
On Fri, May 6, 2011 at 1:42 AM, Fabian Jakobs <fabian...@web.de> wrote:
I would like to pull this functionality directly into Ace. Could you
open a github issue to remind me doing it?

Julian Viereck

unread,
May 9, 2011, 11:18:42 AM5/9/11
to Ajax.org Cloud9 Editor (Ace)
See my answer in the issue: https://github.com/ajaxorg/ace/issues/239#issuecomment-1123327

On May 6, 7:03 pm, Brion Vibber <br...@pobox.com> wrote:
Reply all
Reply to author
Forward
0 new messages