Ticket #13 (closed enhancement: wontfix)

Opened 7 years ago

Last modified 7 years ago

Loading Context CSS rules into an inline editor

Reported by: garrettb Owned by: niko
Priority: normal Milestone: Version 1.0
Component: Xinha Core Version:
Severity: normal Keywords: CSS, inline
Cc:

Description (last modified by gogo) (diff)

When using editor to edit portions of a page inline, editor does not contain the main document styles. Therefore, you get black text on black bg, etc.

I have created a JS only version that will load the cascaded styles into the main document of the iframe, but does not work on child formatting like li, etc.

I will try to tackle this one, but I am not sure when it can be done by.

Change History

Changed 7 years ago by anonymous

fghfgh sdgsdgsdg sdg sdgsdg


sdgsdgsdg

[]

Changed 7 years ago by gogo

Can't you just use editor.config.pageStyle or editor.config.pageStyleSheets ?

Not sure I understand.

Changed 7 years ago by Niko <ns@…>

imho this ticket should be marked as resolved. as gogo said, editor.config.pageStyle is the solution of the problem.

Changed 7 years ago by blaine@…

If your editor is inside of a div with id "theeditor" and your parent document has rules

div.theditor li { css rules; }

Simply loading the rules as per your suggestion will not work since the styles are applied to the body of the iframe and thus does not have the parent div with id of "theditor". The only way to really do this is to parse the node structure of the parent document and any associated styles to populate a string of CSS to load into the iframe with a dynamic style tag.

I'll probably handle this one since I am guessing I am one of the few who need it. This summer perhaps.

Changed 7 years ago by gogo

  • severity changed from normal to enhancement
  • description modified (diff)
  • milestone deleted

Hmm, I see, perhaps this could be solved if we add a config variable which allows for adding class(es) to the <body> of the iframe, so you could add "theeditor" class to the iframe's body, and instead of div.theeditor just have .theeditor.

Changed 7 years ago by niko

such a config-variable would be a nice idea and not too hard to implement.

Changed 7 years ago by niko

  • owner changed from garrettb to niko
  • milestone set to Version 1.0

Changed 7 years ago by niko

  • status changed from new to assigned

Changed 7 years ago by gogo

  • status changed from assigned to closed
  • resolution set to wontfix

Thinking on this some more. I don't think it's necessary, the submitter gives the case of having

div.theeditor li ( .... }

and that not working in the editor when supplied via pagestyle. Well why not just supply

li { .... }

to pagestyle. Seems it would do just what is required.

Adding classes to the body (or ID, or whatever) would cause problems in "fullPage" mode I think.

Note: See TracTickets for help on using tickets.