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

Commit

Permalink
v1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Steffan committed Mar 3, 2018
1 parent 78f5e05 commit ecd13de
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 39 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ $ npm install vue-resource
```

### CDN
Available on [jsdelivr](https://cdn.jsdelivr.net/npm/vue-resource@1.4.0), [unpkg](https://unpkg.com/vue-resource@1.4.0) or [cdnjs](https://cdnjs.com/libraries/vue-resource).
Available on [jsdelivr](https://cdn.jsdelivr.net/npm/vue-resource@1.5.0), [unpkg](https://unpkg.com/vue-resource@1.5.0) or [cdnjs](https://cdnjs.com/libraries/vue-resource).
```html
<script src="https://cdn.jsdelivr.net/npm/vue-resource@1.4.0"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-resource@1.5.0"></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.4.0",
"version": "1.5.0",
"description": "The HTTP client for Vue.js",
"homepage": "https://github.com/pagekit/vue-resource",
"license": "MIT",
Expand Down
32 changes: 21 additions & 11 deletions dist/vue-resource.common.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-resource v1.4.0
* vue-resource v1.5.0
* https://github.com/pagekit/vue-resource
* Released under the MIT License.
*/
Expand Down Expand Up @@ -1037,14 +1037,6 @@ function xhrClient (request) {

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

if (request.progress) {
if (request.method === 'GET') {
xhr.addEventListener('progress', request.progress);
} else if (/^(POST|PUT)$/i.test(request.method)) {
xhr.upload.addEventListener('progress', request.progress);
}
}

xhr.open(request.method, request.getUrl(), true);

if (request.timeout) {
Expand All @@ -1063,6 +1055,24 @@ function xhrClient (request) {
request.headers.set('X-Requested-With', 'XMLHttpRequest');
}

// deprecated use downloadProgress
if (isFunction(request.progress) && request.method === 'GET') {
xhr.addEventListener('progress', request.progress);
}

if (isFunction(request.downloadProgress)) {
xhr.addEventListener('progress', request.downloadProgress);
}

// deprecated use uploadProgress
if (isFunction(request.progress) && /^(POST|PUT)$/i.test(request.method)) {
xhr.upload.addEventListener('progress', request.progress);
}

if (isFunction(request.uploadProgress) && xhr.upload) {
xhr.upload.addEventListener('progress', request.uploadProgress);
}

request.headers.forEach(function (value, name) {
xhr.setRequestHeader(name, value);
});
Expand Down Expand Up @@ -1165,11 +1175,11 @@ function Client (context) {
return Client;
}

function sendRequest(request, resolve) {
function sendRequest(request) {

var client = request.client || (inBrowser ? xhrClient : nodeClient);

resolve(client(request));
return client(request);
}

/**
Expand Down
32 changes: 21 additions & 11 deletions dist/vue-resource.esm.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-resource v1.4.0
* vue-resource v1.5.0
* https://github.com/pagekit/vue-resource
* Released under the MIT License.
*/
Expand Down Expand Up @@ -1035,14 +1035,6 @@ function xhrClient (request) {

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

if (request.progress) {
if (request.method === 'GET') {
xhr.addEventListener('progress', request.progress);
} else if (/^(POST|PUT)$/i.test(request.method)) {
xhr.upload.addEventListener('progress', request.progress);
}
}

xhr.open(request.method, request.getUrl(), true);

if (request.timeout) {
Expand All @@ -1061,6 +1053,24 @@ function xhrClient (request) {
request.headers.set('X-Requested-With', 'XMLHttpRequest');
}

// deprecated use downloadProgress
if (isFunction(request.progress) && request.method === 'GET') {
xhr.addEventListener('progress', request.progress);
}

if (isFunction(request.downloadProgress)) {
xhr.addEventListener('progress', request.downloadProgress);
}

// deprecated use uploadProgress
if (isFunction(request.progress) && /^(POST|PUT)$/i.test(request.method)) {
xhr.upload.addEventListener('progress', request.progress);
}

if (isFunction(request.uploadProgress) && xhr.upload) {
xhr.upload.addEventListener('progress', request.uploadProgress);
}

request.headers.forEach(function (value, name) {
xhr.setRequestHeader(name, value);
});
Expand Down Expand Up @@ -1163,11 +1173,11 @@ function Client (context) {
return Client;
}

function sendRequest(request, resolve) {
function sendRequest(request) {

var client = request.client || (inBrowser ? xhrClient : nodeClient);

resolve(client(request));
return client(request);
}

/**
Expand Down
32 changes: 21 additions & 11 deletions dist/vue-resource.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-resource v1.4.0
* vue-resource v1.5.0
* https://github.com/pagekit/vue-resource
* Released under the MIT License.
*/
Expand Down Expand Up @@ -1041,14 +1041,6 @@ function xhrClient (request) {

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

if (request.progress) {
if (request.method === 'GET') {
xhr.addEventListener('progress', request.progress);
} else if (/^(POST|PUT)$/i.test(request.method)) {
xhr.upload.addEventListener('progress', request.progress);
}
}

xhr.open(request.method, request.getUrl(), true);

if (request.timeout) {
Expand All @@ -1067,6 +1059,24 @@ function xhrClient (request) {
request.headers.set('X-Requested-With', 'XMLHttpRequest');
}

// deprecated use downloadProgress
if (isFunction(request.progress) && request.method === 'GET') {
xhr.addEventListener('progress', request.progress);
}

if (isFunction(request.downloadProgress)) {
xhr.addEventListener('progress', request.downloadProgress);
}

// deprecated use uploadProgress
if (isFunction(request.progress) && /^(POST|PUT)$/i.test(request.method)) {
xhr.upload.addEventListener('progress', request.progress);
}

if (isFunction(request.uploadProgress) && xhr.upload) {
xhr.upload.addEventListener('progress', request.uploadProgress);
}

request.headers.forEach(function (value, name) {
xhr.setRequestHeader(name, value);
});
Expand Down Expand Up @@ -1169,11 +1179,11 @@ function Client (context) {
return Client;
}

function sendRequest(request, resolve) {
function sendRequest(request) {

var client = request.client || (inBrowser ? xhrClient : nodeClient);

resolve(client(request));
return client(request);
}

/**
Expand Down
Loading

0 comments on commit ecd13de

Please sign in to comment.