using CSS for default Magritte-Editors

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

using CSS for default Magritte-Editors

Stefan Krecher
Hi,
i have a main-component where i overwrite updateRoot to inject some css.
On the main-page, i render a list of domain-objects, every domain-object gets an "edit"-link. By pressing edit, i construct a component (-> descriptions asComponentOn: aMitarbeiter).
The component will be rendered via self call: component. To inject css in the resulting editor, i add a custom MAFormDecoration (with an overwritten updateRoot:).
Now i have the editor for that domain-object. The domain-object has a one-to-many-relationship to another domain-object, it is modelled like this:

descriptionHistorieArbeitsbereiche
^MAToManyRelationDescription new
classes: (Array with: HistorieArbeitsbereiche);
accessor: (MAPluggableAccessor read:[ :mitarbeiter | mitarbeiter historieArbeitsbereiche ] write: [:mitarbeiter :historieArbeitsbereiche | mitarbeiter historieArbeitsbereiche: historieArbeitsbereiche]);
  label: 'Arbeitsbereiche';
default: #();
priority: 500;
beSorted;
cssClass: #historieArbeitsbereiche;
reference: (HistorieArbeitsbereiche descriptionArbeitsbereich);
      yourself

The problem is, that i have no idea, how to inject css in the resulting editor (when i click on "edit" or "add").

Is there a way to inject an link to a css into the header of _every_ page that is rendered? If i use call: to render a component, the calling component gets replaced (including the <header> section). If a magritte-editor is redered via a OneToMany-Relationsip i don't seem to have access to the header-section of the resulting html (i only could use a custom renderer - here i could try to load css from the <body>-section of the page - but that seems do be no clean way.

thx and regards,
Stefan

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: using CSS for default Magritte-Editors

Gastón Dall' Oglio
Hello Stefan.

Hello.First of all I will clarify that I am no expert in html or css, much less in Seaside, but I mention something that you could try.
* In HTML5 it's totally OK to put a <link> or <style> in <body>.
* In fact, you can even have scoped <style>s that apply only to a part of your document!
* But in terms of rendering, it may be slower because the browser re-renders the page.


Then, you can experiment load your css (and your js) in the body. As far as I understand, in Seaside 3.0.7, WAHtmlCanvas has no support for this, so I use a raw:

 html html: '<link href="', (SomeLibrary / #someCss) greaseString, '" type="text/css" rel="stylesheet" />' 

Regards.

2013/3/14 Stefan Krecher <[hidden email]>
Hi,
i have a main-component where i overwrite updateRoot to inject some css.
On the main-page, i render a list of domain-objects, every domain-object gets an "edit"-link. By pressing edit, i construct a component (-> descriptions asComponentOn: aMitarbeiter).
The component will be rendered via self call: component. To inject css in the resulting editor, i add a custom MAFormDecoration (with an overwritten updateRoot:).
Now i have the editor for that domain-object. The domain-object has a one-to-many-relationship to another domain-object, it is modelled like this:

descriptionHistorieArbeitsbereiche
^MAToManyRelationDescription new
classes: (Array with: HistorieArbeitsbereiche);
accessor: (MAPluggableAccessor read:[ :mitarbeiter | mitarbeiter historieArbeitsbereiche ] write: [:mitarbeiter :historieArbeitsbereiche | mitarbeiter historieArbeitsbereiche: historieArbeitsbereiche]);
  label: 'Arbeitsbereiche';
default: #();
priority: 500;
beSorted;
cssClass: #historieArbeitsbereiche;
reference: (HistorieArbeitsbereiche descriptionArbeitsbereich);
      yourself

The problem is, that i have no idea, how to inject css in the resulting editor (when i click on "edit" or "add").

Is there a way to inject an link to a css into the header of _every_ page that is rendered? If i use call: to render a component, the calling component gets replaced (including the <header> section). If a magritte-editor is redered via a OneToMany-Relationsip i don't seem to have access to the header-section of the resulting html (i only could use a custom renderer - here i could try to load css from the <body>-section of the page - but that seems do be no clean way.

thx and regards,
Stefan

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside