mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-07 15:57:31 +09:00
[Pale-Moon] Remove excess whitespace.
This commit is contained in:
parent
fcab070621
commit
b6b33a6b2a
73 changed files with 1883 additions and 1883 deletions
|
|
@ -213,7 +213,7 @@ HistoryDownloadElementShell.prototype = {
|
|||
* be activated when entering the visible area. Session downloads are always
|
||||
* active.
|
||||
*/
|
||||
ensureActive: function () {
|
||||
ensureActive: function() {
|
||||
if (!this._active) {
|
||||
this._active = true;
|
||||
this.element.setAttribute("active", true);
|
||||
|
|
@ -305,7 +305,7 @@ HistoryDownloadElementShell.prototype = {
|
|||
},
|
||||
|
||||
/* nsIController */
|
||||
isCommandEnabled: function (aCommand) {
|
||||
isCommandEnabled: function(aCommand) {
|
||||
// The only valid command for inactive elements is cmd_delete.
|
||||
if (!this.active && aCommand != "cmd_delete")
|
||||
return false;
|
||||
|
|
@ -340,7 +340,7 @@ HistoryDownloadElementShell.prototype = {
|
|||
},
|
||||
|
||||
/* nsIController */
|
||||
doCommand: function (aCommand) {
|
||||
doCommand: function(aCommand) {
|
||||
switch (aCommand) {
|
||||
case "downloadsCmd_open": {
|
||||
let file = new FileUtils.File(this.download.target.path);
|
||||
|
|
@ -391,7 +391,7 @@ HistoryDownloadElementShell.prototype = {
|
|||
// Returns whether or not the download handled by this shell should
|
||||
// show up in the search results for the given term. Both the display
|
||||
// name for the download and the url are searched.
|
||||
matchesSearchTerm: function (aTerm) {
|
||||
matchesSearchTerm: function(aTerm) {
|
||||
if (!aTerm)
|
||||
return true;
|
||||
aTerm = aTerm.toLowerCase();
|
||||
|
|
@ -401,7 +401,7 @@ HistoryDownloadElementShell.prototype = {
|
|||
|
||||
// Handles return keypress on the element (the keypress listener is
|
||||
// set in the DownloadsPlacesView object).
|
||||
doDefaultCommand: function () {
|
||||
doDefaultCommand: function() {
|
||||
function getDefaultCommandForState(aState) {
|
||||
switch (aState) {
|
||||
case nsIDM.DOWNLOAD_FINISHED:
|
||||
|
|
@ -435,7 +435,7 @@ HistoryDownloadElementShell.prototype = {
|
|||
* existence of the target file already, we can do it now and then update
|
||||
* the commands as needed.
|
||||
*/
|
||||
onSelect: function () {
|
||||
onSelect: function() {
|
||||
if (!this.active)
|
||||
return;
|
||||
|
||||
|
|
@ -775,7 +775,7 @@ DownloadsPlacesView.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
_removeElement: function (aElement) {
|
||||
_removeElement: function(aElement) {
|
||||
// If the element was selected exclusively, select its next
|
||||
// sibling first, if not, try for previous sibling, if any.
|
||||
if ((aElement.nextSibling || aElement.previousSibling) &&
|
||||
|
|
@ -796,7 +796,7 @@ DownloadsPlacesView.prototype = {
|
|||
},
|
||||
|
||||
_removeHistoryDownloadFromView:
|
||||
function (aPlacesNode) {
|
||||
function(aPlacesNode) {
|
||||
let downloadURI = aPlacesNode.uri;
|
||||
let shellsForURI = this._downloadElementsShellsForURI.get(downloadURI);
|
||||
if (shellsForURI) {
|
||||
|
|
@ -857,7 +857,7 @@ DownloadsPlacesView.prototype = {
|
|||
},
|
||||
|
||||
_ensureVisibleElementsAreActive:
|
||||
function () {
|
||||
function() {
|
||||
if (!this.active || this._ensureVisibleTimer || !this._richlistbox.firstChild)
|
||||
return;
|
||||
|
||||
|
|
@ -964,12 +964,12 @@ DownloadsPlacesView.prototype = {
|
|||
get hasSelection() this.selectedNodes.length > 0,
|
||||
|
||||
containerStateChanged:
|
||||
function (aNode, aOldState, aNewState) {
|
||||
function(aNode, aOldState, aNewState) {
|
||||
this.invalidateContainer(aNode)
|
||||
},
|
||||
|
||||
invalidateContainer:
|
||||
function (aContainer) {
|
||||
function(aContainer) {
|
||||
if (aContainer != this._resultNode)
|
||||
throw new Error("Unexpected container node");
|
||||
if (!aContainer.containerOpen)
|
||||
|
|
@ -1015,7 +1015,7 @@ DownloadsPlacesView.prototype = {
|
|||
goUpdateDownloadCommands();
|
||||
},
|
||||
|
||||
_appendDownloadsFragment: function (aDOMFragment) {
|
||||
_appendDownloadsFragment: function(aDOMFragment) {
|
||||
// Workaround multiple reflows hang by removing the richlistbox
|
||||
// and adding it back when we're done.
|
||||
|
||||
|
|
@ -1037,11 +1037,11 @@ DownloadsPlacesView.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
nodeInserted: function (aParent, aPlacesNode) {
|
||||
nodeInserted: function(aParent, aPlacesNode) {
|
||||
this._addDownloadData(null, aPlacesNode);
|
||||
},
|
||||
|
||||
nodeRemoved: function (aParent, aPlacesNode, aOldIndex) {
|
||||
nodeRemoved: function(aParent, aPlacesNode, aOldIndex) {
|
||||
this._removeHistoryDownloadFromView(aPlacesNode);
|
||||
},
|
||||
|
||||
|
|
@ -1086,7 +1086,7 @@ DownloadsPlacesView.prototype = {
|
|||
* data is done loading. However, if the selection has changed in-between,
|
||||
* we assume the user has already started using the view and give up.
|
||||
*/
|
||||
_ensureInitialSelection: function () {
|
||||
_ensureInitialSelection: function() {
|
||||
// Either they're both null, or the selection has not changed in between.
|
||||
if (this._richlistbox.selectedItem == this._initiallySelectedElement) {
|
||||
let firstDownloadElement = this._richlistbox.firstChild;
|
||||
|
|
@ -1106,7 +1106,7 @@ DownloadsPlacesView.prototype = {
|
|||
},
|
||||
|
||||
onDataLoadStarting: function() { },
|
||||
onDataLoadCompleted: function () {
|
||||
onDataLoadCompleted: function() {
|
||||
this._ensureInitialSelection();
|
||||
},
|
||||
|
||||
|
|
@ -1126,7 +1126,7 @@ DownloadsPlacesView.prototype = {
|
|||
this._removeSessionDownloadFromView(download);
|
||||
},
|
||||
|
||||
supportsCommand: function (aCommand) {
|
||||
supportsCommand: function(aCommand) {
|
||||
if (DOWNLOAD_VIEW_SUPPORTED_COMMANDS.indexOf(aCommand) != -1) {
|
||||
// The clear-downloads command may be performed by the toolbar-button,
|
||||
// which can be focused on OS X. Thus enable this command even if the
|
||||
|
|
@ -1144,7 +1144,7 @@ DownloadsPlacesView.prototype = {
|
|||
return false;
|
||||
},
|
||||
|
||||
isCommandEnabled: function (aCommand) {
|
||||
isCommandEnabled: function(aCommand) {
|
||||
switch (aCommand) {
|
||||
case "cmd_copy":
|
||||
return this._richlistbox.selectedItems.length > 0;
|
||||
|
|
@ -1161,7 +1161,7 @@ DownloadsPlacesView.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
_canClearDownloads: function () {
|
||||
_canClearDownloads: function() {
|
||||
// Downloads can be cleared if there's at least one removable download in
|
||||
// the list (either a history download or a completed session download).
|
||||
// Because history downloads are always removable and are listed after the
|
||||
|
|
@ -1177,7 +1177,7 @@ DownloadsPlacesView.prototype = {
|
|||
},
|
||||
|
||||
_copySelectedDownloadsToClipboard:
|
||||
function () {
|
||||
function() {
|
||||
let urls = [for (element of this._richlistbox.selectedItems)
|
||||
element._shell.download.source.url];
|
||||
|
||||
|
|
@ -1186,7 +1186,7 @@ DownloadsPlacesView.prototype = {
|
|||
.copyString(urls.join("\n"), document);
|
||||
},
|
||||
|
||||
_getURLFromClipboardData: function () {
|
||||
_getURLFromClipboardData: function() {
|
||||
let trans = Cc["@mozilla.org/widget/transferable;1"].
|
||||
createInstance(Ci.nsITransferable);
|
||||
trans.init(null);
|
||||
|
|
@ -1210,19 +1210,19 @@ DownloadsPlacesView.prototype = {
|
|||
return ["", ""];
|
||||
},
|
||||
|
||||
_canDownloadClipboardURL: function () {
|
||||
_canDownloadClipboardURL: function() {
|
||||
let [url, name] = this._getURLFromClipboardData();
|
||||
return url != "";
|
||||
},
|
||||
|
||||
_downloadURLFromClipboard: function () {
|
||||
_downloadURLFromClipboard: function() {
|
||||
let [url, name] = this._getURLFromClipboardData();
|
||||
let browserWin = RecentWindow.getMostRecentBrowserWindow();
|
||||
let initiatingDoc = browserWin ? browserWin.document : document;
|
||||
DownloadURL(url, name, initiatingDoc);
|
||||
},
|
||||
|
||||
doCommand: function (aCommand) {
|
||||
doCommand: function(aCommand) {
|
||||
// Commands may be invoked with keyboard shortcuts even if disabled.
|
||||
if (!this.isCommandEnabled(aCommand)) {
|
||||
return;
|
||||
|
|
@ -1263,7 +1263,7 @@ DownloadsPlacesView.prototype = {
|
|||
|
||||
onEvent: function() { },
|
||||
|
||||
onContextMenu: function (aEvent)
|
||||
onContextMenu: function(aEvent)
|
||||
{
|
||||
let element = this._richlistbox.selectedItem;
|
||||
if (!element || !element._shell)
|
||||
|
|
@ -1283,7 +1283,7 @@ DownloadsPlacesView.prototype = {
|
|||
return true;
|
||||
},
|
||||
|
||||
onKeyPress: function (aEvent) {
|
||||
onKeyPress: function(aEvent) {
|
||||
let selectedElements = this._richlistbox.selectedItems;
|
||||
if (aEvent.keyCode == KeyEvent.DOM_VK_RETURN) {
|
||||
// In the content tree, opening bookmarks by pressing return is only
|
||||
|
|
@ -1304,7 +1304,7 @@ DownloadsPlacesView.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
onDoubleClick: function (aEvent) {
|
||||
onDoubleClick: function(aEvent) {
|
||||
if (aEvent.button != 0)
|
||||
return;
|
||||
|
||||
|
|
@ -1317,11 +1317,11 @@ DownloadsPlacesView.prototype = {
|
|||
element._shell.doDefaultCommand();
|
||||
},
|
||||
|
||||
onScroll: function () {
|
||||
onScroll: function() {
|
||||
this._ensureVisibleElementsAreActive();
|
||||
},
|
||||
|
||||
onSelect: function () {
|
||||
onSelect: function() {
|
||||
goUpdateDownloadCommands();
|
||||
|
||||
let selectedElements = this._richlistbox.selectedItems;
|
||||
|
|
@ -1331,7 +1331,7 @@ DownloadsPlacesView.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
onDragStart: function (aEvent) {
|
||||
onDragStart: function(aEvent) {
|
||||
// TODO Bug 831358: Support d&d for multiple selection.
|
||||
// For now, we just drag the first element.
|
||||
let selectedItem = this._richlistbox.selectedItem;
|
||||
|
|
@ -1357,7 +1357,7 @@ DownloadsPlacesView.prototype = {
|
|||
dt.addElement(selectedItem);
|
||||
},
|
||||
|
||||
onDragOver: function (aEvent) {
|
||||
onDragOver: function(aEvent) {
|
||||
let types = aEvent.dataTransfer.types;
|
||||
if (types.contains("text/uri-list") ||
|
||||
types.contains("text/x-moz-url") ||
|
||||
|
|
@ -1366,7 +1366,7 @@ DownloadsPlacesView.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
onDrop: function (aEvent) {
|
||||
onDrop: function(aEvent) {
|
||||
let dt = aEvent.dataTransfer;
|
||||
// If dragged item is from our source, do not try to
|
||||
// redownload already downloaded file.
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
|
||||
|
||||
var ContentAreaDownloadsView = {
|
||||
init: function () {
|
||||
init: function() {
|
||||
let view = new DownloadsPlacesView(document.getElementById("downloadsRichListBox"));
|
||||
// Do not display the Places downloads in private windows
|
||||
if (!PrivateBrowsingUtils.isWindowPrivate(window)) {
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ const DownloadsPanel = {
|
|||
* @param aCallback
|
||||
* Called when initialization is complete.
|
||||
*/
|
||||
initialize: function (aCallback)
|
||||
initialize: function(aCallback)
|
||||
{
|
||||
DownloadsCommon.log("Attempting to initialize DownloadsPanel for a window.");
|
||||
if (this._state != this.kStateUninitialized) {
|
||||
|
|
@ -164,7 +164,7 @@ const DownloadsPanel = {
|
|||
* downloads. The downloads panel can be reopened later, even after this
|
||||
* function has been called.
|
||||
*/
|
||||
terminate: function ()
|
||||
terminate: function()
|
||||
{
|
||||
DownloadsCommon.log("Attempting to terminate DownloadsPanel for a window.");
|
||||
if (this._state == this.kStateUninitialized) {
|
||||
|
|
@ -214,7 +214,7 @@ const DownloadsPanel = {
|
|||
* initialized the first time this method is called, and the panel is shown
|
||||
* only when data is ready.
|
||||
*/
|
||||
showPanel: function ()
|
||||
showPanel: function()
|
||||
{
|
||||
DownloadsCommon.log("Opening the downloads panel.");
|
||||
|
||||
|
|
@ -229,7 +229,7 @@ const DownloadsPanel = {
|
|||
// called while another window is closing (like the window for selecting
|
||||
// whether to save or open the file), and that would cause the panel to
|
||||
// close immediately.
|
||||
setTimeout(function () DownloadsPanel._openPopupIfDataReady(), 0);
|
||||
setTimeout(function() DownloadsPanel._openPopupIfDataReady(), 0);
|
||||
}.bind(this));
|
||||
|
||||
DownloadsCommon.log("Waiting for the downloads panel to appear.");
|
||||
|
|
@ -240,7 +240,7 @@ const DownloadsPanel = {
|
|||
* Hides the downloads panel, if visible, but keeps the internal state so that
|
||||
* the panel can be reopened quickly if required.
|
||||
*/
|
||||
hidePanel: function ()
|
||||
hidePanel: function()
|
||||
{
|
||||
DownloadsCommon.log("Closing the downloads panel.");
|
||||
|
||||
|
|
@ -297,7 +297,7 @@ const DownloadsPanel = {
|
|||
* Handles the mousemove event for the panel, which disables focusring
|
||||
* visualization.
|
||||
*/
|
||||
handleEvent: function (aEvent)
|
||||
handleEvent: function(aEvent)
|
||||
{
|
||||
if (aEvent.type == "mousemove") {
|
||||
this.keyFocusing = false;
|
||||
|
|
@ -310,7 +310,7 @@ const DownloadsPanel = {
|
|||
/**
|
||||
* Called after data loading finished.
|
||||
*/
|
||||
onViewLoadCompleted: function ()
|
||||
onViewLoadCompleted: function()
|
||||
{
|
||||
this._openPopupIfDataReady();
|
||||
},
|
||||
|
|
@ -318,13 +318,13 @@ const DownloadsPanel = {
|
|||
//////////////////////////////////////////////////////////////////////////////
|
||||
//// User interface event functions
|
||||
|
||||
onWindowUnload: function ()
|
||||
onWindowUnload: function()
|
||||
{
|
||||
// This function is registered as an event listener, we can't use "this".
|
||||
DownloadsPanel.terminate();
|
||||
},
|
||||
|
||||
onPopupShown: function (aEvent)
|
||||
onPopupShown: function(aEvent)
|
||||
{
|
||||
// Ignore events raised by nested popups.
|
||||
if (aEvent.target != aEvent.currentTarget) {
|
||||
|
|
@ -346,7 +346,7 @@ const DownloadsPanel = {
|
|||
this._focusPanel();
|
||||
},
|
||||
|
||||
onPopupHidden: function (aEvent)
|
||||
onPopupHidden: function(aEvent)
|
||||
{
|
||||
// Ignore events raised by nested popups.
|
||||
if (aEvent.target != aEvent.currentTarget) {
|
||||
|
|
@ -375,7 +375,7 @@ const DownloadsPanel = {
|
|||
/**
|
||||
* Shows or focuses the user interface dedicated to downloads history.
|
||||
*/
|
||||
showDownloadsHistory: function ()
|
||||
showDownloadsHistory: function()
|
||||
{
|
||||
DownloadsCommon.log("Showing download history.");
|
||||
// Hide the panel before showing another window, otherwise focus will return
|
||||
|
|
@ -393,7 +393,7 @@ const DownloadsPanel = {
|
|||
* removed in _unattachEventListeners. This is called automatically after the
|
||||
* panel has successfully loaded.
|
||||
*/
|
||||
_attachEventListeners: function ()
|
||||
_attachEventListeners: function()
|
||||
{
|
||||
// Handle keydown to support accel-V.
|
||||
this.panel.addEventListener("keydown", this._onKeyDown.bind(this), false);
|
||||
|
|
@ -406,7 +406,7 @@ const DownloadsPanel = {
|
|||
* Unattach event listeners that were added in _attachEventListeners. This
|
||||
* is called automatically on panel termination.
|
||||
*/
|
||||
_unattachEventListeners: function ()
|
||||
_unattachEventListeners: function()
|
||||
{
|
||||
this.panel.removeEventListener("keydown", this._onKeyDown.bind(this),
|
||||
false);
|
||||
|
|
@ -414,7 +414,7 @@ const DownloadsPanel = {
|
|||
false);
|
||||
},
|
||||
|
||||
_onKeyPress: function (aEvent)
|
||||
_onKeyPress: function(aEvent)
|
||||
{
|
||||
// Handle unmodified keys only.
|
||||
if (aEvent.altKey || aEvent.ctrlKey || aEvent.shiftKey || aEvent.metaKey) {
|
||||
|
|
@ -462,7 +462,7 @@ const DownloadsPanel = {
|
|||
* as the the accel-V "paste" event, which initiates a file download if the
|
||||
* pasted item can be resolved to a URI.
|
||||
*/
|
||||
_onKeyDown: function (aEvent)
|
||||
_onKeyDown: function(aEvent)
|
||||
{
|
||||
// If the footer is focused and the downloads list has at least 1 element
|
||||
// in it, focus the last element in the list when going up.
|
||||
|
|
@ -516,7 +516,7 @@ const DownloadsPanel = {
|
|||
* Move focus to the main element in the downloads panel, unless another
|
||||
* element in the panel is already focused.
|
||||
*/
|
||||
_focusPanel: function ()
|
||||
_focusPanel: function()
|
||||
{
|
||||
// We may be invoked while the panel is still waiting to be shown.
|
||||
if (this._state != this.kStateShown) {
|
||||
|
|
@ -539,7 +539,7 @@ const DownloadsPanel = {
|
|||
/**
|
||||
* Opens the downloads panel when data is ready to be displayed.
|
||||
*/
|
||||
_openPopupIfDataReady: function ()
|
||||
_openPopupIfDataReady: function()
|
||||
{
|
||||
// We don't want to open the popup if we already displayed it, or if we are
|
||||
// still loading data.
|
||||
|
|
@ -627,7 +627,7 @@ const DownloadsOverlayLoader = {
|
|||
* Invoked when loading is completed. If the overlay is already
|
||||
* loaded, the function is called immediately.
|
||||
*/
|
||||
ensureOverlayLoaded: function (aOverlay, aCallback)
|
||||
ensureOverlayLoaded: function(aOverlay, aCallback)
|
||||
{
|
||||
// The overlay is already loaded, invoke the callback immediately.
|
||||
if (aOverlay in this._loadedOverlays) {
|
||||
|
|
@ -663,7 +663,7 @@ const DownloadsOverlayLoader = {
|
|||
* and/or loading more overlays as needed. In most cases, there will be a
|
||||
* single request for one overlay, that will be processed immediately.
|
||||
*/
|
||||
processPendingRequests: function ()
|
||||
processPendingRequests: function()
|
||||
{
|
||||
// Re-process all the currently pending requests, yet allow more requests
|
||||
// to be appended at the end of the array if we're not ready for them.
|
||||
|
|
@ -721,7 +721,7 @@ const DownloadsView = {
|
|||
/**
|
||||
* Called when the number of items in the list changes.
|
||||
*/
|
||||
_itemCountChanged: function ()
|
||||
_itemCountChanged: function()
|
||||
{
|
||||
DownloadsCommon.log("The downloads item count has changed - we are tracking",
|
||||
this._downloads.length, "downloads in total.");
|
||||
|
|
@ -766,7 +766,7 @@ const DownloadsView = {
|
|||
/**
|
||||
* Called before multiple downloads are about to be loaded.
|
||||
*/
|
||||
onDataLoadStarting: function ()
|
||||
onDataLoadStarting: function()
|
||||
{
|
||||
DownloadsCommon.log("onDataLoadStarting called for DownloadsView.");
|
||||
this.loading = true;
|
||||
|
|
@ -775,7 +775,7 @@ const DownloadsView = {
|
|||
/**
|
||||
* Called after data loading finished.
|
||||
*/
|
||||
onDataLoadCompleted: function ()
|
||||
onDataLoadCompleted: function()
|
||||
{
|
||||
DownloadsCommon.log("onDataLoadCompleted called for DownloadsView.");
|
||||
|
||||
|
|
@ -795,7 +795,7 @@ const DownloadsView = {
|
|||
* entering Private Browsing Mode). References to existing data should be
|
||||
* discarded.
|
||||
*/
|
||||
onDataInvalidated: function ()
|
||||
onDataInvalidated: function()
|
||||
{
|
||||
DownloadsCommon.log("Downloads data has been invalidated. Cleaning up",
|
||||
"DownloadsView.");
|
||||
|
|
@ -952,7 +952,7 @@ const DownloadsView = {
|
|||
* @param aCommand
|
||||
* The command to be performed.
|
||||
*/
|
||||
onDownloadCommand: function (aEvent, aCommand)
|
||||
onDownloadCommand: function(aEvent, aCommand)
|
||||
{
|
||||
let target = aEvent.target;
|
||||
while (target.nodeName != "richlistitem") {
|
||||
|
|
@ -961,7 +961,7 @@ const DownloadsView = {
|
|||
DownloadsView.controllerForElement(target).doCommand(aCommand);
|
||||
},
|
||||
|
||||
onDownloadClick: function (aEvent)
|
||||
onDownloadClick: function(aEvent)
|
||||
{
|
||||
// Handle primary clicks only, and exclude the action button.
|
||||
if (aEvent.button == 0 &&
|
||||
|
|
@ -973,7 +973,7 @@ const DownloadsView = {
|
|||
/**
|
||||
* Handles keypress events on a download item.
|
||||
*/
|
||||
onDownloadKeyPress: function (aEvent)
|
||||
onDownloadKeyPress: function(aEvent)
|
||||
{
|
||||
// Pressing the key on buttons should not invoke the action because the
|
||||
// event has already been handled by the button itself.
|
||||
|
|
@ -997,12 +997,12 @@ const DownloadsView = {
|
|||
/**
|
||||
* Mouse listeners to handle selection on hover.
|
||||
*/
|
||||
onDownloadMouseOver: function (aEvent)
|
||||
onDownloadMouseOver: function(aEvent)
|
||||
{
|
||||
if (aEvent.originalTarget.parentNode == this.richListBox)
|
||||
this.richListBox.selectedItem = aEvent.originalTarget;
|
||||
},
|
||||
onDownloadMouseOut: function (aEvent)
|
||||
onDownloadMouseOut: function(aEvent)
|
||||
{
|
||||
if (aEvent.originalTarget.parentNode == this.richListBox) {
|
||||
// If the destination element is outside of the richlistitem, clear the
|
||||
|
|
@ -1016,7 +1016,7 @@ const DownloadsView = {
|
|||
}
|
||||
},
|
||||
|
||||
onDownloadContextMenu: function (aEvent)
|
||||
onDownloadContextMenu: function(aEvent)
|
||||
{
|
||||
let element = this.richListBox.selectedItem;
|
||||
if (!element) {
|
||||
|
|
@ -1030,7 +1030,7 @@ const DownloadsView = {
|
|||
contextMenu.setAttribute("state", element.getAttribute("state"));
|
||||
},
|
||||
|
||||
onDownloadDragStart: function (aEvent)
|
||||
onDownloadDragStart: function(aEvent)
|
||||
{
|
||||
let element = this.richListBox.selectedItem;
|
||||
if (!element) {
|
||||
|
|
@ -1113,12 +1113,12 @@ const DownloadsViewController = {
|
|||
//////////////////////////////////////////////////////////////////////////////
|
||||
//// Initialization and termination
|
||||
|
||||
initialize: function ()
|
||||
initialize: function()
|
||||
{
|
||||
window.controllers.insertControllerAt(0, this);
|
||||
},
|
||||
|
||||
terminate: function ()
|
||||
terminate: function()
|
||||
{
|
||||
window.controllers.removeController(this);
|
||||
},
|
||||
|
|
@ -1126,7 +1126,7 @@ const DownloadsViewController = {
|
|||
//////////////////////////////////////////////////////////////////////////////
|
||||
//// nsIController
|
||||
|
||||
supportsCommand: function (aCommand)
|
||||
supportsCommand: function(aCommand)
|
||||
{
|
||||
// Firstly, determine if this is a command that we can handle.
|
||||
if (!(aCommand in this.commands) &&
|
||||
|
|
@ -1143,7 +1143,7 @@ const DownloadsViewController = {
|
|||
return !!element;
|
||||
},
|
||||
|
||||
isCommandEnabled: function (aCommand)
|
||||
isCommandEnabled: function(aCommand)
|
||||
{
|
||||
// Handle commands that are not selection-specific.
|
||||
if (aCommand == "downloadsCmd_clearList") {
|
||||
|
|
@ -1156,7 +1156,7 @@ const DownloadsViewController = {
|
|||
.isCommandEnabled(aCommand);
|
||||
},
|
||||
|
||||
doCommand: function (aCommand)
|
||||
doCommand: function(aCommand)
|
||||
{
|
||||
// If this command is not selection-specific, execute it.
|
||||
if (aCommand in this.commands) {
|
||||
|
|
@ -1172,12 +1172,12 @@ const DownloadsViewController = {
|
|||
}
|
||||
},
|
||||
|
||||
onEvent: function () { },
|
||||
onEvent: function() { },
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//// Other functions
|
||||
|
||||
updateCommands: function ()
|
||||
updateCommands: function()
|
||||
{
|
||||
Object.keys(this.commands).forEach(goUpdateCommand);
|
||||
Object.keys(DownloadsViewItemController.prototype.commands)
|
||||
|
|
@ -1192,7 +1192,7 @@ const DownloadsViewController = {
|
|||
* the currently selected item in the list.
|
||||
*/
|
||||
commands: {
|
||||
downloadsCmd_clearList: function ()
|
||||
downloadsCmd_clearList: function()
|
||||
{
|
||||
DownloadsCommon.getData(window).removeFinished();
|
||||
}
|
||||
|
|
@ -1213,7 +1213,7 @@ function DownloadsViewItemController(download) {
|
|||
}
|
||||
|
||||
DownloadsViewItemController.prototype = {
|
||||
isCommandEnabled: function (aCommand)
|
||||
isCommandEnabled: function(aCommand)
|
||||
{
|
||||
switch (aCommand) {
|
||||
case "downloadsCmd_open": {
|
||||
|
|
@ -1252,7 +1252,7 @@ DownloadsViewItemController.prototype = {
|
|||
return false;
|
||||
},
|
||||
|
||||
doCommand: function (aCommand)
|
||||
doCommand: function(aCommand)
|
||||
{
|
||||
if (this.isCommandEnabled(aCommand)) {
|
||||
this.commands[aCommand].apply(this);
|
||||
|
|
@ -1268,20 +1268,20 @@ DownloadsViewItemController.prototype = {
|
|||
* In commands, the "this" identifier points to the controller item.
|
||||
*/
|
||||
commands: {
|
||||
cmd_delete: function ()
|
||||
cmd_delete: function()
|
||||
{
|
||||
DownloadsCommon.removeAndFinalizeDownload(this.download);
|
||||
PlacesUtils.bhistory.removePage(
|
||||
NetUtil.newURI(this.download.source.url));
|
||||
},
|
||||
|
||||
downloadsCmd_cancel: function ()
|
||||
downloadsCmd_cancel: function()
|
||||
{
|
||||
this.download.cancel().catch(() => {});
|
||||
this.download.removePartialData().catch(Cu.reportError);
|
||||
},
|
||||
|
||||
downloadsCmd_open: function ()
|
||||
downloadsCmd_open: function()
|
||||
{
|
||||
this.download.launch().catch(Cu.reportError);
|
||||
|
||||
|
|
@ -1293,7 +1293,7 @@ DownloadsViewItemController.prototype = {
|
|||
DownloadsPanel.hidePanel();
|
||||
},
|
||||
|
||||
downloadsCmd_show: function ()
|
||||
downloadsCmd_show: function()
|
||||
{
|
||||
let file = new FileUtils.File(this.download.target.path);
|
||||
DownloadsCommon.showDownloadedFile(file);
|
||||
|
|
@ -1306,7 +1306,7 @@ DownloadsViewItemController.prototype = {
|
|||
DownloadsPanel.hidePanel();
|
||||
},
|
||||
|
||||
downloadsCmd_pauseResume: function ()
|
||||
downloadsCmd_pauseResume: function()
|
||||
{
|
||||
if (this.download.stopped) {
|
||||
this.download.start();
|
||||
|
|
@ -1315,29 +1315,29 @@ DownloadsViewItemController.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
downloadsCmd_retry: function ()
|
||||
downloadsCmd_retry: function()
|
||||
{
|
||||
this.download.start().catch(() => {});
|
||||
},
|
||||
|
||||
downloadsCmd_openReferrer: function ()
|
||||
downloadsCmd_openReferrer: function()
|
||||
{
|
||||
openURL(this.download.source.referrer);
|
||||
},
|
||||
|
||||
downloadsCmd_copyLocation: function ()
|
||||
downloadsCmd_copyLocation: function()
|
||||
{
|
||||
let clipboard = Cc["@mozilla.org/widget/clipboardhelper;1"]
|
||||
.getService(Ci.nsIClipboardHelper);
|
||||
clipboard.copyString(this.download.source.url, document);
|
||||
},
|
||||
|
||||
downloadsCmd_doDefault: function ()
|
||||
downloadsCmd_doDefault: function()
|
||||
{
|
||||
const nsIDM = Ci.nsIDownloadManager;
|
||||
|
||||
// Determine the default command for the current item.
|
||||
let defaultCommand = function () {
|
||||
let defaultCommand = function() {
|
||||
switch (DownloadsCommon.stateOfDownload(this.download)) {
|
||||
case nsIDM.DOWNLOAD_NOTSTARTED: return "downloadsCmd_cancel";
|
||||
case nsIDM.DOWNLOAD_FINISHED: return "downloadsCmd_open";
|
||||
|
|
@ -1478,7 +1478,7 @@ const DownloadsSummary = {
|
|||
* @param aEvent
|
||||
* The keydown event being handled.
|
||||
*/
|
||||
onKeyDown: function (aEvent)
|
||||
onKeyDown: function(aEvent)
|
||||
{
|
||||
if (aEvent.charCode == " ".charCodeAt(0) ||
|
||||
aEvent.keyCode == KeyEvent.DOM_VK_ENTER ||
|
||||
|
|
@ -1493,7 +1493,7 @@ const DownloadsSummary = {
|
|||
* @param aEvent
|
||||
* The click event being handled.
|
||||
*/
|
||||
onClick: function (aEvent)
|
||||
onClick: function(aEvent)
|
||||
{
|
||||
DownloadsPanel.showDownloadsHistory();
|
||||
},
|
||||
|
|
@ -1569,7 +1569,7 @@ const DownloadsFooter = {
|
|||
* is visible, focus it. If not, focus the "Show All Downloads"
|
||||
* button.
|
||||
*/
|
||||
focus: function ()
|
||||
focus: function()
|
||||
{
|
||||
if (this._showingSummary) {
|
||||
DownloadsSummary.focus();
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ const DownloadsButton = {
|
|||
* startup time, and in particular should not cause the Download Manager
|
||||
* service to start.
|
||||
*/
|
||||
initializeIndicator: function ()
|
||||
initializeIndicator: function()
|
||||
{
|
||||
this._update();
|
||||
},
|
||||
|
|
@ -77,7 +77,7 @@ const DownloadsButton = {
|
|||
* placeholder is an ordinary button defined in the browser window that can be
|
||||
* moved freely between the toolbars and the customization palette.
|
||||
*/
|
||||
customizeStart: function ()
|
||||
customizeStart: function()
|
||||
{
|
||||
// Hide the indicator and prevent it to be displayed as a temporary anchor
|
||||
// during customization, even if requested using the getAnchor method.
|
||||
|
|
@ -98,7 +98,7 @@ const DownloadsButton = {
|
|||
/**
|
||||
* This function is called when toolbar customization ends.
|
||||
*/
|
||||
customizeDone: function ()
|
||||
customizeDone: function()
|
||||
{
|
||||
this._customizing = false;
|
||||
this._update();
|
||||
|
|
@ -114,7 +114,7 @@ const DownloadsButton = {
|
|||
* input/output it performs, and in particular should not cause the
|
||||
* Download Manager service to start.
|
||||
*/
|
||||
_update: function () {
|
||||
_update: function() {
|
||||
this._updatePositionInternal();
|
||||
|
||||
if (!DownloadsCommon.useToolkitUI) {
|
||||
|
|
@ -131,7 +131,7 @@ const DownloadsButton = {
|
|||
* that the panel doesn't flicker because we move the DOM element to which
|
||||
* it's anchored.
|
||||
*/
|
||||
updatePosition: function ()
|
||||
updatePosition: function()
|
||||
{
|
||||
if (!this._anchorRequested) {
|
||||
this._updatePositionInternal();
|
||||
|
|
@ -144,7 +144,7 @@ const DownloadsButton = {
|
|||
*
|
||||
* @return Anchor element, or null if the indicator is not visible.
|
||||
*/
|
||||
_updatePositionInternal: function ()
|
||||
_updatePositionInternal: function()
|
||||
{
|
||||
let indicator = DownloadsIndicatorView.indicator;
|
||||
if (!indicator) {
|
||||
|
|
@ -187,7 +187,7 @@ const DownloadsButton = {
|
|||
* Called once the indicator overlay has loaded. Gets a boolean
|
||||
* argument representing the indicator visibility.
|
||||
*/
|
||||
checkIsVisible: function (aCallback)
|
||||
checkIsVisible: function(aCallback)
|
||||
{
|
||||
function DB_CEV_callback() {
|
||||
if (!this._placeholder) {
|
||||
|
|
@ -215,7 +215,7 @@ const DownloadsButton = {
|
|||
* panel should be anchored, or null if an anchor is not available (for
|
||||
* example because both the tab bar and the navigation bar are hidden).
|
||||
*/
|
||||
getAnchor: function (aCallback)
|
||||
getAnchor: function(aCallback)
|
||||
{
|
||||
// Do not allow anchoring the panel to the element while customizing.
|
||||
if (this._customizing) {
|
||||
|
|
@ -235,7 +235,7 @@ const DownloadsButton = {
|
|||
/**
|
||||
* Allows the temporary anchor to be hidden.
|
||||
*/
|
||||
releaseAnchor: function ()
|
||||
releaseAnchor: function()
|
||||
{
|
||||
this._anchorRequested = false;
|
||||
this._updatePositionInternal();
|
||||
|
|
@ -284,7 +284,7 @@ const DownloadsIndicatorView = {
|
|||
/**
|
||||
* Prepares the downloads indicator to be displayed.
|
||||
*/
|
||||
ensureInitialized: function ()
|
||||
ensureInitialized: function()
|
||||
{
|
||||
if (this._initialized) {
|
||||
return;
|
||||
|
|
@ -298,7 +298,7 @@ const DownloadsIndicatorView = {
|
|||
/**
|
||||
* Frees the internal resources related to the indicator.
|
||||
*/
|
||||
ensureTerminated: function ()
|
||||
ensureTerminated: function()
|
||||
{
|
||||
if (!this._initialized) {
|
||||
return;
|
||||
|
|
@ -320,7 +320,7 @@ const DownloadsIndicatorView = {
|
|||
* Ensures that the user interface elements required to display the indicator
|
||||
* are loaded, then invokes the given callback.
|
||||
*/
|
||||
_ensureOperational: function (aCallback)
|
||||
_ensureOperational: function(aCallback)
|
||||
{
|
||||
if (this._operational) {
|
||||
aCallback();
|
||||
|
|
@ -359,7 +359,7 @@ const DownloadsIndicatorView = {
|
|||
* @param aType
|
||||
* Set to "start" for new downloads, "finish" for completed downloads.
|
||||
*/
|
||||
showEventNotification: function (aType)
|
||||
showEventNotification: function(aType)
|
||||
{
|
||||
if (!this._initialized) {
|
||||
return;
|
||||
|
|
@ -386,7 +386,7 @@ const DownloadsIndicatorView = {
|
|||
let indicator = this.indicator;
|
||||
indicator.setAttribute("notification", aType);
|
||||
this._notificationTimeout = setTimeout(
|
||||
function () indicator.removeAttribute("notification"), 1000);
|
||||
function() indicator.removeAttribute("notification"), 1000);
|
||||
}
|
||||
|
||||
this._ensureOperational(DIV_SEN_callback.bind(this));
|
||||
|
|
@ -516,13 +516,13 @@ const DownloadsIndicatorView = {
|
|||
//////////////////////////////////////////////////////////////////////////////
|
||||
//// User interface event functions
|
||||
|
||||
onWindowUnload: function ()
|
||||
onWindowUnload: function()
|
||||
{
|
||||
// This function is registered as an event listener, we can't use "this".
|
||||
DownloadsIndicatorView.ensureTerminated();
|
||||
},
|
||||
|
||||
onCommand: function (aEvent)
|
||||
onCommand: function(aEvent)
|
||||
{
|
||||
if (DownloadsCommon.useToolkitUI) {
|
||||
// The panel won't suppress attention for us, we need to clear now.
|
||||
|
|
@ -535,12 +535,12 @@ const DownloadsIndicatorView = {
|
|||
aEvent.stopPropagation();
|
||||
},
|
||||
|
||||
onDragOver: function (aEvent)
|
||||
onDragOver: function(aEvent)
|
||||
{
|
||||
browserDragAndDrop.dragOver(aEvent);
|
||||
},
|
||||
|
||||
onDrop: function (aEvent)
|
||||
onDrop: function(aEvent)
|
||||
{
|
||||
let dt = aEvent.dataTransfer;
|
||||
// If dragged item is from our source, do not try to
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue