Permalink
Browse files

update juicer to 0.6.5-stable.

  • Loading branch information...
1 parent 8155ddb commit 011432510b23d32dbbb5bb96ec855e41f9f668ea @PaulGuo PaulGuo committed Apr 3, 2013
@@ -0,0 +1,106 @@
+Juicer Change History
+=====================
+
+
+0.4.0
+-----
+
+* Added `register` and `unregister` methods to manage the customed method.
+
+* Resolved `__escapehtml` global pollution.
+
+
+0.5.0
+-----
+
+* Added `#id` support for tpl parameter.
+
+* Support custom the tags by `juicer.set('tag::someTag', 'yourTag')`.
+
+* Fixed `each … range` bug that ranges are incorrect.
+
+0.5.1
+-----
+
+* Fixed `#id` support invalid bug because of `var document`.
+
+* Fixed `lexical analyze` bug (`Issue #3`), for example: `{@if a == b}` will throw b is undefined.
+
+0.5.2
+-----
+
+* Fixed `lexical analyze` bug (`Issue #4`), for example: `{@if a == true}` will throw `Unexpected token true`.
+
+* Fixed `lexical analyze` bug (`Issue #5`), for example: `{@else if a == b}` will throw a is undefined.
+
+0.5.3
+-----
+
+* Added `arguments support` when using helper function (`Pull #6`).
+
+* Added `Object each operation support`.
+
+0.5.4
+-----
+
+* Update `whitelist` for lexicalAnalyze.
+
+0.5.5
+-----
+
+* Fixed `window` is not defined warning under expressjs.
+* Added `expressjs` wrapper, and demo.
+
+0.5.6
+-----
+
+* Fixed `Object each operation` bug.
+
+0.5.7
+-----
+
+* Compatible for `avoid re-declare native function` for node.js.
+
+0.5.8
+-----
+
+* Fixed `varialble outer each statement environment` bug (`Issue #8`), for example: `{@each array as item}${item}{@/each}${item}`.
+
+0.5.9
+-----
+
+* avoid re-declare registered function, if not do this, template `{@if registered_func(name)}` could be throw undefined.
+
+0.6.0
+-----
+
+* fixed bug for Firefox 14.0.1 (`issue #9`, https://bugzilla.mozilla.org/show_bug.cgi?id=785822).
+* added adapter for expressjs-3.x.
+
+0.6.1
+-----
+
+* avoid re-analyze method statement variable.
+
+0.6.2
+-----
+
+* fixed bug that variable support in `each .. range` expression (`issue #16`).
+* added sub-template support using `{@include sub, data}`.
+
+0.6.3
+-----
+
+* update testcase of sub-template support.
+* added command line support for node.js, using for precompile the template files, `npm install -g juicer`.
+
+0.6.4
+-----
+
+* fixed bug that `if(console)` detection will throw error under some browser (like ie6).
+
+0.6.5
+-----
+
+* added `other helper types support`, not only the function type, but also can be object type, etc. fixed `variableAnalyze` for `object[variable]` statement.
+
@@ -0,0 +1,12 @@
+<project name="pagination.build" default="build" basedir=".">
+ <description>Component Build File</description>
+
+ <property name="src.dir" value="."/>
+ <property name="component.name" value="juicer"/>
+ <property name="component.version" value="1.3"/>
+
+ <import file="../../common.xml"/>
+
+ <target name="build" depends="common.build">
+ </target>
+</project>
@@ -0,0 +1,146 @@
+<!doctype html>
+<html>
+<head>
+ <meta charset="utf-8"/>
+ <title>KISSY gallery - Juicer</title>
+
+ <link rel="stylesheet" href="http://a.tbcdn.cn/s/kissy/1.3.0/css/dpl/base-min.css"/>
+ <link rel="stylesheet" href="../../../tools/skin/default.css"/>
+ <style>
+ h4 {
+ font-size: 14px;
+ font-weight: bold;
+ margin-bottom: 10px;
+ }
+ textarea {
+ border: 1px solid #BBBBBB;
+ font-family: Inconsolata,monaco,courier;
+ font-size: 12px;
+ height: 280px;
+ margin-bottom: 20px;
+ padding: 5px;
+ width: 800px;
+ }
+ </style>
+ <script src="http://a.tbcdn.cn/s/kissy/1.3.0/kissy.js" charset="utf-8"></script>
+ <script>
+ KISSY.config({
+ packages:[
+ {
+ name:"gallery",
+ tag:"20130403",
+ path:"../../../", // cdn上适当修改对应路径
+ charset:"utf-8"
+ }
+ ]
+ });
+ </script>
+ <link rel="stylesheet" href="../../../tools/skin/show-code.js"/>
+
+</head>
+<body>
+ <div id="header">
+ <h1 class="logo"><a alt="KISSY" href="http://kissyui.com/"><img src="http://a.tbcdn.cn/s/kissy/logo.png"/></a></h1>
+ <div class="sub-title">Gallery</div>
+ <ul class="navigation">
+ <li><a href="http://blog.kissyui.com/">博客</a></li>
+ <li><a href="http://github.com/kissyteam">源码</a></li>
+ </ul>
+
+ </div>
+ <div id="content">
+ <div class="s-crumbs">
+ <span>当前位置:</span>
+ <a href="http://kissyui.com/">KISSY</a>
+ <a href="../../../index.html">Gallery</a>
+ <span>Juicer</span>
+ </div>
+ <pre class="s-section">
+Author: liuhuo.gk@taobao.com (流火)
+Description:juicer is a lightweight javascript template engine, it’s fast and easy to use. it’s syntax like smarty, it can running either at browser or node.js
+Docs : <a href="http://juicer.name/docs/docs.html">doc</a>
+Source code: <a href="juicer.js">juicer.js</a></pre>
+
+ <h3 class="s-title">Demo - 使用 Juicer 渲染模版</h3>
+ <div class="s-section">
+ <div class="s-demo">
+ <div>
+
+<h4>Juicer 模版:</h4>
+
+<textarea id="template">
+<h1>${header}</h1>
+{@if bug}
+{@/if}
+{@each items as it}
+ {@if it.first}
+ <li><strong>${it.name}</strong></li>
+ {@/if}
+ {@if it.link}
+ <li><a href="${it.url}">${it.name}</a></li>
+ {@/if}
+{@/each}
+{@if empty}
+ <p>The list is empty.</p>
+{@/if}
+</textarea>
+
+<h4>JSON 数据:</h4>
+
+<textarea id="data">
+{
+ "header": "Colors",
+ "items": [
+ {"name": "red", "first": true, "url": "#Red"},
+ {"name": "green", "link": true, "url": "#Green"},
+ {"name": "blue", "link": true, "url": "#Blue"}
+ ],
+ "empty": false
+}
+</textarea>
+
+<h4>渲染结果:</h4>
+<pre id="juicer"></pre>
+
+ </div>
+
+ <script>
+ KISSY.use('gallery/juicer/1.3/',function(S, juicer){
+ var template = S.one('#template').html(),
+ data = S.JSON.parse(S.one('#data').html()),
+ html = juicer(template, data);
+
+ S.one('#juicer').html(html.replace(/^\s*/mg, ''));
+ });
+ </script>
+ </div>
+ <a class="s-view-code" href="demo.html#">显示源码</a><!--点击该链接自动帮你显示s=demo里的内容,如不需要,去除链接即可-->
+ </div>
+
+ <h3 class="s-title">API</h3>
+ <div class="s-section">
+ <h4 class="s-api-title">方法</h4>
+ <div class="s-api-method"> juicer(template,data)</div>
+ <h4 class="s-api-title">参数</h4>
+ <div class="s-api-params">
+ <ul class="s-list">
+ <li>{String} [ <em>template</em> ] 模版字符串</li>
+ <li>{JSON} [ <em>data</em> ] 模版数据</li>
+ </ul>
+ </div>
+ <h4 class="s-api-title">返回</h4>
+ <div class="s-api-return">{String} 渲染后的字符串</div>
+ </div>
+
+ <h3 class="s-title">Note</h3>
+ <div class="s-section">
+ <ul class="s-list">
+ <li>http://juicer.name/</li>
+ </ul>
+ </div>
+ </div>
+ <div id="footer">
+ &copy; Copyright 2010~2012, KISSY Team.
+ </div>
+</body>
+</html>
@@ -0,0 +1,5 @@
+KISSY.add("gallery/juicer/1.3/index",function(S, Juicer) {
+ return Juicer;
+}, {
+ requires:["./juicer"]
+});
Oops, something went wrong.

0 comments on commit 0114325

Please sign in to comment.