Permalink
Please sign in to comment.
Showing
with
107 additions
and 4 deletions.
- +1 −1 README.md
- +0 −1 bower.json
- +1 −1 build/dom4.js
- +43 −0 build/dom4.max.js
- +1 −1 package.json
- +43 −0 src/dom4.js
- +18 −0 test/dom4.js
| @@ -1,2 +1,2 @@ | ||
| /*! (C) WebReflection Mit Style License */ | ||
| -(function(e){"use strict";function t(){return f.createDocumentFragment()}function n(e){if(e.length===1)return r(e[0]);for(var n=t(),i=O.call(e),s=0;s<e.length;s++)n.appendChild(r(i[s]));return n}function r(e){return typeof e=="string"?f.createTextNode(e):e}for(var i,s,o,u,a,f=e.document,l=Object.defineProperty||function(e,t,n){e.__defineGetter__(t,n.get)},c=[].indexOf||function(t){var n=this.length;while(n--)if(this[n]===t)break;return n},h=function(e){if(!e)throw"SyntaxError";if(g.test(e))throw"InvalidCharacterError";return e},p=function(e){var t=e.className,n=typeof t=="object",r=(n?t.baseVal:t).replace(m,"");r.length&&A.push.apply(this,r.split(g)),this._isSVG=n,this._=e},d={get:function(){return new p(this)},set:function(){}},v="dom4-tmp-".concat(Math.random()*+(new Date)).replace(".","-"),m=/^\s+|\s+$/g,g=/\s+/,y=" ",b="classList",w=function(t,n){if(this.contains(t))n||this.remove(t);else if(n===undefined||n)n=!0,this.add(t);return!!n},E=e.DocumentFragment,S=(e.Element||e.Node||e.HTMLElement).prototype,x=e.ShadowRoot,T=e.SVGElement,N=/ /g,C="\\ ",k=function(e){var t=e==="querySelectorAll";return function(n){var r,i,s,o,u,a,f=this.parentNode;if(f){for(s=this.getAttribute("id")||v,o=s===v?s:s.replace(N,C),a=n.split(","),i=0;i<a.length;i++)a[i]="#"+o+" "+a[i];n=a.join(",")}s===v&&this.setAttribute("id",s),u=(f||this)[e](n),s===v&&this.removeAttribute("id");if(t){i=u.length,r=new Array(i);while(i--)r[i]=u[i]}else r=u;return r}},L=function(e){"query"in e||(e.query=S.query),"queryAll"in e||(e.queryAll=S.queryAll)},A=["matches",S.matchesSelector||S.webkitMatchesSelector||S.khtmlMatchesSelector||S.mozMatchesSelector||S.msMatchesSelector||S.oMatchesSelector||function(t){var n=this.parentNode;return!!n&&-1<c.call(n.querySelectorAll(t),this)},"closest",function(t){var n=this,r;while((r=n&&n.matches)&&!n.matches(t))n=n.parentNode;return r?n:null},"prepend",function(){var t=this.firstChild,r=n(arguments);t?this.insertBefore(r,t):this.appendChild(r)},"append",function(){this.appendChild(n(arguments))},"before",function(){var t=this.parentNode;t&&t.insertBefore(n(arguments),this)},"after",function(){var t=this.parentNode,r=this.nextSibling,i=n(arguments);t&&(r?t.insertBefore(i,r):t.appendChild(i))},"replace",function(){this.replaceWith.apply(this,arguments)},"replaceWith",function(){var t=this.parentNode;t&&t.replaceChild(n(arguments),this)},"remove",function(){var t=this.parentNode;t&&t.removeChild(this)},"query",k("querySelector"),"queryAll",k("querySelectorAll")],O=A.slice,M=A.length;M;M-=2)s=A[M-2],s in S||(S[s]=A[M-1]);L(f);if(E)L(E.prototype);else try{L(t().constructor.prototype)}catch(_){}x&&L(x.prototype),f.createElement("a").matches("a")||(S[s]=function(e){return function(n){return e.call(this.parentNode?this:t().appendChild(this),n)}}(S[s])),p.prototype={length:0,add:function(){for(var t=0,n;t<arguments.length;t++)n=arguments[t],this.contains(n)||A.push.call(this,s);this._isSVG?this._.setAttribute("class",""+this):this._.className=""+this},contains:function(e){return function(n){return M=e.call(this,s=h(n)),-1<M}}([].indexOf||function(e){M=this.length;while(M--&&this[M]!==e);return M}),item:function(t){return this[t]||null},remove:function(){for(var t=0,n;t<arguments.length;t++)n=arguments[t],this.contains(n)&&A.splice.call(this,M,1);this._isSVG?this._.setAttribute("class",""+this):this._.className=""+this},toggle:w,toString:function D(){return A.join.call(this,y)}},T&&!(b in T.prototype)&&l(T.prototype,b,d),b in f.documentElement?(u=f.createElement("div")[b],u.add("a","b","a"),"a b"!=u&&(o=u.constructor.prototype,"add"in o||(o=e.TemporaryTokenList.prototype),a=function(e){return function(){var t=0;while(t<arguments.length)e.call(this,arguments[t++])}},o.add=a(o.add),o.remove=a(o.remove),o.toggle=w)):l(S,b,d),"head"in f||l(f,"head",{get:function(){return i||(i=f.getElementsByTagName("head")[0])}});try{new e.CustomEvent("?")}catch(_){e.CustomEvent=function(e,t){function n(n,i){var s=f.createEvent(e);if(typeof n!="string")throw new Error("An event name must be provided");return e=="Event"&&(s.initCustomEvent=r),i==null&&(i=t),s.initCustomEvent(n,i.bubbles,i.cancelable,i.detail),s}function r(e,t,n,r){this.initEvent(e,t,n),this.detail=r}return n}(e.CustomEvent?"CustomEvent":"Event",{bubbles:!1,cancelable:!1,detail:null})}})(window); | ||
| +(function(e){"use strict";function t(){return f.createDocumentFragment()}function n(e){if(e.length===1)return r(e[0]);for(var n=t(),i=O.call(e),s=0;s<e.length;s++)n.appendChild(r(i[s]));return n}function r(e){return typeof e=="string"?f.createTextNode(e):e}for(var i,s,o,u,a,f=e.document,l=Object.defineProperty||function(e,t,n){e.__defineGetter__(t,n.get)},c=[].indexOf||function(t){var n=this.length;while(n--)if(this[n]===t)break;return n},h=function(e){if(!e)throw"SyntaxError";if(g.test(e))throw"InvalidCharacterError";return e},p=function(e){var t=e.className,n=typeof t=="object",r=(n?t.baseVal:t).replace(m,"");r.length&&A.push.apply(this,r.split(g)),this._isSVG=n,this._=e},d={get:function(){return new p(this)},set:function(){}},v="dom4-tmp-".concat(Math.random()*+(new Date)).replace(".","-"),m=/^\s+|\s+$/g,g=/\s+/,y=" ",b="classList",w=function(t,n){if(this.contains(t))n||this.remove(t);else if(n===undefined||n)n=!0,this.add(t);return!!n},E=e.DocumentFragment,S=(e.Element||e.Node||e.HTMLElement).prototype,x=e.ShadowRoot,T=e.SVGElement,N=/ /g,C="\\ ",k=function(e){var t=e==="querySelectorAll";return function(n){var r,i,s,o,u,a,f=this.parentNode;if(f){for(s=this.getAttribute("id")||v,o=s===v?s:s.replace(N,C),a=n.split(","),i=0;i<a.length;i++)a[i]="#"+o+" "+a[i];n=a.join(",")}s===v&&this.setAttribute("id",s),u=(f||this)[e](n),s===v&&this.removeAttribute("id");if(t){i=u.length,r=new Array(i);while(i--)r[i]=u[i]}else r=u;return r}},L=function(e){"query"in e||(e.query=S.query),"queryAll"in e||(e.queryAll=S.queryAll)},A=["matches",S.matchesSelector||S.webkitMatchesSelector||S.khtmlMatchesSelector||S.mozMatchesSelector||S.msMatchesSelector||S.oMatchesSelector||function(t){var n=this.parentNode;return!!n&&-1<c.call(n.querySelectorAll(t),this)},"closest",function(t){var n=this,r;while((r=n&&n.matches)&&!n.matches(t))n=n.parentNode;return r?n:null},"prepend",function(){var t=this.firstChild,r=n(arguments);t?this.insertBefore(r,t):this.appendChild(r)},"append",function(){this.appendChild(n(arguments))},"before",function(){var t=this.parentNode;t&&t.insertBefore(n(arguments),this)},"after",function(){var t=this.parentNode,r=this.nextSibling,i=n(arguments);t&&(r?t.insertBefore(i,r):t.appendChild(i))},"replace",function(){this.replaceWith.apply(this,arguments)},"replaceWith",function(){var t=this.parentNode;t&&t.replaceChild(n(arguments),this)},"remove",function(){var t=this.parentNode;t&&t.removeChild(this)},"query",k("querySelector"),"queryAll",k("querySelectorAll")],O=A.slice,M=A.length;M;M-=2)s=A[M-2],s in S||(S[s]=A[M-1]);L(f);if(E)L(E.prototype);else try{L(t().constructor.prototype)}catch(_){}x&&L(x.prototype),f.createElement("a").matches("a")||(S[s]=function(e){return function(n){return e.call(this.parentNode?this:t().appendChild(this),n)}}(S[s])),p.prototype={length:0,add:function(){for(var t=0,n;t<arguments.length;t++)n=arguments[t],this.contains(n)||A.push.call(this,s);this._isSVG?this._.setAttribute("class",""+this):this._.className=""+this},contains:function(e){return function(n){return M=e.call(this,s=h(n)),-1<M}}([].indexOf||function(e){M=this.length;while(M--&&this[M]!==e);return M}),item:function(t){return this[t]||null},remove:function(){for(var t=0,n;t<arguments.length;t++)n=arguments[t],this.contains(n)&&A.splice.call(this,M,1);this._isSVG?this._.setAttribute("class",""+this):this._.className=""+this},toggle:w,toString:function D(){return A.join.call(this,y)}},T&&!(b in T.prototype)&&l(T.prototype,b,d),b in f.documentElement?(u=f.createElement("div")[b],u.add("a","b","a"),"a b"!=u&&(o=u.constructor.prototype,"add"in o||(o=e.TemporaryTokenList.prototype),a=function(e){return function(){var t=0;while(t<arguments.length)e.call(this,arguments[t++])}},o.add=a(o.add),o.remove=a(o.remove),o.toggle=w)):l(S,b,d),"head"in f||l(f,"head",{get:function(){return i||(i=f.getElementsByTagName("head")[0])}}),function(){for(var t,n=e.requestAnimationFrame,r=e.cancelAnimationFrame,i=["o","ms","moz","webkit"],s=i.length;!r&&s--;)n=n||e[i[s]+"RequestAnimationFrame"],r=e[i[s]+"CancelAnimationFrame"]||e[i[s]+"CancelRequestAnimationFrame"];r||(n?(t=n,n=function(e){var n=!0;return t(function(){n&&e.apply(this,arguments)}),function(){n=!1}},r=function(e){e()}):(n=function(e){return setTimeout(e,15,15)},r=function(e){clearTimeout(e)})),e.requestAnimationFrame=n,e.cancelAnimationFrame=r}();try{new e.CustomEvent("?")}catch(_){e.CustomEvent=function(e,t){function n(n,i){var s=f.createEvent(e);if(typeof n!="string")throw new Error("An event name must be provided");return e=="Event"&&(s.initCustomEvent=r),i==null&&(i=t),s.initCustomEvent(n,i.bubbles,i.cancelable,i.detail),s}function r(e,t,n,r){this.initEvent(e,t,n),this.detail=r}return n}(e.CustomEvent?"CustomEvent":"Event",{bubbles:!1,cancelable:!1,detail:null})}})(window); |
43
src/dom4.js
18
test/dom4.js
0 comments on commit
7638b4b