vendor: 4,030 bytes, lines 1-118
1// Source: https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach 2if (window.NodeList && !NodeList.prototype.forEach) { 3 NodeList.prototype.forEach = function(callback, thisArg) { 4 thisArg = thisArg || window; 5 for (var i = 0; i < this.length; i++) { 6 callback.call(thisArg, this[i], i, this); 7 } 8 }; 9} 10 11// Source: https://developer.mozilla.org/en-US/docs/Web/API/Element/matches 12if (!Element.prototype.matches) { 13 Element.prototype.matches = 14 Element.prototype.matchesSelector || 15 Element.prototype.mozMatchesSelector || 16 Element.prototype.msMatchesSelector || 17 Element.prototype.oMatchesSelector || 18 Element.prototype.webkitMatchesSelector || 19 function(s) { 20 var matches = ( 21 this.document || this.ownerDocument 22 ).querySelectorAll(s), 23 i = matches.length; 24 while (--i >= 0 && matches.item(i) !== this) {} 25 return i > -1; 26 }; 27} 28 29// Source: https://developer.mozilla.org/en-US/docs/Web/API/Element/closest 30if (!Element.prototype.matches) { 31 Element.prototype.matches = 32 Element.prototype.msMatchesSelector || 33 Element.prototype.webkitMatchesSelector; 34} 35 36if (!Element.prototype.closest) { 37 Element.prototype.closest = function(s) { 38 var el = this; 39 40 do { 41 if (el.matches(s)) return el; 42 el = el.parentElement || el.parentNode; 43 } while (el !== null && el.nodeType === 1); 44 return null; 45 }; 46} 47 48// from: https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/after()/after().md 49(function(arr) { 50 arr.forEach(function(item) { 51 if (item.hasOwnProperty('after')) { 52 return; 53 } 54 Object.defineProperty(item, 'after', { 55 configurable: true, 56 enumerable: true, 57 writable: true, 58 value: function after() { 59 var argArr = Array.prototype.slice.call(arguments), 60 docFrag = document.createDocumentFragment(); 61 62 argArr.forEach(function(argItem) { 63 var isNode = argItem instanceof Node; 64 docFrag.appendChild( 65 isNode 66 ? argItem 67 : document.createTextNode(String(argItem)) 68 ); 69 }); 70 71 this.parentNode.insertBefore(docFrag, this.nextSibling); 72 } 73 }); 74 }); 75})([Element.prototype, CharacterData.prototype, DocumentType.prototype]); 76 77// Source: https://github.com/jserz/js_piece/blob/master/DOM/ParentNode/append()/append().md 78(function(arr) { 79 arr.forEach(function(item) { 80 if (item.hasOwnProperty('append')) { 81 return; 82 } 83 Object.defineProperty(item, 'append', { 84 configurable: true, 85 enumerable: true, 86 writable: true, 87 value: function append() { 88 var argArr = Array.prototype.slice.call(arguments), 89 docFrag = document.createDocumentFragment(); 90 91 argArr.forEach(function(argItem) { 92 var isNode = argItem instanceof Node; 93 docFrag.appendChild( 94 isNode 95 ? argItem 96 : document.createTextNode(String(argItem)) 97 ); 98 }); 99 100 this.appendChild(docFrag); 101 } 102 }); 103 }); 104})([Element.prototype, Document.prototype, DocumentFragment.prototype]); 105 106// from: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent 107(function() { 108 if (typeof window.Event === 'function') return false; 109 110 function Event(event, params) { 111 params = params || { bubbles: false, cancelable: false }; 112 var evt = document.createEvent('Event'); 113 evt.initEvent(event, params.bubbles, params.cancelable); 114 return evt; 115 } 116 117 window.Event = Event; 118})();
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.