Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tabgroups menuitem #1

Closed
char101 opened this issue Dec 9, 2010 · 5 comments
Closed

tabgroups menuitem #1

char101 opened this issue Dec 9, 2010 · 5 comments

Comments

@char101
Copy link

char101 commented Dec 9, 2010

Hi,

I'd like to suggest about adding tabgroup actions to multipletab popup menu, such as

  • groups selected tabs as new group
  • move selected tabs to existing group

I have tried to implement the first one myself. Here is my implementation, which is about 80% working. Currently the problem is that the the tabbar is not updated even though I have called _updateTabBar

createNewGroup: function MTS_createNewGroup(aTabs, aRemoteWindow)
    {
        if (!aTabs || !aTabs.length) return null;

        if (! TabView) return;

        //aTabs.forEach(this.ensureLoaded, this);

        var self = this;
        var handler = function() {
            var tw  = TabView.getContentWindow();
            self.clearSelection();
        
            var groupItem = new tw.GroupItem(null, { title: window.prompt("Group title:"), immediately: true });
            aTabs.forEach(function(tab) {
                tw.GroupItems.moveTabToGroupItem(tab, groupItem.id);
            });

            groupItem.setActiveTab(aTabs[0].tabItem);
            tw.GroupItems.updateActiveGroupItemAndTabBar(aTabs[0].tabItem);
            tw.GroupItems._updateTabBar();
            tw.GroupItems.arrange();
        };
        
        var tw = TabView.getContentWindow();
        if (! tw) {
            TabView._initFrame(handler);
        } else {
            handler();  
        }       

        return aRemoteWindow;
    },
@piroor
Copy link
Owner

piroor commented Dec 10, 2010

Cool! I also have a plan to do it. But currently TabView API seem too unstable, so I put the plan on the shelf...
http://mxr.mozilla.org/mozilla-central/source/browser/base/content/browser-tabview.js
I think those APIs should be rewritten as clean and useful.

Or, if there is any library to control Tab Candy on Jetpack SDK, it will help this plan.
https://github.com/mozilla/addon-sdk/tree/master/packages
https://wiki.mozilla.org/Labs/Jetpack/Reboot/JEP/110

@piroor
Copy link
Owner

piroor commented Dec 10, 2010

I've found a sample addon based on Jetpack SDK made by mitcho.
https://github.com/mitcho/badges

@piroor
Copy link
Owner

piroor commented Dec 10, 2010

http://www.slideshare.net/mitcho/firefox-panorama
mitcho said that Panorama will provide more APIs for addons in the future. I think we should work after new APIs become available.

@char101
Copy link
Author

char101 commented Dec 10, 2010

Hi,

Thank you for your reply. I'll be looking forward until the API is stable then :)

@piroor
Copy link
Owner

piroor commented Jan 17, 2011

I've implemented this experimentally.
b0f538c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants