rem: genTextData.data = src; trans.setTransferData ( "text/unicode", genTextData, src.length * 2 ); var transArray = Components.classes["component: if ( transArray ) {  var genTrans = trans.QueryInterface(Components.interfaces.nsISupports); transArray.AppendElement(genTrans); var nsIDragService = Components.interfaces.nsIDragService; dragService.invokeDragSession ( event.target, transArray, null, nsIDragService.DRAGDROP_ACTION_COPY + nsIDragService.DRAGDROP_ACTION_MOVE ); dragStarted = true; } } } } 
add: default: case '#text': case 'LI': case 'OL': case 'DD': textstring = enclosingLink(event.target); if ( textstring != "" ) htmlstring = "<a href=\"" + textstring + "\">" + textstring + "</a>"; else return; break; } }  htmlData.data = htmlstring; trans.addDataFlavor("text/html"); trans.setTransferData ( "text/html", htmlData, htmlstring.length * 2 ); 
context: function BeginDragContentArea ( event ){  var dragStarted = false;  var dragService = Components.classes["component://netscape/widget/dragservice"].getService(Components.interfaces.nsIDragService);  if ( dragService )  {    var trans = Components.classes["component://netscape/widget/transferable"].createInstance(Components.interfaces.nsITransferable);    if ( trans )    {      var genTextData = Components.classes["component://netscape/supports-wstring"].createInstance(Components.interfaces.nsISupportsWString);      var htmlData = Components.classes["component://netscape/supports-wstring"].createInstance(Components.interfaces.nsISupportsWString);      if ( genTextData && htmlData )      {        trans.addDataFlavor("text/html");        trans.addDataFlavor("text/unicode");                var htmlstring = null;        switch (event.target.nodeName)        {          case 'AREA':          case 'IMG':            var imgsrc = event.target.getAttribute("src");            var baseurl = window.content.location.href;            src = imgsrc;            htmlstring = "<img src=\"" + src + "\">";            dump("htmlstring is "+htmlstring+"\n");            break;                    case 'HR':            break;                    case 'A':            if ( event.target.href )            {              // link              src = event.target.getAttribute("href");              htmlstring = "<a href=\"" + src + "\">" + src + "</a>";            }            else if (event.target.name )            {              // named anchor              src = event.target.getAttribute("name");              htmlstring = "<a name=\"" + src + "\">" + src + "</a>"            }            break;                    default:            dump("no handler found for " + event.target.nodeName + "\n");          case '#text':          case 'LI':          case 'OL':          case 'DD':            src = enclosingLink(event.target);            if ( src != "" )              htmlstring = "<a href=\"" + src + "\">" + src + "</a>";            else              return;            break;        }                htmlData.data = htmlstring;        trans.setTransferData ( "text/html", htmlData, htmlstring.length * 2 );  // double byte data        genTextData.data = src;        trans.setTransferData ( "text/unicode", genTextData, src.length * 2 );  // double byte data        var transArray = Components.classes["component://netscape/supports-array"].createInstance(Components.interfaces.nsISupportsArray);        if ( transArray )        {          // put it into the transferable as an |nsISupports|          var genTrans = trans.QueryInterface(Components.interfaces.nsISupports);          transArray.AppendElement(genTrans);          var nsIDragService = Components.interfaces.nsIDragService;          dragService.invokeDragSession ( event.target, transArray, null, nsIDragService.DRAGDROP_ACTION_COPY +                                               nsIDragService.DRAGDROP_ACTION_MOVE );          dragStarted = true;        }      } // if data object    } // if transferable  } // if drag service  if ( dragStarted )               // don't propagate the event if a drag has begun    event.preventBubble();}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/1916868e448b038c0a147996be4eee5ec9dff3de/navigatorDD.js/buggy/xpfe/browser/resources/content/navigatorDD.js