]> git.wh0rd.org - tt-rss.git/blobdiff - js/functions.js
body: disable overflow
[tt-rss.git] / js / functions.js
index 9e40ecf51669ad17beb2a9576c08c0f1f6387be4..720a5654a95d73e4f8d15af0ed09817088499f47 100644 (file)
@@ -44,11 +44,8 @@ function exception_error(location, e, ext_info) {
 
        try {
 
-               if (ext_info) {
-                       if (ext_info.responseText) {
-                               ext_info = ext_info.responseText;
-                       }
-               }
+               if (ext_info)
+                       ext_info = JSON.stringify(ext_info);
 
                try {
                        new Ajax.Request("backend.php", {
@@ -88,6 +85,9 @@ function exception_error(location, e, ext_info) {
 
                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>";
@@ -100,6 +100,22 @@ function exception_error(location, e, ext_info) {
                        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 information about your web browser and tt-rss configuration. Your IP will be saved in the database."))) {
+
+                                       document.forms['exceptionForm'].params.value = $H({
+                                               browserName: navigator.appName,
+                                               browserVersion: navigator.appVersion,
+                                               browserPlatform: navigator.platform,
+                                               browserCookies: navigator.cookieEnabled,
+                                               ttrssVersion: __ttrss_version,
+                                               initParams: JSON.stringify(init_params),
+                                       }).toQueryString();
+
+                                       document.forms['exceptionForm'].submit();
+
+                               }
+                       },
                        content: content});
 
                dialog.show();
@@ -166,11 +182,6 @@ function param_unescape(arg) {
                return unescape(arg);
 }
 
-
-function hide_notify() {
-       Element.hide('notify');
-}
-
 function notify_real(msg, no_hide, n_type) {
 
        var n = $("notify");
@@ -182,12 +193,11 @@ function notify_real(msg, no_hide, n_type) {
        }
 
        if (msg == "") {
-               if (Element.visible(n)) {
-                       notify_hide_timerid = window.setTimeout("hide_notify()", 0);
+               if (n.hasClassName("visible")) {
+                       notify_hide_timerid = window.setTimeout(function() {
+                               n.removeClassName("visible") }, 0);
                }
                return;
-       } else {
-               Element.show(n);
        }
 
        /* types:
@@ -201,18 +211,18 @@ function notify_real(msg, no_hide, n_type) {
 
        msg = "<span class=\"msg\"> " + __(msg) + "</span>";
 
-       if (n_type == 1) {
-               n.className = "notify";
-       } else if (n_type == 2) {
-               n.className = "notify progress";
+       if (n_type == 2) {
+               n.className = "notify notify_progress visible";
                msg = "<span><img src='images/indicator_white.gif'></span>" + msg;
                no_hide = true;
        } else if (n_type == 3) {
-               n.className = "notify error";
+               n.className = "notify notify_error visible";
                msg = "<span><img src='images/alert.png'></span>" + msg;
        } else if (n_type == 4) {
-               n.className = "notify info";
+               n.className = "notify notify_info visible";
                msg = "<span><img src='images/information.png'></span>" + msg;
+       } else {
+               n.className = "notify visible";
        }
 
        msg += " <span><img src=\"images/cross.png\" class=\"close\" title=\"" +
@@ -223,7 +233,8 @@ function notify_real(msg, no_hide, n_type) {
        n.innerHTML = msg;
 
        if (!no_hide) {
-               notify_hide_timerid = window.setTimeout("hide_notify()", 5*1000);
+               notify_hide_timerid = window.setTimeout(function() {
+                               n.removeClassName("visible") }, 5*1000);
        }
 }
 
@@ -1277,10 +1288,8 @@ function backend_sanity_check_callback(transport) {
                        console.log('reading init-params...');
 
                        for (k in params) {
-                               var v = params[k];
-                               console.log("IP: " + k + " => " + v);
-
-                               if (k == "label_base_index") _label_base_index = parseInt(v);
+                               console.log("IP: " + k + " => " + JSON.stringify(params[k]));
+                               if (k == "label_base_index") _label_base_index = parseInt(params[k]);
                        }
 
                        init_params = params;