Remove coroutines from connector-shared code
This commit is contained in:
parent
96e3c2e81c
commit
24709a9c4b
|
@ -276,8 +276,8 @@ Zotero.Connector_Debug = new function() {
|
||||||
/**
|
/**
|
||||||
* Call a callback with the lines themselves
|
* Call a callback with the lines themselves
|
||||||
*/
|
*/
|
||||||
this.get = Zotero.Promise.coroutine(function* (callback) {
|
this.get = function(callback) {
|
||||||
callback(yield Zotero.Debug.get());
|
Zotero.Debug.get().then(callback);
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -290,9 +290,9 @@ Zotero.Connector_Debug = new function() {
|
||||||
/**
|
/**
|
||||||
* Submit data to the server
|
* Submit data to the server
|
||||||
*/
|
*/
|
||||||
this.submitReport = Zotero.Promise.coroutine(function* (callback) {
|
this.submitReport = function(callback) {
|
||||||
var output = yield Zotero.Debug.get();
|
Zotero.Debug.get().then(function(output){
|
||||||
var req = yield Zotero.HTTP.request(
|
return Zotero.HTTP.request(
|
||||||
ZOTERO_CONFIG.REPOSITORY_URL + "report?debug=1",
|
ZOTERO_CONFIG.REPOSITORY_URL + "report?debug=1",
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -302,6 +302,7 @@ Zotero.Connector_Debug = new function() {
|
||||||
successCodes: false
|
successCodes: false
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
}).then(function(xmlhttp){
|
||||||
if (!xmlhttp.responseXML) {
|
if (!xmlhttp.responseXML) {
|
||||||
callback(false, 'Invalid response from server');
|
callback(false, 'Invalid response from server');
|
||||||
return;
|
return;
|
||||||
|
@ -315,4 +316,5 @@ Zotero.Connector_Debug = new function() {
|
||||||
var reportID = reported[0].getAttribute('reportID');
|
var reportID = reported[0].getAttribute('reportID');
|
||||||
callback(true, reportID);
|
callback(true, reportID);
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,7 +129,7 @@ Zotero.Debug = new function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
this.get = Zotero.Promise.coroutine(function* (maxChars, maxLineLength) {
|
this.get = Zotero.Promise.method(function(maxChars, maxLineLength) {
|
||||||
var output = _output;
|
var output = _output;
|
||||||
var total = output.length;
|
var total = output.length;
|
||||||
|
|
||||||
|
@ -159,10 +159,12 @@ Zotero.Debug = new function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Zotero.getErrors) {
|
if (Zotero.getErrors) {
|
||||||
|
return Zotero.getSystemInfo().then(function(sysInfo) {
|
||||||
return Zotero.getErrors(true).join('\n\n') +
|
return Zotero.getErrors(true).join('\n\n') +
|
||||||
"\n\n" + (yield Zotero.getSystemInfo()) + "\n\n" +
|
"\n\n" + sysInfo + "\n\n" +
|
||||||
"=========================================================\n\n" +
|
"=========================================================\n\n" +
|
||||||
output;
|
output;
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user