Skip to content

Commit

Permalink
Release-v0.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Dec 24, 2013
1 parent 7fc537a commit 590a7ee
Show file tree
Hide file tree
Showing 6 changed files with 124 additions and 54 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue",
"version": "0.7.0",
"version": "0.7.1",
"main": "dist/vue.js",
"ignore": [
".*",
Expand Down
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue",
"version": "0.7.0",
"version": "0.7.1",
"main": "src/main.js",
"description": "Data-driven View Models",
"keywords": ["mvvm", "framework", "data binding"],
Expand Down
166 changes: 118 additions & 48 deletions dist/vue.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,15 @@ var config = require('./config'),
/**
* Set config options
*/
ViewModel.config = function (opts) {
if (opts) {
ViewModel.config = function (opts, val) {
if (typeof opts === 'string') {
if (val === undefined) {
return config[opts]
} else {
config[opts] = val
}
} else {
utils.extend(config, opts)
if (opts.prefix) updatePrefix()
}
return this
}
Expand Down Expand Up @@ -521,29 +526,6 @@ function mergeHook (fn, parentFn) {
}
}

/**
* Update prefix for some special directives
* that are used in compilation.
*/
var specialAttributes = [
'pre',
'text',
'repeat',
'partial',
'component',
'component-id',
'transition'
]

function updatePrefix () {
specialAttributes.forEach(setPrefix)
}

function setPrefix (attr) {
config.attrs[attr] = config.prefix + '-' + attr
}

updatePrefix()
module.exports = ViewModel
});
require.register("vue/src/emitter.js", function(exports, require, module){
Expand All @@ -569,16 +551,42 @@ try {
module.exports = Emitter
});
require.register("vue/src/config.js", function(exports, require, module){
module.exports = {
var prefix = 'v',
specialAttributes = [
'pre',
'text',
'repeat',
'partial',
'component',
'component-id',
'transition'
],
config = module.exports = {

async : true,
debug : false,
silent : false,
enterClass : 'v-enter',
leaveClass : 'v-leave',
attrs : {},

get prefix () {
return prefix
},
set prefix (val) {
prefix = val
updatePrefix()
}

}

prefix : 'v',
debug : false,
silent : false,
enterClass : 'v-enter',
leaveClass : 'v-leave',
attrs : {}

function updatePrefix () {
specialAttributes.forEach(function (attr) {
config.attrs[attr] = prefix + '-' + attr
})
}

updatePrefix()
});
require.register("vue/src/utils.js", function(exports, require, module){
var config = require('./config'),
Expand All @@ -588,10 +596,13 @@ var config = require('./config'),
console = window.console,
ViewModel // late def

var defer =
window.webkitRequestAnimationFrame ||
window.requestAnimationFrame ||
window.setTimeout
// PhantomJS doesn't support rAF, yet it has the global
// variable exposed. Use setTimeout so tests can work.
var defer = navigator.userAgent.indexOf('PhantomJS') > -1
? window.setTimeout
: (window.webkitRequestAnimationFrame ||
window.requestAnimationFrame ||
window.setTimeout)

/**
* Create a prototype-less object
Expand Down Expand Up @@ -771,7 +782,7 @@ var utils = module.exports = {
},

/**
* Defer DOM updates
* used to defer batch updates
*/
nextTick: function (cb) {
defer(cb, 0)
Expand Down Expand Up @@ -1586,6 +1597,9 @@ function getTargetVM (vm, path) {
module.exports = ViewModel
});
require.register("vue/src/binding.js", function(exports, require, module){
var batcher = require('./batcher'),
id = 0

/**
* Binding class.
*
Expand All @@ -1594,6 +1608,7 @@ require.register("vue/src/binding.js", function(exports, require, module){
* and multiple computed property dependents
*/
function Binding (compiler, key, isExp, isFn) {
this.id = id++
this.value = undefined
this.isExp = !!isExp
this.isFn = isFn
Expand All @@ -1603,6 +1618,7 @@ function Binding (compiler, key, isExp, isFn) {
this.instances = []
this.subs = []
this.deps = []
this.unbound = false
}

var BindingProto = Binding.prototype
Expand All @@ -1612,9 +1628,13 @@ var BindingProto = Binding.prototype
*/
BindingProto.update = function (value) {
this.value = value
batcher.queue(this, 'update')
}

BindingProto._update = function () {
var i = this.instances.length
while (i--) {
this.instances[i].update(value)
this.instances[i].update(this.value)
}
this.pub()
}
Expand All @@ -1624,6 +1644,10 @@ BindingProto.update = function (value) {
* Force all instances to re-evaluate themselves
*/
BindingProto.refresh = function () {
batcher.queue(this, 'refresh')
}

BindingProto._refresh = function () {
var i = this.instances.length
while (i--) {
this.instances[i].refresh()
Expand All @@ -1646,6 +1670,11 @@ BindingProto.pub = function () {
* Unbind the binding, remove itself from all of its dependencies
*/
BindingProto.unbind = function () {
// Indicate this has been unbound.
// It's possible this binding will be in
// the batcher's flush queue when its owner
// compiler has already been destroyed.
this.unbound = true
var i = this.instances.length
while (i--) {
this.instances[i].unbind()
Expand Down Expand Up @@ -2668,6 +2697,48 @@ function sniffTransitionEndEvent () {
}
}
});
require.register("vue/src/batcher.js", function(exports, require, module){
var config = require('./config'),
utils = require('./utils'),
queue, has, waiting

reset()

exports.queue = function (binding, method) {
if (!config.async) {
binding['_' + method]()
return
}
if (!has[binding.id]) {
queue.push({
binding: binding,
method: method
})
has[binding.id] = true
if (!waiting) {
waiting = true
utils.nextTick(flush)
}
}
}

function flush () {
for (var i = 0; i < queue.length; i++) {
var task = queue[i],
b = task.binding
if (b.unbound) continue
b['_' + task.method]()
has[b.id] = false
}
reset()
}

function reset () {
queue = []
has = utils.hash()
waiting = false
}
});
require.register("vue/src/directives/index.js", function(exports, require, module){
var utils = require('../utils'),
transition = require('../transition')
Expand Down Expand Up @@ -3143,15 +3214,14 @@ module.exports = {
try {
cursorPos = el.selectionStart
} catch (e) {}
// `input` event has weird updating issue with
// International (e.g. Chinese) input methods,
// have to use a Timeout to hack around it...
setTimeout(function () {
self.vm.$set(self.key, el[attr])
self.vm.$set(self.key, el[attr])
// since updates are async
// we need to reset cursor position async too
utils.nextTick(function () {
if (cursorPos !== undefined) {
el.setSelectionRange(cursorPos, cursorPos)
}
}, 0)
})
}
: function () {
// no filters, don't let it trigger update()
Expand All @@ -3166,9 +3236,9 @@ module.exports = {
if (isIE9) {
self.onCut = function () {
// cut event fires before the value actually changes
setTimeout(function () {
utils.nextTick(function () {
self.set()
}, 0)
})
}
self.onDel = function (e) {
if (e.keyCode === 46 || e.keyCode === 8) {
Expand Down
4 changes: 2 additions & 2 deletions dist/vue.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue",
"version": "0.7.0",
"version": "0.7.1",
"author": {
"name": "Evan You",
"email": "yyx990803@gmail.com",
Expand Down
2 changes: 1 addition & 1 deletion tasks/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = function (grunt) {
grunt.registerTask('release', function (version) {

var done = this.async(),
current = grunt.config('pkg.version'),
current = grunt.config('version'),
next = semver.inc(current, version || 'patch') || version

if (!semver.valid(next)) {
Expand Down

0 comments on commit 590a7ee

Please sign in to comment.