Re: CSS for all pages
That sounds handy, thanks. Although is does highlight a niggle I've always had with the JavaScriptSupport service and similar - other than coding convenience, I've never understood what CSS has to do with JavaScript!?? I would prefer it if CSS and JavaScript support were maintained in separate services for it would make it easier to find both. As it is, it's not obvious you have to turn to a JavaScript service for CSS support. Steve. On 29 September 2011 13:56, Olaf Tomczak wrote: > The other way to do this is (simpler in my opinion) to implement your own > JavaScriptStack (List getStylesheets() method) and make a > contribution to JavaScriptStackSource in your module. > > Cheers, Olaf > > 2011/9/28 Wechsung, Wulf > >> Exactly, Steve! >> You solution is great! Thanks a lot :) >> >> >> -Original Message- >> From: Steve Eynon [mailto:steve.ey...@alienfactory.co.uk] >> Sent: Mittwoch, 28. September 2011 19:53 >> To: Tapestry users >> Subject: Re: CSS for all pages >> >> Ah, cheers Thiago! >> >> I think Wulf was saying the CSS was part of a separate module he >> wouldn't have direct access to the Layout component - in that case he >> could use the Worker to single out the Layout and just add the Mixin >> to that. >> >> -- Forwarded message -- >> From: Thiago H. de Paula Figueiredo >> Date: 29 September 2011 01:27 >> Subject: Re: CSS for all pages >> To: Steve Eynon >> >> Awesome use of a component class transformation and a mixin, Steve! :) >> >> Wulf, I'd say almost all Tapestry projects have a Layout component >> used in all pages, so @Import'ing your CSS or JavaScript in it makes >> them being added to all pages. >> >> >> On Wed, 28 Sep 2011 13:39:56 -0300, Steve Eynon >> wrote: >> >> > There may be an easier way, but you could have a worker to add a Mixin >> > / Component to each page which has no markup, but @Import's your CSS. >> > >> > In T5.3 it's : >> > >> > public class EmbedCssMixinInEveryPageWorker implements >> > ComponentClassTransformWorker2 { >> > public void transform(PlasticClass plasticClass, >> > TransformationSupport support, MutableComponentModel model) { >> > if (model.isPage()) >> > model.addMixinClassName(CssMixin.class.getName()); >> > } >> > } >> > >> > @Import(stylesheet="context:myApp.css") >> > public class CssMixin { >> > } >> > >> > in your module, add >> > >> > public static void >> > >> contributeComponentClassTransformWorker(OrderedConfiguration >> > configuration) { >> > configuration.addInstance("CssMixin", >> EmbedCssMixinInEveryPageWorker.class); >> > } >> > >> > Steve. >> > >> > On 29 September 2011 00:24, Wechsung, Wulf >> wrote: >> >> >> >> Hello Guys, >> >> >> >> I was wondering if it is at all possible to add a global (ie included in >> all pages) CSS from a module. Basically just like the tapestry framework >> adds the default.css to any page in your tapestry web app I would like to >> have a webapp that loads a module that includes a CSS in all the pages of >> the app. The use-case is that I need to add some CSS fixes that should go >> into all apps that use the module auto-magically as is the case with filters >> and services. >> >> >> >> Thanks and kind Regards, >> >> Wulf >> >> >> > >> > - >> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> > For additional commands, e-mail: users-h...@tapestry.apache.org >> > >> >> >> -- >> Thiago H. de Paula Figueiredo >> Independent Java, Apache Tapestry 5 and Hibernate consultant, >> developer, and instructor >> Owner, Ars Machina Tecnologia da Informação Ltda. >> Consultor, desenvolvedor e instrutor em Java, Tapestry e Hibernate >> http://www.arsmachina.com.br >> >> - >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> >> > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: CSS for all pages
The other way to do this is (simpler in my opinion) to implement your own JavaScriptStack (List getStylesheets() method) and make a contribution to JavaScriptStackSource in your module. Cheers, Olaf 2011/9/28 Wechsung, Wulf > Exactly, Steve! > You solution is great! Thanks a lot :) > > > -Original Message- > From: Steve Eynon [mailto:steve.ey...@alienfactory.co.uk] > Sent: Mittwoch, 28. September 2011 19:53 > To: Tapestry users > Subject: Re: CSS for all pages > > Ah, cheers Thiago! > > I think Wulf was saying the CSS was part of a separate module he > wouldn't have direct access to the Layout component - in that case he > could use the Worker to single out the Layout and just add the Mixin > to that. > > -- Forwarded message -- > From: Thiago H. de Paula Figueiredo > Date: 29 September 2011 01:27 > Subject: Re: CSS for all pages > To: Steve Eynon > > Awesome use of a component class transformation and a mixin, Steve! :) > > Wulf, I'd say almost all Tapestry projects have a Layout component > used in all pages, so @Import'ing your CSS or JavaScript in it makes > them being added to all pages. > > > On Wed, 28 Sep 2011 13:39:56 -0300, Steve Eynon > wrote: > > > There may be an easier way, but you could have a worker to add a Mixin > > / Component to each page which has no markup, but @Import's your CSS. > > > > In T5.3 it's : > > > > public class EmbedCssMixinInEveryPageWorker implements > > ComponentClassTransformWorker2 { > >public void transform(PlasticClass plasticClass, > > TransformationSupport support, MutableComponentModel model) { > >if (model.isPage()) > >model.addMixinClassName(CssMixin.class.getName()); > >} > > } > > > > @Import(stylesheet="context:myApp.css") > > public class CssMixin { > > } > > > > in your module, add > > > > public static void > > > contributeComponentClassTransformWorker(OrderedConfiguration > > configuration) { > >configuration.addInstance("CssMixin", > EmbedCssMixinInEveryPageWorker.class); > > } > > > > Steve. > > > > On 29 September 2011 00:24, Wechsung, Wulf > wrote: > >> > >> Hello Guys, > >> > >> I was wondering if it is at all possible to add a global (ie included in > all pages) CSS from a module. Basically just like the tapestry framework > adds the default.css to any page in your tapestry web app I would like to > have a webapp that loads a module that includes a CSS in all the pages of > the app. The use-case is that I need to add some CSS fixes that should go > into all apps that use the module auto-magically as is the case with filters > and services. > >> > >> Thanks and kind Regards, > >> Wulf > >> > > > > - > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > > For additional commands, e-mail: users-h...@tapestry.apache.org > > > > > -- > Thiago H. de Paula Figueiredo > Independent Java, Apache Tapestry 5 and Hibernate consultant, > developer, and instructor > Owner, Ars Machina Tecnologia da Informação Ltda. > Consultor, desenvolvedor e instrutor em Java, Tapestry e Hibernate > http://www.arsmachina.com.br > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
RE: CSS for all pages
Exactly, Steve! You solution is great! Thanks a lot :) -Original Message- From: Steve Eynon [mailto:steve.ey...@alienfactory.co.uk] Sent: Mittwoch, 28. September 2011 19:53 To: Tapestry users Subject: Re: CSS for all pages Ah, cheers Thiago! I think Wulf was saying the CSS was part of a separate module he wouldn't have direct access to the Layout component - in that case he could use the Worker to single out the Layout and just add the Mixin to that. -- Forwarded message -- From: Thiago H. de Paula Figueiredo Date: 29 September 2011 01:27 Subject: Re: CSS for all pages To: Steve Eynon Awesome use of a component class transformation and a mixin, Steve! :) Wulf, I'd say almost all Tapestry projects have a Layout component used in all pages, so @Import'ing your CSS or JavaScript in it makes them being added to all pages. On Wed, 28 Sep 2011 13:39:56 -0300, Steve Eynon wrote: > There may be an easier way, but you could have a worker to add a Mixin > / Component to each page which has no markup, but @Import's your CSS. > > In T5.3 it's : > > public class EmbedCssMixinInEveryPageWorker implements > ComponentClassTransformWorker2 { > public void transform(PlasticClass plasticClass, > TransformationSupport support, MutableComponentModel model) { > if (model.isPage()) > model.addMixinClassName(CssMixin.class.getName()); > } > } > > @Import(stylesheet="context:myApp.css") > public class CssMixin { > } > > in your module, add > > public static void > contributeComponentClassTransformWorker(OrderedConfiguration > configuration) { > configuration.addInstance("CssMixin", > EmbedCssMixinInEveryPageWorker.class); > } > > Steve. > > On 29 September 2011 00:24, Wechsung, Wulf wrote: >> >> Hello Guys, >> >> I was wondering if it is at all possible to add a global (ie included in all >> pages) CSS from a module. Basically just like the tapestry framework adds >> the default.css to any page in your tapestry web app I would like to have a >> webapp that loads a module that includes a CSS in all the pages of the app. >> The use-case is that I need to add some CSS fixes that should go into all >> apps that use the module auto-magically as is the case with filters and >> services. >> >> Thanks and kind Regards, >> Wulf >> > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. Consultor, desenvolvedor e instrutor em Java, Tapestry e Hibernate http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: CSS for all pages
Ah, cheers Thiago! I think Wulf was saying the CSS was part of a separate module he wouldn't have direct access to the Layout component - in that case he could use the Worker to single out the Layout and just add the Mixin to that. -- Forwarded message -- From: Thiago H. de Paula Figueiredo Date: 29 September 2011 01:27 Subject: Re: CSS for all pages To: Steve Eynon Awesome use of a component class transformation and a mixin, Steve! :) Wulf, I'd say almost all Tapestry projects have a Layout component used in all pages, so @Import'ing your CSS or JavaScript in it makes them being added to all pages. On Wed, 28 Sep 2011 13:39:56 -0300, Steve Eynon wrote: > There may be an easier way, but you could have a worker to add a Mixin > / Component to each page which has no markup, but @Import's your CSS. > > In T5.3 it's : > > public class EmbedCssMixinInEveryPageWorker implements > ComponentClassTransformWorker2 { > public void transform(PlasticClass plasticClass, > TransformationSupport support, MutableComponentModel model) { > if (model.isPage()) > model.addMixinClassName(CssMixin.class.getName()); > } > } > > @Import(stylesheet="context:myApp.css") > public class CssMixin { > } > > in your module, add > > public static void > contributeComponentClassTransformWorker(OrderedConfiguration > configuration) { > configuration.addInstance("CssMixin", > EmbedCssMixinInEveryPageWorker.class); > } > > Steve. > > On 29 September 2011 00:24, Wechsung, Wulf wrote: >> >> Hello Guys, >> >> I was wondering if it is at all possible to add a global (ie included in all >> pages) CSS from a module. Basically just like the tapestry framework adds >> the default.css to any page in your tapestry web app I would like to have a >> webapp that loads a module that includes a CSS in all the pages of the app. >> The use-case is that I need to add some CSS fixes that should go into all >> apps that use the module auto-magically as is the case with filters and >> services. >> >> Thanks and kind Regards, >> Wulf >> > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. Consultor, desenvolvedor e instrutor em Java, Tapestry e Hibernate http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: CSS for all pages
There may be an easier way, but you could have a worker to add a Mixin / Component to each page which has no markup, but @Import's your CSS. In T5.3 it's : public class EmbedCssMixinInEveryPageWorker implements ComponentClassTransformWorker2 { public void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel model) { if (model.isPage()) model.addMixinClassName(CssMixin.class.getName()); } } @Import(stylesheet="context:myApp.css") public class CssMixin { } in your module, add public static void contributeComponentClassTransformWorker(OrderedConfiguration configuration) { configuration.addInstance("CssMixin", EmbedCssMixinInEveryPageWorker.class); } Steve. On 29 September 2011 00:24, Wechsung, Wulf wrote: > Hello Guys, > > I was wondering if it is at all possible to add a global (ie included in all > pages) CSS from a module. Basically just like the tapestry framework adds > the default.css to any page in your tapestry web app I would like to have a > webapp that loads a module that includes a CSS in all the pages of the app. > The use-case is that I need to add some CSS fixes that should go into all > apps that use the module auto-magically as is the case with filters and > services. > > Thanks and kind Regards, > Wulf > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
CSS for all pages
Hello Guys, I was wondering if it is at all possible to add a global (ie included in all pages) CSS from a module. Basically just like the tapestry framework adds the default.css to any page in your tapestry web app I would like to have a webapp that loads a module that includes a CSS in all the pages of the app. The use-case is that I need to add some CSS fixes that should go into all apps that use the module auto-magically as is the case with filters and services. Thanks and kind Regards, Wulf