Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pull #1

Merged
merged 82 commits into from
Aug 27, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
de23c41
fix nested event bug
leeluolee Nov 20, 2014
f1d90e9
push regularjs stand
leeluolee Nov 20, 2014
4a768dc
fix stopPropagation typo
leeluolee Nov 23, 2014
9b33ac3
radio set to other value, all radio should set to false
leeluolee Nov 23, 2014
61c1270
读取package.json不需要fs.read
jabez128 Nov 26, 2014
8ac4904
Merge pull request #22 from jabez128/master
leeluolee Nov 26, 2014
4aa7410
fix EXPR_OPEN when config { or [
leeluolee Dec 2, 2014
9e380e7
publish 0.2.14
leeluolee Dec 3, 2014
920d922
Merge branch 'master' of github.com:regularjs/regular
leeluolee Dec 3, 2014
34d1e6b
fix testcase runner stop at 173
leeluolee Dec 5, 2014
85946e0
fix the string-inteplation
leeluolee Dec 5, 2014
bfec642
add mute
leeluolee Dec 6, 2014
f855b09
change the node main.js
leeluolee Dec 6, 2014
6f6a0e6
add parse options
leeluolee Dec 8, 2014
db59fd9
add events handle in implement
leeluolee Dec 17, 2014
7beefba
remove log
leeluolee Dec 18, 2014
9deae30
fix nest {} when use custom End and Close
leeluolee Dec 23, 2014
e7d8a46
mute
leeluolee Dec 23, 2014
35a77cc
remove demo
leeluolee Jan 3, 2015
db3062f
remove r-content
leeluolee Jan 3, 2015
24c2ac8
forbid error in nested access
leeluolee Jan 3, 2015
3c400a6
remove undefined
leeluolee Jan 4, 2015
4cb3449
use $body as special include content
leeluolee Jan 4, 2015
8767792
branch v0.3.0
leeluolee Jan 4, 2015
ce551b8
0.3.0-pre
leeluolee Jan 4, 2015
5286e79
Merge branch 'syntax-change' into v0.3.0
leeluolee Jan 4, 2015
322370c
prevent nestundefined
leeluolee Jan 5, 2015
629bbf1
add two-way filter
leeluolee Jan 13, 2015
e1a4376
fix two way binding
leeluolee Jan 13, 2015
9e26173
push regularjs
leeluolee Jan 16, 2015
e74623c
remove filter
leeluolee Jan 17, 2015
70e7c79
remove filter
leeluolee Jan 17, 2015
08c7d99
animation
leeluolee Jan 17, 2015
a6eaa8f
add filter every
leeluolee Jan 18, 2015
2386827
add REAME.md
leeluolee Jan 18, 2015
8956d91
change REAME.md
leeluolee Jan 18, 2015
51af45a
README.md
leeluolee Jan 19, 2015
1eb0900
add jshint
leeluolee Jan 19, 2015
385c174
add selector length restrict to 16
leeluolee Jan 21, 2015
8d00c8f
make the name global
leeluolee Jan 22, 2015
d5f0725
add animation test
leeluolee Jan 25, 2015
f980ac4
model
leeluolee Jan 26, 2015
8740ed9
merge animation
leeluolee Jan 27, 2015
9993739
change model
leeluolee Jan 27, 2015
feb48dc
prepare for 0.3.0
leeluolee Jan 27, 2015
bcc61dc
add origin
leeluolee Jan 27, 2015
26cdfa7
fix #21
leeluolee Jan 27, 2015
0420486
change inejct
leeluolee Jan 29, 2015
a72779a
list rewrite with extra data
leeluolee Feb 1, 2015
6499f54
node env support
leeluolee Feb 1, 2015
c47a74d
delete
leeluolee Feb 1, 2015
77b4fac
first next
leeluolee Feb 2, 2015
d28ad86
prepare for requrejs-regular
leeluolee Feb 2, 2015
6bc8944
fix [] -> undefined error , in walkers.list
leeluolee Feb 11, 2015
ae8fcdd
add r-content support
leeluolee Feb 11, 2015
e0ecf08
add browser-nested.js
leeluolee Feb 11, 2015
a5d73e4
issue26
leeluolee Feb 11, 2015
bc43506
#fix list in list undestroy
leeluolee Feb 12, 2015
841ccd0
add list in list test case
leeluolee Feb 12, 2015
5751363
Change MIT
leeluolee Feb 13, 2015
b255000
add auto-detect in r-animation
leeluolee Feb 15, 2015
979d123
add $outer
leeluolee Feb 15, 2015
8072f00
fix String inteplate with quote
leeluolee Feb 15, 2015
c4fe238
make the $body can be initialize by new Regular
leeluolee Feb 15, 2015
dbe659c
add nested testcase
leeluolee Feb 16, 2015
da5f1ca
Merge branch 'issue26' into next
leeluolee Feb 16, 2015
1e721b6
add $config event
leeluolee Feb 18, 2015
0a8a48f
fix animate testcase
leeluolee Feb 26, 2015
e39d0b2
add tag
leeluolee Feb 26, 2015
c4006ec
Merge branch 'master' of github.com:regularjs/regular
leeluolee Feb 26, 2015
14d08d1
if with attribute in list can't got the extra param for inteplation
leeluolee Mar 6, 2015
1920cd4
change nested attribute bug
leeluolee Apr 17, 2015
7e79d66
add suport for $watch(fn)
leeluolee Jul 7, 2015
6b93a28
fix #40
leeluolee Jul 7, 2015
a98ef7f
fix #39
leeluolee Jul 7, 2015
648aee2
cached every group per loop
leeluolee Jul 9, 2015
2286475
fix extra deepClone
leeluolee Jul 11, 2015
1a7af20
add list-else
leeluolee Jul 11, 2015
dec70d2
make r-class and r-style accept unbraced string , like left: num+"px"
leeluolee Jul 11, 2015
b4bb6b5
Update README.md
infinnie Aug 22, 2015
f0c89a7
Update README.md
infinnie Aug 22, 2015
af0fea3
Merge pull request #47 from infinnie/master
leeluolee Aug 27, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ coverage*
out/*


.DS_Store
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(The MIT License)

Copyright (c) 2012-2014 zheng haibo(leeluolee). and regular contributors
Copyright (c) 2012-2015 NetEase, Inc. and regularjs contributors.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
118 changes: 79 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,25 @@
![regularjs](http://regularjs.github.io/image/regular-icon-100.png)
</a>

> <strong>After version 0.3.0: in Regularjs, the default TAG is changed from `{{}}` to the cleaner`{}`</strong>. However you can use `Regular.config({BEGIN:'{{', END: '}}'})` if the old syntax is needed.
# Regularjs


[![Build Status](http://img.shields.io/travis/regularjs/regular/master.svg?style=flat-square)](http://travis-ci.org/regularjs/regular)

> Regularjs is a __living template engine__ that helping us to create data-driven component.
> Regularjs is a __living template engine__ that helps us to create data-driven components.



## Features

- __String-based template__ make it flexible to build your component.
- __data-binding__ is based on dirty-check, angular experience also make sense to regularjs
- __self-contained and well encapsulation__, make it be easily integrated with other framework
- __composite component__ , using component as 'custom element'.
- __directive, filter, event and animation...__ all you need is provided out of box with __concise API__
- __String-based templates__ make it flexible to build your component;
- __data-binding__ based on dirty-check: the Angular-like experience also makes sense to regularjs;
- __self-contained and well-defined encapsulation__ makes it more easily integrated with other frameworks;
- __composite components__: components can be used as "custom elements";
- __directive, filter, event and animation...__ all you need is provided out of box with __concise API__.



Expand All @@ -29,8 +31,8 @@
```javascript
var Note = Regular.extend({
template:
"<input {{#if !disabled}} r-model='hello' {{#else}} disabled {{/if}} > {{hello}} \
<button on-click={{disabled = !disabled}}>{{disabled? 'active': 'disable'}} it</button>"
"<input {#if !disabled} r-model='hello' {#else} disabled {/if} > {hello} \
<button on-click={disabled = !disabled}>{disabled? 'active': 'disable'} it</button>"
})

// inject component into #app , you can also inject at 'before' , 'after', 'top'.
Expand All @@ -40,17 +42,17 @@ var note = new Note().$inject("#app");

__[Example1 on codepen.io](http://codepen.io/leeluolee/pen/JqAaH)__

the Example is dead simple, but you can find the directive and attribute is easily switched by statement 'if'. which is difficult with other mvvm framework.
the Example is dead simple, but you can find the directive and attribute is easily switched by statement 'if'. which is difficult with other mvvm frameworks.


### Example 2: __define a List Component__

```javascript
var NoteList = Regular.extend({
template:
"<ul>{{#list notes as nt}}" +
"<li class={{nt.done? 'done': ''}} on-click={{nt.done= !nt.done}}>{{nt.content}}</li>" +
"{{/list}}</ul>"
"<ul>{#list notes as nt}" +
"<li class={nt.done? 'done': ''} on-click={nt.done= !nt.done}>{{nt.content}}</li>" +
"{/list}</ul>"
});

var list = new NoteList({
Expand All @@ -60,20 +62,20 @@ var list = new NoteList({

```

In this Example, we create a ListView by statement `list`.
In this Example, we create a ListView by the statement `list`.

__[Example2 on codepen.io](http://codepen.io/leeluolee/pen/mAKlL)__


### Example 3: combine Note with NoteList

we need refactor Note to make it composable.
we need to refactor Note to make it composable.

```javascript
var Note = Regular.extend({
name: 'note', // register component during the definition of Component
template:
"<input r-model={{draft}} on-enter={{this.post()}}>",
"<input r-model={draft}> <button on-click={this.post()}> post</button>",
post: function(){
var data = this.data;
this.$emit('post', data.draft);
Expand All @@ -85,17 +87,17 @@ var Note = Regular.extend({
Regular.component('list', NoteList); // manual register a component

```
when 'Enter' is pressed, we emit a 'post' event with the `draft` as the $event object.
When 'Enter' is pressed, we emit a 'post' event with the `draft` as the $event object.

> the `this` in template is pointing to the component self.
> The keyword `this` in the template points to the component itself.
then, define Core Component: NoteApp.
Then, define the core component: NoteApp.

```javascript
var NoteApp = Regular.extend({
template:
"<note on-post={{notes.push({ content: $event} )}}/>"+
"<list notes = {{notes}}></list>"
"<note on-post={notes.push({ content: $event} )}/>"+
"<list notes ={notes}></list>"
})

var noteapp = new NoteApp({
Expand All @@ -106,7 +108,7 @@ noteapp.$inject('#app');

```

you can register a component(via attribute `name` or method `Component.component`) to make them composable in other component.
you can register a component (via attribute `name` or method `Component.component`) to make it composable in other components.

__[Example3 on codepen.io](http://codepen.io/leeluolee/pen/bqkLp)__

Expand All @@ -115,45 +117,83 @@ See more on [Guide: Quirk Start](http://regularjs.github.io/guide/en/getting-sta

## Resources

* __[regular's Offcial Guide](http://regularjs.github.io/guide/)__(use gitbook)
* __[Offcial Site ](http://regularjs.github.io)__
* __[demo on codepen.io](http://codepen.io/search?q=regularjs&limit=all&depth=everything&show_forks=false)__
* __[Reference ](http://regularjs.github.io/reference)__


## Browser Compatibility

IE7+ and other modern browser.
IE7+ and other modern browsers.

## Community

* If you find bugs or have suggestion, please feel free to open [an issue](https://github.com/regularjs/regular/issues)
## installation

* Ask any questions on [Stack Overflow](http://stackoverflow.com/questions/tagged/regularjs) with tag `regularjs`.
###bower

* Social
1. twitter: follow the [@regularjs](https://twitter.com/regularjs).
3. gitter: talk on [![Gitter chat](https://badges.gitter.im/regularjs/regular.png)](https://gitter.im/regularjs/regular)
2. weibo: [@拴萝卜的棍子](http://weibo.com/luobolee)
```javascript
bower install regularjs
```

## Contribute
`dist/regular.js` has been packaged as a standard UMD, and therefore you can use it in AMD, commonjs and global.

### npm (browserify or other based on commonjs)

__regularjs is still in heavily development__, helping us with feedback. there is some recommend to contributor.
```js
npm install regularjs
```

* Please [open issue](https://github.com/regularjs/regular/issues) before sending pull request,
* if needed, add your testcase at `test/specs` folder. always make sure the `gulp test` is passed, and the `test/runner/index.html` is passed in every target browser (if you doesn't have some browser installed that list in [gulpfile's karmaConfig](https://github.com/regularjs/regular/blob/master/gulpfile.js#L30))
use

```js
var Regular = require('regularjs');
```

## Who are use ?

1. [NetEase](https://github.com/NetEase) : operator of famous [www.163.com](http://www.163.com).
### component

```
component install regularjs/regular
```
use

```js
var Regular = require('regularjs/regular');
```



## LICENSE
### Direct download

[MIT](https://github.com/regularjs/regular/blob/master/LICENSE).
1. [regular.js](https://rawgit.com/regularjs/regular/master/dist/regular.js)
2. [regular.min.js](https://rawgit.com/regularjs/regular/master/dist/regular.min.js)


## Who are using?

1. [NetEase](https://github.com/NetEase): the operator of the famous website [www.163.com](http://www.163.com).



## Community

* If you find bugs or have suggestions, please feel free to open [an issue](https://github.com/regularjs/regular/issues)

* Ask any questions on [Stack Overflow](http://stackoverflow.com/questions/tagged/regularjs) with tag `regularjs`.

* Social
1. twitter: follow the [@regularjs](https://twitter.com/regularjs).
1. gitter: talk on [![Gitter chat](https://badges.gitter.im/regularjs/regular.png)](https://gitter.im/regularjs/regular)
1. weibo: [@拴萝卜的棍子](http://weibo.com/luobolee)

## Contribute

__regularjs is still in heavily development__, and please help us with feedback. Contributing to this project is also recommended.

* Please [open an issue](https://github.com/regularjs/regular/issues) before sending pull request,
* if needed, add your testcase at `test/specs` folder. always make sure the `gulp test` is passed, and the `test/runner/index.html` is passed in every target browser (if a certain browser is not installed, list that in [gulpfile's karmaConfig](https://github.com/regularjs/regular/blob/master/gulpfile.js#L30))



## LICENSE

[MIT](https://github.com/regularjs/regular/blob/master/LICENSE).
3 changes: 2 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "regularjs",
"version": "0.2.12",
"version": "0.3.1",
"main": "dist/regular.js",
"description": "reactjs + angularjs = regularjs",
"authors": "@leeluolee <[email protected]>",
Expand All @@ -10,6 +10,7 @@
"node_modules",
"bin",
"test",
"example",
"gulpfile.js",
"*.json",
"*.md"
Expand Down
3 changes: 2 additions & 1 deletion component.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "regularjs",
"version": "0.2.12",
"version": "0.3.1",
"main": "src/index.js",
"scripts": [
"src/Regular.js",
Expand All @@ -22,6 +22,7 @@
"src/helper/animate.js",
"src/helper/combine.js",
"src/helper/entities.js",
"src/helper/filter.js",
"src/directive/base.js",
"src/directive/form.js",
"src/directive/animation.js",
Expand Down
Loading