summaryrefslogtreecommitdiffstats
path: root/core/vendor
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-01-28 14:24:12 +0100
committerVincent Petry <pvince81@owncloud.com>2016-02-02 18:01:15 +0100
commit29386eccf96aec3e6a4c776f43e74c95474697bb (patch)
tree48675aa104747f87a6ebb1d4750cad13e434fde4 /core/vendor
parentd1518045ecdf4dd006224256b25b292a92b1202d (diff)
downloadnextcloud-server-29386eccf96aec3e6a4c776f43e74c95474697bb.tar.gz
nextcloud-server-29386eccf96aec3e6a4c776f43e74c95474697bb.zip
Add pagination support for comments GUI
Diffstat (limited to 'core/vendor')
-rw-r--r--core/vendor/davclient.js/lib/client.js29
1 files changed, 17 insertions, 12 deletions
diff --git a/core/vendor/davclient.js/lib/client.js b/core/vendor/davclient.js/lib/client.js
index 1a73c7db020..dbdfd3823e4 100644
--- a/core/vendor/davclient.js/lib/client.js
+++ b/core/vendor/davclient.js/lib/client.js
@@ -1,17 +1,17 @@
if (typeof dav == 'undefined') { dav = {}; };
dav._XML_CHAR_MAP = {
- '<': '&lt;',
- '>': '&gt;',
- '&': '&amp;',
- '"': '&quot;',
- "'": '&apos;'
+ '<': '&lt;',
+ '>': '&gt;',
+ '&': '&amp;',
+ '"': '&quot;',
+ "'": '&apos;'
};
dav._escapeXml = function(s) {
- return s.replace(/[<>&"']/g, function (ch) {
- return dav._XML_CHAR_MAP[ch];
- });
+ return s.replace(/[<>&"']/g, function (ch) {
+ return dav._XML_CHAR_MAP[ch];
+ });
};
dav.Client = function(options) {
@@ -79,17 +79,16 @@ dav.Client.prototype = {
return this.request('PROPFIND', url, headers, body).then(
function(result) {
- var resultBody = this.parseMultiStatus(result.body);
if (depth===0) {
return {
status: result.status,
- body: resultBody[0],
+ body: result.body[0],
xhr: result.xhr
};
} else {
return {
status: result.status,
- body: resultBody,
+ body: result.body,
xhr: result.xhr
};
}
@@ -161,6 +160,7 @@ dav.Client.prototype = {
*/
request : function(method, url, headers, body) {
+ var self = this;
var xhr = this.xhrProvider();
if (this.userName) {
@@ -182,8 +182,13 @@ dav.Client.prototype = {
return;
}
+ var resultBody = xhr.response;
+ if (xhr.status === 207) {
+ resultBody = self.parseMultiStatus(xhr.response);
+ }
+
fulfill({
- body: xhr.response,
+ body: resultBody,
status: xhr.status,
xhr: xhr
});