Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#9837 closed enhancement (fixed)

Provide ShowBlockNodes plugin for dijit.Editor

Reported by: Jared Jurkiewicz Owned by: Jared Jurkiewicz
Priority: high Milestone: 1.4
Component: Editor Version: 1.3.2
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by liucougar)

Provide ShowBlockNodes? plugin for dijit.Editor

This is a ticket for a small enhancement to editor that is useful when editing a document online, the ShowBlockNodes?. The plugin uses CSS updates in the editor to show you the basic structure (layout), being used in the underlying html rendering the rich text. This can be extremely helpful if something isn't laying out right to see why.

Of course, it's only generally helpful to those who know HTML too. Still, it's a ncie to have plugin at times and helps our editor feature set.

Not much code and easy to add.

Working on testcase now.

Change History (9)

comment:1 Changed 10 years ago by Jared Jurkiewicz

Description: modified (diff)
Type: defectenhancement

comment:2 Changed 10 years ago by Jared Jurkiewicz

Resolution: fixed
Status: newclosed

(In [20025]) Adding in the show block nodes plugin. fixes #9837

comment:3 Changed 10 years ago by liucougar

Description: modified (diff)

the links to test files are wrong

comment:4 Changed 10 years ago by liucougar

thanks for the plugin.

I have some small suggestions:

  • in _initButton: dojo.hitch is not needed in this.connect(this.button, "onChange", dojo.hitch(this, this._showBlocks));
  • in bottom of _initButton: no need to create an anonymouse function to wrap this.toggle()
  • the first line in _showBlocks: "this.editor.iframe.contentWindow.document;" can be changed to "this.editor.document"

I believe the reason for the need of _calcBaseUrl is that, in webkit, it does not assign a <base> tag to the iframe for the editor (due to the fact that we are setting the iframe src to "javascript:..."). I think maybe it's a good idea to explicitly set a <base> to the content html in the iframe.

it may actually be easier to use a css file (instead of dynamically inserting the css rules to the iframe).

comment:5 Changed 10 years ago by Jared Jurkiewicz

(In [20047]) Minor tweak to the ShowBlockNodes? enhancement, need to compute baseUrl better for absolute paths in the module url. refs #9837

comment:6 Changed 10 years ago by Jared Jurkiewicz

(In [20048]) Minor tweaks from Liu Cougar comments. Slight code reductions on connects, updated readme. refs #9837

comment:7 Changed 10 years ago by Jared Jurkiewicz

(In [20049]) Minor tweaks from Liu Cougar comments. Slight code reductions on connects, updated readme. refs #9837

comment:8 Changed 10 years ago by Jared Jurkiewicz

(In [20060]) Tweak to button instantiation. refs #9837

comment:9 Changed 10 years ago by Jared Jurkiewicz

(In [20096]) Update dynamic style gen so that it only displays, doesn't try to print. refs #9837

Note: See TracTickets for help on using tickets.