mirror of https://gitee.com/zhang_1334717033/kiftd
10 lines
28 KiB
JavaScript
10 lines
28 KiB
JavaScript
|
|
/*!
|
||
|
|
* Viewer.js v1.0.1
|
||
|
|
* https://fengyuanchen.github.io/viewerjs
|
||
|
|
*
|
||
|
|
* Copyright 2015-present Chen Fengyuan
|
||
|
|
* Released under the MIT license
|
||
|
|
*
|
||
|
|
* Date: 2018-05-20T09:43:46.347Z
|
||
|
|
*/
|
||
|
|
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):t.Viewer=i()}(this,function(){"use strict";var n={inline:!1,button:!0,navbar:!0,title:!0,toolbar:!0,tooltip:!0,movable:!0,zoomable:!0,rotatable:!0,scalable:!0,transition:!0,fullscreen:!0,interval:5e3,keyboard:!0,backdrop:!0,loading:!0,loop:!0,minWidth:200,minHeight:100,zoomRatio:.1,minZoomRatio:.01,maxZoomRatio:100,zIndex:2015,zIndexInline:0,url:"src",container:"body",filter:null,ready:null,show:null,shown:null,hide:null,hidden:null,view:null,viewed:null},s="undefined"!=typeof window,o=s?window:{},p="viewer",d="move",c="switch",u="zoom",m=p+"-active",w=p+"-fade",b=p+"-fixed",a=p+"-fullscreen-exit",y=p+"-hide",f=p+"-in",x=p+"-invisible",v=p+"-loading",i=p+"-open",g=p+"-show",D=p+"-transition",z="ready",r="show",e="shown",h="hide",l="hidden",k="view",E="viewed",S="click",I="dragstart",T="keydown",L="load",C=o.PointerEvent?"pointerdown":"touchstart mousedown",M=o.PointerEvent?"pointermove":"touchmove mousemove",N=o.PointerEvent?"pointerup pointercancel":"touchend touchcancel mouseup",Y="resize",X="transitionend",R="wheel mousewheel DOMMouseScroll",q=p+"Action",F=["zoom-in","zoom-out","one-to-one","reset","prev","play","next","rotate-left","rotate-right","flip-horizontal","flip-vertical"],O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t=function(){function n(t,i){for(var e=0;e<i.length;e++){var n=i[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(t,i,e){return i&&n(t.prototype,i),e&&n(t,e),t}}();function W(t){return"string"==typeof t}var P=Number.isNaN||o.isNaN;function A(t){return"number"==typeof t&&!P(t)}function H(t){return void 0===t}function j(t){return"object"===(void 0===t?"undefined":O(t))&&null!==t}var B=Object.prototype.hasOwnProperty;function V(t){if(!j(t))return!1;try{var i=t.constructor,e=i.prototype;return i&&e&&B.call(e,"isPrototypeOf")}catch(t){return!1}}function K(t){return"function"==typeof t}function U(i,e){if(i&&K(e))if(Array.isArray(i)||A(i.length)){var t=i.length,n=void 0;for(n=0;n<t&&!1!==e.call(i,i[n],n,i);n+=1);}else j(i)&&Object.keys(i).forEach(function(t){e.call(i,i[t],t,i)});return i}var Z=Object.assign||function(e){for(var t=arguments.length,i=Array(1<t?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return j(e)&&0<i.length&&i.forEach(function(i){j(i)&&Object.keys(i).forEach(function(t){e[t]=i[t]})}),e},$=/^(?:width|height|left|top|marginLeft|marginTop)$/;function _(t,i){var e=t.style;U(i,function(t,i){$.test(i)&&A(t)&&(t+="px"),e[i]=t})}function G(t,i){return t.classList?t.classList.contains(i):-1<t.className.indexOf(i)}function J(t,i){if(i)if(A(t.length))U(t,function(t){J(t,i)});else if(t.classList)t.classList.add(i);else{var e=t.className.trim();e?e.indexOf(i)<0&&(t.className=e+" "+i):t.className=i}}function Q(t,i){i&&(A(t.length)?U(t,function(t){Q(t,i)}):t.classList?t.classList.remove(i):0<=t.className.indexOf(i)&&(t.className=t.className.replace(i,"")))}function tt(t,i,e){i&&(A(t.length)?U(t,function(t){tt(t,i,e)}):e?J(t,i):Q(t,i))}var it=/([a-z\d])([A-Z])/g;function et(t){return t.replace(it,"$1-$2").toLowerCase()}function nt(t,i){return j(t[i])?t[i]:t.dataset?t.dataset[i]:t.getAttribute("data-"+et(i))}function st(t,i,e){j(e)?t[i]=e:t.dataset?t.dataset[i]=e:t.setAttribute("data-"+et(i),e)}var ot=/\s\s*/,at=function(){var t=!1;if(s){var i=!1,e=function(){},n=Object.defineProperty({},"once",{get:function(){return t=!0,i},set:function(t){i=t}});o.addEventListener("test",e,n),o.removeEventListener("test",e,n)}return t}();function rt(e,t,n){var s=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},o=n;t.trim().split(ot).forEach(function(t){if(!at){var i=e.listeners;i&&i[t]&&i[t][n]&&(o=i[t][n],delete i[t][n],0===Object.keys(i[t]).length&&delete i[t],0===Object.keys(i).length&&delete e.listeners)}e.removeEventListener(t,o,s)})}funct
|