/
collection.js
3 lines (3 loc) · 2.96 KB
/
collection.js
1
2
3
/**! Qoopido.nucleus 3.2.14 | http://nucleus.qoopido.com | (c) 2021 Dirk Lueth */
!function(e){"use strict";provide(["/demand/validator/isTypeOf","/demand/validator/isInstanceOf","./element"],(function(t,n,r){var i=Array.prototype.slice,l=Object.defineProperty;function s(n){var r,l,s=0;if(t(n,"string"))for(r=n.split(","),n=[],s=0;l=r[s];s++)try{n=n.concat(i.call(e.querySelectorAll(l)))}catch(e){}return n.length&&!Array.isArray(n)&&(n=i.call(n)),Array.isArray(n)||(n=[n]),n}function o(e){for(var t,n=this,r=n.elements,l=i.call(arguments,1),s=0;t=r[s];s++)t[e].apply(t,l);return n}function u(e,t){return(e=n(e,r)?e:new r(e))&&e[t].call(e,a(this.elements)),this}function a(t){for(var n,r=e.createDocumentFragment(),i=0;n=t[i];i++)r.appendChild(n.node);return r}function c(e){var t=this;return l(t,"elements",{value:[]}),l(t,"nodes",{value:[]}),e&&t.add(e),t}return c.prototype={get length(){return this.elements.length},get:function(e){return this.elements[e]},add:function(e){var t,i=this,l=0;for(e=s(e);t=e[l];l++)-1===i.nodes.indexOf(t.node||t)&&(t=n(t,r)?t:new r(t),i.elements.push(t),i.nodes.push(t.node));return i},remove:function(e){var t,n,r=this,i=0;for(e=s(e);t=e[i];i++)-1!==(n=r.nodes.indexOf(t.node||t))&&(r.elements.splice(n,1),r.nodes.splice(n,1));return r},each:function(e){for(var t,n=this.elements,r=0;t=n[r];r++)e.call(t,r);return this},setAttribute:function(e,t){return o.call(this,"setAttribute",e,t)},setAttributes:function(e){return o.call(this,"setAttributes",e)},removeAttribute:function(e){return o.call(this,"removeAttribute",e)},removeAttributes:function(e){return o.call(this,"removeAttributes",e)},setStyle:function(e,t){return o.call(this,"setStyle",e,t)},setStyles:function(e){return o.call(this,"setStyles",e)},removeStyle:function(e){return o.call(this,"removeStyle",e)},removeStyles:function(e){return o.call(this,"removeStyles",e)},addClass:function(e){return o.call(this,"addClass",e)},removeClass:function(e){return o.call(this,"removeClass",e)},toggleClass:function(e){return o.call(this,"toggleClass",e)},prependTo:function(e){return u.call(this,e,"prepend")},appendTo:function(e){return u.call(this,e,"append")},insertBefore:function(e){return(e=n(e,r)?e:new r(e))&&(e=e.node)&&e.parentNode.insertBefore(a(this.elements),e),this},insertAfter:function(e){var t,i;return(e=n(e,r)?e:new r(e))&&(e=e.node)&&(i=a(this.elements),(t=e.nextSibling)?e.parentNode.insertBefore(i,t):e.parentNode.appendChild(i)),this},replace:function(e){for(var t,n=this.elements,r=0;t=n[r];r++)0===r?t.replace(e):t.insertAfter(n[r-1]);return this},detach:function(){for(var e,t=this.elements,n=0;e=t[n];n++)e.detach();return this},blur:function(){return o.call(this,"blur")},on:function(){return o.apply(this,["on"].concat(i.call(arguments)))},one:function(){return o.apply(this,["one"].concat(i.call(arguments)))},off:function(){return o.apply(this,["off"].concat(i.call(arguments)))},emit:function(){return o.apply(this,["emit"].concat(i.call(arguments)))}},c}))}(document);
//# sourceMappingURL=collection.js.map