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

This commit is contained in:
athenian200 2020-02-06 06:37:09 -06:00 committed by Roy Tam
commit addf7b2fb1
10 changed files with 253 additions and 253 deletions

View file

@ -38,7 +38,7 @@ var FullZoom = {
// Initialization & Destruction
init: function FullZoom_init() {
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 FullZoom_destroy() {
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 FullZoom_handleEvent(event) {
handleEvent: function (event) {
switch (event.type) {
case "ZoomChangeUsingMouseWheel":
let browser = this._getTargetedBrowser(event);
@ -108,11 +108,11 @@ var FullZoom = {
// nsIContentPrefObserver
onContentPrefSet: function FullZoom_onContentPrefSet(aGroup, aName, aValue, aIsPrivate) {
onContentPrefSet: function (aGroup, aName, aValue, aIsPrivate) {
this._onContentPrefChanged(aGroup, aValue, aIsPrivate);
},
onContentPrefRemoved: function FullZoom_onContentPrefRemoved(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 FullZoom__onContentPrefChanged(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
@ -175,7 +175,7 @@ var FullZoom = {
* @param aBrowser
* (optional) browser object displaying the document
*/
onLocationChange: function FullZoom_onLocationChange(aURI, aIsTabSwitch, aBrowser) {
onLocationChange: function (aURI, aIsTabSwitch, aBrowser) {
let browser = aBrowser || gBrowser.selectedBrowser;
// If we haven't been initialized yet but receive an onLocationChange
@ -237,7 +237,7 @@ var FullZoom = {
// update state of zoom type menu item
updateMenu: function FullZoom_updateMenu() {
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 FullZoom_reduce() {
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 FullZoom_enlarge() {
enlarge: function () {
ZoomManager.enlarge();
let browser = gBrowser.selectedBrowser;
this._ignorePendingZoomAccesses(browser);
@ -281,7 +281,7 @@ var FullZoom = {
*
* @return A promise which resolves when the zoom reset has been applied.
*/
reset: function FullZoom_reset(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 FullZoom__applyPrefToZoom(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 FullZoom__applyZoomToPref(browser) {
_applyZoomToPref: function (browser) {
Services.obs.notifyObservers(browser, "browser-fullZoom:zoomChange", "");
if (!this.siteSpecific ||
gInPrintPreviewMode ||
@ -375,7 +375,7 @@ var FullZoom = {
*
* @param browser The zoom of this browser will be removed. Required.
*/
_removePref: function FullZoom__removePref(browser) {
_removePref: function (browser) {
Services.obs.notifyObservers(browser, "browser-fullZoom:zoomReset", "");
if (browser.isSyntheticDocument)
return;
@ -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 FullZoom__getBrowserToken(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 FullZoom__getTargetedBrowser(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 FullZoom__ignorePendingZoomAccesses(browser) {
_ignorePendingZoomAccesses: function (browser) {
let map = this._browserTokenMap;
map.set(browser, (map.get(browser) || 0) + 1);
},
_ensureValid: function FullZoom__ensureValid(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 FullZoom__getGlobalValue(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.
@ -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 FullZoom__loadContextFromBrowser(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 FullZoom__notifyOnLocationChange(browser) {
_notifyOnLocationChange: function (browser) {
this._executeSoon(function () {
Services.obs.notifyObservers(browser, "browser-fullZoom:location-change", "");
});
},
_executeSoon: function FullZoom__executeSoon(callback) {
_executeSoon: function (callback) {
if (!callback)
return;
Services.tm.mainThread.dispatch(callback, Ci.nsIThread.DISPATCH_NORMAL);

View file

@ -24,7 +24,7 @@ var gGestureSupport = {
* @param aAddListener
* True to add/init listeners and false to remove/uninit
*/
init: function GS_init(aAddListener) {
init: function (aAddListener) {
// Bug 863514 - Make gesture support work in electrolysis
if (gMultiProcessBrowser)
return;
@ -50,7 +50,7 @@ var gGestureSupport = {
* @param aEvent
* The gesture event to handle
*/
handleEvent: function GS_handleEvent(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 GS__setupGesture(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 GS__doUpdate(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 GS__swipeNavigatesHistory(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 GS__setupSwipeGesture(aEvent) {
_setupSwipeGesture: function (aEvent) {
if (!this._swipeNavigatesHistory(aEvent))
return;
@ -197,11 +197,11 @@ var gGestureSupport = {
gHistorySwipeAnimation.startAnimation();
this._doUpdate = function GS__doUpdate(aEvent) {
this._doUpdate = function (aEvent) {
gHistorySwipeAnimation.updateAnimation(aEvent.delta);
};
this._doEnd = function GS__doEnd(aEvent) {
this._doEnd = function (aEvent) {
gHistorySwipeAnimation.swipeEndEventReceived();
this._doUpdate = function (aEvent) {};
@ -217,7 +217,7 @@ 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 GS__power(aArray) {
_power: function (aArray) {
// Create a bitmask based on the length of the array
let num = 1 << aArray.length;
while (--num >= 0) {
@ -241,7 +241,7 @@ var gGestureSupport = {
* @return Name of the executed command. Returns null if no command is
* found.
*/
_doAction: function GS__doAction(aEvent, aGesture) {
_doAction: function (aEvent, aGesture) {
let command = this._getCommand(aEvent, aGesture);
return command && this._doCommand(aEvent, command);
},
@ -255,7 +255,7 @@ var gGestureSupport = {
* @param aGesture
* Array of gesture name parts (to be joined by periods)
*/
_getCommand: function GS__getCommand(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)
@ -289,7 +289,7 @@ var gGestureSupport = {
* @param aCommand
* Name of the command found for the event's keys and gesture.
*/
_doCommand: function GS__doCommand(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 GS_onSwipe(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 GS_processSwipeEvent(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 GS__coordinateSwipeEventWithAnimation(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 GS__getPref(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 HSA_init() {
init: function () {
if (!this._isSupported())
return;
@ -568,7 +568,7 @@ var gHistorySwipeAnimation = {
/**
* Uninitializes the support for history swipe animations.
*/
uninit: function HSA_uninit() {
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 HSA_startAnimation() {
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 HSA_stopAnimation() {
stopAnimation: function () {
gHistorySwipeAnimation._removeBoxes();
},
@ -618,7 +618,7 @@ var gHistorySwipeAnimation = {
* A floating point value that represents the progress of the
* swipe gesture.
*/
updateAnimation: function HSA_updateAnimation(aVal) {
updateAnimation: function (aVal) {
if (!this.isAnimationRunning())
return;
@ -668,7 +668,7 @@ var gHistorySwipeAnimation = {
* @param aEvent
* An event to process.
*/
handleEvent: function HSA_handleEvent(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 HSA_isAnimationRunning() {
isAnimationRunning: function () {
return !!this._container;
},
@ -710,7 +710,7 @@ var gHistorySwipeAnimation = {
* @param aDir
* The direction for the swipe event
*/
processSwipeEvent: function HSA_processSwipeEvent(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 HSA_canGoBack() {
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 HSA_canGoForward() {
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 HSA_swipeEndEventReceived() {
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 HSA__doesIndexExistInHistory(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 HSA__navigateToHistoryIndex() {
_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 HSA__isSupported() {
_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 HSA__handleFastSwiping() {
_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 HSA__addBoxes() {
_addBoxes: function () {
let browserStack =
document.getAnonymousElementByAttribute(gBrowser.getNotificationBox(),
"class", "browserStack");
@ -830,7 +830,7 @@ var gHistorySwipeAnimation = {
/**
* Removes the boxes.
*/
_removeBoxes: function HSA__removeBoxes() {
_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 HSA__createElement(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 HSA__positionBox(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 HSA__takeSnapshot() {
_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 HSA__getMaxSnapshots() {
_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 HSA__assignSnapshotToCurrentBrowser(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 HSA__removeTrackedSnapshot(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 HSA__addSnapshotRefToArray(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 HSA__convertToImg(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 HSA__installCurrentPageSnapshot(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 HSA__installPrevAndNextSnapshots() {
function () {
let snapshots = gBrowser.selectedBrowser.snapshots || [];
let currIndex = this._historyIndex;
let prevIndex = currIndex - 1;

View file

@ -33,7 +33,7 @@ var StarUI = {
["cmd_close", "cmd_closeWindow"].map(function (id) this._element(id), this);
},
_blockCommands: function SU__blockCommands() {
_blockCommands: function () {
this._blockedCommands.forEach(function (elt) {
// make sure not to permanently disable this item (see bug 409155)
if (elt.hasAttribute("wasDisabled"))
@ -47,7 +47,7 @@ var StarUI = {
});
},
_restoreCommandsState: function SU__restoreCommandsState() {
_restoreCommandsState: function () {
this._blockedCommands.forEach(function (elt) {
if (elt.getAttribute("wasDisabled") != "true")
elt.removeAttribute("disabled");
@ -56,7 +56,7 @@ var StarUI = {
},
// nsIDOMEventListener
handleEvent: function SU_handleEvent(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 SU_showEditBookmarkPopup(aItemId, aAnchorElement, aPosition) {
function (aItemId, aAnchorElement, aPosition) {
// Performance: load the overlay the first time the panel is opened
// (see bug 392443).
if (this._overlayLoading)
@ -152,7 +152,7 @@ var StarUI = {
},
_doShowEditBookmarkPanel:
function SU__doShowEditBookmarkPanel(aItemId, aAnchorElement, aPosition) {
function (aItemId, aAnchorElement, aPosition) {
if (this.panel.state != "closed")
return;
@ -210,7 +210,7 @@ var StarUI = {
},
panelShown:
function SU_panelShown(aEvent) {
function (aEvent) {
if (aEvent.target == this.panel) {
if (!this._element("editBookmarkPanelContent").hidden) {
let fieldToFocus = "editBMPanel_" +
@ -227,24 +227,24 @@ var StarUI = {
}
},
quitEditMode: function SU_quitEditMode() {
quitEditMode: function () {
this._element("editBookmarkPanelContent").hidden = true;
this._element("editBookmarkPanelBottomButtons").hidden = true;
gEditItemOverlay.uninitPanel(true);
},
cancelButtonOnCommand: function SU_cancelButtonOnCommand() {
cancelButtonOnCommand: function () {
this._actionOnHide = "cancel";
this.panel.hidePopup();
},
removeBookmarkButtonCommand: function SU_removeBookmarkButtonCommand() {
removeBookmarkButtonCommand: function () {
this._uriForRemoval = PlacesUtils.bookmarks.getBookmarkURI(this._itemId);
this._actionOnHide = "remove";
this.panel.hidePopup();
},
beginBatch: function SU_beginBatch() {
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 PCH_bookmarkPage(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 PCH_bookmarkCurrentPage(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 PCH_bookmarkLink(aParent, aURL, aTitle) {
bookmarkLink: function (aParent, aURL, aTitle) {
var linkURI = makeURI(aURL);
var itemId = PlacesUtils.getMostRecentBookmarkForURI(linkURI);
if (itemId == -1) {
@ -401,7 +401,7 @@ var PlacesCommandHook = {
* Adds a folder with bookmarks to all of the currently open tabs in this
* window.
*/
bookmarkCurrentPages: function PCH_bookmarkCurrentPages() {
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 PCH_updateBookmarkAllTabsCommand() {
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 PCH_addLiveBookmark(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 PCH_showPlacesOrganizer(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 HM_toggleRestoreLastSession() {
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 HM_toggleRecentlyClosedTabs() {
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 PHM__undoCloseMiddleClick(aEvent) {
_undoCloseMiddleClick: function (aEvent) {
if (aEvent.button != 1)
return;
@ -537,7 +537,7 @@ HistoryMenu.prototype = {
/**
* Populate when the history menu is opened
*/
populateUndoSubmenu: function PHM_populateUndoSubmenu() {
populateUndoSubmenu: function () {
var undoMenu = this._rootElt.getElementsByClassName("recentlyClosedTabsMenu")[0];
var undoPopup = undoMenu.firstChild;
@ -596,7 +596,7 @@ HistoryMenu.prototype = {
}, false);
},
toggleRecentlyClosedWindows: function PHM_toggleRecentlyClosedWindows() {
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 PHM_populateUndoWindowSubmenu() {
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 PHM_toggleTabsFromOtherComputers() {
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 HM__onPopupShowing(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 HM__onCommand(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 BEH_onClick(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 BEH_onCommand(aEvent, aView) {
onCommand: function (aEvent, aView) {
var target = aEvent.originalTarget;
if (target._placesNode)
PlacesUIUtils.openNodeWithEvent(target._placesNode, aEvent, aView);
},
fillInBHTooltip: function BEH_fillInBHTooltip(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 PMDH_onDragEnter(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 PMDH_onDragLeave(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 PMDH__isContainer(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 PMDH_onDragOver(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 PMDH_onDrop(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 PTH_init() {
init: function () {
let viewElt = this._viewElt;
if (!viewElt || viewElt._placesView)
return;
@ -997,7 +997,7 @@ var PlacesToolbarHelper = {
new PlacesToolbar(this._place);
},
customizeStart: function PTH_customizeStart() {
customizeStart: function () {
let viewElt = this._viewElt;
if (viewElt && viewElt._placesView)
viewElt._placesView.uninit();
@ -1005,7 +1005,7 @@ var PlacesToolbarHelper = {
this._isCustomizing = true;
},
customizeDone: function PTH_customizeDone() {
customizeDone: function () {
this._isCustomizing = false;
this.init();
}
@ -1074,11 +1074,11 @@ var BookmarkingUI = {
* reasons.
*/
_popupNeedsUpdate: true,
onToolbarVisibilityChange: function BUI_onToolbarVisibilityChange() {
onToolbarVisibilityChange: function () {
this._popupNeedsUpdate = true;
},
onPopupShowing: function BUI_onPopupShowing(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 BUI_onPageProxyStateChanged(aState) {
onPageProxyStateChanged: function (aState) {
if (!this.star) {
return;
}
@ -1126,7 +1126,7 @@ var BookmarkingUI = {
}
},
_updateToolbarStyle: function BUI__updateToolbarStyle() {
_updateToolbarStyle: function () {
if (!this.button) {
return;
}
@ -1145,7 +1145,7 @@ var BookmarkingUI = {
}
},
_uninitView: function BUI__uninitView() {
_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 BUI_customizeStart() {
customizeStart: function () {
this._uninitView();
},
customizeChange: function BUI_customizeChange() {
customizeChange: function () {
this._updateToolbarStyle();
},
customizeDone: function BUI_customizeDone() {
customizeDone: function () {
delete this._button;
this.onToolbarVisibilityChange();
this._updateToolbarStyle();
},
_hasBookmarksObserver: false,
uninit: function BUI_uninit() {
uninit: function () {
this._uninitView();
if (this._hasBookmarksObserver) {
@ -1188,14 +1188,14 @@ var BookmarkingUI = {
}
},
onLocationChange: function BUI_onLocationChange() {
onLocationChange: function () {
if (this._uri && gBrowser.currentURI.equals(this._uri)) {
return;
}
this.updateStarState();
},
updateStarState: function BUI_updateStarState() {
updateStarState: function () {
// Reset tracked values.
this._uri = gBrowser.currentURI;
this._itemIds = [];
@ -1240,7 +1240,7 @@ var BookmarkingUI = {
}, this);
},
_updateStar: function BUI__updateStar() {
_updateStar: function () {
if (!this.star) {
return;
}
@ -1255,7 +1255,7 @@ var BookmarkingUI = {
}
},
onCommand: function BUI_onCommand(aEvent) {
onCommand: function (aEvent) {
if (aEvent.target != aEvent.currentTarget) {
return;
}
@ -1266,7 +1266,7 @@ var BookmarkingUI = {
},
// nsINavBookmarkObserver
onItemAdded: function BUI_onItemAdded(aItemId, aParentId, aIndex, aItemType,
onItemAdded: function (aItemId, aParentId, aIndex, aItemType,
aURI) {
if (aURI && aURI.equals(this._uri)) {
// If a new bookmark has been added to the tracked uri, register it.
@ -1277,7 +1277,7 @@ var BookmarkingUI = {
}
},
onItemRemoved: function BUI_onItemRemoved(aItemId) {
onItemRemoved: function (aItemId) {
let index = this._itemIds.indexOf(aItemId);
// If one of the tracked bookmarks has been removed, unregister it.
if (index != -1) {
@ -1286,7 +1286,7 @@ var BookmarkingUI = {
}
},
onItemChanged: function BUI_onItemChanged(aItemId, aProperty,
onItemChanged: function (aItemId, aProperty,
aIsAnnotationProperty, aNewValue) {
if (aProperty == "uri") {
let index = this._itemIds.indexOf(aItemId);

View file

@ -269,12 +269,12 @@ var gPluginHandler = {
}
},
isKnownPlugin: function PH_isKnownPlugin(objLoadingContent) {
isKnownPlugin: function (objLoadingContent) {
return (objLoadingContent.getContentTypeForMIMEType(objLoadingContent.actualType) ==
Ci.nsIObjectLoadingContent.TYPE_PLUGIN);
},
canActivatePlugin: function PH_canActivatePlugin(objLoadingContent) {
canActivatePlugin: function (objLoadingContent) {
// if this isn't a known plugin, we can't activate it
// (this also guards pluginHost.getPermissionStringForType against
// unexpected input)
@ -307,7 +307,7 @@ var gPluginHandler = {
overlay.style.visibility = "hidden";
},
stopPlayPreview: function PH_stopPlayPreview(aPlugin, aPlayPlugin) {
stopPlayPreview: function (aPlugin, aPlayPlugin) {
let objLoadingContent = aPlugin.QueryInterface(Ci.nsIObjectLoadingContent);
if (objLoadingContent.activated)
return;
@ -340,7 +340,7 @@ var gPluginHandler = {
},
// Event listener for click-to-play plugins.
_handleClickToPlayEvent: function PH_handleClickToPlayEvent(aPlugin) {
_handleClickToPlayEvent: function (aPlugin) {
let doc = aPlugin.ownerDocument;
let browser = gBrowser.getBrowserForDocument(doc.defaultView.top.document);
let pluginHost = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
@ -372,7 +372,7 @@ var gPluginHandler = {
},
_overlayClickListener: {
handleEvent: function PH_handleOverlayClick(aEvent) {
handleEvent: function (aEvent) {
let plugin = document.getBindingParent(aEvent.target);
let contentWindow = plugin.ownerDocument.defaultView.top;
// gBrowser.getBrowserForDocument does not exist in the case where we
@ -399,7 +399,7 @@ var gPluginHandler = {
}
},
_handlePlayPreviewEvent: function PH_handlePlayPreviewEvent(aPlugin) {
_handlePlayPreviewEvent: function (aPlugin) {
let doc = aPlugin.ownerDocument;
let browser = gBrowser.getBrowserForDocument(doc.defaultView.top.document);
let pluginHost = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
@ -441,7 +441,7 @@ var gPluginHandler = {
}
},
reshowClickToPlayNotification: function PH_reshowClickToPlayNotification() {
reshowClickToPlayNotification: function () {
let browser = gBrowser.selectedBrowser;
let contentWindow = browser.contentWindow;
let cwu = contentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
@ -459,7 +459,7 @@ var gPluginHandler = {
gPluginHandler._showClickToPlayNotification(browser);
},
_clickToPlayNotificationEventCallback: function PH_ctpEventCallback(event) {
_clickToPlayNotificationEventCallback: function (event) {
if (event == "showing") {
gPluginHandler._makeCenterActions(this);
}
@ -470,7 +470,7 @@ var gPluginHandler = {
}
},
_makeCenterActions: function PH_makeCenterActions(notification) {
_makeCenterActions: function (notification) {
let contentWindow = notification.browser.contentWindow;
let cwu = contentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils);
@ -533,7 +533,7 @@ var gPluginHandler = {
* and activate plugins if necessary.
* aNewState should be either "allownow" "allowalways" or "block"
*/
_updatePluginPermission: function PH_setPermissionForPlugins(aNotification, aPluginInfo, aNewState) {
_updatePluginPermission: function (aNotification, aPluginInfo, aNewState) {
let permission;
let expireType;
let expireTime;
@ -598,7 +598,7 @@ var gPluginHandler = {
}
},
_showClickToPlayNotification: function PH_showClickToPlayNotification(aBrowser, aPrimaryPlugin) {
_showClickToPlayNotification: function (aBrowser, aPrimaryPlugin) {
let notification = PopupNotifications.getNotification("click-to-play-plugins", aBrowser);
let contentWindow = aBrowser.contentWindow;

View file

@ -20,7 +20,7 @@ var gSyncUI = {
_unloaded: false,
init: function SUI_init() {
init: function () {
// Proceed to set up the UI if Sync has already started up.
// Otherwise we'll do it when Sync is firing up.
let xps = Components.classes["@mozilla.org/weave/service;1"]
@ -48,7 +48,7 @@ var gSyncUI = {
}, false);
},
initUI: function SUI_initUI() {
initUI: function () {
// If this is a browser window?
if (gBrowser) {
this._obs.push("weave:notification:added");
@ -64,7 +64,7 @@ var gSyncUI = {
this.updateUI();
},
initNotifications: function SUI_initNotifications() {
initNotifications: function () {
const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
let notificationbox = document.createElementNS(XULNS, "notificationbox");
notificationbox.id = "sync-notifications";
@ -82,13 +82,13 @@ var gSyncUI = {
_wasDelayed: false,
_needsSetup: function SUI__needsSetup() {
_needsSetup: function () {
let firstSync = Services.prefs.getCharPref("services.sync.firstSync", "");
return Weave.Status.checkSetup() == Weave.CLIENT_NOT_CONFIGURED ||
firstSync == "notReady";
},
updateUI: function SUI_updateUI() {
updateUI: function () {
let needsSetup = this._needsSetup();
document.getElementById("sync-setup-state").hidden = !needsSetup;
document.getElementById("sync-syncnow-state").hidden = needsSetup;
@ -108,7 +108,7 @@ var gSyncUI = {
// Functions called by observers
onActivityStart: function SUI_onActivityStart() {
onActivityStart: function () {
if (!gBrowser)
return;
@ -119,7 +119,7 @@ var gSyncUI = {
button.setAttribute("status", "active");
},
onSyncDelay: function SUI_onSyncDelay() {
onSyncDelay: function () {
// basically, we want to just inform users that stuff is going to take a while
let title = this._stringBundle.GetStringFromName("error.sync.no_node_found.title");
let description = this._stringBundle.GetStringFromName("error.sync.no_node_found");
@ -134,17 +134,17 @@ var gSyncUI = {
this._wasDelayed = true;
},
onLoginFinish: function SUI_onLoginFinish() {
onLoginFinish: function () {
// Clear out any login failure notifications
let title = this._stringBundle.GetStringFromName("error.login.title");
this.clearError(title);
},
onSetupComplete: function SUI_onSetupComplete() {
onSetupComplete: function () {
this.onLoginFinish();
},
onLoginError: function SUI_onLoginError() {
onLoginError: function () {
// if login fails, any other notifications are essentially moot
Weave.Notifications.removeAll();
@ -182,11 +182,11 @@ var gSyncUI = {
this.updateUI();
},
onLogout: function SUI_onLogout() {
onLogout: function () {
this.updateUI();
},
onStartOver: function SUI_onStartOver() {
onStartOver: function () {
this.clearError();
},
@ -211,11 +211,11 @@ var gSyncUI = {
},
// Commands
doSync: function SUI_doSync() {
doSync: function () {
setTimeout(function() Weave.Service.errorHandler.syncAndReportErrors(), 0);
},
handleToolbarButton: function SUI_handleStatusbarButton() {
handleToolbarButton: function () {
if (this._needsSetup())
this.openSetup();
else
@ -235,7 +235,7 @@ var gSyncUI = {
* "reset" -- reset sync
*/
openSetup: function SUI_openSetup(wizardType) {
openSetup: function (wizardType) {
let win = Services.wm.getMostRecentWindow("Weave:AccountSetup");
if (win)
win.focus();
@ -258,7 +258,7 @@ var gSyncUI = {
"syncAddDevice", "centerscreen,chrome,resizable=no");
},
openQuotaDialog: function SUI_openQuotaDialog() {
openQuotaDialog: function () {
let win = Services.wm.getMostRecentWindow("Sync:ViewQuota");
if (win)
win.focus();
@ -268,13 +268,13 @@ var gSyncUI = {
"centerscreen,chrome,dialog,modal");
},
openPrefs: function SUI_openPrefs() {
openPrefs: function () {
openPreferences("paneSync");
},
// Helpers
_updateLastSyncTime: function SUI__updateLastSyncTime() {
_updateLastSyncTime: function () {
if (!gBrowser)
return;
@ -296,12 +296,12 @@ var gSyncUI = {
syncButton.setAttribute("tooltiptext", lastSyncLabel);
},
clearError: function SUI_clearError(errorString) {
clearError: function (errorString) {
Weave.Notifications.removeAll(errorString);
this.updateUI();
},
onSyncFinish: function SUI_onSyncFinish() {
onSyncFinish: function () {
let title = this._stringBundle.GetStringFromName("error.sync.title");
// Clear out sync failures on a successful sync
@ -314,7 +314,7 @@ var gSyncUI = {
}
},
onSyncError: function SUI_onSyncError() {
onSyncError: function () {
let title = this._stringBundle.GetStringFromName("error.sync.title");
if (Weave.Status.login != Weave.LOGIN_SUCCEEDED) {
@ -395,7 +395,7 @@ var gSyncUI = {
this.updateUI();
},
observe: function SUI_observe(subject, topic, data) {
observe: function (subject, topic, data) {
if (this._unloaded) {
Cu.reportError("SyncUI observer called after unload: " + topic);
return;

View file

@ -22,7 +22,7 @@ var tabPreviews = {
return this.height = Math.round(this.width * this.aspectRatio);
},
init: function tabPreviews_init() {
init: function () {
if (this._selectedTab)
return;
this._selectedTab = gBrowser.selectedTab;
@ -31,7 +31,7 @@ var tabPreviews = {
gBrowser.tabContainer.addEventListener("SSTabRestored", this, false);
},
get: function tabPreviews_get(aTab) {
get: function (aTab) {
let uri = aTab.linkedBrowser.currentURI.spec;
if (aTab.__thumbnail_lastURI &&
@ -52,7 +52,7 @@ var tabPreviews = {
return this.capture(aTab, !aTab.hasAttribute("busy"));
},
capture: function tabPreviews_capture(aTab, aStore) {
capture: function (aTab, aStore) {
var thumbnail = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas");
thumbnail.mozOpaque = true;
thumbnail.height = this.height;
@ -75,7 +75,7 @@ var tabPreviews = {
return thumbnail;
},
handleEvent: function tabPreviews_handleEvent(event) {
handleEvent: function (event) {
switch (event.type) {
case "TabSelect":
if (this._selectedTab &&
@ -228,7 +228,7 @@ var ctrlTab = {
return this._tabList = list;
},
init: function ctrlTab_init() {
init: function () {
if (!this._recentlyUsedTabs) {
tabPreviews.init();
@ -237,13 +237,13 @@ var ctrlTab = {
}
},
uninit: function ctrlTab_uninit() {
uninit: function () {
this._recentlyUsedTabs = null;
this._init(false);
},
prefName: "browser.ctrlTab.previews",
readPref: function ctrlTab_readPref() {
readPref: function () {
var enable =
gPrefService.getBoolPref(this.prefName) &&
(!gPrefService.prefHasUserValue("browser.ctrlTab.disallowForScreenReaders") ||
@ -258,7 +258,7 @@ var ctrlTab = {
this.readPref();
},
updatePreviews: function ctrlTab_updatePreviews() {
updatePreviews: function () {
for (let i = 0; i < this.previews.length; i++)
this.updatePreview(this.previews[i], this.tabList[i]);
@ -267,7 +267,7 @@ var ctrlTab = {
PluralForm.get(this.tabCount, showAllLabel).replace("#1", this.tabCount);
},
updatePreview: function ctrlTab_updatePreview(aPreview, aTab) {
updatePreview: function (aPreview, aTab) {
if (aPreview == this.showAllButton)
return;
@ -301,7 +301,7 @@ var ctrlTab = {
}
},
advanceFocus: function ctrlTab_advanceFocus(aForward) {
advanceFocus: function (aForward) {
let selectedIndex = Array.indexOf(this.previews, this.selected);
do {
selectedIndex += aForward ? 1 : -1;
@ -325,12 +325,12 @@ var ctrlTab = {
}
},
_mouseOverFocus: function ctrlTab_mouseOverFocus(aPreview) {
_mouseOverFocus: function (aPreview) {
if (this._trackMouseOver)
aPreview.focus();
},
pick: function ctrlTab_pick(aPreview) {
pick: function (aPreview) {
if (!this.tabCount)
return;
@ -342,17 +342,17 @@ var ctrlTab = {
this.close(select._tab);
},
showAllTabs: function ctrlTab_showAllTabs(aPreview) {
showAllTabs: function (aPreview) {
this.close();
document.getElementById("Browser:ShowAllTabs").doCommand();
},
remove: function ctrlTab_remove(aPreview) {
remove: function (aPreview) {
if (aPreview._tab)
gBrowser.removeTab(aPreview._tab);
},
attachTab: function ctrlTab_attachTab(aTab, aPos) {
attachTab: function (aTab, aPos) {
if (aPos == 0)
this._recentlyUsedTabs.unshift(aTab);
else if (aPos)
@ -360,13 +360,13 @@ var ctrlTab = {
else
this._recentlyUsedTabs.push(aTab);
},
detachTab: function ctrlTab_detachTab(aTab) {
detachTab: function (aTab) {
var i = this._recentlyUsedTabs.indexOf(aTab);
if (i >= 0)
this._recentlyUsedTabs.splice(i, 1);
},
open: function ctrlTab_open() {
open: function () {
if (this.isOpen)
return;
@ -385,7 +385,7 @@ var ctrlTab = {
}, 200, this);
},
_openPanel: function ctrlTab_openPanel() {
_openPanel: function () {
tabPreviewPanelHelper.opening(this);
this.panel.width = Math.min(screen.availWidth * .99,
@ -396,7 +396,7 @@ var ctrlTab = {
false);
},
close: function ctrlTab_close(aTabToSelect) {
close: function (aTabToSelect) {
if (!this.isOpen)
return;
@ -413,7 +413,7 @@ var ctrlTab = {
this.panel.hidePopup();
},
setupGUI: function ctrlTab_setupGUI() {
setupGUI: function () {
this.selected.focus();
this._selectedIndex = -1;
@ -426,7 +426,7 @@ var ctrlTab = {
}, 0, this);
},
suspendGUI: function ctrlTab_suspendGUI() {
suspendGUI: function () {
document.removeEventListener("keyup", this, true);
Array.forEach(this.previews, function (preview) {
@ -436,7 +436,7 @@ var ctrlTab = {
this._tabList = null;
},
onKeyPress: function ctrlTab_onKeyPress(event) {
onKeyPress: function (event) {
var isOpen = this.isOpen;
if (isOpen) {
@ -481,7 +481,7 @@ var ctrlTab = {
}
},
removeClosingTabFromUI: function ctrlTab_removeClosingTabFromUI(aTab) {
removeClosingTabFromUI: function (aTab) {
if (this.tabCount == 2) {
this.close();
return;
@ -503,7 +503,7 @@ var ctrlTab = {
}
},
handleEvent: function ctrlTab_handleEvent(event) {
handleEvent: function (event) {
switch (event.type) {
case "TabAttrModified":
// tab attribute modified (e.g. label, crop, busy, image, selected)
@ -536,7 +536,7 @@ var ctrlTab = {
}
},
_init: function ctrlTab__init(enable) {
_init: function (enable) {
var toggleEventListener = enable ? "addEventListener" : "removeEventListener";
var tabContainer = gBrowser.tabContainer;
@ -587,7 +587,7 @@ var allTabs = {
get previews () this.container.getElementsByClassName("allTabs-preview"),
get isOpen () this.panel.state == "open" || this.panel.state == "showing",
init: function allTabs_init() {
init: function () {
if (this._initiated)
return;
this._initiated = true;
@ -604,7 +604,7 @@ var allTabs = {
gBrowser.tabContainer.addEventListener("TabClose", this, false);
},
uninit: function allTabs_uninit() {
uninit: function () {
if (!this._initiated)
return;
@ -620,7 +620,7 @@ var allTabs = {
},
prefName: "browser.allTabs.previews",
readPref: function allTabs_readPref() {
readPref: function () {
var allTabsButton = this.toolbarButton;
if (!allTabsButton)
return;
@ -638,7 +638,7 @@ var allTabs = {
this.readPref();
},
pick: function allTabs_pick(aPreview) {
pick: function (aPreview) {
if (!aPreview)
aPreview = this._firstVisiblePreview;
if (aPreview)
@ -647,12 +647,12 @@ var allTabs = {
this.close();
},
closeTab: function allTabs_closeTab(event) {
closeTab: function (event) {
this.filterField.focus();
gBrowser.removeTab(event.currentTarget._targetPreview._tab);
},
filter: function allTabs_filter() {
filter: function () {
if (this._currentFilter == this.filterField.value)
return;
@ -694,7 +694,7 @@ var allTabs = {
this._reflow();
},
open: function allTabs_open() {
open: function () {
var allTabsButton = this.toolbarButton;
if (allTabsButton &&
allTabsButton.getAttribute("type") == "menu") {
@ -722,11 +722,11 @@ var allTabs = {
this.panel.openPopup(gBrowser, "overlap", 0, 0, false, true);
},
close: function allTabs_close() {
close: function () {
this.panel.hidePopup();
},
setupGUI: function allTabs_setupGUI() {
setupGUI: function () {
this.filterField.focus();
this.filterField.placeholder = this.filterField.tooltipText;
@ -739,7 +739,7 @@ var allTabs = {
document.getElementById("Browser:ShowAllTabs").setAttribute("disabled", "true");
},
suspendGUI: function allTabs_suspendGUI() {
suspendGUI: function () {
this.filterField.placeholder = "";
this.filterField.value = "";
this._currentFilter = null;
@ -755,7 +755,7 @@ var allTabs = {
}, 300);
},
handleEvent: function allTabs_handleEvent(event) {
handleEvent: function (event) {
if (event.type.startsWith("Tab")) {
var tab = event.target;
if (event.type != "TabOpen")
@ -828,7 +828,7 @@ var allTabs = {
return null;
},
_reflow: function allTabs_reflow() {
_reflow: function () {
this._updateTabCloseButton();
const CONTAINER_MAX_WIDTH = this._maxPanelWidth * .95;
@ -887,14 +887,14 @@ var allTabs = {
this.container.maxHeight = rows * outerHeight;
},
_addPreview: function allTabs_addPreview(aTab) {
_addPreview: function (aTab) {
var preview = document.createElement("button");
preview.className = "allTabs-preview";
preview._tab = aTab;
this.container.lastChild.appendChild(preview);
},
_removePreview: function allTabs_removePreview(aPreview) {
_removePreview: function (aPreview) {
var updateUI = (this.isOpen && !aPreview.hidden);
aPreview._tab = null;
aPreview.parentNode.removeChild(aPreview);
@ -905,7 +905,7 @@ var allTabs = {
}
},
_getPreview: function allTabs_getPreview(aTab) {
_getPreview: function (aTab) {
var previews = this.previews;
for (let i = 0; i < previews.length; i++)
if (previews[i]._tab == aTab)
@ -913,7 +913,7 @@ var allTabs = {
return null;
},
_updateTabCloseButton: function allTabs_updateTabCloseButton(event) {
_updateTabCloseButton: function (event) {
if (event && event.target == this.tabCloseButton)
return;
@ -950,7 +950,7 @@ var allTabs = {
}
},
_updatePreview: function allTabs_updatePreview(aPreview) {
_updatePreview: function (aPreview) {
aPreview.setAttribute("label", aPreview._tab.label);
aPreview.setAttribute("tooltiptext", aPreview._tab.label);
aPreview.setAttribute("crop", aPreview._tab.crop);
@ -975,7 +975,7 @@ var allTabs = {
aPreview.appendChild(thumbnail);
},
_onKeyPress: function allTabs_onKeyPress(event) {
_onKeyPress: function (event) {
if (event.eventPhase == event.CAPTURING_PHASE) {
this._onCapturingKeyPress(event);
return;
@ -1010,7 +1010,7 @@ var allTabs = {
}
},
_onCapturingKeyPress: function allTabs_onCapturingKeyPress(event) {
_onCapturingKeyPress: function (event) {
switch (event.keyCode) {
case event.DOM_VK_UP:
case event.DOM_VK_DOWN:
@ -1028,7 +1028,7 @@ var allTabs = {
}
},
_advanceFocusVertically: function allTabs_advanceFocusVertically(event) {
_advanceFocusVertically: function (event) {
var preview = document.activeElement;
if (!preview || preview.parentNode.parentNode != this.container)
return;

View file

@ -30,7 +30,7 @@ var gBrowserThumbnails = {
*/
_tabEvents: ["TabClose", "TabSelect"],
init: function Thumbnails_init() {
init: function () {
// Bug 863512 - Make page thumbnails work in electrolysis
if (gMultiProcessBrowser)
return;
@ -54,7 +54,7 @@ var gBrowserThumbnails = {
this._timeouts = new WeakMap();
},
uninit: function Thumbnails_uninit() {
uninit: function () {
// Bug 863512 - Make page thumbnails work in electrolysis
if (gMultiProcessBrowser)
return;
@ -68,7 +68,7 @@ var gBrowserThumbnails = {
}, this);
},
handleEvent: function Thumbnails_handleEvent(aEvent) {
handleEvent: function (aEvent) {
switch (aEvent.type) {
case "scroll":
let browser = aEvent.currentTarget;
@ -85,13 +85,13 @@ var gBrowserThumbnails = {
}
},
observe: function Thumbnails_observe() {
observe: function () {
this._sslDiskCacheEnabled =
Services.prefs.getBoolPref(this.PREF_DISK_CACHE_SSL);
},
filterForThumbnailExpiration:
function Thumbnails_filterForThumbnailExpiration(aCallback) {
function (aCallback) {
// Tycho: aCallback([browser.currentURI.spec for (browser of gBrowser.browsers)]);
let result = [];
for (let browser of gBrowser.browsers) {
@ -103,19 +103,19 @@ var gBrowserThumbnails = {
/**
* State change progress listener for all tabs.
*/
onStateChange: function Thumbnails_onStateChange(aBrowser, aWebProgress,
onStateChange: function (aBrowser, aWebProgress,
aRequest, aStateFlags, aStatus) {
if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP &&
aStateFlags & Ci.nsIWebProgressListener.STATE_IS_NETWORK)
this._delayedCapture(aBrowser);
},
_capture: function Thumbnails_capture(aBrowser) {
_capture: function (aBrowser) {
if (this._shouldCapture(aBrowser))
PageThumbs.captureAndStore(aBrowser);
},
_delayedCapture: function Thumbnails_delayedCapture(aBrowser) {
_delayedCapture: function (aBrowser) {
if (this._timeouts.has(aBrowser))
clearTimeout(this._timeouts.get(aBrowser));
else
@ -129,7 +129,7 @@ var gBrowserThumbnails = {
this._timeouts.set(aBrowser, timeout);
},
_shouldCapture: function Thumbnails_shouldCapture(aBrowser) {
_shouldCapture: function (aBrowser) {
// Capture only if it's the currently selected tab.
if (aBrowser != gBrowser.selectedBrowser)
return false;
@ -193,7 +193,7 @@ var gBrowserThumbnails = {
return true;
},
_clearTimeout: function Thumbnails_clearTimeout(aBrowser) {
_clearTimeout: function (aBrowser) {
if (this._timeouts.has(aBrowser)) {
aBrowser.removeEventListener("scroll", this, false);
clearTimeout(this._timeouts.get(aBrowser));

View file

@ -2502,7 +2502,7 @@ function BrowserOnAboutPageLoad(doc) {
* Handle command events bubbling up from error page content
*/
var BrowserOnClick = {
handleEvent: function BrowserOnClick_handleEvent(aEvent) {
handleEvent: function (aEvent) {
if (!aEvent.isTrusted || // Don't trust synthetic events
aEvent.button == 2 || aEvent.target.localName != "button") {
return;
@ -2524,7 +2524,7 @@ var BrowserOnClick = {
}
},
onAboutCertError: function BrowserOnClick_onAboutCertError(aTargetElm, aOwnerDoc) {
onAboutCertError: function (aTargetElm, aOwnerDoc) {
let elmId = aTargetElm.getAttribute("id");
let isTopFrame = (aOwnerDoc.defaultView.parent === aOwnerDoc.defaultView);
@ -2565,14 +2565,14 @@ var BrowserOnClick = {
}
},
onAboutNetError: function BrowserOnClick_onAboutNetError(aTargetElm, aOwnerDoc) {
onAboutNetError: function (aTargetElm, aOwnerDoc) {
let elmId = aTargetElm.getAttribute("id");
if (elmId != "errorTryAgain" || !/e=netOffline/.test(aOwnerDoc.documentURI))
return;
Services.io.offline = false;
},
onAboutHome: function BrowserOnClick_onAboutHome(aTargetElm, aOwnerDoc) {
onAboutHome: function (aTargetElm, aOwnerDoc) {
let elmId = aTargetElm.getAttribute("id");
switch (elmId) {
@ -3113,7 +3113,7 @@ const BrowserSearch = {
* the default engine's search form otherwise. For Mac, opens a new window
* or focuses an existing window, if necessary.
*/
webSearch: function BrowserSearch_webSearch() {
webSearch: function () {
#ifdef XP_MACOSX
if (window.location.href != getBrowserURL()) {
var win = getTopWin();
@ -3164,7 +3164,7 @@ const BrowserSearch = {
* @return string Name of the search engine used to perform a search or null
* if a search was not performed.
*/
loadSearch: function BrowserSearch_search(searchText, useNewTab, purpose) {
loadSearch: function (searchText, useNewTab, purpose) {
var engine;
// If the search bar is visible, use the current engine, otherwise, fall
@ -3211,7 +3211,7 @@ const BrowserSearch = {
return document.getElementById("searchbar");
},
loadAddEngines: function BrowserSearch_loadAddEngines() {
loadAddEngines: function () {
var newWindowPref = gPrefService.getIntPref("browser.link.open_newwindow");
var where = newWindowPref == 3 ? "tab" : "window";
var searchEnginesURL = formatURL("browser.search.searchEnginesURL", true);
@ -3637,7 +3637,7 @@ function updateCharacterEncodingMenuState()
}
}
var XULBrowserWindow = {
var XULBrowserWindow = {
// Stored Status, Link and Loading values
status: "",
defaultStatus: "",
@ -4130,7 +4130,7 @@ var XULBrowserWindow = {
},
// simulate all change notifications after switching tabs
onUpdateCurrentBrowser: function XWB_onUpdateCurrentBrowser(aStateFlags, aStatus, aMessage, aTotalProgress) {
onUpdateCurrentBrowser: function (aStateFlags, aStatus, aMessage, aTotalProgress) {
if (FullZoom.updateBackgroundTabs)
FullZoom.onLocationChange(gBrowser.currentURI, true);
var nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
@ -4654,7 +4654,7 @@ var AudioIndicator = {
}
var TabsOnTop = {
init: function TabsOnTop_init() {
init: function () {
Services.prefs.addObserver(this._prefName, this, false);
// Pale Moon: Stop Being a Derp, Mozilla (#3)
// Only show the toggle UI if the user disabled tabs on top.
@ -4664,7 +4664,7 @@ var TabsOnTop = {
// }
},
uninit: function TabsOnTop_uninit() {
uninit: function () {
Services.prefs.removeObserver(this._prefName, this);
},
@ -6940,7 +6940,7 @@ function getBrowser() gBrowser;
function getNavToolbox() gNavToolbox;
var gPrivateBrowsingUI = {
init: function PBUI_init() {
init: function () {
// Do nothing for normal windows
if (!PrivateBrowsingUtils.isWindowPrivate(window)) {
return;

View file

@ -13,7 +13,7 @@ function nsContextMenu(aXulMenu, aIsShift) {
// Prototype for nsContextMenu "class."
nsContextMenu.prototype = {
initMenu: function CM_initMenu(aXulMenu, aIsShift) {
initMenu: function (aXulMenu, aIsShift) {
// Get contextual info.
this.setTarget(document.popupNode, document.popupRangeParent,
document.popupRangeOffset);
@ -40,14 +40,14 @@ nsContextMenu.prototype = {
this.initItems();
},
hiding: function CM_hiding() {
hiding: function () {
gContextMenuContentData = null;
InlineSpellCheckerUI.clearSuggestionsFromMenu();
InlineSpellCheckerUI.clearDictionaryListFromMenu();
InlineSpellCheckerUI.uninit();
},
initItems: function CM_initItems() {
initItems: function () {
this.initPageMenuSeparator();
this.initOpenItems();
this.initNavigationItems();
@ -61,11 +61,11 @@ nsContextMenu.prototype = {
this.initClickToPlayItems();
},
initPageMenuSeparator: function CM_initPageMenuSeparator() {
initPageMenuSeparator: function () {
this.showItem("page-menu-separator", this.hasPageMenu);
},
initOpenItems: function CM_initOpenItems() {
initOpenItems: function () {
var isMailtoInternal = false;
if (this.onMailtoLink) {
var mailtoHandler = Cc["@mozilla.org/uriloader/external-protocol-service;1"].
@ -114,7 +114,7 @@ nsContextMenu.prototype = {
this.showItem("context-sep-open", shouldShow);
},
initNavigationItems: function CM_initNavigationItems() {
initNavigationItems: function () {
var shouldShow = !(this.isContentSelected || this.onLink || this.onImage ||
this.onCanvas || this.onVideo || this.onAudio ||
this.onTextInput);
@ -136,7 +136,7 @@ nsContextMenu.prototype = {
//this.setItemAttrFromNode( "context-stop", "disabled", "canStop" );
},
initLeaveDOMFullScreenItems: function CM_initLeaveFullScreenItem() {
initLeaveDOMFullScreenItems: function () {
// only show the option if the user is in DOM fullscreen
var shouldShow = (this.target.ownerDocument.mozFullScreenElement != null);
this.showItem("context-leave-dom-fullscreen", shouldShow);
@ -146,7 +146,7 @@ nsContextMenu.prototype = {
this.showItem("context-media-sep-commands", true);
},
initSaveItems: function CM_initSaveItems() {
initSaveItems: function () {
var shouldShow = !(this.onTextInput || this.onLink ||
this.isContentSelected || this.onImage ||
this.onCanvas || this.onVideo || this.onAudio);
@ -172,7 +172,7 @@ nsContextMenu.prototype = {
this.setItemAttr("context-sendaudio", "disabled", !this.mediaURL);
},
initViewItems: function CM_initViewItems() {
initViewItems: function () {
// View source is always OK, unless in directory listing.
this.showItem("context-viewpartialsource-selection",
this.isContentSelected);
@ -236,7 +236,7 @@ nsContextMenu.prototype = {
this.showItem("context-viewimageinfo", this.onImage);
},
initMiscItems: function CM_initMiscItems() {
initMiscItems: function () {
// Use "Bookmark This Link" if on a link.
this.showItem("context-bookmarkpage",
!(this.isContentSelected || this.onTextInput || this.onLink ||
@ -426,7 +426,7 @@ nsContextMenu.prototype = {
this.showItem("context-sep-ctp", this.onCTPPlugin);
},
inspectNode: function CM_inspectNode() {
inspectNode: function () {
let {devtools} = Cu.import("resource://devtools/shared/Loader.jsm", {});
let gBrowser = this.browser.ownerDocument.defaultView.gBrowser;
let target = devtools.TargetFactory.forTab(gBrowser.selectedTab);
@ -1027,7 +1027,7 @@ nsContextMenu.prototype = {
saveAsListener.prototype = {
extListener: null,
onStartRequest: function saveLinkAs_onStartRequest(aRequest, aContext) {
onStartRequest: function (aRequest, aContext) {
// if the timer fired, the error status will have been caused by that,
// and we'll be restarting in onStopRequest, so no reason to notify
@ -1065,7 +1065,7 @@ nsContextMenu.prototype = {
this.extListener.onStartRequest(aRequest, aContext);
},
onStopRequest: function saveLinkAs_onStopRequest(aRequest, aContext,
onStopRequest: function (aRequest, aContext,
aStatusCode) {
if (aStatusCode == NS_ERROR_SAVE_LINK_AS_TIMEOUT) {
// do it the old fashioned way, which will pick the best filename
@ -1076,7 +1076,7 @@ nsContextMenu.prototype = {
this.extListener.onStopRequest(aRequest, aContext, aStatusCode);
},
onDataAvailable: function saveLinkAs_onDataAvailable(aRequest, aContext,
onDataAvailable: function (aRequest, aContext,
aInputStream,
aOffset, aCount) {
this.extListener.onDataAvailable(aRequest, aContext, aInputStream,
@ -1086,7 +1086,7 @@ nsContextMenu.prototype = {
function callbacks() {}
callbacks.prototype = {
getInterface: function sLA_callbacks_getInterface(aIID) {
getInterface: function (aIID) {
if (aIID.equals(Ci.nsIAuthPrompt) || aIID.equals(Ci.nsIAuthPrompt2)) {
// If the channel demands authentication prompt, we must cancel it
// because the save-as-timer would expire and cancel the channel
@ -1105,7 +1105,7 @@ nsContextMenu.prototype = {
// we give up waiting for the filename.
function timerCallback() {}
timerCallback.prototype = {
notify: function sLA_timer_notify(aTimer) {
notify: function (aTimer) {
channel.cancel(NS_ERROR_SAVE_LINK_AS_TIMEOUT);
return;
}
@ -1465,11 +1465,11 @@ nsContextMenu.prototype = {
openUILinkIn(uri, where);
},
bookmarkThisPage: function CM_bookmarkThisPage() {
bookmarkThisPage: function () {
window.top.PlacesCommandHook.bookmarkPage(this.browser, PlacesUtils.bookmarksMenuFolderId, true);
},
bookmarkLink: function CM_bookmarkLink() {
bookmarkLink: function () {
var linkText;
// If selected text is found to match valid URL pattern.
if (this.onPlainTextLink)
@ -1480,7 +1480,7 @@ nsContextMenu.prototype = {
linkText);
},
addBookmarkForFrame: function CM_addBookmarkForFrame() {
addBookmarkForFrame: function () {
var doc = this.target.ownerDocument;
var uri = doc.documentURIObject;
@ -1507,23 +1507,23 @@ nsContextMenu.prototype = {
}
},
savePageAs: function CM_savePageAs() {
savePageAs: function () {
saveDocument(this.browser.contentDocument);
},
sendPage: function CM_sendPage() {
sendPage: function () {
MailIntegration.sendLinkForWindow(this.browser.contentWindow);
},
printFrame: function CM_printFrame() {
printFrame: function () {
PrintUtils.print(this.target.ownerDocument.defaultView);
},
switchPageDirection: function CM_switchPageDirection() {
switchPageDirection: function () {
SwitchDocumentDirection(this.browser.contentWindow);
},
mediaCommand : function CM_mediaCommand(command, data) {
mediaCommand : function (command, data) {
var media = this.target;
switch (command) {

View file

@ -589,7 +589,7 @@ var gContiguousSelectionTreeHelper = {
* view
* @return The new view
*/
setTree: function CSTH_setTree(aTreeElement, aProtoTreeView)
setTree: function (aTreeElement, aProtoTreeView)
{
this._tree = aTreeElement;
var newView = this._makeTreeView(aProtoTreeView || aTreeElement.view);
@ -604,7 +604,7 @@ var gContiguousSelectionTreeHelper = {
*
* @return The row index of the grippy
*/
getGrippyRow: function CSTH_getGrippyRow()
getGrippyRow: function ()
{
var sel = this.tree.view.selection;
var rangeCount = sel.getRangeCount();
@ -626,7 +626,7 @@ var gContiguousSelectionTreeHelper = {
* @param aEvent
* The observed dragover event
*/
ondragover: function CSTH_ondragover(aEvent)
ondragover: function (aEvent)
{
// Without this when dragging on Windows the mouse cursor is a "no" sign.
// This makes it a drop symbol.
@ -653,7 +653,7 @@ var gContiguousSelectionTreeHelper = {
* @param aEvent
* The observed dragstart event
*/
ondragstart: function CSTH_ondragstart(aEvent)
ondragstart: function (aEvent)
{
var tbo = this.tree.treeBoxObject;
var clickedRow = tbo.getRowAt(aEvent.clientX, aEvent.clientY);
@ -688,7 +688,7 @@ var gContiguousSelectionTreeHelper = {
* @param aEvent
* The observed keypress event
*/
onkeypress: function CSTH_onkeypress(aEvent)
onkeypress: function (aEvent)
{
var grippyRow = this.getGrippyRow();
var tbo = this.tree.treeBoxObject;
@ -749,7 +749,7 @@ var gContiguousSelectionTreeHelper = {
* @param aEvent
* The observed mousedown event
*/
onmousedown: function CSTH_onmousedown(aEvent)
onmousedown: function (aEvent)
{
var tbo = this.tree.treeBoxObject;
var clickedRow = tbo.getRowAt(aEvent.clientX, aEvent.clientY);
@ -771,7 +771,7 @@ var gContiguousSelectionTreeHelper = {
* @param aEndRow
* The range [0, aEndRow] will be selected.
*/
rangedSelect: function CSTH_rangedSelect(aEndRow)
rangedSelect: function (aEndRow)
{
var tbo = this.tree.treeBoxObject;
if (aEndRow < 0)
@ -784,7 +784,7 @@ var gContiguousSelectionTreeHelper = {
/**
* Scrolls the tree so that the grippy row is in the center of the view.
*/
scrollToGrippy: function CSTH_scrollToGrippy()
scrollToGrippy: function ()
{
var rowCount = this.tree.view.rowCount;
var tbo = this.tree.treeBoxObject;
@ -817,14 +817,14 @@ var gContiguousSelectionTreeHelper = {
* @param aProtoTreeView
* Used as the new view's prototype if specified
*/
_makeTreeView: function CSTH__makeTreeView(aProtoTreeView)
_makeTreeView: function (aProtoTreeView)
{
var view = aProtoTreeView;
var that = this;
//XXXadw: When Alex gets the grippy icon done, this may or may not change,
// depending on how we style it.
view.isSeparator = function CSTH_View_isSeparator(aRow)
view.isSeparator = function (aRow)
{
return aRow === that.getGrippyRow();
};
@ -832,7 +832,7 @@ var gContiguousSelectionTreeHelper = {
// rowCount includes the grippy row.
view.__defineGetter__("_rowCount", view.__lookupGetter__("rowCount"));
view.__defineGetter__("rowCount",
function CSTH_View_rowCount()
function ()
{
return this._rowCount + 1;
});