Skip to content

Commit b779c5a

Browse files
committed
new chinese guide
1 parent a181708 commit b779c5a

61 files changed

Lines changed: 3011 additions & 41 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.DS_Store‎

6 KB
Binary file not shown.

‎book.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
{
2+
"plugins": [ "-mathjax"],
3+
"variables": {
4+
"reference": "https://regularjs.github.io/reference",
5+
"ref": "https://regularjs.github.io/reference"
6+
}
27
}

‎en/book.json‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"links": {
3+
"sidebar": {
4+
"\u27AD Github": "http://github.com/regularjs/regular",
5+
"\u27AD API and Syntax": "http://regularjs.github.io/reference"
6+
}
7+
8+
}
9+
}

‎gulpfile.js‎

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,67 @@ gulp.task('deploy', function () {
99
.on("error", function(err){
1010
console.log(err)
1111
})
12-
});
12+
});
13+
14+
15+
16+
<!--引入todomvc.css-->
17+
<link rel="stylesheet" href="https://rawgit.com/tastejs/todomvc-app-css/master/index.css">
18+
19+
<div id="todoapp"></div>
20+
21+
<footer id="info">
22+
<p>Double-click to edit a todo</p>
23+
<p>Created by @leeluolee</p>
24+
<p>
25+
Part of
26+
<a href="http://todomvc.com">TodoMVC</a>
27+
</p>
28+
</footer>
29+
30+
<script type='template/regular' id='todomvc'>
31+
<div>
32+
<h1>regular-todo</h1>
33+
<input id="new-todo" on-enter={ this.newTodo(editTodo) } placeholder="What needs to be done?" r-model={ editTodo }>
34+
</div>
35+
36+
{#if !!todos.length}
37+
<section id="main">
38+
39+
<input id="toggle-all" type="checkbox" name='toggle' r-model='allCompleted'>
40+
<label for="toggle-all">Mark all as complete</label>
41+
<ul id="todo-list">
42+
{#list this.getList(filter) as todo}
43+
<li r-class={ {'completed': todo.completed, 'editing': todo.editing} }>
44+
<div class="view">
45+
<input class="toggle" type="checkbox" r-model={ todo.completed }>
46+
<label on-dblclick={todo.editing = true}>{ todo.description }</label>
47+
<button on-click={ todos.splice(todo_index,1) } class="destroy"></button>
48+
</div>
49+
<input id="edit" class="edit"on-enter={ todo.editing = false } r-model={todo.description} autofocus></li>
50+
{/list}
51+
</ul>
52+
</section>
53+
<footer id="footer">
54+
<span id="todo-count"> <strong>{ activeLength }</strong>
55+
{ activeLength === 1 ? 'item' : 'items' } left
56+
</span>
57+
<ul id="filters">
58+
<li>
59+
<a class="{ filter === 'all'? 'selected' : '' }" href="javascript:;" on-click={filter='all'}>All</a>
60+
</li>
61+
<li>
62+
<a class="{ filter === 'active'? 'selected' : '' }" href='javascript:;' on-click={filter = 'active'}>Active</a>
63+
</li>
64+
<li>
65+
<a class="{ filter === 'completed'? 'selected' : '' }" href="javascript:;" on-click={filter = 'completed'}>Completed</a>
66+
</li>
67+
</ul>
68+
{#if completedLength}
69+
<button id="clear-completed" on-click={this.clearCompleted()} >Clear completed ({ completedLength })</button>
70+
{/if}
71+
</footer>
72+
{/if}
73+
</script>
74+
<!-- 引入regularjs -->
75+
<script src="https://rawgit.com/regularjs/regular/master/dist/regular.js"></script>

‎package.json‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
},
99
"author": "leeluolee <oe.zheng@gmail.com>",
1010
"dependencies": {
11-
"gulp-gh-pages": "^0.3.3",
12-
"gulp": "3.6.x"
11+
"gitbook-plugin-reveal": "0.0.3",
12+
"gulp": "3.6.x",
13+
"gulp-gh-pages": "^0.3.3"
1314
}
1415
}

‎zh/.DS_Store‎

6 KB
Binary file not shown.

‎zh/README.md‎

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,18 @@
11
# regularjs指南
22

3+
本书是[reguarljs](https://github.com/regularjs/regular)的官方指南, 会放一些重要但是无法放到API文档的资源.
34

4-
> <b>版本 0.3.0后regularjs 改变标签为 `{}`</b>, 你可以使用`Regular.config({BEGIN:'{{', END: '}}'})` 来返回到原语法
5+
## <b style='color:red;'>&#x26A0; 通知</b>
56

7+
- &#x2620;版本 0.3.0后regularjs 改变标签为 `{}`</b>, 你可以使用`Regular.config({BEGIN:'{{', END: '}}'})` 来返回到原语法
68

7-
regularjs是一个基于字符串模板的用于创建数据驱动的组件的类库, 相较于其它同类的基于字符串的模板引擎比如(mustache), regularjs在compile之后数据和dom仍然保持联系, 所以也称之为'live template engine'.
9+
- API接口说明已经移到统一的[Reference页面](http://regularjs.github.io/reference/?api-zh), 对应的模板语法说明移动到了[Syntax页面](http://regularjs.github.io/reference/?syntax-zh). 此页面只用来作为Guide使用
810

9-
regularjs的更高层次的目的是__规范有序(regular)__的去定义组件的业务逻辑. 它可以创建拥有独立生命周期的组件,从而可以__无缝的与任意框架集成__.
1011

1112

13+
### 指南命名约定
1214

13-
本书是[reguarljs](https://github.com/regularjs/regular)的官方指南, 会放置一些独立的指南.
14-
15-
16-
17-
## 你也许需要
18-
19-
* [API Reference](http://regularjs.github.io/api?api-zh)
20-
* [Syntax Reference](http://regularjs.github.io/api?syntax-zh)
21-
22-
-----------
23-
24-
__指南命名约定__
25-
26-
* __Component__ 指代所有Regular和继承自Regular的组件(Regular.extend)
15+
* __Component__ 指代所有Regular和继承自Regular的组件
2716
* __component(小写)__ 指代所有__Component__的实例
2817

2918

@@ -33,6 +22,3 @@ __指南命名约定__
3322

3423

3524

36-
37-
38-

‎zh/SUMMARY.md‎

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,53 @@
11
# Summary
22

3-
* [你好 Regular](getting-start/README.md)
3+
4+
- [你好, Regularjs](intro/README.md)
5+
- [Regularjs是什么](intro/what.md)
6+
- [◉ DEMO: HelloRegular](intro/hello-regularjs.md)
7+
- [指令与过滤器](basic/README.md)
8+
- [指令](basic/directive.md)
9+
- [过滤器](basic/filter.md)
10+
- [事件系统](events/README.md)
11+
- [Dom事件](events/dom.md)
12+
- [组件事件](events/component.md)
13+
- [组件系统(文档未完成)](component/README.md)
14+
- [动画系统(文档未完成)](animation/README.md)
15+
- [完整动画指南](animation/syntax.md)
16+
- [不同节点间的动画序列](animation/squence.md)
17+
- [如何优雅的管理你的模板](template/README.md)
18+
- [轻量级的模块化](modular/README.md)
19+
- [基于类的组件](modular/class.md)
20+
- [扩展/可见性](modular/extension.md)
21+
- [如何定义插件?](modular/plugin.md)
22+
- [小节](modular/review.md)
23+
- [重要概念(陆续更新)](concept/README.md)
24+
- [脏检查: 数据绑定的秘密](concept/dirty.md)
25+
- [组件生命周期](concept/lifecycle.md)
26+
- [一大波DEMO(陆续更新)](#)
27+
- [◉ 50行代码实现的todomvc](demo/todomvc.md)
28+
29+
<!--
30+
31+
- [内嵌组件的初始化](component/lifecycle.md)
32+
- [transclude: 内嵌内容](component/trasclude.md)
33+
- [◉ DEMO: 翻页器组件](guide/hello-regularjs.md)
34+
- [◉ DEMO: Grid组件](guide/hello-regularjs.md)
35+
- [◉ DEMO: Tab切换组件](guide/hello-regularjs.md)
36+
- [动画系统](animation/README.md)
37+
- [◉ DEMO: 多点动画衔接](guide/hello-regularjs.md)
38+
- [轻量级的模块化](modular/README.md)
39+
- [重要概念](concept/README.md)
40+
- [脏检查: 数据绑定的秘密](concept/dirty.md)
41+
- [销毁时发生了什么?](concept/lifecycle.md)
42+
- [何谓动态模板引擎?](concept/living-template.md)
43+
- [regularjs与热门框架的对比](concept/ractivejs.md)
44+
- [未来的regularjs](concept/future.md)
45+
- [Demo园](demo/README.md)
46+
- [50行代码实现的todomvc](guide/todomvc.md)
47+
- [转换为到polymer组件](guide/polymer.md)
48+
49+
-->
50+
51+
<!--
52+
- [利用transclude实现Tabs](guide/tabs.md)
53+
-->

‎zh/animation/README.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 动画系统
2+
3+
声明式的动画绝对是所有mvvm框架都面临的难点, 90%的框架都只处理了 节点进入退出的动画操作. regularjs的动画系统非常轻量级(代码量上), 但是毫无疑问的却是目前最具可扩展性/强大的实现, 眼见为实, 让我们看下它的过人之处吧.

‎zh/animation/squence.md‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# 不同节点间的动画序列联动
2+
3+
经过上节的学习, 我们发现regularjs
4+
5+
6+
有两个组合可以帮助我们结合regularjs中的另外两个概念实现不同节点间的动画联动
7+
8+
## 1. on/emit命令: 使用regularjs的事件系统完成联动
9+
10+
```html
11+
<div r-aniamtion
12+
```
13+
14+
15+
16+
17+
## 2. when/call命令: 使用数据监听体系完成动画联动
18+
19+
20+
21+
22+

0 commit comments

Comments
 (0)