Thanks for your input David.

Unfortunately,   I'd already found that web page and tryed that
extension to the Ajax.InPlaceEditor.  It fails miserably, returning
null whenever it encounters  HTML tags in the text.   !!!!

So, I did a lot of banging around before I posted to this group with
no success.

The odd thing is that after recieving your post,  I revisited the
problem and rewrote the extension one more ( perhaps the 35th )
time ...

Object.extend(Ajax.InPlaceEditor.prototype, {
    onLoadedExternalText: function(transport) {
        Element.removeClassName(this.form,
        this.options.loadingClassName);
        this.editField.disabled = false;
        this.editField.value = transport.responseText;
        Field.scrollFreeActivate(this.editField);
    }
});

Object.extend(Ajax.InPlaceEditor.prototype, {
    getText: function() {
     return this.element.innerHTML;}
});

and this version WORKED.

What's different?

I pulled the getText: function()   straight out of  controls.js,
pasted it in and  removed the call to unescapeHTML().

Try it.   You'll like it.   I do.

Thanks for your response.

BearState



On Feb 18, 7:33 am, david <david.brill...@gmail.com> wrote:
> HibearState,
>
> I did not see this post, look 
> athttp://wiki.github.com/madrobby/scriptaculous/ajax-inplaceeditor
>
> and you'll have I think what you need:
>
> <<
> Using HTML within the In Place Editor
>
> If you are using Markdown or Textile, you can include HTML within your
> text. And if you follow the instructions above, you will be able to
> load this text in from your database with loadTextURL. But the
> stripTags function is invoked by the In Place Editor, and that strips
> out all the code before it can be displayed in the editor field.
>
> To get around this, add the following two extensions anywhere after
> the rest of the library has loaded. I use the extensions.js method
> noted elsewhere on this site.
>
> Object.extend(Ajax.InPlaceEditor.prototype, {
>     onLoadedExternalText: function(transport) {
>         Element.removeClassName(this.form,
> this.options.loadingClassName);
>         this.editField.disabled = false;
>         this.editField.value = transport.responseText;
>         Field.scrollFreeActivate(this.editField);
>     }
>
> });
>
> Object.extend(Ajax.InPlaceEditor.prototype, {
>     getText: function() {
>         return this.element.childNodes[0] ? this.element.childNodes
> [0].nodeValue : '';
>     }
>
> });
>
> If you do this, make sure that your loadTextURL does not return entity-
> encoded text (using htmlentities() for example) or you will end up
> with double-encoded text.
>
>
>
> --
> david
>
> On 16 fév, 01:48,BearState<wixelb...@yahoo.com> wrote:
>
>
>
> > Hello and Howdy Do!
>
> > I'm working on something and  Prototype and Scriptaculous are new to
> > me.
>
> > I've been hashing at it and learning it on my own, but I've finally
> > relented and accept that maybe hearing from others who have already
> > been there and done that is OK.
>
> > ajaxOptions has    stripLoadedTextTags   which I set to false and
> > STILL, STILL can not get the editor to load text w/o stripping the
> > HTML tags.
>
> > It's start'n to T me off.
>
> > I've also run accross some sample that shows how to extend
> > Ajax.InPlaceEditor to supposedly do the trick, but that doesn't work
> > either.
>
> > Anybody out there know what I'm trying to do and how to do it?
> > Please share your invaluable insights.
>
> >BearState- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to