Opened 10 years ago

Closed 10 years ago

#10507 closed enhancement (fixed)

Add header/footer dom nodes to RichText Editor

Reported by: Jared Jurkiewicz Owned by: Jared Jurkiewicz
Priority: high Milestone: 1.5
Component: Editor Version: 1.4.0
Keywords: Cc: bill
Blocked By: Blocking:

Description (last modified by Jared Jurkiewicz)

Add header/footer dom nodes to RichText? Editor.

As it currently stands, the editor is formed from the following HTML when created:

<div>
  <div dojoType="dijit.Toolbar"></div>
  <div>
    <iframe>
  </div>
</div>

This is fairly limiting when it comes to plugins augmenting the toolbar. For example, consider the FullScreen? toolbar. For it to work right, it has to compute the size of the toolbar, then the iframe container, etc. Well, what if you wanted additional toolbars, such as a find and replace toolbar? What if you wanted a footer (Such as the Breadcrumb plugin). It gets extremely diofficult for plugins like FullScreen? to work well. I'm proposing we alter its dom construction a bit so it's like this:

<div>
  <div dojoAttachPoint="header">
    <div dojoType="dijit.Toolbar"></div>
  </div>
  <div>
    <iframe>
  </div>
  <div dojoAttachPoint="footer">
  </div>
</div>

That way, we have a defined, beginning section, middle content, and trailing section. This gives generic sections to append toolbars and the like to that can also be generically size-computed, making implementing FullScreen? in a generic manner simpler (in terms of calculating header/footer usage), and so on.

I also propose we add utility functions to RichText?.js to make getting their heights easier. I have a prototype implementation of this that doesn't break any exisiting UT, and simplifies how FS and ViewSource? work, particularly when other plugins such as Breadcrumb and FindReplace? come into play.

The other nice thing is the code change is minimal to RichText?.

Attachments (3)

editorStructure.patch (5.5 KB) - added by Jared Jurkiewicz 10 years ago.
Patch to restructure the DOM layout of editor a little.
editorStructure.2.patch (6.2 KB) - added by Jared Jurkiewicz 10 years ago.
Updated patch with tweak to AlwaysShowToolbar?
layout.patch (7.0 KB) - added by Jared Jurkiewicz 10 years ago.
Updated patch with tweaks to make layout containers work right.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 10 years ago by Jared Jurkiewicz

Description: modified (diff)

Changed 10 years ago by Jared Jurkiewicz

Attachment: editorStructure.patch added

Patch to restructure the DOM layout of editor a little.

Changed 10 years ago by Jared Jurkiewicz

Attachment: editorStructure.2.patch added

Updated patch with tweak to AlwaysShowToolbar?

Changed 10 years ago by Jared Jurkiewicz

Attachment: layout.patch added

Updated patch with tweaks to make layout containers work right.

comment:2 Changed 10 years ago by Jared Jurkiewicz

Resolution: fixed
Status: newclosed

(In [21046]) Adding header/footer containers + improvements to layout. fixes #10507 \!strict

Note: See TracTickets for help on using tickets.