Opened 16 years ago

Closed 15 years ago

#13 closed enhancement (wontfix)

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

Description (last modified by gogo)

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 (9)

comment:1 Changed 16 years ago by anonymous

fghfgh sdgsdgsdg sdg sdgsdg



comment:2 Changed 16 years ago by gogo

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

Not sure I understand.

comment:3 Changed 16 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.

comment:4 Changed 16 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.

comment:5 Changed 16 years ago by gogo

  • Description modified (diff)
  • Milestone Version 1.0 deleted
  • Severity changed from normal to enhancement

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.

comment:6 Changed 16 years ago by niko

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

comment:7 Changed 16 years ago by niko

  • Milestone set to Version 1.0
  • Owner changed from garrettb to niko

comment:8 Changed 16 years ago by niko

  • Status changed from new to assigned

comment:9 Changed 15 years ago by gogo

  • Resolution set to wontfix
  • Status changed from assigned to closed

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.