You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Ittay Dror <it...@tikalk.com> on 2009/10/07 12:55:45 UTC
custom resolving of relative paths in head section of panel
Hi,
Is there a way in which I can convert javascript/css relative references
in a <wicket:head> of a panel and add a prefix to them?
Regards,
Ittay
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: custom resolving of relative paths in head section of panel
Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
That's one of the good things about this list: you try to answer a question
and you end up learning something new:-)
Thanks,
Ernesto
On Wed, Oct 7, 2009 at 1:30 PM, Pedro Santos <pe...@gmail.com> wrote:
> Hi Ittay, you can use wicket:link tag to resolve that path dynamically too.
>
> <head>
> <wicket:head>
> <wicket:link>
> <script type="text/javascript" src="./js/application.js"></script>
> </wicket:link>
> </wicket:head>
> </head>
>
> that way you keep the reference valid whe html is viewed as standalone, and
> in the context of the application
>
> On Wed, Oct 7, 2009 at 8:26 AM, Ernesto Reinaldo Barreiro <
> reiern70@gmail.com> wrote:
>
> > You could do
> > public class MyPanel extends Panel {
> >
> > public static ResourceReference CSS = new
> ResourceReference(MyPanel.class,
> > "mycss.css");
> >
> > public MyPanel(String id) {
> > add(CSSPackageResource.getHeaderContribution(CSS ));
> > }
> > }
> >
> > Similar for JavaScript with JavascriptPackageResource instead
> > of CSSPackageResource
> >
> > Best,
> >
> > Ernesto
> >
> > On Wed, Oct 7, 2009 at 1:21 PM, Ittay Dror <it...@tikalk.com> wrote:
> >
> > > In the panel's html i have something like:
> > >
> > > <script type="text/javascript" src="./js/application.js"></script>
> > >
> > >
> > > This works well when the html is viewed as standalone. but in the
> context
> > > of the application i need the tag to be rendered as:
> > >
> > > <script type="text/javascript" src="prefix/js/application.js"></script>
> > >
> > >
> > > Ittay
> > >
> > >
> > > Ernesto Reinaldo Barreiro wrote:
> > >
> > > Not quite following you... What do you mean? Something like:
> > >> a.myClass {
> > >> background: url('${myURL}');
> > >> }
> > >>
> > >> and get ${myURL} replaced?
> > >>
> > >> Best,
> > >>
> > >> Ernesto
> > >>
> > >>
> > >> On Wed, Oct 7, 2009 at 12:55 PM, Ittay Dror <it...@tikalk.com>
> wrote:
> > >>
> > >>
> > >>
> > >>> Hi,
> > >>>
> > >>>
> > >>> Is there a way in which I can convert javascript/css relative
> > references
> > >>> in
> > >>> a <wicket:head> of a panel and add a prefix to them?
> > >>>
> > >>>
> > >>> Regards,
> > >>>
> > >>> Ittay
> > >>>
> > >>>
> > >>>
> > >>> ---------------------------------------------------------------------
> > >>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > >>> For additional commands, e-mail: users-help@wicket.apache.org
> > >>>
> > >>>
> > >>>
> > >>>
> > >>
> > >>
> > >>
> > >
> > > --
> > > -- Tikal <http://www.tikalk.com>
> > > Tikal Project <http://tikal.sourceforge.net>
> > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > For additional commands, e-mail: users-help@wicket.apache.org
> > >
> > >
> >
>
>
>
> --
> Pedro Henrique Oliveira dos Santos
>
Re: custom resolving of relative paths in head section of panel
Posted by Pedro Santos <pe...@gmail.com>.
sorry, I miss that that tag will handle the 'href' attribute, the script tag
has 'src'
On Wed, Oct 7, 2009 at 8:58 AM, Ittay Dror <it...@tikalk.com> wrote:
>
>
> Pedro Santos wrote:
>
>> Hi Ittay, you can use wicket:link tag to resolve that path dynamically
>> too.
>>
>> <head>
>> <wicket:head>
>> <wicket:link>
>> <script type="text/javascript" src="./js/application.js"></script>
>> </wicket:link>
>> </wicket:head>
>> </head>
>>
>> that way you keep the reference valid whe html is viewed as standalone,
>> and
>> in the context of the application
>>
>>
> Thank you, I tried this and the result is:
>
> <wicket:link><script onclick="window.location.href='./js/application.js';"
> src="./js/application.js <view-source:
> http://localhost:8080/alm/js/application.js>"
> type="text/javascript"></script></wicket:link>
>
> Ittay
>
> On Wed, Oct 7, 2009 at 8:26 AM, Ernesto Reinaldo Barreiro <
>> reiern70@gmail.com> wrote:
>>
>>
>>
>>> You could do
>>> public class MyPanel extends Panel {
>>>
>>> public static ResourceReference CSS = new
>>> ResourceReference(MyPanel.class,
>>> "mycss.css");
>>>
>>> public MyPanel(String id) {
>>> add(CSSPackageResource.getHeaderContribution(CSS ));
>>> }
>>> }
>>>
>>> Similar for JavaScript with JavascriptPackageResource instead
>>> of CSSPackageResource
>>>
>>> Best,
>>>
>>> Ernesto
>>>
>>> On Wed, Oct 7, 2009 at 1:21 PM, Ittay Dror <it...@tikalk.com> wrote:
>>>
>>>
>>>
>>>> In the panel's html i have something like:
>>>>
>>>> <script type="text/javascript" src="./js/application.js"></script>
>>>>
>>>>
>>>> This works well when the html is viewed as standalone. but in the
>>>> context
>>>> of the application i need the tag to be rendered as:
>>>>
>>>> <script type="text/javascript" src="prefix/js/application.js"></script>
>>>>
>>>>
>>>> Ittay
>>>>
>>>>
>>>> Ernesto Reinaldo Barreiro wrote:
>>>>
>>>> Not quite following you... What do you mean? Something like:
>>>>
>>>>
>>>>> a.myClass {
>>>>> background: url('${myURL}');
>>>>> }
>>>>>
>>>>> and get ${myURL} replaced?
>>>>>
>>>>> Best,
>>>>>
>>>>> Ernesto
>>>>>
>>>>>
>>>>> On Wed, Oct 7, 2009 at 12:55 PM, Ittay Dror <it...@tikalk.com> wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>>
>>>>>> Is there a way in which I can convert javascript/css relative
>>>>>>
>>>>>>
>>>>> references
>>>
>>>
>>>> in
>>>>>> a <wicket:head> of a panel and add a prefix to them?
>>>>>>
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Ittay
>>>>>>
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>> --
>>>> -- Tikal <http://www.tikalk.com>
>>>> Tikal Project <http://tikal.sourceforge.net>
>>>>
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>>
>>>>
>>>
>>
>>
>>
>>
>
> --
> -- Tikal <http://www.tikalk.com>
> Tikal Project <http://tikal.sourceforge.net>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Pedro Henrique Oliveira dos Santos
Re: custom resolving of relative paths in head section of panel
Posted by Ittay Dror <it...@tikalk.com>.
Pedro Santos wrote:
> Hi Ittay, you can use wicket:link tag to resolve that path dynamically too.
>
> <head>
> <wicket:head>
> <wicket:link>
> <script type="text/javascript" src="./js/application.js"></script>
> </wicket:link>
> </wicket:head>
> </head>
>
> that way you keep the reference valid whe html is viewed as standalone, and
> in the context of the application
>
Thank you, I tried this and the result is:
<wicket:link><script onclick="window.location.href='./js/application.js';" src="./js/application.js <view-source:http://localhost:8080/alm/js/application.js>" type="text/javascript"></script></wicket:link>
Ittay
> On Wed, Oct 7, 2009 at 8:26 AM, Ernesto Reinaldo Barreiro <
> reiern70@gmail.com> wrote:
>
>
>> You could do
>> public class MyPanel extends Panel {
>>
>> public static ResourceReference CSS = new ResourceReference(MyPanel.class,
>> "mycss.css");
>>
>> public MyPanel(String id) {
>> add(CSSPackageResource.getHeaderContribution(CSS ));
>> }
>> }
>>
>> Similar for JavaScript with JavascriptPackageResource instead
>> of CSSPackageResource
>>
>> Best,
>>
>> Ernesto
>>
>> On Wed, Oct 7, 2009 at 1:21 PM, Ittay Dror <it...@tikalk.com> wrote:
>>
>>
>>> In the panel's html i have something like:
>>>
>>> <script type="text/javascript" src="./js/application.js"></script>
>>>
>>>
>>> This works well when the html is viewed as standalone. but in the context
>>> of the application i need the tag to be rendered as:
>>>
>>> <script type="text/javascript" src="prefix/js/application.js"></script>
>>>
>>>
>>> Ittay
>>>
>>>
>>> Ernesto Reinaldo Barreiro wrote:
>>>
>>> Not quite following you... What do you mean? Something like:
>>>
>>>> a.myClass {
>>>> background: url('${myURL}');
>>>> }
>>>>
>>>> and get ${myURL} replaced?
>>>>
>>>> Best,
>>>>
>>>> Ernesto
>>>>
>>>>
>>>> On Wed, Oct 7, 2009 at 12:55 PM, Ittay Dror <it...@tikalk.com> wrote:
>>>>
>>>>
>>>>
>>>>
>>>>> Hi,
>>>>>
>>>>>
>>>>> Is there a way in which I can convert javascript/css relative
>>>>>
>> references
>>
>>>>> in
>>>>> a <wicket:head> of a panel and add a prefix to them?
>>>>>
>>>>>
>>>>> Regards,
>>>>>
>>>>> Ittay
>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>> --
>>> -- Tikal <http://www.tikalk.com>
>>> Tikal Project <http://tikal.sourceforge.net>
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>>
>
>
>
>
--
--
Tikal <http://www.tikalk.com>
Tikal Project <http://tikal.sourceforge.net>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: custom resolving of relative paths in head section of panel
Posted by Pedro Santos <pe...@gmail.com>.
Hi Ittay, you can use wicket:link tag to resolve that path dynamically too.
<head>
<wicket:head>
<wicket:link>
<script type="text/javascript" src="./js/application.js"></script>
</wicket:link>
</wicket:head>
</head>
that way you keep the reference valid whe html is viewed as standalone, and
in the context of the application
On Wed, Oct 7, 2009 at 8:26 AM, Ernesto Reinaldo Barreiro <
reiern70@gmail.com> wrote:
> You could do
> public class MyPanel extends Panel {
>
> public static ResourceReference CSS = new ResourceReference(MyPanel.class,
> "mycss.css");
>
> public MyPanel(String id) {
> add(CSSPackageResource.getHeaderContribution(CSS ));
> }
> }
>
> Similar for JavaScript with JavascriptPackageResource instead
> of CSSPackageResource
>
> Best,
>
> Ernesto
>
> On Wed, Oct 7, 2009 at 1:21 PM, Ittay Dror <it...@tikalk.com> wrote:
>
> > In the panel's html i have something like:
> >
> > <script type="text/javascript" src="./js/application.js"></script>
> >
> >
> > This works well when the html is viewed as standalone. but in the context
> > of the application i need the tag to be rendered as:
> >
> > <script type="text/javascript" src="prefix/js/application.js"></script>
> >
> >
> > Ittay
> >
> >
> > Ernesto Reinaldo Barreiro wrote:
> >
> > Not quite following you... What do you mean? Something like:
> >> a.myClass {
> >> background: url('${myURL}');
> >> }
> >>
> >> and get ${myURL} replaced?
> >>
> >> Best,
> >>
> >> Ernesto
> >>
> >>
> >> On Wed, Oct 7, 2009 at 12:55 PM, Ittay Dror <it...@tikalk.com> wrote:
> >>
> >>
> >>
> >>> Hi,
> >>>
> >>>
> >>> Is there a way in which I can convert javascript/css relative
> references
> >>> in
> >>> a <wicket:head> of a panel and add a prefix to them?
> >>>
> >>>
> >>> Regards,
> >>>
> >>> Ittay
> >>>
> >>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >>
> >
> > --
> > -- Tikal <http://www.tikalk.com>
> > Tikal Project <http://tikal.sourceforge.net>
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
--
Pedro Henrique Oliveira dos Santos
Re: custom resolving of relative paths in head section of panel
Posted by Pedro Santos <pe...@gmail.com>.
<script type="text/javascript" src="./js/application.js"></script>
This works well when the html is viewed as standalone. but in the context of
the application i need the tag to be rendered as:
<script type="text/javascript" src="prefix/js/application.js"></script>
I think that is the case to use:
<head>
<script type="text/javascript" src="./js/application.js"></script>
<wicket:head>
<script type="text/javascript" src="prefix/js/application.js"></script>
</wicket:head>
<head>
<wicket:panel>
....
</wicket:panel>
On Wed, Oct 7, 2009 at 9:55 AM, Ittay Dror <it...@tikalk.com> wrote:
>
>
> Ernesto Reinaldo Barreiro wrote:
>
> This solution will work for sure... and additionally you could have the
>> markup of MyPanel
>> <html>
>> <head>
>> <script type="text/javascript" src="./js/application.js"></script>
>> </head>
>> <body>
>> <wicket:panel>
>> .....
>> </wicket:panel>
>> </body>
>> </html>
>> So that you cant test it offline and have it working when used
>> dynamically.
>>
>>
> Thank you, but in my case, the javascript files are not globally available,
> i need to service them via a mounted target url coding strategy.
>
> Ittay
>
> Ernesto
>>
>> On Wed, Oct 7, 2009 at 1:26 PM, Ernesto Reinaldo Barreiro <
>> reiern70@gmail.com> wrote:
>>
>>
>>
>>> You could do
>>> public class MyPanel extends Panel {
>>>
>>> public static ResourceReference CSS = new
>>> ResourceReference(MyPanel.class,
>>> "mycss.css");
>>>
>>> public MyPanel(String id) {
>>> add(CSSPackageResource.getHeaderContribution(CSS ));
>>> }
>>> }
>>>
>>> Similar for JavaScript with JavascriptPackageResource instead
>>> of CSSPackageResource
>>>
>>> Best,
>>>
>>> Ernesto
>>>
>>> On Wed, Oct 7, 2009 at 1:21 PM, Ittay Dror <it...@tikalk.com> wrote:
>>>
>>>
>>>
>>>> In the panel's html i have something like:
>>>>
>>>> <script type="text/javascript" src="./js/application.js"></script>
>>>>
>>>>
>>>> This works well when the html is viewed as standalone. but in the
>>>> context
>>>> of the application i need the tag to be rendered as:
>>>>
>>>> <script type="text/javascript" src="prefix/js/application.js"></script>
>>>>
>>>>
>>>> Ittay
>>>>
>>>>
>>>> Ernesto Reinaldo Barreiro wrote:
>>>>
>>>> Not quite following you... What do you mean? Something like:
>>>>
>>>>
>>>>> a.myClass {
>>>>> background: url('${myURL}');
>>>>> }
>>>>>
>>>>> and get ${myURL} replaced?
>>>>>
>>>>> Best,
>>>>>
>>>>> Ernesto
>>>>>
>>>>>
>>>>> On Wed, Oct 7, 2009 at 12:55 PM, Ittay Dror <it...@tikalk.com> wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>>
>>>>>> Is there a way in which I can convert javascript/css relative
>>>>>> references
>>>>>> in
>>>>>> a <wicket:head> of a panel and add a prefix to them?
>>>>>>
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Ittay
>>>>>>
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>> --
>>>> -- Tikal <http://www.tikalk.com>
>>>> Tikal Project <http://tikal.sourceforge.net>
>>>>
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>>
>>>>
>>>
>>
>>
>
> --
> -- Tikal <http://www.tikalk.com>
> Tikal Project <http://tikal.sourceforge.net>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Pedro Henrique Oliveira dos Santos
Re: custom resolving of relative paths in head section of panel
Posted by Ittay Dror <it...@tikalk.com>.
Ernesto Reinaldo Barreiro wrote:
> This solution will work for sure... and additionally you could have the
> markup of MyPanel
> <html>
> <head>
> <script type="text/javascript" src="./js/application.js"></script>
> </head>
> <body>
> <wicket:panel>
> .....
> </wicket:panel>
> </body>
> </html>
> So that you cant test it offline and have it working when used dynamically.
>
Thank you, but in my case, the javascript files are not globally
available, i need to service them via a mounted target url coding strategy.
Ittay
> Ernesto
>
> On Wed, Oct 7, 2009 at 1:26 PM, Ernesto Reinaldo Barreiro <
> reiern70@gmail.com> wrote:
>
>
>> You could do
>> public class MyPanel extends Panel {
>>
>> public static ResourceReference CSS = new ResourceReference(MyPanel.class,
>> "mycss.css");
>>
>> public MyPanel(String id) {
>> add(CSSPackageResource.getHeaderContribution(CSS ));
>> }
>> }
>>
>> Similar for JavaScript with JavascriptPackageResource instead
>> of CSSPackageResource
>>
>> Best,
>>
>> Ernesto
>>
>> On Wed, Oct 7, 2009 at 1:21 PM, Ittay Dror <it...@tikalk.com> wrote:
>>
>>
>>> In the panel's html i have something like:
>>>
>>> <script type="text/javascript" src="./js/application.js"></script>
>>>
>>>
>>> This works well when the html is viewed as standalone. but in the context
>>> of the application i need the tag to be rendered as:
>>>
>>> <script type="text/javascript" src="prefix/js/application.js"></script>
>>>
>>>
>>> Ittay
>>>
>>>
>>> Ernesto Reinaldo Barreiro wrote:
>>>
>>> Not quite following you... What do you mean? Something like:
>>>
>>>> a.myClass {
>>>> background: url('${myURL}');
>>>> }
>>>>
>>>> and get ${myURL} replaced?
>>>>
>>>> Best,
>>>>
>>>> Ernesto
>>>>
>>>>
>>>> On Wed, Oct 7, 2009 at 12:55 PM, Ittay Dror <it...@tikalk.com> wrote:
>>>>
>>>>
>>>>
>>>>
>>>>> Hi,
>>>>>
>>>>>
>>>>> Is there a way in which I can convert javascript/css relative references
>>>>> in
>>>>> a <wicket:head> of a panel and add a prefix to them?
>>>>>
>>>>>
>>>>> Regards,
>>>>>
>>>>> Ittay
>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>> --
>>> -- Tikal <http://www.tikalk.com>
>>> Tikal Project <http://tikal.sourceforge.net>
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>>
>
>
--
--
Tikal <http://www.tikalk.com>
Tikal Project <http://tikal.sourceforge.net>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: custom resolving of relative paths in head section of panel
Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
This solution will work for sure... and additionally you could have the
markup of MyPanel
<html>
<head>
<script type="text/javascript" src="./js/application.js"></script>
</head>
<body>
<wicket:panel>
.....
</wicket:panel>
</body>
</html>
So that you cant test it offline and have it working when used dynamically.
Ernesto
On Wed, Oct 7, 2009 at 1:26 PM, Ernesto Reinaldo Barreiro <
reiern70@gmail.com> wrote:
> You could do
> public class MyPanel extends Panel {
>
> public static ResourceReference CSS = new ResourceReference(MyPanel.class,
> "mycss.css");
>
> public MyPanel(String id) {
> add(CSSPackageResource.getHeaderContribution(CSS ));
> }
> }
>
> Similar for JavaScript with JavascriptPackageResource instead
> of CSSPackageResource
>
> Best,
>
> Ernesto
>
> On Wed, Oct 7, 2009 at 1:21 PM, Ittay Dror <it...@tikalk.com> wrote:
>
>> In the panel's html i have something like:
>>
>> <script type="text/javascript" src="./js/application.js"></script>
>>
>>
>> This works well when the html is viewed as standalone. but in the context
>> of the application i need the tag to be rendered as:
>>
>> <script type="text/javascript" src="prefix/js/application.js"></script>
>>
>>
>> Ittay
>>
>>
>> Ernesto Reinaldo Barreiro wrote:
>>
>> Not quite following you... What do you mean? Something like:
>>> a.myClass {
>>> background: url('${myURL}');
>>> }
>>>
>>> and get ${myURL} replaced?
>>>
>>> Best,
>>>
>>> Ernesto
>>>
>>>
>>> On Wed, Oct 7, 2009 at 12:55 PM, Ittay Dror <it...@tikalk.com> wrote:
>>>
>>>
>>>
>>>> Hi,
>>>>
>>>>
>>>> Is there a way in which I can convert javascript/css relative references
>>>> in
>>>> a <wicket:head> of a panel and add a prefix to them?
>>>>
>>>>
>>>> Regards,
>>>>
>>>> Ittay
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>> --
>> -- Tikal <http://www.tikalk.com>
>> Tikal Project <http://tikal.sourceforge.net>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
Re: custom resolving of relative paths in head section of panel
Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
You could do
public class MyPanel extends Panel {
public static ResourceReference CSS = new ResourceReference(MyPanel.class,
"mycss.css");
public MyPanel(String id) {
add(CSSPackageResource.getHeaderContribution(CSS ));
}
}
Similar for JavaScript with JavascriptPackageResource instead
of CSSPackageResource
Best,
Ernesto
On Wed, Oct 7, 2009 at 1:21 PM, Ittay Dror <it...@tikalk.com> wrote:
> In the panel's html i have something like:
>
> <script type="text/javascript" src="./js/application.js"></script>
>
>
> This works well when the html is viewed as standalone. but in the context
> of the application i need the tag to be rendered as:
>
> <script type="text/javascript" src="prefix/js/application.js"></script>
>
>
> Ittay
>
>
> Ernesto Reinaldo Barreiro wrote:
>
> Not quite following you... What do you mean? Something like:
>> a.myClass {
>> background: url('${myURL}');
>> }
>>
>> and get ${myURL} replaced?
>>
>> Best,
>>
>> Ernesto
>>
>>
>> On Wed, Oct 7, 2009 at 12:55 PM, Ittay Dror <it...@tikalk.com> wrote:
>>
>>
>>
>>> Hi,
>>>
>>>
>>> Is there a way in which I can convert javascript/css relative references
>>> in
>>> a <wicket:head> of a panel and add a prefix to them?
>>>
>>>
>>> Regards,
>>>
>>> Ittay
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>>
>>>
>>
>>
>>
>
> --
> -- Tikal <http://www.tikalk.com>
> Tikal Project <http://tikal.sourceforge.net>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: custom resolving of relative paths in head section of panel
Posted by Ittay Dror <it...@tikalk.com>.
In the panel's html i have something like:
<script type="text/javascript" src="./js/application.js"></script>
This works well when the html is viewed as standalone. but in the
context of the application i need the tag to be rendered as:
<script type="text/javascript" src="prefix/js/application.js"></script>
Ittay
Ernesto Reinaldo Barreiro wrote:
> Not quite following you... What do you mean? Something like:
> a.myClass {
> background: url('${myURL}');
> }
>
> and get ${myURL} replaced?
>
> Best,
>
> Ernesto
>
>
> On Wed, Oct 7, 2009 at 12:55 PM, Ittay Dror <it...@tikalk.com> wrote:
>
>
>> Hi,
>>
>>
>> Is there a way in which I can convert javascript/css relative references in
>> a <wicket:head> of a panel and add a prefix to them?
>>
>>
>> Regards,
>>
>> Ittay
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>
>
--
--
Tikal <http://www.tikalk.com>
Tikal Project <http://tikal.sourceforge.net>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: custom resolving of relative paths in head section of panel
Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
Not quite following you... What do you mean? Something like:
a.myClass {
background: url('${myURL}');
}
and get ${myURL} replaced?
Best,
Ernesto
On Wed, Oct 7, 2009 at 12:55 PM, Ittay Dror <it...@tikalk.com> wrote:
> Hi,
>
>
> Is there a way in which I can convert javascript/css relative references in
> a <wicket:head> of a panel and add a prefix to them?
>
>
> Regards,
>
> Ittay
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>