Merge pull request #29964 from nextcloud/fix/ie-davclient

pull/29995/head
Pytal 3 years ago committed by GitHub
commit 6ea28a0d7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      core/js/dist/files_client.js
  2. 2
      core/js/dist/files_client.js.map
  3. 4
      core/js/dist/files_fileinfo.js
  4. 2
      core/js/dist/files_fileinfo.js.map
  5. 24
      core/js/dist/install.js
  6. 2
      core/js/dist/install.js.map
  7. 294
      core/js/dist/login.js
  8. 2
      core/js/dist/login.js.map
  9. 306
      core/js/dist/main.js
  10. 2
      core/js/dist/main.js.map
  11. 4
      core/js/dist/maintenance.js
  12. 2
      core/js/dist/maintenance.js.map
  13. 18
      core/js/dist/profile.js
  14. 2
      core/js/dist/profile.js.map
  15. 6
      core/js/dist/recommendedapps.js
  16. 2
      core/js/dist/recommendedapps.js.map
  17. 10
      core/js/dist/unified-search.js
  18. 2
      core/js/dist/unified-search.js.map
  19. 173
      core/src/files/iedavclient.js
  20. 1
      core/webpack.js
  21. 5
      lib/private/legacy/OC_Template.php

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

306
core/js/dist/main.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,173 +0,0 @@
/**
* Copyright (c) 2015
*
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/* eslint-disable */
(function(dav) {
/**
* Override davclient.js methods with IE-compatible logic
*/
dav.Client.prototype = _.extend({}, dav.Client.prototype, {
/**
* Performs a HTTP request, and returns a Promise
*
* @param {string} method HTTP method
* @param {string} url Relative or absolute url
* @param {Object} headers HTTP headers as an object.
* @param {string} body HTTP request body.
* @returns {Promise}
*/
request: function(method, url, headers, body) {
const self = this
const xhr = this.xhrProvider()
headers = headers || {}
if (this.userName) {
headers.Authorization = 'Basic ' + btoa(this.userName + ':' + this.password)
// xhr.open(method, this.resolveUrl(url), true, this.userName, this.password);
}
xhr.open(method, this.resolveUrl(url), true)
let ii
for (ii in headers) {
xhr.setRequestHeader(ii, headers[ii])
}
if (body === undefined) {
xhr.send()
} else {
xhr.send(body)
}
return new Promise(function(fulfill, reject) {
xhr.onreadystatechange = function() {
if (xhr.readyState !== 4) {
return
}
let resultBody = xhr.response
if (xhr.status === 207) {
resultBody = self.parseMultiStatus(xhr.responseXML)
}
fulfill({
body: resultBody,
status: xhr.status,
xhr: xhr,
})
}
xhr.ontimeout = function() {
reject(new Error('Timeout exceeded'))
}
})
},
_getElementsByTagName: function(node, name, resolver) {
const parts = name.split(':')
const tagName = parts[1]
const namespace = resolver(parts[0])
// make sure we can get elements
if (typeof node === 'string') {
const parser = new DOMParser()
node = parser.parseFromString(node, 'text/xml')
}
if (node.getElementsByTagNameNS) {
return node.getElementsByTagNameNS(namespace, tagName)
}
return node.getElementsByTagName(name)
},
/**
* Parses a multi-status response body.
*
* @param {string} xmlBody
* @param {Array}
*/
parseMultiStatus: function(doc) {
const result = []
const resolver = function(foo) {
let ii
for (ii in this.xmlNamespaces) {
if (this.xmlNamespaces[ii] === foo) {
return ii
}
}
}.bind(this)
const responses = this._getElementsByTagName(doc, 'd:response', resolver)
let i
for (i = 0; i < responses.length; i++) {
const responseNode = responses[i]
const response = {
href: null,
propStat: [],
}
const hrefNode = this._getElementsByTagName(responseNode, 'd:href', resolver)[0]
response.href = hrefNode.textContent || hrefNode.text
const propStatNodes = this._getElementsByTagName(responseNode, 'd:propstat', resolver)
let j = 0
for (j = 0; j < propStatNodes.length; j++) {
const propStatNode = propStatNodes[j]
const statusNode = this._getElementsByTagName(propStatNode, 'd:status', resolver)[0]
const propStat = {
status: statusNode.textContent || statusNode.text,
properties: [],
}
const propNode = this._getElementsByTagName(propStatNode, 'd:prop', resolver)[0]
if (!propNode) {
continue
}
let k = 0
for (k = 0; k < propNode.childNodes.length; k++) {
const prop = propNode.childNodes[k]
const value = this._parsePropNode(prop)
propStat.properties['{' + prop.namespaceURI + '}' + (prop.localName || prop.baseName)] = value
}
response.propStat.push(propStat)
}
result.push(response)
}
return result
},
})
})(dav)

@ -31,7 +31,6 @@ module.exports = [
entry: {
files_client: path.join(__dirname, 'src/files/client.js'),
files_fileinfo: path.join(__dirname, 'src/files/fileinfo.js'),
files_iedavclient: path.join(__dirname, 'src/files/iedavclient.js'),
install: path.join(__dirname, 'src/install.js'),
login: path.join(__dirname, 'src/login.js'),
main: path.join(__dirname, 'src/main.js'),

@ -120,11 +120,6 @@ class OC_Template extends \OC\Template\Base {
}
OC_Util::addScript('core', 'dist/main', true);
if (\OC::$server->getRequest()->isUserAgent([\OC\AppFramework\Http\Request::USER_AGENT_IE])) {
// shim for the davclient.js library
\OCP\Util::addScript('dist/files_iedavclient');
}
self::$initTemplateEngineFirstRun = false;
}
}

Loading…
Cancel
Save