diff --git a/chrome/content/zotero/preferences/preferences.js b/chrome/content/zotero/preferences/preferences.js index cccc0864f..41c81ca85 100644 --- a/chrome/content/zotero/preferences/preferences.js +++ b/chrome/content/zotero/preferences/preferences.js @@ -1335,7 +1335,7 @@ Zotero_Preferences.Debug_Output = { var url = "https://repo.zotero.org/repo/report?debug=1"; var output = Zotero.Debug.get( - Zotero.Prefs.get('debug.store.submitLimit'), + Zotero.Prefs.get('debug.store.submitSize'), Zotero.Prefs.get('debug.store.submitLineLength') ); Zotero_Preferences.Debug_Output.setStore(false); diff --git a/chrome/content/zotero/xpcom/debug.js b/chrome/content/zotero/xpcom/debug.js index c1c58623e..2a1f07923 100644 --- a/chrome/content/zotero/xpcom/debug.js +++ b/chrome/content/zotero/xpcom/debug.js @@ -107,24 +107,36 @@ Zotero.Debug = new function () { } - this.get = function (limit, maxLength) { + this.get = function (maxChars, maxLineLength) { var output = _output; var total = output.length; - if (limit && limit < total) { - output = output.slice(limit * -1); + if (total == 0) { + return ""; } - if (maxLength) { + if (maxLineLength) { for (var i=0, len=output.length; i maxLength) { - output[i] = Zotero.Utilities.ellipsize(output[i], maxLength, true); + if (output[i].length > maxLineLength) { + output[i] = Zotero.Utilities.ellipsize(output[i], maxLineLength, true); } } } - return output.join('\n\n'); + output = output.join('\n\n'); + + if (maxChars) { + output = output.substr(maxChars * -1); + // Cut at two newlines + for (var i=1, len=output.length; i