vendor: 6,716 bytes, lines 1-91
1/** 2 * angular-drag-and-drop-lists v2.1.0 3 * 4 * Copyright (c) 2014 Marcel Juenemann [email protected] 5 * Copyright (c) 2014-2017 Google Inc. 6 * https://github.com/marceljuenemann/angular-drag-and-drop-lists 7 * 8 * License: MIT 9 */ 10!function (e) { 11 function n(e, n) { return "all" == n ? e : e.filter(function (e) { return -1 != n.toLowerCase().indexOf(e) }) } var a = "application/x-dnd", r = "application/json", t = "Text", d = ["move", "copy", "link"] 12 e.directive("dndDraggable", ["$parse", "$timeout", function (e, i) { 13 return function (l, f, c) { 14 f.attr("draggable", "true"), c.dndDisableIf && l.$watch(c.dndDisableIf, function (e) { f.attr("draggable", !e) }), f.on("dragstart", function (s) { 15 if (s = s.originalEvent || s, "false" == f.attr("draggable")) return !0 16 o.isDragging = !0, o.itemType = c.dndType && l.$eval(c.dndType).toLowerCase(), o.dropEffect = "none", o.effectAllowed = c.dndEffectAllowed || d[0], s.dataTransfer.effectAllowed = o.effectAllowed 17 var g = l.$eval(c.dndDraggable), u = a + (o.itemType ? "-" + o.itemType : "") 18 try { s.dataTransfer.setData(u, angular.toJson(g)) } catch (p) { 19 var v = angular.toJson({ item: g, type: o.itemType }) 20 try { s.dataTransfer.setData(r, v) } catch (p) { 21 var D = n(d, o.effectAllowed) 22 s.dataTransfer.effectAllowed = D[0], s.dataTransfer.setData(t, v) 23 } 24 } if (f.addClass("dndDragging"), i(function () { f.addClass("dndDraggingSource") }, 0), s._dndHandle && s.dataTransfer.setDragImage && s.dataTransfer.setDragImage(f[0], 0, 0), e(c.dndDragstart)(l, { event: s }), c.dndCallback) { 25 var y = e(c.dndCallback) 26 o.callback = function (e) { return y(l, e || {}) } 27 } s.stopPropagation() 28 }), f.on("dragend", function (n) { 29 n = n.originalEvent || n, l.$apply(function () { 30 var a = o.dropEffect, r = { copy: "dndCopied", link: "dndLinked", move: "dndMoved", none: "dndCanceled" } 31 e(c[r[a]])(l, { event: n }), e(c.dndDragend)(l, { event: n, dropEffect: a }) 32 }), o.isDragging = !1, o.callback = void 0, f.removeClass("dndDragging"), f.removeClass("dndDraggingSource"), n.stopPropagation(), i(function () { f.removeClass("dndDraggingSource") }, 0) 33 }), f.on("click", function (n) { c.dndSelected && (n = n.originalEvent || n, l.$apply(function () { e(c.dndSelected)(l, { event: n }) }), n.stopPropagation()) }), f.on("selectstart", function () { this.dragDrop && this.dragDrop() }) 34 } 35 }]), e.directive("dndList", ["$parse", function (e) { 36 return function (i, l, f) { 37 function c(e) { 38 if (!e) return t 39 for (var n = 0; n < e.length; n++)if (e[n] == t || e[n] == r || e[n].substr(0, a.length) == a) return e[n] 40 return null 41 } function s(e) { return o.isDragging ? o.itemType || void 0 : e == t || e == r ? null : e && e.substr(a.length + 1) || void 0 } function g(e) { return E.disabled ? !1 : E.externalSources || o.isDragging ? E.allowedTypes && null !== e ? e && -1 != E.allowedTypes.indexOf(e) : !0 : !1 } function u(e, a) { 42 var r = d 43 return a || (r = n(r, e.dataTransfer.effectAllowed)), o.isDragging && (r = n(r, o.effectAllowed)), f.dndEffectAllowed && (r = n(r, f.dndEffectAllowed)), r.length ? e.ctrlKey && -1 != r.indexOf("copy") ? "copy" : e.altKey && -1 != r.indexOf("link") ? "link" : r[0] : "none" 44 } function p() { return T.remove(), l.removeClass("dndDragover"), !0 } function v(n, a, r, t, d, l) { return e(n)(i, { callback: o.callback, dropEffect: r, event: a, external: !o.isDragging, index: void 0 !== d ? d : D(), item: l || void 0, type: t }) } function D() { return Array.prototype.indexOf.call(m.children, h) } function y() { 45 var e 46 return angular.forEach(l.children(), function (n) { 47 var a = angular.element(n) 48 a.hasClass("dndPlaceholder") && (e = a) 49 }), e || angular.element("<li class='dndPlaceholder'></li>") 50 } var T = y() 51 T.remove() 52 var h = T[0], m = l[0], E = {} 53 l.on("dragenter", function (e) { 54 e = e.originalEvent || e 55 var n = f.dndAllowedTypes && i.$eval(f.dndAllowedTypes) 56 E = { allowedTypes: angular.isArray(n) && n.join("|").toLowerCase().split("|"), disabled: f.dndDisableIf && i.$eval(f.dndDisableIf), externalSources: f.dndExternalSources && i.$eval(f.dndExternalSources), horizontal: f.dndHorizontalList && i.$eval(f.dndHorizontalList) } 57 var a = c(e.dataTransfer.types) 58 return a && g(s(a)) ? void e.preventDefault() : !0 59 }), l.on("dragover", function (e) { 60 e = e.originalEvent || e 61 var n = c(e.dataTransfer.types), a = s(n) 62 if (!n || !g(a)) return !0 63 if (h.parentNode != m && l.append(T), e.target != m) { 64 for (var r = e.target; r.parentNode != m && r.parentNode;)r = r.parentNode 65 if (r.parentNode == m && r != h) { 66 var d = r.getBoundingClientRect() 67 if (E.horizontal) var o = e.clientX < d.left + d.width / 2 68 else var o = e.clientY < d.top + d.height / 2 69 m.insertBefore(h, o ? r : r.nextSibling) 70 } 71 } var i = n == t, D = u(e, i) 72 return "none" == D ? p() : f.dndDragover && !v(f.dndDragover, e, D, a) ? p() : (e.preventDefault(), i || (e.dataTransfer.dropEffect = D), l.addClass("dndDragover"), e.stopPropagation(), !1) 73 }), l.on("drop", function (e) { 74 e = e.originalEvent || e 75 var n = c(e.dataTransfer.types), a = s(n) 76 if (!n || !g(a)) return !0 77 e.preventDefault() 78 try { var d = JSON.parse(e.dataTransfer.getData(n)) } catch (l) { return p() } if ((n == t || n == r) && (a = d.type || void 0, d = d.item, !g(a))) return p() 79 var y = n == t, T = u(e, y) 80 if ("none" == T) return p() 81 var h = D() 82 return f.dndDrop && (d = v(f.dndDrop, e, T, a, h, d), !d) ? p() : (o.dropEffect = T, y || (e.dataTransfer.dropEffect = T), d !== !0 && i.$apply(function () { i.$eval(f.dndList).splice(h, 0, d) }), v(f.dndInserted, e, T, a, h, d), p(), e.stopPropagation(), !1) 83 }), l.on("dragleave", function (e) { 84 e = e.originalEvent || e 85 var n = document.elementFromPoint(e.clientX, e.clientY) 86 m.contains(n) && !e._dndPhShown ? e._dndPhShown = !0 : p() 87 }) 88 } 89 }]), e.directive("dndNodrag", function () { return function (e, n, a) { n.attr("draggable", "true"), n.on("dragstart", function (e) { e = e.originalEvent || e, e._dndHandle || (e.dataTransfer.types && e.dataTransfer.types.length || e.preventDefault(), e.stopPropagation()) }), n.on("dragend", function (e) { e = e.originalEvent || e, e._dndHandle || e.stopPropagation() }) } }), e.directive("dndHandle", function () { return function (e, n, a) { n.attr("draggable", "true"), n.on("dragstart dragend", function (e) { e = e.originalEvent || e, e._dndHandle = !0 }) } }) 90 var o = {} 91}(angular.module("dndLists", []));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.