Resource Plugin add 'resource' automatically to css background image url

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Resource Plugin add 'resource' automatically to css background image url

netwiser
Using compile ':resources:1.2.RC2', I am having a weird issue which drives me to crazy.

In my config I set 
grails.resources.adhoc.patterns = [
'/images/*',
'/img/**',
'/css/*',
'/js/*',
'/plugins/*'
]

In my CSS, I have a CSS class with background-image:url("../img/icons/slider-handle.png")
In my WEB-INF folder, I have icons folder under img folder, everything suppose to be fine, however, when I run-app in local, the background image url will be processed and updated to background-image:url("resource:/css/img/icons/slider-handle.png"). Additional string "resource" is added!

I have tried to play around the adhoc patterns but no luck at all.

Can anyone shed some light? Since I use CSS delivered by other party I can not easily to modify it. 

Regards,

James
Reply | Threaded
Open this post in threaded view
|

RE: Resource Plugin add 'resource' automatically to css background image url

Bob Brown
See:

http://grails-plugins.github.io/grails-resources/guide/9.%20Configuration.ht
ml

Which says:

"""
Controlling the scope of the adhoc filter: grails.resources.adhoc.patterns

The ad-hoc resource filter is mapped using Servlet SDK filter mappings,
which are more restricted that Ant patterns. You can specify folder (xxx/)
or file type (.xxx) mappings only.
"""

You have an ant-style mapping: '/img/**'

I wonder if this is the issue?

BOB

> -----Original Message-----
> From: James Zhang [mailto:[hidden email]]
> Sent: Wednesday, 31 July 2013 3:39 PM
> To: [hidden email]
> Subject: [grails-user] Resource Plugin add 'resource' automatically to css
> background image url
>
> Using compile ':resources:1.2.RC2', I am having a weird issue which drives
me

> to crazy.
>
> In my config I set
> grails.resources.adhoc.patterns = [
> '/images/*',
> '/img/**',
> '/css/*',
> '/js/*',
> '/plugins/*'
> ]
>
> In my CSS, I have a CSS class with
background-image:url("../img/icons/slider-

> handle.png")
> In my WEB-INF folder, I have icons folder under img folder, everything
> suppose to be fine, however, when I run-app in local, the background image
> url will be processed and updated to background-
> image:url("resource:/css/img/icons/slider-handle.png"). Additional string
> "resource" is added!
>
>
> I have tried to play around the adhoc patterns but no luck at all.
>
>
> Can anyone shed some light? Since I use CSS delivered by other party I can
> not easily to modify it.
>
>
> Regards,
>
>
> James


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Resource Plugin add 'resource' automatically to css background image url

PeterNSteinmetz
Also perhaps try using resources 1.2, not 1.2RC2 ?

On Tuesday, July 30, 2013 at 10:43 PM, Bob Brown wrote:

See:

http://grails-plugins.github.io/grails-resources/guide/9.%20Configuration.ht
ml

Which says:

"""
Controlling the scope of the adhoc filter: grails.resources.adhoc.patterns

The ad-hoc resource filter is mapped using Servlet SDK filter mappings,
which are more restricted that Ant patterns. You can specify folder (xxx/)
or file type (.xxx) mappings only.
"""

You have an ant-style mapping: '/img/**'

I wonder if this is the issue?

BOB

-----Original Message-----
From: James Zhang [mailto:[hidden email]]
Sent: Wednesday, 31 July 2013 3:39 PM
Subject: [grails-user] Resource Plugin add 'resource' automatically to css
background image url

Using compile ':resources:1.2.RC2', I am having a weird issue which drives
me
to crazy.

In my config I set
grails.resources.adhoc.patterns = [
'/images/*',
'/img/**',
'/css/*',
'/js/*',
'/plugins/*'
]

In my CSS, I have a CSS class with
background-image:url("../img/icons/slider-
handle.png")
In my WEB-INF folder, I have icons folder under img folder, everything
suppose to be fine, however, when I run-app in local, the background image
url will be processed and updated to background-
image:url("resource:/css/img/icons/slider-handle.png"). Additional string
"resource" is added!


I have tried to play around the adhoc patterns but no luck at all.


Can anyone shed some light? Since I use CSS delivered by other party I can
not easily to modify it.


Regards,


James


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

RE: Resource Plugin add 'resource' automatically to css background image url

netwiser
In reply to this post by netwiser
I play around with all setting in grails resources, include, exclude, adhoc but still no luck, finally I have to temporary copy all images from /img folder to /css/img, and use this

grails.resources.adhoc.patterns = ['/images/*','/img/*','/css/*','/js/*','/plugins/*'] to make it work for now.

However, the war size is double up now due to duplicated images.


Regards,

James



From: [hidden email]
To: [hidden email]
Subject: Resource Plugin add 'resource' automatically to css background image url
Date: Wed, 31 Jul 2013 01:38:58 -0400

Using compile ':resources:1.2.RC2', I am having a weird issue which drives me to crazy.

In my config I set 
grails.resources.adhoc.patterns = [
'/images/*',
'/img/**',
'/css/*',
'/js/*',
'/plugins/*'
]

In my CSS, I have a CSS class with background-image:url("../img/icons/slider-handle.png")
In my WEB-INF folder, I have icons folder under img folder, everything suppose to be fine, however, when I run-app in local, the background image url will be processed and updated to background-image:url("resource:/css/img/icons/slider-handle.png"). Additional string "resource" is added!

I have tried to play around the adhoc patterns but no luck at all.

Can anyone shed some light? Since I use CSS delivered by other party I can not easily to modify it. 

Regards,

James
Reply | Threaded
Open this post in threaded view
|

RE: Resource Plugin add 'resource' automatically to css background image url

wilsonaikeda@gmail.com
Have you tried moving all your resources one level up? web-app folder? We usually don't put resources inside the web-inf folder

On Aug 1, 2013, at 10:29 PM, James Zhang <[hidden email]> wrote:

I play around with all setting in grails resources, include, exclude, adhoc but still no luck, finally I have to temporary copy all images from /img folder to /css/img, and use this

grails.resources.adhoc.patterns = ['/images/*','/img/*','/css/*','/js/*','/plugins/*'] to make it work for now. 

However, the war size is double up now due to duplicated images. 


Regards,

James



From: [hidden email]
To: [hidden email]
Subject: Resource Plugin add 'resource' automatically to css background image url
Date: Wed, 31 Jul 2013 01:38:58 -0400

Using compile ':resources:1.2.RC2', I am having a weird issue which drives me to crazy.

In my config I set 
grails.resources.adhoc.patterns = [
'/images/*',
'/img/**',
'/css/*',
'/js/*',
'/plugins/*'
]

In my CSS, I have a CSS class with background-image:url("../img/icons/slider-handle.png")
In my WEB-INF folder, I have icons folder under img folder, everything suppose to be fine, however, when I run-app in local, the background image url will be processed and updated to background-image:url("resource:/css/img/icons/slider-handle.png"). Additional string "resource" is added!

I have tried to play around the adhoc patterns but no luck at all.

Can anyone shed some light? Since I use CSS delivered by other party I can not easily to modify it. 

Regards,

James

Reply | Threaded
Open this post in threaded view
|

RE: Resource Plugin add 'resource' automatically to css background image url

netwiser
Yes, I did try that as well.

Resource plugin will put additional 'resource:' to the url if the image can't be found.

Now the images referred by the css using background-image : url ('../img/blahblah.jpg') have to be put under /web-app/css/img, with this setup the generated css file looks like this : background-image : url ('/css/img/blahblah.jpg'), it works and only works for now in this way.

However, the weird thing is I have my own css in less format with relative image path such as background-image : url ('../images/logo.png'), it is parsed and generated correctly.


Regards,

James



From: [hidden email]
Date: Thu, 1 Aug 2013 23:48:31 +0900
To: [hidden email]
Subject: Re: [grails-user] RE: Resource Plugin add 'resource' automatically to css background image url

Have you tried moving all your resources one level up? web-app folder? We usually don't put resources inside the web-inf folder

On Aug 1, 2013, at 10:29 PM, James Zhang <[hidden email]> wrote:

I play around with all setting in grails resources, include, exclude, adhoc but still no luck, finally I have to temporary copy all images from /img folder to /css/img, and use this

grails.resources.adhoc.patterns = ['/images/*','/img/*','/css/*','/js/*','/plugins/*'] to make it work for now. 

However, the war size is double up now due to duplicated images. 


Regards,

James



From: [hidden email]
To: [hidden email]
Subject: Resource Plugin add 'resource' automatically to css background image url
Date: Wed, 31 Jul 2013 01:38:58 -0400

Using compile ':resources:1.2.RC2', I am having a weird issue which drives me to crazy.

In my config I set 
grails.resources.adhoc.patterns = [
'/images/*',
'/img/**',
'/css/*',
'/js/*',
'/plugins/*'
]

In my CSS, I have a CSS class with background-image:url("../img/icons/slider-handle.png")
In my WEB-INF folder, I have icons folder under img folder, everything suppose to be fine, however, when I run-app in local, the background image url will be processed and updated to background-image:url("resource:/css/img/icons/slider-handle.png"). Additional string "resource" is added!

I have tried to play around the adhoc patterns but no luck at all.

Can anyone shed some light? Since I use CSS delivered by other party I can not easily to modify it. 

Regards,

James