rem: if (url == "")	return(false); debug("Copy URL: " + url); 
add: if (url == "") return false; debug("Copy URL: " + url); 
context: function copySelectionToClipboard(){	var treeNode = document.getElementById("bookmarksTree");	if (!treeNode)    return(false);	var select_list = treeNode.selectedItems;	if (!select_list)	return(false);	if (select_list.length < 1)    return(false);	debug("# of Nodes selected: " + select_list.length + "\n");	var RDF = Components.classes["component://netscape/rdf/rdf-service"].getService();	RDF = RDF.QueryInterface(Components.interfaces.nsIRDFService);	if (!RDF)	return(false);	var Bookmarks = RDF.GetDataSource("rdf:bookmarks");	if (!Bookmarks)	return(false);	var nameRes = RDF.GetResource("http://home.netscape.com/NC-rdf#Name");	if (!nameRes)	return(false);	// build a url that encodes all the select nodes as well as their parent nodes	var url="";	var text="";	var html="";	for (var nodeIndex=0; nodeIndex<select_list.length; nodeIndex++)	{		var node = select_list[nodeIndex];		if (!node)    continue;		var ID = getAbsoluteID("bookmarksTree", node);		if (!ID)    continue;				var IDRes = RDF.GetResource(ID);		if (!IDRes)	continue;		var nameNode = Bookmarks.GetTarget(IDRes, nameRes, true);		var theName = "";		if (nameNode) nameNode = nameNode.QueryInterface(Components.interfaces.nsIRDFLiteral);		if (nameNode)	theName = nameNode.Value;		debug("Node " + nodeIndex + ": " + ID + "    name: " + theName);		url += "ID:{" + ID + "};";		url += "NAME:{" + theName + "};";		var isContainerFlag = node.getAttribute("container") == "true" ? true:false;		if (isContainerFlag == false)		{			var type = node.getAttribute("type");			if (type == "http://home.netscape.com/NC-rdf#BookmarkSeparator")			{				// Note: can't encode separators in text, just html				html += "<hr><p>";			}			else			{				text += ID + "\r";							html += "<a href='" + ID + "'>";				if (theName != "")				{					html += theName;				}				html += "</a><p>";			}		}	}	if (url == "")	return(false);	debug("Copy URL: " + url);	// get some useful components	var trans = Components.classes["component://netscape/widget/transferable"].createInstance();	if ( trans ) trans = trans.QueryInterface(Components.interfaces.nsITransferable);	if ( !trans )	return(false);	var clip = Components.classes["component://netscape/widget/clipboard"].createInstance();	if ( clip ) clip = clip.QueryInterface(Components.interfaces.nsIClipboard);	if (!clip)	return(false);	clip.emptyClipboard();	// save bookmark's ID	trans.addDataFlavor("moz/bookmarkclipboarditem");	var data = Components.classes["component://netscape/supports-wstring"].createInstance();	if ( data )	data = data.QueryInterface(Components.interfaces.nsISupportsWString);	if (!data)	return(false);	data.data = url;	trans.setTransferData ( "moz/bookmarkclipboarditem", data, url.length*2 );			// double byte data	if (text != "")	{		trans.addDataFlavor("text/unicode");		var textData = Components.classes["component://netscape/supports-wstring"].createInstance();		if ( textData )	textData = textData.QueryInterface(Components.interfaces.nsISupportsWString);		if (!textData)	return(false);		textData.data = text;		trans.setTransferData ( "text/unicode", textData, text.length*2 );			// double byte data	}	if (html != "")	{		trans.addDataFlavor("text/html");		var htmlData = Components.classes["component://netscape/supports-wstring"].createInstance();		if ( htmlData )	htmlData = htmlData.QueryInterface(Components.interfaces.nsISupportsWString);		if (!htmlData)	return(false);		htmlData.data = html;		trans.setTransferData ( "text/html", htmlData, html.length*2 );			// double byte data	}	clip.setData(trans, null, Components.interfaces.nsIClipboard.kGlobalClipboard);	return(true);}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/e9736d961a24945c2f31d67dc799c3c803d7729a/bookmarks.js/clean/xpfe/components/bookmarks/resources/bookmarks.js