Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

zoom.ts

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zoom.ts - npm Package Compare versions

Comparing version 7.3.0 to 7.3.1

4

dist/zoom.js
/*!
* zoom.ts v7.3.0
* zoom.ts v7.3.1
* https://www.michael-bull.com/projects/zoom.ts

@@ -8,2 +8,2 @@ *

*/
!function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="dist/",t(t.s=11)}([function(e,t,n){"use strict";function i(e,t,n,i,o){var r=e[i],s=e[o];return"function"==typeof r?(r.call(e,t,n),!0):"function"==typeof s&&(s.call(e,"on"+t,n),!0)}function o(e){if("function"==typeof Event)return new Event(e);var t=document.createEvent("Event");return t.initEvent(e,!1,!1),t}function r(e,t,n){i(e,t,n,"addEventListener","attachEvent")||a(t,n)}function s(e,t,n){i(e,t,n,"removeEventListener","detachEvent")}function a(e,t){t(o(e))}Object.defineProperty(t,"__esModule",{value:!0}),t.addEventListener=r,t.removeEventListener=s,t.fireEventListener=a},function(e,t,n){"use strict";function i(e,t){if("complete"===e.readyState)return t();l.addEventListener(e,"DOMContentLoaded",function(){return t()})}function o(e){return(e.documentElement||e.body).clientWidth}function r(e){return(e.documentElement||e.body).clientHeight}function s(e,t){return void 0===e.pageYOffset?(t.documentElement||t.body).scrollTop:e.pageYOffset}function a(e){var t=document.createElement("div");return t.className=e,t}function c(e){var t=document.createElement("img");return t.className="zoom__clone",t.src=e,t}Object.defineProperty(t,"__esModule",{value:!0});var l=n(0);t.ready=i,t.viewportWidth=o,t.viewportHeight=r,t.pageScrollY=s,t.createDiv=a,t.createClone=c},function(e,t,n){"use strict";function i(e){var n,i,o,r=[e],s=""+e.charAt(0).toUpperCase()+e.substr(1);for(n=0,i=t.vendorPrefixes;n<i.length;n++)o=i[n],r.push(""+o+s);return r}function o(e,t){var n,o,r;for(n=0,o=i(t);n<o.length;n++)if(r=o[n],r in e.style)return r;return null}Object.defineProperty(t,"__esModule",{value:!0}),t.vendorPrefixes=["Webkit","Moz","ms","O"],t.vendorProperties=i,t.vendorProperty=o},function(e,t,n){"use strict";function i(e){D=e.cloneNode(!0),B=O.createDiv("zoom__container"),B.appendChild(D),A.replaceChild(B,e)}function o(e,t){J=!0,D=t,B=e,W=B.children.item(1)}function r(){a(),c(),b(),_(),E(),u()}function s(){J=!1,d(),x(),w(),m(),l()}function a(){H=+(A.getAttribute("data-width")||1/0),I=+(A.getAttribute("data-height")||1/0)}function c(){A.style.height=D.height+"px"}function l(){A.style.height=""}function u(){V=O.pageScrollY(window,document),T.addEventListener(window,"resize",q),T.addEventListener(window,"scroll",Q),T.addEventListener(document,"keyup",X),T.addEventListener(B,"click",$)}function d(){T.removeEventListener(window,"resize",q),T.removeEventListener(window,"scroll",Q),T.removeEventListener(document,"keyup",X),T.removeEventListener(B,"click",$)}function f(e){W=O.createClone(e),T.addEventListener(W,"load",ee),B.appendChild(W)}function p(){M.addClass(D,"zoom__element--hidden"),M.addClass(W,"zoom__clone--visible")}function m(){M.removeClass(D,"zoom__element--hidden"),M.removeClass(W,"zoom__clone--visible")}function v(){B.style.transition="initial",h(),M.repaint(B),B.style.transition=""}function h(){var e,t,n,i,o=O.viewportWidth(document),r=O.viewportHeight(document),s=Math.min(o,H)/Y.width,a=Math.min(r,I)/Y.height,c=Math.min(s,a),l=Y.width*c,u=Y.height*c,d=(o-l)/2,f=(r-u)/2,p=B.style;"expanding"===F||"collapsing"===F?(e=Y.left+(Y.width-l)/2,t=Y.top+(Y.height-u)/2,n=(d-e)/c,i=(f-t)/c,p[G]="scale("+c+") "+N.translate(n,i,K)):(p[G]="",p.left=d-Y.left+"px",p.top=f-Y.top+"px",p.width=l+"px",p.maxWidth=l+"px",p.height=u+"px")}function y(){var e=B.style;e[G]="",e.left="",e.top="",e.width="",e.maxWidth="",e.height=""}function b(){document.body.appendChild(R)}function g(){document.body.removeChild(R)}function _(){M.repaint(R),M.addClass(R,"zoom__overlay--visible")}function w(){M.removeClass(R,"zoom__overlay--visible"),j.removeTransitionEndListener(B,te)}function E(){F="expanding",Y=A.getBoundingClientRect(),L(),j.addTransitionEndListener(B,te),h()}function x(){F="collapsing",j.addTransitionEndListener(B,ne),v(),y()}function L(){M.addClass(A,"zoom--active"),M.addClass(D,"zoom__element--active")}function z(){M.removeClass(A,"zoom--active"),M.removeClass(D,"zoom__element--active")}function C(){T.addEventListener(document.body,"click",Z)}function k(){T.removeEventListener(document.body,"click",Z)}var O,M,T,j,N,P,S,U,R,A,B,D,W,Y,H,I,G,K,F,J,V,q,Q,X,Z,$,ee,te,ne;Object.defineProperty(t,"__esModule",{value:!0}),O=n(1),M=n(5),T=n(0),j=n(6),N=n(7),P=n(2),S=27,U=50,R=O.createDiv("zoom__overlay"),F="collapsed",J=!1,q=function(){V=O.pageScrollY(window,document),Y=A.getBoundingClientRect(),h()},Q=function(){Math.abs(V-O.pageScrollY(window,document))>U&&s()},X=function(e){e.keyCode===S&&s()},Z=function(e){var t,n,s,a,c,l=e.target;if(l instanceof HTMLImageElement&&M.hasClass(l,"zoom__element")){if(t=l.parentElement,null===t)return;if(n=t.parentElement,null===n)return;e.preventDefault(),s=M.hasClass(t,"zoom__container"),a=s?n:t,c=M.srcAttribute(a,l),void 0===G&&(G=P.vendorProperty(document.body,"transform")),null===G||e.metaKey||e.ctrlKey?window.open(c,"_blank"):(k(),void 0===K&&null!==G&&(K=N.hasTranslate3d(document.body,G)),A=a,s?o(t,l):(i(l),f(c)),r())}},$=function(){s()},ee=function(){T.removeEventListener(W,"load",ee),J=!0,"expanded"===F&&p()},te=function(){F="expanded",j.removeTransitionEndListener(B,te),v(),J&&p()},ne=function(){F="collapsed",j.removeTransitionEndListener(B,ne),g(),z(),C()},t.startListening=C,t.stopListening=k},function(e,t,n){var i=n(8);"string"==typeof i&&(i=[[e.i,i,""]]),n(10)(i,{}),i.locals&&(e.exports=i.locals)},function(e,t,n){"use strict";function i(e){e.offsetHeight}function o(e,t){var n=e.getAttribute("data-src");return null!==n?n:t.src}function r(e,t){return e.className.indexOf(t)!==-1}function s(e,t){0===e.className.length?e.className=t:e.className+=" "+t}function a(e,t){var n,i=e.className;i.indexOf(" ")!==-1?(n=i.split(" "),n.splice(n.indexOf(t),1),e.className=n.join(" ")):i===t&&(e.className="")}Object.defineProperty(t,"__esModule",{value:!0}),t.repaint=i,t.srcAttribute=o,t.hasClass=r,t.addClass=s,t.removeClass=a},function(e,t,n){"use strict";function i(e){var t,n,i,o;return void 0!==window.getComputedStyle&&(t=a.vendorProperty(e,"transitionDuration"),null!==t&&(n=window.getComputedStyle(e),i=n[t],!(i.length<1)&&(o=parseFloat(i),!isNaN(o)&&0!==o)))}function o(e,t){var n,o,r;if(i(e))for(n=0,o=c;n<o.length;n++)r=o[n],s.addEventListener(e,r,t);else s.fireEventListener(c[0],t)}function r(e,t){var n,i,o;for(n=0,i=c;n<i.length;n++)o=i[n],s.removeEventListener(e,o,t)}var s,a,c,l,u,d;for(Object.defineProperty(t,"__esModule",{value:!0}),s=n(0),a=n(2),c=["transitionend"],l=0,u=a.vendorPrefixes;l<u.length;l++)d=u[l],c.push(d+"TransitionEnd");t.hasTransitions=i,t.addTransitionEndListener=o,t.removeTransitionEndListener=r},function(e,t,n){"use strict";function i(e,t,n){return n?"translate3d("+e+"px, "+t+"px, 0)":"translate("+e+"px, "+t+"px)"}function o(e,t){var n,i,o,r,s;return void 0!==window.getComputedStyle&&(n={WebkitTransform:"-webkit-transform",MozTransform:"-moz-transform",msTransform:"-ms-transform",OTransform:"-o-transform",transform:"transform"},t in n&&(i=document.createElement("div"),o=i.style,o[t]="translate3d(1px,1px,1px)",e.insertBefore(i,null),r=window.getComputedStyle(i),s=r.getPropertyValue(n[t]),e.removeChild(i),s.length>0&&"none"!==s))}Object.defineProperty(t,"__esModule",{value:!0}),t.translate=i,t.hasTranslate3d=o},function(e,t,n){t=e.exports=n(9)(),t.push([e.i,'.zoom{display:block;position:relative;width:100%;line-height:0;text-align:center}.zoom--active{z-index:2}.zoom__container{position:relative;-webkit-transition:-webkit-transform .3s cubic-bezier(.2,0,.2,1);transition:-webkit-transform .3s cubic-bezier(.2,0,.2,1);transition:transform .3s cubic-bezier(.2,0,.2,1);transition:transform .3s cubic-bezier(.2,0,.2,1),-webkit-transform .3s cubic-bezier(.2,0,.2,1);will-change:transform}.zoom__element{visibility:visible;opacity:1;-webkit-transition:visibility 0s linear 0s,opacity .4s 0s;transition:visibility 0s linear 0s,opacity .4s 0s;will-change:visibility,opacity;max-width:100%;cursor:pointer;cursor:-moz-zoom-in;cursor:-webkit-zoom-in}.zoom__element--active{width:100%}.zoom__clone,.zoom__element--hidden{visibility:hidden;opacity:0;-webkit-transition:visibility 0s linear .5s,opacity .1s .4s;transition:visibility 0s linear .5s,opacity .1s .4s}.zoom__clone{will-change:visibility,opacity;position:absolute;top:0;right:0;bottom:0;left:0;width:100%;cursor:pointer;cursor:-moz-zoom-out;cursor:-webkit-zoom-out}.zoom__clone--visible{visibility:visible;opacity:1;-webkit-transition:visibility 0s linear 0s,opacity .4s 0s;transition:visibility 0s linear 0s,opacity .4s 0s}.zoom__overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1;background:#fff;opacity:0;filter:"alpha(opacity=0)";-webkit-transition:opacity .3s;transition:opacity .3s;will-change:opacity,filter}.zoom__overlay--visible{opacity:1;filter:"alpha(opacity=100)"}',""])},function(e,t){e.exports=function(){var e=[];return e.toString=function(){var e,t,n=[];for(e=0;e<this.length;e++)t=this[e],t[2]?n.push("@media "+t[2]+"{"+t[1]+"}"):n.push(t[1]);return n.join("")},e.i=function(t,n){var i,o,r,s;for("string"==typeof t&&(t=[[null,t,""]]),i={},o=0;o<this.length;o++)r=this[o][0],"number"==typeof r&&(i[r]=!0);for(o=0;o<t.length;o++)s=t[o],"number"==typeof s[0]&&i[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]="("+s[2]+") and ("+n+")"),e.push(s))},e}},function(e,t){function n(e,t){var n,i,o,r,s;for(n=0;n<e.length;n++)if(i=e[n],o=p[i.id]){for(o.refs++,r=0;r<o.parts.length;r++)o.parts[r](i.parts[r]);for(;r<i.parts.length;r++)o.parts.push(c(i.parts[r],t))}else{for(s=[],r=0;r<i.parts.length;r++)s.push(c(i.parts[r],t));p[i.id]={id:i.id,refs:1,parts:s}}}function i(e){var t,n,i,o,r,s,a,c=[],l={};for(t=0;t<e.length;t++)n=e[t],i=n[0],o=n[1],r=n[2],s=n[3],a={css:o,media:r,sourceMap:s},l[i]?l[i].parts.push(a):c.push(l[i]={id:i,parts:[a]});return c}function o(e,t){var n=h(),i=g[g.length-1];if("top"===e.insertAt)i?i.nextSibling?n.insertBefore(t,i.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),g.push(t);else{if("bottom"!==e.insertAt)throw Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");n.appendChild(t)}}function r(e){e.parentNode.removeChild(e);var t=g.indexOf(e);t>=0&&g.splice(t,1)}function s(e){var t=document.createElement("style");return t.type="text/css",o(e,t),t}function a(e){var t=document.createElement("link");return t.rel="stylesheet",o(e,t),t}function c(e,t){var n,i,o,c;return t.singleton?(c=b++,n=y||(y=s(t)),i=l.bind(null,n,c,!1),o=l.bind(null,n,c,!0)):e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=a(t),i=d.bind(null,n),o=function(){r(n),n.href&&URL.revokeObjectURL(n.href)}):(n=s(t),i=u.bind(null,n),o=function(){r(n)}),i(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;i(e=t)}else o()}}function l(e,t,n,i){var o,r,s=n?"":i.css;e.styleSheet?e.styleSheet.cssText=f(t,s):(o=document.createTextNode(s),r=e.childNodes,r[t]&&e.removeChild(r[t]),r.length?e.insertBefore(o,r[t]):e.appendChild(o))}function u(e,t){var n=t.css,i=t.media;if(i&&e.setAttribute("media",i),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function d(e,t){var n,i,o=t.css,r=t.sourceMap;r&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */"),n=new Blob([o],{type:"text/css"}),i=e.href,e.href=URL.createObjectURL(n),i&&URL.revokeObjectURL(i)}var f,p={},m=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}},v=m(function(){return/msie [6-9]\b/.test(self.navigator.userAgent.toLowerCase())}),h=m(function(){return document.head||document.getElementsByTagName("head")[0]}),y=null,b=0,g=[];e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw Error("The style-loader cannot be used in a non-browser environment");t=t||{},void 0===t.singleton&&(t.singleton=v()),void 0===t.insertAt&&(t.insertAt="bottom");var o=i(e);return n(o,t),function(e){var r,s,a,c,l,u=[];for(r=0;r<o.length;r++)s=o[r],a=p[s.id],a.refs--,u.push(a);for(e&&(c=i(e),n(c,t)),r=0;r<u.length;r++)if(a=u[r],0===a.refs){for(l=0;l<a.parts.length;l++)a.parts[l]();delete p[a.id]}}},f=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}()},function(e,t,n){"use strict";var i,o;Object.defineProperty(t,"__esModule",{value:!0}),n(4),i=n(1),o=n(3),i.ready(document,function(){return o.startListening()})}]);
!function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="dist/",t(t.s=11)}([function(e,t,n){"use strict";function i(e,t,n,i,o){var r=e[i],s=e[o];return"function"==typeof r?(r.call(e,t,n),!0):"function"==typeof s&&(s.call(e,"on"+t,n),!0)}function o(e){if("function"==typeof Event)return new Event(e);var t=document.createEvent("Event");return t.initEvent(e,!1,!1),t}function r(e,t,n){i(e,t,n,"addEventListener","attachEvent")||a(t,n)}function s(e,t,n){i(e,t,n,"removeEventListener","detachEvent")}function a(e,t){t(o(e))}Object.defineProperty(t,"__esModule",{value:!0}),t.addEventListener=r,t.removeEventListener=s,t.fireEventListener=a},function(e,t,n){"use strict";function i(e,t){var n=e.readyState;if("interactive"===n||"complete"===n)return t();l.addEventListener(e,"DOMContentLoaded",function(){return t()})}function o(e){return(e.documentElement||e.body).clientWidth}function r(e){return(e.documentElement||e.body).clientHeight}function s(e,t){return void 0===e.pageYOffset?(t.documentElement||t.body).scrollTop:e.pageYOffset}function a(e){var t=document.createElement("div");return t.className=e,t}function c(e){var t=document.createElement("img");return t.className="zoom__clone",t.src=e,t}Object.defineProperty(t,"__esModule",{value:!0});var l=n(0);t.ready=i,t.viewportWidth=o,t.viewportHeight=r,t.pageScrollY=s,t.createDiv=a,t.createClone=c},function(e,t,n){"use strict";function i(e){var n,i,o,r=[e],s=""+e.charAt(0).toUpperCase()+e.substr(1);for(n=0,i=t.vendorPrefixes;n<i.length;n++)o=i[n],r.push(""+o+s);return r}function o(e,t){var n,o,r;for(n=0,o=i(t);n<o.length;n++)if(r=o[n],r in e.style)return r;return null}Object.defineProperty(t,"__esModule",{value:!0}),t.vendorPrefixes=["Webkit","Moz","ms","O"],t.vendorProperties=i,t.vendorProperty=o},function(e,t,n){"use strict";function i(e){D=e.cloneNode(!0),B=O.createDiv("zoom__container"),B.appendChild(D),A.replaceChild(B,e)}function o(e,t){J=!0,D=t,B=e,W=B.children.item(1)}function r(){a(),c(),b(),_(),E(),u()}function s(){J=!1,d(),x(),w(),m(),l()}function a(){H=+(A.getAttribute("data-width")||1/0),I=+(A.getAttribute("data-height")||1/0)}function c(){A.style.height=D.height+"px"}function l(){A.style.height=""}function u(){V=O.pageScrollY(window,document),T.addEventListener(window,"resize",q),T.addEventListener(window,"scroll",Q),T.addEventListener(document,"keyup",X),T.addEventListener(B,"click",$)}function d(){T.removeEventListener(window,"resize",q),T.removeEventListener(window,"scroll",Q),T.removeEventListener(document,"keyup",X),T.removeEventListener(B,"click",$)}function f(e){W=O.createClone(e),T.addEventListener(W,"load",ee),B.appendChild(W)}function p(){M.addClass(D,"zoom__element--hidden"),M.addClass(W,"zoom__clone--visible")}function m(){M.removeClass(D,"zoom__element--hidden"),M.removeClass(W,"zoom__clone--visible")}function v(){B.style.transition="initial",h(),M.repaint(B),B.style.transition=""}function h(){var e,t,n,i,o=O.viewportWidth(document),r=O.viewportHeight(document),s=Math.min(o,H)/Y.width,a=Math.min(r,I)/Y.height,c=Math.min(s,a),l=Y.width*c,u=Y.height*c,d=(o-l)/2,f=(r-u)/2,p=B.style;"expanding"===F||"collapsing"===F?(e=Y.left+(Y.width-l)/2,t=Y.top+(Y.height-u)/2,n=(d-e)/c,i=(f-t)/c,p[G]="scale("+c+") "+N.translate(n,i,K)):(p[G]="",p.left=d-Y.left+"px",p.top=f-Y.top+"px",p.width=l+"px",p.maxWidth=l+"px",p.height=u+"px")}function y(){var e=B.style;e[G]="",e.left="",e.top="",e.width="",e.maxWidth="",e.height=""}function b(){document.body.appendChild(R)}function g(){document.body.removeChild(R)}function _(){M.repaint(R),M.addClass(R,"zoom__overlay--visible")}function w(){M.removeClass(R,"zoom__overlay--visible"),j.removeTransitionEndListener(B,te)}function E(){F="expanding",Y=A.getBoundingClientRect(),L(),j.addTransitionEndListener(B,te),h()}function x(){F="collapsing",j.addTransitionEndListener(B,ne),v(),y()}function L(){M.addClass(A,"zoom--active"),M.addClass(D,"zoom__element--active")}function z(){M.removeClass(A,"zoom--active"),M.removeClass(D,"zoom__element--active")}function C(){T.addEventListener(document.body,"click",Z)}function k(){T.removeEventListener(document.body,"click",Z)}var O,M,T,j,N,P,S,U,R,A,B,D,W,Y,H,I,G,K,F,J,V,q,Q,X,Z,$,ee,te,ne;Object.defineProperty(t,"__esModule",{value:!0}),O=n(1),M=n(5),T=n(0),j=n(6),N=n(7),P=n(2),S=27,U=50,R=O.createDiv("zoom__overlay"),F="collapsed",J=!1,q=function(){V=O.pageScrollY(window,document),Y=A.getBoundingClientRect(),h()},Q=function(){Math.abs(V-O.pageScrollY(window,document))>U&&s()},X=function(e){e.keyCode===S&&s()},Z=function(e){var t,n,s,a,c,l=e.target;if(l instanceof HTMLImageElement&&M.hasClass(l,"zoom__element")){if(t=l.parentElement,null===t)return;if(n=t.parentElement,null===n)return;e.preventDefault(),s=M.hasClass(t,"zoom__container"),a=s?n:t,c=M.srcAttribute(a,l),void 0===G&&(G=P.vendorProperty(document.body,"transform")),null===G||e.metaKey||e.ctrlKey?window.open(c,"_blank"):(k(),void 0===K&&null!==G&&(K=N.hasTranslate3d(document.body,G)),A=a,s?o(t,l):(i(l),f(c)),r())}},$=function(){s()},ee=function(){T.removeEventListener(W,"load",ee),J=!0,"expanded"===F&&p()},te=function(){F="expanded",j.removeTransitionEndListener(B,te),v(),J&&p()},ne=function(){F="collapsed",j.removeTransitionEndListener(B,ne),g(),z(),C()},t.startListening=C,t.stopListening=k},function(e,t,n){var i=n(8);"string"==typeof i&&(i=[[e.i,i,""]]),n(10)(i,{}),i.locals&&(e.exports=i.locals)},function(e,t,n){"use strict";function i(e){e.offsetHeight}function o(e,t){var n=e.getAttribute("data-src");return null!==n?n:t.src}function r(e,t){return e.className.indexOf(t)!==-1}function s(e,t){0===e.className.length?e.className=t:e.className+=" "+t}function a(e,t){var n,i=e.className;i.indexOf(" ")!==-1?(n=i.split(" "),n.splice(n.indexOf(t),1),e.className=n.join(" ")):i===t&&(e.className="")}Object.defineProperty(t,"__esModule",{value:!0}),t.repaint=i,t.srcAttribute=o,t.hasClass=r,t.addClass=s,t.removeClass=a},function(e,t,n){"use strict";function i(e){var t,n,i,o;return void 0!==window.getComputedStyle&&(t=a.vendorProperty(e,"transitionDuration"),null!==t&&(n=window.getComputedStyle(e),i=n[t],!(i.length<1)&&(o=parseFloat(i),!isNaN(o)&&0!==o)))}function o(e,t){var n,o,r;if(i(e))for(n=0,o=c;n<o.length;n++)r=o[n],s.addEventListener(e,r,t);else s.fireEventListener(c[0],t)}function r(e,t){var n,i,o;for(n=0,i=c;n<i.length;n++)o=i[n],s.removeEventListener(e,o,t)}var s,a,c,l,u,d;for(Object.defineProperty(t,"__esModule",{value:!0}),s=n(0),a=n(2),c=["transitionend"],l=0,u=a.vendorPrefixes;l<u.length;l++)d=u[l],c.push(d+"TransitionEnd");t.hasTransitions=i,t.addTransitionEndListener=o,t.removeTransitionEndListener=r},function(e,t,n){"use strict";function i(e,t,n){return n?"translate3d("+e+"px, "+t+"px, 0)":"translate("+e+"px, "+t+"px)"}function o(e,t){var n,i,o,r,s;return void 0!==window.getComputedStyle&&(n={WebkitTransform:"-webkit-transform",MozTransform:"-moz-transform",msTransform:"-ms-transform",OTransform:"-o-transform",transform:"transform"},t in n&&(i=document.createElement("div"),o=i.style,o[t]="translate3d(1px,1px,1px)",e.insertBefore(i,null),r=window.getComputedStyle(i),s=r.getPropertyValue(n[t]),e.removeChild(i),s.length>0&&"none"!==s))}Object.defineProperty(t,"__esModule",{value:!0}),t.translate=i,t.hasTranslate3d=o},function(e,t,n){t=e.exports=n(9)(),t.push([e.i,'.zoom{display:block;position:relative;width:100%;line-height:0;text-align:center}.zoom--active{z-index:2}.zoom__container{position:relative;-webkit-transition:-webkit-transform .3s cubic-bezier(.2,0,.2,1);transition:-webkit-transform .3s cubic-bezier(.2,0,.2,1);transition:transform .3s cubic-bezier(.2,0,.2,1);transition:transform .3s cubic-bezier(.2,0,.2,1),-webkit-transform .3s cubic-bezier(.2,0,.2,1);will-change:transform}.zoom__element{visibility:visible;opacity:1;-webkit-transition:visibility 0s linear 0s,opacity .4s 0s;transition:visibility 0s linear 0s,opacity .4s 0s;will-change:visibility,opacity;max-width:100%;cursor:pointer;cursor:-moz-zoom-in;cursor:-webkit-zoom-in}.zoom__element--active{width:100%}.zoom__clone,.zoom__element--hidden{visibility:hidden;opacity:0;-webkit-transition:visibility 0s linear .5s,opacity .1s .4s;transition:visibility 0s linear .5s,opacity .1s .4s}.zoom__clone{will-change:visibility,opacity;position:absolute;top:0;right:0;bottom:0;left:0;width:100%;cursor:pointer;cursor:-moz-zoom-out;cursor:-webkit-zoom-out}.zoom__clone--visible{visibility:visible;opacity:1;-webkit-transition:visibility 0s linear 0s,opacity .4s 0s;transition:visibility 0s linear 0s,opacity .4s 0s}.zoom__overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1;background:#fff;opacity:0;filter:"alpha(opacity=0)";-webkit-transition:opacity .3s;transition:opacity .3s;will-change:opacity,filter}.zoom__overlay--visible{opacity:1;filter:"alpha(opacity=100)"}',""])},function(e,t){e.exports=function(){var e=[];return e.toString=function(){var e,t,n=[];for(e=0;e<this.length;e++)t=this[e],t[2]?n.push("@media "+t[2]+"{"+t[1]+"}"):n.push(t[1]);return n.join("")},e.i=function(t,n){var i,o,r,s;for("string"==typeof t&&(t=[[null,t,""]]),i={},o=0;o<this.length;o++)r=this[o][0],"number"==typeof r&&(i[r]=!0);for(o=0;o<t.length;o++)s=t[o],"number"==typeof s[0]&&i[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]="("+s[2]+") and ("+n+")"),e.push(s))},e}},function(e,t){function n(e,t){var n,i,o,r,s;for(n=0;n<e.length;n++)if(i=e[n],o=p[i.id]){for(o.refs++,r=0;r<o.parts.length;r++)o.parts[r](i.parts[r]);for(;r<i.parts.length;r++)o.parts.push(c(i.parts[r],t))}else{for(s=[],r=0;r<i.parts.length;r++)s.push(c(i.parts[r],t));p[i.id]={id:i.id,refs:1,parts:s}}}function i(e){var t,n,i,o,r,s,a,c=[],l={};for(t=0;t<e.length;t++)n=e[t],i=n[0],o=n[1],r=n[2],s=n[3],a={css:o,media:r,sourceMap:s},l[i]?l[i].parts.push(a):c.push(l[i]={id:i,parts:[a]});return c}function o(e,t){var n=h(),i=g[g.length-1];if("top"===e.insertAt)i?i.nextSibling?n.insertBefore(t,i.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),g.push(t);else{if("bottom"!==e.insertAt)throw Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");n.appendChild(t)}}function r(e){e.parentNode.removeChild(e);var t=g.indexOf(e);t>=0&&g.splice(t,1)}function s(e){var t=document.createElement("style");return t.type="text/css",o(e,t),t}function a(e){var t=document.createElement("link");return t.rel="stylesheet",o(e,t),t}function c(e,t){var n,i,o,c;return t.singleton?(c=b++,n=y||(y=s(t)),i=l.bind(null,n,c,!1),o=l.bind(null,n,c,!0)):e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=a(t),i=d.bind(null,n),o=function(){r(n),n.href&&URL.revokeObjectURL(n.href)}):(n=s(t),i=u.bind(null,n),o=function(){r(n)}),i(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;i(e=t)}else o()}}function l(e,t,n,i){var o,r,s=n?"":i.css;e.styleSheet?e.styleSheet.cssText=f(t,s):(o=document.createTextNode(s),r=e.childNodes,r[t]&&e.removeChild(r[t]),r.length?e.insertBefore(o,r[t]):e.appendChild(o))}function u(e,t){var n=t.css,i=t.media;if(i&&e.setAttribute("media",i),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function d(e,t){var n,i,o=t.css,r=t.sourceMap;r&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */"),n=new Blob([o],{type:"text/css"}),i=e.href,e.href=URL.createObjectURL(n),i&&URL.revokeObjectURL(i)}var f,p={},m=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}},v=m(function(){return/msie [6-9]\b/.test(self.navigator.userAgent.toLowerCase())}),h=m(function(){return document.head||document.getElementsByTagName("head")[0]}),y=null,b=0,g=[];e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw Error("The style-loader cannot be used in a non-browser environment");t=t||{},void 0===t.singleton&&(t.singleton=v()),void 0===t.insertAt&&(t.insertAt="bottom");var o=i(e);return n(o,t),function(e){var r,s,a,c,l,u=[];for(r=0;r<o.length;r++)s=o[r],a=p[s.id],a.refs--,u.push(a);for(e&&(c=i(e),n(c,t)),r=0;r<u.length;r++)if(a=u[r],0===a.refs){for(l=0;l<a.parts.length;l++)a.parts[l]();delete p[a.id]}}},f=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}()},function(e,t,n){"use strict";var i,o;Object.defineProperty(t,"__esModule",{value:!0}),n(4),i=n(1),o=n(3),i.ready(document,function(){return o.startListening()})}]);

@@ -11,3 +11,5 @@ import { addEventListener } from './Events';

export function ready(document: Document, callback: Function): any {
if (document.readyState === 'complete') {
let state: string = document.readyState;
if (state === 'interactive' || state === 'complete') {
return callback();

@@ -14,0 +16,0 @@ } else {

{
"name": "zoom.ts",
"version": "7.3.0",
"version": "7.3.1",
"description": "A lightweight TypeScript library for image zooming, as seen on Medium.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -11,3 +11,3 @@ import {

describe('ready', () => {
it('should execute the callback immediately if the document is ready', () => {
it('should execute the callback immediately if document.readyState is complete', () => {
let document: any = {

@@ -25,2 +25,15 @@ readyState: 'complete',

it('should execute the callback immediately if document.readyState is interactive', () => {
let document: any = {
readyState: 'complete',
addEventListener: jasmine.createSpy('EventListener')
};
let callback: jasmine.Spy = jasmine.createSpy('Function');
ready(document, callback);
expect(callback).toHaveBeenCalled();
expect(document.addEventListener).toHaveBeenCalledTimes(0);
});
it('should add an event listener for the DOMContentLoaded event if the document is not ready', () => {

@@ -27,0 +40,0 @@ let document: any = {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc