Skip to content

Commit

Permalink
0.6.0 - rename to VueJS
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Dec 8, 2013
1 parent cdd0716 commit 218557c
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 3,311 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
node_modules
components
explorations
test/seed.test.js
test/seed.test-cov.js
test/vue.test.js
test/vue.test-cov.js
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ components
node_modules
.jshintrc
.gitignore
.travis.yml
.sass-cache
.npmignore
bower.json
component.json
Gruntfile.js
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Seed.js
# VueJS

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

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

## Features

Expand All @@ -27,23 +27,23 @@ Modular & Lightweight JavaScript MVVM

**Component**

$ component install yyx990803/seed
$ component install yyx990803/vue

**Browserify**

$ npm install seed-mvvm
$ npm install vue

**Bower**

$ bower install seed
$ bower install vue

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

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

**Standalone**

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

## Development

Expand Down Expand Up @@ -74,20 +74,20 @@ $ grunt test
**HTML**

~~~ html
<div id="demo" sd-on="click:changeText">
<p sd-text="hello"></p>
<div id="demo" v-on="click:changeText">
<p v-text="hello"></p>
</div>
~~~

**JavaScript**

~~~ js
new Seed({
new Vue({
el: '#demo',
scope: {
hello: 'Hello World!',
changeText: function () {
this.hello = 'Hello Seed!'
this.hello = 'Hello VueJS!'
}
}
})
Expand Down
46 changes: 23 additions & 23 deletions dist/vue.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,23 +200,8 @@ require.relative = function(parent) {

return localRequire;
};
require.register("component-indexof/index.js", function(exports, require, module){
module.exports = function(arr, obj){
if (arr.indexOf) return arr.indexOf(obj);
for (var i = 0; i < arr.length; ++i) {
if (arr[i] === obj) return i;
}
return -1;
};
});
require.register("component-emitter/index.js", function(exports, require, module){

/**
* Module dependencies.
*/

var index = require('indexof');

/**
* Expose `Emitter`.
*/
Expand Down Expand Up @@ -257,7 +242,8 @@ function mixin(obj) {
* @api public
*/

Emitter.prototype.on = function(event, fn){
Emitter.prototype.on =
Emitter.prototype.addEventListener = function(event, fn){
this._callbacks = this._callbacks || {};
(this._callbacks[event] = this._callbacks[event] || [])
.push(fn);
Expand All @@ -283,7 +269,7 @@ Emitter.prototype.once = function(event, fn){
fn.apply(this, arguments);
}

fn._off = on;
on.fn = fn;
this.on(event, on);
return this;
};
Expand All @@ -300,7 +286,8 @@ Emitter.prototype.once = function(event, fn){

Emitter.prototype.off =
Emitter.prototype.removeListener =
Emitter.prototype.removeAllListeners = function(event, fn){
Emitter.prototype.removeAllListeners =
Emitter.prototype.removeEventListener = function(event, fn){
this._callbacks = this._callbacks || {};

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

// remove specific handler
var i = index(callbacks, fn._off || fn);
if (~i) callbacks.splice(i, 1);
var cb;
for (var i = 0; i < callbacks.length; i++) {
cb = callbacks[i];
if (cb === fn || cb.fn === fn) {
callbacks.splice(i, 1);
break;
}
}
return this;
};

Expand Down Expand Up @@ -548,9 +541,17 @@ try {
// unable to parse the dependency, thus preventing it from
// stopping the compilation after a failed lookup.
Emitter = require(componentEmitter)
} catch (e) {}
} catch (e) {
Emitter = require('events').EventEmitter
Emitter.prototype.off = function () {
var method = arguments.length > 1
? this.removeListener
: this.removeAllListeners
return method.apply(this, arguments)
}
}

module.exports = Emitter || require('events').EventEmitter
module.exports = Emitter
});
require.register("vue/src/config.js", function(exports, require, module){
module.exports = {
Expand Down Expand Up @@ -3170,7 +3171,6 @@ module.exports = {
});
require.alias("component-emitter/index.js", "vue/deps/emitter/index.js");
require.alias("component-emitter/index.js", "emitter/index.js");
require.alias("component-indexof/index.js", "component-emitter/deps/indexof/index.js");

require.alias("vue/src/main.js", "vue/index.js");if (typeof exports == "object") {
module.exports = require("vue");
Expand Down
2 changes: 1 addition & 1 deletion dist/vue.min.js

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions src/emitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ try {
// unable to parse the dependency, thus preventing it from
// stopping the compilation after a failed lookup.
Emitter = require(componentEmitter)
} catch (e) {}
} catch (e) {
Emitter = require('events').EventEmitter
Emitter.prototype.off = function () {
var method = arguments.length > 1
? this.removeListener
: this.removeAllListeners
return method.apply(this, arguments)
}
}

module.exports = Emitter || require('events').EventEmitter
module.exports = Emitter
3,272 changes: 0 additions & 3,272 deletions test/vue.test-cov.js

This file was deleted.

0 comments on commit 218557c

Please sign in to comment.