Permalink
Browse files

Add imageQueryString option to WebKitCSSResourceCache#getTextureURL

Signed-off-by: Kazuki Sakamoto <sakamoto@splhack.org>
  • Loading branch information...
1 parent e58c8f2 commit 77adca18df46a68f35d151cbc5578292dc433032 @deardaniel deardaniel committed with splhack Mar 5, 2014
Showing with 3 additions and 1 deletion.
  1. +3 −1 coffee/webkitcss/lwf_webkitcss_resourcecache.coffee
@@ -39,6 +39,8 @@ class WebkitCSSResourceCache
getTextureURL:(settings, data, texture) ->
prefix = settings["imagePrefix"] ? settings["prefix"] ? ""
suffix = settings["imageSuffix"] ? ""
+ queryString = settings["imageQueryString"] ? ""
+ queryString = "?#{queryString}" if queryString.length > 0
imageMap = settings["imageMap"]
url = texture.filename
if typeof imageMap is 'function'
@@ -48,7 +50,7 @@ class WebkitCSSResourceCache
newUrl = imageMap[url]
url = newUrl if newUrl?
url = prefix + url unless url.match(/^\//)
- url = url.replace(/(\.gif|\.png|\.jpg)/i, suffix + "$1")
+ url = url.replace(/(\.gif|\.png|\.jpg)/i, suffix + "$1" + queryString)
return url
checkTextures:(settings, data) ->

0 comments on commit 77adca1

Please sign in to comment.