]> git.wh0rd.org - tt-rss.git/blobdiff - js/tt-rss.js
sorta-kinda fix the feedlist
[tt-rss.git] / js / tt-rss.js
index 96147b3d3a8baacdd87eab73ac8d8df35ed13677..a4c67bfcccfc76b93f10c404338a44acac6d5c87 100644 (file)
@@ -5,7 +5,6 @@ var _active_feed_id = 0;
 var _active_feed_is_cat = false;
 var hotkey_prefix = false;
 var hotkey_prefix_pressed = false;
-var init_params = {};
 var _force_scheduled_update = false;
 var last_scheduled_update = false;
 
@@ -62,12 +61,12 @@ function updateFeedList() {
                }
 
                var store = new dojo.data.ItemFileWriteStore({
-         url: "backend.php?op=feeds"});
+         url: "backend.php?op=pref_feeds&method=getfeedtree&mode=2"});
 
                var treeModel = new fox.FeedStoreModel({
                        store: store,
                        query: {
-                               "type": "feed"
+                               "type": init_params['enable_feed_cats'] == 1 ? "category" : "feed"
                        },
                        rootId: "root",
                        rootLabel: "Feeds",
@@ -106,6 +105,8 @@ function updateFeedList() {
                id: "feedTree",
                }, "feedTree");
 
+               _force_scheduled_update = true;
+
 /*             var menu = new dijit.Menu({id: 'feedMenu'});
 
                menu.addChild(new dijit.MenuItem({
@@ -222,7 +223,7 @@ function timeout() {
 }
 
 function search() {
-       var query = "backend.php?op=dlg&id=search&param=" +
+       var query = "backend.php?op=dlg&method=search&param=" +
                param_escape(getActiveFeedId() + ":" + activeFeedIsCat());
 
        if (dijit.byId("searchDlg"))
@@ -274,7 +275,7 @@ function genericSanityCheck() {
 
 function init() {
        try {
-               dojo.registerModulePath("fox", "../../js/");
+               //dojo.registerModulePath("fox", "../../js/");
 
                dojo.require("fox.FeedTree");
 
@@ -284,16 +285,6 @@ function init() {
 
                dojo.parser.parse();
 
-               dojo.addOnLoad(function() {
-                       updateFeedList();
-                       closeArticlePanel();
-
-                       if (typeof themeAfterLayout == 'function') {
-                               themeAfterLayout();
-                       }
-
-               });
-
                if (!genericSanityCheck())
                        return false;
 
@@ -315,6 +306,15 @@ function init() {
 function init_second_stage() {
 
        try {
+               dojo.addOnLoad(function() {
+                       updateFeedList();
+                       closeArticlePanel();
+
+                       if (typeof themeAfterLayout == 'function') {
+                               themeAfterLayout();
+                       }
+
+               });
 
                delCookie("ttrss_test");
 
@@ -428,18 +428,12 @@ function quickMenuGo(opid) {
                }
 
                if (opid == "qmcHKhelp") {
-                       //Element.show("hotkey_help_overlay");
-                       Effect.Appear("hotkey_help_overlay", {duration : 0.3});
-               }
-
-               if (opid == "qmcAbout") {
-                       dialog = new dijit.Dialog({
-                               title: __("About..."),
-                               style: "width: 400px",
-                               href: "backend.php?op=dlg&id=about",
-                       });
-
-                       dialog.show();
+                       new Ajax.Request("backend.php", {
+                               parameters: "?op=backend&method=help&topic=main",
+                               onComplete: function(transport) {
+                                       $("hotkey_help_overlay").innerHTML = transport.responseText;
+                                       Effect.Appear("hotkey_help_overlay", {duration : 0.3});
+                               } });
                }
 
        } catch (e) {
@@ -512,34 +506,6 @@ function parse_runtime_info(data) {
        }
 }
 
-function catchupCurrentFeed() {
-
-       var fn = getFeedName(getActiveFeedId(), activeFeedIsCat());
-
-       var str = __("Mark all articles in %s as read?").replace("%s", fn);
-
-       if (getInitParam("confirm_feed_catchup") != 1 || confirm(str)) {
-               return viewCurrentFeed('MarkAllRead');
-       }
-}
-
-function catchupFeedInGroup(id) {
-
-       try {
-
-               var title = getFeedName(id);
-
-               var str = __("Mark all articles in %s as read?").replace("%s", title);
-
-               if (getInitParam("confirm_feed_catchup") != 1 || confirm(str)) {
-                       return viewCurrentFeed('MarkAllReadGR:' + id);
-               }
-
-       } catch (e) {
-               exception_error("catchupFeedInGroup", e);
-       }
-}
-
 function collapse_feedlist() {
        try {
 
@@ -692,11 +658,13 @@ function hotkey_handler(e) {
                        }
 
                        if ((keycode == 191 || keychar == '?') && shift_key) { // ?
-                               if (!Element.visible("hotkey_help_overlay")) {
-                                       Effect.Appear("hotkey_help_overlay", {duration : 0.3, to : 0.9});
-                               } else {
-                                       Element.hide("hotkey_help_overlay");
-                               }
+
+                               new Ajax.Request("backend.php", {
+                                       parameters: "?op=backend&method=help&topic=main",
+                                       onComplete: function(transport) {
+                                               $("hotkey_help_overlay").innerHTML = transport.responseText;
+                                               Effect.Appear("hotkey_help_overlay", {duration : 0.3});
+                                       } });
                                return false;
                        }
 
@@ -1078,7 +1046,7 @@ function scheduleFeedUpdate(id, is_cat) {
 
 function newVersionDlg() {
        try {
-               var query = "backend.php?op=dlg&id=newVersion";
+               var query = "backend.php?op=dlg&method=newVersion";
 
                if (dijit.byId("newVersionDlg"))
                        dijit.byId("newVersionDlg").destroyRecursive();