Returns an announcement message when the Draggable element is swapped with another draggable element
@param {SwappableSwappedEvent} swappableEvent
@return {String}
964111
function onSwappableSwappedDefaultAnnouncement({dragEvent, swappedElement}) {
  const sourceText = dragEvent.source.textContent.trim() || dragEvent.source.id || 'swappable element';
  const overText = swappedElement.textContent.trim() || swappedElement.id || 'swappable element';

  return `Swapped ${sourceText} with ${overText}`;
}
892181
function swap(source, target) {
  // wrap to allow string selectors, arrays etc.
  source = $(source);
  target = $(target);
  source.each(function(el, index) {
    var content = target.get(index);
    if(el.parentNode && content) {
      // deep clone template partial
      content = content.cloneNode(true);
      // replace sourc element with cloned target element
      el.parentNode.replaceChild(content, el);
    }
  })
}
1308737
function announce(message, {expire}) {
  const element = document.createElement('div');

  element.textContent = message;
  liveRegion.appendChild(element);

  return setTimeout(() => {
    liveRegion.removeChild(element);
  }, expire);
}
297753
function shouldUseChangeEvent(elem) {
  var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
  return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
}
280436
function swapEle(e1, e2) {
    var n = e1.next(),
        p = e2.prev();
    e2.insertBefore(n);
    e1.insertAfter(p);
}
1349982
protected void removeDragAndDropMessage() {

        if (m_dragAndDropMessage != null) {
            m_dragAndDropMessage.removeFromParent();
            m_dragAndDropMessage = null;
            getContentWrapper().getElement().getStyle().clearBackgroundColor();
        }
    }
514140
def dragMoveEvent( self, event ):
        
        filt = self.dragDropFilter()
        if ( not filt ):
            super(XCalendarWidget, self).dragMoveEvent(event)
            return
        
        filt(self, event)
804383
function getEventPosition(event) {
    let _event = event
    if (event.touches) {
        [_event] = event.touches
    }
    return [
        _event.pageX - window.pageXOffset,
        _event.pageY - window.pageYOffset
    ]
}
955716
function draggable(e) {
			e.preventDefault();
			previousEvent = e;
			document.addEventListener('mousemove', drag);
			document.addEventListener('mouseup', removeDrag);
		}
230582
def dragMoveEvent(self, event):
        """"""
        if (event.mimeData().hasFormat("text/plain")):
            event.setDropAction(Qt.MoveAction)
            event.accept()
        else:
            event.ignore()
1292847
function (sortableElement) {
        var opts = addData(sortableElement, 'opts');
        var items = _filter(sortableElement.children, opts.items);
        var handles = _getHandles(items, opts.handle);
        addAttribute(sortableElement, 'aria-dropeffect', 'move');
        addData(sortableElement, '_disabled', 'false');
        addAttribute(handles, 'draggable', 'true');
        // @todo: remove this fix
        // IE FIX for ghost
        // can be disabled as it has the side effect that other events
        // (e.g. click) will be ignored
        if (opts.disableIEFix === false) {
            var spanEl = (document || window.document).createElement('span');
            if (typeof spanEl.dragDrop === 'function') {
                addEventListener(handles, 'mousedown', function () {
                    if (items.indexOf(this) !== -1) {
                        this.dragDrop();
                    }
                    else {
                        var parent = this.parentElement;
                        while (items.indexOf(parent) === -1) {
                            parent = parent.parentElement;
                        }
                        parent.dragDrop();
                    }
                });
            }
        }
    }
1360481
function _changeEvent(el,attr,value,oldValue,args,action,type,stopChange)
        {
          this.stopPropagation = function(){this._stopPropogation = true;};
          this.preventDefault = function(){this._preventDefault = true;};
          this.value = value;
          this.oldValue = oldValue;
          this.target = el;
          this.attr = attr;
          this.arguments = args;
          this.action = action;
          this.child = undefined;
          this.type = type;
          this.stopChange = stopChange;
        }
137747
public void dragElementTo(String draggable, String droppable, int waitForMillies) throws InterruptedException {
		WebElement draggableEl = translateLocatorToWebElement(draggable);
		WebElement dragReceiver = translateLocatorToWebElement(droppable);

		Actions clickAndDrag = new Actions(getWebDriver());
		clickAndDrag.dragAndDrop(draggableEl, dragReceiver);
		clickAndDrag.perform();

		// ToDO: clarify what to do with the parameter waitForMillies
	}
828855
function (oEvent) {
			var iPageY = oEvent.changedTouches && oEvent.changedTouches.length ? oEvent.changedTouches[0].pageY : oEvent.pageY;

			if (this._bIsDrag === false) {
				this.fireTap(oEvent);
				this._dragSession = null;
			}

			this._bIsDrag = true;

			if (!this.getIsExpanded()) {
				this._dragSession = null;
				return;
			}

			this._endDrag(iPageY, oEvent.timeStamp);

			this._mousedown = false;
		}
1108827
function(e) {
			/*
			 * TODO: Move this code into {gui.EventPlugin}
			 */
			if (e.type === 'webkitTransitionEnd') {
				e = {
					type: 'transitionend',
					target: e.target,
					propertyName: e.propertyName,
					elapsedTime: e.elapsedTime,
					pseudoElement: e.pseudoElement
				};
			}
			this.onevent(e);
		}
412650
function(message){
							if (!message) // the message is already gone
								return cb();
							var objDeviceMessage = JSON.parse(message);
							//if (objDeviceMessage.to !== row.to)
							//    throw "to mismatch";
							console.log('sending stalled '+row.message_hash);
							sendPreparedMessageToHub(row.hub, row.pubkey, row.message_hash, objDeviceMessage, {ifOk: cb, ifError: function(err){ cb(); }});
						}
233247
function receiveIframeMessage(event) {
    const data = uiFns.receiveIframeMessageBoilerplate(event);

    if (!data) {
      return;
    }

    if (data.codeOverlay) {
      if (data.codeOverlay === 'on') {
        // Can assume we're not viewing the Mustache Browser.
        codeViewer.mustacheBrowser = false;

        // Make sure the annotations overlay is off before showing code view.
        window.annotationsViewer.annotationsActive = false;

        uiProps.sgTAnnotations.classList.remove('active');
        window.annotationsViewer.slideAnnotations($sgCodeContainer.outerHeight());

        // Make codeViewer and nav reflect that code view is active.
        codeViewer.codeActive = true;
        codeViewer.viewall = data.viewall || false;
        uiProps.sgTCode.classList.add('active');

        // Update code.
        codeViewer.updateCode(data.lineage, data.lineageR, data.patternPartial, data.patternState);
      }
      else {
        codeViewer.closeCode();
      }
    }
    else if (typeof data.codeMustacheBrowser === 'boolean') {
      codeViewer.mustacheBrowser = data.codeMustacheBrowser;
    }
    else if (typeof data.codeViewall === 'boolean') {
      codeViewer.viewall = data.codeViewall;
    }

    switch (data.event) {
      case 'patternlab.keyPress':
        switch (data.keyPress) {
          case 'ctrl+shift+c':
            codeViewer.toggleCode();

            break;

          case 'ctrl+alt+m':
          case 'ctrl+shift+u':
            codeViewer.swapCode('m');

            break;

          case 'ctrl+alt+h':
          case 'ctrl+shift+y':
            codeViewer.swapCode('e');

            break;

          case 'mod+a':
            codeViewer.selectCode();

            break;

          case 'esc':
            if (codeViewer.codeActive) {
              codeViewer.closeCode();
            }

            break;
        }

        break;
    }
  }