MozillaZine


"Manage Folder" extension please!

Talk about add-ons and extension development.
mai9

User avatar
 
Posts: 1619
Joined: January 15th, 2003, 3:41 pm
Location: Barcelona

Post Posted September 25th, 2005, 10:46 am

Can somebody with good will and some time create an extension that brings back the good "Manage Folder" context menu item?

This item was removed from nightlies and it's not expected to be on the 1.5 release. Read more here:

https://bugzilla.mozilla.org/show_bug.cgi?id=222883#c21

thanks to the potential coder :)

Schrade

User avatar
 
Posts: 1187
Joined: March 17th, 2004, 12:24 am

Post Posted September 25th, 2005, 10:48 am

I heartily agree. I really would like this functionality back. I have bazillions of bookmarks (my bookmarks.html is like 2 megs) and the ability to right click on a folder in my bookmarks toolbar and 'Manage Folder' makes it so much easier to sort things.
"Linux is for those who hate Windows, BSD is for those who love Unix." -Some Guy
Try my themes: QuBranch and QuTrunk
Fix Firefox's Resized image scrolling speed: <b>Bug 163975</b>

jedbro

User avatar
 
Posts: 1899
Joined: November 10th, 2002, 12:35 pm
Location: Mexico / Boulder Co.

Post Posted September 25th, 2005, 5:45 pm

Wow, I never even noticed that feature :D Thanks for pointing it out.
It seems to work great for me, but if the devs say it's quirky than it should be removed.

I have a nasty test on Tuesday, but I promise I'll make the extension tuesdaynight or wednesday if no-one beats me to it.

Cheers
-Jed

p.s. Maybe if someone can pm me on tuesday as a reminder that would be awesome :D

johnlgalt

User avatar
 
Posts: 228
Joined: January 25th, 2005, 12:18 pm
Location: 3rd rock

Post Posted September 28th, 2005, 7:54 am

I agree, this is going to be a winner for me as well.

While not at 2 MB they are getting up there at over 800K....

manc39
Moderator
 
Posts: 2037
Joined: June 17th, 2004, 8:34 am
Location: Manchester, England

Post Posted September 28th, 2005, 8:26 am

I used to use this a lot and had no idea it had gone :?

Does the commentactually make any sense? Why take it out if the code's going to be left in anyway?
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1b1) Gecko/20060712 BonEcho/2.0b1

johnlgalt

User avatar
 
Posts: 228
Joined: January 25th, 2005, 12:18 pm
Location: 3rd rock

Post Posted September 28th, 2005, 9:17 am

I think that this comment sums it up pretty well. It had a lot of 'quirks', if you will, and newer recruits to Fx might potentially be turned off from using Fx by having the feature available to them when they could not figure out how it worked and stuff.

Technically, instead of having to make an extension to enable it, I would rather that they had simply made it an option set - disabled by default, but able to be enabled on a per user basis....

And yes, I realize that it is not that big a deal, and I do not *myself* foresee any user dumping Fx b/c of this tiny feature, but then again, *I* am not on the dev team either, so....

Schrade

User avatar
 
Posts: 1187
Joined: March 17th, 2004, 12:24 am

Post Posted September 28th, 2005, 11:29 am

The thing about the comment is that it's not accurate. The patch that was posted doesn't seem to be the patch that was applied. I did a diff between the two files and there was a whole lot more changed than just 5 lines. They completely removed the code it seems and didn't just remove the menu entries.
"Linux is for those who hate Windows, BSD is for those who love Unix." -Some Guy
Try my themes: QuBranch and QuTrunk
Fix Firefox's Resized image scrolling speed: <b>Bug 163975</b>

jedbro

User avatar
 
Posts: 1899
Joined: November 10th, 2002, 12:35 pm
Location: Mexico / Boulder Co.

Post Posted September 28th, 2005, 1:49 pm

Schrade wrote:They completely removed the code it seems and didn't just remove the menu entries.


No, according to the patch, all they did was remove the context-menu entry.

mai9

User avatar
 
Posts: 1619
Joined: January 15th, 2003, 3:41 pm
Location: Barcelona

Post Posted September 28th, 2005, 4:40 pm

manc39 wrote:I used to use this a lot and had no idea it had gone :?

Does the commentactually make any sense? Why take it out if the code's going to be left in anyway?

I almost agree with you. When I saw this change (and after reading the comments for the first time) I said to myself that deleting the feature was way too much. The whole problem with this "manage folder" only happens when you create a folder without clicking inside the window first. To me this is a very tiny problem not worth deleting a useful feature (that I use a lot).

But on second thoughts... well it makes more sense (of course it only makes sense when you can install the extension). They want to have a 100% clean of problems Firefox and they'll be re-working on bookmarks in two months (I hope), so let's clean FF and ship it (and start working on next version).

Schrade

User avatar
 
Posts: 1187
Joined: March 17th, 2004, 12:24 am

Post Posted September 28th, 2005, 6:00 pm

jedbro wrote:
Schrade wrote:They completely removed the code it seems and didn't just remove the menu entries.


No, according to the patch, all they did was remove the context-menu entry.


Yes, that's what you'd think <u>if</u> they had used that patch.

Here's what really happened:

Code: Select all
--- C:\DL\Firefox Trunk Extensions\Fix Manage Folder\bookmarks.js   Mon Sep 19 16:03:54 2005
+++ C:\DL\Firefox Trunk Extensions\Fix Manage Folder\new-bookmarks.js   Tue Sep 20 12:21:30 2005
@@ -144,19 +144,6 @@
     xulElement.setAttribute("cmd", aCommandName);
     var cmd = "cmd_" + aCommandName.substring(gNC_NS_CMD.length);
     xulElement.setAttribute("command", cmd);
-   
-    if (aCommandName == gNC_NS_CMD + "bm_expandfolder") {
-      var shouldCollapse = true;
-      for (var i=0; i<aSelection.length; ++i)
-        if (!aSelection.isExpanded[i])
-          shouldCollapse = false;
-
-      if (shouldCollapse) {
-        aDisplayName = BookmarksUtils.getLocaleString("cmd_bm_collapsefolder");
-        aAccessKey   = BookmarksUtils.getLocaleString("cmd_bm_collapsefolder_accesskey");
-      }
-    }
-
     xulElement.setAttribute("label", aDisplayName);
     xulElement.setAttribute("accesskey", aAccessKey);
     return xulElement;
@@ -213,11 +200,8 @@
         popup.appendChild(element);
     }
 
-    switch (popup.firstChild.getAttribute("command")) {
-    case "cmd_bm_open":
-    case "cmd_bm_expandfolder":
+    if (popup.firstChild.getAttribute("command") == "cmd_bm_open")
       popup.firstChild.setAttribute("default", "true");
-    }
   },
   
   /////////////////////////////////////////////////////////////////////////////
@@ -269,7 +253,6 @@
     var commands = [];
     // menu order:
     //
-    // bm_expandfolder
     // bm_open, bm_openfolder
     // bm_openinnewwindow
     // bm_openinnewtab
@@ -304,15 +287,15 @@
       break;
     case "Folder":
     case "PersonalToolbarFolder":
-      commands = ["bm_expandfolder", "bm_openfolder", "bm_managefolder", "bm_separator",
-                  "bm_newbookmark", "bm_newfolder", "bm_newseparator", "bm_separator",
+      commands = ["bm_openfolder", "bm_separator", "bm_newbookmark",
+                  "bm_newfolder", "bm_newseparator", "bm_separator",
                   "cut", "copy", "paste", "bm_separator",
                   "delete", "bm_separator",
                   "bm_sortbyname", "bm_separator",
                   "bm_properties"];
       break;
     case "IEFavoriteFolder":
-      commands = ["bm_expandfolder", "bm_separator", "delete"];
+      commands = ["bm_separator", "delete"];
       break;
     case "IEFavorite":
       commands = ["bm_open", "bm_openinnewwindow", "bm_openinnewtab", "bm_separator",
@@ -323,7 +306,7 @@
                   "copy"];
       break;
     case "Livemark":
-      commands = ["bm_expandfolder", "bm_openfolder", "bm_separator",
+      commands = ["bm_openfolder", "bm_separator",
                   "cut", "copy", "bm_separator",
                   "delete", "bm_separator",
                   "bm_refreshlivemark", "bm_sortbyname", "bm_separator",
@@ -995,7 +978,6 @@
     case "cmd_bm_open":
     case "cmd_bm_openinnewwindow":
     case "cmd_bm_openinnewtab":
-    case "cmd_bm_expandfolder":
     case "cmd_bm_openfolder":
     case "cmd_bm_managefolder":
     case "cmd_bm_newbookmark":
@@ -1070,7 +1052,6 @@
     case "cmd_selectAll":
       return true;
     case "cmd_bm_open":
-    case "cmd_bm_expandfolder":
     case "cmd_bm_managefolder":
       return length == 1;
     case "cmd_bm_openinnewwindow":
@@ -1593,9 +1574,9 @@
       if (aTarget.index == -1) {
         transaction.index[i] = -1;
       } else {
-//@line 1640 "/cygdrive/c/builds/tinderbox/Fx-Mozilla1.8/WINNT_5.2_Depend/mozilla/browser/components/bookmarks/content/bookmarks.js"
+//@line 1621 "/cygdrive/c/builds/tinderbox/Fx-Mozilla1.8/WINNT_5.2_Depend/mozilla/browser/components/bookmarks/content/bookmarks.js"
       transaction.index [i] = index++;
-//@line 1642 "/cygdrive/c/builds/tinderbox/Fx-Mozilla1.8/WINNT_5.2_Depend/mozilla/browser/components/bookmarks/content/bookmarks.js"
+//@line 1623 "/cygdrive/c/builds/tinderbox/Fx-Mozilla1.8/WINNT_5.2_Depend/mozilla/browser/components/bookmarks/content/bookmarks.js"
       }
     }
     BMSVC.transactionManager.doTransaction(transaction);
@@ -1907,9 +1888,9 @@
         this.RDFC.AppendElement(this.item[i]);
         this.index[i] = this.RDFC.GetCount();
       } else {
-//@line 1964 "/cygdrive/c/builds/tinderbox/Fx-Mozilla1.8/WINNT_5.2_Depend/mozilla/browser/components/bookmarks/content/bookmarks.js"
+//@line 1945 "/cygdrive/c/builds/tinderbox/Fx-Mozilla1.8/WINNT_5.2_Depend/mozilla/browser/components/bookmarks/content/bookmarks.js"
         this.RDFC.InsertElementAt(this.item[i], this.index[i], true);
-//@line 1966 "/cygdrive/c/builds/tinderbox/Fx-Mozilla1.8/WINNT_5.2_Depend/mozilla/browser/components/bookmarks/content/bookmarks.js"
+//@line 1947 "/cygdrive/c/builds/tinderbox/Fx-Mozilla1.8/WINNT_5.2_Depend/mozilla/browser/components/bookmarks/content/bookmarks.js"
       }
 
       // insert back all the properties

"Linux is for those who hate Windows, BSD is for those who love Unix." -Some Guy
Try my themes: QuBranch and QuTrunk
Fix Firefox's Resized image scrolling speed: <b>Bug 163975</b>

jedbro

User avatar
 
Posts: 1899
Joined: November 10th, 2002, 12:35 pm
Location: Mexico / Boulder Co.

Post Posted September 28th, 2005, 8:14 pm

Here you all go.
Sorry for the delay.

<del>ManageFolders 0.1</del>

*edit* new version is Manage Folders v0.2

For next release (if there is a next) I'll move the menu entry to where it originally was (right now it's at the bottom).
This took a bit longer because I had to contact Vlad as I didn't see an easy way to do this, (the menu is generated dynamically via javascript, hence a '5 line overlay' wasn't possible ).

Still not much code, just harder to figure out.

Props go to Vlad for suggesting how I should do this.

Cheers
-Jed
Last edited by jedbro on September 29th, 2005, 6:32 pm, edited 1 time in total.

Duke D
 
Posts: 419
Joined: February 7th, 2005, 3:08 pm

Post Posted September 28th, 2005, 9:02 pm

what does this do??

Schrade

User avatar
 
Posts: 1187
Joined: March 17th, 2004, 12:24 am

Post Posted September 28th, 2005, 9:05 pm

It's supposed to restore the Manage Folders menu option when you right click on a folder in your Bookmark Toolbar. That feature was recently removed in one of the Branch nightlies.
"Linux is for those who hate Windows, BSD is for those who love Unix." -Some Guy
Try my themes: QuBranch and QuTrunk
Fix Firefox's Resized image scrolling speed: <b>Bug 163975</b>

jedbro

User avatar
 
Posts: 1899
Joined: November 10th, 2002, 12:35 pm
Location: Mexico / Boulder Co.

Post Posted September 28th, 2005, 9:12 pm

Schrade wrote:It's supposed to restore the Manage Folders menu option when you right click on a folder in your Bookmark Toolbar. That feature was recently removed in one of the Branch nightlies.


You mean it does restore the Manage Folders menu option when you right click on a folder in your Bookmark Toolbar. :D

I tested it on a nightly trunk from the 25th.

This will work in earlier versions (i.e. 1.5beta) however all you would be doing is duplicating the entry.

Cheers
-Jed

Schrade

User avatar
 
Posts: 1187
Joined: March 17th, 2004, 12:24 am

Post Posted September 28th, 2005, 9:20 pm

Yeah I had installed it but hadn't rebooted yet to test it when I did that reply.

I have a question though, what's with the diff I posted above? There's way more changes made than what the patch proposed.
"Linux is for those who hate Windows, BSD is for those who love Unix." -Some Guy
Try my themes: QuBranch and QuTrunk
Fix Firefox's Resized image scrolling speed: <b>Bug 163975</b>

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 0 guests