9 lines
72 KiB
JavaScript
9 lines
72 KiB
JavaScript
|
/**
|
||
|
* Fresco - A Beautiful Responsive Lightbox - v2.3.0
|
||
|
* (c) 2012-2019 Nick Stakenburg
|
||
|
*
|
||
|
* https://www.frescojs.com
|
||
|
*
|
||
|
* @license: https://creativecommons.org/licenses/by/4.0
|
||
|
*/
|
||
|
!function(i,e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&module.exports?module.exports=e(require("jquery")):i.Fresco=e(jQuery)}(this,function($){var Fresco={};$.extend(Fresco,{version:"2.3.0"}),Fresco.Skins={fresco:{}};var Bounds={viewport:function(){var i={width:$(window).width()};if(Browser.MobileSafari||Browser.Android&&Browser.Gecko){var e=document.documentElement.clientWidth/window.innerWidth;i.height=window.innerHeight*e}else i.height=$(window).height();return i}},Browser=(e=navigator.userAgent,{IE:!(!window.attachEvent||-1!==e.indexOf("Opera"))&&f("MSIE "),Opera:-1<e.indexOf("Opera")&&(!!window.opera&&opera.version&&parseFloat(opera.version())||7.55),WebKit:-1<e.indexOf("AppleWebKit/")&&f("AppleWebKit/"),Gecko:-1<e.indexOf("Gecko")&&-1===e.indexOf("KHTML")&&f("rv:"),MobileSafari:!!e.match(/Apple.*Mobile.*Safari/),Chrome:-1<e.indexOf("Chrome")&&f("Chrome/"),ChromeMobile:-1<e.indexOf("CrMo")&&f("CrMo/"),Android:-1<e.indexOf("Android")&&f("Android "),IEMobile:-1<e.indexOf("IEMobile")&&f("IEMobile/")}),e;function f(i){var t=new RegExp(i+"([\\d.]+)").exec(e);return!t||parseFloat(t[1])}var _slice=Array.prototype.slice;function baseToString(i){return"string"==typeof i?i:null==i?"":i+""}var _={isElement:function(i){return i&&1===i.nodeType},String:{capitalize:function(i){return(i=baseToString(i))&&i.charAt(0).toUpperCase()+i.slice(1)}}};$(document.documentElement).on("mousewheel DOMMouseScroll",function(i){var e;if(i.originalEvent.wheelDelta?e=i.originalEvent.wheelDelta/120:i.originalEvent.detail&&(e=-i.originalEvent.detail/3),e){var t=$.Event("fresco:mousewheel");$(i.target).trigger(t,e),t.isPropagationStopped()&&i.stopPropagation(),t.isDefaultPrevented()&&i.preventDefault()}});var Fit={within:function(i,e){for(var t=$.extend({height:!0,width:!0},arguments[2]||{}),s=$.extend({},e),n=1,o=5,a=t.width,h=t.height;0<o&&(a&&s.width>i.width||h&&s.height>i.height);){var r=1,d=1;a&&s.width>i.width&&(r=i.width/s.width),h&&s.height>i.height&&(d=i.height/s.height),n=Math.min(r,d),s={width:e.width*n,height:e.height*n},o--}return s.width=Math.max(s.width,0),s.height=Math.max(s.height,0),s}};$.extend($.easing,{frescoEaseInCubic:function(i,e,t,s,n){return s*(e/=n)*e*e+t},frescoEaseInSine:function(i,e,t,s,n){return-s*Math.cos(e/n*(Math.PI/2))+s+t},frescoEaseOutSine:function(i,e,t,s,n){return s*Math.sin(e/n*(Math.PI/2))+t}});var Support=(O=document.createElement("div"),P="Webkit Moz O ms Khtml".split(" "),{canvas:(ba=document.createElement("canvas"),!(!ba.getContext||!ba.getContext("2d"))),css:{animation:S("animation"),transform:S("transform"),prefixed:function(i){return S(i,"prefix")}},svg:!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,touch:function(){try{return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)}catch(i){return!1}}()}),ba,O,P;function S(i,e){var t=i.charAt(0).toUpperCase()+i.substr(1);return function(i,e){for(var t in i)if(void 0!==O.style[i[t]])return"prefix"!==e||i[t];return!1}((i+" "+P.join(t+" ")+t).split(" "),e)}Support.detectMobileTouch=function(){Support.mobileTouch=Support.touch&&(Browser.MobileSafari||Browser.Android||Browser.IEMobile||Browser.ChromeMobile||!/^(Win|Mac|Linux)/.test(navigator.platform))},Support.detectMobileTouch();var ImageReady=function(){return this.initialize.apply(this,Array.prototype.slice.call(arguments))};function Timers(){return this.initialize.apply(this,_slice.call(arguments))}function getURIData(s){var n={type:"image"};return $.each(Types,function(i,e){var t=e.data(s);t&&((n=t).type=i,n.url=s)}),n}function detectExtension(i){var e=(i||"").replace(/\?.*/g,"").match(/\.([^.]{3,4})$/);return e?e[1].toLowerCase():null}$.extend(ImageReady.prototype,{supports:{naturalWidth:"naturalWidth"in new Image},initialize:function(i,e,t){this.img=$(i)[0],this.successCallback=e,this.errorCallback=t,this.isLoaded=!1,this.options=$.extend({method:"naturalWidth",pollFallbackAfter:1e3},arguments[3]||{}),this.supports.naturalWidth&&"onload"!==this.options.method?this.img.com
|