fix report function in exception dialog

This commit is contained in:
Andrew Dolgov 2011-03-18 14:31:54 +03:00
parent fb5662dec0
commit be2f5e1a44
1 changed files with 101 additions and 98 deletions

View File

@ -33,13 +33,21 @@ function exception_error(location, e, ext_info) {
var content = "<div class=\"fatalError\">" + var content = "<div class=\"fatalError\">" +
"<pre>" + msg + "</pre>"; "<pre>" + msg + "</pre>";
content += "<form name=\"exceptionForm\" id=\"exceptionForm\" target=\"_blank\" "+
"action=\"http://tt-rss.org/report.php\" method=\"POST\">";
content += "<textarea style=\"display : none\" name=\"message\">" + msg + "</textarea>";
content += "<textarea style=\"display : none\" name=\"params\">N/A</textarea>";
if (ext_info) { if (ext_info) {
content += "<div><b>Additional information:</b></div>" + content += "<div><b>Additional information:</b></div>" +
"<textarea readonly=\"1\">" + ext_info + "</textarea>"; "<textarea name=\"xinfo\" readonly=\"1\">" + ext_info + "</textarea>";
} }
content += "<div><b>Stack trace:</b></div>" + content += "<div><b>Stack trace:</b></div>" +
"<textarea readonly=\"1\">" + e.stack + "</textarea>"; "<textarea name=\"stack\" readonly=\"1\">" + e.stack + "</textarea>";
content += "</form>";
content += "</div>"; content += "</div>";
@ -61,19 +69,14 @@ function exception_error(location, e, ext_info) {
report: function() { 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."))) { 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({ document.forms['exceptionForm'].params.value = $H({
message: msg,
xinfo: ext_info,
stack: e.stack,
browserName: navigator.appName, browserName: navigator.appName,
browserVersion: navigator.appVersion, browserVersion: navigator.appVersion,
browserPlatform: navigator.platform, browserPlatform: navigator.platform,
browserCookies: navigator.cookieEnabled, browserCookies: navigator.cookieEnabled,
}); }).toQueryString();
var url = "http://tt-rss.org/report.php?" + params.toQueryString(); document.forms['exceptionForm'].submit();
window.open(url);
} }
}, },