Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: lib/ui.js

Issue 9052057: Fixed some sloppy programming causing null access keys to show up in the menu in Firefox 20 (Closed)
Patch Set: Created Dec. 19, 2012, 1:25 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of the Adblock Plus, 2 * This file is part of the Adblock Plus,
3 * Copyright (C) 2006-2012 Eyeo GmbH 3 * Copyright (C) 2006-2012 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after
1634 { 1634 {
1635 let item = items[i]; 1635 let item = items[i];
1636 let match = /^abp-key-/.exec(item.getAttribute("key")); 1636 let match = /^abp-key-/.exec(item.getAttribute("key"));
1637 if (!match) 1637 if (!match)
1638 continue; 1638 continue;
1639 1639
1640 let name = match.input.substr(match.index + match[0].length); 1640 let name = match.input.substr(match.index + match[0].length);
1641 if (!this.hotkeys) 1641 if (!this.hotkeys)
1642 this.configureKeys(window); 1642 this.configureKeys(window);
1643 if (name in this.hotkeys) 1643 if (name in this.hotkeys)
1644 item.setAttribute("acceltext", KeySelector.getTextForKey(this.hotkeys[na me])); 1644 {
1645 let text = KeySelector.getTextForKey(this.hotkeys[name]);
1646 if (text)
1647 item.setAttribute("acceltext", text);
1648 else
1649 item.removeAttribute("acceltext");
1650 }
1645 } 1651 }
1646 1652
1647 hideElement(prefix + "contributebutton", Prefs.hideContributeButton); 1653 hideElement(prefix + "contributebutton", Prefs.hideContributeButton);
1648 }, 1654 },
1649 1655
1650 /** 1656 /**
1651 * Adds Adblock Plus menu items to the content area context menu when it shows 1657 * Adds Adblock Plus menu items to the content area context menu when it shows
1652 * up. 1658 * up.
1653 */ 1659 */
1654 fillContentContextMenu: function(/**Element*/ popup) 1660 fillContentContextMenu: function(/**Element*/ popup)
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
1922 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)], 1928 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)],
1923 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)] 1929 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)]
1924 ]; 1930 ];
1925 1931
1926 onShutdown.add(function() 1932 onShutdown.add(function()
1927 { 1933 {
1928 for (let window in UI.applicationWindows) 1934 for (let window in UI.applicationWindows)
1929 if (UI.isBottombarOpen(window)) 1935 if (UI.isBottombarOpen(window))
1930 UI.toggleBottombar(window); 1936 UI.toggleBottombar(window);
1931 }); 1937 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld