[Pale-Moon] Issue MoonchildProductions/UXP#516 - Remove named function syntax from palemoon/components/newtab.

pull/24/head
athenian200 3 years ago committed by Roy Tam
parent f5a1756738
commit 3d1be0ea0f
  1. 6
      application/palemoon/components/newtab/cells.js
  2. 10
      application/palemoon/components/newtab/drag.js
  3. 2
      application/palemoon/components/newtab/dragDataHelper.js
  4. 16
      application/palemoon/components/newtab/drop.js
  5. 16
      application/palemoon/components/newtab/dropPreview.js
  6. 2
      application/palemoon/components/newtab/dropTargetShim.js
  7. 14
      application/palemoon/components/newtab/grid.js
  8. 12
      application/palemoon/components/newtab/page.js
  9. 30
      application/palemoon/components/newtab/sites.js
  10. 30
      application/palemoon/components/newtab/transformations.js
  11. 12
      application/palemoon/components/newtab/undo.js
  12. 14
      application/palemoon/components/newtab/updater.js

@ -81,7 +81,7 @@ Cell.prototype = {
* Checks whether the cell contains a pinned site.
* @return Whether the cell contains a pinned site.
*/
containsPinnedSite: function Cell_containsPinnedSite() {
containsPinnedSite: function () {
let site = this.site;
return site && site.isPinned();
},
@ -90,14 +90,14 @@ Cell.prototype = {
* Checks whether the cell contains a site (is empty).
* @return Whether the cell is empty.
*/
isEmpty: function Cell_isEmpty() {
isEmpty: function () {
return !this.site;
},
/**
* Handles all cell events.
*/
handleEvent: function Cell_handleEvent(aEvent) {
handleEvent: function (aEvent) {
// We're not responding to external drag/drop events
// when our parent window is in private browsing mode.
if (inPrivateBrowsingMode() && !gDrag.draggedSite)

@ -33,7 +33,7 @@ var gDrag = {
* @param aSite The site that's being dragged.
* @param aEvent The 'dragstart' event.
*/
start: function Drag_start(aSite, aEvent) {
start: function (aSite, aEvent) {
this._draggedSite = aSite;
// Mark nodes as being dragged.
@ -66,7 +66,7 @@ var gDrag = {
* @param aSite The site that's being dragged.
* @param aEvent The 'drag' event.
*/
drag: function Drag_drag(aSite, aEvent) {
drag: function (aSite, aEvent) {
// Get the viewport size.
let {clientWidth, clientHeight} = document.documentElement;
@ -90,7 +90,7 @@ var gDrag = {
* @param aSite The site that's being dragged.
* @param aEvent The 'dragend' event.
*/
end: function Drag_end(aSite, aEvent) {
end: function (aSite, aEvent) {
let nodes = gGrid.node.querySelectorAll("[dragged]")
for (let i = 0; i < nodes.length; i++)
nodes[i].removeAttribute("dragged");
@ -106,7 +106,7 @@ var gDrag = {
* @param aEvent The drag event to check.
* @return Whether we should handle this drag and drop operation.
*/
isValid: function Drag_isValid(aEvent) {
isValid: function (aEvent) {
let link = gDragDataHelper.getLinkFromDragEvent(aEvent);
// Check that the drag data is non-empty.
@ -125,7 +125,7 @@ var gDrag = {
* @param aSite The site that's being dragged.
* @param aEvent The 'dragstart' event.
*/
_setDragData: function Drag_setDragData(aSite, aEvent) {
_setDragData: function (aSite, aEvent) {
let {url, title} = aSite;
let dt = aEvent.dataTransfer;

@ -9,7 +9,7 @@ var gDragDataHelper = {
return "text/x-moz-url";
},
getLinkFromDragEvent: function DragDataHelper_getLinkFromDragEvent(aEvent) {
getLinkFromDragEvent: function (aEvent) {
let dt = aEvent.dataTransfer;
if (!dt || !dt.types.includes(this.mimeType)) {
return null;

@ -21,7 +21,7 @@ var gDrop = {
* Handles the 'dragenter' event.
* @param aCell The drop target cell.
*/
enter: function Drop_enter(aCell) {
enter: function (aCell) {
this._delayedRearrange(aCell);
},
@ -30,7 +30,7 @@ var gDrop = {
* @param aCell The drop target cell.
* @param aEvent The 'dragexit' event.
*/
exit: function Drop_exit(aCell, aEvent) {
exit: function (aCell, aEvent) {
if (aEvent.dataTransfer && !aEvent.dataTransfer.mozUserCancelled) {
this._delayedRearrange();
} else {
@ -45,7 +45,7 @@ var gDrop = {
* @param aCell The drop target cell.
* @param aEvent The 'dragexit' event.
*/
drop: function Drop_drop(aCell, aEvent) {
drop: function (aCell, aEvent) {
// The cell that is the drop target could contain a pinned site. We need
// to find out where that site has gone and re-pin it there.
if (aCell.containsPinnedSite())
@ -64,7 +64,7 @@ var gDrop = {
* Re-pins all pinned sites in their (new) positions.
* @param aCell The drop target cell.
*/
_repinSitesAfterDrop: function Drop_repinSitesAfterDrop(aCell) {
_repinSitesAfterDrop: function (aCell) {
let sites = gDropPreview.rearrange(aCell);
// Filter out pinned sites.
@ -81,7 +81,7 @@ var gDrop = {
* @param aCell The drop target cell.
* @param aEvent The 'dragexit' event.
*/
_pinDraggedSite: function Drop_pinDraggedSite(aCell, aEvent) {
_pinDraggedSite: function (aCell, aEvent) {
let index = aCell.index;
let draggedSite = gDrag.draggedSite;
@ -105,7 +105,7 @@ var gDrop = {
* Time a rearrange with a little delay.
* @param aCell The drop target cell.
*/
_delayedRearrange: function Drop_delayedRearrange(aCell) {
_delayedRearrange: function (aCell) {
// The last drop target didn't change so there's no need to re-arrange.
if (this._lastDropTarget == aCell)
return;
@ -127,7 +127,7 @@ var gDrop = {
/**
* Cancels a timed rearrange, if any.
*/
_cancelDelayedArrange: function Drop_cancelDelayedArrange() {
_cancelDelayedArrange: function () {
if (this._rearrangeTimeout) {
clearTimeout(this._rearrangeTimeout);
this._rearrangeTimeout = null;
@ -138,7 +138,7 @@ var gDrop = {
* Rearrange all sites in the grid depending on the current drop target.
* @param aCell The drop target cell.
*/
_rearrange: function Drop_rearrange(aCell) {
_rearrange: function (aCell) {
let sites = gGrid.sites;
// We need to rearrange the grid only if there's a current drop target.

@ -16,7 +16,7 @@ var gDropPreview = {
* @param aCell The drop target cell.
* @return The re-arranged array of sites.
*/
rearrange: function DropPreview_rearrange(aCell) {
rearrange: function (aCell) {
let sites = gGrid.sites;
// Insert the dragged site into the current grid.
@ -34,7 +34,7 @@ var gDropPreview = {
* @param aSites The array of sites to insert into.
* @param aCell The drop target cell.
*/
_insertDraggedSite: function DropPreview_insertDraggedSite(aSites, aCell) {
_insertDraggedSite: function (aSites, aCell) {
let dropIndex = aCell.index;
let draggedSite = gDrag.draggedSite;
@ -61,7 +61,7 @@ var gDropPreview = {
* @param aCell The drop target cell.
*/
_repositionPinnedSites:
function DropPreview_repositionPinnedSites(aSites, aCell) {
function (aSites, aCell) {
// Collect all pinned sites.
let pinnedSites = this._filterPinnedSites(aSites, aCell);
@ -85,7 +85,7 @@ var gDropPreview = {
* @param aCell The drop target cell.
* @return The filtered array of sites.
*/
_filterPinnedSites: function DropPreview_filterPinnedSites(aSites, aCell) {
_filterPinnedSites: function (aSites, aCell) {
let draggedSite = gDrag.draggedSite;
// When dropping on a cell that contains a pinned site make sure that all
@ -109,7 +109,7 @@ var gDropPreview = {
* @param aCell The drop target cell.
* @return The range of pinned cells.
*/
_getPinnedRange: function DropPreview_getPinnedRange(aCell) {
_getPinnedRange: function (aCell) {
let dropIndex = aCell.index;
let range = {start: dropIndex, end: dropIndex};
@ -139,7 +139,7 @@ var gDropPreview = {
* @return Whether there is an overflowed pinned cell.
*/
_hasOverflowedPinnedSite:
function DropPreview_hasOverflowedPinnedSite(aSites, aCell) {
function (aSites, aCell) {
// If the drop target isn't pinned there's no way a pinned site has been
// pushed out of the grid so we can just exit here.
@ -166,7 +166,7 @@ var gDropPreview = {
* @param aCell The drop target cell.
*/
_repositionOverflowedPinnedSite:
function DropPreview_repositionOverflowedPinnedSite(aSites, aCell) {
function (aSites, aCell) {
// Try to find a lower-priority cell (empty or containing an unpinned site).
let index = this._indexOfLowerPrioritySite(aSites, aCell);
@ -197,7 +197,7 @@ var gDropPreview = {
* @return The cell's index.
*/
_indexOfLowerPrioritySite:
function DropPreview_indexOfLowerPrioritySite(aSites, aCell) {
function (aSites, aCell) {
let cells = gGrid.cells;
let dropIndex = aCell.index;

@ -204,7 +204,7 @@ var gDropTargetShim = {
* Gets the positions of all cell nodes.
* @return The (cached) cell positions.
*/
_getCellPositions: function DropTargetShim_getCellPositions() {
_getCellPositions: function () {
if (this._cellPositions)
return this._cellPositions;

@ -48,7 +48,7 @@ var gGrid = {
* Initializes the grid.
* @param aSelector The query selector of the grid.
*/
init: function Grid_init() {
init: function () {
this._node = document.getElementById("newtab-grid");
this._gridDefaultContent = this._node.lastChild;
this._createSiteFragment();
@ -65,7 +65,7 @@ var gGrid = {
* @param aCell The cell that will contain the new site.
* @return The newly created site.
*/
createSite: function Grid_createSite(aLink, aCell) {
createSite: function (aLink, aCell) {
let node = aCell.node;
node.appendChild(this._siteFragment.cloneNode(true));
return new Site(node.firstElementChild, aLink);
@ -74,21 +74,21 @@ var gGrid = {
/**
* Handles all grid events.
*/
handleEvent: function Grid_handleEvent(aEvent) {
handleEvent: function (aEvent) {
// Any specific events should go here.
},
/**
* Locks the grid to block all pointer events.
*/
lock: function Grid_lock() {
lock: function () {
this.node.setAttribute("locked", "true");
},
/**
* Unlocks the grid to allow all pointer events.
*/
unlock: function Grid_unlock() {
unlock: function () {
this.node.removeAttribute("locked");
},
@ -142,7 +142,7 @@ var gGrid = {
/**
* Creates the DOM fragment that is re-used when creating sites.
*/
_createSiteFragment: function Grid_createSiteFragment() {
_createSiteFragment: function () {
let site = document.createElementNS(HTML_NAMESPACE, "div");
site.classList.add("newtab-site");
site.setAttribute("draggable", "true");
@ -167,7 +167,7 @@ var gGrid = {
* Test a tile at a given position for being pinned or history
* @param position Position in sites array
*/
_isHistoricalTile: function Grid_isHistoricalTile(aPos) {
_isHistoricalTile: function (aPos) {
let site = this.sites[aPos];
return site && (site.isPinned() || site.link && site.link.type == "history");
}

@ -15,7 +15,7 @@ var gPage = {
/**
* Initializes the page.
*/
init: function Page_init() {
init: function () {
// Add ourselves to the list of pages to receive notifications.
gAllPages.register(this);
@ -42,7 +42,7 @@ var gPage = {
/**
* Listens for notifications specific to this page.
*/
observe: function Page_observe(aSubject, aTopic, aData) {
observe: function (aSubject, aTopic, aData) {
if (aTopic == "nsPref:changed") {
let enabled = gAllPages.enabled;
this._updateAttributes(enabled);
@ -102,7 +102,7 @@ var gPage = {
* Internally initializes the page. This runs only when/if the feature
* is/gets enabled.
*/
_init: function Page_init() {
_init: function () {
if (this._initialized)
return;
@ -136,7 +136,7 @@ var gPage = {
* Updates the 'page-disabled' attributes of the respective DOM nodes.
* @param aValue Whether the New Tab Page is enabled or not.
*/
_updateAttributes: function Page_updateAttributes(aValue) {
_updateAttributes: function (aValue) {
// Set the nodes' states.
let nodeSelector = "#newtab-grid, #searchContainer";
for (let node of document.querySelectorAll(nodeSelector)) {
@ -159,14 +159,14 @@ var gPage = {
/**
* Handles unload event
*/
_handleUnloadEvent: function Page_handleUnloadEvent() {
_handleUnloadEvent: function () {
gAllPages.unregister(this);
},
/**
* Handles all page events.
*/
handleEvent: function Page_handleEvent(aEvent) {
handleEvent: function (aEvent) {
switch (aEvent.type) {
case "load":
this.onPageVisibleAndLoaded();

@ -55,7 +55,7 @@ Site.prototype = {
* @param aIndex The pinned index (optional).
* @return true if link changed type after pin
*/
pin: function Site_pin(aIndex) {
pin: function (aIndex) {
if (typeof aIndex == "undefined")
aIndex = this.cell.index;
@ -71,7 +71,7 @@ Site.prototype = {
/**
* Unpins the site and calls the given callback when done.
*/
unpin: function Site_unpin() {
unpin: function () {
if (this.isPinned()) {
this._updateAttributes(false);
gPinnedLinks.unpin(this._link);
@ -83,7 +83,7 @@ Site.prototype = {
* Checks whether this site is pinned.
* @return Whether this site is pinned.
*/
isPinned: function Site_isPinned() {
isPinned: function () {
return gPinnedLinks.isPinned(this._link);
},
@ -91,7 +91,7 @@ Site.prototype = {
* Blocks the site (removes it from the grid) and calls the given callback
* when done.
*/
block: function Site_block() {
block: function () {
if (!gBlockedLinks.isBlocked(this._link)) {
gUndoDialog.show(this);
gBlockedLinks.block(this._link);
@ -104,7 +104,7 @@ Site.prototype = {
* @param aSelector The query selector.
* @return The DOM node we found.
*/
_querySelector: function Site_querySelector(aSelector) {
_querySelector: function (aSelector) {
return this.node.querySelector(aSelector);
},
@ -139,7 +139,7 @@ Site.prototype = {
/**
* Checks for and modifies link at campaign end time
*/
_checkLinkEndTime: function Site_checkLinkEndTime() {
_checkLinkEndTime: function () {
if (this.link.endTime && this.link.endTime < Date.now()) {
let oldUrl = this.url;
// chop off the path part from url
@ -155,7 +155,7 @@ Site.prototype = {
/**
* Renders the site's data (fills the HTML fragment).
*/
_render: function Site_render() {
_render: function () {
// first check for end time, as it may modify the link
this._checkLinkEndTime();
// setup display variables
@ -189,7 +189,7 @@ Site.prototype = {
* Since the newtab may be preloaded long before it's displayed,
* check for changed conditions and re-render if needed
*/
onFirstVisible: function Site_onFirstVisible() {
onFirstVisible: function () {
if (this.link.endTime && this.link.endTime < Date.now()) {
// site needs to change landing url and background image
this._render();
@ -203,7 +203,7 @@ Site.prototype = {
* Captures the site's thumbnail in the background, but only if there's no
* existing thumbnail and the page allows background captures.
*/
captureIfMissing: function Site_captureIfMissing() {
captureIfMissing: function () {
if (!document.hidden && !this.link.imageURI) {
BackgroundPageThumbs.captureIfMissing(this.url);
}
@ -212,7 +212,7 @@ Site.prototype = {
/**
* Refreshes the thumbnail for the site.
*/
refreshThumbnail: function Site_refreshThumbnail() {
refreshThumbnail: function () {
let link = this.link;
let thumbnail = this._querySelector(".newtab-thumbnail.thumbnail");
@ -249,7 +249,7 @@ Site.prototype = {
/**
* Adds event handlers for the site and its buttons.
*/
_addEventHandlers: function Site_addEventHandlers() {
_addEventHandlers: function () {
// Register drag-and-drop event handlers.
this._node.addEventListener("dragstart", this, false);
this._node.addEventListener("dragend", this, false);
@ -259,7 +259,7 @@ Site.prototype = {
/**
* Speculatively opens a connection to the current site.
*/
_speculativeConnect: function Site_speculativeConnect() {
_speculativeConnect: function () {
let sc = Services.io.QueryInterface(Ci.nsISpeculativeConnect);
let uri = Services.io.newURI(this.url, null, null);
try {
@ -272,7 +272,7 @@ Site.prototype = {
/**
* Record interaction with site using telemetry.
*/
_recordSiteClicked: function Site_recordSiteClicked(aIndex) {
_recordSiteClicked: function (aIndex) {
if (Services.prefs.prefHasUserValue("browser.newtabpage.rows") ||
Services.prefs.prefHasUserValue("browser.newtabpage.columns") ||
aIndex > 8) {
@ -297,7 +297,7 @@ Site.prototype = {
/**
* Handles site click events.
*/
onClick: function Site_onClick(aEvent) {
onClick: function (aEvent) {
let action;
let pinned = this.isPinned();
let tileIndex = this.cell.index;
@ -336,7 +336,7 @@ Site.prototype = {
/**
* Handles all site events.
*/
handleEvent: function Site_handleEvent(aEvent) {
handleEvent: function (aEvent) {
switch (aEvent.type) {
case "mouseover":
this._node.removeEventListener("mouseover", this, false);

@ -33,7 +33,7 @@ var gTransformation = {
* @param aNode The DOM node.
* @return A Rect instance with the position.
*/
getNodePosition: function Transformation_getNodePosition(aNode) {
getNodePosition: function (aNode) {
let {left, top, width, height} = aNode.getBoundingClientRect();
return new Rect(left + scrollX, top + scrollY, width, height);
},
@ -43,7 +43,7 @@ var gTransformation = {
* @param aNode The node to fade.
* @param aCallback The callback to call when finished.
*/
fadeNodeIn: function Transformation_fadeNodeIn(aNode, aCallback) {
fadeNodeIn: function (aNode, aCallback) {
this._setNodeOpacity(aNode, 1, function () {
// Clear the style property.
aNode.style.opacity = "";
@ -58,7 +58,7 @@ var gTransformation = {
* @param aNode The node to fade.
* @param aCallback The callback to call when finished.
*/
fadeNodeOut: function Transformation_fadeNodeOut(aNode, aCallback) {
fadeNodeOut: function (aNode, aCallback) {
this._setNodeOpacity(aNode, 0, aCallback);
},
@ -67,7 +67,7 @@ var gTransformation = {
* @param aSite The site to fade.
* @param aCallback The callback to call when finished.
*/
showSite: function Transformation_showSite(aSite, aCallback) {
showSite: function (aSite, aCallback) {
this.fadeNodeIn(aSite.node, aCallback);
},
@ -76,7 +76,7 @@ var gTransformation = {
* @param aSite The site to fade.
* @param aCallback The callback to call when finished.
*/
hideSite: function Transformation_hideSite(aSite, aCallback) {
hideSite: function (aSite, aCallback) {
this.fadeNodeOut(aSite.node, aCallback);
},
@ -85,7 +85,7 @@ var gTransformation = {
* @param aSite The site to re-position.
* @param aPosition The desired position for the given site.
*/
setSitePosition: function Transformation_setSitePosition(aSite, aPosition) {
setSitePosition: function (aSite, aPosition) {
let style = aSite.node.style;
let {top, left} = aPosition;
@ -97,7 +97,7 @@ var gTransformation = {
* Freezes a site in its current position by positioning it absolute.
* @param aSite The site to freeze.
*/
freezeSitePosition: function Transformation_freezeSitePosition(aSite) {
freezeSitePosition: function (aSite) {
if (this._isFrozen(aSite))
return;
@ -114,7 +114,7 @@ var gTransformation = {
* Unfreezes a site by removing its absolute positioning.
* @param aSite The site to unfreeze.
*/
unfreezeSitePosition: function Transformation_unfreezeSitePosition(aSite) {
unfreezeSitePosition: function (aSite) {
if (!this._isFrozen(aSite))
return;
@ -131,7 +131,7 @@ var gTransformation = {
* unfreeze - unfreeze the site after sliding
* callback - the callback to call when finished
*/
slideSiteTo: function Transformation_slideSiteTo(aSite, aTarget, aOptions) {
slideSiteTo: function (aSite, aTarget, aOptions) {
let currentPosition = this.getNodePosition(aSite.node);
let targetPosition = this.getNodePosition(aTarget.node)
let callback = aOptions && aOptions.callback;
@ -168,7 +168,7 @@ var gTransformation = {
* unfreeze - unfreeze the site after rearranging
* callback - the callback to call when finished
*/
rearrangeSites: function Transformation_rearrangeSites(aSites, aOptions) {
rearrangeSites: function (aSites, aOptions) {
let batch = [];
let cells = gGrid.cells;
let callback = aOptions && aOptions.callback;
@ -206,7 +206,7 @@ var gTransformation = {
* @param aCallback The callback to call when finished.
*/
_whenTransitionEnded:
function Transformation_whenTransitionEnded(aNode, aProperties, aCallback) {
function (aNode, aProperties, aCallback) {
let props = new Set(aProperties);
aNode.addEventListener("transitionend", function onEnd(e) {
@ -222,7 +222,7 @@ var gTransformation = {
* @param aNode The node to get the opacity value from.
* @return The node's opacity value.
*/
_getNodeOpacity: function Transformation_getNodeOpacity(aNode) {
_getNodeOpacity: function (aNode) {
let cstyle = window.getComputedStyle(aNode, null);
return cstyle.getPropertyValue("opacity");
},
@ -234,7 +234,7 @@ var gTransformation = {
* @param aCallback The callback to call when finished.
*/
_setNodeOpacity:
function Transformation_setNodeOpacity(aNode, aOpacity, aCallback) {
function (aNode, aOpacity, aCallback) {
if (this._getNodeOpacity(aNode) == aOpacity) {
if (aCallback)
@ -254,7 +254,7 @@ var gTransformation = {
* @param aIndex The target cell's index.
* @param aOptions Options that are directly passed to slideSiteTo().
*/
_moveSite: function Transformation_moveSite(aSite, aIndex, aOptions) {
_moveSite: function (aSite, aIndex, aOptions) {
this.freezeSitePosition(aSite);
this.slideSiteTo(aSite, gGrid.cells[aIndex], aOptions);
},
@ -264,7 +264,7 @@ var gTransformation = {
* @param aSite The site to check.
* @return Whether the given site is frozen.
*/
_isFrozen: function Transformation_isFrozen(aSite) {
_isFrozen: function (aSite) {
return aSite.node.hasAttribute("frozen");
}
};

@ -22,7 +22,7 @@ var gUndoDialog = {
/**
* Initializes the undo dialog.
*/
init: function UndoDialog_init() {
init: function () {
this._undoContainer = document.getElementById("newtab-undo-container");
this._undoContainer.addEventListener("click", this, false);
this._undoButton = document.getElementById("newtab-undo-button");
@ -34,7 +34,7 @@ var gUndoDialog = {
* Shows the undo dialog.
* @param aSite The site that just got removed.
*/
show: function UndoDialog_show(aSite) {
show: function (aSite) {
if (this._undoData)
clearTimeout(this._undoData.timeout);
@ -54,7 +54,7 @@ var gUndoDialog = {
/**
* Hides the undo dialog.
*/
hide: function UndoDialog_hide() {
hide: function () {
if (!this._undoData)
return;
@ -70,7 +70,7 @@ var gUndoDialog = {
* The undo dialog event handler.
* @param aEvent The event to handle.
*/
handleEvent: function UndoDialog_handleEvent(aEvent) {
handleEvent: function (aEvent) {
switch (aEvent.target.id) {
case "newtab-undo-button":
this._undo();
@ -87,7 +87,7 @@ var gUndoDialog = {
/**
* Undo the last blocked site.
*/
_undo: function UndoDialog_undo() {
_undo: function () {
if (!this._undoData)
return;
@ -105,7 +105,7 @@ var gUndoDialog = {
/**
* Undo all blocked sites.
*/
_undoAll: function UndoDialog_undoAll() {
_undoAll: function () {
NewTabUtils.undoAll(function() {
gUpdater.updateGrid();
this.hide();

@ -14,7 +14,7 @@ var gUpdater = {
* This removes old, moves existing and creates new sites to fill gaps.
* @param aCallback The callback to call when finished.
*/
updateGrid: function Updater_updateGrid(aCallback) {
updateGrid: function (aCallback) {
let links = gLinks.getLinks().slice(0, gGrid.cells.length);
// Find all sites that remain in the grid.
@ -50,7 +50,7 @@ var gUpdater = {
* @param aLinks The array of links to find sites for.
* @return Array of sites mapped to the given links (can contain null values).
*/
_findRemainingSites: function Updater_findRemainingSites(aLinks) {
_findRemainingSites: function (aLinks) {
let map = {};
// Create a map to easily retrieve the site for a given URL.
@ -69,7 +69,7 @@ var gUpdater = {
* Freezes the given sites' positions.
* @param aSites The array of sites to freeze.
*/
_freezeSitePositions: function Updater_freezeSitePositions(aSites) {
_freezeSitePositions: function (aSites) {
aSites.forEach(function (aSite) {
if (aSite)
gTransformation.freezeSitePosition(aSite);
@ -80,7 +80,7 @@ var gUpdater = {
* Moves the given sites' DOM nodes to their new positions.
* @param aSites The array of sites to move.
*/
_moveSiteNodes: function Updater_moveSiteNodes(aSites) {
_moveSiteNodes: function (aSites) {
let cells = gGrid.cells;
// Truncate the given array of sites to not have more sites than cells.
@ -112,7 +112,7 @@ var gUpdater = {
* @param aSites The array of sites to re-arrange.
* @param aCallback The callback to call when finished.
*/
_rearrangeSites: function Updater_rearrangeSites(aSites, aCallback) {
_rearrangeSites: function (aSites, aCallback) {
let options = {callback: aCallback, unfreeze: true};
gTransformation.rearrangeSites(aSites, options);
},
@ -123,7 +123,7 @@ var gUpdater = {
* @param aSites The array of sites remaining in the grid.
* @param aCallback The callback to call when finished.
*/
_removeLegacySites: function Updater_removeLegacySites(aSites, aCallback) {
_removeLegacySites: function (aSites, aCallback) {
let batch = [];
// Delete sites that were removed from the grid.
@ -152,7 +152,7 @@ var gUpdater = {
* @param aLinks The array of links.
* @param aCallback The callback to call when finished.
*/
_fillEmptyCells: function Updater_fillEmptyCells(aLinks, aCallback) {
_fillEmptyCells: function (aLinks, aCallback) {
let {cells, sites} = gGrid;
// Find empty cells and fill them.

Loading…
Cancel
Save