Created
October 7, 2011 15:31
-
-
Save tomaslin/1270541 to your computer and use it in GitHub Desktop.
Mapping UI-performance tags to resources tags
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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