From ba083651fa57c7bd19358701b0da17c354bcd564 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 6 Mar 2011 10:56:08 +0300 Subject: [PATCH] add code to report fatal exceptions to tt-rss.org --- functions.js | 31 ++++++++++++++++++++++++++++++- tt-rss.css | 3 +++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/functions.js b/functions.js index 88365d70..423b0b53 100644 --- a/functions.js +++ b/functions.js @@ -43,11 +43,40 @@ function exception_error(location, e, ext_info) { content += ""; - // TODO: add code to automatically report errors to tt-rss.org + content += "
"; + + content += " "; + content += ""; + content += "
"; + var dialog = new dijit.Dialog({ + id: "exceptionDlg", title: "Unhandled exception", style: "width: 600px", + report: function() { + if (confirm(__("Are you sure to report this exception to tt-rss.org? The report will include your browser information. Your IP would be saved in the database."))) { + + var params = $H({ + message: msg, + xinfo: ext_info, + stack: e.stack, + browserName: navigator.appName, + browserVersion: navigator.appVersion, + browserPlatform: navigator.platform, + browserCookies: navigator.cookieEnabled, + }); + + var url = "http://tt-rss.org/report.php?" + params.toQueryString(); + + window.open(url); + + } + }, content: content}); dialog.show(); diff --git a/tt-rss.css b/tt-rss.css index 928a5e94..e4661e83 100644 --- a/tt-rss.css +++ b/tt-rss.css @@ -1487,6 +1487,9 @@ div.hlUpdPic img { max-width : 16px; } +div.fatalError { + margin-bottom : 10px; +} div.fatalError button { margin-top : 5px; -- 2.39.5