-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix bug: #30; add tag for play-rythm template engine
- Loading branch information
1 parent
bf1622b
commit d8a9883
Showing
8 changed files
with
60 additions
and
72 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
@args String type; | ||
@if ("js".equalsIgnoreCase(type)) </script> @ else if ("css".equalsIgnoreCase(type)) </style> @ | ||
#{verbatim} | ||
@args String type | ||
@("js".equalsIgnoreCase(type) ? "</script>" : ("css".equalsIgnoreCase(type) ? "</style>" : "" )) | ||
#{/verbatim} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,4 @@ | ||
#{verbatim} | ||
@args String nameList, Object output, boolean all, boolean deps, String media, String browser, String id, String charset, int priority; | ||
|
||
@{ | ||
if (null == nameList) nameList = _getAs("arg", String.class); | ||
String cacheKey = nameList + output + all + deps + media + browser + id + charset + priority; | ||
}@ | ||
|
||
@cacheOnProd(cacheKey, "1h") << | ||
@greenscript.gs_(nameList = nameList, output = output, all = all, deps = deps, media = media, browser = browser, id = id, charset = charset, priority = priority, type = "css") | ||
@ | ||
@greenscript.gs_(nameList = nameList, output = output, all = all, deps = deps, media = media, browser = browser, id = id, charset = charset, priority = priority, type = "css", _body = _body) | ||
#{/verbatim} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,47 @@ | ||
@import play.modules.greenscript.GreenScriptPlugin; | ||
@args String nameList, Object output, boolean all, boolean deps, String media, String browser, String id, String charset, int priority = 0, String type; | ||
@{ | ||
final com.greenscriptool.RenderSession sm = (com.greenscriptool.RenderSession)GreenScriptPlugin.session(type); | ||
if (null != nameList) { | ||
sm.declare(nameList, media, browser); | ||
} | ||
_logger.info("aaa"); | ||
|
||
all = all || "all".equals(output); | ||
deps = deps || "deps".equals(output); | ||
#{verbatim} | ||
@import play.modules.greenscript.GreenScriptPlugin | ||
@args String nameList, Object output, boolean all, boolean deps, String media, String browser, String id, String charset, int priority = 0, String type | ||
@{ | ||
final com.greenscriptool.RenderSession sm = (com.greenscriptool.RenderSession)GreenScriptPlugin.session(type); | ||
if (null != nameList) { | ||
sm.declare(nameList, media, browser); | ||
} | ||
|
||
boolean _output = all || deps || ((null != output) && ((output instanceof Boolean) ? (Boolean)output : !"false".equals(output.toString()))); | ||
}@ | ||
all = all || "all".equals(output); | ||
deps = deps || "deps".equals(output); | ||
|
||
@if (_output) | ||
@if (all) | ||
@// default browser with default media | ||
@greenscript.output_(nameList, deps = deps, all = all, media = null, browser = null, id = id, charset = charset, type = type, sm = sm) | ||
boolean _output = all || deps || ((null != output) && ((output instanceof Boolean) ? (Boolean)output : !"false".equals(output.toString()))); | ||
}@ | ||
|
||
@// default browser with non-default media | ||
@each String med: sm.getMedias(null) | ||
@greenscript.output_(nameList, deps = deps, all = all, media = med, browser = null, id = id, charset = charset, type = type, sm = sm) | ||
@ | ||
@if (_output) { | ||
@if (all) { | ||
@// default browser with default media | ||
@greenscript.output_(nameList, deps = deps, all = all, media = null, browser = null, id = id, charset = charset, type = type, sm = sm) | ||
|
||
@// non-default browsers | ||
@each String bro: sm.getBrowsers() | ||
@each String med: sm.getMedias(bro) | ||
@greenscript.output_(nameList, deps = deps, all = all, media = med, browser = bro, id = id, charset = charset, type = type, sm = sm) | ||
@ | ||
@ | ||
@ else | ||
@greenscript.output_(nameList, deps = deps, all = all, media = media, browser = browser, id = id, charset = charset, type = type, sm = sm) | ||
@ | ||
@ | ||
@// default browser with non-default media | ||
@each String med: sm.getMedias(null) { | ||
@greenscript.output_(nameList, deps = deps, all = all, media = med, browser = null, id = id, charset = charset, type = type, sm = sm) | ||
} | ||
|
||
@// handle inline code | ||
@// non-default browsers | ||
@each String bro: sm.getBrowsers() { | ||
@each String med: sm.getMedias(bro) { | ||
@greenscript.output_(nameList, deps = deps, all = all, media = med, browser = bro, id = id, charset = charset, type = type, sm = sm) | ||
} | ||
} | ||
} else { | ||
@greenscript.output_(nameList, deps = deps, all = all, media = media, browser = browser, id = id, charset = charset, type = type, sm = sm) | ||
} | ||
} | ||
|
||
@if (null != _body) | ||
@if (_output) | ||
@greenscript.openTag_(type) | ||
@_body | ||
@greenscript.closeTag_(type) | ||
@ else | ||
@{ sm.declareInline(_body.toString(), priority); }@ | ||
@ | ||
@ | ||
@// handle inline code | ||
@if (null != _body) { | ||
@if (_output) { | ||
@greenscript.openTag_(type) | ||
@_body | ||
@greenscript.closeTag_(type) | ||
} else { | ||
@{ sm.declareInline(_body.toString(), priority) }@ | ||
} | ||
} | ||
#{/verbatim} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
@import play.modules.greenscript.GreenScriptPlugin; | ||
#{verbatim} | ||
@import play.modules.greenscript.GreenScriptPlugin | ||
@args String nameList; | ||
|
||
@GreenScriptPlugin.lessImport(nameList) | ||
@GreenScriptPlugin.lessImport(nameList) | ||
#{/verbatim} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,4 @@ | ||
@args String nameList, Object output, boolean all, boolean deps, String media, String browser, String id, String charset, int priority; | ||
|
||
@{ | ||
if (null == nameList) nameList = _getAs("arg", String.class); | ||
String cacheKey = nameList + output + all + deps + media + browser + id + charset + priority; | ||
}@ | ||
|
||
@cacheOnProd(cacheKey, "1h") << | ||
@greenscript.gs_(nameList = nameList, output = output, all = all, deps = deps, media = media, browser = browser, id = id, charset = charset, priority = priority, type = "js") | ||
@ | ||
#{verbatim} | ||
@args String nameList, Object output, boolean all, boolean deps, String media, String browser, String id, String charset, int priority | ||
@greenscript.gs_(nameList = nameList, output = output, all = all, deps = deps, media = media, browser = browser, id = id, charset = charset, priority = priority, type = "js", _body = _body) | ||
#{/verbatim} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
#{verbatim} | ||
@args String type | ||
|
||
@if ("js".equalsIgnoreCase(type)) | ||
<script type="text/javascript"> | ||
@ else if ("css".equalsIgnoreCase(type)) | ||
<style type="text/css"> | ||
@ | ||
@("js".equalsIgnoreCase(type) ? "<script type=\"text/javascript\">" : ("css".equalsIgnoreCase(type) ? "<style type=\"text/css\">" : "" )) | ||
#{/verbatim} |
This file contains 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