From db598a8dfb272d5b9c4b9bfd32f3d4e7deb01389 Mon Sep 17 00:00:00 2001 From: Steffan Date: Thu, 16 Jul 2015 14:31:31 +0200 Subject: [PATCH] v0.1.10 --- bower.json | 2 +- dist/vue-resource.js | 34 ++++++++++++++++------------------ dist/vue-resource.min.js | 4 ++-- package.json | 2 +- 4 files changed, 20 insertions(+), 22 deletions(-) diff --git a/bower.json b/bower.json index fd65eaa0..6c2a7825 100644 --- a/bower.json +++ b/bower.json @@ -2,7 +2,7 @@ "name": "vue-resource", "main": "dist/vue-resource.js", "description": "A web request service for Vue.js", - "version": "0.1.9", + "version": "0.1.10", "homepage": "https://github.com/vuejs/vue-resource", "license": "MIT", "ignore": [ diff --git a/dist/vue-resource.js b/dist/vue-resource.js index 8c9169a6..d23c4ea3 100644 --- a/dist/vue-resource.js +++ b/dist/vue-resource.js @@ -1,5 +1,5 @@ /** - * vue-resource v0.1.9 + * vue-resource v0.1.10 * https://github.com/vuejs/vue-resource * Released under the MIT License. */ @@ -359,7 +359,7 @@ return /******/ (function(modules) { // webpackBootstrap } options = _.extend(true, {url: url}, - Http.options, _.options('http', this, options) + Http.options, _.options('http', self, options) ); if (options.crossOrigin === null) { @@ -378,7 +378,7 @@ return /******/ (function(modules) { // webpackBootstrap delete options.data; } - if (options.emulateHTTP && !option.crossOrigin && /^(put|patch|delete)$/i.test(options.method)) { + if (options.emulateHTTP && !options.crossOrigin && /^(put|patch|delete)$/i.test(options.method)) { options.headers['X-HTTP-Method-Override'] = options.method; options.method = 'post'; } @@ -396,7 +396,7 @@ return /******/ (function(modules) { // webpackBootstrap options.data = JSON.stringify(options.data); } - promise = (options.method.toLowerCase() == 'jsonp' ? jsonp : xhr).call(this, this.$url || Url, options); + promise = (options.method.toLowerCase() == 'jsonp' ? jsonp : xhr).call(self, self.$url || Url, options); promise.then(transformResponse, transformResponse); @@ -565,9 +565,13 @@ return /******/ (function(modules) { // webpackBootstrap * Promises/A+ polyfill v1.1.0 (https://github.com/bramstein/promis) */ + var RESOLVED = 0; + var REJECTED = 1; + var PENDING = 2; + function Promise(executor) { - this.state = Promise.State.PENDING; + this.state = PENDING; this.value = undefined; this.deferred = []; @@ -584,12 +588,6 @@ return /******/ (function(modules) { // webpackBootstrap } } - Promise.State = { - RESOLVED: 0, - REJECTED: 1, - PENDING: 2 - }; - Promise.reject = function (r) { return new Promise(function (resolve, reject) { reject(r); @@ -641,7 +639,7 @@ return /******/ (function(modules) { // webpackBootstrap p.resolve = function resolve(x) { var promise = this; - if (promise.state === Promise.State.PENDING) { + if (promise.state === PENDING) { if (x === promise) { throw new TypeError('Promise settled with itself.'); } @@ -672,7 +670,7 @@ return /******/ (function(modules) { // webpackBootstrap } return; } - promise.state = Promise.State.RESOLVED; + promise.state = RESOLVED; promise.value = x; promise.notify(); } @@ -681,12 +679,12 @@ return /******/ (function(modules) { // webpackBootstrap p.reject = function reject(reason) { var promise = this; - if (promise.state === Promise.State.PENDING) { + if (promise.state === PENDING) { if (reason === promise) { throw new TypeError('Promise settled with itself.'); } - promise.state = Promise.State.REJECTED; + promise.state = REJECTED; promise.value = reason; promise.notify(); } @@ -696,7 +694,7 @@ return /******/ (function(modules) { // webpackBootstrap var promise = this; async(function () { - if (promise.state !== Promise.State.PENDING) { + if (promise.state !== PENDING) { while (promise.deferred.length) { var deferred = promise.deferred.shift(), onResolved = deferred[0], @@ -705,13 +703,13 @@ return /******/ (function(modules) { // webpackBootstrap reject = deferred[3]; try { - if (promise.state === Promise.State.RESOLVED) { + if (promise.state === RESOLVED) { if (typeof onResolved === 'function') { resolve(onResolved.call(undefined, promise.value)); } else { resolve(promise.value); } - } else if (promise.state === Promise.State.REJECTED) { + } else if (promise.state === REJECTED) { if (typeof onRejected === 'function') { resolve(onRejected.call(undefined, promise.value)); } else { diff --git a/dist/vue-resource.min.js b/dist/vue-resource.min.js index db09544c..ddf851ae 100644 --- a/dist/vue-resource.min.js +++ b/dist/vue-resource.min.js @@ -1,7 +1,7 @@ /** - * vue-resource v0.1.9 + * vue-resource v0.1.10 * https://github.com/vuejs/vue-resource * Released under the MIT License. */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):"object"==typeof exports?exports.VueResource=e():t.VueResource=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){function r(t){t.url=n(1)(t),t.http=n(3)(t),t.resource=n(7)(t)}window.Vue&&Vue.use(r),t.exports=r},function(t,e,n){var r=n(2),o=document.createElement("a");t.exports=function(t){function e(t,n){var o,i={},s={},c=t;return r.isPlainObject(c)||(c={url:t,params:n}),c=r.extend({},e.options,r.options("url",this,c)),t=c.url.replace(/:([a-z]\w*)/gi,function(t,e){return c.params[e]?(i[e]=!0,a(c.params[e])):""}),"string"!=typeof c.root||t.match(/^(https?:)?\//)||(t=c.root+"/"+t),t=t.replace(/([^:])[\/]{2,}/g,"$1/"),t=t.replace(/(\w+)\/+$/,"$1"),r.each(c.params,function(t,e){i[e]||(s[e]=t)}),o=e.params(s),o&&(t+=(-1==t.indexOf("?")?"?":"&")+o),t}function n(t,e,o){var a,i=r.isArray(e),s=r.isPlainObject(e);r.each(e,function(e,c){a=r.isObject(e)||r.isArray(e),o&&(c=o+"["+(s||a?c:"")+"]"),!o&&i?t.add(e.name,e.value):a?n(t,e,c):t.add(c,e)})}function a(t){return i(t,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function i(t,e){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,e?"%20":"+")}return e.options={url:"",params:{}},e.params=function(t){var e=[];return e.add=function(t,e){r.isFunction(e)&&(e=e()),null===e&&(e=""),this.push(a(t)+"="+a(e))},n(e,t),e.join("&")},e.parse=function(t){return o.href=t,{href:o.href,protocol:o.protocol?o.protocol.replace(/:$/,""):"",port:o.port,host:o.host,hostname:o.hostname,pathname:"/"===o.pathname.charAt(0)?o.pathname:"/"+o.pathname,search:o.search?o.search.replace(/^\?/,""):"",hash:o.hash?o.hash.replace(/^#/,""):""}},Object.defineProperty(t.prototype,"$url",{get:function(){return r.extend(e.bind(this),e)}}),e}},function(t,e){function n(t,e,o){for(var a in e)o&&(r.isPlainObject(e[a])||r.isArray(e[a]))?(r.isPlainObject(e[a])&&!r.isPlainObject(t[a])&&(t[a]={}),r.isArray(e[a])&&!r.isArray(t[a])&&(t[a]=[]),n(t[a],e[a],o)):void 0!==e[a]&&(t[a]=e[a])}var r=e;r.isArray=Array.isArray,r.isFunction=function(t){return t&&"function"==typeof t},r.isObject=function(t){return null!==t&&"object"==typeof t},r.isPlainObject=function(t){return"[object Object]"===Object.prototype.toString.call(t)},r.options=function(t,e,n){var o=e.$options||{};return r.extend({},o[t],n)},r.each=function(t,e){var n,o;if("number"==typeof t.length)for(n=0;n=200&&this.status<300?n(this):o(this))},a.send(e.data)}),r.extend(n,{abort:function(){a.abort()}}),n}},function(t,e){function n(t){this.state=n.State.PENDING,this.value=void 0,this.deferred=[];var e=this;try{t(function(t){e.resolve(t)},function(t){e.reject(t)})}catch(r){e.reject(r)}}n.State={RESOLVED:0,REJECTED:1,PENDING:2},n.reject=function(t){return new n(function(e,n){n(t)})},n.resolve=function(t){return new n(function(e,n){e(t)})},n.all=function(t){return new n(function(e,n){function r(n){return function(r){a[n]=r,o+=1,o===t.length&&e(a)}}var o=0,a=[];0===t.length&&e(a);for(var i=0;i=200&&this.status<300?n(this):o(this))},a.send(e.data)}),r.extend(n,{abort:function(){a.abort()}}),n}},function(t,e){function n(t){this.state=a,this.value=void 0,this.deferred=[];var e=this;try{t(function(t){e.resolve(t)},function(t){e.reject(t)})}catch(n){e.reject(n)}}var r=0,o=1,a=2;n.reject=function(t){return new n(function(e,n){n(t)})},n.resolve=function(t){return new n(function(e,n){e(t)})},n.all=function(t){return new n(function(e,n){function r(n){return function(r){a[n]=r,o+=1,o===t.length&&e(a)}}var o=0,a=[];0===t.length&&e(a);for(var i=0;i