From d9b8a7f5f9694a56d1ee4985cf7cc064ddf93c47 Mon Sep 17 00:00:00 2001 From: gdh1995 Date: Tue, 12 Apr 2022 22:47:53 +0800 Subject: [PATCH] update viewer.js --- lib/viewer.min.css | 4 ++-- lib/viewer.min.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/viewer.min.css b/lib/viewer.min.css index 2b5008c39..902a7bf8d 100644 --- a/lib/viewer.min.css +++ b/lib/viewer.min.css @@ -1,9 +1,9 @@ /*! - * Viewer.js v1.10.4 + * Viewer.js v1.10.5 * https://fengyuanchen.github.io/viewerjs * * Copyright 2015-present Chen Fengyuan * Released under the MIT license * - * Date: 2022-03-22T18:49:23.785Z + * Date: 2022-04-12T14:46:42.391Z */.viewer-close:before,.viewer-flip-horizontal:before,.viewer-flip-vertical:before,.viewer-fullscreen-exit:before,.viewer-fullscreen:before,.viewer-next:before,.viewer-one-to-one:before,.viewer-play:before,.viewer-prev:before,.viewer-reset:before,.viewer-rotate-left:before,.viewer-rotate-right:before,.viewer-zoom-in:before,.viewer-zoom-out:before{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARgAAAAUCAYAAABWOyJDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAQPSURBVHic7Zs/iFxVFMa/0U2UaJGksUgnIVhYxVhpjDbZCBmLdAYECxsRFBTUamcXUiSNncgKQbSxsxH8gzAP3FU2jY0kKKJNiiiIghFlccnP4p3nPCdv3p9778vsLOcHB2bfveeb7955c3jvvNkBIMdxnD64a94GHMfZu3iBcRynN7zAOI7TG15gHCeeNUkr8zaxG2lbYDYsdgMbktBsP03jdQwljSXdtBhLOmtjowC9Mg9L+knSlcD8TNKpSA9lBpK2JF2VdDSR5n5J64m0qli399hNFMUlpshQii5jbXTbHGviB0nLNeNDSd9VO4A2UdB2fp+x0eCnaXxWXGA2X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C");background-repeat:no-repeat;background-size:280px;color:transparent;display:block;font-size:0;height:20px;line-height:0;width:20px}.viewer-zoom-in:before{background-position:0 0;content:"Zoom In"}.viewer-zoom-out:before{background-position:-20px 0;content:"Zoom Out"}.viewer-one-to-one:before{background-position:-40px 0;content:"One to One"}.viewer-reset:before{background-position:-60px 0;content:"Reset"}.viewer-prev:before{background-position:-80px 0;content:"Previous"}.viewer-play:before{background-position:-100px 0;content:"Play"}.viewer-next:before{background-position:-120px 0;content:"Next"}.viewer-rotate-left:before{background-position:-140px 0;content:"Rotate Left"}.viewer-rotate-right:before{background-position:-160px 0;content:"Rotate Right"}.viewer-flip-horizontal:before{background-position:-180px 0;content:"Flip Horizontal"}.viewer-flip-vertical:before{background-position:-200px 0;content:"Flip Vertical"}.viewer-fullscreen:before{background-position:-220px 0;content:"Enter Full Screen"}.viewer-fullscreen-exit:before{background-position:-240px 0;content:"Exit Full Screen"}.viewer-close:before{background-position:-260px 0;content:"Close"}.viewer-container{-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;bottom:0;direction:ltr;font-size:0;left:0;line-height:0;overflow:hidden;position:absolute;right:0;top:0;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.viewer-container ::-moz-selection,.viewer-container::-moz-selection{background-color:transparent}.viewer-container ::selection,.viewer-container::selection{background-color:transparent}.viewer-container:focus{outline:0}.viewer-container img{display:block;height:auto;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.viewer-canvas{bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:0}.viewer-canvas>img{height:auto;margin:15px auto;max-width:90%!important;width:auto}.viewer-footer{bottom:0;left:0;overflow:hidden;position:absolute;right:0;text-align:center}.viewer-navbar{background-color:rgba(0,0,0,.5);overflow:hidden}.viewer-list{box-sizing:content-box;height:50px;margin:0;overflow:hidden;padding:1px 0}.viewer-list>li{color:transparent;cursor:pointer;float:left;font-size:0;height:50px;line-height:0;opacity:.5;overflow:hidden;transition:opacity .15s;width:30px}.viewer-list>li:focus,.viewer-list>li:hover{opacity:.75}.viewer-list>li:focus{outline:0}.viewer-list>li+li{margin-left:1px}.viewer-list>.viewer-loading{position:relative}.viewer-list>.viewer-loading:after{border-width:2px;height:20px;margin-left:-10px;margin-top:-10px;width:20px}.viewer-list>.viewer-active,.viewer-list>.viewer-active:focus,.viewer-list>.viewer-active:hover{opacity:1}.viewer-player{background-color:#000;bottom:0;cursor:none;display:none;right:0;z-index:1}.viewer-player,.viewer-player>img{left:0;position:absolute;top:0}.viewer-toolbar>ul{display:inline-block;margin:0 auto 5px;overflow:hidden;padding:6px 3px}.viewer-toolbar>ul>li{background-color:rgba(0,0,0,.5);border-radius:50%;cursor:pointer;float:left;height:24px;overflow:hidden;transition:background-color .15s;width:24px}.viewer-toolbar>ul>li:focus,.viewer-toolbar>ul>li:hover{background-color:rgba(0,0,0,.8)}.viewer-toolbar>ul>li:focus{box-shadow:0 0 3px #fff;outline:0;position:relative;z-index:1}.viewer-toolbar>ul>li:before{margin:2px}.viewer-toolbar>ul>li+li{margin-left:1px}.viewer-toolbar>ul>.viewer-small{height:18px;margin-bottom:3px;margin-top:3px;width:18px}.viewer-toolbar>ul>.viewer-small:before{margin:-1px}.viewer-toolbar>ul>.viewer-large{height:30px;margin-bottom:-3px;margin-top:-3px;width:30px}.viewer-toolbar>ul>.viewer-large:before{margin:5px}.viewer-tooltip{background-color:rgba(0,0,0,.8);border-radius:10px;color:#fff;display:none;font-size:12px;height:20px;left:50%;line-height:20px;margin-left:-25px;margin-top:-10px;position:absolute;text-align:center;top:50%;width:50px}.viewer-title{color:#ccc;display:inline-block;font-size:12px;line-height:1.2;margin:0 5% 5px;max-width:90%;opacity:.8;overflow:hidden;text-overflow:ellipsis;transition:opacity .15s;white-space:nowrap}.viewer-title:hover{opacity:1}.viewer-button{-webkit-app-region:no-drag;background-color:rgba(0,0,0,.5);border-radius:50%;cursor:pointer;height:80px;overflow:hidden;position:absolute;right:-40px;top:-40px;transition:background-color .15s;width:80px}.viewer-button:focus,.viewer-button:hover{background-color:rgba(0,0,0,.8)}.viewer-button:focus{box-shadow:0 0 3px #fff;outline:0}.viewer-button:before{bottom:15px;left:15px;position:absolute}.viewer-fixed{position:fixed}.viewer-open{overflow:hidden}.viewer-show{display:block}.viewer-hide{display:none}.viewer-backdrop{background-color:rgba(0,0,0,.5)}.viewer-invisible{visibility:hidden}.viewer-move{cursor:move;cursor:-webkit-grab;cursor:grab}.viewer-fade{opacity:0}.viewer-in{opacity:1}.viewer-transition{transition:all .3s}@-webkit-keyframes viewer-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes viewer-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.viewer-loading:after{-webkit-animation:viewer-spinner 1s linear infinite;animation:viewer-spinner 1s linear infinite;border:4px solid hsla(0,0%,100%,.1);border-left-color:hsla(0,0%,100%,.5);border-radius:50%;content:"";display:inline-block;height:40px;left:50%;margin-left:-20px;margin-top:-20px;position:absolute;top:50%;width:40px;z-index:1}@media (max-width:767px){.viewer-hide-xs-down{display:none}}@media (max-width:991px){.viewer-hide-sm-down{display:none}}@media (max-width:1199px){.viewer-hide-md-down{display:none}} \ No newline at end of file diff --git a/lib/viewer.min.js b/lib/viewer.min.js index 7794df5e8..cabfb5783 100644 --- a/lib/viewer.min.js +++ b/lib/viewer.min.js @@ -1,10 +1,10 @@ /*! - * Viewer.js v1.10.4 + * Viewer.js v1.10.5 * https://fengyuanchen.github.io/viewerjs * * Copyright 2015-present Chen Fengyuan * Released under the MIT license * - * Date: 2022-03-22T18:49:24.794Z + * Date: 2022-04-12T14:46:43.451Z */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Viewer=e()}(this,function(){"use strict";function e(e,t){var i,n=Object.keys(e);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(e),t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)),n}function l(n){for(var t=1;t=this.length||this.viewed&&t===this.index)return this;if(!this.isShown)return this.index=t,this.show();this.viewing&&this.viewing.abort();var e=this.element,n=this.options,l=this.title,s=this.canvas,o=this.items[t],a=o.querySelector("img"),r=ut(a,"originalUrl"),c=a.getAttribute("alt"),h=document.createElement("img");if(z(n.inheritedAttributes,function(t){var e=a.getAttribute(t);null!==e&&h.setAttribute(t,e)}),h.src=r,h.alt=c,k(n.view)&&D(e,"view",n.view,{once:!0}),!1===E(e,"view",{originalImage:this.images[t],index:t,image:h})||!this.isShown||this.hiding||this.played)return this;function u(){var t=i.imageData,e=Array.isArray(n.title)?n.title[1]:n.title;l.textContent=k(e)?e.call(i,h,t):c+" ("+t.naturalWidth+" × "+t.naturalHeight+")"}var d,m,r=this.items[this.index];r&&(v(r,b),r.removeAttribute("aria-selected")),f(o,b),o.setAttribute("aria-selected",!0),n.focus&&o.focus(),this.image=h,this.viewed=!1,this.index=t,this.imageData={},f(h,A),n.loading&&f(s,S),s.innerHTML="",s.appendChild(h),this.renderList(),l.innerHTML="";return D(e,K,u,{once:!0}),this.viewing={abort:function(){p(e,K,u),h.complete?i.imageRendering?i.imageRendering.abort():i.imageInitializing&&i.imageInitializing.abort():(h.src="",p(h,X,d),i.timeout&&clearTimeout(i.timeout))}},h.complete?this.load():(D(h,X,d=function(){p(h,M,m),i.load()},{once:!0}),D(h,M,m=function(){p(h,X,d),i.timeout&&(clearTimeout(i.timeout),i.timeout=!1),v(h,A),n.loading&&v(i.canvas,S)},{once:!0}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){v(h,A),i.timeout=!1},1e3)),this},prev:function(){var t=this.index-1;return t<0&&(t=0Math.abs(r)&&(this.pointers={},1
',h=(i=h.querySelector("."+g+"-container")).querySelector("."+g+"-title"),n=i.querySelector("."+g+"-toolbar"),l=i.querySelector("."+g+"-navbar"),s=i.querySelector("."+g+"-button"),a=i.querySelector("."+g+"-canvas"),this.parent=e,this.viewer=i,this.title=h,this.toolbar=n,this.navbar=l,this.button=s,this.canvas=a,this.footer=i.querySelector("."+g+"-footer"),this.tooltipBox=i.querySelector("."+g+"-tooltip"),this.player=i.querySelector("."+g+"-player"),this.list=i.querySelector("."+g+"-list"),i.id=g+this.id,h.id=g+"Title"+this.id,f(h,o.title?wt(Array.isArray(o.title)?o.title[0]:o.title):T),f(l,o.navbar?wt(o.navbar):T),ht(s,T,!o.button),o.keyboard&&s.setAttribute("tabindex",0),o.backdrop&&(f(i,g+"-backdrop"),o.inline||"static"===o.backdrop||dt(a,$,"hide")),J(o.className)&&o.className&&o.className.split(_).forEach(function(t){f(i,t)}),o.toolbar?(c=document.createElement("ul"),r=nt(o.toolbar),u=G.slice(0,3),d=G.slice(7,9),m=G.slice(9),r||f(n,wt(o.toolbar)),z(r?o.toolbar:G,function(t,e){var i,n=r&&nt(t),e=r?ct(e):t,s=n&&!tt(t.show)?t.show:t;!s||!o.zoomable&&-1!==u.indexOf(e)||!o.rotatable&&-1!==d.indexOf(e)||!o.scalable&&-1!==m.indexOf(e)||(i=n&&!tt(t.size)?t.size:t,n=n&&!tt(t.click)?t.click:t,t=document.createElement("li"),o.keyboard&&t.setAttribute("tabindex",0),t.setAttribute("role","button"),f(t,g+"-"+e),k(n)||dt(t,$,e),x(s)&&f(t,wt(s)),-1!==["small","large"].indexOf(i)?f(t,g+"-"+i):"play"===e&&f(t,g+"-large"),k(n)&&D(t,R,n),c.appendChild(t))}),n.appendChild(c)):f(n,T),o.rotatable||(f(h=n.querySelectorAll('li[class*="rotate"]'),A),z(h,function(t){n.appendChild(t)})),o.inline?(f(s,"viewer-fullscreen"),at(i,{zIndex:o.zIndexInline}),"static"===window.getComputedStyle(e).position&&at(e,{position:"relative"}),e.insertBefore(i,t.nextSibling)):(f(s,"viewer-close"),f(i,y),f(i,w),f(i,T),at(i,{zIndex:o.zIndex}),(l=(l=J(l=o.container)?t.ownerDocument.querySelector(l):l)||this.body).appendChild(i)),o.inline&&(this.render(),this.bind(),this.isShown=!0),this.ready=!0,k(o.ready)&&D(t,V,o.ready,{once:!0}),!1!==E(t,V)?this.ready&&o.inline&&this.view(this.index):this.ready=!1)}}])&&n(t.prototype,e),i&&n(t,i),Object.defineProperty(t,"prototype",{writable:!1}),s}();return st(s.prototype,r,t,kt,zt,Dt),s}); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Viewer=e()}(this,function(){"use strict";function o(e,t){var i,n=Object.keys(e);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(e),t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)),n}function q(n){for(var t=1;t=this.length||this.viewed&&t===this.index)return this;if(!this.isShown)return this.index=t,this.show();this.viewing&&this.viewing.abort();var e=this.element,n=this.options,s=this.title,o=this.canvas,a=this.items[t],r=a.querySelector("img"),h=Y(r,"originalUrl"),l=r.getAttribute("alt"),c=document.createElement("img");if(S(n.inheritedAttributes,function(t){var e=r.getAttribute(t);null!==e&&c.setAttribute(t,e)}),c.src=h,c.alt=l,A(n.view)&&M(e,"view",n.view,{once:!0}),!1===P(e,"view",{originalImage:this.images[t],index:t,image:c})||!this.isShown||this.hiding||this.played)return this;function u(){var t=i.imageData,e=Array.isArray(n.title)?n.title[1]:n.title;s.textContent=A(e)?e.call(i,c,t):l+" ("+t.naturalWidth+" × "+t.naturalHeight+")"}var d,m,h=this.items[this.index];h&&(F(h,f),h.removeAttribute("aria-selected")),L(a,f),a.setAttribute("aria-selected",!0),n.focus&&a.focus(),this.image=c,this.viewed=!1,this.index=t,this.imageData={},L(c,b),n.loading&&L(o,w),o.innerHTML="",o.appendChild(c),this.renderList(),s.innerHTML="";return M(e,E,u,{once:!0}),this.viewing={abort:function(){X(e,E,u),c.complete?i.imageRendering?i.imageRendering.abort():i.imageInitializing&&i.imageInitializing.abort():(c.src="",X(c,x,d),i.timeout&&clearTimeout(i.timeout))}},c.complete?this.load():(M(c,x,d=function(){X(c,k,m),i.load()},{once:!0}),M(c,k,m=function(){X(c,x,d),i.timeout&&(clearTimeout(i.timeout),i.timeout=!1),F(c,b),n.loading&&F(i.canvas,w)},{once:!0}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){F(c,b),i.timeout=!1},1e3)),this},prev:function(){var t=this.index-1;return t<0&&(t=0Math.abs(r)&&(this.pointers={},1
',d=(i=d.querySelector("."+g+"-container")).querySelector("."+g+"-title"),n=i.querySelector("."+g+"-toolbar"),m=i.querySelector("."+g+"-navbar"),s=i.querySelector("."+g+"-button"),a=i.querySelector("."+g+"-canvas"),this.parent=e,this.viewer=i,this.title=d,this.toolbar=n,this.navbar=m,this.button=s,this.canvas=a,this.footer=i.querySelector("."+g+"-footer"),this.tooltipBox=i.querySelector("."+g+"-tooltip"),this.player=i.querySelector("."+g+"-player"),this.list=i.querySelector("."+g+"-list"),i.id=g+this.id,d.id=g+"Title"+this.id,L(d,o.title?wt(Array.isArray(o.title)?o.title[0]:o.title):p),L(m,o.navbar?wt(o.navbar):p),N(s,p,!o.button),o.keyboard&&s.setAttribute("tabindex",0),o.backdrop&&(L(i,g+"-backdrop"),o.inline||"static"===o.backdrop||dt(a,nt,"hide")),at(o.className)&&o.className&&o.className.split(st).forEach(function(t){L(i,t)}),o.toolbar?(r=document.createElement("ul"),h=I(o.toolbar),l=ot.slice(0,3),c=ot.slice(7,9),u=ot.slice(9),h||L(n,wt(o.toolbar)),S(h?o.toolbar:ot,function(t,e){var i,n=h&&I(t),e=h?ut(e):t,s=n&&!T(t.show)?t.show:t;!s||!o.zoomable&&-1!==l.indexOf(e)||!o.rotatable&&-1!==c.indexOf(e)||!o.scalable&&-1!==u.indexOf(e)||(i=n&&!T(t.size)?t.size:t,n=n&&!T(t.click)?t.click:t,t=document.createElement("li"),o.keyboard&&t.setAttribute("tabindex",0),t.setAttribute("role","button"),L(t,g+"-"+e),A(n)||dt(t,nt,e),D(s)&&L(t,wt(s)),-1!==["small","large"].indexOf(i)?L(t,g+"-"+i):"play"===e&&L(t,g+"-large"),A(n)&&M(t,y,n),r.appendChild(t))}),n.appendChild(r)):L(n,p),o.rotatable||(L(d=n.querySelectorAll('li[class*="rotate"]'),b),S(d,function(t){n.appendChild(t)})),o.inline?(L(s,"viewer-fullscreen"),C(i,{zIndex:o.zIndexInline}),"static"===window.getComputedStyle(e).position&&C(e,{position:"relative"}),e.insertBefore(i,t.nextSibling)):(L(s,"viewer-close"),L(i,j),L(i,v),L(i,p),C(i,{zIndex:o.zIndex}),(m=(m=at(m=o.container)?t.ownerDocument.querySelector(m):m)||this.body).appendChild(i)),o.inline&&(this.render(),this.bind(),this.isShown=!0),this.ready=!0,A(o.ready)&&M(t,tt,o.ready,{once:!0}),!1===P(t,tt)?this.ready=!1:this.ready&&o.inline&&this.view(this.index))}}])&&r(t.prototype,e),i&&r(t,i),Object.defineProperty(t,"prototype",{writable:!1}),s}();return O(e.prototype,i,t,kt,zt,Et),e}); \ No newline at end of file