Remove unused WebDAV methods
This commit is contained in:
parent
276bb99fc9
commit
c5890a2479
1 changed files with 0 additions and 72 deletions
|
@ -729,78 +729,6 @@ Zotero.HTTP = new function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
// WebDAV methods
|
|
||||||
//
|
|
||||||
|
|
||||||
this.WebDAV = {};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Send a WebDAV MKCOL request via XMLHTTPRequest
|
|
||||||
*
|
|
||||||
* @param {nsIURI} url
|
|
||||||
* @param {Function} onDone
|
|
||||||
* @return {XMLHTTPRequest}
|
|
||||||
*/
|
|
||||||
this.WebDAV.doMkCol = function (uri, callback) {
|
|
||||||
// Don't display password in console
|
|
||||||
var disp = Zotero.HTTP.getDisplayURI(uri);
|
|
||||||
Zotero.debug("HTTP MKCOL " + disp.spec);
|
|
||||||
|
|
||||||
if (Zotero.HTTP.browserIsOffline()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
var xmlhttp = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"]
|
|
||||||
.createInstance();
|
|
||||||
// Prevent certificate/authentication dialogs from popping up
|
|
||||||
xmlhttp.mozBackgroundRequest = true;
|
|
||||||
xmlhttp.open('MKCOL', uri.spec, true);
|
|
||||||
var useMethodjit = Components.utils.methodjit;
|
|
||||||
/** @ignore */
|
|
||||||
xmlhttp.onreadystatechange = function() {
|
|
||||||
_stateChange(xmlhttp, callback);
|
|
||||||
};
|
|
||||||
xmlhttp.send(null);
|
|
||||||
return xmlhttp;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Send a WebDAV PUT request via XMLHTTPRequest
|
|
||||||
*
|
|
||||||
* @param {nsIURI} url
|
|
||||||
* @param {Function} onDone
|
|
||||||
* @return {XMLHTTPRequest}
|
|
||||||
*/
|
|
||||||
this.WebDAV.doDelete = function (uri, callback) {
|
|
||||||
// Don't display password in console
|
|
||||||
var disp = Zotero.HTTP.getDisplayURI(uri);
|
|
||||||
|
|
||||||
Zotero.debug("WebDAV DELETE to " + disp.spec);
|
|
||||||
|
|
||||||
if (Zotero.HTTP.browserIsOffline()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
var xmlhttp = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"]
|
|
||||||
.createInstance();
|
|
||||||
// Prevent certificate/authentication dialogs from popping up
|
|
||||||
xmlhttp.mozBackgroundRequest = true;
|
|
||||||
xmlhttp.open("DELETE", uri.spec, true);
|
|
||||||
// Firefox 3 throws a "no element found" error even with a
|
|
||||||
// 204 ("No Content") response, so we override to text
|
|
||||||
xmlhttp.overrideMimeType("text/plain");
|
|
||||||
var useMethodjit = Components.utils.methodjit;
|
|
||||||
/** @ignore */
|
|
||||||
xmlhttp.onreadystatechange = function() {
|
|
||||||
_stateChange(xmlhttp, callback);
|
|
||||||
};
|
|
||||||
xmlhttp.send(null);
|
|
||||||
return xmlhttp;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
this.isWriteMethod = function (method) {
|
this.isWriteMethod = function (method) {
|
||||||
return method == 'POST' || method == 'PUT' || method == 'PATCH' || method == 'DELETE';
|
return method == 'POST' || method == 'PUT' || method == 'PATCH' || method == 'DELETE';
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue