rem: dragService.invokeDragSession ( transArray, null, nsIDragService.DRAGDROP_ACTION_COPY + 
add: dragService.invokeDragSession ( event.target, transArray, null, nsIDragService.DRAGDROP_ACTION_COPY + 
context: function BeginDragTree ( event ){  //XXX we rely on a capturer to already have determined which item the mouse was over  //XXX and have set an attribute.      // if the click is on the tree proper, ignore it. We only care about clicks on items.  var tree = document.getElementById("bookmarksTree");  if ( event.target == tree )    return(true);         // continue propagating the event      var childWithDatabase = tree;  if ( ! childWithDatabase )    return(false);      var dragStarted = false;  var trans =     Components.classes["component://netscape/widget/transferable"].createInstance(Components.interfaces.nsITransferable);  if ( !trans ) return(false);  var genData =     Components.classes["component://netscape/supports-wstring"].createInstance(Components.interfaces.nsISupportsWString);  if (!genData) return(false);  var genDataURL =     Components.classes["component://netscape/supports-wstring"].createInstance(Components.interfaces.nsISupportsWString);  if (!genDataURL) return(false);  trans.addDataFlavor("text/unicode");  trans.addDataFlavor("moz/rdfitem");          // ref/id (url) is on the <treeitem> which is two levels above the <treecell> which is  // the target of the event.  var id = event.target.parentNode.parentNode.getAttribute("ref");  if (!id || id=="")  {	id = event.target.parentNode.parentNode.getAttribute("id");  }  dump("\n    ID: " + id);  var parentID = event.target.parentNode.parentNode.parentNode.parentNode.getAttribute("ref");  if (!parentID || parentID == "")  {	parentID = event.target.parentNode.parentNode.parentNode.parentNode.getAttribute("id");  }  dump("    Parent ID: " + parentID);  var trueID = id;  if (parentID != null)  {  	trueID += "\n" + parentID;  }  genData.data = trueID;  genDataURL.data = id;  var database = childWithDatabase.database;  var rdf =     Components.classes["component://netscape/rdf/rdf-service"].getService(Components.interfaces.nsIRDFService);  if ((!rdf) || (!database))  { dump("CAN'T GET DATABASE\n"); return(false); }  // make sure its a bookmark, bookmark separator, or bookmark folder  var src = rdf.GetResource(id, true);  var prop = rdf.GetResource("http://www.w3.org/1999/02/22-rdf-syntax-ns#type", true);  var target = database.GetTarget(src, prop, true);  if (target) target = target.QueryInterface(Components.interfaces.nsIRDFResource);  if (target) target = target.Value;  if ((!target) || (target == "")) {dump("BAD\n"); return(false);}  dump("    Type: '" + target + "'");  if ((target != "http://home.netscape.com/NC-rdf#BookmarkSeparator") &&    (target != "http://home.netscape.com/NC-rdf#Bookmark") &&    (target != "http://home.netscape.com/NC-rdf#Folder")) return(false);dump("genData is " + genData.data + " len is " + genData.data.length + "\n");  trans.setTransferData ( "moz/rdfitem", genData, genData.data.length * 2);  // double byte data  trans.setTransferData ( "text/unicode", genDataURL, genDataURL.data.length * 2);  // double byte data  var transArray =     Components.classes["component://netscape/supports-array"].createInstance(Components.interfaces.nsISupportsArray);  if ( !transArray )  return(false);  // put it into the transferable as an |nsISupports|  var genTrans = trans.QueryInterface(Components.interfaces.nsISupports);  transArray.AppendElement(genTrans);    var dragService =     Components.classes["component://netscape/widget/dragservice"].getService(Components.interfaces.nsIDragService);  if ( !dragService ) return(false);  var nsIDragService = Components.interfaces.nsIDragService;  dragService.invokeDragSession ( transArray, null, nsIDragService.DRAGDROP_ACTION_COPY +                                      nsIDragService.DRAGDROP_ACTION_MOVE );  dragStarted = true;  return(!dragStarted);}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/644b37485027c54a631175516801e24337db859e/bookmarksDD.js/clean/xpfe/components/bookmarks/resources/bookmarksDD.js