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

Ticket #7907 (closed enhancement: fixed)

Opened 2 years ago

Last modified 2 years ago

[PATCH] Complete refactoring of the Insertion Object. Adds deprecated.js

Reported by: Tobie Assigned to: Tobie
Priority: normal Milestone: 1.x
Component: Prototype Version: edge
Severity: normal Keywords: 1.5.2 ready
Cc:

Description

Adds Element.prepend, Element.append, Element.addBefore, Element.addAfter and Element.wrap methods. Insertion now also accepts DOM nodes.

Attachments

insertions.diff (8.2 kB) - added by Tobie on 03/25/07 03:14:58.
insertions-includes-ticket-7903.diff (23.3 kB) - added by Tobie on 03/25/07 03:28:22.
this patch includes #7903
insertion-needs-7903-to-work.diff (8.2 kB) - added by Tobie on 03/25/07 03:32:27.
and this one needs 7903 to work.
insertion.diff (18.5 kB) - added by Tobie on 04/30/07 08:35:28.
True refactoring this time + backwards compatibility.

Change History

03/25/07 03:14:58 changed by Tobie

  • attachment insertions.diff added.

03/25/07 03:28:22 changed by Tobie

  • attachment insertions-includes-ticket-7903.diff added.

this patch includes #7903

03/25/07 03:32:27 changed by Tobie

  • attachment insertion-needs-7903-to-work.diff added.

and this one needs 7903 to work.

03/25/07 03:32:59 changed by Tobie

  • keywords changed from 1.5.2 ready to 1.5.2 1.5.1? ready.

03/27/07 18:42:36 changed by madrobby

  • keywords changed from 1.5.2 1.5.1? ready to 1.5.2 ready.

We should had for bugfixes only with 1.5.1, and put this on the menu for 1.5.2.

04/28/07 17:18:12 changed by Tobie

  • summary changed from [PATCH] Element.prepend, append, addBefore, addAfter and wrap methods. Insertions now accepts DOM nodes. to [PATCH] Complete refactoring of the Insertion Object. Adds deprecated.js.

This latest patch (insertion.diff) adds the following methods:

  • Element.prepend, Element.append, Element.addBefore, Element.addAfter,
  • Element.insert (which takes a position argument),
  • Deprecates the Insertion object in favor of Element.Insertion,
  • adds a deprecated.js file,
  • Makes Ajax.Updater handle both options.insertion:
    new Ajax.Updater(element, url, {insertion: Insertion.Top});
    // AND:
    new Ajax.Updater(element, url, {insertion: 'Top'});
    

04/28/07 17:18:19 changed by Tobie

  • owner changed from sam to Tobie.

04/28/07 20:47:19 changed by Tobie

Real refactoring this time, which leaves us only with:

Element.insert(content[, position = 'Bottom'])

The rest is as mentioned above.

04/30/07 08:35:28 changed by Tobie

  • attachment insertion.diff added.

True refactoring this time + backwards compatibility.

05/12/07 05:02:00 changed by sam

  • status changed from new to closed.
  • resolution set to fixed.

(In [6725]) Merge -r6634:HEAD from ../branches/dom.

* Make Element#update and Element#insert work for SELECT tags in IE and Opera. [Tobie Langel]

* Make Element#insert and Element#update better handle TABLE related elements in IE and Opera. Closes #7776, #8040, #7550, #7776, #7938. [Tobie Langel]

* Make Element#readAttribute('title') work in Opera. [Tobie Langel]

* Make Element#replace work with form elements in Firefox and Safari. Closes #8010, #7989. [dsl239, Tobie Langel]

* Add Element#wrap which wraps the element inside a new one. Closes #5732. [P. Vande, Tobie Langel]

* Make Element into a constructor: new Element(tagName, attributes). Add Element#writeAttribute which accepts a hash of attributes or a name/value pair. Closes #7476. [Mislav Marohni?\196?\135, haraldmartin, Tobie Langel]

* Insertion overhaul: Add Element.insert(content[, position = 'Bottom']). Deprecate Insertion (kept for backwards compatibility). Make Ajax.Updater option.insertion accept both Insertion.Top or the now preferred 'Top'. Closes #7907. [Tobie Langel]