Do not get Control.TextArea to work

12 views
Skip to first unread message

Stefan Meretz

unread,
Jan 16, 2012, 6:00:41 AM1/16/12
to livepipe...@googlegroups.com
Hi all,

help would be appreciated to get Control.TextArea to work. What I did was:

- include prototype, effects, dragdrop, slider, livepipe, textarea
(not sure if all of them are necessary)
- include the js tutorial script
- include the css tutorial script
- edit the html by copying the html tutorial snippet into the code

The editor does not appear (only the default textarea).

Firebug throws an error saying

(textarea.js line 21) $(this.element) is null:
$(this.element).observe('keyup',this.doOnChange.bindAsEventListener(this));

It seems, that initialization failed, but I don't know why.

Please note: I am not familiar with JavaScript.

Thanks in advance,
Stefan

--
Start here: www.meretz.de

Alex Indigo

unread,
Jan 16, 2012, 12:33:33 PM1/16/12
to livepipe...@googlegroups.com
Can you provide your code?

-- A.I. -- Sent from my iPhone

> --
> You received this message because you are subscribed to the Google Groups "LivePipe UI Users" group.
> To post to this group, send email to livepipe...@googlegroups.com.
> To unsubscribe from this group, send email to livepipe-ui-us...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/livepipe-ui-users?hl=en.
>

Stefan Meretz

unread,
Jan 16, 2012, 3:57:20 PM1/16/12
to livepipe...@googlegroups.com
Am 16.01.2012 18:33, schrieb Alex Indigo:
> Can you provide your code?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="de-DE">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test</title>
<link rel="stylesheet" href="editor.css" type="text/css" media="screen">
<script language="javascript" type="text/javascript"
src="prototype.js"></script>
<script language="javascript" type="text/javascript"
src="effects.js"></script>
<script language="javascript" type="text/javascript"
src="dragdrop.js"></script>
<script language="javascript" type="text/javascript"
src="slider.js"></script>
<script language="javascript" type="text/javascript"
src="livepipe.js"></script>
<script language="javascript" type="text/javascript"
src="textarea.js"></script>
<script language="javascript" type="text/javascript"
src="editor.js"></script>
</head>
<body>
<textarea id="markdown_example"></textarea>
<div id="markdown_formatted"></div>
</body></html>

As said, editor.css and editor.js were copied from the tutorial here:
http://livepipe.net/control/textarea

Nothing special. Error, see below.

Ideas?

Best,
Stefan

>> - include prototype, effects, dragdrop, slider, livepipe, textarea
>> (not sure if all of them are necessary)
>> - include the js tutorial script
>> - include the css tutorial script
>> - edit the html by copying the html tutorial snippet into the code
>>
>> The editor does not appear (only the default textarea).
>>
>> Firebug throws an error saying
>>
>> (textarea.js line 21) $(this.element) is null:
>> $(this.element).observe('keyup',this.doOnChange.bindAsEventListener(this));


--
Start here: www.meretz.de

Alex Indigo

unread,
Jan 16, 2012, 7:00:16 PM1/16/12
to livepipe...@googlegroups.com
You need to wrap your editor.js into dom.loaded handler

document.observe('dom:loaded',function(){

// editor.js content goes here

]);

And then only thing that missing would be button icons.

Stefan Meretz

unread,
Jan 17, 2012, 7:30:46 AM1/17/12
to livepipe...@googlegroups.com
Am 17.01.2012 01:00, schrieb Alex Indigo:
> You need to wrap your editor.js into dom.loaded handler
>
> document.observe('dom:loaded',function(){
>
> // editor.js content goes here
>
> ]);

Great, thank you! // Btw. typo: ]); is });

Maybe this should be added to the tutorial script or otherwise mentioned?

> And then only thing that missing would be button icons.

Sure, I got them.

What I additionally had to do, was to search for showdown.js, in order
to include this script to got the preview working. Just for the records.

Thanks again,

Alex Indigo

unread,
Jan 17, 2012, 1:51:57 PM1/17/12
to livepipe...@googlegroups.com
Hi Stefan,

document.observe('dom:loaded') – is the standard thing for Prototype based scripts,
usually people put all their custom js inside that function and forget about it. :)

But, good point it might benefit from better docs,
but honestly saying Prototype community is not in the best shape right now,
especially after Sam Stephenson mentioned that if there would be version two of Prototype,
it would be similar to jQuery.
(Which is huge disappointment from my side, since I'm big fan of the Prototype API approach).

So I'd suggest you to take a look into ender.no.de,
(or just one of microjs.com)
it might do all the work you need, with less filesize
and seems like more future proof.

Enjoy. :)

Stefan Meretz

unread,
Jan 18, 2012, 1:55:13 PM1/18/12
to livepipe...@googlegroups.com
Am 17.01.2012 19:51, schrieb Alex Indigo:
> document.observe('dom:loaded') � is the standard thing for Prototype based scripts,

> usually people put all their custom js inside that function and forget about it. :)

Good to know ;)

> But, good point it might benefit from better docs,
> but honestly saying Prototype community is not in the best shape right now,
> especially after Sam Stephenson mentioned that if there would be version two of Prototype,
> it would be similar to jQuery.
> (Which is huge disappointment from my side, since I'm big fan of the Prototype API approach).
>
> So I'd suggest you to take a look into ender.no.de,
> (or just one of microjs.com)
> it might do all the work you need, with less filesize
> and seems like more future proof.

I'll check it out, thanks a lot!

Reply all
Reply to author
Forward
0 new messages