diff --git a/browser/components/places/content-shim/browserShim.xul b/browser/components/places/content-shim/browserShim.xul index 716fed802bc3..0816b7be7013 100755 --- a/browser/components/places/content-shim/browserShim.xul +++ b/browser/components/places/content-shim/browserShim.xul @@ -1,6 +1,7 @@ + diff --git a/browser/components/places/content/controller.js b/browser/components/places/content/controller.js index 176c92ab77d0..e8984ac10bed 100755 --- a/browser/components/places/content/controller.js +++ b/browser/components/places/content/controller.js @@ -1305,11 +1305,17 @@ var PlacesController = { /** * Get a TransferDataSet containing the content of the selection that can be * dropped elsewhere. + * @param dragAction + * The action to happen when dragging, i.e. copy * @returns A TransferDataSet object that can be dragged and dropped * elsewhere. */ - getTransferData: function PC_getTransferData() { - var nodes = this._activeView.getCopyableSelection(); + getTransferData: function PC_getTransferData(dragAction) { + var nodes = null; + if (dragAction == Ci.nsIDragService.DRAGDROP_ACTION_COPY) + nodes = this._activeView.getCopyableSelection(); + else + nodes = this._activeView.getDragableSelection(); var dataSet = new TransferDataSet(); for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; @@ -1450,10 +1456,15 @@ var PlacesController = { * Drop functions are passed the view that is being dropped on. */ var PlacesControllerDragHelper = { + /** + * DOM Element currently being dragged over + */ + currentDropTarget: null, + /** * @returns The current active drag session. Returns null if there is none. */ - _getSession: function VO__getSession() { + getSession: function VO__getSession() { var dragService = Cc["@mozilla.org/widget/dragservice;1"]. getService(Ci.nsIDragService); @@ -1476,7 +1487,7 @@ var PlacesControllerDragHelper = { !PlacesController.nodeIsFolder(parent)) return false; - var session = this._getSession(); + var session = this.getSession(); if (session) { if (orientation != NHRVO.DROP_ON) var types = view.supportedDropTypes; @@ -1531,7 +1542,7 @@ var PlacesControllerDragHelper = { */ onDrop: function PCDH_onDrop(sourceView, targetView, insertionPoint, visibleInsertCount) { - var session = this._getSession(); + var session = this.getSession(); var copy = session.dragAction & Ci.nsIDragService.DRAGDROP_ACTION_COPY; var transactions = []; var xferable = this._initTransferable(targetView, diff --git a/browser/components/places/content/menu.xml b/browser/components/places/content/menu.xml index 4c34313d9543..2cdf7b204bb8 100755 --- a/browser/components/places/content/menu.xml +++ b/browser/components/places/content/menu.xml @@ -51,8 +51,6 @@ null - null - null @@ -68,29 +66,53 @@ ]]> + + -1 + -1 + =0; i--) { + this.removeChild(this.childNodes[i]); + } } LOG("KIDS = " + this.childNodes.length); ]]> @@ -98,6 +120,13 @@ + + + + + - + + + + @@ -250,6 +313,263 @@ + + + @@ -263,16 +583,35 @@ this._resultNode.QueryInterface(Ci.nsINavHistoryContainerResultNode); this._resultNode.containerOpen = false; } + // The autoopened attribute is set for folders which have been + // automatically opened when dragged over. Turn off this attribute + // when the folder closes because it is no longer applicable. + this.removeAttribute("autoopened"); } + + + + diff --git a/browser/components/places/content/toolbar.xml b/browser/components/places/content/toolbar.xml index b56602a8008d..b0827d9e6419 100755 --- a/browser/components/places/content/toolbar.xml +++ b/browser/components/places/content/toolbar.xml @@ -7,6 +7,32 @@ xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + + + + + + + + + + + + + + + + + + + + @@ -40,6 +66,9 @@ this._rebuild(); ]]> + + document.getAnonymousNodes(this)[0].firstChild + document.getAnonymousNodes(this)[0].childNodes[1].firstChild.firstChild null @@ -52,12 +81,17 @@ ]]> - null @@ -124,7 +146,7 @@ @@ -208,6 +230,14 @@ ]]> + + + + @@ -326,47 +356,224 @@ } })]]> + + + + + + @@ -401,29 +632,34 @@ PlacesController.mouseLoadURI(event); + + + = 0; i--) { + if (PlacesController.nodeIsReadOnly(nodes[i].parent)) + nodes.splice(i, 1); + } + return nodes; + ]]> + @@ -438,11 +448,11 @@ } } - // Stuff the encoded selection into the transferable data object - xferData.data = PlacesController.getTransferData(); // XXXben - the drag wrapper should do this automatically. if (event.ctrlKey) dragAction.action = Ci.nsIDragService.DRAGDROP_ACTION_COPY; + // Stuff the encoded selection into the transferable data object + xferData.data = PlacesController.getTransferData(dragAction.action); ]]> diff --git a/browser/components/places/jar.mn b/browser/components/places/jar.mn index 7bdc16e6488c..ff62c9b926de 100755 --- a/browser/components/places/jar.mn +++ b/browser/components/places/jar.mn @@ -21,6 +21,8 @@ classic.jar: skin/classic/browser/places/bookmarks_toolbar.png (skin-win/bookmarks_toolbar.png) skin/classic/browser/places/livemark_item.png (skin-win/livemark_item.png) skin/classic/browser/places/places-icon.png (skin-win/places-icon.png) + skin/classic/browser/places/toolbar_dropmarker.png (skin-win/toolbar_dropmarker.png) + skin/classic/browser/places/folder_drag_over.png (skin-win/folder_drag_over.png) skin/classic/browser/places/bookmarkProperties.css (skin-win/bookmarkProperties.css) en-US.jar: diff --git a/browser/components/places/skin-win/folder_drag_over.png b/browser/components/places/skin-win/folder_drag_over.png new file mode 100755 index 000000000000..740dabf01517 Binary files /dev/null and b/browser/components/places/skin-win/folder_drag_over.png differ diff --git a/browser/components/places/skin-win/places.css b/browser/components/places/skin-win/places.css index d714be19f9f2..948b0a85536c 100755 --- a/browser/components/places/skin-win/places.css +++ b/browser/components/places/skin-win/places.css @@ -232,3 +232,45 @@ treechildren::-moz-tree-cell-text(title, separator, selected, focus) { .no-margin-button { min-width:0em; } + +/* Personal toolbar */ +.toolbar-drop-indicator { + height: 16px; + width: 5px; + margin-bottom: -8px; + position: relative; + background: url('chrome://browser/skin/places/toolbar_dropmarker.png') 50% 50% no-repeat; +} + +.toolbar-drop-indicator-bar { + display: none; + height: 16px; + margin-bottom: -16px; + margin-left: 4px; + position: relative; +} + +.toolbar-drop-indicator-bar[dragging="true"] { + display: -moz-box; +} + +toolbarbutton.bookmark-item[dragover="true"][open="true"] { + -moz-appearance: none; + background: Highlight !important; + color: HighlightText !important; + list-style-image: url('chrome://browser/skin/places/folder_drag_over.png') !important; + -moz-image-region: rect(0px, 16px, 16px, 0px) !important; +} + +.bookmark-item[dragover-into="true"] { + background: Highlight !important; + color: HighlightText !important; +} + +.bookmark-item[dragover-top="true"] { + -moz-border-top-colors: #000000; +} + +.bookmark-item[dragover-bottom="true"] { + -moz-border-bottom-colors: #000000; +} diff --git a/browser/components/places/skin-win/toolbar_dropmarker.png b/browser/components/places/skin-win/toolbar_dropmarker.png new file mode 100755 index 000000000000..c59c05ae4868 Binary files /dev/null and b/browser/components/places/skin-win/toolbar_dropmarker.png differ