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

Ticket #9960 (new enhancement)

Opened 2 years ago

Last modified 1 year ago

Selection class

Reported by: noremember Assigned to: sam
Priority: low Milestone: 2.x
Component: Prototype Version: edge
Severity: minor Keywords:
Cc:

Description

Hello,

I would like to suggest a class : Selection. Selection is a class which provides easy way to control selected text over an input or a textarea. This class is cross browsers and is based on Prototype.

I have been using JSUnit for my unit tests (83 actually) and they all works fined on :
- Firefox 2.0.0.8
- Opera 9.24
- Internet Explorer 6
- Internet Explorer 7
- Safari 3.0.3

Known issue : selection{end|Start} works fine with textarea on Konqueror, but not with inputs where end == start sometimes.

Actually I don't know if it's possible to get round this bug.

Thanks for testing on other browsers and older versions.

Attachments

selection.class.js (7.1 kB) - added by noremember on 10/23/07 13:23:23.
The selection class.
index.html (27.7 kB) - added by noremember on 10/23/07 13:25:10.
Units tests.
array.extend.js (354 bytes) - added by noremember on 10/23/07 13:25:45.
Array class extension.
selection.patch (0.9 kB) - added by noremember on 10/23/07 14:44:56.
Patch selection.class.js.
index.patch (0.7 kB) - added by noremember on 10/23/07 14:45:13.
Patch index.html.

Change History

10/23/07 13:23:23 changed by noremember

  • attachment selection.class.js added.

The selection class.

10/23/07 13:25:10 changed by noremember

  • attachment index.html added.

Units tests.

10/23/07 13:25:45 changed by noremember

  • attachment array.extend.js added.

Array class extension.

10/23/07 14:44:56 changed by noremember

  • attachment selection.patch added.

Patch selection.class.js.

10/23/07 14:45:13 changed by noremember

  • attachment index.patch added.

Patch index.html.

02/27/08 04:25:36 changed by kangax

This would be a great standalone extension. You could then submit it to http://scripteka.com for everyone to use.