Add Zotero.File.getContentsFromURLAsync(url) for local text files
This commit is contained in:
parent
43978624de
commit
2b4de89aaf
1 changed files with 11 additions and 0 deletions
|
@ -216,6 +216,17 @@ Zotero.File = new function(){
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* Return a promise for the contents of a URL as a string
|
||||
*/
|
||||
this.getContentsFromURLAsync = function (url) {
|
||||
return Zotero.HTTP.promise("GET", url, { responseType: "text" })
|
||||
.then(function (xmlhttp) {
|
||||
return xmlhttp.response;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Write string to a file, overwriting existing file if necessary
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue