Skip to content

Instantly share code, notes, and snippets.

@tomaslin
Created October 7, 2011 15:31
Show Gist options
  • Select an option

  • Save tomaslin/1270541 to your computer and use it in GitHub Desktop.

Select an option

Save tomaslin/1270541 to your computer and use it in GitHub Desktop.
Mapping UI-performance tags to resources tags
package com.flashsales.utils
// maps UI Performance tags to resources plugin tags
class ConvertUiPerformanceTagLib {
static namespace = 'p'
def css = { attrs ->
attrs.uri = "/css/${ attrs.remove( 'name' ) }.css"
attrs.type = 'css'
out << r.external( attrs )
}
def image = { attrs ->
attrs.uri = '/images' + attrs.remove( 'src' )
out << r.img( attrs )
}
def javascript = { attrs ->
attrs.uri = "/js/${ attrs.remove( 'src' ) }.js"
attrs.type = 'js'
out << r.external( attrs )
}
// TODO: imageLink, favicon, inputImage, sprite, dependantJavascript and addJavaScript
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment