mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-08 08:17:31 +09:00
[Pale-Moon] Issue MoonchildProductions/UXP#516 - Remove named function syntax from palemoon/modules.
This commit is contained in:
parent
addf7b2fb1
commit
95492157f1
6 changed files with 74 additions and 74 deletions
|
|
@ -65,13 +65,13 @@ function _handleEvent(aEvent) {
|
|||
|
||||
// Methods that impact a browser. Put into single object for organization.
|
||||
var BrowserHelper = {
|
||||
onOpen: function NP_BH_onOpen(aBrowser) {
|
||||
onOpen: function (aBrowser) {
|
||||
// If the tab is in the focused window, leave priority as it is
|
||||
if (aBrowser.ownerDocument.defaultView != _lastFocusedWindow)
|
||||
this.decreasePriority(aBrowser);
|
||||
},
|
||||
|
||||
onSelect: function NP_BH_onSelect(aBrowser) {
|
||||
onSelect: function (aBrowser) {
|
||||
let windowEntry = WindowHelper.getEntry(aBrowser.ownerDocument.defaultView);
|
||||
if (windowEntry.lastSelectedBrowser)
|
||||
this.decreasePriority(windowEntry.lastSelectedBrowser);
|
||||
|
|
@ -80,11 +80,11 @@ var BrowserHelper = {
|
|||
windowEntry.lastSelectedBrowser = aBrowser;
|
||||
},
|
||||
|
||||
increasePriority: function NP_BH_increasePriority(aBrowser) {
|
||||
increasePriority: function (aBrowser) {
|
||||
aBrowser.adjustPriority(PRIORITY_DELTA);
|
||||
},
|
||||
|
||||
decreasePriority: function NP_BH_decreasePriority(aBrowser) {
|
||||
decreasePriority: function (aBrowser) {
|
||||
aBrowser.adjustPriority(PRIORITY_DELTA * -1);
|
||||
}
|
||||
};
|
||||
|
|
@ -92,7 +92,7 @@ var BrowserHelper = {
|
|||
|
||||
// Methods that impact a window. Put into single object for organization.
|
||||
var WindowHelper = {
|
||||
addWindow: function NP_WH_addWindow(aWindow) {
|
||||
addWindow: function (aWindow) {
|
||||
// Build internal data object
|
||||
_windows.push({ window: aWindow, lastSelectedBrowser: null });
|
||||
|
||||
|
|
@ -115,7 +115,7 @@ var WindowHelper = {
|
|||
BrowserHelper.onSelect(aWindow.gBrowser.selectedBrowser);
|
||||
},
|
||||
|
||||
removeWindow: function NP_WH_removeWindow(aWindow) {
|
||||
removeWindow: function (aWindow) {
|
||||
if (aWindow == _lastFocusedWindow)
|
||||
_lastFocusedWindow = null;
|
||||
|
||||
|
|
@ -131,7 +131,7 @@ var WindowHelper = {
|
|||
});
|
||||
},
|
||||
|
||||
onActivate: function NP_WH_onActivate(aWindow, aHasFocus) {
|
||||
onActivate: function (aWindow, aHasFocus) {
|
||||
// If this window was the last focused window, we don't need to do anything
|
||||
if (aWindow == _lastFocusedWindow)
|
||||
return;
|
||||
|
|
@ -143,7 +143,7 @@ var WindowHelper = {
|
|||
this.increasePriority(aWindow);
|
||||
},
|
||||
|
||||
handleFocusedWindow: function NP_WH_handleFocusedWindow(aWindow) {
|
||||
handleFocusedWindow: function (aWindow) {
|
||||
// If we have a last focused window, we need to deprioritize it first
|
||||
if (_lastFocusedWindow)
|
||||
this.decreasePriority(_lastFocusedWindow);
|
||||
|
|
@ -153,23 +153,23 @@ var WindowHelper = {
|
|||
},
|
||||
|
||||
// Auxiliary methods
|
||||
increasePriority: function NP_WH_increasePriority(aWindow) {
|
||||
increasePriority: function (aWindow) {
|
||||
aWindow.gBrowser.browsers.forEach(function(aBrowser) {
|
||||
BrowserHelper.increasePriority(aBrowser);
|
||||
});
|
||||
},
|
||||
|
||||
decreasePriority: function NP_WH_decreasePriority(aWindow) {
|
||||
decreasePriority: function (aWindow) {
|
||||
aWindow.gBrowser.browsers.forEach(function(aBrowser) {
|
||||
BrowserHelper.decreasePriority(aBrowser);
|
||||
});
|
||||
},
|
||||
|
||||
getEntry: function NP_WH_getEntry(aWindow) {
|
||||
getEntry: function (aWindow) {
|
||||
return _windows[this.getEntryIndex(aWindow)];
|
||||
},
|
||||
|
||||
getEntryIndex: function NP_WH_getEntryAtIndex(aWindow) {
|
||||
getEntryIndex: function (aWindow) {
|
||||
// Assumes that every object has a unique window & it's in the array
|
||||
for (let i = 0; i < _windows.length; i++)
|
||||
if (_windows[i].window == aWindow)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue