Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #7607 (new enhancement)

Opened 2 years ago

Last modified 1 year ago

[PATCH] Ajax.InPlaceEditor.getText. Patch for entity reference

Reported by: jiro@elelis.jp Assigned to: thomas@fesch.at
Priority: normal Milestone: 2.x
Component: script.aculo.us Version:
Severity: normal Keywords: InplaceEditor
Cc:

Description

Hello!! From Japan.

I hope patch like this:

638: getText: function() { -639: return this.element.innerHTML; +639: return new String(this.element.innerHTML).unescapeHTML(); 640: },

or

638: getText: function() { -639: return this.element.innerHTML; +639: if(this.element.childNodes){ +640: return this.element.childNodes[0].nodeValue; +641: }else{ +642: return ; +643: }

In the case of most, html contents is written using entity reference. Example: <span id="inplace">ABC&amp;XYZ</span> <script> new Ajax.InPlaceEditor('inplace',....

if there are no patch, "&amp;" is displayed in input-area. I expected "&" was displayed.

My English is clumsy. Sorry & Thank you for your time.

Change History

02/20/07 15:57:36 changed by jiro@elelis.jp

Hello!! From Japan.

I hope patch like this:

638: getText: function() {
-639: return this.element.innerHTML;
+639: return new String(this.element.innerHTML).unescapeHTML();
640: },

or

638: getText: function() {
-639: return this.element.innerHTML;
+639: if(this.element.childNodes){
+640: return this.element.childNodes[0].nodeValue;
+641: }else{
+642: return ;
+643: }


In the case of most, html contents is written using entity reference.
Example:
<span id="inplace">ABC&amp;XYZ</span>
<script>
new Ajax.InPlaceEditor('inplace',....


if there are no patch, "&amp;" is displayed in input-area.
I expected "&" was displayed.


My English is clumsy. Sorry & Thank you for your time.

03/12/07 23:52:25 changed by Glorat

This is a dupe of #4588 but I personally prefer this patch because it only modifies one line