-
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 tags for rythm template engine
- Loading branch information
1 parent
13d45f1
commit 473c2fc
Showing
15 changed files
with
115 additions
and
3 deletions.
There are no files selected for viewing
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
Binary file not shown.
Binary file renamed
BIN
+80.1 KB
java/core/lib/greenscript-core-1.2.6m.jar → java/core/lib/greenscript-core-1.2.7.jar
Binary file not shown.
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
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
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@args String type; | ||
@if ("js".equalsIgnoreCase(type)) </script> @ else if ("css".equalsIgnoreCase(type)) </style> @ |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@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") | ||
@ |
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 |
---|---|---|
@@ -0,0 +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); | ||
|
||
boolean _output = all || deps || ((null != output) && ((output instanceof Boolean) ? (Boolean)output : !"false".equals(output.toString()))); | ||
}@ | ||
|
||
@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) | ||
|
||
@// 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) | ||
@ | ||
|
||
@// 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) | ||
@ | ||
@ | ||
|
||
@// handle inline code | ||
|
||
@if (null != _body) | ||
@if (_output) | ||
@greenscript.openTag_(type) | ||
@_body.build() | ||
@greenscript.closeTag_(type) | ||
@ else | ||
@{ sm.declareInline(_body.toString(), priority); }@ | ||
@ | ||
@ |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@import play.modules.greenscript.GreenScriptPlugin; | ||
@args String nameList; | ||
|
||
@GreenScriptPlugin.lessImport(nameList) |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@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") | ||
@ |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@args String type | ||
|
||
@if ("js".equalsIgnoreCase(type)) | ||
<script type="text/javascript"> | ||
@ else if ("css".equalsIgnoreCase(type)) | ||
<style type="text/css"> | ||
@ |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
@args String nameList, Object output, boolean all, boolean deps, String media, String browser, String id, String charset, String type, com.greenscriptool.RenderSession sm; | ||
|
||
@if (!sm.isDefault(browser)) | ||
|
||
<!--[if @browser]> | ||
@ | ||
@each String sUrl: sm.output(nameList, deps, all, media, browser) | ||
@if("css".equals(type)) | ||
<link rel="stylesheet" type="text/css" media="@media" href="@sUrl"/> | ||
@ else | ||
<script type="text/javascript" src="@sUrl" @if (null != id && !"".equals(id)) id="@id" @ @if (null != charset && !"".equals(charset)) charset="@charset" @></script> | ||
@ | ||
@ | ||
@if (!sm.isDefault(browser)) | ||
<![endif]--> | ||
@ | ||
|
||
@{ String inline = all ? sm.outputInline().trim() : null; }@ | ||
@if (null != inline && !"".equals(inline)) | ||
@greenscript.openTag_(type) @inline.raw() @greenscript.closeTag_(type) | ||
@ |
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,4 @@ | ||
self: play -> greenscript 1.2.4b | ||
self: play -> greenscript 1.2.7 | ||
|
||
require: | ||
- play [1.2,) | ||
|
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 |
---|---|---|
|
@@ -53,6 +53,9 @@ | |
* Define a Playframework plugin | ||
* | ||
* @author [email protected] | ||
* @version 1.2.7 2012-01-31 | ||
* fix bug: https://github.com/greenlaw110/greenscript/issues/30 | ||
* Add tags for rythm engine | ||
* @version 1.2.6, 2011-09-04 | ||
* support LESS, | ||
* fix bug: https://github.com/greenlaw110/greenscript/issues/18 | ||
|
@@ -71,7 +74,7 @@ | |
*/ | ||
public class GreenScriptPlugin extends PlayPlugin { | ||
|
||
public static final String VERSION = "1.2.6m"; | ||
public static final String VERSION = "1.2.7"; | ||
|
||
private static String msg_(String msg, Object... args) { | ||
return String.format("GreenScript-" + VERSION + "> %1$s", | ||
|