rem:   var id = event.target.parentNode.parentNode.getAttribute("ref"); if (!id || id=="") { id = event.target.parentNode.parentNode.getAttribute("id"); }  var src = RDF.GetResource(id, true); var urlProp = RDF.GetResource(NC_URL, true); var url = database.GetTarget(src, urlProp, true); if (url) url = url.QueryInterface(nsIRDFLiteral); if (url) url = url.Value; if (!url || url=="") return false;  var descProp = RDF.GetResource(NC_NAME, true); var desc = database.GetTarget(src, descProp, true); if (desc) desc = desc.QueryInterface(nsIRDFLiteral); if (desc) desc = desc.Value; if (!desc || desc=="") return false;  genDataURL.data = url + "\n" + desc; genDataHTML.data = "<a href=\"" + url + "\">" + desc + "</a>"; genData.data = url;  transferable.setTransferData ( "text/x-moz-url", genDataURL, genDataURL.data.length * 2); transferable.setTransferData ( "text/html", genDataHTML, genDataHTML.data.length * 2); transferable.setTransferData ( "text/unicode", genData, genData.data.length * 2);  var transArray = Components.classes[ARRAY_CONTRACTID].createInstance(nsISupportsArray); if ( !transArray )  return(false);   var genTrans = transferable.QueryInterface(Components.interfaces.nsISupports); transArray.AppendElement(genTrans); 
add: dragStarted = true; } catch (ex) { } 
context: function BeginDragTree ( event ){  var tree = document.getElementById("tree");  if ( event.target == tree )    return(true);         // continue propagating the event  // only <treeitem>s can be dragged out  if ( event.target.parentNode.parentNode.tagName != "treeitem")    return(false);  var database = tree.database;  if (!database)    return(false);  var RDF =     Components.classes[RDFSERVICE_CONTRACTID].getService(nsIRDFService);  if (!RDF) return(false);  var dragStarted = false;  var transferable =     Components.classes[TRANSFERABLE_CONTRACTID].createInstance(nsITransferable);  if ( !transferable ) return(false);  var genDataURL =     Components.classes[WSTRING_CONTRACTID].createInstance(nsISupportsWString);  if (!genDataURL) return(false);  var genDataHTML =     Components.classes[WSTRING_CONTRACTID].createInstance(nsISupportsWString);  if (!genDataHTML) return(false);  var genData =     Components.classes[WSTRING_CONTRACTID].createInstance(nsISupportsWString);  if (!genData) return(false);  var genDataURL =     Components.classes[WSTRING_CONTRACTID].createInstance(nsISupportsWString);  if (!genDataURL) return(false);  transferable.addDataFlavor("text/x-moz-url");  transferable.addDataFlavor("text/html");  transferable.addDataFlavor("text/unicode");    // 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");  }  var src = RDF.GetResource(id, true);  var urlProp = RDF.GetResource(NC_URL, true);  var url = database.GetTarget(src, urlProp, true);  if (url) url = url.QueryInterface(nsIRDFLiteral);  if (url) url = url.Value;  if (!url || url=="")      return false;  var descProp = RDF.GetResource(NC_NAME, true);  var desc = database.GetTarget(src, descProp, true);  if (desc) desc = desc.QueryInterface(nsIRDFLiteral);  if (desc) desc = desc.Value;  if (!desc || desc=="")      return false;  genDataURL.data = url + "\n" + desc;  genDataHTML.data = "<a href=\"" + url + "\">" + desc + "</a>";  genData.data = url;  transferable.setTransferData ( "text/x-moz-url", genDataURL, genDataURL.data.length * 2);  transferable.setTransferData ( "text/html", genDataHTML, genDataHTML.data.length * 2);  transferable.setTransferData ( "text/unicode", genData, genData.data.length * 2);  var transArray =     Components.classes[ARRAY_CONTRACTID].createInstance(nsISupportsArray);  if ( !transArray )  return(false);  // put it into the transferable as an |nsISupports|  var genTrans = transferable.QueryInterface(Components.interfaces.nsISupports);  transArray.AppendElement(genTrans);    var dragService =     Components.classes[DRAGSERVICE_CONTRACTID].getService(nsIDragService);  if ( !dragService ) return(false);  dragService.invokeDragSession ( event.target, 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/a376ddc0531725ad80728692bef9c8ab8b17636c/directory.js/buggy/suite/common/directory/directory.js