]> git.wh0rd.org Git - tt-rss.git/commitdiff
assorted DnD and pref layout fixes
authorAndrew Dolgov <fox@fakecake.org>
Thu, 18 Nov 2010 07:15:14 +0000 (10:15 +0300)
committerAndrew Dolgov <fox@fakecake.org>
Thu, 18 Nov 2010 07:15:14 +0000 (10:15 +0300)
PrefFeedTree.js
lib/CheckBoxTree.js
modules/pref-feeds.php
prefs.js
tt-rss.css

index f8d1e7b15fb33619605d10bea5e323c8b705221a..026e5d4894c5d2891e9b81a05c6bd53347060b75 100644 (file)
@@ -6,11 +6,32 @@ dojo.declare("fox.PrefFeedTree", lib.CheckBoxTree, {
        checkItemAcceptance: function(target, source, position) {
                var item = dijit.getEnclosingWidget(target).item;
 
-               console.log(source.currentWidget);
-               
+               // disable copying items
+               source.copyState = function() { return false; }
+
+               var source_item = false;
+
+               source.forInSelectedItems(function(node) {
+                       source_item = node.data.item;
+               });
+
+               if (!source_item || !item) return false;
+
                var id = String(item.id);
-               return (id.match("CAT:") || position != "over");
-               return true;
+               var source_id = String(source_item.id);
+
+               var id = this.tree.model.store.getValue(item, 'id');
+               var source_id = source.tree.model.store.getValue(source_item, 'id');
+
+               //console.log(id + " " + position + " " + source_id);
+
+               if (source_id.match("FEED:")) {
+                       return ((id.match("CAT:") && position == "over") ||
+                               (id.match("FEED:") && position != "over"));
+               } else if (source_id.match("CAT:")) {
+                       return ((id.match("CAT:") && position != "over") ||
+                               (id.match("root") && position == "over"));
+               }
        },
 });
 
index 35e7039babb18ae573176eac55f545afbf268bd7..fb532801c36fe408cbf691e4fd705eee0e06e258 100644 (file)
@@ -104,9 +104,10 @@ dojo.declare( "lib.CheckBoxStoreModel", dijit.tree.TreeStoreModel,
                //      | var currState = model.getCheckboxState(item);
                //              
                var currState = undefined;
-               
+       
                // Special handling required for the 'fake' root entry (the root is NOT a dojo.data.item).
-               if ( storeItem == this.root ) {
+               // this stuff is only relevant for Forest store -fox
+/*             if ( storeItem == this.root ) {
                        if( typeof(storeItem.checkbox) == "undefined" ) {
                                this.root.checkbox = undefined;         // create a new checbox reference as undefined.
                                if( this.checkboxRoot ) {
@@ -121,7 +122,14 @@ dojo.declare( "lib.CheckBoxStoreModel", dijit.tree.TreeStoreModel,
                                this._setCheckboxState( storeItem, this.checkboxState );
                                currState = this.checkboxState;
                        }
+               } */
+
+               currState = this.store.getValue(storeItem, this.checkboxIdent);
+               if( currState == undefined && this.checkboxAll) {
+                       this._setCheckboxState( storeItem, this.checkboxState );
+                       currState = this.checkboxState;
                }
+
                return currState  // the current state of the checkbox (true/false or undefined)
        },
 
index 10b7462ece7afd86213b7b939a384aefab5e62ee..3eb3c46216386d2c3b29d748dbe4b6de1b83cd74 100644 (file)
 
                if ($num_errors > 0) {
 
-                       print format_notice("<a href=\"javascript:showFeedsWithErrors()\">".
-                               __('Some feeds have update errors (click for details)')."</a>");
+                       $error_button = "<button dojoType=\"dijit.form.Button\"
+                                       onclick=\"showFeedsWithErrors\" id=\"errorButton\">" .
+                               __("Feeds with errors") . "</button>";
+
+//                     print format_notice("<a href=\"javascript:showFeedsWithErrors()\">".
+//                             __('Some feeds have update errors (click for details)')."</a>");
                }
 
                $feed_search = db_escape_string($_REQUEST["search"]);
                                __('Edit categories')."</button dojoType=\"dijit.form.Button\"> ";
                }
 
+               print $error_button;
+
                print "<button dojoType=\"dijit.form.Button\" onclick=\"removeSelectedFeeds()\">"
                        .__('Unsubscribe')."</button dojoType=\"dijit.form.Button\"> ";
 
index 42f51087d7767647ffd2c2a590a591f68d008b77..556c71dbbadd46230fc8b5965504d75a63954100 100644 (file)
--- a/prefs.js
+++ b/prefs.js
@@ -323,8 +323,6 @@ function editUser(id, event) {
        try {
                if (!event || !event.ctrlKey) {
 
-               disableHotkeys();
-
                notify_progress("Loading, please wait...");
 
                selectTableRows('prefUserList', 'none');
@@ -358,8 +356,6 @@ function editFilter(id, event) {
 
                if (!event || !event.ctrlKey) {
 
-                       disableHotkeys();
-
                        notify_progress("Loading, please wait...");
 
                        selectTableRows('prefFilterList', 'none');
@@ -391,8 +387,6 @@ function editFeed(feed, event) {
 
                if (event && !event.ctrlKey) {
 
-                       disableHotkeys();
-       
                        notify_progress("Loading, please wait...");
 
 //                     selectTableRows('prefFeedList', 'none');        
@@ -963,8 +957,6 @@ function editSelectedFeeds() {
        
                notify("");
        
-               disableHotkeys();
-       
                notify_progress("Loading, please wait...");
        
                var query = "?op=pref-feeds&subop=editfeeds&ids=" +
@@ -1271,6 +1263,7 @@ function pref_hotkey_handler(e) {
                }
 
                if (keycode == 16) return; // ignore lone shift
+               if (keycode == 17) return; // ignore lone ctrl
 
                if ((keycode == 67 || keycode == 71) && !hotkey_prefix) {
                        hotkey_prefix = keycode;
index b1d3ea582aeb47ad923e52e6b64d239e06346612..4cab27e9f67a578425495a768cb255d979cb0051 100644 (file)
@@ -1559,4 +1559,6 @@ div#pref-tabs .dijitContentPane h3 {
        border-width : 0px;
 }
 
-
+#errorButton {
+       color : red;
+}