summaryrefslogtreecommitdiffstats
path: root/application/palemoon/components/places
diff options
context:
space:
mode:
authorwicknix <39230578+wicknix@users.noreply.github.com>2019-04-15 18:58:07 -0500
committerGitHub <noreply@github.com>2019-04-15 18:58:07 -0500
commit5a1843c9f9e323627f9c35529e6a8c853d4dbb0d (patch)
tree62de3cd7cb8a6f75e568863bb73ca2deb80d87a9 /application/palemoon/components/places
parent065f6f9e5ebc1ed6cfaadaf7851b6021fa94a013 (diff)
parent095ea556855b38138e39e713f482eb440f7da9b2 (diff)
downloadUXP-5a1843c9f9e323627f9c35529e6a8c853d4dbb0d.tar
UXP-5a1843c9f9e323627f9c35529e6a8c853d4dbb0d.tar.gz
UXP-5a1843c9f9e323627f9c35529e6a8c853d4dbb0d.tar.lz
UXP-5a1843c9f9e323627f9c35529e6a8c853d4dbb0d.tar.xz
UXP-5a1843c9f9e323627f9c35529e6a8c853d4dbb0d.zip
Merge pull request #1 from MoonchildProductions/master
keep up with mc
Diffstat (limited to 'application/palemoon/components/places')
-rw-r--r--application/palemoon/components/places/PlacesUIUtils.jsm40
-rw-r--r--application/palemoon/components/places/content/bookmarkProperties.js5
-rw-r--r--application/palemoon/components/places/content/controller.js17
-rw-r--r--application/palemoon/components/places/content/places.js4
-rw-r--r--application/palemoon/components/places/jar.mn46
-rw-r--r--application/palemoon/components/places/moz.build1
6 files changed, 64 insertions, 49 deletions
diff --git a/application/palemoon/components/places/PlacesUIUtils.jsm b/application/palemoon/components/places/PlacesUIUtils.jsm
index f62535613..05d79241c 100644
--- a/application/palemoon/components/places/PlacesUIUtils.jsm
+++ b/application/palemoon/components/places/PlacesUIUtils.jsm
@@ -146,14 +146,21 @@ this.PlacesUIUtils = {
* annotations are synced from the old one.
* @see this._copyableAnnotations for the list of copyable annotations.
*/
- _getFolderCopyTransaction:
- function PUIU__getFolderCopyTransaction(aData, aContainer, aIndex)
- {
- function getChildItemsTransactions(aChildren)
- {
+ _getFolderCopyTransaction(aData, aContainer, aIndex) {
+ function getChildItemsTransactions(aRoot) {
let transactions = [];
let index = aIndex;
- aChildren.forEach(function (node, i) {
+ for (let i = 0; i < aRoot.childCount; ++i) {
+ let child = aRoot.getChild(i);
+ // Temporary hacks until we switch to PlacesTransactions.jsm.
+ let isLivemark =
+ PlacesUtils.annotations.itemHasAnnotation(child.itemId,
+ PlacesUtils.LMANNO_FEEDURI);
+ let [node] = PlacesUtils.unwrapNodes(
+ PlacesUtils.wrapNode(child, PlacesUtils.TYPE_X_MOZ_PLACE, isLivemark),
+ PlacesUtils.TYPE_X_MOZ_PLACE
+ );
+
// Make sure that items are given the correct index, this will be
// passed by the transaction manager to the backend for the insertion.
// Insertion behaves differently for DEFAULT_INDEX (append).
@@ -184,19 +191,21 @@ this.PlacesUIUtils = {
else {
throw new Error("Unexpected item under a bookmarks folder");
}
- });
+ }
return transactions;
}
- if (aContainer == PlacesUtils.tagsFolderId) { // Copying a tag folder.
+ if (aContainer == PlacesUtils.tagsFolderId) { // Copying into a tag folder.
let transactions = [];
- if (aData.children) {
- aData.children.forEach(function(aChild) {
+ if (!aData.livemark && aData.type == PlacesUtils.TYPE_X_MOZ_PLACE_CONTAINER) {
+ let {root} = PlacesUtils.getFolderContents(aData.id, false, false);
+ let urls = PlacesUtils.getURLsForContainerNode(root);
+ root.containerOpen = false;
+ for (let { uri } of urls) {
transactions.push(
- new PlacesTagURITransaction(PlacesUtils._uri(aChild.uri),
- [aData.title])
+ new PlacesTagURITransaction(NetUtil.newURI(uri), [aData.title])
);
- });
+ }
}
return new PlacesAggregatedTransaction("addTags", transactions);
}
@@ -205,7 +214,10 @@ this.PlacesUIUtils = {
return this._getLivemarkCopyTransaction(aData, aContainer, aIndex);
}
- let transactions = getChildItemsTransactions(aData.children);
+ let {root} = PlacesUtils.getFolderContents(aData.id, false, false);
+ let transactions = getChildItemsTransactions(root);
+ root.containerOpen = false;
+
if (aData.dateAdded) {
transactions.push(
new PlacesEditItemDateAddedTransaction(null, aData.dateAdded)
diff --git a/application/palemoon/components/places/content/bookmarkProperties.js b/application/palemoon/components/places/content/bookmarkProperties.js
index 685ef57d2..e1d1077ab 100644
--- a/application/palemoon/components/places/content/bookmarkProperties.js
+++ b/application/palemoon/components/places/content/bookmarkProperties.js
@@ -382,6 +382,11 @@ var BookmarkPropertiesPanel = {
.addEventListener("input", this, false);
}
}
+
+ // Ensure the Name Picker textbox is focused on load
+ var namePickerElem = document.getElementById('editBMPanel_namePicker');
+ namePickerElem.focus();
+ namePickerElem.select();
}),
// nsIDOMEventListener
diff --git a/application/palemoon/components/places/content/controller.js b/application/palemoon/components/places/content/controller.js
index 7f27e8347..7f5f7f652 100644
--- a/application/palemoon/components/places/content/controller.js
+++ b/application/palemoon/components/places/content/controller.js
@@ -1287,15 +1287,15 @@ PlacesController.prototype = {
if (!didSuppressNotifications)
result.suppressNotifications = true;
- function addData(type, index, overrideURI) {
- let wrapNode = PlacesUtils.wrapNode(node, type, overrideURI, doCopy);
+ function addData(type, index, feedURI) {
+ let wrapNode = PlacesUtils.wrapNode(node, type, feedURI);
dt.mozSetDataAt(type, wrapNode, index);
}
- function addURIData(index, overrideURI) {
- addData(PlacesUtils.TYPE_X_MOZ_URL, index, overrideURI);
- addData(PlacesUtils.TYPE_UNICODE, index, overrideURI);
- addData(PlacesUtils.TYPE_HTML, index, overrideURI);
+ function addURIData(index, feedURI) {
+ addData(PlacesUtils.TYPE_X_MOZ_URL, index, feedURI);
+ addData(PlacesUtils.TYPE_UNICODE, index, feedURI);
+ addData(PlacesUtils.TYPE_HTML, index, feedURI);
}
try {
@@ -1387,12 +1387,11 @@ PlacesController.prototype = {
copiedFolders.push(node);
let livemarkInfo = this.getCachedLivemarkInfo(node);
- let overrideURI = livemarkInfo ? livemarkInfo.feedURI.spec : null;
- let resolveShortcuts = !PlacesControllerDragHelper.canMoveNode(node);
+ let feedURI = livemarkInfo && livemarkInfo.feedURI.spec;
contents.forEach(function (content) {
content.entries.push(
- PlacesUtils.wrapNode(node, content.type, overrideURI, resolveShortcuts)
+ PlacesUtils.wrapNode(node, content.type, feedURI)
);
});
}, this);
diff --git a/application/palemoon/components/places/content/places.js b/application/palemoon/components/places/content/places.js
index a94193823..40dbcb9b8 100644
--- a/application/palemoon/components/places/content/places.js
+++ b/application/palemoon/components/places/content/places.js
@@ -491,7 +491,7 @@ var PlacesOrganizer = {
Task.spawn(function() {
try {
- yield BookmarkJSONUtils.importFromFile(aFile, true);
+ yield BookmarkJSONUtils.importFromFile(aFile.path, true);
} catch(ex) {
PlacesOrganizer._showErrorAlert(PlacesUIUtils.getString("bookmarksRestoreParseError"));
}
@@ -519,7 +519,7 @@ var PlacesOrganizer = {
let fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
let fpCallback = function fpCallback_done(aResult) {
if (aResult != Ci.nsIFilePicker.returnCancel) {
- BookmarkJSONUtils.exportToFile(fp.file);
+ BookmarkJSONUtils.exportToFile(fp.file.path);
}
};
diff --git a/application/palemoon/components/places/jar.mn b/application/palemoon/components/places/jar.mn
index 44ae61fd3..41222e156 100644
--- a/application/palemoon/components/places/jar.mn
+++ b/application/palemoon/components/places/jar.mn
@@ -6,29 +6,29 @@ browser.jar:
% overlay chrome://browser/content/places/places.xul chrome://browser/content/places/downloadsViewOverlay.xul
# Provide another URI for the bookmarkProperties dialog so we can persist the
# attributes separately
- content/browser/places/bookmarkProperties2.xul (content/bookmarkProperties.xul)
-* content/browser/places/places.xul (content/places.xul)
-* content/browser/places/places.js (content/places.js)
- content/browser/places/places.css (content/places.css)
- content/browser/places/organizer.css (content/organizer.css)
- content/browser/places/bookmarkProperties.xul (content/bookmarkProperties.xul)
- content/browser/places/bookmarkProperties.js (content/bookmarkProperties.js)
- content/browser/places/placesOverlay.xul (content/placesOverlay.xul)
-* content/browser/places/menu.xml (content/menu.xml)
- content/browser/places/tree.xml (content/tree.xml)
- content/browser/places/controller.js (content/controller.js)
- content/browser/places/treeView.js (content/treeView.js)
-* content/browser/places/browserPlacesViews.js (content/browserPlacesViews.js)
+ content/browser/places/bookmarkProperties2.xul (content/bookmarkProperties.xul)
+* content/browser/places/places.xul (content/places.xul)
+* content/browser/places/places.js (content/places.js)
+ content/browser/places/places.css (content/places.css)
+ content/browser/places/organizer.css (content/organizer.css)
+ content/browser/places/bookmarkProperties.xul (content/bookmarkProperties.xul)
+ content/browser/places/bookmarkProperties.js (content/bookmarkProperties.js)
+ content/browser/places/placesOverlay.xul (content/placesOverlay.xul)
+* content/browser/places/menu.xml (content/menu.xml)
+ content/browser/places/tree.xml (content/tree.xml)
+ content/browser/places/controller.js (content/controller.js)
+ content/browser/places/treeView.js (content/treeView.js)
+* content/browser/places/browserPlacesViews.js (content/browserPlacesViews.js)
# keep the Places version of the history sidebar at history/history-panel.xul
# to prevent having to worry about between versions of the browser
-* content/browser/history/history-panel.xul (content/history-panel.xul)
- content/browser/places/history-panel.js (content/history-panel.js)
+* content/browser/history/history-panel.xul (content/history-panel.xul)
+ content/browser/places/history-panel.js (content/history-panel.js)
# ditto for the bookmarks sidebar
- content/browser/bookmarks/bookmarksPanel.xul (content/bookmarksPanel.xul)
- content/browser/bookmarks/bookmarksPanel.js (content/bookmarksPanel.js)
-* content/browser/bookmarks/sidebarUtils.js (content/sidebarUtils.js)
- content/browser/places/moveBookmarks.xul (content/moveBookmarks.xul)
- content/browser/places/moveBookmarks.js (content/moveBookmarks.js)
- content/browser/places/editBookmarkOverlay.xul (content/editBookmarkOverlay.xul)
- content/browser/places/editBookmarkOverlay.js (content/editBookmarkOverlay.js)
-* content/browser/places/downloadsViewOverlay.xul (content/downloadsViewOverlay.xul)
+ content/browser/bookmarks/bookmarksPanel.xul (content/bookmarksPanel.xul)
+ content/browser/bookmarks/bookmarksPanel.js (content/bookmarksPanel.js)
+* content/browser/bookmarks/sidebarUtils.js (content/sidebarUtils.js)
+ content/browser/places/moveBookmarks.xul (content/moveBookmarks.xul)
+ content/browser/places/moveBookmarks.js (content/moveBookmarks.js)
+ content/browser/places/editBookmarkOverlay.xul (content/editBookmarkOverlay.xul)
+ content/browser/places/editBookmarkOverlay.js (content/editBookmarkOverlay.js)
+* content/browser/places/downloadsViewOverlay.xul (content/downloadsViewOverlay.xul)
diff --git a/application/palemoon/components/places/moz.build b/application/palemoon/components/places/moz.build
index 2e35e1951..f8b0d125d 100644
--- a/application/palemoon/components/places/moz.build
+++ b/application/palemoon/components/places/moz.build
@@ -7,4 +7,3 @@
JAR_MANIFESTS += ['jar.mn']
EXTRA_JS_MODULES += [ 'PlacesUIUtils.jsm' ]
-