Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Commit

Permalink
v1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
steffans committed Sep 23, 2016
1 parent 4adbc27 commit 393211a
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 45 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ $ bower install vue-resource
```

### CDN
Available on [jsdelivr](https://cdn.jsdelivr.net/vue.resource/1.0.2/vue-resource.min.js), [cdnjs](https://cdnjs.com/libraries/vue-resource) or [unpkg](https://unpkg.com/[email protected].2/dist/vue-resource.min.js).
Available on [jsdelivr](https://cdn.jsdelivr.net/vue.resource/1.0.3/vue-resource.min.js), [cdnjs](https://cdnjs.com/libraries/vue-resource) or [unpkg](https://unpkg.com/[email protected].3/dist/vue-resource.min.js).
```html
<script src="https://cdn.jsdelivr.net/vue.resource/1.0.2/vue-resource.min.js"></script>
<script src="https://cdn.jsdelivr.net/vue.resource/1.0.3/vue-resource.min.js"></script>
```

## Example
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vue-resource",
"main": "dist/vue-resource.js",
"version": "1.0.2",
"version": "1.0.3",
"description": "The HTTP client for Vue.js",
"homepage": "https://github.com/vuejs/vue-resource",
"license": "MIT",
Expand Down
33 changes: 20 additions & 13 deletions dist/vue-resource.common.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-resource v1.0.2
* vue-resource v1.0.3
* https://github.com/vuejs/vue-resource
* Released under the MIT License.
*/
Expand Down Expand Up @@ -770,25 +770,30 @@ function xdrClient (request) {
return new PromiseObj(function (resolve) {

var xdr = new XDomainRequest(),
handler = function (event) {
handler = function (_ref) {
var type = _ref.type;

var response = request.respondWith(xdr.responseText, {
status: xdr.status,
statusText: xdr.statusText
});

resolve(response);
var status = 0;

if (type === 'load') {
status = 200;
} else if (type === 'error') {
status = 500;
}

resolve(request.respondWith(xdr.responseText, { status: status }));
};

request.abort = function () {
return xdr.abort();
};

xdr.open(request.method, request.getUrl(), true);
xdr.open(request.method, request.getUrl());
xdr.timeout = 0;
xdr.onload = handler;
xdr.onerror = handler;
xdr.ontimeout = function () {};
xdr.ontimeout = handler;
xdr.onprogress = function () {};
xdr.send(request.getBody());
});
Expand Down Expand Up @@ -889,14 +894,16 @@ function jsonpClient (request) {
handler,
script;

handler = function (event) {
handler = function (_ref) {
var type = _ref.type;


var status = 0;

if (event.type === 'load' && body !== null) {
if (type === 'load' && body !== null) {
status = 200;
} else if (event.type === 'error') {
status = 404;
} else if (type === 'error') {
status = 500;
}

resolve(request.respondWith(body, { status: status }));
Expand Down
33 changes: 20 additions & 13 deletions dist/vue-resource.es2015.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-resource v1.0.2
* vue-resource v1.0.3
* https://github.com/vuejs/vue-resource
* Released under the MIT License.
*/
Expand Down Expand Up @@ -768,25 +768,30 @@ function xdrClient (request) {
return new PromiseObj(function (resolve) {

var xdr = new XDomainRequest(),
handler = function (event) {
handler = function (_ref) {
var type = _ref.type;

var response = request.respondWith(xdr.responseText, {
status: xdr.status,
statusText: xdr.statusText
});

resolve(response);
var status = 0;

if (type === 'load') {
status = 200;
} else if (type === 'error') {
status = 500;
}

resolve(request.respondWith(xdr.responseText, { status: status }));
};

request.abort = function () {
return xdr.abort();
};

xdr.open(request.method, request.getUrl(), true);
xdr.open(request.method, request.getUrl());
xdr.timeout = 0;
xdr.onload = handler;
xdr.onerror = handler;
xdr.ontimeout = function () {};
xdr.ontimeout = handler;
xdr.onprogress = function () {};
xdr.send(request.getBody());
});
Expand Down Expand Up @@ -887,14 +892,16 @@ function jsonpClient (request) {
handler,
script;

handler = function (event) {
handler = function (_ref) {
var type = _ref.type;


var status = 0;

if (event.type === 'load' && body !== null) {
if (type === 'load' && body !== null) {
status = 200;
} else if (event.type === 'error') {
status = 404;
} else if (type === 'error') {
status = 500;
}

resolve(request.respondWith(body, { status: status }));
Expand Down
33 changes: 20 additions & 13 deletions dist/vue-resource.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-resource v1.0.2
* vue-resource v1.0.3
* https://github.com/vuejs/vue-resource
* Released under the MIT License.
*/
Expand Down Expand Up @@ -774,25 +774,30 @@ function xdrClient (request) {
return new PromiseObj(function (resolve) {

var xdr = new XDomainRequest(),
handler = function (event) {
handler = function (_ref) {
var type = _ref.type;

var response = request.respondWith(xdr.responseText, {
status: xdr.status,
statusText: xdr.statusText
});

resolve(response);
var status = 0;

if (type === 'load') {
status = 200;
} else if (type === 'error') {
status = 500;
}

resolve(request.respondWith(xdr.responseText, { status: status }));
};

request.abort = function () {
return xdr.abort();
};

xdr.open(request.method, request.getUrl(), true);
xdr.open(request.method, request.getUrl());
xdr.timeout = 0;
xdr.onload = handler;
xdr.onerror = handler;
xdr.ontimeout = function () {};
xdr.ontimeout = handler;
xdr.onprogress = function () {};
xdr.send(request.getBody());
});
Expand Down Expand Up @@ -893,14 +898,16 @@ function jsonpClient (request) {
handler,
script;

handler = function (event) {
handler = function (_ref) {
var type = _ref.type;


var status = 0;

if (event.type === 'load' && body !== null) {
if (type === 'load' && body !== null) {
status = 200;
} else if (event.type === 'error') {
status = 404;
} else if (type === 'error') {
status = 500;
}

resolve(request.respondWith(body, { status: status }));
Expand Down
Loading

0 comments on commit 393211a

Please sign in to comment.