summaryrefslogtreecommitdiffstats
path: root/application/palemoon/components/downloads
diff options
context:
space:
mode:
Diffstat (limited to 'application/palemoon/components/downloads')
-rw-r--r--application/palemoon/components/downloads/DownloadsCommon.jsm16
-rw-r--r--application/palemoon/components/downloads/content/allDownloadsViewOverlay.js23
-rw-r--r--application/palemoon/components/downloads/content/downloads.js14
-rw-r--r--application/palemoon/components/downloads/content/indicator.js12
4 files changed, 52 insertions, 13 deletions
diff --git a/application/palemoon/components/downloads/DownloadsCommon.jsm b/application/palemoon/components/downloads/DownloadsCommon.jsm
index b90baaf9c..0921f8400 100644
--- a/application/palemoon/components/downloads/DownloadsCommon.jsm
+++ b/application/palemoon/components/downloads/DownloadsCommon.jsm
@@ -867,9 +867,19 @@ DownloadsDataCtor.prototype = {
// Sort backwards by start time, ensuring that the most recent
// downloads are added first regardless of their state.
- let loadedItemsArray = [dataItem
- for each (dataItem in this.dataItems)
- if (dataItem)];
+ // Tycho:
+ //let loadedItemsArray = [dataItem
+ // for each (dataItem in this.dataItems)
+ // if (dataItem)];
+
+ let loadedItemsArray = [];
+
+ for each (let dataItem in this.dataItems) {
+ if (dataItem) {
+ loadedItemsArray.push(dataItem);
+ }
+ }
+
loadedItemsArray.sort(function(a, b) b.startTime - a.startTime);
loadedItemsArray.forEach(
function (dataItem) aView.onDataItemAdded(dataItem, false)
diff --git a/application/palemoon/components/downloads/content/allDownloadsViewOverlay.js b/application/palemoon/components/downloads/content/allDownloadsViewOverlay.js
index e1d0e75d4..46e867068 100644
--- a/application/palemoon/components/downloads/content/allDownloadsViewOverlay.js
+++ b/application/palemoon/components/downloads/content/allDownloadsViewOverlay.js
@@ -8,9 +8,9 @@
* ON IT AS AN API.
*/
-let Cu = Components.utils;
-let Ci = Components.interfaces;
-let Cc = Components.classes;
+var Cu = Components.utils;
+var Ci = Components.interfaces;
+var Cc = Components.classes;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
@@ -1408,7 +1408,12 @@ DownloadsPlacesView.prototype = {
_copySelectedDownloadsToClipboard:
function DPV__copySelectedDownloadsToClipboard() {
let selectedElements = this._richlistbox.selectedItems;
- let urls = [e._shell.downloadURI for each (e in selectedElements)];
+ // Tycho: let urls = [e._shell.downloadURI for each (e in selectedElements)];
+ let urls = [];
+
+ for each (e in selectedElements) {
+ urls.push(e._shell.downloadURI);
+ }
Cc["@mozilla.org/widget/clipboardhelper;1"].
getService(Ci.nsIClipboardHelper).copyString(urls.join("\n"), document);
@@ -1471,11 +1476,11 @@ DownloadsPlacesView.prototype = {
goUpdateCommand("downloadsCmd_clearDownloads");
break;
default: {
- // Slicing the array to get a freezed list of selected items. Otherwise,
- // the selectedItems array is live and doCommand may alter the selection
- // while we are trying to do one particular action, like removing items
- // from history.
- let selectedElements = this._richlistbox.selectedItems.slice();
+ // Cloning the nodelist into an array to get a frozen list of selected items.
+ // Otherwise, the selectedItems nodelist is live and doCommand may alter the
+ // selection while we are trying to do one particular action, like removing
+ // items from history.
+ let selectedElements = [...this._richlistbox.selectedItems];
for (let element of selectedElements) {
element._shell.doCommand(aCommand);
}
diff --git a/application/palemoon/components/downloads/content/downloads.js b/application/palemoon/components/downloads/content/downloads.js
index 1a2288041..0412344bc 100644
--- a/application/palemoon/components/downloads/content/downloads.js
+++ b/application/palemoon/components/downloads/content/downloads.js
@@ -590,6 +590,8 @@ const DownloadsPanel = {
}
};
+XPCOMUtils.defineConstant(this, "DownloadsPanel", DownloadsPanel);
+
////////////////////////////////////////////////////////////////////////////////
//// DownloadsOverlayLoader
@@ -677,6 +679,8 @@ const DownloadsOverlayLoader = {
}
};
+XPCOMUtils.defineConstant(this, "DownloadsOverlayLoader", DownloadsOverlayLoader);
+
////////////////////////////////////////////////////////////////////////////////
//// DownloadsView
@@ -1053,6 +1057,8 @@ const DownloadsView = {
}
}
+XPCOMUtils.defineConstant(this, "DownloadsView", DownloadsView);
+
////////////////////////////////////////////////////////////////////////////////
//// DownloadsViewItem
@@ -1414,6 +1420,8 @@ const DownloadsViewController = {
}
};
+XPCOMUtils.defineConstant(this, "DownloadsViewController", DownloadsViewController);
+
////////////////////////////////////////////////////////////////////////////////
//// DownloadsViewItemController
@@ -1754,7 +1762,9 @@ const DownloadsSummary = {
delete this._detailsNode;
return this._detailsNode = node;
}
-}
+};
+
+XPCOMUtils.defineConstant(this, "DownloadsSummary", DownloadsSummary);
////////////////////////////////////////////////////////////////////////////////
//// DownloadsFooter
@@ -1811,3 +1821,5 @@ const DownloadsFooter = {
return this._footerNode = node;
}
};
+
+XPCOMUtils.defineConstant(this, "DownloadsFooter", DownloadsFooter);
diff --git a/application/palemoon/components/downloads/content/indicator.js b/application/palemoon/components/downloads/content/indicator.js
index b0e3217e5..e6a5bd012 100644
--- a/application/palemoon/components/downloads/content/indicator.js
+++ b/application/palemoon/components/downloads/content/indicator.js
@@ -254,6 +254,12 @@ const DownloadsButton = {
}
};
+Object.defineProperty(this, "DownloadsButton", {
+ value: DownloadsButton,
+ enumerable: true,
+ writable: false
+});
+
////////////////////////////////////////////////////////////////////////////////
//// DownloadsIndicatorView
@@ -592,3 +598,9 @@ const DownloadsIndicatorView = {
document.getElementById("downloads-indicator-progress");
}
};
+
+Object.defineProperty(this, "DownloadsIndicatorView", {
+ value: DownloadsIndicatorView,
+ enumerable: true,
+ writable: false
+});