B2G/gecko/browser/components/places/content/controller.js
/**
   * Fills a DataTransfer object with the content of the selection that can be
   * dropped elsewhere.
   * @param   aEvent
   *          The dragstart event.
   */
Fills a DataTransfer object with the content of the selection that can be
dropped elsewhere.
@param   aEvent
The dragstart event.
Fills a DataTransfer object with the content of the selection that can be dropped elsewhere . @param aEvent The dragstart event .
function PC_setDataTransfer(aEvent) {
    let dt = aEvent.dataTransfer;
    let doCopy = ["copyLink", "copy", "link"].indexOf(dt.effectAllowed) != -1;
    let result = this._view.result;
    let didSuppressNotifications = result.suppressNotifications;
    if (!didSuppressNotifications)
      result.suppressNotifications = true;
    try {
      let nodes = this._view.draggableSelection;
      for (let i = 0; i < nodes.length; ++i) {
        var node = nodes[i];
        function addData(type, index, overrideURI) {
          let wrapNode = PlacesUtils.wrapNode(node, type, overrideURI, doCopy);
          dt.mozSetDataAt(type, wrapNode, index);
        }
        function addURIData(index, overrideURI) {
          addData(PlacesUtils.TYPE_X_MOZ_URL, index, overrideURI);
          addData(PlacesUtils.TYPE_UNICODE, index, overrideURI);
          addData(PlacesUtils.TYPE_HTML, index, overrideURI);
        }
        addData(PlacesUtils.TYPE_X_MOZ_PLACE, i);
        let livemarkInfo = this.getCachedLivemarkInfo(node);
        if (livemarkInfo) {
          addURIData(i, livemarkInfo.feedURI.spec);
        }
        else if (node.uri) {
          addURIData(i);
        }
      }
    }
    finally {
      if (!didSuppressNotifications)
        result.suppressNotifications = false;
    }
  }
function PC_setDataTransfer ( aEvent ) { let dt = aEvent . dataTransfer ; let doCopy = [ "copyLink" , "copy" , "link" ] . indexOf ( dt . effectAllowed ) != - 1 ; let result = this . _view . result ; let didSuppressNotifications = result . suppressNotifications ; if ( ! didSuppressNotifications ) result . suppressNotifications = true ; try { let nodes = this . _view . draggableSelection ; for ( let i = 0 ; i < nodes . length ; ++ i ) { var node = nodes [ i ] ; function addData ( type , index , overrideURI ) { let wrapNode = PlacesUtils . wrapNode ( node , type , overrideURI , doCopy ) ; dt . mozSetDataAt ( type , wrapNode , index ) ; } function addURIData ( index , overrideURI ) { addData ( PlacesUtils . TYPE_X_MOZ_URL , index , overrideURI ) ; addData ( PlacesUtils . TYPE_UNICODE , index , overrideURI ) ; addData ( PlacesUtils . TYPE_HTML , index , overrideURI ) ; } addData ( PlacesUtils . TYPE_X_MOZ_PLACE , i ) ; let livemarkInfo = this . getCachedLivemarkInfo ( node ) ; if ( livemarkInfo ) { addURIData ( i , livemarkInfo . feedURI . spec ) ; } else if ( node . uri ) { addURIData ( i ) ; } } } finally { if ( ! didSuppressNotifications ) result . suppressNotifications = false ; } }
Fills a DataTransfer object with the content of the selection that can be
 dropped elsewhere.
Fills a DataTransfer object with the content of the selection that can be dropped elsewhere .
// This order is _important_! It controls how this and other // applications select data to be inserted based on type. // Drop the feed uri for livemark containers