[Ext]Show Parent Folder

Announce and Discuss the Latest Theme and Extension Releases.
Alan Baxter
Posts: 4419
Joined: May 30th, 2005, 2:01 pm
Location: Colorado, USA

Re: [Ext]Show Parent Folder

Post by Alan Baxter »

iav wrote:And this field is empty, when it really needed - for search results.

The field is not empty for me in the Library's bookmark search results. Sorry you're having a problem. Do you want some help?
User avatar
iav
Posts: 123
Joined: September 23rd, 2005, 3:18 pm
Contact:

Re: [Ext]Show Parent Folder

Post by iav »

Maybe. Today I run
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.3a6pre) Gecko/20100624 Minefield/3.7a6pre - Build ID: 20100624030247
Do you use nightly builds?
User avatar
Alice0775
Posts: 2818
Joined: October 26th, 2007, 11:25 pm
Location: OSAKA

Re: [Ext]Show Parent Folder

Post by Alice0775 »

iav wrote:Maybe. Today I run
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.3a6pre) Gecko/20100624 Minefield/3.7a6pre - Build ID: 20100624030247
Do you use nightly builds?

It is not compatible with 3.5a or later due to checked in Bug 556739.
Do not use it with 3.5a or later.
And I do not plan to release updated version till UI and API are fixed on Firefox 4.0.
orangepisa
Posts: 1
Joined: November 1st, 2010, 4:41 pm

Re: [Ext]Show Parent Folder

Post by orangepisa »

I noticed that the Delicious Bookmarks Extension makes Show Parent Folder not work.
Are there any anticipated workarounds?
Thanks
terrypin
Posts: 1642
Joined: January 17th, 2005, 10:42 am

Re: [Ext]Show Parent Folder

Post by terrypin »

The major flaw with this Add-On IMO is that you cannot sort by the Parent Folder column. I often find I want to do that, such as after searching for a string and ending up with scores of hits - which then need to be grouped into their folders.

http://dl.dropbox.com/u/4019461/FF-Sorting.jpg

--
Terry, East Grinstead, UK
Terry, East Grinstead, UK
Win 10 Pro, Waterfox 56.1.0 replaced Firefox 56.0.2, TMP 0.5.0.5pre
User avatar
Alice0775
Posts: 2818
Joined: October 26th, 2007, 11:25 pm
Location: OSAKA

Re: [Ext]Show Parent Folder

Post by Alice0775 »

terrypin wrote:The major flaw with this Add-On IMO is that you cannot sort by the Parent Folder column. I often find I want to do that, such as after searching for a string and ending up with scores of hits - which then need to be grouped into their folders.

http://dl.dropbox.com/u/4019461/FF-Sorting.jpg

--
Terry, East Grinstead, UK

I know that.
But I cannot.
User avatar
Lunar
Posts: 492
Joined: July 6th, 2004, 5:08 am
Location: Texas, США
Contact:

Re: [Ext]Show Parent Folder

Post by Lunar »

iav wrote:Maybe. Today I run
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.3a6pre) Gecko/20100624 Minefield/3.7a6pre - Build ID: 20100624030247
Do you use nightly builds?


I use it on Linux (openSuSE), Aurora nightly builds.
I open the xpi in ark (decompress), drag the install.rdf file to temp dir, edit the install.rdf, edit in kwrite (utf-8 editor like kate) change the MaxVerison= number to whatever, 12.x 13.02, but I never go beyond what the major number of nightly is (12, 13 etc)... save, drag the install.rdf file back to the open xpi file (ark window) and close.. drop the show_parent.xpi file on mozilla... firefox (Aurora). Done.

I do this with all my 'must have' add-ons and my favorite theme black office which hasn't been updated by author since somewhere around release nightly 6 or 7, firefox, pre-Aurora branch, pre03.18 or something.. what ever...

hope this works for you too.
Landis.
vk/LandisTwo
'Microsucks' made me nuts, Linux is making me crazy...
...at least with Linux, I can afford the therapy.. : )
openSuSE | KDE | enlightenment | mozilla Aurora 55 / Nightly 106 Konqueror /Opera/ Aurora Dev Ed | Now, down to Firefox 45 52 ESR as the 'new' direction... sxxxs!
Negativeions
Posts: 244
Joined: September 17th, 2003, 12:07 pm

Re: [Ext]Show Parent Folder

Post by Negativeions »

Hi, nice add-on... but wouldn't it be better if you just made "go parent folder" a feature of "show parent folder"?? It should be 1 add-on, not 2 separate ones. Thanks.
benroll
Posts: 2
Joined: May 29th, 2004, 5:42 am

Re: [Ext]Show Parent Folder

Post by benroll »

Hello It would be useful to be able to search the folder names content and not only the bookmarks names content.
May be a "search folders" add-on should be added to the very usefull "show parent folder" and "go parent folder" ones.
Thanks in advance to the programmer that may implement it !
Negativeions
Posts: 244
Joined: September 17th, 2003, 12:07 pm

Re: [Ext]Show Parent Folder

Post by Negativeions »

Can you please make Show parent folder and go parent folder 1 add-on? It's stupid to have 2 seperate addons for this.
User avatar
Alice0775
Posts: 2818
Joined: October 26th, 2007, 11:25 pm
Location: OSAKA

Re: [Ext]Show Parent Folder

Post by Alice0775 »

Negativeions wrote:Can you please make Show parent folder and go parent folder 1 add-on? It's stupid to have 2 seperate addons for this.

No, I do not think so.
verbatim613
Posts: 3
Joined: November 9th, 2009, 4:24 am

Add Parent Folder / Pathname info to "properties" dialog?

Post by verbatim613 »

Show Parent Folder is very helpful Add-on.

http://www.flickr.com/photos/85547812@N ... hotostream

When right clicking on results of a bookmark search, user has option to view properties of that bookmark. Is it possible to add the "Parent Folder" property of the bookmark to this dialog box?
User avatar
Alice0775
Posts: 2818
Joined: October 26th, 2007, 11:25 pm
Location: OSAKA

Re: Add Parent Folder / Pathname info to "properties" dialog

Post by Alice0775 »

verbatim613 wrote:Show Parent Folder is very helpful Add-on.

http://www.flickr.com/photos/85547812@N ... hotostream

When right clicking on results of a bookmark search, user has option to view properties of that bookmark. Is it possible to add the "Parent Folder" property of the bookmark to this dialog box?

This add-on is for Libraly, not for Bookmarks Sidebar and Bookmarks Menu.
So, I do not think it is possible.
techlivezheng
Posts: 12
Joined: October 27th, 2011, 11:25 am

Re: [Ext]Show Parent Folder

Post by techlivezheng »

Alice0775 wrote:
terrypin wrote:The major flaw with this Add-On IMO is that you cannot sort by the Parent Folder column. I often find I want to do that, such as after searching for a string and ending up with scores of hits - which then need to be grouped into their folders.

http://dl.dropbox.com/u/4019461/FF-Sorting.jpg

--
Terry, East Grinstead, UK

I know that.
But I cannot.


May I ask why you can't, is it so hard so implement? Where could I find you source code repository, and do something about it, of cause, if that is okay?
techlivezheng
Posts: 12
Joined: October 27th, 2011, 11:25 am

Re: [Ext]Show Parent Folder

Post by techlivezheng »

techlivezheng wrote:
Alice0775 wrote:
terrypin wrote:The major flaw with this Add-On IMO is that you cannot sort by the Parent Folder column. I often find I want to do that, such as after searching for a string and ending up with scores of hits - which then need to be grouped into their folders.

http://dl.dropbox.com/u/4019461/FF-Sorting.jpg

--
Terry, East Grinstead, UK

I know that.
But I cannot.


May I ask why you can't, is it so hard so implement? Where could I find you source code repository, and do something about it, of cause, if that is okay?


After some investigation, I have learned that it is not easy to implement the sorting based on the "parentFolder" column, because all the other columns' sorting is done by the Places Querying API which does not provide way for a customized sorting.

There has been bug report since 2003 https://bugzilla.mozilla.org/show_bug.cgi?id=196509, hope it could be resoved someday. Besides waiting the bug report to be resolved, It is possible to bind our own sorting mechanism to the click event of the "parentFolder" column header though, but it needs much more work, maybe next time I will give it a shot.

One last thing is during this investionation, I reworked js code a bit using function extending instead of your "Funtion -> String -> Regex Replacing -> Function" method, please give it a look.

Here is the new code.

Code: Select all

//Bug 196509  Search for bookmark should show parent folder

if ("undefined" == typeof(showparentfolder)) {
  var showparentfolder = {};
};

showparentfolder = {
  init: function() {
    window.removeEventListener("load",showparentfolder.init,false);
    window.addEventListener('unload', showparentfolder.uninit,false);

    PlacesTreeView.prototype.COLUMN_TYPE_PARENTFOLDER = 999;

    showparentfolder._old_cycleHeader = PlacesTreeView.prototype.cycleHeader;
    PlacesTreeView.prototype.cycleHeader = showparentfolder.cycleHeader;

    showparentfolder._old_getCellText = PlacesTreeView.prototype.getCellText;
    PlacesTreeView.prototype.getCellText = showparentfolder.getCellText;

    showparentfolder._old_getColumnType = PlacesTreeView.prototype._getColumnType;
    PlacesTreeView.prototype._getColumnType = showparentfolder._getColumnType;
  },

  uninit: function(){
    window.removeEventListener("unload",showparentfolder.uninit,false);
  },

  //xxx Parentfolder column sort will do nothing.
  cycleHeader: function PTV_cycleHeader(aColumn) {
    switch (this._getColumnType(aColumn)) {
        case this.COLUMN_TYPE_PARENTFOLDER:
          return;
        default:
          showparentfolder._old_cycleHeader.apply(this,arguments);
    }
  },

  getCellText: function PTV_getCellText(aRow, aColumn) {
    let node = this._getNodeForRow(aRow);
    switch (this._getColumnType(aColumn)) {
      case this.COLUMN_TYPE_PARENTFOLDER:
        if (PlacesUtils.nodeIsQuery(node.parent) &&
             PlacesUtils.asQuery(node.parent).queryOptions.queryType ==
              Ci.nsINavHistoryQueryOptions.QUERY_TYPE_HISTORY &&
             node.uri )
          return "";
        var bmsvc = Components.classes["@mozilla.org/browser/nav-bookmarks-service;1"]
                    .getService(Components.interfaces.nsINavBookmarksService);
        var rowId = node.itemId;
        try {
          var FolderId;
          var parentFolderId = bmsvc.getFolderIdForItem(rowId);
          var folderTitle = bmsvc.getItemTitle(parentFolderId);
          var xpref = Components.classes["@mozilla.org/preferences-service;1"]
              .getService(Components.interfaces.nsIPrefBranch2);
          var reverse = xpref.getBoolPref("extensions.showParentFolder.reverseFolderHierarchy");
          if (xpref.getBoolPref("extensions.showParentFolder.showFolderHierarchy")){
            while ( (FolderId = bmsvc.getFolderIdForItem(parentFolderId)) ){
              if (FolderId == parentFolderId)
                break;
              parentFolderId = FolderId;
              var text = bmsvc.getItemTitle(parentFolderId);
              if (!text)
                break;
              if (!reverse)
                folderTitle = text + " /"+ folderTitle;
              else
                folderTitle = folderTitle + "<"+ text;
            }
            folderTitle = folderTitle.replace(/^\s/,"");
          }
        } catch(ex) {
          var folderTitle = "";
        }
        return folderTitle;
      default:
        return showparentfolder._old_getCellText.apply(this,arguments);
    }
  },

  _getColumnType: function PTV__getColumnType(aColumn) {
    let columnType = aColumn.element.getAttribute("anonid") || aColumn.id;

    switch (columnType) {
      case "parentFolder":
        return this.COLUMN_TYPE_PARENTFOLDER;
      default:
        return showparentfolder._old_getColumnType.apply(this,arguments);
    }
  },
}

window.addEventListener("load",showparentfolder.init,false);
Post Reply