See my DEPRECATED code below (just copy paste into appmodule).
I haven't tested this just now since like I said, I deprecated this for the
got jquery implementation which implements
a contributeContribuableClientInfrastructure that interferes (so I think)
 with the pasted code.

Perhaps better is to look at the implementation of
their contributeContribuableClientInfrastructure  as I remember reading
somewhere today that decorateClientInfrastructure which my code is based on
is deprecated in T5.2. (see: http://github.com/got5/tapestry5-jquery)

Anyhow for a quick fix see below.

HTH
Geert-Jan

/////////////////

public class ClientInfrastructureOwn implements ClientInfrastructure{
List<Asset> newStack = new ArrayList<Asset>();
public ClientInfrastructureOwn(ClientInfrastructure original) {
//this is the original stack. We stip all but the essential tapestry.js
//moreover, before that we include our own assets (updated versions of
prototype + scriptaculous)
List<Asset> origStack = original.getJavascriptStack();
 newStack.add(ownProto); //defined assets like @Inject
@Path("context:js/proto.js") Asset ownProto;
newStack.add(ownScriptaculous);
 for(Asset a:origStack){
if(true){//add your conditionals here to selet which assets from the orig
stack to add.
newStack.add(a);
}
}
}

public List<Asset> getJavascriptStack() {
return newStack;
}

public List<Asset> getStylesheetStack() {
return new ArrayList<Asset>(); //no default css at all
}
}


public ClientInfrastructure
decorateClientInfrastructure(ClientInfrastructure original) {
return new ClientInfrastructureOwn(original);
}



2010/10/28 françois facon [via Tapestry] <
ml-node+3241210-1302441614-91...@n5.nabble.com<ml-node%2b3241210-1302441614-91...@n5.nabble.com>
>

> hello jan,
>
> What did you change in your decoration Of clientInfastructure?
> We are also asking us how a component can contribute to the
> corejavascriptstack.
>
> françois
>
> 2010/10/28 gbrits <[hidden 
> email]<http://user/SendEmail.jtp?type=node&node=3241210&i=0>>
>
>
> >
> > I've ported my app (t5.1) to use jquery using Got jquery
> > (http://github.com/got5/tapestry5-jquery/issues)
> > which works very good.
> >
> > However, in the past (when using the regular prototype stack) I supplied
> my
> > own ClientInfrastructure (using decorateClientInfrastructure) to strip
> the
> > small javascripts which get autoloaded when certain components load. (I
> > know
> > tapestry packs the javascripts together for the client, but when
> different
> > pages use different components, the aggregated packed js is different per
>
> > page, so the client has to download the entire package again). Since as
> the
> > designer I know best what js to include when, I want to have total
> control
> > over it.
> >
> > This worked until I started using got jquery, which implements
> > contributeContribuableClientInfrastructure.
> >  I believe this interferes with my decorateClientInfrastructure which
> used
> > to strip the javascripts.
> >
> > So a long intro to the question:
> > how can I strip autoloaded js-files when using got jquery?
> >
> > Thanks,
> > Geert-Jan
> > --
> > View this message in context:
> >
> http://tapestry.1045711.n5.nabble.com/how-to-disable-autoloading-of-additional-javascripts-when-using-got-jquery-tp3240347p3240347.html<http://tapestry.1045711.n5.nabble.com/how-to-disable-autoloading-of-additional-javascripts-when-using-got-jquery-tp3240347p3240347.html?by-user=t>
> > Sent from the Tapestry - User mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden 
> > email]<http://user/SendEmail.jtp?type=node&node=3241210&i=1>
> > For additional commands, e-mail: [hidden 
> > email]<http://user/SendEmail.jtp?type=node&node=3241210&i=2>
> >
> >
>
>
> ------------------------------
>  View message @
> http://tapestry.1045711.n5.nabble.com/how-to-disable-autoloading-of-additional-javascripts-when-using-got-jquery-tp3240347p3241210.html
> To unsubscribe from how to disable autoloading of additional javascripts
> when using got jquery, click 
> here<http://tapestry.1045711.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3240347&code=Z2JyaXRzQGdtYWlsLmNvbXwzMjQwMzQ3fDExNjk3MTIyNTA=>.
>
>
>

-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/how-to-disable-autoloading-of-additional-javascripts-when-using-got-jquery-tp3240347p3241242.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

Reply via email to