]> git.wh0rd.org Git - tt-rss.git/commitdiff
new hotkey: c m (toggle category reorder mode)
authorAndrew Dolgov <fox@bah.spb.su>
Sat, 6 Sep 2008 13:23:20 +0000 (14:23 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sat, 6 Sep 2008 13:23:20 +0000 (14:23 +0100)
feedlist.js
help/3.php
tt-rss.js

index 98d5f5a0f116717eb623c920b758e7400a0be71b..6eb7312f36bc1e57f9dc9b3dc2db12e017c53779 100644 (file)
@@ -10,6 +10,20 @@ var mouse_x = 0;
 var resize_enabled = false;
 var counters_last_request = 0;
 
+function toggle_sortable_feedlist(enabled) {
+       try {
+
+               if (enabled) {
+                       Sortable.create('feedList', {onChange: feedlist_dragsorted, only: "feedCat"});
+               } else {
+                       Sortable.destroy('feedList');
+               }
+
+       } catch (e) {
+               exception_error("toggle_sortable_feedlist", e);
+       }
+}
+
 function viewCategory(cat) {
        active_feed_is_cat = true;
        viewfeed(cat, '', true);
@@ -382,7 +396,7 @@ function feedlist_init() {
 
                init_collapsable_feedlist(getInitParam("theme"));
 
-               Sortable.create('feedList', {onChange: feedlist_dragsorted, only: "feedCat"});
+               toggle_sortable_feedlist(isFeedlistSortable());
 
        } catch (e) {
                exception_error("feedlist/init", e);
index 76c87c0d06d9f7e508e157af8c799d5b67cf3f8c..f6afb857939ffce151dea651a2bc4ffd14b9d2c9 100644 (file)
@@ -28,6 +28,7 @@
 
                <tr><td class='n'>c f</td><td><?php echo __("Create filter") ?></td></tr>
                <tr><td class='n'>c s</td><td><?php echo __("Collapse sidebar") ?></td></tr>
+               <tr><td class='n'>c m</td><td><?php echo __("Toggle category reordering mode") ?></td></tr>
                <tr><td class='n'>?</td><td><?php echo __("Display this help dialog") ?></td></tr>
        </table>
 
index 2bbe782cbf943d4df87de8b89682d8f7cc03f6f0..a63ccacb59e91ddacac07d156e49dd29220b9f78 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -18,6 +18,11 @@ var init_params = new Object();
 var ver_offset = 0;
 var hor_offset = 0;
 var feeds_sort_by_unread = false;
+var feedlist_sortable_enabled = false;
+
+function isFeedlistSortable() {
+       return feedlist_sortable_enabled;
+}
 
 function tagsAreDisplayed() {
        return display_tags;
@@ -1315,6 +1320,17 @@ function hotkey_handler(e) {
                                }
                        }
 
+                       if (keycode == 77) { // m
+                               feedlist_sortable_enabled = !feedlist_sortable_enabled;
+                               if (feedlist_sortable_enabled) {
+                                       notify_info("Category reordering enabled");
+                                       toggle_sortable_feedlist(true);
+                               } else {
+                                       notify_info("Category reordering disabled");
+                                       toggle_sortable_feedlist(false);
+                               }
+                       }
+
                }
 
                /* Prefix g */