It looks like you're extending the wrong object.
Try this: (untested)
Object.extend(Ajax.InPlaceEditor.prototype, { // <-- here
onLoadedExternalText: function (transport) {
// ...
}
});
TAG
On Apr 17, 2007, at 12:14 PM, Walter Lee Davis wrote:
>
> I followed the advice on this page:
>
> <http://wiki.script.aculo.us/scriptaculous/show/
> HowtoExtendAndOverride>
>
> And created an extension.js file and added the following to it:
>
> Object.extend(Ajax, {
> getText: function() {
> return this.element.childNodes[0] ?
> this.element.childNodes[0].nodeValue : '';
> }
> });
>
>
> This works perfectly, I now get my entity-escaped characters like
> &
> showing correctly in the editor.
>
> But when I tried to do this:
>
> Object.extend(Ajax, {
> onLoadedExternalText: function(transport) {
> Element.removeClassName(this.form,
> this.options.loadingClassName);
> this.editField.disabled = false;
> this.editField.value = transport.responseText;
> Field.scrollFreeActivate(this.editField);
> }
> });
>
> The base function was not overridden. (I am trying to remove the
> stripTags() call from the end of responseText.)
>
> The only thing that worked was to comment out line 655 of controls.js,
> like so:
>
> //this.editField.value = transport.responseText.stripTags();
> this.editField.value = transport.responseText;
>
> Can anyone spot what I'm doing wrong here that I'm not able to
> override
> this function from an extensions.js file?
>
> Thanks,
>
> Walter
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---