]> git.wh0rd.org Git - tt-rss.git/commitdiff
add code to report fatal exceptions to tt-rss.org
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sun, 6 Mar 2011 07:56:08 +0000 (10:56 +0300)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sun, 6 Mar 2011 07:56:08 +0000 (10:56 +0300)
functions.js
tt-rss.css

index 88365d70a555df4bbde50c7e37eba40f487d22de..423b0b539132979996441213dfcd1c0f87f62fe3 100644 (file)
@@ -43,11 +43,40 @@ function exception_error(location, e, ext_info) {
 
                content += "</div>";
 
-               // TODO: add code to automatically report errors to tt-rss.org
+               content += "<div class='dlgButtons'>";
+
+               content += "<button dojoType=\"dijit.form.Button\""+
+                               "onclick=\"dijit.byId('exceptionDlg').report()\">" +
+                               __('Report to tt-rss.org') + "</button> ";
+               content += "<button dojoType=\"dijit.form.Button\" "+
+                               "onclick=\"dijit.byId('exceptionDlg').hide()\">" + 
+                               __('Close') + "</button>";
+               content += "</div>";
+
 
                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();
index 928a5e94fa55b73c94ef6bb9971f718890046a43..e4661e83922c26849a0eb504d1e23a6018df5d80 100644 (file)
@@ -1487,6 +1487,9 @@ div.hlUpdPic img {
        max-width : 16px;
 }
 
+div.fatalError {
+       margin-bottom : 10px;
+}
 
 div.fatalError button {
        margin-top : 5px;