зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1439315 - 1 - rename InsertionPoint to PlacesInsertionPoint. r=standard8
MozReview-Commit-ID: 1NfkueEUPXC --HG-- extra : rebase_source : 9e3e6f58742a0900fdd73e6c5ed5089f7d01da63
This commit is contained in:
Родитель
f7f73b417a
Коммит
388f9e4090
|
@ -481,7 +481,7 @@ var PlacesCommandHook = {
|
|||
let parentGuid = parentId == PlacesUtils.bookmarksMenuFolderId ?
|
||||
PlacesUtils.bookmarks.menuGuid :
|
||||
await PlacesUtils.promiseItemGuid(parentId);
|
||||
let defaultInsertionPoint = new InsertionPoint({ parentId, parentGuid });
|
||||
let defaultInsertionPoint = new PlacesInsertionPoint({ parentId, parentGuid });
|
||||
PlacesUIUtils.showBookmarkDialog({ action: "add",
|
||||
type: "bookmark",
|
||||
uri: makeURI(url),
|
||||
|
@ -557,7 +557,7 @@ var PlacesCommandHook = {
|
|||
* A short description of the feed. Optional.
|
||||
*/
|
||||
async addLiveBookmark(url, feedTitle, feedSubtitle) {
|
||||
let toolbarIP = new InsertionPoint({
|
||||
let toolbarIP = new PlacesInsertionPoint({
|
||||
parentId: PlacesUtils.toolbarFolderId,
|
||||
parentGuid: PlacesUtils.bookmarks.toolbarGuid
|
||||
});
|
||||
|
@ -993,7 +993,7 @@ var PlacesMenuDNDHandler = {
|
|||
* The DragOver event.
|
||||
*/
|
||||
onDragOver: function PMDH_onDragOver(event) {
|
||||
let ip = new InsertionPoint({
|
||||
let ip = new PlacesInsertionPoint({
|
||||
parentId: PlacesUtils.bookmarksMenuFolderId,
|
||||
parentGuid: PlacesUtils.bookmarks.menuGuid
|
||||
});
|
||||
|
@ -1010,7 +1010,7 @@ var PlacesMenuDNDHandler = {
|
|||
*/
|
||||
onDrop: function PMDH_onDrop(event) {
|
||||
// Put the item at the end of bookmark menu.
|
||||
let ip = new InsertionPoint({
|
||||
let ip = new PlacesInsertionPoint({
|
||||
parentId: PlacesUtils.bookmarksMenuFolderId,
|
||||
parentGuid: PlacesUtils.bookmarks.menuGuid
|
||||
});
|
||||
|
|
|
@ -161,7 +161,7 @@ var BookmarkPropertiesPanel = {
|
|||
this._defaultInsertionPoint = dialogInfo.defaultInsertionPoint;
|
||||
} else {
|
||||
this._defaultInsertionPoint =
|
||||
new InsertionPoint({
|
||||
new PlacesInsertionPoint({
|
||||
parentId: PlacesUtils.bookmarksMenuFolderId,
|
||||
parentGuid: PlacesUtils.bookmarks.menuGuid
|
||||
});
|
||||
|
|
|
@ -220,7 +220,7 @@ PlacesViewBase.prototype = {
|
|||
if (PlacesControllerDragHelper.disallowInsertion(container, this))
|
||||
return null;
|
||||
|
||||
return new InsertionPoint({
|
||||
return new PlacesInsertionPoint({
|
||||
parentId: PlacesUtils.getConcreteItemId(container),
|
||||
parentGuid: PlacesUtils.getConcreteItemGuid(container),
|
||||
index, orientation, tagName
|
||||
|
@ -1519,7 +1519,7 @@ PlacesToolbar.prototype = {
|
|||
: (aEvent.clientX < eltRect.left + threshold)) {
|
||||
// Drop before this folder.
|
||||
dropPoint.ip =
|
||||
new InsertionPoint({
|
||||
new PlacesInsertionPoint({
|
||||
parentId: PlacesUtils.getConcreteItemId(this._resultNode),
|
||||
parentGuid: PlacesUtils.getConcreteItemGuid(this._resultNode),
|
||||
index: eltIndex,
|
||||
|
@ -1532,7 +1532,7 @@ PlacesToolbar.prototype = {
|
|||
let tagName = PlacesUtils.nodeIsTagQuery(elt._placesNode) ?
|
||||
elt._placesNode.title : null;
|
||||
dropPoint.ip =
|
||||
new InsertionPoint({
|
||||
new PlacesInsertionPoint({
|
||||
parentId: PlacesUtils.getConcreteItemId(elt._placesNode),
|
||||
parentGuid: PlacesUtils.getConcreteItemGuid(elt._placesNode),
|
||||
tagName
|
||||
|
@ -1546,7 +1546,7 @@ PlacesToolbar.prototype = {
|
|||
-1 : eltIndex + 1;
|
||||
|
||||
dropPoint.ip =
|
||||
new InsertionPoint({
|
||||
new PlacesInsertionPoint({
|
||||
parentId: PlacesUtils.getConcreteItemId(this._resultNode),
|
||||
parentGuid: PlacesUtils.getConcreteItemGuid(this._resultNode),
|
||||
index: beforeIndex,
|
||||
|
@ -1562,7 +1562,7 @@ PlacesToolbar.prototype = {
|
|||
: (aEvent.clientX < eltRect.left + threshold)) {
|
||||
// Drop before this bookmark.
|
||||
dropPoint.ip =
|
||||
new InsertionPoint({
|
||||
new PlacesInsertionPoint({
|
||||
parentId: PlacesUtils.getConcreteItemId(this._resultNode),
|
||||
parentGuid: PlacesUtils.getConcreteItemGuid(this._resultNode),
|
||||
index: eltIndex,
|
||||
|
@ -1575,7 +1575,7 @@ PlacesToolbar.prototype = {
|
|||
eltIndex == this._rootElt.childNodes.length - 1 ?
|
||||
-1 : eltIndex + 1;
|
||||
dropPoint.ip =
|
||||
new InsertionPoint({
|
||||
new PlacesInsertionPoint({
|
||||
parentId: PlacesUtils.getConcreteItemId(this._resultNode),
|
||||
parentGuid: PlacesUtils.getConcreteItemGuid(this._resultNode),
|
||||
index: beforeIndex,
|
||||
|
@ -1588,7 +1588,7 @@ PlacesToolbar.prototype = {
|
|||
// We are most likely dragging on the empty area of the
|
||||
// toolbar, we should drop after the last node.
|
||||
dropPoint.ip =
|
||||
new InsertionPoint({
|
||||
new PlacesInsertionPoint({
|
||||
parentId: PlacesUtils.getConcreteItemId(this._resultNode),
|
||||
parentGuid: PlacesUtils.getConcreteItemGuid(this._resultNode),
|
||||
orientation: Ci.nsITreeView.DROP_BEFORE
|
||||
|
|
|
@ -30,11 +30,11 @@ ChromeUtils.defineModuleGetter(this, "PrivateBrowsingUtils",
|
|||
* - dropNearNode
|
||||
* When defined index will be calculated based on this node
|
||||
*/
|
||||
function InsertionPoint({ parentId, parentGuid,
|
||||
index = PlacesUtils.bookmarks.DEFAULT_INDEX,
|
||||
orientation = Ci.nsITreeView.DROP_ON,
|
||||
tagName = null,
|
||||
dropNearNode = null }) {
|
||||
function PlacesInsertionPoint({ parentId, parentGuid,
|
||||
index = PlacesUtils.bookmarks.DEFAULT_INDEX,
|
||||
orientation = Ci.nsITreeView.DROP_ON,
|
||||
tagName = null,
|
||||
dropNearNode = null }) {
|
||||
this.itemId = parentId;
|
||||
this.guid = parentGuid;
|
||||
this._index = index;
|
||||
|
@ -43,7 +43,7 @@ function InsertionPoint({ parentId, parentGuid,
|
|||
this.dropNearNode = dropNearNode;
|
||||
}
|
||||
|
||||
InsertionPoint.prototype = {
|
||||
PlacesInsertionPoint.prototype = {
|
||||
set index(val) {
|
||||
return this._index = val;
|
||||
},
|
||||
|
|
|
@ -932,7 +932,7 @@ var gEditItemOverlay = {
|
|||
|
||||
// default to the bookmarks menu folder
|
||||
if (!ip) {
|
||||
ip = new InsertionPoint({
|
||||
ip = new PlacesInsertionPoint({
|
||||
parentId: PlacesUtils.bookmarksMenuFolderId,
|
||||
parentGuid: PlacesUtils.bookmarks.menuGuid
|
||||
});
|
||||
|
|
|
@ -90,7 +90,7 @@
|
|||
|
||||
if (!elt._placesNode) {
|
||||
// If we are dragging over a non places node drop at the end.
|
||||
dropPoint.ip = new InsertionPoint({
|
||||
dropPoint.ip = new PlacesInsertionPoint({
|
||||
parentId: PlacesUtils.getConcreteItemId(resultNode),
|
||||
parentGuid: PlacesUtils.getConcreteItemGuid(resultNode)
|
||||
});
|
||||
|
@ -113,7 +113,7 @@
|
|||
// This is a folder or a tag container.
|
||||
if (eventY - eltY < eltHeight * 0.20) {
|
||||
// If mouse is in the top part of the element, drop above folder.
|
||||
dropPoint.ip = new InsertionPoint({
|
||||
dropPoint.ip = new PlacesInsertionPoint({
|
||||
parentId: PlacesUtils.getConcreteItemId(resultNode),
|
||||
parentGuid: PlacesUtils.getConcreteItemGuid(resultNode),
|
||||
orientation: Ci.nsITreeView.DROP_BEFORE,
|
||||
|
@ -123,7 +123,7 @@
|
|||
return dropPoint;
|
||||
} else if (eventY - eltY < eltHeight * 0.80) {
|
||||
// If mouse is in the middle of the element, drop inside folder.
|
||||
dropPoint.ip = new InsertionPoint({
|
||||
dropPoint.ip = new PlacesInsertionPoint({
|
||||
parentId: PlacesUtils.getConcreteItemId(elt._placesNode),
|
||||
parentGuid: PlacesUtils.getConcreteItemGuid(elt._placesNode),
|
||||
tagName
|
||||
|
@ -134,7 +134,7 @@
|
|||
} else if (eventY - eltY <= eltHeight / 2) {
|
||||
// This is a non-folder node or a readonly folder.
|
||||
// If the mouse is above the middle, drop above this item.
|
||||
dropPoint.ip = new InsertionPoint({
|
||||
dropPoint.ip = new PlacesInsertionPoint({
|
||||
parentId: PlacesUtils.getConcreteItemId(resultNode),
|
||||
parentGuid: PlacesUtils.getConcreteItemGuid(resultNode),
|
||||
orientation: Ci.nsITreeView.DROP_BEFORE,
|
||||
|
@ -145,7 +145,7 @@
|
|||
}
|
||||
|
||||
// Drop below the item.
|
||||
dropPoint.ip = new InsertionPoint({
|
||||
dropPoint.ip = new PlacesInsertionPoint({
|
||||
parentId: PlacesUtils.getConcreteItemId(resultNode),
|
||||
parentGuid: PlacesUtils.getConcreteItemGuid(resultNode),
|
||||
orientation: Ci.nsITreeView.DROP_AFTER,
|
||||
|
|
|
@ -541,7 +541,7 @@
|
|||
return null;
|
||||
}
|
||||
|
||||
return new InsertionPoint({
|
||||
return new PlacesInsertionPoint({
|
||||
parentId: PlacesUtils.getConcreteItemId(container),
|
||||
parentGuid: PlacesUtils.getConcreteItemGuid(container),
|
||||
index, orientation, tagName, dropNearNode
|
||||
|
|
|
@ -1470,7 +1470,7 @@ PlacesTreeView.prototype = {
|
|||
return null;
|
||||
}
|
||||
|
||||
return new InsertionPoint({
|
||||
return new PlacesInsertionPoint({
|
||||
parentId: PlacesUtils.getConcreteItemId(container),
|
||||
parentGuid: PlacesUtils.getConcreteItemGuid(container),
|
||||
index, orientation, tagName, dropNearNode
|
||||
|
|
|
@ -76,7 +76,7 @@ async function run_drag_test(startBookmarkIndex, insertionIndex, newParentGuid,
|
|||
// Simulating a drag-drop with a tree view turns out to be really difficult
|
||||
// as you can't get a node for the source/target. Hence, we fake the
|
||||
// insertion point and drag data and call the function direct.
|
||||
let ip = new InsertionPoint({
|
||||
let ip = new PlacesInsertionPoint({
|
||||
parentId: await PlacesUtils.promiseItemId(PlacesUtils.bookmarks.unfiledGuid),
|
||||
parentGuid: newParentGuid,
|
||||
index: insertionIndex,
|
||||
|
|
|
@ -69,7 +69,7 @@ async function simulateDrop(selectTargets, sourceBm, dropEffect, targetGuid,
|
|||
|
||||
Assert.equal(dataTransfer.dropEffect, dropEffect);
|
||||
|
||||
let ip = new InsertionPoint({
|
||||
let ip = new PlacesInsertionPoint({
|
||||
parentId: await PlacesUtils.promiseItemId(targetGuid),
|
||||
parentGuid: targetGuid,
|
||||
index: 0,
|
||||
|
|
|
@ -56,7 +56,7 @@ async function run_drag_test(startBookmarkIndex, newParentGuid) {
|
|||
// Simulating a drag-drop with a tree view turns out to be really difficult
|
||||
// as you can't get a node for the source/target. Hence, we fake the
|
||||
// insertion point and drag data and call the function direct.
|
||||
let ip = new InsertionPoint({
|
||||
let ip = new PlacesInsertionPoint({
|
||||
isTag: true,
|
||||
tagName: TAG_NAME,
|
||||
orientation: Ci.nsITreeView.DROP_ON
|
||||
|
|
Загрузка…
Ссылка в новой задаче