mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-20 15:27:32 +09:00
[Basilisk] Issue MoonchildProductions/UXP#516 - Remove named function syntax from basilisk/components/places.
This commit is contained in:
parent
d546845b66
commit
1cceb703f1
9 changed files with 211 additions and 211 deletions
|
|
@ -222,17 +222,17 @@ PlacesViewBase.prototype = {
|
|||
index, orientation, tagName);
|
||||
},
|
||||
|
||||
buildContextMenu: function PVB_buildContextMenu(aPopup) {
|
||||
buildContextMenu: function(aPopup) {
|
||||
this._contextMenuShown = aPopup;
|
||||
window.updateCommands("places");
|
||||
return this.controller.buildContextMenu(aPopup);
|
||||
},
|
||||
|
||||
destroyContextMenu: function PVB_destroyContextMenu(aPopup) {
|
||||
destroyContextMenu: function(aPopup) {
|
||||
this._contextMenuShown = null;
|
||||
},
|
||||
|
||||
_cleanPopup: function PVB_cleanPopup(aPopup, aDelay) {
|
||||
_cleanPopup: function(aPopup, aDelay) {
|
||||
// Remove Places nodes from the popup.
|
||||
let child = aPopup._startMarker;
|
||||
while (child.nextSibling != aPopup._endMarker) {
|
||||
|
|
@ -255,7 +255,7 @@ PlacesViewBase.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
_rebuildPopup: function PVB__rebuildPopup(aPopup) {
|
||||
_rebuildPopup: function(aPopup) {
|
||||
let resultNode = aPopup._placesNode;
|
||||
if (!resultNode.containerOpen)
|
||||
return;
|
||||
|
|
@ -284,7 +284,7 @@ PlacesViewBase.prototype = {
|
|||
aPopup._built = true;
|
||||
},
|
||||
|
||||
_removeChild: function PVB__removeChild(aChild) {
|
||||
_removeChild: function(aChild) {
|
||||
// If document.popupNode pointed to this child, null it out,
|
||||
// otherwise controller's command-updating may rely on the removed
|
||||
// item still being "selected".
|
||||
|
|
@ -487,7 +487,7 @@ PlacesViewBase.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
toggleCutNode: function PVB_toggleCutNode(aPlacesNode, aValue) {
|
||||
toggleCutNode: function(aPlacesNode, aValue) {
|
||||
let elt = this._getDOMNodeForPlacesNode(aPlacesNode);
|
||||
|
||||
// We may get the popup for menus, but we need the menu itself.
|
||||
|
|
@ -499,7 +499,7 @@ PlacesViewBase.prototype = {
|
|||
elt.removeAttribute("cutting");
|
||||
},
|
||||
|
||||
nodeURIChanged: function PVB_nodeURIChanged(aPlacesNode, aURIString) {
|
||||
nodeURIChanged: function(aPlacesNode, aURIString) {
|
||||
let elt = this._getDOMNodeForPlacesNode(aPlacesNode);
|
||||
|
||||
// Here we need the <menu>.
|
||||
|
|
@ -509,7 +509,7 @@ PlacesViewBase.prototype = {
|
|||
elt.setAttribute("scheme", PlacesUIUtils.guessUrlSchemeForUI(aURIString));
|
||||
},
|
||||
|
||||
nodeIconChanged: function PVB_nodeIconChanged(aPlacesNode) {
|
||||
nodeIconChanged: function(aPlacesNode) {
|
||||
let elt = this._getDOMNodeForPlacesNode(aPlacesNode);
|
||||
|
||||
// There's no UI representation for the root node, thus there's nothing to
|
||||
|
|
@ -701,7 +701,7 @@ PlacesViewBase.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
_populateLivemarkPopup: function PVB__populateLivemarkPopup(aPopup)
|
||||
_populateLivemarkPopup: function(aPopup)
|
||||
{
|
||||
this._setLivemarkSiteURIMenuItem(aPopup);
|
||||
// Show the loading status only if there are no entries yet.
|
||||
|
|
@ -731,7 +731,7 @@ PlacesViewBase.prototype = {
|
|||
}, Components.utils.reportError);
|
||||
},
|
||||
|
||||
invalidateContainer: function PVB_invalidateContainer(aPlacesNode) {
|
||||
invalidateContainer: function(aPlacesNode) {
|
||||
let elt = this._getDOMNodeForPlacesNode(aPlacesNode);
|
||||
elt._built = false;
|
||||
|
||||
|
|
@ -740,7 +740,7 @@ PlacesViewBase.prototype = {
|
|||
this._rebuildPopup(elt);
|
||||
},
|
||||
|
||||
uninit: function PVB_uninit() {
|
||||
uninit: function() {
|
||||
if (this._result) {
|
||||
this._result.removeObserver(this);
|
||||
this._resultNode.containerOpen = false;
|
||||
|
|
@ -783,7 +783,7 @@ PlacesViewBase.prototype = {
|
|||
* @param aPopup
|
||||
* a Places popup.
|
||||
*/
|
||||
_mayAddCommandsItems: function PVB__mayAddCommandsItems(aPopup) {
|
||||
_mayAddCommandsItems: function(aPopup) {
|
||||
// The command items are never added to the root popup.
|
||||
if (aPopup == this._rootElt)
|
||||
return;
|
||||
|
|
@ -860,7 +860,7 @@ PlacesViewBase.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
_ensureMarkers: function PVB__ensureMarkers(aPopup) {
|
||||
_ensureMarkers: function(aPopup) {
|
||||
if (aPopup._startMarker)
|
||||
return;
|
||||
|
||||
|
|
@ -904,7 +904,7 @@ PlacesViewBase.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
_onPopupShowing: function PVB__onPopupShowing(aEvent) {
|
||||
_onPopupShowing: function(aEvent) {
|
||||
// Avoid handling popupshowing of inner views.
|
||||
let popup = aEvent.originalTarget;
|
||||
|
||||
|
|
@ -991,7 +991,7 @@ PlacesToolbar.prototype = {
|
|||
_cbEvents: ["dragstart", "dragover", "dragexit", "dragend", "drop",
|
||||
"mousemove", "mouseover", "mouseout"],
|
||||
|
||||
QueryInterface: function PT_QueryInterface(aIID) {
|
||||
QueryInterface: function(aIID) {
|
||||
if (aIID.equals(Ci.nsIDOMEventListener) ||
|
||||
aIID.equals(Ci.nsITimerCallback))
|
||||
return this;
|
||||
|
|
@ -999,7 +999,7 @@ PlacesToolbar.prototype = {
|
|||
return PlacesViewBase.prototype.QueryInterface.apply(this, arguments);
|
||||
},
|
||||
|
||||
uninit: function PT_uninit() {
|
||||
uninit: function() {
|
||||
this._removeEventListeners(this._viewElt, this._cbEvents, false);
|
||||
this._removeEventListeners(this._rootElt, ["popupshowing", "popuphidden"],
|
||||
true);
|
||||
|
|
@ -1017,7 +1017,7 @@ PlacesToolbar.prototype = {
|
|||
_openedMenuButton: null,
|
||||
_allowPopupShowing: true,
|
||||
|
||||
_rebuild: function PT__rebuild() {
|
||||
_rebuild: function() {
|
||||
// Clear out references to existing nodes, since they will be removed
|
||||
// and re-added.
|
||||
if (this._overFolder.elt)
|
||||
|
|
@ -1120,7 +1120,7 @@ PlacesToolbar.prototype = {
|
|||
this._updateChevronPopupNodesVisibility();
|
||||
},
|
||||
|
||||
handleEvent: function PT_handleEvent(aEvent) {
|
||||
handleEvent: function(aEvent) {
|
||||
switch (aEvent.type) {
|
||||
case "unload":
|
||||
this.uninit();
|
||||
|
|
@ -1188,12 +1188,12 @@ PlacesToolbar.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
_isOverflowStateEventRelevant: function PT_isOverflowStateEventRelevant(aEvent) {
|
||||
_isOverflowStateEventRelevant: function(aEvent) {
|
||||
// Ignore events not aimed at ourselves, as well as purely vertical ones:
|
||||
return aEvent.target == aEvent.currentTarget && aEvent.detail > 0;
|
||||
},
|
||||
|
||||
_onOverflow: function PT_onOverflow() {
|
||||
_onOverflow: function() {
|
||||
// Attach the popup binding to the chevron popup if it has not yet
|
||||
// been initialized.
|
||||
if (!this._chevronPopup.hasAttribute("type")) {
|
||||
|
|
@ -1204,12 +1204,12 @@ PlacesToolbar.prototype = {
|
|||
this.updateChevron();
|
||||
},
|
||||
|
||||
_onUnderflow: function PT_onUnderflow() {
|
||||
_onUnderflow: function() {
|
||||
this.updateChevron();
|
||||
this._chevron.collapsed = true;
|
||||
},
|
||||
|
||||
updateChevron: function PT_updateChevron() {
|
||||
updateChevron: function() {
|
||||
// If the chevron is collapsed there's nothing to update.
|
||||
if (this._chevron.collapsed)
|
||||
return;
|
||||
|
|
@ -1222,7 +1222,7 @@ PlacesToolbar.prototype = {
|
|||
this._updateChevronTimer = this._setTimer(100);
|
||||
},
|
||||
|
||||
_updateChevronTimerCallback: function PT__updateChevronTimerCallback() {
|
||||
_updateChevronTimerCallback: function() {
|
||||
let scrollRect = this._rootElt.getBoundingClientRect();
|
||||
let childOverflowed = false;
|
||||
for (let i = 0; i < this._rootElt.childNodes.length; i++) {
|
||||
|
|
@ -1337,7 +1337,7 @@ PlacesToolbar.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
nodeTitleChanged: function PT_nodeTitleChanged(aPlacesNode, aNewTitle) {
|
||||
nodeTitleChanged: function(aPlacesNode, aNewTitle) {
|
||||
let elt = this._getDOMNodeForPlacesNode(aPlacesNode);
|
||||
|
||||
// There's no UI representation for the root node, thus there's
|
||||
|
|
@ -1357,7 +1357,7 @@ PlacesToolbar.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
invalidateContainer: function PT_invalidateContainer(aPlacesNode) {
|
||||
invalidateContainer: function(aPlacesNode) {
|
||||
let elt = this._getDOMNodeForPlacesNode(aPlacesNode);
|
||||
if (elt == this._rootElt) {
|
||||
// Container is the toolbar itself.
|
||||
|
|
@ -1373,7 +1373,7 @@ PlacesToolbar.prototype = {
|
|||
hoverTime: 350,
|
||||
closeTimer: null },
|
||||
|
||||
_clearOverFolder: function PT__clearOverFolder() {
|
||||
_clearOverFolder: function() {
|
||||
// The mouse is no longer dragging over the stored menubutton.
|
||||
// Close the menubutton, clear out drag styles, and clear all
|
||||
// timers for opening/closing it.
|
||||
|
|
@ -1401,7 +1401,7 @@ PlacesToolbar.prototype = {
|
|||
* - beforeIndex: child index to drop before, for the drop indicator.
|
||||
* - folderElt: the folder to drop into, if applicable.
|
||||
*/
|
||||
_getDropPoint: function PT__getDropPoint(aEvent) {
|
||||
_getDropPoint: function(aEvent) {
|
||||
if (!PlacesUtils.nodeIsFolder(this._resultNode))
|
||||
return null;
|
||||
|
||||
|
|
@ -1485,13 +1485,13 @@ PlacesToolbar.prototype = {
|
|||
return dropPoint;
|
||||
},
|
||||
|
||||
_setTimer: function PT_setTimer(aTime) {
|
||||
_setTimer: function(aTime) {
|
||||
let timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
||||
timer.initWithCallback(this, aTime, timer.TYPE_ONE_SHOT);
|
||||
return timer;
|
||||
},
|
||||
|
||||
notify: function PT_notify(aTimer) {
|
||||
notify: function(aTimer) {
|
||||
if (aTimer == this._updateChevronTimer) {
|
||||
this._updateChevronTimer = null;
|
||||
this._updateChevronTimerCallback();
|
||||
|
|
@ -1536,18 +1536,18 @@ PlacesToolbar.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
_onMouseOver: function PT__onMouseOver(aEvent) {
|
||||
_onMouseOver: function(aEvent) {
|
||||
let button = aEvent.target;
|
||||
if (button.parentNode == this._rootElt && button._placesNode &&
|
||||
PlacesUtils.nodeIsURI(button._placesNode))
|
||||
window.XULBrowserWindow.setOverLink(aEvent.target._placesNode.uri, null);
|
||||
},
|
||||
|
||||
_onMouseOut: function PT__onMouseOut(aEvent) {
|
||||
_onMouseOut: function(aEvent) {
|
||||
window.XULBrowserWindow.setOverLink("", null);
|
||||
},
|
||||
|
||||
_cleanupDragDetails: function PT__cleanupDragDetails() {
|
||||
_cleanupDragDetails: function() {
|
||||
// Called on dragend and drop.
|
||||
PlacesControllerDragHelper.currentDropTarget = null;
|
||||
this._draggedElt = null;
|
||||
|
|
@ -1557,7 +1557,7 @@ PlacesToolbar.prototype = {
|
|||
this._dropIndicator.collapsed = true;
|
||||
},
|
||||
|
||||
_onDragStart: function PT__onDragStart(aEvent) {
|
||||
_onDragStart: function(aEvent) {
|
||||
// Sub menus have their own d&d handlers.
|
||||
let draggedElt = aEvent.target;
|
||||
if (draggedElt.parentNode != this._rootElt || !draggedElt._placesNode)
|
||||
|
|
@ -1592,7 +1592,7 @@ PlacesToolbar.prototype = {
|
|||
aEvent.stopPropagation();
|
||||
},
|
||||
|
||||
_onDragOver: function PT__onDragOver(aEvent) {
|
||||
_onDragOver: function(aEvent) {
|
||||
// Cache the dataTransfer
|
||||
PlacesControllerDragHelper.currentDropTarget = aEvent.target;
|
||||
let dt = aEvent.dataTransfer;
|
||||
|
|
@ -1669,7 +1669,7 @@ PlacesToolbar.prototype = {
|
|||
aEvent.stopPropagation();
|
||||
},
|
||||
|
||||
_onDrop: function PT__onDrop(aEvent) {
|
||||
_onDrop: function(aEvent) {
|
||||
PlacesControllerDragHelper.currentDropTarget = aEvent.target;
|
||||
|
||||
let dropPoint = this._getDropPoint(aEvent);
|
||||
|
|
@ -1683,7 +1683,7 @@ PlacesToolbar.prototype = {
|
|||
aEvent.stopPropagation();
|
||||
},
|
||||
|
||||
_onDragExit: function PT__onDragExit(aEvent) {
|
||||
_onDragExit: function(aEvent) {
|
||||
PlacesControllerDragHelper.currentDropTarget = null;
|
||||
|
||||
// Set timer to turn off indicator bar (if we turn it off
|
||||
|
|
@ -1698,11 +1698,11 @@ PlacesToolbar.prototype = {
|
|||
this._overFolder.closeTimer = this._setTimer(this._overFolder.hoverTime);
|
||||
},
|
||||
|
||||
_onDragEnd: function PT_onDragEnd(aEvent) {
|
||||
_onDragEnd: function(aEvent) {
|
||||
this._cleanupDragDetails();
|
||||
},
|
||||
|
||||
_onPopupShowing: function PT__onPopupShowing(aEvent) {
|
||||
_onPopupShowing: function(aEvent) {
|
||||
if (!this._allowPopupShowing) {
|
||||
this._allowPopupShowing = true;
|
||||
aEvent.preventDefault();
|
||||
|
|
@ -1716,7 +1716,7 @@ PlacesToolbar.prototype = {
|
|||
PlacesViewBase.prototype._onPopupShowing.apply(this, arguments);
|
||||
},
|
||||
|
||||
_onPopupHidden: function PT__onPopupHidden(aEvent) {
|
||||
_onPopupHidden: function(aEvent) {
|
||||
let popup = aEvent.target;
|
||||
let placesNode = popup._placesNode;
|
||||
// Avoid handling popuphidden of inner views
|
||||
|
|
@ -1742,7 +1742,7 @@ PlacesToolbar.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
_onMouseMove: function PT__onMouseMove(aEvent) {
|
||||
_onMouseMove: function(aEvent) {
|
||||
// Used in dragStart to prevent dragging folders when dragging down.
|
||||
this._cachedMouseMoveEvent = aEvent;
|
||||
|
||||
|
|
@ -1788,18 +1788,18 @@ function PlacesMenu(aPopupShowingEvent, aPlace, aOptions) {
|
|||
PlacesMenu.prototype = {
|
||||
__proto__: PlacesViewBase.prototype,
|
||||
|
||||
QueryInterface: function PM_QueryInterface(aIID) {
|
||||
QueryInterface: function(aIID) {
|
||||
if (aIID.equals(Ci.nsIDOMEventListener))
|
||||
return this;
|
||||
|
||||
return PlacesViewBase.prototype.QueryInterface.apply(this, arguments);
|
||||
},
|
||||
|
||||
_removeChild: function PM_removeChild(aChild) {
|
||||
_removeChild: function(aChild) {
|
||||
PlacesViewBase.prototype._removeChild.apply(this, arguments);
|
||||
},
|
||||
|
||||
uninit: function PM_uninit() {
|
||||
uninit: function() {
|
||||
this._removeEventListeners(this._rootElt, ["popupshowing", "popuphidden"],
|
||||
true);
|
||||
this._removeEventListeners(window, ["unload"], false);
|
||||
|
|
@ -1807,7 +1807,7 @@ PlacesMenu.prototype = {
|
|||
PlacesViewBase.prototype.uninit.apply(this, arguments);
|
||||
},
|
||||
|
||||
handleEvent: function PM_handleEvent(aEvent) {
|
||||
handleEvent: function(aEvent) {
|
||||
switch (aEvent.type) {
|
||||
case "unload":
|
||||
this.uninit();
|
||||
|
|
@ -1821,7 +1821,7 @@ PlacesMenu.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
_onPopupHidden: function PM__onPopupHidden(aEvent) {
|
||||
_onPopupHidden: function(aEvent) {
|
||||
// Avoid handling popuphidden of inner views.
|
||||
let popup = aEvent.originalTarget;
|
||||
let placesNode = popup._placesNode;
|
||||
|
|
@ -1856,11 +1856,11 @@ function PlacesPanelMenuView(aPlace, aViewId, aRootId, aOptions) {
|
|||
PlacesPanelMenuView.prototype = {
|
||||
__proto__: PlacesViewBase.prototype,
|
||||
|
||||
QueryInterface: function PAMV_QueryInterface(aIID) {
|
||||
QueryInterface: function(aIID) {
|
||||
return PlacesViewBase.prototype.QueryInterface.apply(this, arguments);
|
||||
},
|
||||
|
||||
uninit: function PAMV_uninit() {
|
||||
uninit: function() {
|
||||
PlacesViewBase.prototype.uninit.apply(this, arguments);
|
||||
},
|
||||
|
||||
|
|
@ -1969,7 +1969,7 @@ PlacesPanelMenuView.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
nodeTitleChanged: function PAMV_nodeTitleChanged(aPlacesNode, aNewTitle) {
|
||||
nodeTitleChanged: function(aPlacesNode, aNewTitle) {
|
||||
let elt = this._getDOMNodeForPlacesNode(aPlacesNode);
|
||||
|
||||
// There's no UI representation for the root node.
|
||||
|
|
@ -1979,7 +1979,7 @@ PlacesPanelMenuView.prototype = {
|
|||
PlacesViewBase.prototype.nodeTitleChanged.apply(this, arguments);
|
||||
},
|
||||
|
||||
invalidateContainer: function PAMV_invalidateContainer(aPlacesNode) {
|
||||
invalidateContainer: function(aPlacesNode) {
|
||||
let elt = this._getDOMNodeForPlacesNode(aPlacesNode);
|
||||
if (elt != this._rootElt)
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue