diff --git a/CHANGELOG.md b/CHANGELOG.md index f222f87..a4591e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ ## Version History +1.3.0 + +* Automatic collection of elements with data-onscreenness attribute +* Output esm and umd script files + 1.2.4 * Integration tests with Puppeteer. @@ -49,4 +54,3 @@ With support of Babel and Rollup it was possible to assemble it to a NPM-module. ## toDo, toWant * Callbacks * Refine the DOM observer -* automatically collect elements with data-onscreenness attribute \ No newline at end of file diff --git a/dist/index.esm.js b/dist/index.esm.js new file mode 100644 index 0000000..4d02129 --- /dev/null +++ b/dist/index.esm.js @@ -0,0 +1,2 @@ +const t=function(t,e){return Number(Math.round(t+"e"+e)+"e-"+e)},e=function(t){return t.split(",").map(t=>t.trim().replace(/\s+/g," ")).filter(t=>t.length)},n=function(t){var e=[];return e.push.apply(e,document.querySelectorAll(t)),e};var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(t,e){return t(e={exports:{}},e.exports),e.exports}var i,c,a,u,s="object",f=function(t){return t&&t.Math==Math&&t},l=f(typeof globalThis==s&&globalThis)||f(typeof window==s&&window)||f(typeof self==s&&self)||f(typeof r==s&&r)||Function("return this")(),p=function(t){try{return!!t()}catch(t){return!0}},h=!p(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),d={}.propertyIsEnumerable,v=Object.getOwnPropertyDescriptor,y={f:v&&!d.call({1:2},1)?function(t){var e=v(this,t);return!!e&&e.enumerable}:d},g=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},m={}.toString,L=function(t){return m.call(t).slice(8,-1)},b="".split,S=p(function(){return!Object("z").propertyIsEnumerable(0)})?function(t){return"String"==L(t)?b.call(t,""):Object(t)}:Object,w=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},E=function(t){return S(w(t))},O=function(t){return"object"==typeof t?null!==t:"function"==typeof t},M=function(t,e){if(!O(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!O(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!O(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!O(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},P={}.hasOwnProperty,T=function(t,e){return P.call(t,e)},j=l.document,x=O(j)&&O(j.createElement),A=!h&&!p(function(){return 7!=Object.defineProperty(("div",x?j.createElement("div"):{}),"a",{get:function(){return 7}}).a}),C=Object.getOwnPropertyDescriptor,k={f:h?C:function(t,e){if(t=E(t),e=M(e,!0),A)try{return C(t,e)}catch(t){}if(T(t,e))return g(!y.f.call(t,e),t[e])}},I=function(t){if(!O(t))throw TypeError(String(t)+" is not an object");return t},N=Object.defineProperty,_={f:h?N:function(t,e,n){if(I(t),e=M(e,!0),I(n),A)try{return N(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},z=h?function(t,e,n){return _.f(t,e,g(1,n))}:function(t,e,n){return t[e]=n,t},D=function(t,e){try{z(l,t,e)}catch(n){l[t]=e}return e},V=o(function(t){var e=l["__core-js_shared__"]||D("__core-js_shared__",{});(t.exports=function(t,n){return e[t]||(e[t]=void 0!==n?n:{})})("versions",[]).push({version:"3.1.3",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}),G=V("native-function-to-string",Function.toString),F=l.WeakMap,H="function"==typeof F&&/native code/.test(G.call(F)),R=0,q=Math.random(),W=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++R+q).toString(36)},B=V("keys"),K={},Y=l.WeakMap;if(H){var J=new Y,Q=J.get,U=J.has,X=J.set;i=function(t,e){return X.call(J,t,e),e},c=function(t){return Q.call(J,t)||{}},a=function(t){return U.call(J,t)}}else{var Z=B[u="state"]||(B[u]=W(u));K[Z]=!0,i=function(t,e){return z(t,Z,e),e},c=function(t){return T(t,Z)?t[Z]:{}},a=function(t){return T(t,Z)}}var $,tt,et,nt={set:i,get:c,has:a,enforce:function(t){return a(t)?c(t):i(t,{})},getterFor:function(t){return function(e){var n;if(!O(e)||(n=c(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},rt=o(function(t){var e=nt.get,n=nt.enforce,r=String(G).split("toString");V("inspectSource",function(t){return G.call(t)}),(t.exports=function(t,e,o,i){var c=!!i&&!!i.unsafe,a=!!i&&!!i.enumerable,u=!!i&&!!i.noTargetGet;"function"==typeof o&&("string"!=typeof e||T(o,"name")||z(o,"name",e),n(o).source=r.join("string"==typeof e?e:"")),t!==l?(c?!u&&t[e]&&(a=!0):delete t[e],a?t[e]=o:z(t,e,o)):a?t[e]=o:D(e,o)})(Function.prototype,"toString",function(){return"function"==typeof this&&e(this).source||G.call(this)})}),ot=l,it=function(t){return"function"==typeof t?t:void 0},ct=Math.ceil,at=Math.floor,ut=function(t){return isNaN(t=+t)?0:(t>0?at:ct)(t)},st=Math.min,ft=function(t){return t>0?st(ut(t),9007199254740991):0},lt=Math.max,pt=Math.min,ht=function(t){return function(e,n,r){var o,i=E(e),c=ft(i.length),a=function(t,e){var n=ut(r);return n<0?lt(n+e,0):pt(n,e)}(0,c);if(t&&n!=n){for(;c>a;)if((o=i[a++])!=o)return!0}else for(;c>a;a++)if((t||a in i)&&i[a]===n)return t||a||0;return!t&&-1}},dt=(ht(!0),ht(!1)),vt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype"),yt={f:Object.getOwnPropertyNames||function(t){return function(t,e){var n,r=E(t),o=0,i=[];for(n in r)!T(K,n)&&T(r,n)&&i.push(n);for(;e.length>o;)T(r,n=e[o++])&&(~dt(i,n)||i.push(n));return i}(t,vt)}},gt={f:Object.getOwnPropertySymbols},mt=function(t,e){return arguments.length<2?it(ot[t])||it(l[t]):ot[t]&&ot[t][e]||l[t]&&l[t][e]}("Reflect","ownKeys")||function(t){var e=yt.f(I(t)),n=gt.f;return n?e.concat(n(t)):e},Lt=function(t,e){for(var n=mt(e),r=_.f,o=k.f,i=0;ig;g++)if((c||g in d)&&(p=v(l=d[g],g,h),t))if(e)L[g]=p;else if(p)switch(t){case 3:return!0;case 5:return l;case 6:return g;case 2:Nt.call(L,l)}else if(o)return!1;return i?-1:r||o?o:L}},zt=[_t(0),_t(1),_t(2),_t(3),_t(4),_t(5),_t(6)][0],Dt=(tt=[].forEach)&&p(function(){tt.call(null,function(){throw 1},1)})?[].forEach:function(t){return zt(this,t,arguments.length>1?arguments[1]:void 0)};for(var Vt in function(t,e){var n,r,o,i,c,a=t.target,u=t.global,s=t.stat;if(n=u?l:s?l[a]||D(a,{}):(l[a]||{}).prototype)for(r in e){if(i=e[r],o=t.noTargetGet?(c=Tt(n,r))&&c.value:n[r],!Pt(u?r:a+(s?".":"#")+r,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;Lt(i,o)}(t.sham||o&&o.sham)&&z(i,"sham",!0),rt(n,r,i,t)}}({target:"Array",proto:!0,forced:[].forEach!=Dt},{forEach:Dt}),{CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}){var Gt=l[Vt],Ft=Gt&&Gt.prototype;if(Ft&&Ft.forEach!==Dt)try{z(Ft,"forEach",Dt)}catch(r){Ft.forEach=Dt}}var Ht=(et=function(t){t instanceof Array||(t=[t]),t.forEach(function(t){return t()})},{onInteractive:function(t){"loading"===document.readyState?window.addEventListener("DOMContentLoaded",function(e){et(t)}):et(t)},onComplete:function(t){"complete"===document.readyState?et(t):window.addEventListener("load",function(e){et(t)})}});export default function(){var r="[data-onscreenness]",o=[],i=[],c=function(t){(t.length?n(t.join(",")):[]).forEach(function(t){t&&(t.classList.remove("onscreen"),t.classList.remove("offscreen"),t.classList.remove("crossscreen"),t.classList.remove("overscreen"),delete t.dataset.onscreenness,delete t.dataset.overlapping)})},a=function(t,e){e.forEach(e=>{t.includes(e)||t.push(e)})},u=function(t){var e={left:0-t.left,right:t.right-document.documentElement.clientWidth,top:0-t.top,bottom:t.bottom-document.documentElement.clientHeight},n=Math.min(Math.max(e.left,0),t.width),r=Math.min(Math.max(e.right,0),t.width),o=Math.min(Math.max(e.top,0),t.height),i=Math.min(Math.max(e.bottom,0),t.height),c=1-n/t.width-r/t.width,a=1-o/t.height-i/t.height,u=(t.width-n-r)/document.documentElement.clientWidth,s=(t.height-o-i)/document.documentElement.clientHeight;return{horizonOverlap:u,verticaOverlap:s,surfaceOverlap:u*s,horizonPresence:c,verticaPresence:a,surfacePresence:c*a}},s=function(e,n){var r=t(n.surfacePresence,3);e.dataset.onscreenness=String(r);var o=e.classList.contains("onscreen");1!==r||o||e.classList.add("onscreen"),r<1&&o&&e.classList.remove("onscreen");var i=e.classList.contains("crossscreen");r>0&&r<1&&!i&&e.classList.add("crossscreen"),0!==r&&1!==r||!i||e.classList.remove("crossscreen");var c=e.classList.contains("offscreen");0!==r||c||e.classList.add("offscreen"),r>0&&c&&e.classList.remove("offscreen");var a=t(n.surfaceOverlap,3);e.dataset.overlapping=String(a);var u=1===n.verticaOverlap&&1===n.horizonOverlap||1===n.verticaOverlap&&1===n.horizonPresence||1===n.horizonOverlap&&1===n.verticaPresence,s=e.classList.contains("overscreen");u&&!s&&e.classList.add("overscreen"),!u&&s&&e.classList.remove("overscreen")},f=function(){var t=[r].concat(o),e=n(t.join(",")),c=i.length?n(i.join(",")):[];return e.filter(t=>!c.includes(t))},l=function(){f().forEach(function(t){var e=t.getBoundingClientRect(),n=u(e);s(t,n)})};window.addEventListener("resize",l,!1),window.addEventListener("scroll",l,!0);let p=new MutationObserver(function(t,e){t.length&&l()});return Ht.onInteractive([l,function(){p.observe(document.body,{childList:!0,subtree:!0})}]),{publicAPI:{collect:function(t){var n=e(t);a(o,n)},exclude:function(t){var n=e(t);c(n),a(i,n)},remove:function(t){e(t).forEach(t=>{o.includes(t)&&(c([t]),o.splice(o.indexOf(t),1))})},reset:function(){c(o),o=[],i=[]}},testSuite:{getVariables:function(){return{queryList:o,blackList:i}},triggerEvent:l,makeNodeList:f,calculatePresence:u,treatElement:s,cleanElements:c}}}().publicAPI; +//# sourceMappingURL=index.esm.js.map diff --git a/dist/index.esm.js.map b/dist/index.esm.js.map new file mode 100644 index 0000000..ed4ea76 --- /dev/null +++ b/dist/index.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.esm.js","sources":["../src/utilities.js","../node_modules/document-staging/dist/index.esm.js","../src/onScreenness.js"],"sourcesContent":["\n/**\n * Round at decimals\n * @private\n * @param {number} number - any number to round\n * @param {number} decimals - number of decimals to round at\n */\nconst roundAt = function (number, decimals) {\n\t// https://www.jacklmoore.com/notes/rounding-in-javascript/\n\treturn Number ( Math.round ( number + 'e' + decimals ) + 'e-' + decimals );\n};\n\n/**\n * Process comma seperated list to a sanitised array with normalised strings\n * @private\n * @param {string} commaSeperatedList\n * @returns {array} array with strings\n */\nconst commaSeperatedListToArray = function ( commaSeperatedList ) {\n\tlet list = commaSeperatedList.split(',');\n\tlet trimmed = list.map ( item => item.trim().replace(/\\s+/g, ' ') );\n\treturn trimmed.filter ( item => {\n\t\treturn item.length;\n\t});\n};\n\n/**\n * Convert a static nodeList to an array to be able to perform array operations like filter or map\n * @private\n * @param {nodeList} nodeList\n * @returns {array} array with HTMLElements\n */\nconst queryToArray = function ( query ) {\n\t// the push.apply operation is in most browsers among the fastest\n\t// https://jsperf.com/nodelist-to-array/27\n\tvar elementArray = [];\n\telementArray.push.apply(elementArray, document.querySelectorAll ( query ) );\n\treturn elementArray;\n};\n\nexport {\n\tcommaSeperatedListToArray,\n\tqueryToArray,\n\troundAt\n};\n","var t=\"undefined\"!=typeof globalThis?globalThis:\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:{};function n(t,n){return t(n={exports:{}},n.exports),n.exports}var r,e,o,i,u=\"object\",c=function(t){return t&&t.Math==Math&&t},f=c(typeof globalThis==u&&globalThis)||c(typeof window==u&&window)||c(typeof self==u&&self)||c(typeof t==u&&t)||Function(\"return this\")(),a=function(t){try{return!!t()}catch(t){return!0}},l=!a(function(){return 7!=Object.defineProperty({},\"a\",{get:function(){return 7}}).a}),s={}.propertyIsEnumerable,p=Object.getOwnPropertyDescriptor,y={f:p&&!s.call({1:2},1)?function(t){var n=p(this,t);return!!n&&n.enumerable}:s},h=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}},d={}.toString,g=function(t){return d.call(t).slice(8,-1)},v=\"\".split,S=a(function(){return!Object(\"z\").propertyIsEnumerable(0)})?function(t){return\"String\"==g(t)?v.call(t,\"\"):Object(t)}:Object,m=function(t){if(null==t)throw TypeError(\"Can't call method on \"+t);return t},b=function(t){return S(m(t))},L=function(t){return\"object\"==typeof t?null!==t:\"function\"==typeof t},w=function(t,n){if(!L(t))return t;var r,e;if(n&&\"function\"==typeof(r=t.toString)&&!L(e=r.call(t)))return e;if(\"function\"==typeof(r=t.valueOf)&&!L(e=r.call(t)))return e;if(!n&&\"function\"==typeof(r=t.toString)&&!L(e=r.call(t)))return e;throw TypeError(\"Can't convert object to primitive value\")},O={}.hasOwnProperty,E=function(t,n){return O.call(t,n)},T=f.document,M=L(T)&&L(T.createElement),j=!l&&!a(function(){return 7!=Object.defineProperty((t=\"div\",M?T.createElement(t):{}),\"a\",{get:function(){return 7}}).a;var t}),P=Object.getOwnPropertyDescriptor,x={f:l?P:function(t,n){if(t=b(t),n=w(n,!0),j)try{return P(t,n)}catch(t){}if(E(t,n))return h(!y.f.call(t,n),t[n])}},A=function(t){if(!L(t))throw TypeError(String(t)+\" is not an object\");return t},C=Object.defineProperty,_={f:l?C:function(t,n,r){if(A(t),n=w(n,!0),A(r),j)try{return C(t,n,r)}catch(t){}if(\"get\"in r||\"set\"in r)throw TypeError(\"Accessors not supported\");return\"value\"in r&&(t[n]=r.value),t}},k=l?function(t,n,r){return _.f(t,n,h(1,r))}:function(t,n,r){return t[n]=r,t},D=function(t,n){try{k(f,t,n)}catch(r){f[t]=n}return n},I=n(function(t){var n=f[\"__core-js_shared__\"]||D(\"__core-js_shared__\",{});(t.exports=function(t,r){return n[t]||(n[t]=void 0!==r?r:{})})(\"versions\",[]).push({version:\"3.1.3\",mode:\"global\",copyright:\"© 2019 Denis Pushkarev (zloirock.ru)\"})}),N=I(\"native-function-to-string\",Function.toString),G=f.WeakMap,V=\"function\"==typeof G&&/native code/.test(N.call(G)),F=0,R=Math.random(),H=function(t){return\"Symbol(\"+String(void 0===t?\"\":t)+\")_\"+(++F+R).toString(36)},z=I(\"keys\"),q={},W=f.WeakMap;if(V){var B=new W,K=B.get,Y=B.has,J=B.set;r=function(t,n){return J.call(B,t,n),n},e=function(t){return K.call(B,t)||{}},o=function(t){return Y.call(B,t)}}else{var Q=z[i=\"state\"]||(z[i]=H(i));q[Q]=!0,r=function(t,n){return k(t,Q,n),n},e=function(t){return E(t,Q)?t[Q]:{}},o=function(t){return E(t,Q)}}var U,X,Z,$={set:r,get:e,has:o,enforce:function(t){return o(t)?e(t):r(t,{})},getterFor:function(t){return function(n){var r;if(!L(n)||(r=e(n)).type!==t)throw TypeError(\"Incompatible receiver, \"+t+\" required\");return r}}},tt=n(function(t){var n=$.get,r=$.enforce,e=String(N).split(\"toString\");I(\"inspectSource\",function(t){return N.call(t)}),(t.exports=function(t,n,o,i){var u=!!i&&!!i.unsafe,c=!!i&&!!i.enumerable,a=!!i&&!!i.noTargetGet;\"function\"==typeof o&&(\"string\"!=typeof n||E(o,\"name\")||k(o,\"name\",n),r(o).source=e.join(\"string\"==typeof n?n:\"\")),t!==f?(u?!a&&t[n]&&(c=!0):delete t[n],c?t[n]=o:k(t,n,o)):c?t[n]=o:D(n,o)})(Function.prototype,\"toString\",function(){return\"function\"==typeof this&&n(this).source||N.call(this)})}),nt=f,rt=function(t){return\"function\"==typeof t?t:void 0},et=Math.ceil,ot=Math.floor,it=function(t){return isNaN(t=+t)?0:(t>0?ot:et)(t)},ut=Math.min,ct=function(t){return t>0?ut(it(t),9007199254740991):0},ft=Math.max,at=Math.min,lt=function(t){return function(n,r,e){var o,i=b(n),u=ct(i.length),c=function(t,n){var r=it(t);return r<0?ft(r+n,0):at(r,n)}(e,u);if(t&&r!=r){for(;u>c;)if((o=i[c++])!=o)return!0}else for(;u>c;c++)if((t||c in i)&&i[c]===r)return t||c||0;return!t&&-1}},st={includes:lt(!0),indexOf:lt(!1)}.indexOf,pt=[\"constructor\",\"hasOwnProperty\",\"isPrototypeOf\",\"propertyIsEnumerable\",\"toLocaleString\",\"toString\",\"valueOf\"].concat(\"length\",\"prototype\"),yt={f:Object.getOwnPropertyNames||function(t){return function(t,n){var r,e=b(t),o=0,i=[];for(r in e)!E(q,r)&&E(e,r)&&i.push(r);for(;n.length>o;)E(e,r=n[o++])&&(~st(i,r)||i.push(r));return i}(t,pt)}},ht={f:Object.getOwnPropertySymbols},dt=function(t,n){return arguments.length<2?rt(nt[t])||rt(f[t]):nt[t]&&nt[t][n]||f[t]&&f[t][n]}(\"Reflect\",\"ownKeys\")||function(t){var n=yt.f(A(t)),r=ht.f;return r?n.concat(r(t)):n},gt=function(t,n){for(var r=dt(n),e=_.f,o=x.f,i=0;iv;v++)if((u||v in h)&&(p=d(s=h[v],v,y),t))if(n)L[v]=p;else if(p)switch(t){case 3:return!0;case 5:return s;case 6:return v;case 2:_t.call(L,s)}else if(o)return!1;return i?-1:e||o?o:L}},Dt={forEach:kt(0),map:kt(1),filter:kt(2),some:kt(3),every:kt(4),find:kt(5),findIndex:kt(6)}.forEach,It=(Z=[][\"forEach\"])&&a(function(){Z.call(null,X||function(){throw 1},1)})?[].forEach:function(t){return Dt(this,t,arguments.length>1?arguments[1]:void 0)};!function(t,n){var r,e,o,i,u,c=t.target,a=t.global,l=t.stat;if(r=a?f:l?f[c]||D(c,{}):(f[c]||{}).prototype)for(e in n){if(i=n[e],o=t.noTargetGet?(u=Et(r,e))&&u.value:r[e],!Ot(a?e:c+(l?\".\":\"#\")+e,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;gt(i,o)}(t.sham||o&&o.sham)&&k(i,\"sham\",!0),tt(r,e,i,t)}}({target:\"Array\",proto:!0,forced:[].forEach!=It},{forEach:It});var Nt;for(var Gt in{CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}){var Vt=f[Gt],Ft=Vt&&Vt.prototype;if(Ft&&Ft.forEach!==It)try{k(Ft,\"forEach\",It)}catch(t){Ft.forEach=It}}export default(Nt=function(t){t instanceof Array||(t=[t]),t.forEach(function(t){return t()})},{onInteractive:function(t){\"loading\"===document.readyState?window.addEventListener(\"DOMContentLoaded\",function(n){Nt(t)}):Nt(t)},onComplete:function(t){\"complete\"===document.readyState?Nt(t):window.addEventListener(\"load\",function(n){Nt(t)})}});\n//# sourceMappingURL=index.esm.js.map\n","import {\n\tcommaSeperatedListToArray,\n\tqueryToArray,\n\troundAt\n} from './utilities.js';\nimport documentStaging from '../node_modules/document-staging/dist/index.esm.js';\n\nlet onScreennessModule = (function () {\n\tvar baseQuery = '[data-onscreenness]';\n\tvar queryList = [];\n\tvar blackList = [];\n\n\t/**\n\t * Remove datasets and classNames from queried elements\n\t * @private\n\t * @param {string} removeList - querySelector\n\t */\n\tvar detachIdentifiers = function ( removeList ) {\n\t\tvar elementList = removeList.length \n\t\t\t? queryToArray ( removeList.join(',') )\n\t\t\t: [];\n\n\t\telementList.forEach( function ( element ) {\n\t\t\tif ( !element ) {\n\t\t\t\t// the elements could be deleted\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telement.classList.remove('onscreen');\n\t\t\telement.classList.remove('offscreen');\n\t\t\telement.classList.remove('crossscreen');\n\t\t\telement.classList.remove('overscreen');\n\t\t\tdelete element.dataset['onscreenness'];\n\t\t\tdelete element.dataset['overlapping'];\n\t\t});\n\t};\n\n\t/**\n\t * Add solitary queries to a list, avoiding duplication\n\t * @private\n\t * @param {string} currentList - list with unique solitary queries\n\t * @param {string} newQueries - querySelector\n\t */\n\tvar addQueries = function ( currentList, newQueries ) {\n\t\tnewQueries.forEach ( ( newQuery ) => {\n\t\t\tif ( !currentList.includes ( newQuery ) ) {\n\t\t\t\tcurrentList.push ( newQuery );\n\t\t\t}\n\t\t});\n\t};\n\n\t/**\n\t * Add query to queryList\n\t * @param {string} rawQuery - querySelector\n\t */\n\tvar collect = function ( rawQuery ) {\n\t\tvar queries = commaSeperatedListToArray ( rawQuery );\n\t\taddQueries ( queryList, queries );\n\t};\n\n\t/**\n\t * Add to blacklist\n\t * @param {string} rawQuery - querySelector\n\t */\n\tvar exclude = function ( rawQuery ) {\n\t\tvar queries = commaSeperatedListToArray ( rawQuery );\n\t\tdetachIdentifiers ( queries );\n\t\taddQueries ( blackList, queries );\n\t};\n\n\t/**\n\t * Remove query from queryList and blacklist\n\t * @param {string} rawQuery - querySelector\n\t */\n\tvar remove = function ( rawQuery ) {\n\t\tvar queries = commaSeperatedListToArray ( rawQuery );\n\t\tqueries.forEach ( ( query ) => {\n\t\t\tif ( queryList.includes ( query ) ) {\n\t\t\t\tdetachIdentifiers ( [query] );\n\t\t\t\tqueryList.splice ( queryList.indexOf ( query ), 1 );\n\t\t\t}\n\t\t});\n\t};\n\n\t/**\n\t * Empty the querylist\n\t */\n\tvar reset = function () {\n\t\tdetachIdentifiers ( queryList );\n\t\tqueryList = [];\n\t\tblackList = [];\n\t};\n\n\t/**\n\t * Calculate onscreenness figures of an element\n\t * @private\n\t * @param {object} boundingRect\n\t * @returns {object} onscreenness figures\n\t */\n\tvar calculatePresence = function ( boundingRect ) {\n\t\tvar overhang = {\n\t\t\tleft: 0 - boundingRect.left,\n\t\t\tright: boundingRect.right - document.documentElement.clientWidth,\n\t\t\ttop: 0 - boundingRect.top,\n\t\t\tbottom: boundingRect.bottom - document.documentElement.clientHeight,\n\t\t};\n\t\tvar absence = {\n\t\t\tleft: Math.min( Math.max( overhang.left, 0 ), boundingRect.width ),\n\t\t\tright: Math.min( Math.max( overhang.right, 0 ), boundingRect.width ),\n\t\t\ttop: Math.min( Math.max( overhang.top, 0 ), boundingRect.height ),\n\t\t\tbottom: Math.min( Math.max( overhang.bottom, 0 ), boundingRect.height ),\n\t\t};\n\t\tvar relativeAbsence = {\n\t\t\tleft: absence.left / boundingRect.width,\n\t\t\tright: absence.right / boundingRect.width,\n\t\t\ttop: absence.top / boundingRect.height,\n\t\t\tbottom: absence.bottom / boundingRect.height,\n\t\t};\n\n\t\tvar horizonPresence = 1 - relativeAbsence.left - relativeAbsence.right;\n\t\tvar verticaPresence = 1 - relativeAbsence.top - relativeAbsence.bottom;\n\n\t\tvar horizonOverlap = (\n\t\t\tboundingRect.width - absence.left - absence.right\n\t\t\t) / document.documentElement.clientWidth;\n\t\tvar verticaOverlap = (\n\t\t\tboundingRect.height - absence.top - absence.bottom\n\t\t\t) / document.documentElement.clientHeight;\n\n\t\treturn {\n\t\t\thorizonOverlap: horizonOverlap,\n\t\t\tverticaOverlap: verticaOverlap,\n\t\t\tsurfaceOverlap: horizonOverlap * verticaOverlap,\n\t\t\thorizonPresence: horizonPresence,\n\t\t\tverticaPresence: verticaPresence,\n\t\t\tsurfacePresence: horizonPresence * verticaPresence,\n\t\t};\n\t};\n\n\t/** \n\t * Updates dataset and classNames of an element\n\t * @private\n\t * @param {element} element\n\t * @param {object} pp - presence properties\n\t */\n\tvar attachIdentifiers = function ( element, pp ) {\n//\t\tconsole.log('presence properties ' + JSON.stringify(pp));\n\t\tvar presence = roundAt ( pp.surfacePresence, 3 );\n\t\telement.dataset['onscreenness'] = String ( presence );\n\n\t\tvar taggedOn = element.classList.contains('onscreen');\n\t\tif ( presence === 1 && !taggedOn ) {\n\t\t\telement.classList.add('onscreen');\n\t\t}\n\t\tif ( presence < 1 && taggedOn ) {\n\t\t\telement.classList.remove('onscreen');\n\t\t}\n\n\t\tvar taggedCross = element.classList.contains('crossscreen');\n\t\tif ( presence > 0 && presence < 1 && !taggedCross ) {\n\t\t\telement.classList.add('crossscreen');\n\t\t}\n\t\tif ( ( presence === 0 || presence === 1 ) && taggedCross ) {\n\t\t\telement.classList.remove('crossscreen');\n\t\t}\n\n\t\tvar taggedOff = element.classList.contains('offscreen');\n\t\tif ( presence === 0 && !taggedOff ) {\n\t\t\telement.classList.add('offscreen');\n\t\t}\n\t\tif ( presence > 0 && taggedOff ) {\n\t\t\telement.classList.remove('offscreen');\n\t\t}\n\n\t\tvar overlapping = roundAt ( pp.surfaceOverlap, 3 );\n\t\telement.dataset['overlapping'] = String ( overlapping );\n\n\t\tvar overhanging = (\n\t\t\t(pp.verticaOverlap === 1 && pp.horizonOverlap === 1) ||\n\t\t\t(pp.verticaOverlap === 1 && pp.horizonPresence === 1) ||\n\t\t\t(pp.horizonOverlap === 1 && pp.verticaPresence === 1)\n\t\t);\n\t\tvar taggedOver = element.classList.contains('overscreen');\n\t\tif ( overhanging && !taggedOver ) {\n\t\t\telement.classList.add('overscreen');\n\t\t}\n\t\tif ( !overhanging && taggedOver ) {\n\t\t\telement.classList.remove('overscreen');\n\t\t}\n\t};\n\n\t/** \n\t * Live list of elements to work on\n\t * @private\n\t */\n\tvar composeJobList = function () {\n\t\tvar fullList = [baseQuery].concat(queryList);\n\t\tvar elementList = queryToArray ( fullList.join(',') );\n\t\tvar ignoreList = blackList.length \n\t\t\t? queryToArray ( blackList.join(',') )\n\t\t\t: [];\n\n\t\treturn elementList.filter ( elm => !ignoreList.includes ( elm ) );\n\t};\n\n\t/** \n\t * Loops all elements from the jobList\n\t * @private\n\t */\n\tvar changeHandler = function () {\n\t\tcomposeJobList().forEach ( function ( element ) {\n\t\t\tvar boundingRect = element.getBoundingClientRect();\n\t\t\tvar props = calculatePresence ( boundingRect );\n\t\t\tattachIdentifiers ( element, props );\n\t\t});\n\t};\n\n\twindow.addEventListener('resize', changeHandler, false);\n\twindow.addEventListener('scroll', changeHandler, true);\n\tlet DOMObserver = new MutationObserver( function ( mutationsList, observer ) {\n\t\tif ( mutationsList.length ) {\n\t\t\tchangeHandler();\n\t\t}\n\t});\n\tdocumentStaging.onInteractive([\n\t\tchangeHandler,\n\t\tfunction () {\n\t\t\tDOMObserver.observe( document.body, { childList: true, subtree: true } );\n\t\t},\n\t]);\n\n\treturn {\n\t\tpublicAPI: {\n\t\t\tcollect: collect,\n\t\t\texclude: exclude,\n\t\t\tremove: remove,\n\t\t\treset: reset\n\t\t},\n\t\ttestSuite: {\n\t\t\t/**\n\t\t\t * Current variables, for testing purposes\n\t\t\t * @private\n\t\t\t * @returns {object} current variables\n\t\t\t */\n\t\t\tgetVariables: function () {\n\t\t\t\treturn {\n\t\t\t\t\tqueryList: queryList,\n\t\t\t\t\tblackList: blackList\n\t\t\t\t};\n\t\t\t},\n\t\t\ttriggerEvent: changeHandler,\n\t\t\tmakeNodeList: composeJobList,\n\t\t\tcalculatePresence: calculatePresence,\n\t\t\ttreatElement: attachIdentifiers,\n\t\t\tcleanElements: detachIdentifiers\n\t\t}\n\t}\n})();\n\nlet onScreenness = onScreennessModule.publicAPI;\nlet onScreenTest = onScreennessModule.testSuite;\n\nexport { onScreenness, onScreenTest };\n"],"names":["roundAt","number","decimals","Number","Math","round","commaSeperatedListToArray","commaSeperatedList","split","map","item","trim","replace","filter","length","queryToArray","query","elementArray","push","apply","document","querySelectorAll","t","globalThis","window","global","self","n","exports","r","e","o","i","u","c","f","Function","a","l","Object","defineProperty","get","s","propertyIsEnumerable","p","getOwnPropertyDescriptor","y","call","1","this","enumerable","h","configurable","writable","value","d","toString","g","slice","v","S","m","TypeError","b","L","w","valueOf","O","hasOwnProperty","E","T","M","createElement","j","P","x","A","String","C","_","k","D","I","version","mode","copyright","N","G","WeakMap","V","test","F","R","random","H","z","q","W","B","K","Y","has","J","set","Q","U","Z","Nt","$","enforce","getterFor","type","tt","unsafe","noTargetGet","source","join","prototype","nt","rt","et","ceil","ot","floor","it","isNaN","ut","min","ct","ft","max","at","lt","st","pt","concat","yt","getOwnPropertyNames","ht","getOwnPropertySymbols","dt","arguments","gt","vt","St","bt","mt","wt","Lt","normalize","toLowerCase","data","NATIVE","POLYFILL","Ot","Et","Mt","Array","isArray","jt","Symbol","Pt","xt","At","Ct","constructor","_t","kt","Tt","Dt","It","forEach","Gt","target","stat","forced","sham","proto","CSSRuleList","CSSStyleDeclaration","CSSValueList","ClientRectList","DOMRectList","DOMStringList","DOMTokenList","DataTransferItemList","FileList","HTMLAllCollection","HTMLCollection","HTMLFormElement","HTMLSelectElement","MediaList","MimeTypeArray","NamedNodeMap","NodeList","PaintRequestList","Plugin","PluginArray","SVGLengthList","SVGNumberList","SVGPathSegList","SVGPointList","SVGStringList","SVGTransformList","SourceBufferList","StyleSheetList","TextTrackCueList","TextTrackList","TouchList","Vt","Ft","onInteractive","readyState","addEventListener","onComplete","baseQuery","queryList","blackList","detachIdentifiers","removeList","element","classList","remove","dataset","addQueries","currentList","newQueries","newQuery","includes","calculatePresence","boundingRect","overhang","left","right","documentElement","clientWidth","top","bottom","clientHeight","absence","width","height","horizonPresence","verticaPresence","horizonOverlap","verticaOverlap","surfaceOverlap","surfacePresence","attachIdentifiers","pp","presence","taggedOn","contains","add","taggedCross","taggedOff","overlapping","overhanging","taggedOver","composeJobList","fullList","elementList","ignoreList","elm","changeHandler","getBoundingClientRect","props","DOMObserver","MutationObserver","mutationsList","observer","documentStaging","observe","body","childList","subtree","publicAPI","collect","rawQuery","queries","exclude","splice","indexOf","reset","testSuite","getVariables","triggerEvent","makeNodeList","treatElement","cleanElements"],"mappings":"AAOA,MAAMA,EAAU,SAAUC,EAAQC,GAEjC,OAAOC,OAASC,KAAKC,MAAQJ,EAAS,IAAMC,GAAa,KAAOA,IAS3DI,EAA4B,SAAWC,GAG5C,OAFWA,EAAmBC,MAAM,KACjBC,IAAMC,GAAQA,EAAKC,OAAOC,QAAQ,OAAQ,MAC9CC,OAASH,GAChBA,EAAKI,SAURC,EAAe,SAAWC,GAG/B,IAAIC,EAAe,GAEnB,OADAA,EAAaC,KAAKC,MAAMF,EAAcG,SAASC,iBAAmBL,IAC3DC,GCrCR,IAAIK,EAAE,oBAAoBC,WAAWA,WAAW,oBAAoBC,OAAOA,OAAO,oBAAoBC,OAAOA,OAAO,oBAAoBC,KAAKA,KAAK,GAAG,SAASC,EAAEL,EAAEK,GAAG,OAAOL,EAAEK,EAAE,CAACC,QAAQ,IAAID,EAAEC,SAASD,EAAEC,QAAQ,IAAIC,EAAEC,EAAEC,EAAEC,EAAEC,EAAE,SAASC,EAAE,SAASZ,GAAG,OAAOA,GAAGA,EAAElB,MAAMA,MAAMkB,GAAGa,EAAED,SAASX,YAAYU,GAAGV,aAAaW,SAASV,QAAQS,GAAGT,SAASU,SAASR,MAAMO,GAAGP,OAAOQ,SAASZ,GAAGW,GAAGX,IAAIc,SAAS,cAATA,GAA0BC,EAAE,SAASf,GAAG,IAAI,QAAQA,IAAI,MAAMA,GAAG,OAAM,IAAKgB,GAAGD,EAAE,WAAW,OAAO,GAAGE,OAAOC,eAAe,GAAG,IAAI,CAACC,IAAI,WAAW,OAAO,KAAKJ,IAAIK,EAAE,GAAGC,qBAAqBC,EAAEL,OAAOM,yBAAyBC,EAAE,CAACX,EAAES,IAAIF,E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,IAAIU,EAAeV,EAAQ6C,wBACvBC,EAAQrC,EAAoBC,GAChCkB,EAAoB5B,EAAS8C,MAI/BlP,OAAO6L,iBAAiB,SAAUmD,GAAe,GACjDhP,OAAO6L,iBAAiB,SAAUmD,GAAe,GACjD,IAAIG,EAAc,IAAIC,iBAAkB,SAAWC,EAAeC,GAC5DD,EAAc/P,QAClB0P,MAUF,OAPAO,GAAgB5D,cAAc,CAC7BqD,EACA,WACCG,EAAYK,QAAS5P,SAAS6P,KAAM,CAAEC,WAAW,EAAMC,SAAS,OAI3D,CACNC,UAAW,CACVC,QAlLY,SAAWC,GACxB,IAAIC,EAAUjR,EAA4BgR,GAC1CtD,EAAaR,EAAW+D,IAiLvBC,QA1KY,SAAWF,GACxB,IAAIC,EAAUjR,EAA4BgR,GAC1C5D,EAAoB6D,GACpBvD,EAAaP,EAAW8D,IAwKvBzD,OAjKW,SAAWwD,GACThR,EAA4BgR,GAClC3G,QAAY3J,IACdwM,EAAUY,SAAWpN,KACzB0M,EAAoB,CAAC1M,IACrBwM,EAAUiE,OAASjE,EAAUkE,QAAU1Q,GAAS,OA6JjD2Q,MArJU,WACXjE,EAAoBF,GACpBA,EAAY,GACZC,EAAY,KAoJZmE,UAAW,CAMVC,aAAc,WACb,MAAO,CACNrE,UAAWA,EACXC,UAAWA,IAGbqE,aAActB,EACduB,aAAc5B,EACd9B,kBAAmBA,EACnB2D,aAAcxC,EACdyC,cAAevE,IAtPO,GA2Pa0D"} \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index 40fa892..036781b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).onScreenness=e()}(this,function(){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t,e){return t(e={exports:{}},e.exports),e.exports}var n,r,o,i="object",c=function(t){return t&&t.Math==Math&&t},u=c(typeof globalThis==i&&globalThis)||c(typeof window==i&&window)||c(typeof self==i&&self)||c(typeof t==i&&t)||Function("return this")(),a=function(t){try{return!!t()}catch(t){return!0}},l=!a(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),s={}.propertyIsEnumerable,f=Object.getOwnPropertyDescriptor,p={f:f&&!s.call({1:2},1)?function(t){var e=f(this,t);return!!e&&e.enumerable}:s},h=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},d={}.toString,v=function(t){return d.call(t).slice(8,-1)},g="".split,y=a(function(){return!Object("z").propertyIsEnumerable(0)})?function(t){return"String"==v(t)?g.call(t,""):Object(t)}:Object,m=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},b=function(t){return y(m(t))},S=function(t){return"object"==typeof t?null!==t:"function"==typeof t},x=function(t,e){if(!S(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!S(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!S(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!S(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},E={}.hasOwnProperty,L=function(t,e){return E.call(t,e)},w=u.document,O=S(w)&&S(w.createElement),I=function(t){return O?w.createElement(t):{}},M=!l&&!a(function(){return 7!=Object.defineProperty(I("div"),"a",{get:function(){return 7}}).a}),A=Object.getOwnPropertyDescriptor,T={f:l?A:function(t,e){if(t=b(t),e=x(e,!0),M)try{return A(t,e)}catch(t){}if(L(t,e))return h(!p.f.call(t,e),t[e])}},j=function(t){if(!S(t))throw TypeError(String(t)+" is not an object");return t},N=Object.defineProperty,P={f:l?N:function(t,e,n){if(j(t),e=x(e,!0),j(n),M)try{return N(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},_=l?function(t,e,n){return P.f(t,e,h(1,n))}:function(t,e,n){return t[e]=n,t},R=function(t,e){try{_(u,t,e)}catch(n){u[t]=e}return e},C=e(function(t){var e=u["__core-js_shared__"]||R("__core-js_shared__",{});(t.exports=function(t,n){return e[t]||(e[t]=void 0!==n?n:{})})("versions",[]).push({version:"3.1.3",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}),k=C("native-function-to-string",Function.toString),F=u.WeakMap,V="function"==typeof F&&/native code/.test(k.call(F)),G=0,z=Math.random(),D=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++G+z).toString(36))},$=C("keys"),H=function(t){return $[t]||($[t]=D(t))},W={},q=u.WeakMap;if(V){var B=new q,Y=B.get,U=B.has,X=B.set;n=function(t,e){return X.call(B,t,e),e},r=function(t){return Y.call(B,t)||{}},o=function(t){return U.call(B,t)}}else{var K=H("state");W[K]=!0,n=function(t,e){return _(t,K,e),e},r=function(t){return L(t,K)?t[K]:{}},o=function(t){return L(t,K)}}var J={set:n,get:r,has:o,enforce:function(t){return o(t)?r(t):n(t,{})},getterFor:function(t){return function(e){var n;if(!S(e)||(n=r(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},Q=e(function(t){var e=J.get,n=J.enforce,r=String(k).split("toString");C("inspectSource",function(t){return k.call(t)}),(t.exports=function(t,e,o,i){var c=!!i&&!!i.unsafe,a=!!i&&!!i.enumerable,l=!!i&&!!i.noTargetGet;"function"==typeof o&&("string"!=typeof e||L(o,"name")||_(o,"name",e),n(o).source=r.join("string"==typeof e?e:"")),t!==u?(c?!l&&t[e]&&(a=!0):delete t[e],a?t[e]=o:_(t,e,o)):a?t[e]=o:R(e,o)})(Function.prototype,"toString",function(){return"function"==typeof this&&e(this).source||k.call(this)})}),Z=Math.ceil,tt=Math.floor,et=function(t){return isNaN(t=+t)?0:(t>0?tt:Z)(t)},nt=Math.min,rt=function(t){return t>0?nt(et(t),9007199254740991):0},ot=Math.max,it=Math.min,ct=function(t,e){var n=et(t);return n<0?ot(n+e,0):it(n,e)},ut=function(t){return function(e,n,r){var o,i=b(e),c=rt(i.length),u=ct(r,c);if(t&&n!=n){for(;c>u;)if((o=i[u++])!=o)return!0}else for(;c>u;u++)if((t||u in i)&&i[u]===n)return t||u||0;return!t&&-1}},at=ut(!1),lt=function(t,e){var n,r=b(t),o=0,i=[];for(n in r)!L(W,n)&&L(r,n)&&i.push(n);for(;e.length>o;)L(r,n=e[o++])&&(~at(i,n)||i.push(n));return i},st=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ft=st.concat("length","prototype"),pt={f:Object.getOwnPropertyNames||function(t){return lt(t,ft)}},ht={f:Object.getOwnPropertySymbols},dt=u.Reflect,vt=dt&&dt.ownKeys||function(t){var e=pt.f(j(t)),n=ht.f;return n?e.concat(n(t)):e},gt=function(t,e){for(var n=vt(e),r=P.f,o=T.f,i=0;im;m++)if((u||m in d)&&(p=v(f=d[m],m,h),t))if(n)b[m]=p;else if(p)switch(t){case 3:return!0;case 5:return f;case 6:return m;case 2:b.push(f)}else if(i)return!1;return c?-1:o||i?i:b}},kt=Pt("species"),Ft=function(t){return!a(function(){var e=[];return(e.constructor={})[kt]=function(){return{foo:1}},1!==e[t](Boolean).foo})},Vt=Ct(2);Ot({target:"Array",proto:!0,forced:!Ft("filter")},{filter:function(t){return Vt(this,t,arguments[1])}});var Gt=function(t,e){var n=[][t];return!n||!a(function(){n.call(null,e||function(){throw 1},1)})},zt=Ct(0),Dt=Gt("forEach")?function(t){return zt(this,t,arguments[1])}:[].forEach;Ot({target:"Array",proto:!0,forced:[].forEach!=Dt},{forEach:Dt});var $t=Object.keys||function(t){return lt(t,st)},Ht=l?Object.defineProperties:function(t,e){j(t);for(var n,r=$t(e),o=r.length,i=0;o>i;)P.f(t,n=r[i++],e[n]);return t},Wt=u.document,qt=Wt&&Wt.documentElement,Bt=H("IE_PROTO"),Yt=function(){},Ut=function(){var t,e=I("iframe"),n=st.length;for(e.style.display="none",qt.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write("