Browse Source

[Pale-Moon] Remove excess whitespace.

pull/24/head
athenian200 2 years ago committed by Roy Tam
parent
commit
b6b33a6b2a
  1. 64
      application/palemoon/base/content/browser-fullZoom.js
  2. 96
      application/palemoon/base/content/browser-gestureSupport.js
  3. 128
      application/palemoon/base/content/browser-places.js
  4. 42
      application/palemoon/base/content/browser-plugins.js
  5. 48
      application/palemoon/base/content/browser-syncui.js
  6. 136
      application/palemoon/base/content/browser-tabPreviews.js
  7. 26
      application/palemoon/base/content/browser-thumbnails.js
  8. 310
      application/palemoon/base/content/browser.js
  9. 74
      application/palemoon/base/content/nsContextMenu.js
  10. 56
      application/palemoon/base/content/sanitizeDialog.js
  11. 12
      application/palemoon/components/distribution.js
  12. 136
      application/palemoon/components/downloads/DownloadsCommon.jsm
  13. 6
      application/palemoon/components/downloads/DownloadsLogger.jsm
  14. 4
      application/palemoon/components/downloads/DownloadsStartup.js
  15. 8
      application/palemoon/components/downloads/DownloadsUI.js
  16. 64
      application/palemoon/components/downloads/content/allDownloadsViewOverlay.js
  17. 2
      application/palemoon/components/downloads/content/contentAreaDownloadsView.js
  18. 106
      application/palemoon/components/downloads/content/downloads.js
  19. 36
      application/palemoon/components/downloads/content/indicator.js
  20. 38
      application/palemoon/components/feeds/FeedConverter.js
  21. 70
      application/palemoon/components/feeds/FeedWriter.js
  22. 80
      application/palemoon/components/feeds/WebContentConverter.js
  23. 6
      application/palemoon/components/feeds/content/subscribe.js
  24. 112
      application/palemoon/components/fuel/fuelApplication.js
  25. 8
      application/palemoon/components/newtab/cells.js
  26. 10
      application/palemoon/components/newtab/drag.js
  27. 2
      application/palemoon/components/newtab/dragDataHelper.js
  28. 18
      application/palemoon/components/newtab/drop.js
  29. 20
      application/palemoon/components/newtab/dropPreview.js
  30. 26
      application/palemoon/components/newtab/dropTargetShim.js
  31. 14
      application/palemoon/components/newtab/grid.js
  32. 14
      application/palemoon/components/newtab/page.js
  33. 32
      application/palemoon/components/newtab/sites.js
  34. 34
      application/palemoon/components/newtab/transformations.js
  35. 12
      application/palemoon/components/newtab/undo.js
  36. 26
      application/palemoon/components/newtab/updater.js
  37. 2
      application/palemoon/components/nsAboutRedirector.js
  38. 18
      application/palemoon/components/nsBrowserContentHandler.js
  39. 84
      application/palemoon/components/nsBrowserGlue.js
  40. 18
      application/palemoon/components/pageinfo/permissions.js
  41. 76
      application/palemoon/components/places/PlacesUIUtils.jsm
  42. 40
      application/palemoon/components/places/content/bookmarkProperties.js
  43. 132
      application/palemoon/components/places/content/browserPlacesViews.js
  44. 104
      application/palemoon/components/places/content/controller.js
  45. 80
      application/palemoon/components/places/content/editBookmarkOverlay.js
  46. 4
      application/palemoon/components/places/content/moveBookmarks.js
  47. 106
      application/palemoon/components/places/content/places.js
  48. 8
      application/palemoon/components/places/content/sidebarUtils.js
  49. 108
      application/palemoon/components/places/content/treeView.js
  50. 56
      application/palemoon/components/preferences/advanced.js
  51. 10
      application/palemoon/components/preferences/applicationManager.js
  52. 122
      application/palemoon/components/preferences/cookies.js
  53. 38
      application/palemoon/components/preferences/privacy.js
  54. 8
      application/palemoon/components/preferences/selectBookmark.js
  55. 62
      application/palemoon/components/search/content/engineManager.js
  56. 6
      application/palemoon/components/sessionstore/DocumentUtils.jsm
  57. 12
      application/palemoon/components/sessionstore/SessionStorage.jsm
  58. 324
      application/palemoon/components/sessionstore/SessionStore.jsm
  59. 10
      application/palemoon/components/sessionstore/XPathGenerator.jsm
  60. 36
      application/palemoon/components/sessionstore/_SessionFile.jsm
  61. 14
      application/palemoon/components/sessionstore/nsSessionStartup.js
  62. 2
      application/palemoon/components/shell/nsSetDefaultBrowser.js
  63. 24
      application/palemoon/components/sync/addDevice.js
  64. 18
      application/palemoon/components/sync/genericChange.js
  65. 32
      application/palemoon/components/sync/quota.js
  66. 96
      application/palemoon/components/sync/setup.js
  67. 22
      application/palemoon/components/sync/utils.js
  68. 52
      application/palemoon/modules/BrowserNewTabPreloader.jsm
  69. 24
      application/palemoon/modules/NetworkPrioritizer.jsm
  70. 70
      application/palemoon/modules/PopupNotifications.jsm
  71. 2
      application/palemoon/modules/RecentWindow.jsm
  72. 64
      application/palemoon/modules/WindowsJumpLists.jsm
  73. 6
      application/palemoon/modules/openLocationLastURL.jsm

64
application/palemoon/base/content/browser-fullZoom.js

@ -38,7 +38,7 @@ var FullZoom = {
// Initialization & Destruction
init: function () {
init: function() {
gBrowser.addEventListener("ZoomChangeUsingMouseWheel", this);
// Register ourselves with the service so we know when our pref changes.
@ -66,7 +66,7 @@ var FullZoom = {
this._initialLocations = null;
},
destroy: function () {
destroy: function() {
gPrefService.removeObserver("browser.zoom.", this);
this._cps2.removeObserverForName(this.name, this);
gBrowser.removeEventListener("ZoomChangeUsingMouseWheel", this);
@ -77,7 +77,7 @@ var FullZoom = {
// nsIDOMEventListener
handleEvent: function (event) {
handleEvent: function(event) {
switch (event.type) {
case "ZoomChangeUsingMouseWheel":
let browser = this._getTargetedBrowser(event);
@ -89,7 +89,7 @@ var FullZoom = {
// nsIObserver
observe: function (aSubject, aTopic, aData) {
observe: function(aSubject, aTopic, aData) {
switch (aTopic) {
case "nsPref:changed":
switch (aData) {
@ -108,11 +108,11 @@ var FullZoom = {
// nsIContentPrefObserver
onContentPrefSet: function (aGroup, aName, aValue, aIsPrivate) {
onContentPrefSet: function(aGroup, aName, aValue, aIsPrivate) {
this._onContentPrefChanged(aGroup, aValue, aIsPrivate);
},
onContentPrefRemoved: function (aGroup, aName, aIsPrivate) {
onContentPrefRemoved: function(aGroup, aName, aIsPrivate) {
this._onContentPrefChanged(aGroup, undefined, aIsPrivate);
},
@ -124,7 +124,7 @@ var FullZoom = {
* @param aValue The new value of the changed preference. Pass undefined to
* indicate the preference's removal.
*/
_onContentPrefChanged: function (aGroup, aValue, aIsPrivate) {
_onContentPrefChanged: function(aGroup, aValue, aIsPrivate) {
if (this._isNextContentPrefChangeInternal) {
// Ignore changes that FullZoom itself makes. This works because the
// content pref service calls callbacks before notifying observers, and it
@ -154,8 +154,8 @@ var FullZoom = {
let hasPref = false;
let token = this._getBrowserToken(browser);
this._cps2.getByDomainAndName(browser.currentURI.spec, this.name, ctxt, {
handleResult: function () { hasPref = true; },
handleCompletion: function () {
handleResult: function() { hasPref = true; },
handleCompletion: function() {
if (!hasPref && token.isCurrent)
this._applyPrefToZoom(undefined, browser);
}.bind(this)
@ -175,7 +175,7 @@ var FullZoom = {
* @param aBrowser
* (optional) browser object displaying the document
*/
onLocationChange: function (aURI, aIsTabSwitch, aBrowser) {
onLocationChange: function(aURI, aIsTabSwitch, aBrowser) {
let browser = aBrowser || gBrowser.selectedBrowser;
// If we haven't been initialized yet but receive an onLocationChange
@ -223,8 +223,8 @@ var FullZoom = {
let value = undefined;
let token = this._getBrowserToken(browser);
this._cps2.getByDomainAndName(aURI.spec, this.name, ctxt, {
handleResult: function (resultPref) { value = resultPref.value; },
handleCompletion: function () {
handleResult: function(resultPref) { value = resultPref.value; },
handleCompletion: function() {
if (!token.isCurrent) {
this._notifyOnLocationChange(browser);
return;
@ -237,7 +237,7 @@ var FullZoom = {
// update state of zoom type menu item
updateMenu: function () {
updateMenu: function() {
var menuItem = document.getElementById("toggle_zoom");
menuItem.setAttribute("checked", !ZoomManager.useFullZoom);
@ -248,7 +248,7 @@ var FullZoom = {
/**
* Reduces the zoom level of the page in the current browser.
*/
reduce: function () {
reduce: function() {
ZoomManager.reduce();
let browser = gBrowser.selectedBrowser;
this._ignorePendingZoomAccesses(browser);
@ -258,7 +258,7 @@ var FullZoom = {
/**
* Enlarges the zoom level of the page in the current browser.
*/
enlarge: function () {
enlarge: function() {
ZoomManager.enlarge();
let browser = gBrowser.selectedBrowser;
this._ignorePendingZoomAccesses(browser);
@ -269,7 +269,7 @@ var FullZoom = {
* Sets the zoom level for the given browser to the given floating
* point value, where 1 is the default zoom level.
*/
setZoom: function (value, browser = gBrowser.selectedBrowser) {
setZoom: function(value, browser = gBrowser.selectedBrowser) {
ZoomManager.setZoomForBrowser(browser, value);
this._ignorePendingZoomAccesses(browser);
this._applyZoomToPref(browser);
@ -281,7 +281,7 @@ var FullZoom = {
*
* @return A promise which resolves when the zoom reset has been applied.
*/
reset: function (browser = gBrowser.selectedBrowser) {
reset: function(browser = gBrowser.selectedBrowser) {
let token = this._getBrowserToken(browser);
let result = this._getGlobalValue(browser).then(value => {
if (token.isCurrent) {
@ -317,7 +317,7 @@ var FullZoom = {
* @param aBrowser The zoom is set in this browser. Required.
* @param aCallback If given, it's asynchronously called when complete.
*/
_applyPrefToZoom: function (aValue, aBrowser, aCallback) {
_applyPrefToZoom: function(aValue, aBrowser, aCallback) {
if (!this.siteSpecific || gInPrintPreviewMode) {
this._executeSoon(aCallback);
return;
@ -354,7 +354,7 @@ var FullZoom = {
*
* @param browser The zoom of this browser will be saved. Required.
*/
_applyZoomToPref: function (browser) {
_applyZoomToPref: function(browser) {
Services.obs.notifyObservers(browser, "browser-fullZoom:zoomChange", "");
if (!this.siteSpecific ||
gInPrintPreviewMode ||
@ -364,7 +364,7 @@ var FullZoom = {
this._cps2.set(browser.currentURI.spec, this.name,
ZoomManager.getZoomForBrowser(browser),
this._loadContextFromBrowser(browser), {
handleCompletion: function () {
handleCompletion: function() {
this._isNextContentPrefChangeInternal = true;
}.bind(this),
});
@ -375,13 +375,13 @@ var FullZoom = {
*
* @param browser The zoom of this browser will be removed. Required.
*/
_removePref: function (browser) {
_removePref: function(browser) {
Services.obs.notifyObservers(browser, "browser-fullZoom:zoomReset", "");
if (browser.isSyntheticDocument)
return;
let ctxt = this._loadContextFromBrowser(browser);
this._cps2.removeByDomainAndName(browser.currentURI.spec, this.name, ctxt, {
handleCompletion: function () {
handleCompletion: function() {
this._isNextContentPrefChangeInternal = true;
}.bind(this),
});
@ -401,7 +401,7 @@ var FullZoom = {
* @param browser The token of this browser will be returned.
* @return An object with an "isCurrent" getter.
*/
_getBrowserToken: function (browser) {
_getBrowserToken: function(browser) {
let map = this._browserTokenMap;
if (!map.has(browser))
map.set(browser, 0);
@ -423,7 +423,7 @@ var FullZoom = {
* @param event The ZoomChangeUsingMouseWheel event.
* @return The associated browser element, if one exists, otherwise null.
*/
_getTargetedBrowser: function (event) {
_getTargetedBrowser: function(event) {
let target = event.originalTarget;
// With remote content browsers, the event's target is the browser
@ -449,12 +449,12 @@ var FullZoom = {
*
* @param browser Pending accesses in this browser will be ignored.
*/
_ignorePendingZoomAccesses: function (browser) {
_ignorePendingZoomAccesses: function(browser) {
let map = this._browserTokenMap;
map.set(browser, (map.get(browser) || 0) + 1);
},
_ensureValid: function (aValue) {
_ensureValid: function(aValue) {
// Note that undefined is a valid value for aValue that indicates a known-
// not-to-exist value.
if (isNaN(aValue))
@ -476,7 +476,7 @@ var FullZoom = {
* @returns Promise<prefValue>
* Resolves to the preference value when done.
*/
_getGlobalValue: function (browser) {
_getGlobalValue: function(browser) {
// * !("_globalValue" in this) => global value not yet cached.
// * this._globalValue === undefined => global value known not to exist.
// * Otherwise, this._globalValue is a number, the global value.
@ -487,7 +487,7 @@ var FullZoom = {
}
let value = undefined;
this._cps2.getGlobal(this.name, this._loadContextFromBrowser(browser), {
handleResult: function (pref) { value = pref.value; },
handleResult: function(pref) { value = pref.value; },
handleCompletion: (reason) => {
this._globalValue = this._ensureValid(value);
resolve(this._globalValue);
@ -502,7 +502,7 @@ var FullZoom = {
* @param Browser The Browser whose load context will be returned.
* @return The nsILoadContext of the given Browser.
*/
_loadContextFromBrowser: function (browser) {
_loadContextFromBrowser: function(browser) {
return browser.loadContext;
},
@ -512,13 +512,13 @@ var FullZoom = {
* The notification is always asynchronous so that observers are guaranteed a
* consistent behavior.
*/
_notifyOnLocationChange: function (browser) {
this._executeSoon(function () {
_notifyOnLocationChange: function(browser) {
this._executeSoon(function() {
Services.obs.notifyObservers(browser, "browser-fullZoom:location-change", "");
});
},
_executeSoon: function (callback) {
_executeSoon: function(callback) {
if (!callback)
return;
Services.tm.mainThread.dispatch(callback, Ci.nsIThread.DISPATCH_NORMAL);

96
application/palemoon/base/content/browser-gestureSupport.js

@ -24,7 +24,7 @@ var gGestureSupport = {
* @param aAddListener
* True to add/init listeners and false to remove/uninit
*/
init: function (aAddListener) {
init: function(aAddListener) {
// Bug 863514 - Make gesture support work in electrolysis
if (gMultiProcessBrowser)
return;
@ -38,7 +38,7 @@ var gGestureSupport = {
let addRemove = aAddListener ? window.addEventListener :
window.removeEventListener;
gestureEvents.forEach(function (event) addRemove("Moz" + event, this, true),
gestureEvents.forEach(function(event) addRemove("Moz" + event, this, true),
this);
},
@ -50,7 +50,7 @@ var gGestureSupport = {
* @param aEvent
* The gesture event to handle
*/
handleEvent: function (aEvent) {
handleEvent: function(aEvent) {
if (!Services.prefs.getBoolPref(
"dom.debug.propagate_gesture_events_through_content")) {
aEvent.stopPropagation();
@ -122,7 +122,7 @@ var gGestureSupport = {
* @param aDec
* Command to trigger for decreasing motion (without gesture name)
*/
_setupGesture: function (aEvent, aGesture, aPref, aInc, aDec) {
_setupGesture: function(aEvent, aGesture, aPref, aInc, aDec) {
// Try to load user-set values from preferences
for (let [pref, def] in Iterator(aPref))
aPref[pref] = this._getPref(aGesture + "." + pref, def);
@ -133,7 +133,7 @@ var gGestureSupport = {
let isLatched = false;
// Create the update function here to capture closure state
this._doUpdate = function (aEvent) {
this._doUpdate = function(aEvent) {
// Update the offset with new event data
offset += aEvent.delta;
@ -167,7 +167,7 @@ var gGestureSupport = {
* The swipe gesture event.
* @return true if the swipe event may navigate the history, false othwerwise.
*/
_swipeNavigatesHistory: function (aEvent) {
_swipeNavigatesHistory: function(aEvent) {
return this._getCommand(aEvent, ["swipe", "left"])
== "Browser:BackOrBackDuplicate" &&
this._getCommand(aEvent, ["swipe", "right"])
@ -180,7 +180,7 @@ var gGestureSupport = {
* @param aEvent
* The swipe gesture start event.
*/
_setupSwipeGesture: function (aEvent) {
_setupSwipeGesture: function(aEvent) {
if (!this._swipeNavigatesHistory(aEvent))
return;
@ -197,15 +197,15 @@ var gGestureSupport = {
gHistorySwipeAnimation.startAnimation();
this._doUpdate = function (aEvent) {
this._doUpdate = function(aEvent) {
gHistorySwipeAnimation.updateAnimation(aEvent.delta);
};
this._doEnd = function (aEvent) {
this._doEnd = function(aEvent) {
gHistorySwipeAnimation.swipeEndEventReceived();
this._doUpdate = function (aEvent) {};
this._doEnd = function (aEvent) {};
this._doUpdate = function(aEvent) {};
this._doEnd = function(aEvent) {};
}
},
@ -217,12 +217,12 @@ var gGestureSupport = {
* Source array containing any number of elements
* @yield Array that is a subset of the input array from full set to empty
*/
_power: function (aArray) {
_power: function(aArray) {
// Create a bitmask based on the length of the array
let num = 1 << aArray.length;
while (--num >= 0) {
// Only select array elements where the current bit is set
yield aArray.reduce(function (aPrev, aCurr, aIndex) {
yield aArray.reduce(function(aPrev, aCurr, aIndex) {
if (num & 1 << aIndex)
aPrev.push(aCurr);
return aPrev;
@ -241,7 +241,7 @@ var gGestureSupport = {
* @return Name of the executed command. Returns null if no command is
* found.
*/
_doAction: function (aEvent, aGesture) {
_doAction: function(aEvent, aGesture) {
let command = this._getCommand(aEvent, aGesture);
return command && this._doCommand(aEvent, command);
},
@ -255,12 +255,12 @@ var gGestureSupport = {
* @param aGesture
* Array of gesture name parts (to be joined by periods)
*/
_getCommand: function (aEvent, aGesture) {
_getCommand: function(aEvent, aGesture) {
// Create an array of pressed keys in a fixed order so that a command for
// "meta" is preferred over "ctrl" when both buttons are pressed (and a
// command for both don't exist)
let keyCombos = [];
["shift", "alt", "ctrl", "meta"].forEach(function (key) {
["shift", "alt", "ctrl", "meta"].forEach(function(key) {
if (aEvent[key + "Key"])
keyCombos.push(key);
});
@ -289,7 +289,7 @@ var gGestureSupport = {
* @param aCommand
* Name of the command found for the event's keys and gesture.
*/
_doCommand: function (aEvent, aCommand) {
_doCommand: function(aEvent, aCommand) {
let node = document.getElementById(aCommand);
if (node) {
if (node.getAttribute("disabled") != "true") {
@ -329,7 +329,7 @@ var gGestureSupport = {
* @param aEvent
* The swipe event to handle
*/
onSwipe: function (aEvent) {
onSwipe: function(aEvent) {
// Figure out which one (and only one) direction was triggered
for (let dir of ["UP", "RIGHT", "DOWN", "LEFT"]) {
if (aEvent.direction == aEvent["DIRECTION_" + dir]) {
@ -347,7 +347,7 @@ var gGestureSupport = {
* @param aDir
* The direction for the swipe event
*/
processSwipeEvent: function (aEvent, aDir) {
processSwipeEvent: function(aEvent, aDir) {
this._doAction(aEvent, ["swipe", aDir.toLowerCase()]);
},
@ -363,7 +363,7 @@ var gGestureSupport = {
* The direction for the swipe event
*/
_coordinateSwipeEventWithAnimation:
function (aEvent, aDir) {
function(aEvent, aDir) {
if ((gHistorySwipeAnimation.isAnimationRunning()) &&
(aDir == "RIGHT" || aDir == "LEFT")) {
gHistorySwipeAnimation.processSwipeEvent(aEvent, aDir);
@ -381,7 +381,7 @@ var gGestureSupport = {
* @param aDef
* Default value if the preference doesn't exist
*/
_getPref: function (aPref, aDef) {
_getPref: function(aPref, aDef) {
// Preferences branch under which all gestures preferences are stored
const branch = "browser.gesture.";
@ -541,7 +541,7 @@ var gHistorySwipeAnimation = {
* Initializes the support for history swipe animations, if it is supported
* by the platform/configuration.
*/
init: function () {
init: function() {
if (!this._isSupported())
return;
@ -568,7 +568,7 @@ var gHistorySwipeAnimation = {
/**
* Uninitializes the support for history swipe animations.
*/
uninit: function () {
uninit: function() {
gBrowser.removeEventListener("pagehide", this, false);
gBrowser.removeEventListener("pageshow", this, false);
gBrowser.removeEventListener("popstate", this, false);
@ -582,7 +582,7 @@ var gHistorySwipeAnimation = {
* Starts the swipe animation and handles fast swiping (i.e. a swipe animation
* is already in progress when a new one is initiated).
*/
startAnimation: function () {
startAnimation: function() {
if (this.isAnimationRunning()) {
gBrowser.stop();
this._lastSwipeDir = "RELOAD"; // just ensure that != ""
@ -607,7 +607,7 @@ var gHistorySwipeAnimation = {
/**
* Stops the swipe animation.
*/
stopAnimation: function () {
stopAnimation: function() {
gHistorySwipeAnimation._removeBoxes();
},
@ -618,7 +618,7 @@ var gHistorySwipeAnimation = {
* A floating point value that represents the progress of the
* swipe gesture.
*/
updateAnimation: function (aVal) {
updateAnimation: function(aVal) {
if (!this.isAnimationRunning())
return;
@ -668,7 +668,7 @@ var gHistorySwipeAnimation = {
* @param aEvent
* An event to process.
*/
handleEvent: function (aEvent) {
handleEvent: function(aEvent) {
switch (aEvent.type) {
case "TabClose":
let browser = gBrowser.getBrowserForTab(aEvent.target);
@ -698,7 +698,7 @@ var gHistorySwipeAnimation = {
*
* @return true if the animation is currently running, false otherwise.
*/
isAnimationRunning: function () {
isAnimationRunning: function() {
return !!this._container;
},
@ -710,7 +710,7 @@ var gHistorySwipeAnimation = {
* @param aDir
* The direction for the swipe event
*/
processSwipeEvent: function (aEvent, aDir) {
processSwipeEvent: function(aEvent, aDir) {
if (aDir == "RIGHT")
this._historyIndex += this.isLTR ? 1 : -1;
else if (aDir == "LEFT")
@ -725,7 +725,7 @@ var gHistorySwipeAnimation = {
*
* @return true if there is a previous page in history, false otherwise.
*/
canGoBack: function () {
canGoBack: function() {
if (this.isAnimationRunning())
return this._doesIndexExistInHistory(this._historyIndex - 1);
return gBrowser.webNavigation.canGoBack;
@ -736,7 +736,7 @@ var gHistorySwipeAnimation = {
*
* @return true if there is a next page in history, false otherwise.
*/
canGoForward: function () {
canGoForward: function() {
if (this.isAnimationRunning())
return this._doesIndexExistInHistory(this._historyIndex + 1);
return gBrowser.webNavigation.canGoForward;
@ -747,7 +747,7 @@ var gHistorySwipeAnimation = {
* event and that we should navigate to the page that the user swiped to, if
* any. This will also result in the animation overlay to be torn down.
*/
swipeEndEventReceived: function () {
swipeEndEventReceived: function() {
if (this._lastSwipeDir != "")
this._navigateToHistoryIndex();
else
@ -761,7 +761,7 @@ var gHistorySwipeAnimation = {
* The index to check for availability for in the history.
* @return true if the index exists in the browser history, false otherwise.
*/
_doesIndexExistInHistory: function (aIndex) {
_doesIndexExistInHistory: function(aIndex) {
try {
gBrowser.webNavigation.sessionHistory.getEntryAtIndex(aIndex, false);
}
@ -775,7 +775,7 @@ var gHistorySwipeAnimation = {
* Navigates to the index in history that is currently being tracked by
* |this|.
*/
_navigateToHistoryIndex: function () {
_navigateToHistoryIndex: function() {
if (this._doesIndexExistInHistory(this._historyIndex)) {
gBrowser.webNavigation.gotoIndex(this._historyIndex);
}
@ -787,7 +787,7 @@ var gHistorySwipeAnimation = {
*
* return true if supported, false otherwise.
*/
_isSupported: function () {
_isSupported: function() {
return window.matchMedia("(-moz-swipe-animation-enabled)").matches;
},
@ -796,7 +796,7 @@ var gHistorySwipeAnimation = {
* progress when a new one is initiated). This will swap out the snapshots
* used in the previous animation with the appropriate new ones.
*/
_handleFastSwiping: function () {
_handleFastSwiping: function() {
this._installCurrentPageSnapshot(null);
this._installPrevAndNextSnapshots();
},
@ -804,7 +804,7 @@ var gHistorySwipeAnimation = {
/**
* Adds the boxes that contain the snapshots used during the swipe animation.
*/
_addBoxes: function () {
_addBoxes: function() {
let browserStack =
document.getAnonymousElementByAttribute(gBrowser.getNotificationBox(),
"class", "browserStack");
@ -830,7 +830,7 @@ var gHistorySwipeAnimation = {
/**
* Removes the boxes.
*/
_removeBoxes: function () {
_removeBoxes: function() {
this._curBox = null;
this._prevBox = null;
this._nextBox = null;
@ -849,7 +849,7 @@ var gHistorySwipeAnimation = {
* The name of the tag to create the element for.
* @return the newly created element.
*/
_createElement: function (aID, aTagName) {
_createElement: function(aID, aTagName) {
let XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
let element = document.createElementNS(XULNS, aTagName);
element.id = aID;
@ -864,14 +864,14 @@ var gHistorySwipeAnimation = {
* @param aPosition
* The position (in X coordinates) to move the box element to.
*/
_positionBox: function (aBox, aPosition) {
_positionBox: function(aBox, aPosition) {
aBox.style.transform = "translateX(" + this._boxWidth * aPosition + "px)";
},
/**
* Takes a snapshot of the page the browser is currently on.
*/
_takeSnapshot: function () {
_takeSnapshot: function() {
if ((this._maxSnapshots < 1) ||
(gBrowser.webNavigation.sessionHistory.index < 0))
return;
@ -899,7 +899,7 @@ var gHistorySwipeAnimation = {
* Retrieves the maximum number of snapshots that should be kept in memory.
* This limit is a global limit and is valid across all open tabs.
*/
_getMaxSnapshots: function () {
_getMaxSnapshots: function() {
return gPrefService.getIntPref("browser.snapshots.limit");
},
@ -912,7 +912,7 @@ var gHistorySwipeAnimation = {
* The snapshot to add to the list and compress.
*/
_assignSnapshotToCurrentBrowser:
function (aCanvas) {
function(aCanvas) {
let browser = gBrowser.selectedBrowser;
let currIndex = browser.webNavigation.sessionHistory.index;
@ -946,7 +946,7 @@ var gHistorySwipeAnimation = {
* @param aBrowser
* The browser the new snapshot was taken in.
*/
_removeTrackedSnapshot: function (aIndex, aBrowser) {
_removeTrackedSnapshot: function(aIndex, aBrowser) {
let arr = this._trackedSnapshots;
let requiresExactIndexMatch = aIndex >= 0;
for (let i = 0; i < arr.length; i++) {
@ -972,7 +972,7 @@ var gHistorySwipeAnimation = {
* The browser the new snapshot was taken in.
*/
_addSnapshotRefToArray:
function (aIndex, aBrowser) {
function(aIndex, aBrowser) {
let id = { index: aIndex,
browser: aBrowser };
let arr = this._trackedSnapshots;
@ -995,7 +995,7 @@ var gHistorySwipeAnimation = {
* couldn't complete before this method was called.
* @return A new Image object representing the converted blob.
*/
_convertToImg: function (aBlob) {
_convertToImg: function(aBlob) {
if (!aBlob)
return null;
@ -1022,7 +1022,7 @@ var gHistorySwipeAnimation = {
* the previously stored snapshot for this index (if any) will be used.
*/
_installCurrentPageSnapshot:
function (aCanvas) {
function(aCanvas) {
let currSnapshot = aCanvas;
if (!currSnapshot) {
let snapshots = gBrowser.selectedBrowser.snapshots || {};
@ -1039,7 +1039,7 @@ var gHistorySwipeAnimation = {
* previously stored for their respective indeces.
*/
_installPrevAndNextSnapshots:
function () {
function() {
let snapshots = gBrowser.selectedBrowser.snapshots || [];
let currIndex = this._historyIndex;
let prevIndex = currIndex - 1;

128
application/palemoon/base/content/browser-places.js

@ -30,11 +30,11 @@ var StarUI = {
get _blockedCommands() {
delete this._blockedCommands;
return this._blockedCommands =
["cmd_close", "cmd_closeWindow"].map(function (id) this._element(id), this);
["cmd_close", "cmd_closeWindow"].map(function(id) this._element(id), this);
},
_blockCommands: function () {
this._blockedCommands.forEach(function (elt) {
_blockCommands: function() {
this._blockedCommands.forEach(function(elt) {
// make sure not to permanently disable this item (see bug 409155)
if (elt.hasAttribute("wasDisabled"))
return;
@ -47,8 +47,8 @@ var StarUI = {
});
},
_restoreCommandsState: function () {
this._blockedCommands.forEach(function (elt) {
_restoreCommandsState: function() {
this._blockedCommands.forEach(function(elt) {
if (elt.getAttribute("wasDisabled") != "true")
elt.removeAttribute("disabled");
elt.removeAttribute("wasDisabled");
@ -56,7 +56,7 @@ var StarUI = {
},
// nsIDOMEventListener
handleEvent: function (aEvent) {
handleEvent: function(aEvent) {
switch (aEvent.type) {
case "popuphidden":
if (aEvent.originalTarget == this.panel) {
@ -119,7 +119,7 @@ var StarUI = {
_overlayLoaded: false,
_overlayLoading: false,
showEditBookmarkPopup:
function (aItemId, aAnchorElement, aPosition) {
function(aItemId, aAnchorElement, aPosition) {
// Performance: load the overlay the first time the panel is opened
// (see bug 392443).
if (this._overlayLoading)
@ -133,7 +133,7 @@ var StarUI = {
this._overlayLoading = true;
document.loadOverlay(
"chrome://browser/content/places/editBookmarkOverlay.xul",
(function (aSubject, aTopic, aData) {
(function(aSubject, aTopic, aData) {
//XXX We just caused localstore.rdf to be re-applied (bug 640158)
retrieveToolbarIconsizesFromTheme();
@ -152,7 +152,7 @@ var StarUI = {
},
_doShowEditBookmarkPanel:
function (aItemId, aAnchorElement, aPosition) {
function(aItemId, aAnchorElement, aPosition) {
if (this.panel.state != "closed")
return;
@ -210,7 +210,7 @@ var StarUI = {
},
panelShown:
function (aEvent) {
function(aEvent) {
if (aEvent.target == this.panel) {
if (!this._element("editBookmarkPanelContent").hidden) {
let fieldToFocus = "editBMPanel_" +
@ -227,24 +227,24 @@ var StarUI = {
}
},
quitEditMode: function () {
quitEditMode: function() {
this._element("editBookmarkPanelContent").hidden = true;
this._element("editBookmarkPanelBottomButtons").hidden = true;
gEditItemOverlay.uninitPanel(true);
},
cancelButtonOnCommand: function () {
cancelButtonOnCommand: function() {
this._actionOnHide = "cancel";
this.panel.hidePopup();
},
removeBookmarkButtonCommand: function () {
removeBookmarkButtonCommand: function() {
this._uriForRemoval = PlacesUtils.bookmarks.getBookmarkURI(this._itemId);
this._actionOnHide = "remove";
this.panel.hidePopup();
},
beginBatch: function () {
beginBatch: function() {
if (!this._batching) {
PlacesUtils.transactionManager.beginBatch(null);
this._batching = true;
@ -267,7 +267,7 @@ var PlacesCommandHook = {
* @param [optional] aShowEditUI
* whether or not to show the edit-bookmark UI for the bookmark item
*/
bookmarkPage: function (aBrowser, aParent, aShowEditUI) {
bookmarkPage: function(aBrowser, aParent, aShowEditUI) {
var uri = aBrowser.currentURI;
var itemId = PlacesUtils.getMostRecentBookmarkForURI(uri);
if (itemId == -1) {
@ -343,7 +343,7 @@ var PlacesCommandHook = {
/**
* Adds a bookmark to the page loaded in the current tab.
*/
bookmarkCurrentPage: function (aShowEditUI, aParent) {
bookmarkCurrentPage: function(aShowEditUI, aParent) {
this.bookmarkPage(gBrowser.selectedBrowser, aParent, aShowEditUI);
},
@ -357,7 +357,7 @@ var PlacesCommandHook = {
* @param aTitle
* The link text
*/
bookmarkLink: function (aParent, aURL, aTitle) {
bookmarkLink: function(aParent, aURL, aTitle) {
var linkURI = makeURI(aURL);
var itemId = PlacesUtils.getMostRecentBookmarkForURI(linkURI);
if (itemId == -1) {
@ -387,7 +387,7 @@ var PlacesCommandHook = {
get uniqueCurrentPages() {
let uniquePages = {};
let URIs = [];
gBrowser.visibleTabs.forEach(function (tab) {
gBrowser.visibleTabs.forEach(function(tab) {
let spec = tab.linkedBrowser.currentURI.spec;
if (!tab.pinned && !(spec in uniquePages)) {
uniquePages[spec] = null;
@ -401,7 +401,7 @@ var PlacesCommandHook = {
* Adds a folder with bookmarks to all of the currently open tabs in this
* window.
*/
bookmarkCurrentPages: function () {
bookmarkCurrentPages: function() {
let pages = this.uniqueCurrentPages;
if (pages.length > 1) {
PlacesUIUtils.showBookmarkDialog({ action: "add"
@ -416,7 +416,7 @@ var PlacesCommandHook = {
* Updates disabled state for the "Bookmark All Tabs" command.
*/
updateBookmarkAllTabsCommand:
function () {
function() {
// There's nothing to do in non-browser windows.
if (window.location.href != getBrowserURL())
return;
@ -436,7 +436,7 @@ var PlacesCommandHook = {
* @subtitle subtitle
* A short description of the feed. Optional.
*/
addLiveBookmark: function (url, feedTitle, feedSubtitle) {
addLiveBookmark: function(url, feedTitle, feedSubtitle) {
let toolbarIP = new InsertionPoint(PlacesUtils.toolbarFolderId, -1);
let feedURI = makeURI(url);
@ -466,7 +466,7 @@ var PlacesCommandHook = {
* are: History, AllBookmarks, BookmarksMenu, BookmarksToolbar,
* UnfiledBookmarks, Tags and Downloads.
*/
showPlacesOrganizer: function (aLeftPaneRoot) {
showPlacesOrganizer: function(aLeftPaneRoot) {
var organizer = Services.wm.getMostRecentWindow("Places:Organizer");
// Due to bug 528706, getMostRecentWindow can return closed windows.
if (!organizer || organizer.closed) {
@ -499,7 +499,7 @@ function HistoryMenu(aPopupShowingEvent) {
}
HistoryMenu.prototype = {
toggleRestoreLastSession: function () {
toggleRestoreLastSession: function() {
let restoreItem = this._rootElt.ownerDocument.getElementById("Browser:RestoreLastSession");
if (this._ss.canRestoreLastSession &&
@ -509,7 +509,7 @@ HistoryMenu.prototype = {
restoreItem.setAttribute("disabled", true);
},
toggleRecentlyClosedTabs: function () {
toggleRecentlyClosedTabs: function() {
// enable/disable the Recently Closed Tabs sub menu
var undoMenu = this._rootElt.getElementsByClassName("recentlyClosedTabsMenu")[0];
@ -526,7 +526,7 @@ HistoryMenu.prototype = {
* @param aEvent
* The event when the user clicks the menu item
*/
_undoCloseMiddleClick: function (aEvent) {
_undoCloseMiddleClick: function(aEvent) {
if (aEvent.button != 1)
return;
@ -537,7 +537,7 @@ HistoryMenu.prototype = {
/**
* Populate when the history menu is opened
*/
populateUndoSubmenu: function () {
populateUndoSubmenu: function() {
var undoMenu = this._rootElt.getElementsByClassName("recentlyClosedTabsMenu")[0];
var undoPopup = undoMenu.firstChild;
@ -596,7 +596,7 @@ HistoryMenu.prototype = {
}, false);
},
toggleRecentlyClosedWindows: function () {
toggleRecentlyClosedWindows: function() {
// enable/disable the Recently Closed Windows sub menu
var undoMenu = this._rootElt.getElementsByClassName("recentlyClosedWindowsMenu")[0];
@ -610,7 +610,7 @@ HistoryMenu.prototype = {
/**
* Populate when the history menu is opened
*/
populateUndoWindowSubmenu: function () {
populateUndoWindowSubmenu: function() {
let undoMenu = this._rootElt.getElementsByClassName("recentlyClosedWindowsMenu")[0];
let undoPopup = undoMenu.firstChild;
let menuLabelString = gNavigatorBundle.getString("menuUndoCloseWindowLabel");
@ -672,7 +672,7 @@ HistoryMenu.prototype = {
"for (var i = 0; i < " + undoItems.length + "; i++) undoCloseWindow();");
},
toggleTabsFromOtherComputers: function () {
toggleTabsFromOtherComputers: function() {
// This is a no-op if MOZ_SERVICES_SYNC isn't defined
#ifdef MOZ_SERVICES_SYNC
// Enable/disable the Tabs From Other Computers menu. Some of the menus handled
@ -698,7 +698,7 @@ HistoryMenu.prototype = {
#endif
},
_onPopupShowing: function (aEvent) {
_onPopupShowing: function(aEvent) {
PlacesMenu.prototype._onPopupShowing.apply(this, arguments);
// Don't handle events for submenus.
@ -711,7 +711,7 @@ HistoryMenu.prototype = {
this.toggleTabsFromOtherComputers();
},
_onCommand: function (aEvent) {
_onCommand: function(aEvent) {
let placesNode = aEvent.target._placesNode;
if (placesNode) {
if (!PrivateBrowsingUtils.isWindowPrivate(window))
@ -739,7 +739,7 @@ var BookmarksEventHandler = {
* @param aView
* The places view which aEvent should be associated with.
*/
onClick: function (aEvent, aView) {
onClick: function(aEvent, aView) {
// Only handle middle-click or left-click with modifiers.
#ifdef XP_MACOSX
var modifKey = aEvent.metaKey || aEvent.shiftKey;
@ -786,13 +786,13 @@ var BookmarksEventHandler = {
* @param aView
* The places view which aEvent should be associated with.
*/
onCommand: function (aEvent, aView) {
onCommand: function(aEvent, aView) {
var target = aEvent.originalTarget;
if (target._placesNode)
PlacesUIUtils.openNodeWithEvent(target._placesNode, aEvent, aView);
},
fillInBHTooltip: function (aDocument, aEvent) {
fillInBHTooltip: function(aDocument, aEvent) {
var node;
var cropped = false;
var targetURI;
@ -863,7 +863,7 @@ var PlacesMenuDNDHandler = {
* @param event
* The DragEnter event that spawned the opening.
*/
onDragEnter: function (event) {
onDragEnter: function(event) {
// Opening menus in a Places popup is handled by the view itself.
if (!this._isStaticContainer(event.target))
return;
@ -887,7 +887,7 @@ var PlacesMenuDNDHandler = {
* @returns true if the element is a container element (menu or
* menu-toolbarbutton), false otherwise.
*/
onDragLeave: function (event) {
onDragLeave: function(event) {
// Handle menu-button separate targets.
if (event.relatedTarget === event.currentTarget ||
event.relatedTarget.parentNode === event.currentTarget)
@ -924,7 +924,7 @@ var PlacesMenuDNDHandler = {
* @returns true if the element is a container element (menu or
*` menu-toolbarbutton), false otherwise.
*/
_isStaticContainer: function (node) {
_isStaticContainer: function(node) {
let isMenu = node.localName == "menu" ||
(node.localName == "toolbarbutton" &&
(node.getAttribute("type") == "menu" ||
@ -940,7 +940,7 @@ var PlacesMenuDNDHandler = {
* @param event
* The DragOver event.
*/
onDragOver: function (event) {
onDragOver: function(event) {
let ip = new InsertionPoint(PlacesUtils.bookmarksMenuFolderId,
PlacesUtils.bookmarks.DEFAULT_INDEX,
Ci.nsITreeView.DROP_ON);
@ -955,7 +955,7 @@ var PlacesMenuDNDHandler = {
* @param event
* The Drop event.
*/
onDrop: function (event) {
onDrop: function(event) {
// Put the item at the end of bookmark menu.
let ip = new InsertionPoint(PlacesUtils.bookmarksMenuFolderId,
PlacesUtils.bookmarks.DEFAULT_INDEX,
@ -979,7 +979,7 @@ var PlacesToolbarHelper = {
return document.getElementById("PlacesToolbar");
},
init: function () {
init: function() {
let viewElt = this._viewElt;
if (!viewElt || viewElt._placesView)
return;
@ -997,7 +997,7 @@ var PlacesToolbarHelper = {
new PlacesToolbar(this._place);
},
customizeStart: function () {
customizeStart: function() {
let viewElt = this._viewElt;
if (viewElt && viewElt._placesView)
viewElt._placesView.uninit();
@ -1005,7 +1005,7 @@ var PlacesToolbarHelper = {
this._isCustomizing = true;
},
customizeDone: function () {
customizeDone: function() {
this._isCustomizing = false;
this.init();
}
@ -1074,11 +1074,11 @@ var BookmarkingUI = {
* reasons.
*/
_popupNeedsUpdate: true,
onToolbarVisibilityChange: function () {
onToolbarVisibilityChange: function() {
this._popupNeedsUpdate = true;
},
onPopupShowing: function (event) {
onPopupShowing: function(event) {
// Don't handle events for submenus.
if (event.target != event.currentTarget)
return;
@ -1112,7 +1112,7 @@ var BookmarkingUI = {
/**
* Handles star styling based on page proxy state changes.
*/
onPageProxyStateChanged: function (aState) {
onPageProxyStateChanged: function(aState) {
if (!this.star) {
return;
}
@ -1126,7 +1126,7 @@ var BookmarkingUI = {
}
},
_updateToolbarStyle: function () {
_updateToolbarStyle: function() {
if (!this.button) {
return;
}
@ -1145,7 +1145,7 @@ var BookmarkingUI = {
}
},
_uninitView: function () {
_uninitView: function() {
// When an element with a placesView attached is removed and re-inserted,
// XBL reapplies the binding causing any kind of issues and possible leaks,
// so kill current view and let popupshowing generate a new one.
@ -1160,22 +1160,22 @@ var BookmarkingUI = {
}
},
customizeStart: function () {
customizeStart: function() {
this._uninitView();
},
customizeChange: function () {
customizeChange: function() {
this._updateToolbarStyle();
},
customizeDone: function () {
customizeDone: function() {
delete this._button;
this.onToolbarVisibilityChange();
this._updateToolbarStyle();
},
_hasBookmarksObserver: false,
uninit: function () {
uninit: function() {
this._uninitView();
if (this._hasBookmarksObserver) {
@ -1188,14 +1188,14 @@ var BookmarkingUI = {
}
},
onLocationChange: function () {
onLocationChange: function() {
if (this._uri && gBrowser.currentURI.equals(this._uri)) {
return;
}
this.updateStarState();
},
updateStarState: function () {
updateStarState: function() {
// Reset tracked values.
this._uri = gBrowser.currentURI;
this._itemIds = [];
@ -1221,7 +1221,7 @@ var BookmarkingUI = {
// calls back. For such an edge case, retain all unique entries from both
// arrays.
this._itemIds = this._itemIds.filter(
function (id) aItemIds.indexOf(id) == -1
function(id) aItemIds.indexOf(id) == -1
).concat(aItemIds);
this._updateStar();
@ -1240,7 +1240,7 @@ var BookmarkingUI = {
}, this);
},
_updateStar: function () {
_updateStar: function() {