]> git.wh0rd.org Git - tt-rss.git/commitdiff
use try/catch block in updatefeedlist
authorAndrew Dolgov <noreply@fakecake.org>
Sun, 5 Mar 2017 07:30:49 +0000 (10:30 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Sun, 5 Mar 2017 07:30:49 +0000 (10:30 +0300)
remove reporting function from exception dialog

css/tt-rss.css
js/functions.js
js/tt-rss.js

index b6469c09460b5adb336b33b24c8b801ff88698b0..b470931bdf1a3e1bc6e62c3d4d72ad09631ddb2d 100644 (file)
@@ -817,8 +817,8 @@ div.fatalError button {
 }
 
 div.fatalError textarea {
-       width : 100%;
-       height : 100px;
+       width : 565px;
+       height : 200px;
 }
 
 #ttrssMain #main {
index 134ce0b18f51ae2764e34d2c76e756de120d3011..ddb27cba156521e3498a85f84ca6e8c23f58bf70 100755 (executable)
@@ -55,34 +55,19 @@ function exception_error(e, e_compat) {
 
                var msg = e.toString();
 
-               msg += "<p>"+ __("The error will be reported to the configured log destination.") +
-                       "</p>";
-
                console.error(msg);
 
-               var content = "<div class=\"fatalError\">" +
-                       "<pre>" + msg + "</pre>";
-
-               content += "<form name=\"exceptionForm\" id=\"exceptionForm\" target=\"_blank\" "+
-                 "action=\"https://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>";
+               var content = "<div class='fatalError'><p>" + msg + "</p>";
 
-               if (e) {
+               if (e.stack) {
                        content += "<div><b>Stack trace:</b></div>" +
                                "<textarea name=\"stack\" readonly=\"1\">" + e.stack + "</textarea>";
                }
 
-               content += "</form>";
-
                content += "</div>";
 
                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>";
@@ -95,22 +80,6 @@ function exception_error(e, e_compat) {
                        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();
index ed305a8bbd9d19758fa9d4c7c390f1f4f60def93..244bbd8ed1530fcc314f143053f4cd02eb57a9d0 100644 (file)
@@ -41,72 +41,76 @@ function setActiveFeedId(id, is_cat) {
 
 
 function updateFeedList() {
+       try {
+               Element.show("feedlistLoading");
 
-       Element.show("feedlistLoading");
-
-       resetCounterCache();
-
-       if (dijit.byId("feedTree")) {
-               dijit.byId("feedTree").destroyRecursive();
-       }
-
-       var store = new dojo.data.ItemFileWriteStore({
-         url: "backend.php?op=pref_feeds&method=getfeedtree&mode=2"});
-
-       var treeModel = new fox.FeedStoreModel({
-               store: store,
-               query: {
-                       "type": getInitParam('enable_feed_cats') == 1 ? "category" : "feed"
-               },
-               rootId: "root",
-               rootLabel: "Feeds",
-               childrenAttrs: ["items"]
-       });
-
-       var tree = new fox.FeedTree({
-       model: treeModel,
-       onClick: function (item, node) {
-               var id = String(item.id);
-               var is_cat = id.match("^CAT:");
-               var feed = id.substr(id.indexOf(":")+1);
-               viewfeed({feed: feed, is_cat: is_cat});
-               return false;
-       },
-       openOnClick: false,
-       showRoot: false,
-       persist: true,
-       id: "feedTree",
-       }, "feedTree");
-
-/*             var menu = new dijit.Menu({id: 'feedMenu'});
-
-       menu.addChild(new dijit.MenuItem({
-          label: "Simple menu item"
-       }));
-
-//             menu.bindDomNode(tree.domNode); */
-
-       var tmph = dojo.connect(dijit.byId('feedMenu'), '_openMyself', function (event) {
-               console.log(dijit.getEnclosingWidget(event.target));
-               dojo.disconnect(tmph);
-       });
-
-       $("feeds-holder").appendChild(tree.domNode);
-
-       var tmph = dojo.connect(tree, 'onLoad', function() {
-               dojo.disconnect(tmph);
-               Element.hide("feedlistLoading");
-
-               try {
-                       feedlist_init();
+               resetCounterCache();
 
-                       loading_set_progress(25);
-               } catch (e) {
-                       exception_error(e);
+               if (dijit.byId("feedTree")) {
+                       dijit.byId("feedTree").destroyRecursive();
                }
-       });
 
-       tree.startup();
+               var store = new dojo.data.ItemFileWriteStore({
+                       url: "backend.php?op=pref_feeds&method=getfeedtree&mode=2"
+               });
+
+               var treeModel = new fox.FeedStoreModel({
+                       store: store,
+                       query: {
+                               "type": getInitParam('enable_feed_cats') == 1 ? "category" : "feed"
+                       },
+                       rootId: "root",
+                       rootLabel: "Feeds",
+                       childrenAttrs: ["items"]
+               });
+
+               var tree = new fox.FeedTree({
+                       model: treeModel,
+                       onClick: function (item, node) {
+                               var id = String(item.id);
+                               var is_cat = id.match("^CAT:");
+                               var feed = id.substr(id.indexOf(":") + 1);
+                               viewfeed({feed: feed, is_cat: is_cat});
+                               return false;
+                       },
+                       openOnClick: false,
+                       showRoot: false,
+                       persist: true,
+                       id: "feedTree",
+               }, "feedTree");
+
+               /*              var menu = new dijit.Menu({id: 'feedMenu'});
+
+                menu.addChild(new dijit.MenuItem({
+                label: "Simple menu item"
+                }));
+
+                //             menu.bindDomNode(tree.domNode); */
+
+               var tmph = dojo.connect(dijit.byId('feedMenu'), '_openMyself', function (event) {
+                       console.log(dijit.getEnclosingWidget(event.target));
+                       dojo.disconnect(tmph);
+               });
+
+               $("feeds-holder").appendChild(tree.domNode);
+
+               var tmph = dojo.connect(tree, 'onLoad', function () {
+                       dojo.disconnect(tmph);
+                       Element.hide("feedlistLoading");
+
+                       try {
+                               feedlist_init();
+
+                               loading_set_progress(25);
+                       } catch (e) {
+                               exception_error(e);
+                       }
+               });
+
+               tree.startup();
+       } catch (e) {
+               exception_error(e);
+       }
 }
 
 function catchupAllFeeds() {