MenuManipulator 20140526

Talk about add-ons and extension development.
pintassilgo
Posts: 200
Joined: August 30th, 2013, 3:50 pm

Re: MenuManipulator 20110327

Post by pintassilgo »

How to restore default or at least detect changes?

And how to delete attributes?
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: MenuManipulator 20110327

Post by dorando »

pintassilgo wrote:How to restore default […]
Context menu > Reset
pintassilgo wrote:[…] or at least detect changes?
Try adding a new menuitem to the MenuManipulator window and add an oncommand attribute containing:

Code: Select all

menuView.getRowProperties = function(row){ if(gData[row].path) { return "selected"; } }
menuView.getCellProperties menuView.getRowProperties;
menuView.treebox.invalidate();

attrView.getRowProperties = function(row){ if(gData[menuTree.currentIndex].Set[attrView.data[row].attrName]) { return "selected"; } }
attrView.getCellProperties attrView.getRowProperties;
attrView.treebox.invalidate(); 
pintassilgo wrote:And how to delete attributes?
Currently not possible for attributes not added through MenuManipulator. Emptying the attribute might help.
Support mozilla.dorando.at through donations/contributions.
bege
Posts: 153
Joined: January 23rd, 2009, 9:14 pm
Location: Germany

Re: MenuManipulator 20110327

Post by bege »

dorando wrote:Try adding a new menuitem to the MenuManipulator window and add an oncommand attribute containing:

Wow, that's wizardry!
bege
Posts: 153
Joined: January 23rd, 2009, 9:14 pm
Location: Germany

Re: MenuManipulator 20110327

Post by bege »

dorando wrote:MenuManipulator can't currently edit the Firefox Button since it is not a proper menu, you can use Personal Menu (Personal Firefox Button) to edit it.

Thank you for updating MenuManipulator. The appmenu still cannot be manipulated with MM. Since there are a few problems with Personal Menu in Firefox 29 I'd love to be able to manipulate the appmenu of ClassicThemeRestorer. Is there no chance to make this possible?
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: MenuManipulator 20140526

Post by dorando »

You could try to modify Profile/extensions/menumanipulator@dorando.xpi (.xpi is the same as .zip) while the application is closed.

in menumanipulator-service.js replace

Code: Select all

function SetID() { 
with

Code: Select all

function SetID() {
 
ID("id('appmenu-popup')//x:hbox[not(@id)]""hbox"); 

in main.js replace

Code: Select all

if(containers[i].parentNode.localName != "menu" && containers[i].id
with

Code: Select all

if(!containers[i].parentNode.localName.match("menu") && containers[i].id
and replace

Code: Select all

case "menupopup": case "popup": case "menubar"
following

Code: Select all

case "menupopup": case "popup": case "menubar": case "vbox": case "hbox": case "splitmenu"

Seems to work with Classic Theme Restorer (Customize Australis) or Firefox ESR 24 (structured differently).
Support mozilla.dorando.at through donations/contributions.
bege
Posts: 153
Joined: January 23rd, 2009, 9:14 pm
Location: Germany

Re: MenuManipulator 20140526

Post by bege »

dorando, that works perfect, also in the Thunderbird 24.5 menu! Thank you very much.
Would you, please, add this to the next MM version?
bege
Posts: 153
Joined: January 23rd, 2009, 9:14 pm
Location: Germany

Re: MenuManipulator 20140526

Post by bege »

Is there a chance to keep MM from creating an additional menuseparator in this menu?
Image
The button turns red if there are changes in watched pages. The additional menuseparator makes the buttion turn red although there are no changes. So the notice function doesn't work any more.
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: MenuManipulator 20140526

Post by dorando »

bege wrote:Would you, please, add this to the next MM version?
Will likely be added to the next version.
bege wrote:Is there a chance to keep MM from creating an additional menuseparator in this menu?
MenuManipulator did not create that menuseparator, just assigned an id to it. SiteDelta 0.13.2 does check if any item after the first element within sitedelta-watch-popup (not sitedelta-pages-popup) has an id, to determine if anything has changed. Try setting the id attribute for menumanipulator-separator-105 to an empty string.
Support mozilla.dorando.at through donations/contributions.
bege
Posts: 153
Joined: January 23rd, 2009, 9:14 pm
Location: Germany

Re: MenuManipulator 20140526

Post by bege »

dorando wrote:Will likely be added to the next version.

Thank you very much :)
dorando wrote:MenuManipulator did not create that menuseparator, just assigned an id to it. SiteDelta 0.13.2 does check if any item after the first element within sitedelta-watch-popup (not sitedelta-pages-popup) has an id, to determine if anything has changed. Try setting the id attribute for menumanipulator-separator-105 to an empty string.

Perfect, as always, dorando. =D> Thank you. :D
Edit: I am sorry to decrease the compliment a bit. :wink: It is not "perfect", because after changing other entries the separators have different numbers and get back an id. So I must re-remove the id after other changes.
Last edited by bege on May 30th, 2014, 4:25 pm, edited 1 time in total.
bege
Posts: 153
Joined: January 23rd, 2009, 9:14 pm
Location: Germany

Re: MenuManipulator 20140526

Post by bege »

Mostly I use MenuManipulator to move or hide entries. Therefore I'd like to ask for another feature: Another context menu entry of MM to hide/unhide an entry, i.e. to automatically add the attribute "hidden: true/false"

Edit: Additionally collapse/expand all trees.
Last edited by bege on May 30th, 2014, 6:31 pm, edited 1 time in total.
bege
Posts: 153
Joined: January 23rd, 2009, 9:14 pm
Location: Germany

Re: MenuManipulator 20140526

Post by bege »

All entries in the tab context menu regarding to close tabs and to close/collapse trees don't keep their position.
I moved them to the top of the context menu but after restarting Firefox they move back down to their previous position.
I have TabMixPlus and TreeStyleTabs installed.
Edit: It is also the entry to bookmark a tree.
All these entries reside beside the tabContextMenu also in another tree called multipletab-tabcontext-menu-template.
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: MenuManipulator 20140526

Post by dorando »

bege wrote:It is not "perfect", because after changing other entries the separators have different numbers and get back an id. So I must re-remove the id after other changes.
To be expected due to the way the id is generated, you could try to add a new menuitem to the MenuManipulator window with the following oncommand:

Code: Select all

var item gData[menuTree.currentIndex];

var 
path prompt("XPath"item.path || createXPath(item.node));

if(
path) {
 
item.path path;
 
gApply true;
and set the XPath of that menuseparator to

Code: Select all

id('sitedelta-watch-popup')/x:menuseparator
bege wrote:Therefore I'd like to ask for another feature: Another context menu entry of MM to hide/unhide an entry, i.e. to automatically add the attribute "hidden: true/false"

Edit: Additionally collapse/expand all trees.
Will likely be added eventually.
bege wrote:All entries in the tab context menu regarding to close tabs and to close/collapse trees don't keep their position.
I moved them to the top of the context menu but after restarting Firefox they move back down to their previous position.
I have TabMixPlus and TreeStyleTabs installed.
Edit: It is also the entry to bookmark a tree.
All these entries reside beside the tabContextMenu also in another tree called multipletab-tabcontext-menu-template.
Tree Style Tab 0.14.2014051101 generates those items (from the multipletab-tabcontext-menu-template) after MenuManipulator has done its work (unless Multiple Tab Handler is also installed). You could try to edit the multipletab-insertafter or multipletab-insertbefore attributes of those menuitems (inside multipletab-tabcontext-menu-template) to change their positions. Note that you also might want to add

Code: Select all

(item.setAttribute("userdefined",""), 
before, and

Code: Select all

after those attributes to hide them from MenuManipulator (otherwise other changes might be affected).
Support mozilla.dorando.at through donations/contributions.
bege
Posts: 153
Joined: January 23rd, 2009, 9:14 pm
Location: Germany

Re: MenuManipulator 20140526

Post by bege »

Your knowledge really amazes me =D>
dorando wrote:To be expected due to the way the id is generated, you could try to add a new menuitem to the MenuManipulator window with the following ...

After many other changes it still works. Thank you.
dorando wrote:You could try to edit the multipletab-insertafter or multipletab-insertbefore attributes of those menuitems (inside multipletab-tabcontext-menu-template) to change their positions.

That works for menu items. It doesn't work for menu separators. To attach or detach any item to a separator or to add a separator makes all changes undone.
So it isn't "perfect" but good enough to live with it. Thank you.

I don't understand this:
dorando wrote:Note that you also might want to add

Code: Select all

(item.setAttribute("userdefined",""), 
before, and

Code: Select all

) 
after those attributes to hide them from MenuManipulator (otherwise other changes might be affected).

Where to add and what is it for?
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: MenuManipulator 20140526

Post by dorando »

bege wrote:Where to add and what is it for?
To the multipletab-insertafter or multipletab-insertbefore attributes. If an item has the userdefined attribute, MenuManipulator won't display that item and won't use it as reference point for calculating positions (which fails for those). Note that you can't add that attribute to the template items, otherwise MenuManipulator would discard changes made to them.

For items without multipletab-insertafter or multipletab-insertbefore you could add one containing

Code: Select all

(item.setAttribute("userdefined",""), null) 
Support mozilla.dorando.at through donations/contributions.
bege
Posts: 153
Joined: January 23rd, 2009, 9:14 pm
Location: Germany

Re: MenuManipulator 20140526

Post by bege »

Hi,
in Firefox 30 several menu items with hidden:true show up again, e.g.
in main context menu
- context-bookmarkpage
- context-savepage
in tools menu
- sync-setup
and app menu
- sync-setup-appmenu

Regards
Post Reply