Skip to content

Commit 218557c

Browse files
committed
0.6.0 - rename to VueJS
1 parent cdd0716 commit 218557c

File tree

7 files changed

+50
-3311
lines changed

7 files changed

+50
-3311
lines changed

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
node_modules
44
components
55
explorations
6-
test/seed.test.js
7-
test/seed.test-cov.js
6+
test/vue.test.js
7+
test/vue.test-cov.js

.npmignore

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ components
66
node_modules
77
.jshintrc
88
.gitignore
9+
.travis.yml
10+
.sass-cache
11+
.npmignore
912
bower.json
1013
component.json
1114
Gruntfile.js

README.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Seed.js
1+
# VueJS
22

3-
Modular & Lightweight JavaScript MVVM
3+
Data-driven, modular & lightweight ViewModels
44

5-
[![Build Status](https://travis-ci.org/yyx990803/seed.png?branch=master)](https://travis-ci.org/yyx990803/seed)
5+
[![Build Status](https://travis-ci.org/yyx990803/vue.png?branch=master)](https://travis-ci.org/yyx990803/vue)
66

77
## Features
88

@@ -27,23 +27,23 @@ Modular & Lightweight JavaScript MVVM
2727

2828
**Component**
2929

30-
$ component install yyx990803/seed
30+
$ component install yyx990803/vue
3131

3232
**Browserify**
3333

34-
$ npm install seed-mvvm
34+
$ npm install vue
3535

3636
**Bower**
3737

38-
$ bower install seed
38+
$ bower install vue
3939

4040
**Module Loaders, e.g. RequireJS, SeaJS**
4141

4242
Built versions in `/dist` or installed via Bower can be used directly as a CommonJS or AMD module.
4343

4444
**Standalone**
4545

46-
Simply include a built version in `/dist` or installed via Bower with a script tag. `seed` will be registered as a global variable.
46+
Simply include a built version in `/dist` or installed via Bower with a script tag. `Vue` will be registered as a global variable.
4747

4848
## Development
4949

@@ -74,20 +74,20 @@ $ grunt test
7474
**HTML**
7575

7676
~~~ html
77-
<div id="demo" sd-on="click:changeText">
78-
<p sd-text="hello"></p>
77+
<div id="demo" v-on="click:changeText">
78+
<p v-text="hello"></p>
7979
</div>
8080
~~~
8181

8282
**JavaScript**
8383

8484
~~~ js
85-
new Seed({
85+
new Vue({
8686
el: '#demo',
8787
scope: {
8888
hello: 'Hello World!',
8989
changeText: function () {
90-
this.hello = 'Hello Seed!'
90+
this.hello = 'Hello VueJS!'
9191
}
9292
}
9393
})

dist/vue.js

+23-23
Original file line numberDiff line numberDiff line change
@@ -200,23 +200,8 @@ require.relative = function(parent) {
200200

201201
return localRequire;
202202
};
203-
require.register("component-indexof/index.js", function(exports, require, module){
204-
module.exports = function(arr, obj){
205-
if (arr.indexOf) return arr.indexOf(obj);
206-
for (var i = 0; i < arr.length; ++i) {
207-
if (arr[i] === obj) return i;
208-
}
209-
return -1;
210-
};
211-
});
212203
require.register("component-emitter/index.js", function(exports, require, module){
213204

214-
/**
215-
* Module dependencies.
216-
*/
217-
218-
var index = require('indexof');
219-
220205
/**
221206
* Expose `Emitter`.
222207
*/
@@ -257,7 +242,8 @@ function mixin(obj) {
257242
* @api public
258243
*/
259244

260-
Emitter.prototype.on = function(event, fn){
245+
Emitter.prototype.on =
246+
Emitter.prototype.addEventListener = function(event, fn){
261247
this._callbacks = this._callbacks || {};
262248
(this._callbacks[event] = this._callbacks[event] || [])
263249
.push(fn);
@@ -283,7 +269,7 @@ Emitter.prototype.once = function(event, fn){
283269
fn.apply(this, arguments);
284270
}
285271

286-
fn._off = on;
272+
on.fn = fn;
287273
this.on(event, on);
288274
return this;
289275
};
@@ -300,7 +286,8 @@ Emitter.prototype.once = function(event, fn){
300286

301287
Emitter.prototype.off =
302288
Emitter.prototype.removeListener =
303-
Emitter.prototype.removeAllListeners = function(event, fn){
289+
Emitter.prototype.removeAllListeners =
290+
Emitter.prototype.removeEventListener = function(event, fn){
304291
this._callbacks = this._callbacks || {};
305292

306293
// all
@@ -320,8 +307,14 @@ Emitter.prototype.removeAllListeners = function(event, fn){
320307
}
321308

322309
// remove specific handler
323-
var i = index(callbacks, fn._off || fn);
324-
if (~i) callbacks.splice(i, 1);
310+
var cb;
311+
for (var i = 0; i < callbacks.length; i++) {
312+
cb = callbacks[i];
313+
if (cb === fn || cb.fn === fn) {
314+
callbacks.splice(i, 1);
315+
break;
316+
}
317+
}
325318
return this;
326319
};
327320

@@ -548,9 +541,17 @@ try {
548541
// unable to parse the dependency, thus preventing it from
549542
// stopping the compilation after a failed lookup.
550543
Emitter = require(componentEmitter)
551-
} catch (e) {}
544+
} catch (e) {
545+
Emitter = require('events').EventEmitter
546+
Emitter.prototype.off = function () {
547+
var method = arguments.length > 1
548+
? this.removeListener
549+
: this.removeAllListeners
550+
return method.apply(this, arguments)
551+
}
552+
}
552553

553-
module.exports = Emitter || require('events').EventEmitter
554+
module.exports = Emitter
554555
});
555556
require.register("vue/src/config.js", function(exports, require, module){
556557
module.exports = {
@@ -3170,7 +3171,6 @@ module.exports = {
31703171
});
31713172
require.alias("component-emitter/index.js", "vue/deps/emitter/index.js");
31723173
require.alias("component-emitter/index.js", "emitter/index.js");
3173-
require.alias("component-indexof/index.js", "component-emitter/deps/indexof/index.js");
31743174

31753175
require.alias("vue/src/main.js", "vue/index.js");if (typeof exports == "object") {
31763176
module.exports = require("vue");

dist/vue.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/emitter.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ try {
77
// unable to parse the dependency, thus preventing it from
88
// stopping the compilation after a failed lookup.
99
Emitter = require(componentEmitter)
10-
} catch (e) {}
10+
} catch (e) {
11+
Emitter = require('events').EventEmitter
12+
Emitter.prototype.off = function () {
13+
var method = arguments.length > 1
14+
? this.removeListener
15+
: this.removeAllListeners
16+
return method.apply(this, arguments)
17+
}
18+
}
1119

12-
module.exports = Emitter || require('events').EventEmitter
20+
module.exports = Emitter

test/vue.test-cov.js

-3,272
This file was deleted.

0 commit comments

Comments
 (0)