Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#10310 closed enhancement (fixed)

RTE: Normalize Indent and Outdent operations in Editor

Reported by: Jared Jurkiewicz Owned by: Jared Jurkiewicz
Priority: high Milestone: 1.4
Component: Editor Version: 1.4.0b
Keywords: Cc: bill, liucougar, Douglas Hays, Adam Peller
Blocked By: Blocking:

Description

The indent and outdent code of the browser do not work very well. They're inconsistent about using blockquote versus div with padding ... and all browsers (IE, FF, WebKit?), indent/outdent lists wrong, they generate malformed lists.

So, like the EnterKeyHandling? plugin, it would be nice to have a way to handle indent/outdent consistently across browsers following a style indent pattern (much like other RTE do).

I have a prototype implementation that does this (and seems to work really well). It even fixes malformed lists from previous indent/outdent ops on a doc. It does not convert blockquote indent/outdent, though (not sure how to do that safely yet. Maybe as a prefilter operation to convert all blockquote tags to an indentable div).

Attachments (1)

indentOutdent.zip (8.9 KB) - added by Jared Jurkiewicz 10 years ago.
Prototype of indent/outdent handler.

Download all attachments as: .zip

Change History (7)

Changed 10 years ago by Jared Jurkiewicz

Attachment: indentOutdent.zip added

Prototype of indent/outdent handler.

comment:1 Changed 10 years ago by Jared Jurkiewicz

The prototype does the following:

1.) Uses customUndo on all browsers, as it has to manipulate the DOM directly.
2.) Fixes malformed lists (if they were created/indented wrong in the first place).

3.) Handles cross-selection indenting (indents elements that are indentable, will wrap inline elements within an indentable div as necessary.

Tests indicate that it seems to work really well. Feedback would be appreciated.

comment:2 Changed 10 years ago by Jared Jurkiewicz

Milestone: tbd1.5

comment:3 Changed 10 years ago by Jared Jurkiewicz

Milestone: 1.51.4

comment:4 Changed 10 years ago by Jared Jurkiewicz

Resolution: fixed
Status: newclosed

(In [20772]) Adding in experimental NormalizeIndentOutdent? for 1.4. Since experimental, is okay to add at this stage. \!strict fixes #10310

comment:5 Changed 10 years ago by Jared Jurkiewicz

(In [20785]) Improving indent/outdent a bit to better handle multi-line select. refs #10310

comment:6 Changed 10 years ago by Jared Jurkiewicz

(In [20786]) Dumb comment typo. refs #10310

Note: See TracTickets for help on using tickets.