MozillaZine

MenuManipulator 20140526

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

Post Posted November 24th, 2013, 2:42 pm

How to restore default or at least detect changes?

And how to delete attributes?

dorando
 
Posts: 1203
Joined: January 9th, 2004, 9:57 am

Post Posted February 3rd, 2014, 3:10 pm

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: 110
Joined: January 23rd, 2009, 9:14 pm
Location: Germany

Post Posted February 4th, 2014, 9:53 am

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

Wow, that's wizardry!

bege
 
Posts: 110
Joined: January 23rd, 2009, 9:14 pm
Location: Germany

Post Posted May 27th, 2014, 11:45 am

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

Post Posted May 28th, 2014, 2:10 pm

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: 110
Joined: January 23rd, 2009, 9:14 pm
Location: Germany

Post Posted May 29th, 2014, 10:53 am

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: 110
Joined: January 23rd, 2009, 9:14 pm
Location: Germany

Post Posted May 29th, 2014, 12:09 pm

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

Post Posted May 30th, 2014, 3:09 pm

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: 110
Joined: January 23rd, 2009, 9:14 pm
Location: Germany

Post Posted May 30th, 2014, 3:30 pm

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: 110
Joined: January 23rd, 2009, 9:14 pm
Location: Germany

Post Posted May 30th, 2014, 3:52 pm

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: 110
Joined: January 23rd, 2009, 9:14 pm
Location: Germany

Post Posted May 30th, 2014, 4:35 pm

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

Post Posted June 1st, 2014, 1:50 pm

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: 110
Joined: January 23rd, 2009, 9:14 pm
Location: Germany

Post Posted June 2nd, 2014, 10:44 am

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

Post Posted June 3rd, 2014, 9:43 am

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: 110
Joined: January 23rd, 2009, 9:14 pm
Location: Germany

Post Posted June 13th, 2014, 2:15 am

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

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 2 guests