You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Ashoka Upadhya <AU...@art.com> on 2012/04/26 18:05:20 UTC

Aggregating JavaScript

I would like to aggregate all javascript and move to the bottom of the
page. I looked into the resource aggregation example and also filtering
header response. If I understand correctly header response filter
methods are called only when the scripts are added explicitly through
IHeaderResponse methods (renderJavaSCriptReference ..etc)

 

In our case, scripts are added in the markup (these markups are defined
in the CMS). Is there a way to collect all scripts from the markup and
also added through IHeaderResponse?

 

Regards, 

 

Ashoka Upadhya 

Principal Software Engineer

Art.com

Phone: (510) 879-4858

Fax: (510) 588-3930    

 

 

 

  <http://www.art.com/> 

  <http://www.allposters.com/> 

  <http://www.artistrising.com/> 

	

If you have received this e-mail in error, please immediately notify the
sender by reply e-mail and destroy the original e-mail and its
attachments without reading or saving them. This e-mail and any
documents, files or previous e-mail messages attached to it, may contain
confidential or privileged information that is prohibited from
disclosure under confidentiality agreement or applicable law. If you are
not the intended recipient, or a person responsible for delivering it to
the intended recipient, you are hereby notified that any disclosure,
copying, distribution or use of this e-mail or any of the information
contained in or attached to this e-mail is STRICTLY PROHIBITED. Thank
you.


Re: Aggregating JavaScript

Posted by Martin Grigorov <mg...@apache.org>.
On Mon, May 14, 2012 at 11:57 PM, kamiseq <ka...@gmail.com> wrote:
> I was thinking about creating custom behaviour that will connect to other
> behaviour and render all scripts needed at the bottom of the page (If this
> is possible),

It is possible.
See the source of
http://www.wicket-library.com/wicket-examples/resourceaggregation

> I understand that headerContributior is not good choice as it will render
> scripts in head section and we want them at the bottom
>
> pozdrawiam
> Paweł Kamiński
>
> kamiseq@gmail.com
> pkaminski.prv@gmail.com
> ______________________
>
>
> On 27 April 2012 09:46, Martin Grigorov <mg...@apache.org> wrote:
>
>> Hi,
>>
>> I think there are two options:
>> 1) use a IMarkupFilter that will extract the scripts from the markup and
>> transform them to header contributions via ComponentTag#addBehavior()
>> 2) <wicket:head> has a non-documented attribute called wicket:scope that
>> may help here. I haven't used it (otherwise I'd document it) and I'm not
>> quite sure whether it will do the job
>>
>> On Thu, Apr 26, 2012 at 7:05 PM, Ashoka Upadhya <AU...@art.com> wrote:
>>
>> > I would like to aggregate all javascript and move to the bottom of the
>> > page. I looked into the resource aggregation example and also filtering
>> > header response. If I understand correctly header response filter methods
>> > are called only when the scripts are added explicitly through
>> > IHeaderResponse methods (renderJavaSCriptReference ..etc)****
>> >
>> > ** **
>> >
>> > In our case, scripts are added in the markup (these markups are defined
>> in
>> > the CMS). Is there a way to collect all scripts from the markup and also
>> > added through IHeaderResponse?****
>> >
>> > ** **
>> >
>> > Regards, ****
>> >
>> >  ****
>> >
>> > Ashoka Upadhya ****
>> >
>> > Principal Software Engineer****
>> >
>> > Art.com****
>> >
>> > Phone: (510) 879-4858****
>> >
>> > Fax: (510) 588-3930    ****
>> >
>> > [image: art.com, inc]****
>> >
>> >  ****
>> >
>> > ** **
>> >
>> > [image: art.com] <http://www.art.com/>****
>> >
>> > [image: allposters.com] <http://www.allposters.com/>****
>> >
>> > [image: artist] <http://www.artistrising.com/>****
>> >
>> > If you have received this e-mail in error, please immediately notify the
>> > sender by reply e-mail and destroy the original e-mail and its
>> attachments
>> > without reading or saving them. This e-mail and any documents, files or
>> > previous e-mail messages attached to it, may contain confidential or
>> > privileged information that is prohibited from disclosure under
>> > confidentiality agreement or applicable law. If you are not the intended
>> > recipient, or a person responsible for delivering it to the intended
>> > recipient, you are hereby notified that any disclosure, copying,
>> > distribution or use of this e-mail or any of the information contained in
>> > or attached to this e-mail is STRICTLY PROHIBITED. Thank you.****
>> >
>>
>>
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com <http://jweekend.com/>
>>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Aggregating JavaScript

Posted by kamiseq <ka...@gmail.com>.
I was thinking about creating custom behaviour that will connect to other
behaviour and render all scripts needed at the bottom of the page (If this
is possible),
I understand that headerContributior is not good choice as it will render
scripts in head section and we want them at the bottom

pozdrawiam
Paweł Kamiński

kamiseq@gmail.com
pkaminski.prv@gmail.com
______________________


On 27 April 2012 09:46, Martin Grigorov <mg...@apache.org> wrote:

> Hi,
>
> I think there are two options:
> 1) use a IMarkupFilter that will extract the scripts from the markup and
> transform them to header contributions via ComponentTag#addBehavior()
> 2) <wicket:head> has a non-documented attribute called wicket:scope that
> may help here. I haven't used it (otherwise I'd document it) and I'm not
> quite sure whether it will do the job
>
> On Thu, Apr 26, 2012 at 7:05 PM, Ashoka Upadhya <AU...@art.com> wrote:
>
> > I would like to aggregate all javascript and move to the bottom of the
> > page. I looked into the resource aggregation example and also filtering
> > header response. If I understand correctly header response filter methods
> > are called only when the scripts are added explicitly through
> > IHeaderResponse methods (renderJavaSCriptReference ..etc)****
> >
> > ** **
> >
> > In our case, scripts are added in the markup (these markups are defined
> in
> > the CMS). Is there a way to collect all scripts from the markup and also
> > added through IHeaderResponse?****
> >
> > ** **
> >
> > Regards, ****
> >
> >  ****
> >
> > Ashoka Upadhya ****
> >
> > Principal Software Engineer****
> >
> > Art.com****
> >
> > Phone: (510) 879-4858****
> >
> > Fax: (510) 588-3930    ****
> >
> > [image: art.com, inc]****
> >
> >  ****
> >
> > ** **
> >
> > [image: art.com] <http://www.art.com/>****
> >
> > [image: allposters.com] <http://www.allposters.com/>****
> >
> > [image: artist] <http://www.artistrising.com/>****
> >
> > If you have received this e-mail in error, please immediately notify the
> > sender by reply e-mail and destroy the original e-mail and its
> attachments
> > without reading or saving them. This e-mail and any documents, files or
> > previous e-mail messages attached to it, may contain confidential or
> > privileged information that is prohibited from disclosure under
> > confidentiality agreement or applicable law. If you are not the intended
> > recipient, or a person responsible for delivering it to the intended
> > recipient, you are hereby notified that any disclosure, copying,
> > distribution or use of this e-mail or any of the information contained in
> > or attached to this e-mail is STRICTLY PROHIBITED. Thank you.****
> >
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com <http://jweekend.com/>
>

Re: Aggregating JavaScript

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

I think there are two options:
1) use a IMarkupFilter that will extract the scripts from the markup and
transform them to header contributions via ComponentTag#addBehavior()
2) <wicket:head> has a non-documented attribute called wicket:scope that
may help here. I haven't used it (otherwise I'd document it) and I'm not
quite sure whether it will do the job

On Thu, Apr 26, 2012 at 7:05 PM, Ashoka Upadhya <AU...@art.com> wrote:

> I would like to aggregate all javascript and move to the bottom of the
> page. I looked into the resource aggregation example and also filtering
> header response. If I understand correctly header response filter methods
> are called only when the scripts are added explicitly through
> IHeaderResponse methods (renderJavaSCriptReference ..etc)****
>
> ** **
>
> In our case, scripts are added in the markup (these markups are defined in
> the CMS). Is there a way to collect all scripts from the markup and also
> added through IHeaderResponse?****
>
> ** **
>
> Regards, ****
>
>  ****
>
> Ashoka Upadhya ****
>
> Principal Software Engineer****
>
> Art.com****
>
> Phone: (510) 879-4858****
>
> Fax: (510) 588-3930    ****
>
> [image: art.com, inc]****
>
>  ****
>
> ** **
>
> [image: art.com] <http://www.art.com/>****
>
> [image: allposters.com] <http://www.allposters.com/>****
>
> [image: artist] <http://www.artistrising.com/>****
>
> If you have received this e-mail in error, please immediately notify the
> sender by reply e-mail and destroy the original e-mail and its attachments
> without reading or saving them. This e-mail and any documents, files or
> previous e-mail messages attached to it, may contain confidential or
> privileged information that is prohibited from disclosure under
> confidentiality agreement or applicable law. If you are not the intended
> recipient, or a person responsible for delivering it to the intended
> recipient, you are hereby notified that any disclosure, copying,
> distribution or use of this e-mail or any of the information contained in
> or attached to this e-mail is STRICTLY PROHIBITED. Thank you.****
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>