зеркало из https://github.com/mozilla/pjs.git
bug 441794 — User configurable keyboard shortcuts: address further review comments, and fix a js error and warning
This commit is contained in:
Родитель
161e923c61
Коммит
c98c41eb6e
|
@ -355,8 +355,12 @@ var BrowserUI = {
|
|||
|
||||
let newLeft = -tabbarW;
|
||||
switch (aMode) {
|
||||
case UIMODE_NONE:
|
||||
Shortcuts.deinit();
|
||||
break;
|
||||
case UIMODE_PANEL:
|
||||
newLeft = -browserW;
|
||||
this._initPanel();
|
||||
break;
|
||||
case UIMODE_CONTROLS:
|
||||
newLeft = -(tabbarW + sidebarW);
|
||||
|
@ -378,19 +382,16 @@ var BrowserUI = {
|
|||
sidebar.left = newLeft + tabbarW + browserW;
|
||||
panelUI.left = newLeft + tabbarW + browserW + sidebarW;
|
||||
panelUI.width = browserW;
|
||||
},
|
||||
|
||||
if (aMode == UIMODE_NONE)
|
||||
Shortcuts.deinit();
|
||||
else
|
||||
{
|
||||
let addons = document.getElementById("addons-container");
|
||||
if (addons.getAttribute("src") == "")
|
||||
addons.setAttribute("src", "chrome://mozapps/content/extensions/extensions.xul");
|
||||
let dloads = document.getElementById("downloads-container");
|
||||
if (dloads.getAttribute("src") == "")
|
||||
dloads.setAttribute("src", "chrome://mozapps/content/downloads/downloads.xul");
|
||||
Shortcuts.init();
|
||||
}
|
||||
_initPanel : function() {
|
||||
let addons = document.getElementById("addons-container");
|
||||
if (!addons.hasAttribute("src"))
|
||||
addons.setAttribute("src", "chrome://mozapps/content/extensions/extensions.xul");
|
||||
let dloads = document.getElementById("downloads-container");
|
||||
if (!dloads.hasAttribute("src"))
|
||||
dloads.setAttribute("src", "chrome://mozapps/content/downloads/downloads.xul");
|
||||
Shortcuts.init();
|
||||
},
|
||||
|
||||
_sizeControls : function(aEvent) {
|
||||
|
@ -443,7 +444,6 @@ var BrowserUI = {
|
|||
|
||||
window.addEventListener("resize", this, false);
|
||||
Shortcuts.restore();
|
||||
Shortcuts.test();
|
||||
},
|
||||
|
||||
update : function(aState, aBrowser) {
|
||||
|
|
|
@ -156,7 +156,7 @@ var Browser = {
|
|||
var phs = Components.classes["@mozilla.org/plugin/host;1"]
|
||||
.getService(Components.interfaces.nsIPluginHost);
|
||||
var plugins = phs.getPluginTags({ });
|
||||
for (i = 0; i < plugins.length; ++i)
|
||||
for (var i = 0; i < plugins.length; ++i)
|
||||
plugins[i].disabled = state;
|
||||
},
|
||||
|
||||
|
@ -549,7 +549,7 @@ nsBrowserAccess.prototype =
|
|||
newWindow = aOpener ? aOpener.top : browser.contentWindow;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
var referrer;
|
||||
if (aURI) {
|
||||
|
|
|
@ -107,9 +107,7 @@
|
|||
|
||||
<!-- scrolling -->
|
||||
<command id="cmd_scrollPageUp" oncommand="CommandUpdater.doCommand(this.id);"/>
|
||||
<command id="cmd_scrollToBeginning" oncommand="CommandUpdater.doCommand(this.id);"/>
|
||||
<command id="cmd_scrollPageDown" oncommand="CommandUpdater.doCommand(this.id);"/>
|
||||
<command id="cmd_scrollToEnd" oncommand="CommandUpdater.doCommand(this.id);"/>
|
||||
|
||||
<!-- editing -->
|
||||
<command id="cmd_cut" label="&cut.label;" oncommand="CommandUpdater.doCommand(this.id);"/>
|
||||
|
@ -250,8 +248,8 @@
|
|||
<toolbarbutton id="tool-shortcuts" class="browser-control-button" oncommand="this.parentNode.nextSibling.selectedIndex=3;"/>
|
||||
</vbox>
|
||||
<deck id="panel-items" flex="1">
|
||||
<iframe id="addons-container" flex="1" src=""/>
|
||||
<iframe id="downloads-container" flex="1" src=""/>
|
||||
<iframe id="addons-container" flex="1"/>
|
||||
<iframe id="downloads-container" flex="1"/>
|
||||
|
||||
<vbox id="prefs-container">
|
||||
<hbox pack="center" id="buttons"/>
|
||||
|
|
|
@ -192,7 +192,7 @@ function ShortcutEditor()
|
|||
|
||||
var result;
|
||||
for each (m in modifiers.split(/,\s*|\s+/))
|
||||
result |= modifierFlags[m];
|
||||
result |= m in modifierFlags && modifierFlags[m];
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче