1(function($) { 2 $.fn.wondercarousellightbox = function(options) { 3 var inst = this; 4 inst.options = $.extend({ 5 freelink: "http://html5box.com/", 6 defaultvideovolume: 1, 7 autoclose: false, 8 insideiframe: false, 9 autoplay: true, 10 loopvideo: false, 11 html5player: true, 12 responsive: true, 13 nativehtml5controls: false, 14 videohidecontrols: false, 15 nativecontrolsonfirefox: true, 16 nativecontrolsonie: true, 17 imagekeepratio: true, 18 useflashonie9: true, 19 useflashonie10: true, 20 useflashonie11: false, 21 googleanalyticsaccount: "", 22 arrowloop: true, 23 shownavigation: true, 24 thumbwidth: 96, 25 thumbheight: 72, 26 thumbgap: 4, 27 thumbtopmargin: 12, 28 thumbbottommargin: 12, 29 thumbborder: 1, 30 thumbbordercolor: "transparent", 31 thumbhighlightbordercolor: "#fff", 32 thumbopacity: 1, 33 navbuttonwidth: 32, 34 overlaybgcolor: "#000", 35 overlayopacity: 0.9, 36 bgcolor: "#fff", 37 bordersize: 8, 38 borderradius: 0, 39 bordermargin: 16, 40 bordertopmargin: 48, 41 bordertopmarginsmall: 48, 42 barautoheight: true, 43 barheight: 64, 44 responsivebarheight: false, 45 smallscreenheight: 415, 46 barheightonsmallheight: 64, 47 notkeepratioonsmallheight: false, 48 loadingwidth: 64, 49 loadingheight: 64, 50 resizespeed: 400, 51 fadespeed: 400, 52 jsfolder: "", 53 skinsfoldername: "skins", 54 loadingimage: "lightbox-loading.gif", 55 nextimage: "lightbox-next.png", 56 previmage: "lightbox-prev.png", 57 closeimage: "lightbox-close.png", 58 playvideoimage: "lightbox-playvideo.png", 59 titlebgimage: "lightbox-titlebg.png", 60 navarrowsprevimage: "lightbox-navprev.png", 61 navarrowsnextimage: "lightbox-navnext.png", 62 navarrowsalwaysshowontouch: true, 63 navarrowsbottomscreenwidth: 479, 64 closeonoverlay: true, 65 alwaysshownavarrows: false, 66 showplaybutton: true, 67 playimage: "lightbox-play.png", 68 pauseimage: "lightbox-pause.png", 69 fullscreenmode: false, 70 fullscreencloseimage: "lightbox-close-fullscreen.png", 71 fullscreennextimage: "lightbox-next-fullscreen.png", 72 fullscreenprevimage: "lightbox-prev-fullscreen.png", 73 videobgcolor: "#000", 74 html5videoposter: "", 75 showtitle: true, 76 titlestyle: "bottom", 77 titleinsidecss: "color:#fff; font-size:16px; font-family:Arial,Helvetica,sans-serif; overflow:hidden; text-align:left;", 78 titlebottomcss: "color:#333; font-size:16px; font-family:Arial,Helvetica,sans-serif; overflow:hidden; text-align:left;", 79 showdescription: true, 80 descriptioninsidecss: "color:#fff; font-size:12px; font-family:Arial,Helvetica,sans-serif; overflow:hidden; text-align:left; margin:4px 0px 0px; padding: 0px;", 81 descriptionbottomcss: "color:#333; font-size:12px; font-family:Arial,Helvetica,sans-serif; overflow:hidden; text-align:left; margin:4px 0px 0px; padding: 0px;", 82 showtitleprefix: true, 83 titleprefix: "%NUM / %TOTAL", 84 autoslide: false, 85 slideinterval: 5E3, 86 showtimer: true, 87 timerposition: "bottom", 88 timerheight: 2, 89 timercolor: "#dc572e", 90 timeropacity: 1, 91 initvimeo: true, 92 inityoutube: true, 93 initsocial: true, 94 showsocial: false, 95 socialposition: "position:absolute;top:100%;right:0;", 96 socialpositionsmallscreen: "position:absolute;top:100%;right:0;left:0;", 97 socialdirection: "horizontal", 98 socialbuttonsize: 32, 99 socialbuttonfontsize: 18, 100 socialrotateeffect: true, 101 showfacebook: true, 102 showtwitter: true, 103 showpinterest: true, 104 imagepercentage: 75, 105 sidetobottomscreenwidth: 479, 106 errorwidth: 280, 107 errorheight: 48, 108 errorcss: "text-align:center; color:#ff0000; font-size:14px; font-family:Arial, sans-serif;", 109 enabletouchswipe: true, 110 supportesckey: true, 111 supportarrowkeys: true, 112 version: "3.3", 113 stamp: false, 114 freemark: "72,84,77,76,53,32,76,105,103,104,116,98,111,120,32,70,114,101,101,32,86,101,114,115,105,111,110", 115 watermark: "", 116 watermarklink: "" 117 }, options); 118 if (typeof wondercarousellightbox_options != "undefined" && wondercarousellightbox_options) $.extend(inst.options, wondercarousellightbox_options);
119 if ($("div#wondercarousellightbox_options").length) $.each($("div#wondercarousellightbox_options").data(), function(key, value) { 120 inst.options[key.toLowerCase()] = value 121 }); 122 if ($("div#html5lightbox_general_options").length) $.each($("div#html5lightbox_general_options").data(), 123 function(key, value) { 124 inst.options[key.toLowerCase()] = value 125 }); 126 var DEFAULT_WIDTH = 960, 127 DEFAULT_HEIGHT = 540; 128 var ELEM_TYPE = 0, 129 ELEM_HREF = 1, 130 ELEM_TITLE = 2, 131 ELEM_GROUP = 3, 132 ELEM_WIDTH = 4, 133 ELEM_HEIGHT = 5, 134 ELEM_HREF_WEBM = 6, 135 ELEM_HREF_OGG = 7, 136 ELEM_THUMBNAIL = 8, 137 ELEM_DESCRIPTION = 9, 138 ELEM_DIV = 10; 139 inst.options.types = ["IMAGE", "FLASH", "VIDEO", "YOUTUBE", "VIMEO", "PDF", "MP3", "WEB", "FLV", "DAILYMOTION", "DIV", "WISTIA"]; 140 inst.options.htmlfolder = window.location.href.substr(0, window.location.href.lastIndexOf("/") + 1); 141 inst.options.skinsfolder = inst.options.skinsfoldername; 142 if (inst.options.skinsfolder.length > 0 && inst.options.skinsfolder[inst.options.skinsfolder.length - 1] != "/") inst.options.skinsfolder += "/"; 143 if (inst.options.skinsfolder.charAt(0) != "/" && inst.options.skinsfolder.substring(0, 5) != "http:" && inst.options.skinsfolder.substring(0, 6) != "https:") inst.options.skinsfolder = inst.options.jsfolder + inst.options.skinsfolder; 144 var i; 145 var l; 146 var mark = ""; 147 var bytes = inst.options.freemark.split(","); 148 for (i = 0; i < bytes.length; i++) mark += String.fromCharCode(bytes[i]); 149 inst.options.freemark = 150 mark; 151 var d0 = "hmtamgli5cboxh.iclolms"; 152 for (i = 1; i <= 5; i++) d0 = d0.slice(0, i) + d0.slice(i + 1); 153 l = d0.length; 154 for (i = 0; i < 5; i++) d0 = d0.slice(0, l - 9 + i) + d0.slice(l - 8 + i); 155 if (inst.options.htmlfolder.indexOf(d0) != -1) inst.options.stamp = false; 156 inst.options.flashInstalled = false; 157 try { 158 if (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) inst.options.flashInstalled = true 159 } catch (e) { 160 if (navigator.mimeTypes["application/x-shockwave-flash"]) inst.options.flashInstalled = true 161 } 162 inst.options.html5VideoSupported = !!document.createElement("video").canPlayType; 163 inst.options.isChrome = navigator.userAgent.match(/Chrome/i) != null; 164 inst.options.isFirefox = navigator.userAgent.match(/Firefox/i) != null; 165 inst.options.isOpera = navigator.userAgent.match(/Opera/i) != null || navigator.userAgent.match(/OPR\//i) != null; 166 inst.options.isSafari = navigator.userAgent.match(/Safari/i) != null; 167 inst.options.isIE11 = navigator.userAgent.match(/Trident\/7/) != null && navigator.userAgent.match(/rv:11/) != null; 168 inst.options.isIE = navigator.userAgent.match(/MSIE/i) != null && !inst.options.isOpera; 169 inst.options.isIE10 = 170 navigator.userAgent.match(/MSIE 10/i) != null && !this.options.isOpera; 171 inst.options.isIE9 = navigator.userAgent.match(/MSIE 9/i) != null && !inst.options.isOpera; 172 inst.options.isIE8 = navigator.userAgent.match(/MSIE 8/i) != null && !inst.options.isOpera; 173 inst.options.isIE7 = navigator.userAgent.match(/MSIE 7/i) != null && !inst.options.isOpera; 174 inst.options.isIE6 = navigator.userAgent.match(/MSIE 6/i) != null && !inst.options.isOpera; 175 inst.options.isIE678 = inst.options.isIE6 || inst.options.isIE7 || inst.options.isIE8; 176 inst.options.isIE6789 = 177 inst.options.isIE6 || inst.options.isIE7 || inst.options.isIE8 || inst.options.isIE9; 178 inst.options.isAndroid = navigator.userAgent.match(/Android/i) != null; 179 inst.options.isIPad = navigator.userAgent.match(/iPad/i) != null; 180 inst.options.isIPhone = navigator.userAgent.match(/iPod/i) != null || navigator.userAgent.match(/iPhone/i) != null; 181 inst.options.isIOS = inst.options.isIPad || inst.options.isIPhone; 182 inst.options.isMobile = inst.options.isAndroid || inst.options.isIPad || inst.options.isIPhone; 183 inst.options.isIOSLess5 = inst.options.isIPad && 184 inst.options.isIPhone && (navigator.userAgent.match(/OS 4/i) != null || navigator.userAgent.match(/OS 3/i) != null); 185 inst.options.supportCSSPositionFixed = !inst.options.isIE6 && !inst.options.isIOSLess5; 186 inst.options.iequirksmode = inst.options.isIE6789 && document.compatMode != "CSS1Compat"; 187 inst.options.isTouch = "ontouchstart" in window; 188 if (inst.options.isMobile) inst.options.autoplay = false; 189 if (inst.options.isFirefox && inst.options.nativecontrolsonfirefox) inst.options.nativehtml5controls = true; 190 if ((inst.options.isIE6789 || 191 inst.options.isIE10 || inst.options.isIE11) && inst.options.nativecontrolsonie) inst.options.nativehtml5controls = true; 192 inst.options.navheight = 0; 193 inst.options.thumbgap += 2 * inst.options.thumbborder; 194 inst.options.resizeTimeout = -1; 195 inst.slideTimeout = null;
196 inst.autosliding = false; 197 inst.elemArray = new Array; 198 inst.options.curElem = -1; 199 inst.defaultoptions = $.extend({}, inst.options); 200 if (inst.options.googleanalyticsaccount && !window._gaq) { 201 window._gaq = window._gaq || []; 202 window._gaq.push(["_setAccount", inst.options.googleanalyticsaccount]); 203 window._gaq.push(["_trackPageview"]); 204 $.getScript("https://ssl.google-analytics.com/ga.js") 205 } 206 if (inst.options.initvimeo) { 207 var tag = document.createElement("script"); 208 tag.src = inst.options.jsfolder + "froogaloop2.min.js"; 209 var firstScriptTag = document.getElementsByTagName("script")[0]; 210 firstScriptTag.parentNode.insertBefore(tag, firstScriptTag) 211 } 212 if (inst.options.inityoutube) { 213 var tag = document.createElement("script"); 214 tag.src = "https://www.youtube.com/iframe_api"; 215 var firstScriptTag = document.getElementsByTagName("script")[0]; 216 firstScriptTag.parentNode.insertBefore(tag, firstScriptTag) 217 } 218 if (inst.options.initsocial) $("head").append('<link rel="stylesheet" href="' + inst.options.jsfolder + 'icons/css/fontello.css" type="text/css" />'); 219 inst.showing = false; 220 inst.supportKeyboard = function() { 221 $(document).keyup(function(e) { 222 if (!inst.showing) return; 223 if (inst.options.supportesckey && e.keyCode == 27) inst.finish(); 224 else if (inst.options.supportarrowkeys)
225 if (e.keyCode == 39) inst.gotoSlide(-1); 226 else if (e.keyCode == 37) inst.gotoSlide(-2) 227 }) 228 }; 229 inst.supportKeyboard(); 230 inst.init = function() { 231 inst.showing = false; 232 inst.readData(); 233 inst.createMarkup(); 234 inst.initSlide() 235 }; 236 inst.readData = function() { 237 inst.each(function() { 238 if (this.nodeName.toLowerCase() != "a" && this.nodeName.toLowerCase() != "area") return; 239 var $this = $(this); 240 var fileType = "mediatype" in $this.data() ? $this.data("mediatype") : inst.checkType($this.attr("href")); 241 if (fileType < 0) return; 242 for (var i = 0; i < inst.elemArray.length; i++) 243 if ($this.attr("href") == inst.elemArray[i][ELEM_HREF]) return; 244 inst.elemArray.push(new Array(fileType, $this.attr("href"), 245 $this.attr("title"), $this.data("group"), $this.data("width"), $this.data("height"), $this.data("webm"), $this.data("ogg"), $this.data("thumbnail"), $this.data("description"))) 246 }) 247 }; 248 inst.createMarkup = function() { 249 inst.options.barheightoriginal = inst.options.barheight; 250 if (inst.options.responsivebarheight) { 251 var winH = window.innerHeight ? window.innerHeight : $(window).height(); 252 if (winH <= inst.options.smallscreenheight) inst.options.barheight = inst.options.barheightonsmallheight 253 } 254 if (!inst.options.titlecss) inst.options.titlecss = 255 inst.options.titlestyle == "inside" ? inst.options.titleinsidecss : inst.options.titlebottomcss; 256 if (!inst.options.descriptioncss) inst.options.descriptioncss = inst.options.titlestyle == "inside" ? inst.options.descriptioninsidecss : inst.options.descriptionbottomcss; 257 inst.options.titlecss = $.trim(inst.options.titlecss); 258 if (inst.options.titlecss.length > 1) { 259 if (inst.options.titlecss.charAt(0) == "{") inst.options.titlecss = inst.options.titlecss.substring(1); 260 if (inst.options.titlecss.charAt(inst.options.titlecss.length - 1) == 261 "}") inst.options.titlecss = inst.options.titlecss.substring(0, inst.options.titlecss.length - 1) 262 } 263 inst.options.descriptioncss = $.trim(inst.options.descriptioncss); 264 if (inst.options.descriptioncss.length > 1) { 265 if (inst.options.descriptioncss.charAt(0) == "{") inst.options.descriptioncss = inst.options.descriptioncss.substring(1); 266 if (inst.options.descriptioncss.charAt(inst.options.descriptioncss.length - 1) == "}") inst.options.descriptioncss = inst.options.descriptioncss.substring(0, inst.options.descriptioncss.length - 1) 267 } 268 inst.options.errorcss = 269 $.trim(inst.options.errorcss); 270 if (inst.options.errorcss.length > 1) { 271 if (inst.options.errorcss.charAt(0) == "{") inst.options.errorcss = inst.options.errorcss.substring(1); 272 if (inst.options.errorcss.charAt(inst.options.errorcss.length - 1) == "}") inst.options.errorcss = inst.options.errorcss.substring(0, inst.options.errorcss.length - 1) 273 } 274 var styleCss = ".html5-hide {display:none !important;} #carousel-html5-lightbox #html5-text {" + inst.options.titlecss + "}"; 275 styleCss += "#carousel-html5-lightbox .html5-description {" + inst.options.descriptioncss + 276 "}"; 277 styleCss += "#carousel-html5-lightbox .html5-error {" + inst.options.errorcss + "}"; 278 if (inst.options.navarrowsalwaysshowontouch || inst.options.alwaysshownavarrows) { 279 styleCss += "#carousel-html5-lightbox .html5-prev-touch {left:0px;top:50%;margin-top:-16px;margin-left:-32px;} #carousel-html5-lightbox .html5-next-touch {right:0px;top:50%;margin-top:-16px;margin-right:-32px;}"; 280 styleCss += "@media (max-width: " + inst.options.navarrowsbottomscreenwidth + "px) { #carousel-html5-lightbox .html5-prev-touch {top:100%;left:0;margin:0;} #carousel-html5-lightbox .html5-next-touch {top:100%;right:0;margin:0;} }" 281 } 282 styleCss += 283 "#carousel-html5-lightbox .html5-prev-fullscreen {display:block;} #carousel-html5-lightbox .html5-next-fullscreen {display:block;} #carousel-html5-lightbox .html5-prev-bottom-fullscreen {display:none;} #carousel-html5-lightbox .html5-next-bottom-fullscreen {display:none;}"; 284 styleCss += "@media (max-width: " + inst.options.navarrowsbottomscreenwidth + "px) {#carousel-html5-lightbox .html5-prev-fullscreen {display:none;} #carousel-html5-lightbox .html5-next-fullscreen {display:none;} #carousel-html5-lightbox .html5-prev-bottom-fullscreen {display:block;} #carousel-html5-lightbox .html5-next-bottom-fullscreen {display:block;} }"; 285 if (inst.options.titlestyle == "right") { 286 styleCss += "#carousel-html5-lightbox #html5-elem-wrap {width:"
286+ inst.options.imagepercentage + "%;height:100%;} #carousel-html5-lightbox #html5-elem-data-box {min-height:100%;}"; 287 styleCss += "@media (max-width: " + inst.options.sidetobottomscreenwidth + "px) {#carousel-html5-lightbox #html5-elem-wrap {width:100%;height:auto;} #carousel-html5-lightbox #html5-elem-data-box {width:100%;height:auto;min-height:0;}}" 288 } else if (inst.options.titlestyle == "left") { 289 styleCss += "#carousel-html5-lightbox #html5-elem-wrap {height:100%;} #carousel-html5-lightbox #html5-elem-data-box {width:" + 290 String(100 - inst.options.imagepercentage) + "%;min-height:100%;}"; 291 styleCss += "@media (max-width: " + inst.options.sidetobottomscreenwidth + "px) {#carousel-html5-lightbox #html5-elem-wrap {width:100%;height:auto;} #carousel-html5-lightbox #html5-elem-data-box {width:100%;height:auto;min-height:0;}}" 292 } 293 styleCss += ".html5-rotate { border-radius:50%; -webkit-transition:-webkit-transform .4s ease-in; transition: transform .4s ease-in; } .html5-rotate:hover { -webkit-transform: rotate(360deg); transform: rotate(360deg); }"; 294 styleCss += "@media (max-width: " + inst.options.navarrowsbottomscreenwidth + "px) {#html5-social {" + inst.options.socialpositionsmallscreen + "}}"; 295 $("head").append("<style type='text/css' data-creator='carousel-html5-lightbox'>" + styleCss + "</style>"); 296 inst.$lightbox = $("<div id='carousel-html5-lightbox' style='display:none;top:0px;left:0px;width:100%;height:100%;z-index:9999998;text-align:center;'>" + "<div id='html5-lightbox-overlay' style='display:block;position:absolute;top:0px;left:0px;width:100%;min-height:100%;background-color:" + 297 inst.options.overlaybgcolor + ";opacity:" + inst.options.overlayopacity + ";filter:alpha(opacity=" + Math.round(inst.options.overlayopacity * 100) + ");'></div>" + "<div id='html5-lightbox-box' style='display:block;position:relative;margin:0px auto;'>" + "<div id='html5-elem-box' style='display:block;position:relative;width:100%;overflow-x:hidden;overflow-y:auto;height:100%;margin:0px auto;text-align:center;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;'>" + "<div id='html5-elem-wrap' style='display:block;position:relative;margin:0px auto;text-align:center;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;background-color:" + 298 inst.options.bgcolor + ";'>" + "<div id='html5-loading' style='display:none;position:absolute;top:0px;left:0px;text-align:center;width:100%;height:100%;background:url(\"" + inst.options.skinsfolder + inst.options.loadingimage + "\") no-repeat center center;'></div>" + "<div id='html5-error' class='html5-error' style='display:none;position:absolute;padding:" + inst.options.bordersize + "px;text-align:center;width:" + inst.options.errorwidth + "px;height:" + inst.options.errorheight + "px;'>" + "The requested content cannot be loaded.<br />Please try again later." + 299 "</div>" + "<div id='html5-image' style='display:none;position:relative;top:0px;left:0px;width:100%;height:100%;" + (inst.options.iequirksmode ? "margin" : "padding") + ":" + inst.options.bordersize + "px;text-align:center;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;'></div>" + "</div>" + "</div>" + "<div id='html5-watermark' style='display:none;position:absolute;left:" + String(inst.options.bordersize + 2) + "px;top:" + String(inst.options.bordersize + 2) + "px;'></div>" + "</div>" + "</div>"); 300 inst.options.positionFixed = 301 inst.options.supportCSSPositionFixed && inst.options.responsive && !inst.options.iequirksmode; 302 inst.$lightbox.css({ 303 position: inst.options.positionFixed ? "fixed" : "absolute" 304 }); 305 inst.$lightbox.appendTo("body"); 306 inst.$lightboxBox = $("#html5-lightbox-box", inst.$lightbox); 307 inst.$elem = $("#html5-elem-box", inst.$lightbox); 308 inst.$elemWrap = $("#html5-elem-wrap", inst.$lightbox); 309 inst.$loading = $("#html5-loading", inst.$lightbox); 310 inst.$error = $("#html5-error", inst.$lightbox); 311 inst.$image = $("#html5-image", inst.$lightbox); 312 var elemText = 313 "<div id='html5-elem-data-box' style='display:none;box-sizing:border-box;'><div id='html5-text' style='display:block;overflow:hidden;'></div></div>"; 314 if (inst.options.titlestyle == "left") inst.$elem.prepend(elemText); 315 else inst.$elem.append(elemText); 316 inst.$elemData = $("#html5-elem-data-box", inst.$lightbox); 317 inst.$text = $("#html5-text", inst.$lightbox);
318 if (inst.options.borderradius > 0) { 319 inst.$elem.css({ 320 "border-radius": inst.options.borderradius + "px", 321 "-moz-border-radius": inst.options.borderradius + "px", 322 "-webkit-border-radius": inst.options.borderradius + 323 "px" 324 }); 325 if (inst.options.titlestyle == "inside") inst.$elemWrap.css({ 326 "border-radius": inst.options.borderradius + "px", 327 "-moz-border-radius": inst.options.borderradius + "px", 328 "-webkit-border-radius": inst.options.borderradius + "px" 329 }); 330 else if (inst.options.titlestyle == "bottom") { 331 inst.$elemWrap.css({ 332 "border-top-left-radius": inst.options.borderradius + "px", 333 "-moz-top-left-border-radius": inst.options.borderradius + "px", 334 "-webkit-top-left-border-radius": inst.options.borderradius + "px", 335 "border-top-right-radius": inst.options.borderradius + 336 "px", 337 "-moz-top-right-border-radius": inst.options.borderradius + "px", 338 "-webkit-top-right-border-radius": inst.options.borderradius + "px" 339 }); 340 inst.$elemData.css({ 341 "border-bottom-left-radius": inst.options.borderradius + "px", 342 "-moz-top-bottom-border-radius": inst.options.borderradius + "px", 343 "-webkit-bottom-left-border-radius": inst.options.borderradius + "px", 344 "border-bottom-right-radius": inst.options.borderradius + "px", 345 "-moz-bottom-right-border-radius": inst.options.borderradius + "px", 346 "-webkit-bottom-right-border-radius": inst.options.borderradius + 347 "px" 348 }) 349 } 350 } 351 if (inst.options.titlestyle == "right" || inst.options.titlestyle == "left") { 352 inst.$lightboxBox.css({ 353 "background-color": inst.options.bgcolor 354 }); 355 if (inst.options.titlestyle == "right") { 356 inst.$elemWrap.css({ 357 position: "relative", 358 "float": "left" 359 }); 360 inst.$elemData.css({ 361 position: "relative", 362 overflow: "hidden", 363 padding: inst.options.bordersize + "px" 364 }) 365 } else { 366 inst.$elemWrap.css({ 367 position: "relative", 368 overflow: "hidden" 369 }); 370 inst.$elemData.css({ 371 position: "relative", 372 "float": "left", 373 padding: inst.options.bordersize + "px" 374 }) 375 } 376 } else if (inst.options.titlestyle == 377 "inside") { 378 inst.$elemData.css({ 379 position: "absolute", 380 margin: inst.options.bordersize + "px", 381 bottom: 0, 382 left: 0, 383 //"background-color": "#333", 384 "background-color": "#fff" 385 //"background-color": "rgba(51, 51, 51, 0.6)" 386 }); 387 inst.$text.css({ 388 padding: inst.options.bordersize + "px " + 2 * inst.options.bordersize + "px" 389 }) 390 } else { 391 inst.$elemData.css({ 392 position: "relative", 393 width: "100%", 394 height: inst.options.barautoheight ? "auto" : inst.options.barheight + "px", 395 "padding": "0 0 " + inst.options.bordersize + "px" + " 0", 396 "background-color": inst.options.bgcolor, 397 "text-align": "left" 398 }); 399 inst.$text.css({ 400 "margin": "0 " + 401 inst.options.bordersize + "px" 402 }) 403 } 404 if (inst.options.showsocial) { 405 var socialCode = '<div id="html5-social" style="display:none;' + inst.options.socialposition + '">'; 406 var socialBtnCSS = (inst.options.socialdirection == "horizontal" ? "display:inline-block;" : "display:block;") + "margin:4px;"; 407 var socialCSS = "display:table-cell;
407width:" + inst.options.socialbuttonsize + "px;height:" + inst.options.socialbuttonsize + "px;font-size:" + inst.options.socialbuttonfontsize + "px;border-radius:50%;color:#fff;vertical-align:middle;text-align:center;cursor:pointer;padding:0;"; 408 if (inst.options.showfacebook) socialCode += '<div class="html5-social-btn' + (inst.options.socialrotateeffect ? " html5-rotate" : "") + ' html5-social-facebook" style="' + socialBtnCSS + '"><div class="mh-icon-facebook" style="' + socialCSS + 'background-color:#3b5998;"></div></div>'; 409 if (inst.options.showtwitter) socialCode += '<div class="html5-social-btn' + (inst.options.socialrotateeffect ? " html5-rotate" : "") + ' html5-social-twitter" style="' + socialBtnCSS + '"><div class="mh-icon-twitter" style="' + socialCSS + 'background-color:#03b3ee;"></div></div>'; 410 if (inst.options.showpinterest) socialCode += '<div class="html5-social-btn' + (inst.options.socialrotateeffect ? " html5-rotate" : "") + ' html5-social-pinterest" style="' + socialBtnCSS + '"><div class="mh-icon-pinterest" style="' + socialCSS + 'background-color:#c92228;"></div></div>'; 411 socialCode += '<div style="clear:both;"></div></div>'; 412 inst.$lightboxBox.append(socialCode); 413 $(".html5-social-btn", inst.$lightbox).click(function() { 414 var shareUrl = window.location.href + (window.location.href.indexOf("?") < 0 ? "?" : "&") + "wpcarousellightboxshare=" + 415 encodeURIComponent(inst.currentElem[ELEM_HREF]); 416 var shareTitle = inst.currentElem[ELEM_TITLE]; 417 var shareMedia = inst.currentElem[ELEM_HREF]; 418 if (inst.currentElem[ELEM_TYPE] == 0) shareMedia = inst.absoluteUrl(inst.currentElem[ELEM_HREF]); 419 else if (inst.currentElem[ELEM_TYPE] == 3) shareMedia = "https://img.youtube.com/vi/" + inst.getYoutubeId(inst.currentElem[ELEM_HREF]) + "/0.jpg"; 420 else { 421 var lightboxLink = $('.wondercarousellightbox[href="' + inst.currentElem[ELEM_HREF] + '"]'); 422 if (lightboxLink.length > 0) 423 if (lightboxLink.data("shareimage") && 424 lightboxLink.data("shareimage").length > 0) shareMedia = inst.absoluteUrl(lightboxLink.data("shareimage")); 425 else if (lightboxLink.data("thumbnail") && lightboxLink.data("thumbnail").length > 0) shareMedia = inst.absoluteUrl(lightboxLink.data("thumbnail")); 426 else { 427 var lightboxImg = $("img", lightboxLink); 428 if (lightboxImg.length > 0) shareMedia = inst.absoluteUrl(lightboxImg.attr("src")) 429 } 430 } 431 var isVideo = inst.currentElem[ELEM_TYPE] == 2 || inst.currentElem[ELEM_TYPE] == 3 || inst.currentElem[ELEM_TYPE] == 4 || inst.currentElem[ELEM_TYPE] == 8 || 432 inst.currentElem[ELEM_TYPE] == 9 || inst.currentElem[ELEM_TYPE] == 11; 433 if ($(this).hasClass("html5-social-facebook")) window.open("https://www.facebook.com/sharer/sharer.php?u=" + encodeURIComponent(shareUrl) + "&t=" + encodeURIComponent(shareTitle), "_blank"); 434 else if ($(this).hasClass("html5-social-twitter")) window.open("https://twitter.com/share?url=" + encodeURIComponent(shareUrl) + "&text=" + encodeURIComponent(shareTitle), "_blank"); 435 else if ($(this).hasClass("html5-social-pinterest")) window.open("https://pinterest.com/pin/create/bookmarklet/?media=" + 436 encodeURIComponent(shareMedia) + "&url=" + encodeURIComponent(shareUrl) + "&description=" + encodeURIComponent(shareTitle) + "&is_video=" + (isVideo ? "true" : "false"), "_blank"); 437 return false 438 }) 439 } 440 if (inst.options.fullscreenmode) { 441 inst.$lightbox.append("<div class='html5-next-fullscreen' style='cursor:pointer;position:absolute;right:" + inst.options.bordersize + "px;top:50%;margin-top:-16px;'><img src='" + inst.options.skinsfolder + inst.options.fullscreennextimage + "'></div>" + "<div class='html5-prev-fullscreen' style='cursor:pointer;position:absolute;
441left:" + 442 inst.options.bordersize + "px;top:50%;margin-top:-16px;'><img src='" + inst.options.skinsfolder + inst.options.fullscreenprevimage + "'></div>"); 443 inst.$next = $(".html5-next-fullscreen", inst.$lightbox); 444 inst.$prev = $(".html5-prev-fullscreen", inst.$lightbox); 445 inst.$lightboxBox.append("<div class='html5-next-bottom-fullscreen' style='cursor:pointer;position:absolute;top:100%;right:0;margin-top:8px;'><img src='" + inst.options.skinsfolder + inst.options.fullscreennextimage + "'></div>" + "<div class='html5-prev-bottom-fullscreen' style='cursor:pointer;position:absolute;top:100%;left:0;margin-top:8px;'><img src='" + 446 inst.options.skinsfolder + inst.options.fullscreenprevimage + "'></div>"); 447 inst.$nextbottom = $(".html5-next-bottom-fullscreen", inst.$lightbox); 448 inst.$prevbottom = $(".html5-prev-bottom-fullscreen", inst.$lightbox); 449 inst.$nextbottom.click(function() { 450 inst.nextArrowClicked() 451 }); 452 inst.$prevbottom.click(function() { 453 inst.prevArrowClicked() 454 }); 455 inst.$lightbox.append("<div id='html5-close-fullscreen' style='display:block;cursor:pointer;position:absolute;top:0;right:0;margin-top:0;margin-right:0;'><img src='" + inst.options.skinsfolder + 456 inst.options.fullscreencloseimage + "'></div>"); 457 inst.$close = $("#html5-close-fullscreen", inst.$lightbox) 458 } else { 459 inst.$elemWrap.append("<div id='html5-next' style='display:none;cursor:pointer;position:absolute;right:" + inst.options.bordersize + "px;top:50%;margin-top:-16px;'><img src='" + inst.options.skinsfolder + inst.options.nextimage + "'></div>" + "<div id='html5-prev' style='display:none;cursor:pointer;position:absolute;left:" + inst.options.bordersize + "px;top:50%;margin-top:-16px;'><img src='" + inst.options.skinsfolder + 460 inst.options.previmage + "'></div>"); 461 inst.$next = $("#html5-next", inst.$lightbox); 462 inst.$prev = $("#html5-prev", inst.$lightbox); 463 if (inst.options.isTouch && inst.options.navarrowsalwaysshowontouch || inst.options.alwaysshownavarrows) { 464 inst.$lightboxBox.append("<div class='html5-next-touch' style='display:block;cursor:pointer;position:absolute;'><img src='" + inst.options.skinsfolder + inst.options.nextimage + "'></div>" + "<div class='html5-prev-touch' style='display:block;cursor:pointer;position:absolute;'><img src='" + 465 inst.options.skinsfolder + inst.options.previmage + "'></div>"); 466 inst.$nexttouch = $(".html5-next-touch", inst.$lightbox); 467 inst.$prevtouch = $(".html5-prev-touch", inst.$lightbox); 468 inst.$nexttouch.click(function() { 469 inst.nextArrowClicked() 470 }); 471 inst.$prevtouch.click(function() { 472 inst.prevArrowClicked() 473 }) 474 } 475 inst.$lightboxBox.append("<div id='html5-close' style='display:none;cursor:pointer;position:absolute;top:0;right:0;margin-top:-16px;margin-right:-16px;'><img src='" + inst.options.skinsfolder + inst.options.closeimage + "'></div>"); 476 inst.$close = $("#html5-close", inst.$lightbox) 477 } 478 inst.$watermark = $("#html5-watermark", inst.$lightbox); 479 if (inst.options.stamp) inst.$watermark.html("<a href='" + inst.options.freelink + "' style='text-decoration:none;' title='jQuery Lightbox'><div style='display:block;width:170px;height:20px;text-align:center;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;background-color:#fff;color:#333;
479font:12px Arial,sans-serif;'><div style='line-height:20px;'>" + inst.options.freemark + "</div></div></a>"); 480 else if (inst.options.watermark) { 481 var html = "<img src='" + inst.options.watermark + "' style='border:none;' />"; 482 if (inst.options.watermarklink) html = "<a href='" + inst.options.watermarklink + "' target='_blank'>" + html + "</a>"; 483 inst.$watermark.html(html) 484 } 485 if (inst.options.closeonoverlay) $("#html5-lightbox-overlay", inst.$lightbox).click(inst.finish); 486 inst.$close.click(inst.finish); 487 inst.$next.click(function() { 488 inst.nextArrowClicked() 489 }); 490 inst.$prev.click(function() { 491 inst.prevArrowClicked() 492 }); 493 $(window).resize(function() { 494 clearTimeout(inst.options.resizeTimeout); 495 inst.options.resizeTimeout = setTimeout(function() { 496 inst.resizeWindow() 497 }, 500) 498 }); 499 $(window).scroll(function() { 500 inst.scrollBox() 501 }); 502 $(window).bind("orientationchange", function(e) { 503 if (inst.options.isMobile) inst.resizeWindow() 504 }); 505 if (inst.options.isIPhone) { 506 inst.options.windowInnerHeight = window.innerHeight; 507 setInterval(function() { 508 if (inst.options.windowInnerHeight != window.innerHeight) { 509 inst.options.windowInnerHeight = window.innerHeight; 510 inst.resizeWindow() 511 } 512 }, 500) 513 } 514 if (inst.options.enabletouchswipe) inst.enableSwipe(); 515 }; 516 inst.slideTimer = function(interval, callback, updatecallback) { 517 var timerInstance = this; 518 timerInstance.timeout = interval; 519 var updateinterval = 50; 520 var updateTimerId = null; 521 var runningTime = 0; 522 var paused = false; 523 var started = false; 524 var startedandpaused = false; 525 this.pause = function() { 526 if (started) { 527 paused = true; 528 clearInterval(updateTimerId) 529 } 530 }; 531 this.resume = function(forceresume) { 532 if (startedandpaused && !forceresume) return; 533 startedandpaused = false; 534 if (started && paused) { 535 paused = false; 536 updateTimerId = setInterval(function() { 537 runningTime += updateinterval; 538 if (runningTime > timerInstance.timeout) { 539 clearInterval(updateTimerId); 540 if (callback) callback() 541 } 542 if (updatecallback) updatecallback(runningTime / timerInstance.timeout) 543 }, updateinterval) 544 } 545 }; 546 this.stop = function() { 547 clearInterval(updateTimerId); 548 if (updatecallback) updatecallback(-1); 549 runningTime = 0; 550 paused = false; 551 started = false 552 }; 553 this.start = function() { 554 runningTime = 0; 555 paused = false; 556 started = true; 557 updateTimerId = setInterval(function() { 558 runningTime += updateinterval; 559 if (runningTime > timerInstance.timeout) { 560 clearInterval(updateTimerId); 561 if (callback) callback() 562 } 563 if (updatecallback) updatecallback(runningTime / 564 timerInstance.timeout) 565 }, updateinterval) 566 }; 567 this.startandpause = function() { 568 runningTime = 0; 569 paused = true; 570 started = true; 571 startedandpaused = true 572 }; 573 return this 574 }; 575 inst.updateTimer = function(percent) { 576 var w = Math.round(percent * 100); 577 if (w > 100) w = 100; 578 if (w < 0) w = 0; 579 $("#html5-timer", inst.$lightbox).css({ 580 display: "block", 581 width: w + "%" 582 }) 583 }; 584 inst.initSlide = function() {
585 inst.autosliding = false; 586 inst.slideTimeout = inst.slideTimer(inst.options.slideinterval, function() { 587 inst.gotoSlide(-1) 588 }, inst.options.showtimer ? function(percent) { 589 inst.updateTimer(percent) 590 } : 591 null); 592 if (inst.options.autoslide) { 593 inst.slideTimeout.stop(); 594 inst.autosliding = true 595 } 596 }; 597 inst.nextArrowClicked = function() { 598 if (inst.options.nextElem <= inst.options.curElem) 599 if (inst.options.onlastarrowclicked && window[inst.options.onlastarrowclicked] && typeof window[inst.options.onlastarrowclicked] == "function") window[inst.options.onlastarrowclicked](); 600 inst.gotoSlide(-1) 601 }; 602 inst.prevArrowClicked = function() { 603 if (inst.options.prevElem >= inst.options.curElem) 604 if (inst.options.onfirstarrowclicked && window[inst.options.onfirstarrowclicked] && 605 typeof window[inst.options.onfirstarrowclicked] == "function") window[inst.options.onfirstarrowclicked]();
606 inst.gotoSlide(-2) 607 }; 608 inst.calcNextPrevElem = function() { 609 inst.options.nextElem = -1; 610 inst.options.prevElem = -1; 611 inst.options.inGroup = false; 612 inst.options.groupIndex = 0; 613 inst.options.groupCount = 0; 614 var group = inst.elemArray[inst.options.curElem][ELEM_GROUP]; 615 for (var i = 0; i < inst.elemArray.length; i++) 616 if (inst.matchGroup(group, inst.elemArray[i][ELEM_GROUP])) { 617 if (i == inst.options.curElem) inst.options.groupIndex = inst.options.groupCount; 618 inst.options.groupCount++ 619 } 620 var j, curGroup = inst.elemArray[inst.options.curElem][ELEM_GROUP]; 621 if (curGroup != undefined && curGroup != null) { 622 for (j = inst.options.curElem + 1; j < inst.elemArray.length; j++) 623 if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { 624 inst.options.nextElem = j; 625 break 626 } 627 if (inst.options.nextElem < 0) 628 for (j = 0; j < inst.options.curElem; j++) 629 if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { 630 inst.options.nextElem = j; 631 break 632 } 633 if (inst.options.nextElem >= 0) { 634 for (j = inst.options.curElem - 1; j >= 0; j--) 635 if (inst.matchGroup(curGroup, 636 inst.elemArray[j][ELEM_GROUP])) { 637 inst.options.prevElem = j; 638 break 639 } 640 if (inst.options.prevElem < 0) 641 for (j = inst.elemArray.length - 1; j > inst.options.curElem; j--) 642 if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { 643 inst.options.prevElem = j; 644 break 645 } 646 } 647 } 648 if (inst.options.nextElem >= 0 || inst.options.prevElem >= 0) inst.options.inGroup = true 649 }; 650 inst.calcBoxPosition = function(initW, initH) { 651 var boxW = initW + 2 * inst.options.bordersize; 652 var boxH = initH + 2 * inst.options.bordersize; 653 var winH = window.innerHeight ? window.innerHeight : $(window).height(); 654 var boxT = Math.round((winH - inst.options.navheight) / 2 - boxH / 2); 655 if (inst.options.titlestyle == "bottom") boxT -= Math.round(inst.options.barheight / 2); 656 var topmargin = $(window).width() < inst.options.navarrowsbottomscreenwidth ? inst.options.bordertopmarginsmall : inst.options.bordertopmargin; 657 if (boxT < topmargin) boxT = topmargin; 658 if (inst.options.insideiframe && window.self != window.top) 659 if (parent.window.jQuery && parent.window.jQuery("#" + inst.options.iframeid).length) { 660 var iframetop = parent.window.jQuery("#" + inst.options.iframeid).offset().top; 661 var parentscroll = parent.window.document.body.scrollTop; 662 boxT = topmargin; 663 boxT += parentscroll > iframetop ? parentscroll - iframetop : 0 664 } 665 return [boxW, boxH, boxT] 666 }; 667 inst.hideNavArrows = function() { 668 var showPrev = false; 669 var showNext = false; 670 if (inst.options.inGroup) { 671 if (inst.options.arrowloop || !inst.options.arrowloop && inst.options.prevElem < inst.options.curElem) showPrev = true; 672 if (inst.options.arrowloop || !inst.options.arrowloop && inst.options.prevElem < inst.options.curElem) showNext = true 673 } 674 if (showPrev) { 675 inst.$prev.removeClass("html5-hide"); 676 if (inst.$prevbottom) inst.$prevbottom.removeClass("html5-hide"); 677 if (inst.$prevtouch) inst.$prevtouch.removeClass("html5-hide") 678 } else { 679 inst.$prev.addClass("html5-hide"); 680 if (inst.$prevbottom) inst.$prevbottom.addClass("html5-hide"); 681 if (inst.$prevtouch) inst.$prevtouch.addClass("html5-hide") 682 } 683 if (showNext) { 684 inst.$next.removeClass("html5-hide"); 685 if (inst.$nextbottom) inst.$nextbottom.removeClass("html5-hide"); 686 if (inst.$nexttouch) inst.$nexttouch.removeClass("html5-hide") 687 } else { 688 inst.$next.addClass("html5-hide"); 689 if (inst.$nextbottom) inst.$nextbottom.addClass("html5-hide"); 690 if (inst.$nexttouch) inst.$nexttouch.addClass("html5-hide") 691 } 692 }; 693 inst.clickHandler = function() { 694 var $this = $(this); 695 var dataoptions = {}; 696 $.each($this.data(), function(key, value) { 697 dataoptions[key.toLowerCase()] = value 698 }); 699 inst.options = $.extend(inst.options, inst.defaultoptions, dataoptions); 700 $(window).trigger("html5lightbox.lightboxshow");
701 inst.init(); 702 if (inst.elemArray.length <= 0) return true; 703 inst.hideObjects(); 704 for (var i = 0; i < inst.elemArray.length; i++) 705 if (inst.elemArray[i][ELEM_HREF] == $this.attr("href")) break; 706 if (i == inst.elemArray.length) return true; 707 inst.options.curElem = i; 708 inst.calcNextPrevElem(); 709 inst.reset(); 710 inst.$lightbox.show(); 711 var boxPos = inst.calcBoxPosition(inst.options.loadingwidth, inst.options.loadingheight); 712 var boxW = boxPos[0]; 713 var boxH = boxPos[1]; 714 var boxT = boxPos[2]; 715 if (inst.options.iequirksmode) inst.$lightboxBox.css({ 716 "top": boxT 717 }); 718 else inst.$lightboxBox.css({ 719 "margin-top": boxT 720 }); 721 if (!inst.options.positionFixed) inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); 722 if (inst.options.titlestyle == "left" || inst.options.titlestyle == 723 "right") inst.$lightboxBox.css({ 724 "width": boxW, 725 "height": boxH 726 }); 727 else { 728 inst.$lightboxBox.css({ 729 "width": boxW, 730 "height": "auto" 731 }); 732 inst.$elemWrap.css({ 733 "width": boxW, 734 "height": boxH 735 }) 736 } 737 inst.loadCurElem(); 738 return false 739 }; 740 inst.loadThumbnail = function(src, index) { 741 var imgLoader = new Image; 742 $(imgLoader).load(function() { 743 var style; 744 if (this.width / this.height <= inst.options.thumbwidth / inst.options.thumbheight) style = "width:100%;"; 745 else style = "height:100%;"; 746 $(".html5-nav-thumb").eq(index).html("<img style='" + style + "' src='" + src + "' />") 747 }); 748 imgLoader.src = src 749 }; 750 inst.matchGroup = function(curGroup, elemGroup) { 751 if (!curGroup || !elemGroup) return false; 752 var curs = curGroup.split(":"); 753 var elems = elemGroup.split(":"); 754 var result = false; 755 for (var i in curs) 756 if ($.inArray(curs[i], elems) > -1) { 757 result = true; 758 break 759 } 760 return result 761 }; 762 inst.showNavigation = function() { 763 if (!inst.options.shownavigation) return; 764 if (!inst.currentElem || !inst.currentElem[ELEM_GROUP]) return; 765 var i; 766 var showNav = false; 767 var group = inst.currentElem[ELEM_GROUP]; 768 for (i = 0; i < inst.elemArray.length; i++) 769 if (inst.matchGroup(group, 770 inst.elemArray[i][ELEM_GROUP])) 771 if (inst.elemArray[i][ELEM_THUMBNAIL] && inst.elemArray[i][ELEM_THUMBNAIL].length > 0) { 772 showNav = true; 773 break 774 } 775 if (!showNav) return; 776 inst.options.navheight = inst.options.thumbheight + inst.options.thumbtopmargin + inst.options.thumbbottommargin; 777 if ($(".html5-nav").length > 0) return; 778 $("body").append("<div class='html5-nav' style='display:block;position:fixed;bottom:0;left:0;width:100%;height:" + inst.options.navheight + "px;z-index:9999999;'>" + "<div class='html5-nav-container' style='position:relative;margin:" + 779 inst.options.thumbtopmargin + "px auto " + inst.options.thumbbottommargin + "px;'>" + "<div class='html5-nav-prev' style='display:block;position:absolute;cursor:pointer;width:" + inst.options.navbuttonwidth + 'px;height:100%;left:0;top:0;background:url("' + inst.options.skinsfolder + inst.options.navarrowsprevimage + "\") no-repeat left center;'></div>" + "<div class='html5-nav-mask' style='display:block;position:relative;margin:0 auto;overflow:hidden;'>" + "<div class='html5-nav-list'></div>" + "</div>" + "<div class='html5-nav-next' style='display:block;position:absolute;cursor:pointer;
779width:" + 780 inst.options.navbuttonwidth + 'px;height:100%;right:0;top:0;background:url("' + inst.options.skinsfolder + inst.options.navarrowsnextimage + "\") no-repeat right center;'></div>" + "</div>" + "</div>"); 781 var index = 0; 782 for (i = 0; i < inst.elemArray.length; i++) 783 if (inst.matchGroup(group, inst.elemArray[i][ELEM_GROUP])) 784 if (inst.elemArray[i][ELEM_THUMBNAIL] && inst.elemArray[i][ELEM_THUMBNAIL].length > 0) { 785 $(".html5-nav-list").append("<div class='html5-nav-thumb' data-arrayindex='" + i + "' style='float:left;overflow:hidden;cursor:pointer;opacity:" + 786 inst.options.thumbopacity + ";margin: 0 " + inst.options.thumbgap / 2 + "px;width:" + inst.options.thumbwidth + "px;height:" + inst.options.thumbheight + "px;border:" + inst.options.thumbborder + "px solid " + inst.options.thumbbordercolor + ";'></div>"); 787 this.loadThumbnail(inst.elemArray[i][ELEM_THUMBNAIL], index); 788 index++ 789 } 790 $(".html5-nav-thumb").hover(function() { 791 $(this).css({ 792 opacity: 1 793 }); 794 $(this).css({ 795 border: inst.options.thumbborder + "px solid " + inst.options.thumbhighlightbordercolor 796 }) 797 }, function() { 798 $(this).css({ 799 opacity: inst.options.thumbopacity 800 }); 801 $(this).css({ 802 border: inst.options.thumbborder + "px solid " + inst.options.thumbbordercolor 803 }) 804 }); 805 $(".html5-nav-thumb").click(function() { 806 var index = $(this).data("arrayindex"); 807 if (index >
807= 0) inst.gotoSlide(index) 808 }); 809 inst.options.totalwidth = index * (inst.options.thumbgap + inst.options.thumbwidth + 2 * inst.options.thumbborder); 810 $(".html5-nav-list").css({ 811 display: "block", 812 position: "relative", 813 "margin-left": 0, 814 width: inst.options.totalwidth + "px" 815 }).append("<div style='clear:both;'></div>"); 816 var $navMask = $(".html5-nav-mask"); 817 var $navPrev = 818 $(".html5-nav-prev"); 819 var $navNext = $(".html5-nav-next"); 820 $navPrev.click(function() { 821 var $navList = $(".html5-nav-list"); 822 var $navNext = $(".html5-nav-next"); 823 var winWidth = $(window).width(); 824 var maskWidth = winWidth - 2 * inst.options.navbuttonwidth; 825 var marginLeft = parseInt($navList.css("margin-left")) + maskWidth; 826 if (marginLeft >= 0) { 827 marginLeft = 0; 828 $(this).css({ 829 "background-position": "center left" 830 }) 831 } else $(this).css({ 832 "background-position": "center right" 833 }); 834 if (marginLeft <= maskWidth - inst.options.totalwidth) $navNext.css({ 835 "background-position": "center left" 836 }); 837 else $navNext.css({ 838 "background-position": "center right" 839 }); 840 $navList.animate({ 841 "margin-left": marginLeft 842 }) 843 }); 844 $navNext.click(function() { 845 var $navList = $(".html5-nav-list"); 846 var $navPrev = $(".html5-nav-prev"); 847 var winWidth = $(window).width(); 848 var maskWidth = winWidth - 2 * inst.options.navbuttonwidth; 849 var marginLeft = parseInt($navList.css("margin-left")) - maskWidth; 850 if (marginLeft <= maskWidth - inst.options.totalwidth) { 851 marginLeft = maskWidth - inst.options.totalwidth; 852 $(this).css({ 853 "background-position": "center left" 854 }) 855 } else $(this).css({ 856 "background-position": "center right" 857 }); 858 if (marginLeft >= 0) $navPrev.css({ 859 "background-position": "center left" 860 }); 861 else $navPrev.css({ 862 "background-position": "center right" 863 }); 864 $navList.animate({ 865 "margin-left": marginLeft 866 }) 867 }); 868 var winWidth = $(window).width(); 869 if (inst.options.totalwidth <= winWidth) { 870 $navMask.css({ 871 width: inst.options.totalwidth + "px" 872 }); 873 $navPrev.hide(); 874 $navNext.hide() 875 } else { 876 $navMask.css({ 877 width: winWidth - 2 * inst.options.navbuttonwidth + "px" 878 }); 879 $navPrev.show(); 880 $navNext.show() 881 } 882 }; 883 inst.loadElem = function(elem) { 884 inst.currentElem = elem; 885 inst.showing = true; 886 inst.showNavigation(); 887 inst.$elem.unbind("mouseenter").unbind("mouseleave").unbind("mousemove"); 888 inst.$loading.show(); 889 if (inst.options.onshowitem && window[inst.options.onshowitem] && typeof window[inst.options.onshowitem] == "function") window[inst.options.onshowitem](elem); 890 switch (elem[ELEM_TYPE]) { 891 case 0: 892 var imgLoader = new Image; 893 $(imgLoader).load(function() { 894 inst.showImage(elem, imgLoader.width, imgLoader.height) 895 }); 896 $(imgLoader).error(function() { 897 inst.showError() 898 }); 899 imgLoader.src = elem[ELEM_HREF]; 900 break; 901 case 1: 902 inst.showSWF(elem); 903 break; 904 case 2: 905 case 8: 906 inst.showVideo(elem); 907 break; 908 case 3: 909 case 4: 910 case 9: 911 case 11: 912 inst.showYoutubeVimeo(elem); 913 break; 914 case 5: 915 inst.showPDF(elem); 916 break; 917 case 6: 918 inst.showMP3(elem); 919 break; 920 case 7: 921 inst.showWeb(elem); 922 break; 923 case 10: 924 inst.showDiv(elem); 925 break 926 } 927 if (inst.options.googleanalyticsaccount && window._gaq) window._gaq.pu
927sh(["_trackEvent", "Lightbox", "Open", elem[ELEM_HREF]]) 928 }; 929 inst.loadCurElem = function() { 930 inst.loadElem(inst.elemArray[inst.options.curElem]) 931 }; 932 inst.showError = function() { 933 inst.$loading.hide(); 934 inst.resizeLightbox(inst.options.errorwidth, 935 inst.options.errorheight, true, 936 function() { 937 inst.$error.show(); 938 inst.$elem.fadeIn(inst.options.fadespeed, function() { 939 inst.showData() 940 }) 941 }) 942 }; 943 inst.calcTextWidth = function(objW) { 944 return objW - 36 945 }; 946 inst.showTitle = function(w, t, description) { 947 if (inst.options.titlestyle == "inside") inst.$elemData.css({ 948 width: w + "px" 949 }); 950 var text = ""; 951 if (inst.options.showtitle) 952 if (t && t.length > 0) text += t; 953 if (inst.options.inGroup) { 954 if (inst.options.showtitleprefix) text = inst.options.titleprefix.replace("%NUM", inst.options.groupIndex + 1).replace("%TOTAL", 955 inst.options.groupCount) + " " + text; 956 if (inst.options.showplaybutton) text = "<div id='html5-playpause' style='display:inline-block;cursor:pointer;vertical-align:middle;'><div id='html5-play' style='display:block;'><img src='" + inst.options.skinsfolder + inst.options.playimage + "'></div><div id='html5-pause' style='display:none;'><img src='" + inst.options.skinsfolder + inst.options.pauseimage + "'></div></div> " + text 957 } 958 if (inst.options.showdescription && description && description.length > 0) text += '<p class="html5-description">' + 959 description + "</p>"; 960 inst.$text.html(text); 961 if (inst.options.inGroup && inst.options.showplaybutton) { 962 if (inst.autosliding) { 963 $("#html5-play", inst.$lightbox).hide(); 964 $("#html5-pause", inst.$lightbox).show() 965 } else { 966 $("#html5-play", inst.$lightbox).show(); 967 $("#html5-pause", inst.$lightbox).hide() 968 } 969 $("#html5-play", inst.$lightbox).click(function() { 970 $("#html5-play", inst.$lightbox).hide(); 971 $("#html5-pause", inst.$lightbox).show(); 972 if (inst.slideTimeout) { 973 inst.slideTimeout.stop(); 974 inst.slideTimeout.start(); 975 inst.autosliding = true 976 } 977 }); 978 $("#html5-pause", inst.$lightbox).click(function() { 979 $("#html5-play", inst.$lightbox).show(); 980 $("#html5-pause", inst.$lightbox).hide(); 981 if (inst.slideTimeout) { 982 inst.slideTimeout.stop(); 983 inst.autosliding = false 984 } 985 }) 986 } 987 $("#html5-social", inst.$lightbox).show() 988 }, inst.showImage = function(elem, imgW, imgH) { 989 var elemW, elemH; 990 if (elem[ELEM_WIDTH]) elemW = elem[ELEM_WIDTH]; 991 else { 992 elemW = imgW; 993 elem[ELEM_WIDTH] = imgW 994 } 995 if (elem[ELEM_HEIGHT]) elemH = elem[ELEM_HEIGHT]; 996 else { 997 elemH = imgH; 998 elem[ELEM_HEIGHT] = imgH 999 } 1000 var sizeObj = inst.calcElemSize({ 1001 w: elemW, 1002 h: elemH 1003 }, inst.options.imagekeepratio); 1004 inst.resizeLightbox(sizeObj.w, sizeObj.h, true, function() { 1005 inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); 1006 var timercode = !inst.options.showtimer || !inst.options.inGroup ? "" : "<div id='html5-timer' style='display:none;position:absolute;" + inst.options.timerposition + ":0;left:0;width:0;height:" + inst.options.timerheight + "px;background-color:" + inst.options.timercolor + ";opacity:" + inst.options.timeropacity + ";'></div>"; 1007 inst.$image.show(); 1008 inst.$image.html("<div id='html5-image-container' style='display:block;position:relative;width:100%;height:100%;" + 1009 (inst.options.imagekeepratio ? "" : "overflow-x:auto;overflow-y:scroll;-ms-overflow-x:auto;-ms-overflow-y:scroll;") + "'><img src='" + elem[ELEM_HREF] + "' width='100%' height='" + (inst.options.imagekeepratio ? "100%" : "auto") + "' />" + timercode + "</div>"); 1010 inst.$elem.fadeIn(inst.options.fadespeed, function() { 1011 inst.showData() 1012 });
1013 if (inst.autosliding) { 1014 inst.slideTimeout.stop(); 1015 inst.slideTimeout.start() 1016 } 1017 }) 1018 }; 1019 inst.showSWF = function(elem) { 1020 var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : DEFAULT_WIDTH; 1021 var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : 1022 DEFAULT_HEIGHT; 1023 var sizeObj = inst.calcElemSize({ 1024 w: dataW, 1025 h: dataH 1026 }, true); 1027 dataW = sizeObj.w; 1028 dataH = sizeObj.h; 1029 inst.resizeLightbox(dataW, dataH, true, function() { 1030 inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); 1031 inst.$image.html("<div id='html5lightbox-swf' style='display:block;width:100%;height:100%;'></div>").show(); 1032 inst.embedFlash($("#html5lightbox-swf"), elem[ELEM_HREF], "window", { 1033 width: dataW, 1034 height: dataH 1035 }); 1036 inst.$elem.show(); 1037 inst.showData(); 1038 if (inst.autosliding) { 1039 inst.slideTimeout.stop(); 1040 inst.slideTimeout.start() 1041 } 1042 }) 1043 }; 1044 inst.showVideo = function(elem) { 1045 inst.slideTimeout.stop(); 1046 var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : DEFAULT_WIDTH; 1047 var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : DEFAULT_HEIGHT; 1048 var sizeObj = inst.calcElemSize({ 1049 w: dataW, 1050 h: dataH 1051 }, true); 1052 dataW = sizeObj.w; 1053 dataH = sizeObj.h; 1054 inst.resizeLightbox(dataW, dataH, true, function() { 1055 inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); 1056 inst.$image.html("<div id='html5lightbox-video' style='display:block;width:100%;height:100%;overflow:hidden;background-color:" + 1057 inst.options.videobgcolor + ";'></div>").show(); 1058 var isHTML5 = false; 1059 if (inst.options.isIE678 || elem[ELEM_TYPE] == 8 || inst.options.isIE9 && inst.options.useflashonie9 || inst.options.isIE10 && inst.options.useflashonie10 || inst.options.isIE11 && inst.options.useflashonie11) isHTML5 = false; 1060 else if (inst.options.isMobile) isHTML5 = true; 1061 else if ((inst.options.html5player || !inst.options.flashInstalled) && inst.options.html5VideoSupported) 1062 if (!inst.options.isFirefox && !inst.options.isOpera || (inst.options.isFirefox || inst.options.isOpera) && 1063 (elem[ELEM_HREF_OGG] || elem[ELEM_HREF_WEBM])) isHTML5 = true; 1064 if (isHTML5) { 1065 var videoSrc = elem[ELEM_HREF]; 1066 if (inst.options.isFirefox || inst.options.isOpera || !videoSrc) videoSrc = elem[ELEM_HREF_WEBM] ? elem[ELEM_HREF_WEBM] : elem[ELEM_HREF_OGG]; 1067 inst.embedHTML5Video($("#html5lightbox-video"), videoSrc, inst.options.autoplay, inst.options.loopvideo) 1068 } else { 1069 var videoFile = elem[ELEM_HREF]; 1070 if (videoFile.charAt(0) != "/" && videoFile.substring(0, 5) != "http:" && videoFile.substring(0, 6) != "https:") videoFile = inst.options.htmlfolder + videoFile; 1071 inst.embedFlash($("#html5lightbox-video"), inst.options.jsfolder + "html5boxplayer.swf", "transparent", { 1072 width: dataW, 1073 height: dataH, 1074 jsobjectname: "html5Lightbox", 1075 hidecontrols: inst.options.videohidecontrols ? "1" : "0", 1076 hideplaybutton: "0", 1077 videofile: videoFile, 1078 hdfile: "", 1079 ishd: "0", 1080 defaultvolume: inst.options.defaultvideovolume, 1081 autoplay: inst.options.autoplay ? "1" : "0", 1082 loop: inst.options.loopvideo ? "1" : "0", 1083 errorcss: ".html5box-error" + inst.options.errorcss, 1084 id: 0 1085 }) 1086 } 1087 inst.$elem.show(); 1088 inst.showData() 1089 }) 1090 }; 1091 inst.loadNext = function() { 1092 $(window).trigger("html5lightbox.videofinished");
1093 if (inst.autosliding) inst.gotoSlide(-1); 1094 else if (inst.options.autoclose) inst.finish() 1095 }; 1096 inst.getYoutubeParams = function(href) { 1097 var result = {}; 1098 if (href.indexOf("?") < 0) return result; 1099 var params = href.substring(href.indexOf("?") + 1).split("&"); 1100 for (var i = 0; i < params.length; i++) { 1101 var value = params[i].split("="); 1102 if (value && value.length == 2 && value[0].toLowerCase() != "v") result[value[0].toLowerCase()] = value[1] 1103 } 1104 return result 1105 }; 1106 inst.getYoutubeId = function(href) { 1107 var youtubeId = ""; 1108 var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\??v?=?))([^#\&\?]*).*/; 1109 var match = href.match(regExp); 1110 if (match && match[7] && match[7].length == 11) youtubeId = match[7]; 1111 return youtubeId 1112 }; 1113 inst.prepareYoutubeHref = function(href) { 1114 var youtubeId = inst.getYoutubeId(href); 1115 var protocol = "https:"; 1116 var result = protocol + "//www.youtube.com/embed/" + youtubeId; 1117 var params = this.getYoutubeParams(href); 1118 var first = true; 1119 for (var key in params) { 1120 if (first) { 1121 result += "?"; 1122 first = false 1123 } else result += "&"; 1124 result += key + "=" + params[key] 1125 } 1126 return result 1127 }; 1128 inst.prepareDailymotionHref = function(href) { 1129 if (href.match(/\:\/\/.*(dai\.ly)/i)) { 1130 var protocol = 1131 "https:"; 1132 var id = href.match(/(dai\.ly\/)([a-zA-Z0-9\-\_]+)/)[2]; 1133 href = protocol + "//www.dailymotion.com/embed/video/" + id 1134 } 1135 return href 1136 }; 1137 inst.showYoutubeVimeo = function(elem) { 1138 inst.slideTimeout.stop(); 1139 var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : DEFAULT_WIDTH; 1140 var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : DEFAULT_HEIGHT; 1141 var sizeObj = inst.calcElemSize({ 1142 w: dataW, 1143 h: dataH 1144 }, true); 1145 dataW = sizeObj.w; 1146 dataH = sizeObj.h; 1147 inst.resizeLightbox(dataW, dataH, true, function() { 1148 inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); 1149 inst.$image.html("<div id='html5lightbox-video' style='display:block;width:100%;height:100%;overflow:hidden;'></div>").show(); 1150 var href = elem[ELEM_HREF]; 1151 var youtubeid = ""; 1152 if (elem[ELEM_TYPE] == 3) { 1153 youtubeid = inst.getYoutubeId(href); 1154 href = inst.prepareYoutubeHref(href) 1155 } 1156 if (elem[ELEM_TYPE] == 9) href = inst.prepareDailymotionHref(href); 1157 if (inst.options.autoplay) { 1158 href += href.indexOf("?") < 0 ? "?" : "&"; 1159 if (elem[ELEM_TYPE] == 11) href += "autoPlay=true"; 1160 else href += "autoplay=1" 1161 } 1162 if (inst.options.loopvideo) { 1163 href += href.indexOf("?") < 1164 0 ? "?" : "&"; 1165 switch (elem[ELEM_TYPE]) { 1166 case 3: 1167 href += "loop=1&playlist=" + youtubeid; 1168 break; 1169 case 4: 1170 case 9: 1171 href += "loop=1"; 1172 break; 1173 case 11: 1174 href += "endVideoBehavior=loop"; 1175 break 1176 } 1177 } 1178 if (elem[ELEM_TYPE] == 3) { 1179 if (href.indexOf("?") < 0) href += "?wmode=transparent&rel=0"; 1180 else href += "&wmode=transparent&rel=0"; 1181 if (inst.options.videohidecontrols) href += "&controls=0&showinfo=0"; 1182 href += "&enablejsapi=1&origin=" + document.location.protocol + "//" + document.location.hostname 1183 } else if (elem[ELEM_TYPE] == 4) { 1184 href += href.indexOf("?") < 0 ? "?" : "&"; 1185 href += 1186 "api=1&player_id=html5boxiframevideo" 1187 } 1188 $("#html5lightbox-video").html("<iframe id='html5boxiframevideo' width='100%' height='100%' src='" + href + "' frameborder='0' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>"); 1189 inst.$elem.show(); 1190 inst.showData(); 1191 if (elem[ELEM_TYPE] == 3 && typeof YT === "object" && typeof YT.Player === "function") new YT.Player("html5boxiframevideo", { 1192 events: { 1193 "onStateChange": function(event) { 1194 if (event.data == YT.PlayerState.ENDED) { 1195 $(window).trigger("html5lightbox.videofinished");
1196 if (inst.autosliding) inst.gotoSlide(-1); 1197 else if (inst.options.autoclose) inst.finish() 1198 } 1199 } 1200 } 1201 }); 1202 else if (elem[ELEM_TYPE] == 4 && typeof $f === "function") { 1203 var vimeoIframe = $("#html5boxiframevideo")[0]; 1204 var vimeoPlayer = $f(vimeoIframe); 1205 vimeoPlayer.addEvent("ready", function() { 1206 vimeoPlayer.addEvent("finish", function(id) { 1207 $(window).trigger("html5lightbox.videofinished"); 1208 if (inst.autosliding) inst.gotoSlide(-1); 1209 else if (inst.options.autoclose) inst.finish() 1210 }) 1211 }) 1212 } 1213 }) 1214 }; 1215 inst.showPDF = function(elem) {}; 1216 inst.showMP3 = function(elem) {}; 1217 inst.showDiv = function(elem) { 1218 var winWidth = $(window).width(); 1219 var winH = window.innerHeight ? window.innerHeight : $(window).height(); 1220 var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : winWidth; 1221 var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : winH - inst.options.navheight; 1222 var sizeObj = inst.calcElemSize({ 1223 w: dataW, 1224 h: dataH 1225 }, false); 1226 dataW = sizeObj.w; 1227 dataH = sizeObj.h; 1228 inst.resizeLightbox(dataW, dataH, true, function() { 1229 inst.$loading.hide(); 1230 inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); 1231 inst.$image.html("<div id='html5lightbox-div' style='display:block;width:100%;height:100%;" + 1232 (inst.options.isIOS ? "-webkit-overflow-scrolling:touch;overflow-y:scroll;" : "overflow:auto;") + "'></div>").show(); 1233 var divID = elem[ELEM_HREF]; 1234 if ($(divID).length > 0) $("#html5lightbox-div").html($(divID).html()); 1235 else $("#html5lightbox-div").html("<div class='html5-error'>The specified div ID does not exist.</div>"); 1236 inst.$elem.show(); 1237 inst.showData(); 1238 if (inst.autosliding) { 1239 inst.slideTimeout.stop(); 1240 inst.slideTimeout.start() 1241 } 1242 }) 1243 }; 1244 inst.showWeb = function(elem) { 1245 var winWidth = $(window).width(); 1246 var winH = window.innerHeight ? 1247 window.innerHeight : $(window).height(); 1248 var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : winWidth; 1249 var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : winH - inst.options.navheight; 1250 var sizeObj = inst.calcElemSize({ 1251 w: dataW, 1252 h: dataH 1253 }, false); 1254 dataW = sizeObj.w; 1255 dataH = sizeObj.h; 1256 inst.resizeLightbox(dataW, dataH, true, function() { 1257 inst.$loading.hide(); 1258 inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); 1259 inst.$image.html("<div id='html5lightbox-web' style='display:block;width:100%;height:100%;" + (inst.options.isIOS ? "-webkit-overflow-scrolling:touch;overflow-y:scroll;" : 1260 "") + "'></div>").show(); 1261 $("#html5lightbox-web").html("<iframe id='html5lightbox-web-iframe' width='100%' height='100%' src='" + elem[ELEM_HREF] + "' frameborder='0'></iframe>"); 1262 inst.$elem.show(); 1263 inst.showData(); 1264 if (inst.autosliding) { 1265 inst.slideTimeout.stop(); 1266 inst.slideTimeout.start() 1267 } 1268 }) 1269 }; 1270 inst.scrollBox = function() {}; 1271 inst.resizeWindow = function() { 1272 if (!inst.currentElem) return; 1273 if (!inst.options.responsive) return; 1274 var winWidth = $(window).width(); 1275 var winH = window.innerHeight ? window.innerHeight : $(window).height(); 1276 if (inst.options.responsivebarheight) { 1277 if (winH <= 1278 inst.options.smallscreenheight) inst.options.barheight = inst.options.barheightonsmallheight; 1279 else inst.options.barheight = inst.options.barheightoriginal; 1280 if (inst.options.titlestyle == "bottom" && inst.options.barauto
1280height != "auto") inst.$elemData.css({ 1281 height: inst.options.barheight + "px", 1282 "max-height": inst.options.barheight + "px" 1283 }) 1284 } 1285 var elemW, elemH, keepratio; 1286 if (inst.currentElem[ELEM_TYPE] == 7 || inst.currentElem[ELEM_TYPE] == 10) { 1287 elemW = inst.currentElem[ELEM_WIDTH] ? inst.currentElem[ELEM_WIDTH] : winWidth; 1288 elemH = inst.currentElem[ELEM_HEIGHT] ? 1289 inst.currentElem[ELEM_HEIGHT] : winH - inst.options.navheight; 1290 keepratio = false 1291 } else { 1292 elemW = inst.currentElem[ELEM_WIDTH] ? inst.currentElem[ELEM_WIDTH] : DEFAULT_WIDTH; 1293 elemH = inst.currentElem[ELEM_HEIGHT] ? inst.currentElem[ELEM_HEIGHT] : DEFAULT_HEIGHT; 1294 if (inst.currentElem[ELEM_TYPE] == 0) keepratio = inst.options.imagekeepratio; 1295 else keepratio = true 1296 } 1297 var sizeObj = inst.calcElemSize({ 1298 w: elemW, 1299 h: elemH 1300 }, keepratio); 1301 var boxPos = inst.calcBoxPosition(sizeObj.w, sizeObj.h); 1302 var boxW = boxPos[0]; 1303 var boxH = boxPos[1]; 1304 var boxT = boxPos[2]; 1305 inst.$lightboxBox.css({ 1306 "margin-top": boxT 1307 }); 1308 if (!inst.options.positionFixed) inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); 1309 if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") inst.$lightboxBox.css({ 1310 "width": boxW, 1311 "height": boxH 1312 }); 1313 else { 1314 inst.$lightboxBox.css({ 1315 "width": boxW, 1316 "height": "auto" 1317 }); 1318 inst.$elemWrap.css({ 1319 "width": boxW, 1320 "height": boxH 1321 }) 1322 } 1323 if (inst.options.titlestyle == "inside") inst.$elemData.css({ 1324 width: sizeObj.w + "px" 1325 }); 1326 if ($(".html5-nav").length <= 0) return; 1327 $(".html5-nav-list").css({ 1328 "margin-left": 0 1329 }); 1330 var $navMask = $(".html5-nav-mask"); 1331 var $navPrev = $(".html5-nav-prev"); 1332 var $navNext = $(".html5-nav-next"); 1333 var winWidth = $(window).width(); 1334 if (inst.options.totalwidth <= winWidth) { 1335 $navMask.css({ 1336 width: inst.options.totalwidth + "px" 1337 }); 1338 $navPrev.hide(); 1339 $navNext.hide() 1340 } else { 1341 $navMask.css({ 1342 width: winWidth - 2 * inst.options.navbuttonwidth + "px" 1343 }); 1344 $navPrev.show(); 1345 $navNext.show() 1346 } 1347 }; 1348 inst.calcElemSize = function(sizeObj, keepratio) { 1349 if (!inst.options.responsive) return sizeObj; 1350 var winWidth = $(window).width(); 1351 winWidth = winWidth ? winWidth : 1352 $(document).width(); 1353 var winH = window.innerHeight ? window.innerHeight : $(window).height(); 1354 winH = winH ? winH : $(document).height(); 1355 if ((inst.options.titlestyle == "left" || inst.options.titlestyle == "right") && winWidth > inst.options.sidetobottomscreenwidth) sizeObj.w = sizeObj.w * 100 / inst.options.imagepercentage; 1356 var topmargin = $(window).width() < inst.options.navarrowsbottomscreenwidth ? inst.options.bordertopmarginsmall : inst.options.bordertopmargin; 1357 var h0 = winH - inst.options.navheight - 2 * inst.options.bordersize - 2 * topmargin; 1358 if (inst.options.titlestyle == "bottom") h0 -= inst.options.barheight; 1359 if ((inst.options.titlestyle == "left" || inst.options.titlestyle == "right") && winWidth <= inst.options.sidetobottomscreenwidth || inst.options.notkeepratioonsmallheight && winH <= inst.options.smallscreenheight) keepratio = false; 1360 if (sizeObj.h > h0) {
1361 if (keepratio) sizeObj.w = Math.round(sizeObj.w * h0 / sizeObj.h); 1362 sizeObj.h = h0 1363 } 1364 var w0 = winWidth - 2 * inst.options.bordersize - 2 * inst.options.bordermargin; 1365 if (inst.options.fullscreenmode && winWidth > inst.options.navarrowsbottomscreenwidth || 1366 (inst.options.isTouch && inst.options.navarrowsalwaysshowontouch || inst.options.alwaysshownavarrows) && winWidth > inst.options.navarrowsbottomscreenwidth) w0 -= 64; 1367 if (sizeObj.w > w0) { 1368 if (keepratio) sizeObj.h = Math.round(sizeObj.h * w0 / sizeObj.w); 1369 sizeObj.w = w0 1370 } 1371 return sizeObj 1372 }; 1373 inst.showData = function() { 1374 if (inst.$text.text().length > 0) inst.$elemData.show(); 1375 if (inst.options.titlestyle == "bottom" || inst.options.titlestyle == "inside") inst.$lightboxBox.css({ 1376 height: "auto" 1377 }); 1378 if (inst.$text.text().length > 0 && inst.options.titlestyle == 1379 "bottom") inst.$elemData.css({ 1380 "max-height": inst.options.barheight + "px" 1381 }); 1382 $("#html5-lightbox-overlay", inst.$lightbox).css({ 1383 height: Math.max($(window).height(), $(document).height()) 1384 }); 1385 $(window).trigger("html5lightbox.lightboxopened") 1386 }; 1387 inst.resizeLightbox = function(elemW, elemH, bAnimate, onFinish) { 1388 inst.hideNavArrows(); 1389 var boxPos = inst.calcBoxPosition(elemW, elemH); 1390 var boxW = boxPos[0]; 1391 var boxH = boxPos[1]; 1392 var boxT = boxPos[2]; 1393 inst.$loading.hide(); 1394 inst.$watermark.hide(); 1395 if (inst.options.nextElem <= inst.options.curElem) 1396 if (inst.options.onlastitem && 1397 window[inst.options.onlastitem] && typeof window[inst.options.onlastitem] == "function") window[inst.options.onlastitem](inst.currentElem); 1398 if (inst.options.prevElem >= inst.options.curElem) 1399 if (inst.options.onfirstitem && window[inst.options.onfirstitem] && typeof window[inst.options.onfirstitem] == "function") window[inst.options.onfirstitem](inst.currentElem); 1400 if (!inst.options.fullscreenmode && (!inst.options.isTouch || !inst.options.navarrowsalwaysshowontouch) && !inst.options.alwaysshownavarrows) { 1401 inst.$elem.bind("mouseenter mousemove", 1402 function() { 1403 if (inst.options.arrowloop && inst.options.prevElem >= 0 || !inst.options.arrowloop && inst.options.prevElem >= 0 && inst.options.prevElem < inst.options.curElem) inst.$prev.fadeIn(); 1404 if (inst.options.arrowloop && inst.options.nextElem >= 0 || !inst.options.arrowloop && inst.options.nextElem >= 0 && inst.options.nextElem > inst.options.curElem) inst.$next.fadeIn() 1405 }); 1406 inst.$elem.bind("mouseleave", function() { 1407 inst.$next.fadeOut(); 1408 inst.$prev.fadeOut() 1409 }) 1410 } 1411 inst.$lightboxBox.css({ 1412 "margin-top": boxT 1413 }); 1414 if (!inst.options.positionFixed) inst.$lightboxBox.css("margin-top", 1415 $(window).scrollTop() + inst.options.bordertopmargin); 1416 if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { 1417 var speed = bAnimate ? inst.options.resizespeed : 0; 1418 if (boxW == inst.$lightboxBox.width() && boxH == inst.$lightboxBox.height()) speed = 0; 1419 inst.$lightboxBox.animate({ 1420 width: boxW 1421 }, speed).animate({ 1422 height: boxH 1423 }, speed, function() { 1424 inst.onAnimateFinish(onFinish) 1425 }) 1426 } else { 1427 var speed = bAnimate ? inst.options.resizespeed : 0; 1428 if (boxW == inst.$elemWrap.width() && boxH == inst.$elemWrap.height()) speed = 0; 1429 inst.$lightboxBox.css({ 1430 "width": boxW, 1431 "height": "auto" 1432 }); 1433 inst.$elemWrap.animate({ 1434 width: boxW 1435 }, speed).animate({ 1436 height: boxH 1437 }, speed, function() { 1438 inst.onAnimateFinish(onFinish) 1439 }) 1440 } 1441 }; 1442 inst.onAnimateFinish = function(onFinish) { 1443 inst.$loading.show(); 1444 inst.$watermark.show(); 1445 inst.$close.show(); 1446 inst.$elem.css({ 1447 "background-color": inst.options.bgcolor 1448 }); 1449 onFinish() 1450 }; 1451 inst.reset = function() { 1452 if (inst.options.stamp) inst.$watermark.hide(); 1453 inst.showing = false; 1454 inst.$image.empty(); 1455 inst.$text.empty(); 1456 inst.$error.hide(); 1457 inst.$loading.hide(); 1458 inst.$image.hide(); 1459 if (inst.options.titlestyle == 1460 "bottom" || inst.options.titlestyle == "inside") inst.$elemData.hide(); 1461 if (!inst.options.fullscreenmode) inst.$close.hide(); 1462 inst.$elem.css({ 1463 "background-color": "" 1464 }) 1465 }; 1466 inst.resetNavigation = function() { 1467 inst.options.navheight = 0; 1468 $(".html5-nav").remove() 1469 }; 1470 inst.finish = function() { 1471 if ($("#html5-lightbox-video", inst.$lightbox).length) $("#html5-lightbox-video", inst.$lightbox).attr("src", ""); 1472 $("head").find("style").each(function() { 1473 if ($(this).data("creator") == "carousel-html5-lightbox") $(this).remove() 1474 }); 1475 inst.slideTimeout.stop(); 1476 inst.reset(); 1477 inst.resetNavigation(); 1478 inst.$lightbox.remove(); 1479 $("#carousel-html5-lightbox").remove(); 1480 inst.showObjects(); 1481 if (inst.options.oncloselightbox && window[inst.options.oncloselightbox] && typeof window[inst.options.oncloselightbox] == "function") window[inst.options.oncloselightbox](inst.currentElem); 1482 if (inst.onLightboxClosed && typeof inst.onLightboxClosed == "function") inst.onLightboxClosed(inst.currentElem) 1483 }; 1484 inst.pauseSlide = function() {}; 1485 inst.playSlide = function() {};
1486 inst.gotoSlide = function(slide) { 1487 if (slide == 1488 -1) { 1489 if (inst.options.nextElem < 0) return; 1490 inst.options.curElem = inst.options.nextElem 1491 } else if (slide == -2) { 1492 if (inst.options.prevElem < 0) return; 1493 inst.options.curElem = inst.options.prevElem 1494 } else if (slide >= 0) inst.options.curElem = slide; 1495 if (inst.autosliding) inst.slideTimeout.stop(); 1496 inst.calcNextPrevElem(); 1497 inst.reset(); 1498 inst.loadCurElem() 1499 }; 1500 inst.enableSwipe = function() { 1501 inst.$elem.carouselTouchSwipe({ 1502 preventWebBrowser: false, 1503 swipeLeft: function() { 1504 inst.gotoSlide(-1) 1505 }, 1506 swipeRight: function() { 1507 inst.gotoSlide(-2) 1508 } 1509 }) 1510 }; 1511 inst.hideObjects = 1512 function() { 1513 $("select, embed, object").css({ 1514 "visibility": "hidden" 1515 }) 1516 }; 1517 inst.showObjects = function() { 1518 $("select, embed, object").css({ 1519 "visibility": "visible" 1520 }) 1521 }; 1522 inst.embedHTML5Video = function($container, src, autoplay, loopvideo) { 1523 $container.html("<div style='display:block;width:100%;height:100%;position:relative;'><video id='html5-lightbox-video' width='100%' height='100%'" + (inst.options.html5videoposter && inst.options.html5videoposter.length > 0 ? "poster='" + inst.options.html5videoposter + "'" : "") + (autoplay ? " autoplay" : 1524 "") + (loopvideo ? " loop" : "") + (inst.options.nativehtml5controls && !inst.options.videohidecontrols ? " controls='controls'" : "") + " src='" + src + "'></div>"); 1525 if (!inst.options.nativehtml5controls) { 1526 $("video", $container).data("src", src); 1527 $("video", $container).acHTML5VideoControls(inst.options.skinsfolder, inst, inst.options.videohidecontrols, false, inst.options.defaultvideovolume) 1528 } 1529 $("video", $container).unbind("ended").bind("ended", function() { 1530 $(window).trigger("html5lightbox.videofinished");
1531 if (inst.autosliding) inst.gotoSlide(-1); 1532 else if (inst.options.autoclose) inst.finish() 1533 }) 1534 }; 1535 inst.embedFlash = function($container, src, wmode, flashVars) { 1536 if (inst.options.flashInstalled) { 1537 var htmlOptions = { 1538 pluginspage: "http://www.adobe.com/go/getflashplayer", 1539 quality: "high", 1540 allowFullScreen: "true", 1541 allowScriptAccess: "always", 1542 type: "application/x-shockwave-flash" 1543 }; 1544 htmlOptions.width = "100%"; 1545 htmlOptions.height = "100%"; 1546 htmlOptions.src = src; 1547 htmlOptions.flashVars = $.param(flashVars); 1548 htmlOptions.wmode = wmode; 1549 var htmlString = ""; 1550 for (var key in htmlOptions) htmlString += 1551 key + "=" + htmlOptions[key] + " "; 1552 $container.html("<embed " + htmlString + "/>") 1553 } else $container.html("<div class='html5lightbox-flash-error' style='display:block; position:relative;text-align:center; width:100%; left:0px; top:40%;'><div class='html5-error'><div>The required Adobe Flash Player plugin is not installed</div><br /><div style='display:block;position:relative;text-align:center;width:112px;height:33px;margin:0px auto;'><a href='http://www.adobe.com/go/getflashplayer'><img src='http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' width='112' height='33'></img></a></div></div>") 1554 }; 1555 inst.checkType = function(href) { 1556 if (!href) return -1; 1557 if (href.match(/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i)) return 0; 1558 if (href.match(/[^\.]\.(swf)\s*$/i)) return 1; 1559 if (href.match(/\.(mp4|m4v|ogv|ogg|webm)(.*)?$/i)) return 2; 1560 if (href.match(/\:\/\/.*(youtube\.com)/i) || href.match(/\:\/\/.*(youtu\.be)/i)) return 3; 1561 if (href.match(/\:\/\/.*(vimeo\.com)/i)) return 4; 1562 if (href.match(/\:\/\/.*(dailymotion\.com)/i) || href.match(/\:\/\/.*(dai\.ly)/i)) return 9; 1563 if (href.match(/[^\.]\.(pdf)\s*$/i)) return 5; 1564 if (href.match(/[^\.]\.(mp3)\s*$/i)) return 6; 1565 if (href.match(/[^\.]\.(flv)\s*$/i)) return 8; 1566 if (href.match(/\#\w+/i)) return 10; 1567 if (href.match(/\:\/\/.*(wistia)/i)) return 11; 1568 return 7 1569 }; 1570 inst.getURLParams = function() { 1571 var result = {}; 1572 var params = window.location.search.substring(1).split("&"); 1573 for (var i = 0; i < params.length; i++) { 1574 var value = params[i].split("="); 1575 if (value && value.length == 2) result[value[0].toLowerCase()] = unescape(value[1]) 1576 } 1577 return result 1578 }; 1579 inst.absoluteUrl = function(href) { 1580 var link = document.createElement("a"); 1581 link.href = href; 1582 return link.protocol + "//" + link.host + 1583 link.pathname + link.search + link.hash 1584 }; 1585 inst.showLightbox = function(type, href, title, width, height, webm, ogg, thumbnail, description) { 1586 inst.options = $.extend(inst.options, inst.defaultoptions); 1587 $(window).trigger("html5lightbox.lightboxshow"); 1588 inst.init(); 1589 inst.reset(); 1590 inst.$lightbox.show(); 1591 var boxPos = inst.calcBoxPosition(inst.options.loadingwidth, inst.options.loadingheight); 1592 var boxW = boxPos[0]; 1593 var boxH = boxPos[1]; 1594 var boxT = boxPos[2]; 1595 inst.$lightboxBox.css({ 1596 "margin-top": boxT 1597 }); 1598 if (!inst.options.positionFixed) inst.$lightboxBox.css("margin-top", 1599 $(window).scrollTop() + inst.options.bordertopmargin); 1600 if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") inst.$lightboxBox.css({ 1601 "width": boxW, 1602 "height": boxH 1603 }); 1604 else { 1605 inst.$lightboxBox.css({ 1606 "width": boxW, 1607 "height": "auto" 1608 }); 1609 inst.$elemWrap.css({ 1610 "width": boxW, 1611 "height": boxH 1612 }) 1613 } 1614 inst.loadElem(new Array(type, href, title, null, width, height, webm, ogg, thumbnail, description)) 1615 }; 1616 inst.addItem = function(href, title, group, width, height, webm, ogg, thumbnail, description, mediatype) { 1617 type = mediatype && mediatype >= 0 ? mediatype : 1618 inst.checkType(href); 1619 inst.elemArray.push(new Array(type, href, title, group, width, height, webm, ogg, thumbnail, description)) 1620 }; 1621 inst.showItem = function(href) { 1622 inst.options = $.extend(inst.options, inst.defaultoptions); 1623 $(window).trigger("html5lightbox.lightboxshow");
1624 inst.init(); 1625 if (inst.elemArray.length <= 0) return true; 1626 inst.hideObjects(); 1627 for (var i = 0; i < inst.elemArray.length; i++) 1628 if (inst.elemArray[i][ELEM_HREF] == href) break; 1629 if (i == inst.elemArray.length) return true; 1630 inst.options.curElem = i; 1631 inst.calcNextPrevElem(); 1632 inst.reset(); 1633 inst.$lightbox.show(); 1634 var boxPos = inst.calcBoxPosition(inst.options.loadingwidth, inst.options.loadingheight); 1635 var boxW = boxPos[0]; 1636 var boxH = boxPos[1]; 1637 var boxT = boxPos[2]; 1638 inst.$lightboxBox.css({ 1639 "margin-top": boxT 1640 }); 1641 if (!inst.options.positionFixed) inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); 1642 if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") inst.$lightboxBox.css({ 1643 "width": boxW, 1644 "height": boxH 1645 }); 1646 else { 1647 inst.$lightboxBox.css({ 1648 "width": boxW, 1649 "height": "auto" 1650 }); 1651 inst.$elemWrap.css({ 1652 "width": boxW, 1653 "height": boxH 1654 }) 1655 } 1656 inst.loadCurElem(); 1657 return false 1658 }; 1659 inst.unbind("click").click(inst.clickHandler); 1660 inst.each(function() { 1661 var self = $(this); 1662 if (self.data("autoopen")) { 1663 setTimeout(function() { 1664 self.click() 1665 }, self.data("autoopendelay") ? self.data("autoopendelay") : 0); 1666 return false 1667 } 1668 }); 1669 var urlParams = inst.getURLParams(); 1670 if ("wpcarousellightboxshare" in urlParams) { 1671 var shareUrl = decodeURIComponent(urlParams["wpcarousellightboxshare"]); 1672 var shareLink = $('.wondercarousellightbox[href="' + shareUrl + '"]'); 1673 if (shareLink.length > 1674 0) shareLink.click() 1675 } 1676 return inst 1677 } 1678})(jQuery); 1679(function($) { 1680 $.fn.acHTML5VideoControls = function(skinFolder, parentInst, hidecontrols, hideplaybutton, defaultvolume) { 1681 var isTouch = "ontouchstart" in window; 1682 var eStart = isTouch ? "touchstart" : "mousedown"; 1683 var eMove = isTouch ? "touchmove" : "mousemove"; 1684 var eCancel = isTouch ? "touchcancel" : "mouseup"; 1685 var eClick = "click"; 1686 var BUTTON_SIZE = 32; 1687 var BAR_HEIGHT = isTouch ? 48 : 36; 1688 var hideControlsTimerId = null; 1689 var hideVolumeBarTimeoutId = null; 1690 var sliderDragging = false; 1691 var isFullscreen = false; 1692 var userActive = true; 1693 var isIPhone = navigator.userAgent.match(/iPod/i) != 1694 null || navigator.userAgent.match(/iPhone/i) != null; 1695 var isHd = $(this).data("ishd"); 1696 var hd = $(this).data("hd"); 1697 var src = $(this).data("src"); 1698 var $videoObj = $(this); 1699 $videoObj.get(0).removeAttribute("controls"); 1700 if (isIPhone) { 1701 var h = $videoObj.height() - BAR_HEIGHT; 1702 $videoObj.css({ 1703 height: h 1704 }) 1705 } 1706 var $videoPlay = $("<div class='html5boxVideoPlay'></div>"); 1707 if (!isIPhone) { 1708 $videoObj.after($videoPlay); 1709 $videoPlay.css({ 1710 position: "absolute", 1711 top: "50%", 1712 left: "50%", 1713 display: "block", 1714 cursor: "pointer", 1715 width: 64, 1716 height: 64, 1717 "margin-left": -32, 1718 "margin-top": -32, 1719 "background-image": "url('" + skinFolder + "html5boxplayer_playvideo.png" + "')", 1720 "background-position": "center center", 1721 "background-repeat": "no-repeat" 1722 }).bind(eClick, function() { 1723 $videoObj.get(0).play() 1724 }) 1725 } 1726 var $videoFullscreenBg = $("<div class='html5boxVideoFullscreenBg'></div>"); 1727 var $videoControls = $("<div class='html5boxVideoControls'>" + "<div class='html5boxVideoControlsBg'></div>" + "<div class='html5boxPlayPause'>" + "<div class='html5boxPlay'></div>" + "<div class='html5boxPause'></div>" + "</div>" + 1728 "<div class='html5boxTimeCurrent'>--:--</div>" + "<div class='html5boxFullscreen'></div>" + "<div class='html5boxHD'></div>" + "<div class='html5boxVolume'>" + "<div class='html5boxVolumeButton'></div>" + "<div class='html5boxVolumeBar'>" + "<div class='html5boxVolumeBarBg'>" + "<div class='html5boxVolumeBarActive'></div>" + "</div>" + "</div>" + "</div>" + "<div class='html5boxTimeTotal'>--:--</div>" + "<div class='html5boxSeeker'>" + "<div class='html5boxSeekerBuffer'></div>" + "<div class='html5boxSeekerPlay'></div>" + "<div class='html5boxSeekerHandler'></div>" + 1729 "</div>" + "<div style='clear:both;'></div>" + "</div>"); 1730 $videoObj.after($videoControls); 1731 $videoObj.after($videoFullscreenBg); 1732 $videoFullscreenBg.css({ 1733 display: "none", 1734 position: "fixed", 1735 left: 0, 1736 top: 0, 1737 bottom: 0, 1738 right: 0, 1739 "z-index": 2147483647 1740 }); 1741 $videoControls.css({ 1742 display: "block", 1743 position: "absolute",
1744 width: "100%", 1745 height: BAR_HEIGHT, 1746 left: 0, 1747 bottom: 0, 1748 right: 0, 1749 "max-width": "640px", 1750 margin: "0 auto" 1751 }); 1752 var userActivate = function() { 1753 userActive = true 1754 }; 1755 $videoObj.bind(eClick, function() { 1756 userActive = true 1757 }).hover(function() { 1758 userActive = 1759 true 1760 }, function() { 1761 userActive = false 1762 }); 1763 if (!hidecontrols) setInterval(function() { 1764 if (userActive) { 1765 $videoControls.show(); 1766 userActive = false; 1767 clearTimeout(hideControlsTimerId); 1768 hideControlsTimerId = setTimeout(function() { 1769 if (!$videoObj.get(0).paused) $videoControls.fadeOut() 1770 }, 5E3) 1771 } 1772 }, 250); 1773 $(".html5boxVideoControlsBg", $videoControls).css({ 1774 display: "block", 1775 position: "absolute", 1776 width: "100%", 1777 height: "100%", 1778 left: 0, 1779 top: 0, 1780 "background-color": "#000000", 1781 opacity: 0.7, 1782 filter: "alpha(opacity=70)" 1783 }); 1784 $(".html5boxPlayPause", $videoControls).css({ 1785 display: "block", 1786 position: "relative", 1787 width: BUTTON_SIZE + "px", 1788 height: BUTTON_SIZE + "px", 1789 margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), 1790 "float": "left" 1791 }); 1792 var $videoBtnPlay = $(".html5boxPlay", $videoControls); 1793 var $videoBtnPause = $(".html5boxPause", $videoControls); 1794 $videoBtnPlay.css({ 1795 display: "block", 1796 position: "absolute", 1797 top: 0, 1798 left: 0, 1799 width: BUTTON_SIZE + "px", 1800 height: BUTTON_SIZE + "px", 1801 cursor: "pointer", 1802 "background-image": "url('" + skinFolder + "html5boxplayer_playpause.png" + "')", 1803 "background-position": "top left" 1804 }).hover(function() { 1805 $(this).css({ 1806 "background-position": "bottom left" 1807 }) 1808 }, 1809 function() { 1810 $(this).css({ 1811 "background-position": "top left" 1812 }) 1813 }).bind(eClick, function() { 1814 $videoObj.get(0).play() 1815 }); 1816 $videoBtnPause.css({ 1817 display: "none", 1818 position: "absolute", 1819 top: 0, 1820 left: 0, 1821 width: BUTTON_SIZE + "px", 1822 height: BUTTON_SIZE + "px", 1823 cursor: "pointer", 1824 "background-image": "url('" + skinFolder + "html5boxplayer_playpause.png" + "')", 1825 "background-position": "top right" 1826 }).hover(function() { 1827 $(this).css({ 1828 "background-position": "bottom right" 1829 }) 1830 }, function() { 1831 $(this).css({ 1832 "background-position": "top right" 1833 }) 1834 }).bind(eClick, function() { 1835 $videoObj.get(0).pause() 1836 }); 1837 var $videoTimeCurrent = $(".html5boxTimeCurrent", $videoControls); 1838 var $videoTimeTotal = $(".html5boxTimeTotal", $videoControls); 1839 var $videoSeeker = $(".html5boxSeeker", $videoControls); 1840 var $videoSeekerPlay = $(".html5boxSeekerPlay", $videoControls); 1841 var $videoSeekerBuffer = $(".html5boxSeekerBuffer", $videoControls); 1842 var $videoSeekerHandler = $(".html5boxSeekerHandler", $videoControls); 1843 $videoTimeCurrent.css({ 1844 display: "block", 1845 position: "relative", 1846 "float": "left", 1847 "line-height": BAR_HEIGHT + "px", 1848 "font-weight": "normal", 1849 "font-size": "12px", 1850 margin: "0 8px", 1851 "font-family": "Arial, Helvetica, sans-serif", 1852 color: "#fff" 1853 }); 1854 $videoTimeTotal.css({ 1855 display: "block", 1856 position: "relative", 1857 "float": "right", 1858 "line-height": BAR_HEIGHT + "px", 1859 "font-weight": "normal", 1860 "font-size": "12px", 1861 margin: "0 8px", 1862 "font-family": "Arial, Helvetica, sans-serif", 1863 color: "#fff" 1864 }); 1865 $videoSeeker.css({ 1866 display: "block", 1867 cursor: "pointer", 1868 overflow: "hidden", 1869 position: "relative", 1870 height: "10px", 1871 "background-color": "#222", 1872 margin: Math.floor((BAR_HEIGHT - 10) / 2) + "px 4px" 1873 }).bind(eStart, function(e) { 1874 var e0 = 1875 isTouch ? e.originalEvent.touches[0] : e; 1876 var pos = e0.pageX - $videoSeeker.offset().left; 1877 $videoSeekerPlay.css({ 1878 width: pos 1879 }); 1880 $videoObj.get(0).currentTime = pos * $videoObj.get(0).duration / $videoSeeker.width(); 1881 $videoSeeker.bind(eMove, function(e) { 1882 var e0 = isTouch ? e.originalEvent.touches[0] : e; 1883 var pos = e0.pageX - $videoSeeker.offset().left; 1884 $videoSeekerPlay.css({ 1885 width: pos 1886 }); 1887 $videoObj.get(0).currentTime = pos * $videoObj.get(0).duration / $videoSeeker.width() 1888 }) 1889 }).bind(eCancel, function() { 1890 $videoSeeker.unbind(eMove) 1891 }); 1892 $videoSeekerBuffer.css({ 1893 display: "block", 1894 position: "absolute",
1895 left: 0, 1896 top: 0, 1897 height: "100%", 1898 "background-color": "#444" 1899 }); 1900 $videoSeekerPlay.css({ 1901 display: "block", 1902 position: "absolute", 1903 left: 0, 1904 top: 0, 1905 height: "100%", 1906 "background-color": "#fcc500" 1907 }); 1908 if (!isIPhone && ($videoObj.get(0).requestFullscreen || $videoObj.get(0).webkitRequestFullScreen || $videoObj.get(0).mozRequestFullScreen || $videoObj.get(0).webkitEnterFullScreen || $videoObj.get(0).msRequestFullscreen)) { 1909 var switchScreen = function(fullscreen) { 1910 if (fullscreen) { 1911 if ($videoObj.get(0).requestFullscreen) $videoObj.get(0).requestFullscreen(); 1912 else if ($videoObj.get(0).webkitRequestFullScreen) $videoObj.get(0).webkitRequestFullScreen(); 1913 else if ($videoObj.get(0).mozRequestFullScreen) $videoObj.get(0).mozRequestFullScreen(); 1914 else if ($videoObj.get(0).webkitEnterFullScreen) $videoObj.get(0).webkitEnterFullScreen(); 1915 if ($videoObj.get(0).msRequestFullscreen) $videoObj.get(0).msRequestFullscreen() 1916 } else if (document.cancelFullScreen) document.cancelFullScreen(); 1917 else if (document.mozCancelFullScreen) document.mozCancelFullScreen(); 1918 else if (document.webkitCancelFullScreen) document.webkitCancelFullScreen(); 1919 else if (document.webkitExitFullscreen) document.webkitExitFullscreen(); 1920 else if (document.msExitFullscreen) document.msExitFullscreen() 1921 }; 1922 var switchScreenCSS = function(fullscreen) { 1923 $videoControls.css({ 1924 position: fullscreen ? "fixed" : "absolute" 1925 }); 1926 var backgroundPosY = $videoFullscreen.css("background-position") ? $videoFullscreen.css("background-position").split(" ")[1] : $videoFullscreen.css("background-position-y"); 1927 $videoFullscreen.css({ 1928 "background-position": (fullscreen ? "right" : "left") + " " + backgroundPosY 1929 }); 1930 $videoFullscreenBg.css({ 1931 display: fullscreen ? 1932 "block" : "none" 1933 }); 1934 if (fullscreen) { 1935 $(document).bind("mousemove", userActivate); 1936 $videoControls.css({ 1937 "z-index": 2147483647 1938 }) 1939 } else { 1940 $(document).unbind("mousemove", userActivate); 1941 $videoControls.css({ 1942 "z-index": "" 1943 }) 1944 } 1945 }; 1946 document.addEventListener("fullscreenchange", function() { 1947 isFullscreen = document.fullscreen;
1948 switchScreenCSS(document.fullscreen) 1949 }, false); 1950 document.addEventListener("mozfullscreenchange", function() { 1951 isFullscreen = document.mozFullScreen; 1952 switchScreenCSS(document.mozFullScreen) 1953 }, false); 1954 document.addEventListener("webkitfullscreenchange", 1955 function() { 1956 isFullscreen = document.webkitIsFullScreen; 1957 switchScreenCSS(document.webkitIsFullScreen) 1958 }, false); 1959 $videoObj.get(0).addEventListener("webkitbeginfullscreen", function() { 1960 isFullscreen = true 1961 }, false); 1962 $videoObj.get(0).addEventListener("webkitendfullscreen", function() { 1963 isFullscreen = false 1964 }, false); 1965 $("head").append("<style type='text/css'>video::-webkit-media-controls { display:none !important; }</style>"); 1966 var $videoFullscreen = $(".html5boxFullscreen", $videoControls); 1967 $videoFullscreen.css({ 1968 display: "block", 1969 position: "relative", 1970 "float": "right", 1971 width: BUTTON_SIZE + "px", 1972 height: BUTTON_SIZE + "px", 1973 margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), 1974 cursor: "pointer", 1975 "background-image": "url('" + skinFolder + "html5boxplayer_fullscreen.png" + "')", 1976 "background-position": "left top" 1977 }).hover(function() { 1978 var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); 1979 $(this).css({ 1980 "background-position": backgroundPosX + " bottom" 1981 }) 1982 }, function() { 1983 var backgroundPosX = 1984 $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); 1985 $(this).css({ 1986 "background-position": backgroundPosX + " top" 1987 }) 1988 }).bind(eClick, function() { 1989 isFullscreen = !isFullscreen; 1990 switchScreen(isFullscreen) 1991 }) 1992 } 1993 if (hd) { 1994 var $videoHD = $(".html5boxHD", $videoControls); 1995 $videoHD.css({ 1996 display: "block", 1997 position: "relative", 1998 "float": "right", 1999 width: BUTTON_SIZE + "px", 2000 height: BUTTON_SIZE + "px", 2001 margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), 2002 cursor: "pointer", 2003 "background-image": "url('" + 2004 skinFolder + "html5boxplayer_hd.png" + "')", 2005 "background-position": (isHd ? "right" : "left") + " center" 2006 }).bind(eClick, function() { 2007 isHd = !isHd; 2008 $(this).css({ 2009 "background-position": (isHd ? "right" : "left") + " center" 2010 }); 2011 parentInst.isHd = isHd; 2012 var isPaused = $videoObj.get(0).isPaused; 2013 $videoObj.get(0).setAttribute("src", (isHd ? hd : src) + "#t=" + $videoObj.get(0).currentTime); 2014 if (!isPaused) $videoObj.get(0).play(); 2015 else if (!isIPhone) $videoObj.get(0).pause() 2016 }) 2017 } 2018 $videoObj.get(0).volume = defaultvolume; 2019 var volumeSaved = defaultvolume == 0 ? 1 : defaultvolume; 2020 var volume = $videoObj.get(0).volume; 2021 $videoObj.get(0).volume = volume / 2 + 0.1; 2022 if ($videoObj.get(0).volume === volume / 2 + 0.1) { 2023 $videoObj.get(0).volume = volume; 2024 var $videoVolume = $(".html5boxVolume", $videoControls); 2025 var $videoVolumeButton = $(".html5boxVolumeButton", $videoControls); 2026 var $videoVolumeBar = $(".html5boxVolumeBar", $videoControls); 2027 var $videoVolumeBarBg = $(".html5boxVolumeBarBg", $videoControls); 2028 var $videoVolumeBarActive = $(".html5boxVolumeBarActive", $videoControls); 2029 $videoVolume.css({ 2030 display: "block", 2031 position: "relative", 2032 "float": "right", 2033 width: BUTTON_SIZE + "px", 2034 height: BUTTON_SIZE + "px", 2035 margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2) 2036 }).hover(function() { 2037 clearTimeout(hideVolumeBarTimeoutId); 2038 var volume = $videoObj.get(0).volume; 2039 $videoVolumeBarActive.css({ 2040 height: Math.round(volume * 100) + "%" 2041 }); 2042 $videoVolumeBar.show() 2043 }, function() { 2044 clearTimeout(hideVolumeBarTimeoutId); 2045 hideVolumeBarTimeoutId = setTimeout(function() { 2046 $videoVolumeBar.hide() 2047 }, 1E3) 2048 }); 2049 $videoVolumeButton.css({ 2050 display: "block", 2051 position: "absolute",
2052 top: 0, 2053 left: 0, 2054 width: BUTTON_SIZE + 2055 "px", 2056 height: BUTTON_SIZE + "px", 2057 cursor: "pointer", 2058 "background-image": "url('" + skinFolder + "html5boxplayer_volume.png" + "')", 2059 "background-position": "top " + (volume > 0 ? "left" : "right") 2060 }).hover(function() { 2061 var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); 2062 $(this).css({ 2063 "background-position": backgroundPosX + " bottom" 2064 }) 2065 }, function() { 2066 var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : 2067 $(this).css("background-position-x"); 2068 $(this).css({ 2069 "background-position": backgroundPosX + " top" 2070 }) 2071 }).bind(eClick, function() { 2072 var volume = $videoObj.get(0).volume; 2073 if (volume > 0) { 2074 volumeSaved = volume; 2075 volume = 0 2076 } else volume = volumeSaved; 2077 var backgroundPosY = $(this).css("background-position") ? $(this).css("background-position").split(" ")[1] : $(this).css("background-position-y"); 2078 $videoVolumeButton.css({ 2079 "background-position": (volume > 0 ? "left" : "right") + " " + backgroundPosY 2080 }); 2081 $videoObj.get(0).volume = volume; 2082 $videoVolumeBarActive.css({ 2083 height: Math.round(volume * 2084 100) + "%" 2085 }) 2086 }); 2087 $videoVolumeBar.css({ 2088 display: "none", 2089 position: "absolute", 2090 left: 4, 2091 bottom: "100%", 2092 width: 24, 2093 height: 80, 2094 "margin-bottom": Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), 2095 "background-color": "#000000", 2096 opacity: 0.7, 2097 filter: "alpha(opacity=70)" 2098 }); 2099 $videoVolumeBarBg.css({ 2100 display: "block", 2101 position: "relative", 2102 width: 10, 2103 height: 68, 2104 margin: 7, 2105 cursor: "pointer", 2106 "background-color": "#222" 2107 }); 2108 $videoVolumeBarActive.css({ 2109 display: "block", 2110 position: "absolute", 2111 bottom: 0, 2112 left: 0, 2113 width: "100%", 2114 height: "100%", 2115 "background-color": "#fcc500" 2116 }); 2117 $videoVolumeBarBg.bind(eStart, function(e) { 2118 var e0 = isTouch ? e.originalEvent.touches[0] : e; 2119 var vol = 1 - (e0.pageY - $videoVolumeBarBg.offset().top) / $videoVolumeBarBg.height(); 2120 vol = vol > 1 ? 1 : vol < 0 ? 0 : vol; 2121 $videoVolumeBarActive.css({ 2122 height: Math.round(vol * 100) + "%" 2123 }); 2124 $videoVolumeButton.css({ 2125 "background-position": "left " + (vol > 0 ? "top" : "bottom") 2126 }); 2127 $videoObj.get(0).volume = vol; 2128 $videoVolumeBarBg.bind(eMove, function(e) { 2129 var e0 = isTouch ? e.originalEvent.touches[0] : e; 2130 var vol = 1 - (e0.pageY - $videoVolumeBarBg.offset().top) / $videoVolumeBarBg.height(); 2131 vol = vol > 1 ? 1 : vol < 0 ? 0 : vol; 2132 $videoVolumeBarActive.css({ 2133 height: Math.round(vol * 100) + "%" 2134 }); 2135 $videoVolumeButton.css({ 2136 "background-position": "left " + (vol > 0 ? "top" : "bottom") 2137 }); 2138 $videoObj.get(0).volume = vol 2139 }) 2140 }).bind(eCancel, function() { 2141 $videoVolumeBarBg.unbind(eMove) 2142 }) 2143 } 2144 var calcTimeFormat = function(seconds) { 2145 var h0 = Math.floor(seconds / 3600); 2146 var h = h0 < 10 ? "0" + h0 : h0; 2147 var m0 = Math.floor((seconds - h0 * 3600) / 60); 2148 var m = m0 < 10 ? "0" + m0 : m0; 2149 var s0 = Math.floor(seconds - (h0 * 3600 + m0 * 60)); 2150 var s = s0 < 10 ? "0" + s0 : s0; 2151 var r = m + ":" + s; 2152 if (h0 > 0) r = h + ":" + 2153 r; 2154 return r 2155 }; 2156 if (hideplaybutton) $videoPlay.hide(); 2157 if (hidecontrols) $videoControls.hide(); 2158 var onVideoPlay = function() { 2159 if (!hideplaybutton) $videoPlay.hide(); 2160 if (!hidecontrols) { 2161 $videoBtnPlay.hide(); 2162 $videoBtnPause.show() 2163 } 2164 }; 2165 var onVideoPause = function() { 2166 if (!hideplaybutton) $videoPlay.show(); 2167 if (!hidecontrols) { 2168 $videoControls.show(); 2169 clearTimeout(hideControlsTimerId); 2170 $videoBtnPlay.show(); 2171 $videoBtnPause.hide() 2172 } 2173 }; 2174 var onVideoEnded = function() { 2175 $(window).trigger("html5lightbox.videoended"); 2176 if (!hideplaybutton) $videoPlay.show(); 2177 if (!hidecontrols) { 2178 $videoControls.show(); 2179 clearTimeout(hideControlsTimerId); 2180 $videoBtnPlay.show(); 2181 $videoBtnPause.hide() 2182 } 2183 }; 2184 var onVideoUpdate = function() { 2185 var curTime = $videoObj.get(0).currentTime; 2186 if (curTime) { 2187 $videoTimeCurrent.text(calcTimeFormat(curTime)); 2188 var duration = $videoObj.get(0).duration; 2189 if (duration) { 2190 $videoTimeTotal.text(calcTimeFormat(duration)); 2191 if (!sliderDragging) { 2192 var sliderW = $videoSeeker.width();
2193 var pos = Math.round(sliderW * curTime / duration); 2194 $videoSeekerPlay.css({ 2195 width: pos 2196 }); 2197 $videoSeekerHandler.css({ 2198 left: pos 2199 }) 2200 } 2201 } 2202 } 2203 }; 2204 var onVideoProgress = function() { 2205 if ($videoObj.get(0).buffered && $videoObj.get(0).buffered.length > 0 && !isNaN($videoObj.get(0).buffered.end(0)) && !isNaN($videoObj.get(0).duration)) { 2206 var sliderW = $videoSeeker.width(); 2207 $videoSeekerBuffer.css({ 2208 width: Math.round(sliderW * $videoObj.get(0).buffered.end(0) / $videoObj.get(0).duration) 2209 }) 2210 } 2211 }; 2212 try { 2213 $videoObj.bind("play", onVideoPlay); 2214 $videoObj.bind("pause", onVideoPause); 2215 $videoObj.bind("ended", onVideoEnded); 2216 $videoObj.bind("timeupdate", onVideoUpdate); 2217 $videoObj.bind("progress", 2218 onVideoProgress) 2219 } catch (e) {} 2220 } 2221})(jQuery); 2222 2223function ASTimer(asTimeout, asCallback, asUpdateCallback) { 2224 var asUpdateInterval = 50; 2225 var asUpdateTimerId = null; 2226 var asRunningTime = 0; 2227 this.pause = function() { 2228 clearInterval(asUpdateTimerId) 2229 }; 2230 this.resume = function() { 2231 clearInterval(asUpdateTimerId); 2232 if (asTimeout > 0) asUpdateTimerId = setInterval(function() { 2233 asRunningTime += asUpdateInterval; 2234 if (asRunningTime > asTimeout) { 2235 clearInterval(asUpdateTimerId); 2236 if (asCallback) asCallback() 2237 } 2238 if (asUpdateCallback) asUpdateCallback(asRunningTime / asTimeout) 2239 }, asUpdateInterval); 2240 else if (asCallback) asCallback() 2241 }; 2242 this.stop = function() { 2243 clearInterval(asUpdateTimerId); 2244 if (asUpdateCallback) asUpdateCallback(-1); 2245 asRunningTime = 0 2246 }; 2247 this.start = function() { 2248 asRunningTime = 0; 2249 clearInterval(asUpdateTimerId); 2250 if (asTimeout > 0) asUpdateTimerId = setInterval(function() { 2251 asRunningTime += asUpdateInterval; 2252 if (asRunningTime > asTimeout) { 2253 clearInterval(asUpdateTimerId); 2254 if (asCallback) asCallback() 2255 } 2256 if (asUpdateCallback) asUpdateCallback(asRunningTime / asTimeout) 2257 }, asUpdateInterval); 2258 else if (asCallback) asCallback() 2259 } 2260} 2261var ACPlatforms = { 2262 flashInstalled: function() { 2263 var flashInstalled = false; 2264 try { 2265 if (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) flashInstalled = true 2266 } catch (e) { 2267 if (navigator.mimeTypes["application/x-shockwave-flash"]) flashInstalled = true 2268 } 2269 return flashInstalled 2270 }, 2271 html5VideoSupported: function() { 2272 return !!document.createElement("video").canPlayType 2273 }, 2274 isChrome: function() { 2275 return navigator.userAgent.match(/Chrome/i) != null 2276 }, 2277 isFirefox: function() { 2278 return navigator.userAgent.match(/Firefox/i) != null 2279 }, 2280 isOpera: function() { 2281 return navigator.userAgent.match(/Opera/i) != 2282 null || navigator.userAgent.match(/OPR\//i) != null 2283 }, 2284 isSafari: function() { 2285 return navigator.userAgent.match(/Safari/i) != null 2286 }, 2287 isAndroid: function() { 2288 return navigator.userAgent.match(/Android/i) != null 2289 }, 2290 isIPad: function() { 2291 return navigator.userAgent.match(/iPad/i) != null 2292 }, 2293 isIPhone: function() { 2294 return navigator.userAgent.match(/iPod/i) != null || navigator.userAgent.match(/iPhone/i) != null 2295 }, 2296 isIOS: function() { 2297 return this.isIPad() || this.isIPhone() 2298 }, 2299 isIE9: function() { 2300 return navigator.userAgent.match(/MSIE/i) != null && this.html5VideoSupported() && 2301 !this.isOpera() 2302 }, 2303 isIE8: function() { 2304 return navigator.userAgent.match(/MSIE 8/i) != null && !this.isOpera() 2305 }, 2306 isIE7: function() { 2307 return navigator.userAgent.match(/MSIE 7/i) != null && !this.isOpera() 2308 }, 2309 isIE6: function() { 2310 return navigator.userAgent.match(/MSIE 6/i) != null && !this.isOpera() 2311 }, 2312 isIE678: function() { 2313 return this.isIE6() || this.isIE7() || this.isIE8() 2314 }, 2315 isIE6789: function() { 2316 return this.isIE6() || this.isIE7() || this.isIE8() || this.isIE9() 2317 }, 2318 css33dTransformSupported: function() { 2319 return !this.isIE6() && !this.isIE7() && !this.isIE8() && 2320 !this.isIE9() && !this.isOpera() 2321 }, 2322 applyBrowserStyles: function(object, applyToValue) { 2323 var ret = {}; 2324 for (var key in object) { 2325 ret[key] = object[key]; 2326 ret["-webkit-" + key] = applyToValue ? "-webkit-" + object[key] : object[key]; 2327 ret["-moz-" + key] = applyToValue ? "-moz-" + object[key] : object[key]; 2328 ret["-ms-" + key] = applyToValue ? "-ms-" + object[key] : object[key]; 2329 ret["-o-" + key] = applyToValue ? "-o-" + object[key] : object[key] 2330 } 2331 return ret 2332 } 2333}; 2334(function($) { 2335 $.fn.fmcarousel = function(options) { 2336 var ELEM_ID = 0, 2337 ELEM_SRC = 1, 2338 ELEM_TITLE = 2, 2339 ELEM_DESCRIPTION = 3,
2340 ELEM_LINK = 4, 2341 ELEM_TARGET = 5, 2342 ELEM_VIDEO = 6, 2343 ELEM_THUMBNAIL = 7, 2344 ELEM_LIGHTBOX = 8, 2345 ELEM_LIGHTBOXWIDTH = 9, 2346 ELEM_LIGHTBOXHEIGHT = 10; 2347 var TYPE_IMAGE = 1, 2348 TYPE_SWF = 2, 2349 TYPE_MP3 = 3, 2350 TYPE_PDF = 4, 2351 TYPE_VIDEO_FLASH = 5, 2352 TYPE_VIDEO_MP4 = 6, 2353 TYPE_VIDEO_OGG = 7, 2354 TYPE_VIDEO_WEBM = 8, 2355 TYPE_VIDEO_YOUTUBE = 9, 2356 TYPE_VIDEO_VIMEO = 10; 2357 var AmazingCarousel = function(container, options, id) { 2358 this.container = container; 2359 this.options = options; 2360 this.id = id; 2361 this.transitionTimeout = 2362 null; 2363 this.arrowTimeout = null; 2364 $(".amazingcarousel-engine").css({ 2365 display: "none" 2366 }); 2367 this.lightboxArray = []; 2368 this.visibleItems = this.options.visibleitems; 2369 this.itemSize = this.options.width; 2370 this.itemHeight = this.options.height; 2371 this.currentItem = 0; 2372 this.elemLength = 0; 2373 this.elemTotalCount = 0; 2374 this.animProp = {}; 2375 this.transitionTimerId = null; 2376 this.transitionTiming = 0; 2377 this.processLightbox(); 2378 this.preprocess(this) 2379 }; 2380 AmazingCarousel.prototype = { 2381 initData: function() { 2382 this.readTags(); 2383 this.init() 2384 }, 2385 processLightbox: function() { 2386 if (this.options.lightboxobject) { 2387 var instance = 2388 this; 2389 this.options.lightboxobject.each(function(index) { 2390 if ($(this).data("ytplaylist")) instance.options.lightboxobject.splice(index, 1) 2391 }) 2392 } 2393 }, 2394 preprocess: function(instance) { 2395 var found = false; 2396 var item_index = 0; 2397 var youtubeapikey = ""; 2398 var youtubeplaylistid = ""; 2399 var youtubeplaylistmaxresults = ""; 2400 $("li.amazingcarousel-item", this.container).each(function(index) { 2401 if ($(this).data("youtubeapikey")) { 2402 youtubeapikey = $(this).data("youtubeapikey"); 2403 youtubeplaylistid = $(this).data("youtubeplaylistid"); 2404 youtubeplaylistmaxresults = $(this).data("youtubeplaylistmaxresults"); 2405 item_index = index; 2406 found = true; 2407 return false 2408 } 2409 }); 2410 if (found) instance.getYouTubePlaylist(youtubeapikey, youtubeplaylistid, youtubeplaylistmaxresults, item_index, item_index, instance.preprocess, instance, null); 2411 else instance.initData() 2412 }, 2413 getYouTubePlaylist: function(youtubeapikey, youtubeplaylistid, youtubeplaylistmaxresults, index, insert_index, onsuccess, instance, pagetoken) { 2414 var youtube_url = "https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=" + youtubeplaylistid + "&key=" + youtubeapikey; 2415 if (youtubeplaylistmaxresults) 2416 if (youtubeplaylistmaxresults > 2417 50) youtube_url += "&maxResults=50"; 2418 else youtube_url += "&maxResults=" + youtubeplaylistmaxresults; 2419 if (pagetoken) youtube_url += "&pageToken=" + pagetoken; 2420 var all_done = true; 2421 $.getJSON(youtube_url, function(data) { 2422 if (data && data.items) { 2423 var original_item = $("li.amazingcarousel-item", instance.container).eq(index); 2424 for (var i = 0; i < data.items.length; i++) { 2425 var video_id = data.items[i]["snippet"]["resourceId"]["videoId"]; 2426 var thumbnail = "https://img.youtube.com/vi/" + video_id + "/0.jpg"; 2427 var image = "https://img.youtube.com/vi/" + video_id + 2428 "/0.jpg"; 2429 if (data.items[i]["snippet"]["thumbnails"] && data.items[i]["snippet"]["thumbnails"]["maxres"]) image = data.items[i]["snippet"]["thumbnails"]["maxres"]["url"]; 2430 var video = "https://www.youtube.com/embed/" + video_id; 2431 var title = data.items[i]["snippet"]["title"]; 2432 var description = data.items[i]["snippet"]["description"]; 2433 var new_item = original_item.clone(); 2434 new_item.removeAttr("data-youtubeapikey").removeAttr("data-youtubeplaylistid").removeAttr("data-youtubeplaylistmaxresults"); 2435 var item_html = new_item.html().replace(/data-srcyt=/g, 2436 "src=").replace(/__IMAGE__/g, image).replace(/__THUMBNAIL__/g, thumbnail).replace(/__VIDEO__/g, video).replace(/__TITLE__/g, title).replace(/__DESCRIPTION__/g, description); 2437 new_item.html(item_html); 2438 if (instance.options.lightboxobject && new_item.find("a").hasClass("wondercarousellightbox")) new_item.find("a").each(function() { 2439 instance.options.lightboxobject.push(this); 2440 $(this).unbind("click").click(instance.options.lightboxobject.clickHandler) 2441 }); 2442 $("li.amazingcarousel-item", instance.container).eq(insert_index).after(new_item); 2443 insert_index++ 2444 } 2445 } 2446 if (data && data.nextPageToken && youtubeplaylistmaxresults && youtubeplaylistmaxresults > 50) { 2447 all_done = false; 2448 instance.getYouTubePlaylist(youtubeapikey, youtubeplaylistid, youtubeplaylistmaxresults
2448- 50, index, insert_index, onsuccess, instance, data.nextPageToken) 2449 } 2450 }).always(function() { 2451 if (all_done) { 2452 $("li.amazingcarousel-item", instance.container).eq(index).remove(); 2453 onsuccess(instance) 2454 } 2455 }) 2456 }, 2457 readTags: function() { 2458 var items = $("li.amazingcarousel-item", this.container); 2459 this.elemLength = items.length; 2460 this.elemTotalCount = 2461 this.elemLength; 2462 var i; 2463 if (this.options.random) { 2464 for (i = this.elemLength - 1; i > 0; i--) { 2465 var index = Math.floor(Math.random() * i); 2466 items.eq(index).insertBefore(items.eq(i)); 2467 items.eq(i).insertBefore(items.eq(index)) 2468 } 2469 items = $("li.amazingcarousel-item", this.container) 2470 } 2471 items.each(function(index) { 2472 $(this).data("itemIndex", index) 2473 }); 2474 if (this.elemLength > 1 && this.options.circular) { 2475 var cloneCount = this.elemLength; 2476 for (i = 0; i < cloneCount; i++) $("ul.amazingcarousel-list", this.container).append(items.eq(i).clone(true)); 2477 this.elemTotalCount += 2478 cloneCount 2479 } 2480 $("ul.amazingcarousel-list", this.container).append("<div style='clear:both;'></div>") 2481 }, 2482 init: function() { 2483 var instance = this; 2484 if (instance.elemLength <= 0) return; 2485 instance.container.css({ 2486 direction: "ltr" 2487 }); 2488 if (!instance.options.hidecontaineroninit && !instance.options.hidecontainerbeforeloaded) instance.container.css({ 2489 display: "block" 2490 }); 2491 instance.isAnimating = false; 2492 instance.isPaused = !instance.options.autoplay; 2493 instance.tempPaused = false; 2494 instance.mousePaused = false; 2495 instance.loopCount = 0; 2496 instance.firstResize = 2497 false; 2498 instance.createPlayVideo(); 2499 instance.createHoverOverlay(); 2500 instance.createStyle(); 2501 instance.createNav(); 2502 instance.createArrows(); 2503 instance.createBackgroundImage();
2504 instance.createItemBackgroundImage(); 2505 instance.createBottomShadow(); 2506 instance.createItemBottomShadow(); 2507 instance.createWatermark(); 2508 instance.createSliderTimeout(); 2509 instance.createGoogleFonts(); 2510 instance.enableSwipe(); 2511 if (instance.options.sameheight && instance.options.direction == "horizontal") instance.itemHeight = instance.calcSameHeight(); 2512 var $img = 2513 $(".amazingcarousel-image", instance.container).find("img"); 2514 if ($img.length) { 2515 instance.totalLength = $img.length; 2516 instance.loadindex = 0; 2517 instance.firstLoad = true; 2518 $img.one("load", function() { 2519 if (instance.options.sameheight && instance.options.direction == "horizontal") $(this).css({ 2520 width: "auto", 2521 height: instance.itemHeight + "px", 2522 "max-width": "none", 2523 "max-height": "100%", 2524 "margin-top": "0px", 2525 "margin-left": "0px" 2526 }); 2527 else if (instance.options.fixaspectratio) { 2528 $(this).wrap('<div class="amazingcarousel-image-fix-wrapper" style="width:100%;height:100%;overflow:hidden;"></div>'); 2529 var imgW = $(this).width(); 2530 var imgH = $(this).height(); 2531 if (imgW > 0 && imgH && imgW / imgH > instance.options.width / instance.options.height) { 2532 $(this).css({ 2533 width: "auto", 2534 height: "100%", 2535 "max-width": "none", 2536 "max-height": "100%", 2537 "margin-top": "0px", 2538 "margin-left": "0px" 2539 }); 2540 if (instance.options.centerimage) 2541 if ($(this).width() > 0) { 2542 var ml = ($(this).closest(".amazingcarousel-image").width() - $(this).width()) / 2; 2543 $(this).css({ 2544 "margin-left": ml + "px" 2545 }) 2546 } 2547 } else { 2548 $(this).css({ 2549 width: "100%", 2550 height: "auto", 2551 "max-width": "100%", 2552 "max-height": "none", 2553 "margin-top": "0px", 2554 "margin-left": "0px" 2555 }); 2556 if (instance.options.centerimage) 2557 if ($(this).height() > 0) { 2558 var mt = ($(this).closest(".amazingcarousel-image").height() - $(this).height()) / 2; 2559 $(this).css({ 2560 "margin-top": mt + "px" 2561 }) 2562 } 2563 } 2564 } else if (instance.options.fitimage) { 2565 $(this).wrap('<div class="amazingcarousel-image-fit-wrapper" style="width:100%;height:100%;overflow:hidden;"></div>'); 2566 $(this).css({ 2567 width: "auto", 2568 height: "auto", 2569 "max-width": "100%", 2570 "max-height": "100%", 2571 "margin-top": "0px", 2572 "margin-left": "0px" 2573 }); 2574 var imgW = $(this).width(); 2575 var imgH = 2576 $(this).height(); 2577 if (imgW > 0 && imgH && imgW / imgH > instance.options.width / instance.options.height) { 2578 $(this).css({ 2579 width: "100%" 2580 }); 2581 if (instance.options.fitcenterimage) 2582 if ($(this).height() > 0) { 2583 var mt = ($(this).closest(".amazingcarousel-image").height() - $(this).height()) / 2; 2584 $(this).css({ 2585 "margin-top": mt + "px" 2586 }) 2587 } 2588 } else { 2589 $(this).css({ 2590 height: "100%" 2591 }); 2592 if (instance.options.fitcenterimage) 2593 if ($(this).width() > 0) { 2594 var ml = ($(this).closest(".amazingcarousel-image").width() - $(this).width()) / 2; 2595 $(this).css({ 2596 "margin-left": ml + "px" 2597 }) 2598 } 2599 } 2600 } 2601 if (!instance.firstResize) { 2602 instance.firstResize = 2603 true; 2604 instance.resizeCarousel() 2605 } 2606 instance.loadindex++; 2607 if (instance.options.hidecontainerbeforeloaded && instance.loadindex == instance.totalLength && instance.firstLoad) { 2608 instance.container.trigger("amazingcarousel.allimagesloaded"); 2609 instance.container.css({ 2610 display: "block" 2611 }); 2612 $(window).trigger("resize"); 2613 if (!instance.isPaused && !instance.tempPaused) instance.sliderTimeout.start(); 2614 instance.firstLoad = false 2615 } 2616 }); 2617 $img.each(function() { 2618 if (this.complete) $(this).load() 2619 }) 2620 } else instance.resizeCarousel(); 2621 if (instance.options.responsive) $(window).resize(function() { 2622 instance.resizeCarousel(); 2623 instance.resizeNav() 2624 }); 2625 $(window).load(function() { 2626 instance.resizeCarousel(); 2627 instance.resizeNav() 2628 }); 2629 instance.resizeNav(); 2630 var params = instance.getParams(); 2631 var firstId = 0; 2632 if ("firstcarouselid" in params && params["firstcarouselid"] >= 0 && params["firstcarouselid"] < instance.elemLength) firstId = params["firstcarouselid"]; 2633 instance.container.trigger("amazingcarousel.switch", [-1, firstId]); 2634 if (firstId > 0) { 2635 instance.slideRun(firstId); 2636 if ("clickcarousel" in params) $(".amazingcarousel-item", instance.container).each(function() { 2637 if ($(this).data("itemIndex") == 2638 firstId) { 2639 $(".amazingcarousel-image img", this).click(); 2640 return false 2641 } 2642 }) 2643 } 2644 if (instance.options.hidecontaineroninit && !instance.options.hidecontainerbeforeloaded) { 2645 instance.container.css({ 2646 display: "block" 2647 }); 2648 $(window).trigger("resize") 2649 } 2650 instance.container.trigger("amazingcarousel.initsuccess"); 2651 if (!instance.isPaused && !instance.tempPaused && !instance.options.hidecontainerbeforeloaded) instance.sliderTimeout.start() 2652 }, 2653 getParams: function() { 2654 var result = {}; 2655 var params = window.location.search.substring(1).split("&"); 2656 for (var i = 2657 0; i < params.length; i++) { 2658 var value = params[i].split("="); 2659 if (value && value.length == 2) result[value[0].toLowerCase()] = unescape(value[1]) 2660 } 2661 return result 2662 }, 2663 enableSwipe: function() { 2664 if (this.options.enabletouchswipe) { 2665 var instance = this; 2666 $(".amazingcarousel-list-container", this.container).carouselTouchSwipe({ 2667 preventWebBrowser: false, 2668 swipeLeft: function() { 2669 instance.slideRun(-1) 2670 }, 2671 swipeRight: function() { 2672 instance.slideRun(-2) 2673 } 2674 }) 2675 } 2676 }, 2677 createPlayVideo: function() { 2678 if (!this.options.showplayvideo) return; 2679 var instance = this; 2680 $(".amazingcarousel-image", 2681 this.container).each(function() { 2682 var $this = $(this); 2683 var isVideo = false; 2684 var isLightboxVideo = false; 2685 var videoUrl = ""; 2686 var videoWebmUrl = ""; 2687 $("img", $this).each(function() { 2688 if ($(this).data("video")) { 2689 videoUrl = $(this).data("video"); 2690 if ($(this).data("videowebm")) videoWebmUrl = $(this).data("videowebm"); 2691 isVideo = true; 2692 return false 2693 } else if ($(this).parent()[0].nodeName.toLowerCase() == "a") 2694 if ($(this).parent().hasClass("wondercarousellightbox")) { 2695 var type = instance.checkVideoType($(this).parent().attr("href")); 2696 if (type == TYPE_VIDEO_YOUTUBE || 2697 type == TYPE_VIDEO_VIMEO || type == TYPE_VIDEO_MP4 || type == TYPE_VIDEO_WEBM) isLightboxVideo = true 2698 } 2699 }); 2700 if (isVideo || isLightboxVideo) { 2701 var pos = "center center"; 2702 switch (instance.options.playvideoimagepos) { 2703 case "topleft": 2704 pos = "left top"; 2705 break; 2706 case "topright": 2707 pos = "right top"; 2708 break; 2709 case "bottomleft": 2710 pos = "left bottom"; 2711 break; 2712 case "bottomright": 2713 pos = "right bottom"; 2714 break 2715 } 2716 var $playVideo = $('<div class="amazingcarousel-play-video" style="position:absolute;
2716left:0;top:0;width:100%;height:100%;cursor:pointer;' + "background-image:url('" + 2717 instance.options.playvideoimage + "');background-repeat:no-repeat;" + "background-position:" + pos + ';"></div>'); 2718 $playVideo.appendTo($this); 2719 if (isVideo) $this.on("click", ".amazingcarousel-play-video", function() { 2720 $this.find("img").css({ 2721 visibility: "hidden" 2722 }); 2723 instance.playVideo($(this), videoUrl, videoWebmUrl); 2724 $(this).unbind("click") 2725 }); 2726 else { 2727 var $img = $("img", $this); 2728 $playVideo.click(function() { 2729 $img.click() 2730 }) 2731 } 2732 } 2733 }) 2734 }, 2735 playVideo: function($videoDiv, videoUrl, videoWebmUrl) { 2736 if (videoUrl.length <= 0) return; 2737 this.sliderTimeout.stop(); 2738 this.tempPaused = true; 2739 var type = this.checkVideoType(videoUrl); 2740 if (type == TYPE_VIDEO_YOUTUBE) this.playYoutubeVideo(videoUrl, $videoDiv); 2741 else if (type == TYPE_VIDEO_VIMEO) this.playVimeoVideo(videoUrl, $videoDiv); 2742 else if (type == TYPE_VIDEO_MP4) this.playMp4Video(videoUrl, videoWebmUrl, true, $videoDiv) 2743 }, 2744 playMp4Video: function(href, webmhref, autoplay, $videoWrapper) { 2745 var isHTML5 = true; 2746 if (ACPlatforms.isIE6789()) isHTML5 = false; 2747 else if ((ACPlatforms.isFirefox() || ACPlatforms.isOpera()) && !webmhref) isHTML5 = false; 2748 if (isHTML5) { 2749 var videoSrc = 2750 ACPlatforms.isFirefox() || ACPlatforms.isOpera() ? webmhref : href; 2751 this.embedHTML5Video($videoWrapper, videoSrc, autoplay) 2752 } else { 2753 var videoFile = href; 2754 if (videoFile.charAt(0) != "/" && videoFile.substring(0, 5) != "http:" && videoFile.substring(0, 6) != "https:") videoFile = this.options.htmlfolder + videoFile; 2755 this.embedFlash($videoWrapper, "100%", "100%", this.options.jsfolder + "html5boxplayer.swf", "transparent", { 2756 width: "100%", 2757 height: "100%", 2758 videofile: videoFile, 2759 hdfile: "", 2760 ishd: "0", 2761 autoplay: autoplay ? "1" : "0", 2762 errorcss: ".amazingcarousel-error" + 2763 this.options.errorcss, 2764 id: this.id, 2765 hidecontrols: "0", 2766 hideplaybutton: "0", 2767 defaultvolume: 1 2768 }) 2769 } 2770 }, 2771 embedHTML5Video: function($container, src, autoPlay) { 2772 $container.html("<div class='amazingcarousel-video-container-" + this.id + "' style='position:relative;display:block;width:100%;height:100%;'><video style='width:100%;height:100%;' controls ></div>"); 2773 $("video", $container).get(0).setAttribute("src", src); 2774 if (autoPlay) $("video", $container).get(0).play(); 2775 if (!this.options.nativehtml5controls) $("video", $container).acHTML5VideoControls(this.options.skinsfolder, 2776 this, this.options.videohidecontrols, this.options.videohideplaybutton, this.options.defaultvideovolume) 2777 }, 2778 embedFlash: function($container, w, h, src, wmode, flashVars) { 2779 if (ACPlatforms.flashInstalled()) { 2780 var htmlOptions = { 2781 pluginspage: "http://www.adobe.com/go/getflashplayer", 2782 quality: "high", 2783 allowFullScreen: "true", 2784 allowScriptAccess: "always", 2785 type: "application/x-shockwave-flash" 2786 }; 2787 htmlOptions.width = w; 2788 htmlOptions.height = h; 2789 htmlOptions.src = src; 2790 htmlOptions.wmode = wmode; 2791 htmlOptions.flashVars = $.param(flashVars); 2792 var htmlString = 2793 ""; 2794 for (var key in htmlOptions) htmlString += key + "=" + htmlOptions[key] + " "; 2795 $container.html("<embed " + htmlString + "/>") 2796 } else $container.html("<div class='amazingcarousel-video-error' style='display:block;position:absolute;text-align:center;width:100%;height:100%;left:0px;top:0px;'><div>The required Adobe Flash Player plugin is not installed</div><br /><div style='display:block;position:relative;text-align:center;width:112px;height:33px;margin:0px auto;'><a href='http://www.adobe.com/go/getflashplayer'>
2796<img src='https://www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' width='112' height='33'></img></a></div>") 2797 }, 2798 playYoutubeVideo: function(href, $videoWrapper) { 2799 if (this.options.previewmode) { 2800 $videoWrapper.html("<div class='amazingcarousel-video-error' style='display:block;position:absolute;left:0;top:0;width:100%;height:100%;color:#fff;background-color:#333;'>To view YouTube video, publish the carousel then open it in your web browser</div>"); 2801 return 2802 } else { 2803 var src = href + (href.indexOf("?") < 0 ? "?" : "&") + "autoplay=1&wmode=transparent&rel=0&autohide=1"; 2804 $videoWrapper.html("<iframe width='100%' height='100%' src='" + src + "' frameborder='0' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>") 2805 } 2806 }, 2807 playVimeoVideo: function(href, $videoWrapper) { 2808 if (this.options.previewmode) { 2809 $videoWrapper.html("<div class='amazingcarousel-video-error' style='display:block;position:absolute;left:0;top:0;width:100%;height:100%;color:#fff;background-color:#333;'>To view Vimeo video, publish the carousel then open it in your web browser</div>"); 2810 return 2811 } else { 2812 var src = href + (href.indexOf("?") < 0 ? "?" : "&") + "autoplay=1&api=1"; 2813 $videoWrapper.html("<iframe width='100%' height='100%' src='" + src + "' frameborder='0' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>") 2814 } 2815 }, 2816 checkVideoType: function(href) { 2817 if (!href) return -1; 2818 if (href.match(/\.(flv)(.*)?$/i)) return TYPE_VIDEO_FLASH; 2819 if (href.match(/\.(mp4|m4v)(.*)?$/i)) return TYPE_VIDEO_MP4; 2820 if (href.match(/\.(ogv|ogg)(.*)?$/i)) return TYPE_VIDEO_OGG; 2821 if (href.match(/\.(webm)(.*)?$/i)) return TYPE_VIDEO_WEBM; 2822 if (href.match(/\:\/\/.*(youtube\.com)/i) || href.match(/\:\/\/.*(youtu\.be)/i)) return TYPE_VIDEO_YOUTUBE; 2823 if (href.match(/\:\/\/.*(vimeo\.com)/i)) return TYPE_VIDEO_VIMEO; 2824 return 0 2825 }, 2826 createHoverOverlay: function() { 2827 var instance = this; 2828 $(".amazingcarousel-image", 2829 this.container).each(function() { 2830 var $this = $(this); 2831 var isLightbox = false; 2832 var isLink = false; 2833 $("img", $this).each(function() { 2834 if ($(this).parent()[0].nodeName.toLowerCase() == "a") { 2835 isLink = true; 2836 if ($(this).parent().hasClass("wondercarousellightbox")) { 2837 isLightbox = true; 2838 return false 2839 } 2840 } 2841 }); 2842 if ($(this).siblings(".amazingcarousel-hover").length > 0 && !(instance.options.hidehoveroverlayontouch && "ontouchstart" in window)) { 2843 $(this).parent().hover(function() { 2844 $(this).find(".amazingcarousel-hover").fadeIn() 2845 }, function() { 2846 $(this).find(".amazingcarousel-hover").fadeOut() 2847 }); 2848 var $img = $("img", $this); 2849 $(this).siblings(".amazingcarousel-hover").click(function() { 2850 $img.click() 2851 }) 2852 } else if (instance.options.showhoveroverlay && !(instance.options.hidehoveroverlayontouch && "ontouchstart" in window) && (isLightbox || isLink && instance.options.showhoveroverlayalways)) { 2853 var $hoverImage = $('<div class="amazingcarousel-hover-effect" style="display:none;position:absolute;
2853left:0;top:0;width:100%;height:100%;cursor:pointer;' + "background-image:url('" + instance.options.hoveroverlayimage + "');background-repeat:no-repeat;" + 2854 'background-position:center center;"></div>'); 2855 $hoverImage.appendTo($this); 2856 var $img = $("img", $this); 2857 $hoverImage.click(function() { 2858 $img.click() 2859 }); 2860 $(this).hover(function() { 2861 if (ACPlatforms.isIE678()) $hoverImage.show(); 2862 else $hoverImage.fadeIn() 2863 }, function() { 2864 if (ACPlatforms.isIE678()) $hoverImage.hide(); 2865 else $hoverImage.fadeOut() 2866 }) 2867 } 2868 if ($(this).siblings(".amazingcarousel-flip").length > 0) { 2869 if (ACPlatforms.isIE6789()) $(this).parent().hover(function() { 2870 $(this).find(".amazingcarousel-flip").hide().insertAfter($(this).find(".amazingcarousel-image")).fadeIn() 2871 }, 2872 function() { 2873 $(this).find(".amazingcarousel-flip").fadeOut() 2874 }); 2875 var $img = $("img", $this); 2876 $(this).siblings(".amazingcarousel-flip").click(function() { 2877 $img.click() 2878 }) 2879 } 2880 if ($(this).closest(".amazingcarousel-flipout").length > 0) { 2881 var $itemcontainer = $(this).closest(".amazingcarousel-item-container"); 2882 if (ACPlatforms.isIE6789()) $itemcontainer.hover(function() { 2883 $(this).find(".amazingcarousel-flip").hide().insertAfter($(this).find(".amazingcarousel-flipout")).fadeIn() 2884 }, function() { 2885 $(this).find(".amazingcarousel-flip").fadeOut() 2886 }); 2887 var $img = $("img", $this); 2888 $itemcontainer.find(".amazingcarousel-flip").click(function() { 2889 $img.click() 2890 }) 2891 } 2892 }) 2893 }, 2894 createStyle: function() { 2895 $("ul.amazingcarousel-list", this.container).wrap('<div class="amazingcarousel-list-wrapper"></div>'); 2896 $("ul.amazingcarousel-list", this.container).css({ 2897 display: "block", 2898 position: "relative", 2899 "list-style-type": "none", 2900 "list-style-image": "none", 2901 "background-image": "none", 2902 "background-color": "transparent", 2903 padding: 0, 2904 margin: 0 2905 }); 2906 $("li.amazingcarousel-item", this.container).css({ 2907 display: "block", 2908 position: "relative", 2909 "background-image": "none", 2910 "background-color": "transparent", 2911 margin: 0, 2912 padding: 0, 2913 "float": this.options.direction == "horizontal" ? "left" : "top" 2914 }); 2915 if (this.options.sameheight && this.options.direction == "horizontal") { 2916 $("ul.amazingcarousel-list", this.container).css({ 2917 "white-space": "nowrap" 2918 }); 2919 $("li.amazingcarousel-item", this.container).css({ 2920 display: "inline-block", 2921 "float": "none" 2922 }) 2923 } 2924 var m = 0; 2925 if (this.options.spacing > 0) 2926 if (this.options.direction == "horizontal") { 2927 var s = Math.min(this.options.spacing / 2); 2928 m = "0 " + s + "px" 2929 } else m = "0 0 " + this.options.spacing + "px 0"; 2930 var itemCss = {}; 2931 itemCss["position"] = "relative"; 2932 itemCss["margin"] = m; 2933 $("div.amazingcarousel-item-container", this.container).css(itemCss); 2934 var listCss = {}; 2935 listCss["position"] = "relative"; 2936 listCss["margin"] = "0 auto"; 2937 listCss["overflow"] = "visible"; 2938 $("div.amazingcarousel-list-container", this.container).css(listCss); 2939 var wrapperCss = {}; 2940 wrapperCss["overflow"] = "hidden"; 2941 if (this.options.direction == "vertical") wrapperCss["he
2941ight"] = "100%"; 2942 $("div.amazingcarousel-list-wrapper", 2943 this.container).css(wrapperCss) 2944 }, 2945 hideVideo: function(start) { 2946 var instance = this; 2947 var index = 0; 2948 $("li.amazingcarousel-item", this.container).each(function() { 2949 if (index < start || index >= start + instance.visibleItems) { 2950 $(this).find(".amazingcarousel-image").find("img").css({ 2951 visibility: "visible" 2952 }); 2953 $(".amazingcarousel-play-video", $(this)).empty() 2954 } 2955 index++ 2956 }) 2957 }, 2958 calcSameHeight: function() { 2959 var itemHeight = this.options.height; 2960 if (this.options.responsive && this.options.sameheightresponsive) { 2961 var screenWidth = $(window).width(); 2962 if (screenWidth < 2963 this.options.sameheightsmallscreen) itemHeight = this.options.sameheightsmallheight; 2964 else if (screenWidth < this.options.sameheightmediumscreen) itemHeight = this.options.sameheightmediumheight; 2965 else itemHeight = this.options.height 2966 } 2967 return itemHeight 2968 }, 2969 checkMK: function() { }, 2970 resizeCarousel: function() { 2971 var instance = this; 2972 this.visibleItems = this.options.visibleitems; 2973 this.itemSize = this.options.width; 2974 if (this.options.responsive) 2975 if (this.options.direction == 2976 "horizontal") { 2977 if (this.options.fullwidth) { 2978 this.container.css({ 2979 "max-width": "100%" 2980 }); 2981 $(".amazingcarousel-list-container", this.container).css({ 2982 width: "100%", 2983 "box-sizing": "border-box" 2984 }); 2985 $(".amazingcarousel-list-wrapper", this.container).css({ 2986 width: "100%" 2987 }) 2988 } 2989 var conWidth; 2990 if (this.options.usescreenquery) { 2991 conWidth = $(".amazingcarousel-list-container", this.container).width(); 2992 if (conWidth > 0) { 2993 var screenWidth = $(window).width(); 2994 for (var i in this.options.screenquery) 2995 if (screenWidth < this.options.screenquery[i].screenwidth) this.visibleItems = 2996 this.options.screenquery[i].visibleitems; 2997 this.itemSize = Math.round(conWidth / this.visibleItems); 2998 $(".amazingcarousel-list-wrapper", this.container).width(conWidth) 2999 } 3000 } else { 3001 conWidth = this.container.width(); 3002 if (conWidth > 0) { 3003 this.visibleItems = this.options.fullwidth ? Math.ceil(conWidth / this.options.width) : Math.floor(conWidth / this.options.width); 3004 if (this.visibleItems < 1) { 3005 this.visibleItems = 1; 3006 this.itemSize = conWidth 3007 } else this.itemSize = this.options.width; 3008 if (!this.options.fullwidth) { 3009 $(".amazingcarousel-list-container", 3010 this.container).width(this.visibleItems * this.itemSize); 3011 $(".amazingcarousel-list-wrapper", this.container).width(this.visibleItems * this.itemSize) 3012 } 3013 } 3014 } 3015 } else { 3016 var itemWidth = $(".amazingcarousel-list-container", this.container).width(); 3017 if (itemWidth > 0) { 3018 this.itemSize = itemWidth; 3019 $(".amazingcarousel-list-wrapper", this.container).width(itemWidth) 3020 } 3021 } 3022 if (this.options.sameheight && this.options.direction == "horizontal") { 3023 instance.itemHeight = instance.calcSameHeight(); 3024 $(".amazingcarousel-image", this.container).find("img").each(function() { 3025 $(this).css({ 3026 width: "auto", 3027 height: instance.itemHeight + "px" 3028 }) 3029 }) 3030 } else { 3031 $("li.amazingcarousel-item", this.container).css({ 3032 width: this.itemSize + "px" 3033 }); 3034 if (this.options.direction == "vertical") this.itemSize = $("li.amazingcarousel-item", this.container).height(); 3035 if (this.options.fixaspectratio) { 3036 var imageWidth = $(".amazingcarousel-image", this.container).width(); 3037 var imageHeight = imageWidth * this.options.height / this.options.width; 3038 $(".amazingcarousel-image", this.container).css({ 3039 height: imageHeight + "px", 3040 overflow: "hidden" 3041 }); 3042 $(".amazingcarousel-image", 3043 this.container).find("img").each(function() { 3044 var imgW = $(this).width(); 3045 var imgH = $(this).height(); 3046 if (imgW > 0 && imgH && imgW / imgH > instance.options.width / instance.options.height) { 3047 $(this).css({ 3048 width: "auto", 3049 height: "100%", 3050 "max-width": "none", 3051 "max-height": "100%",
3052 "margin-top": "0px", 3053 "margin-left": "0px" 3054 }); 3055 if (instance.options.centerimage) 3056 if ($(this).width() > 0) { 3057 var ml = ($(this).closest(".amazingcarousel-image").width() - $(this).width()) / 2; 3058 $(this).css({ 3059 "margin-left": ml + "px" 3060 }) 3061 } 3062 } else { 3063 $(this).css({ 3064 width: "100%", 3065 height: "auto", 3066 "max-width": "100%", 3067 "max-height": "none", 3068 "margin-top": "0px", 3069 "margin-left": "0px" 3070 }); 3071 if (instance.options.centerimage) 3072 if ($(this).height() > 0) { 3073 var mt = ($(this).closest(".amazingcarousel-image").height() - $(this).height()) / 2; 3074 $(this).css({ 3075 "margin-top": mt + "px" 3076 }) 3077 } 3078 } 3079 }) 3080 } else if (this.options.fitimage) { 3081 var imageWidth = $(".amazingcarousel-image", this.container).width(); 3082 var imageHeight = imageWidth * this.options.height / this.options.width; 3083 $(".amazingcarousel-image", this.container).css({ 3084 height: imageHeight + "px", 3085 overflow: "hidden" 3086 }); 3087 $(".amazingcarousel-image", this.container).find("img").each(function() { 3088 $(this).css({ 3089 width: "auto", 3090 height: "auto", 3091 "max-width": "100%", 3092 "max-height": "100%", 3093 "margin-top": "0px", 3094 "margin-left": "0px" 3095 }); 3096 var imgW = $(this).width(); 3097 var imgH = $(this).height(); 3098 if (imgW > 0 && imgH && imgW / imgH > instance.options.width / instance.options.height) { 3099 $(this).css({ 3100 width: "100%" 3101 }); 3102 if (instance.options.fitcenterimage) 3103 if ($(this).height() > 0) { 3104 var mt = ($(this).closest(".amazingcarousel-image").height() - $(this).height()) / 2; 3105 $(this).css({ 3106 "margin-top": mt + 3107 "px" 3108 }) 3109 } 3110 } else { 3111 $(this).css({ 3112 height: "100%" 3113 }); 3114 if (instance.options.fitcenterimage) 3115 if ($(this).width() > 0) { 3116 var ml = ($(this).closest(".amazingcarousel-image").width() - $(this).width()) / 2; 3117 $(this).css({ 3118 "margin-left": ml + "px" 3119 }) 3120 } 3121 } 3122 }) 3123 } 3124 } 3125 if (this.options.direction == "horizontal") 3126 if (this.options.sameheight) $("ul.amazingcarousel-list", this.container).css({ 3127 width: "auto" 3128 }); 3129 else $("ul.amazingcarousel-list", this.container).css("width", this.itemSize * (this.options.circular ? this.elemTotalCount : this.elemLength) + "px"); 3130 else $("ul.amazingcarousel-list", 3131 this.container).css("height", this.options.height * (this.options.circular ? this.elemTotalCount : this.elemLength) + "px"); 3132 var cssProp = this.options.direction == "horizontal" ? "margin-left" : "margin-top"; 3133 var itemSize = this.options.direction == "horizontal" ? this.itemSize : this.options.height; 3134 var pos = -itemSize * this.currentItem; 3135 $("ul.amazingcarousel-list", this.container).css(cssProp, pos + "px"); 3136 if (this.options.direction == "vertical") { 3137 var itemHeight = this.options.height; 3138 if (this.options.fixaspectratio) { 3139 if ($(".amazingcarousel-item", 3140 this.container).height() > 0) itemHeight = $(".amazingcarousel-item", this.container).height() 3141 } else { 3142 var h0 = $(".amazingcarousel-item", this.container).height(); 3143 if (h0 > 0) { 3144 var equalHeight = true; 3145 $(".amazingcarousel-item", this.container).each(function() { 3146 if ($(this).height() != h0) { 3147 equalHeight = false; 3148 return false 3149 } 3150 }); 3151 if (equalHeight) itemHeight = h0 3152 } 3153 } 3154 $("div.amazingcarousel-list-container", this.container).css({ 3155 height: String(itemHeight * this.visibleItems + this.options.spacing * (this.visibleItems - 1)) + "px" 3156 }) 3157 } 3158 this.hideVideo(this.currentItem); 3159 this.hideArrows(); 3160 this.checkMK() 3161 }, 3162 createGoogleFonts: function() { 3163 if (this.options.previewmode) return; 3164 if (this.options.addgooglefonts && this.options.googlefonts && this.options.googlefonts.length > 0) { 3165 var protocol = window.location.protocol == "https:" ? "https:" : "http:"; 3166 var fontRef = protocol + "//fonts.googleapis.com/css?family=" + this.options.googlefonts; 3167 var fontLink = document.createElement("link"); 3168 fontLink.setAttribute("rel", "stylesheet"); 3169 fontLink.setAttribute("type", "text/css"); 3170 fontLink.setAttribute("href", fontRef); 3171 document.getElementsByTagName("head")[0].appendChild(fontLink) 3172 } 3173 }, 3174 createWatermark: function() { 3175 if (!this.options.showwatermark) return; 3176 if (this.options.watermarkstyle == "text" && this.options.watermarktext.length <= 0) return; 3177 if (this.options.watermarkstyle == "image" && this.options.watermarkimage.length <= 0) return; 3178 var wmCode = "<div style='" + this.options.watermarkpositioncss; 3179 if (this.options.watermarkstyle == "text") wmCode += this.options.watermarktextcss; 3180 if (this.options.watermarklink) wmCode += "cursor:pointer;"; 3181 wmCode += 3182 "'>"; 3183 if (this.options.watermarklink) { 3184 wmCode += "<a href='" + this.options.watermarklink + "' style='" + this.options.watermarklinkcss + "'"; 3185 if (this.options.watermarktarget) wmCode += " target='" + this.options.watermarktarget + "'"; 3186 wmCode += ">" 3187 } 3188 if (this.options.watermarkstyle == "text") wmCode += this.options.watermarktext; 3189 else if (this.options.watermarkstyle == "image") wmCode += "<img src='" + this.options.skinsfolder + this.options.watermarkimage + "' style='border:none;' />"; 3190 if (this.options.watermarklink) wmCode += "</a>"; 3191 wmCode += "</div>"; 3192 for (var i = 0; i < $(".amazingcarousel-image", this.container).length; i++) { 3193 if (this.options.versionmark != "AMC" + "om" && i % 2 != 0) continue; 3194 $(".amazingcarousel-image", this.container).eq(i).append($(wmCode)) 3195 } 3196 }, 3197 createSliderTimeout: function() { 3198 var instance = this; 3199 this.sliderTimeout = new ASTimer(this.options.interval, function() { 3200 instance.slideRun(-1) 3201 }, null); 3202 if (instance.options.pauseonmouseover) this.container.hover(function() { 3203 instance.mousePaused = true; 3204 if (!instance.isPaused) instance.sliderTimeout.pause(); 3205 if (instance.options.continuous) { 3206 $("ul.amazingcarousel-list", 3207 instance.container).stop(); 3208 clearInterval(instance.transitionTimerId); 3209 instance.transitionTimerId = null 3210 } 3211 }, function() { 3212 instance.mousePaused = false; 3213 if (!instance.isPaused) instance.sliderTimeout.resume(); 3214 if (instance.options.continuous) { 3215 $("ul.amazingcarousel-list", instance.container).animate(instance.animProp, instance.transitionTiming, instance.options.transitioneasing, function() { 3216 instance.animationDone() 3217 }); 3218 instance.transitionTimerId = setInterval(function() { 3219 instance.transitionTiming -= 100 3220 }, 100) 3221 } 3222 }) 3223 }, 3224 createItemBottomShadow: function() { 3225 if (!this.options.showitembottomshadow) return; 3226 var l = (100 - this.options.itembottomshadowimagewidth) / 2; 3227 var shadow = "<div class='amazingcarousel-item-bottom-shadow' " + "style='display:block;position:absolute;
3227left:" + l + "%;top:" + this.options.itembottomshadowimagetop + "%;" + "width:" + this.options.itembottomshadowimagewidth + "%;height:auto;'>" + "<img src='" + this.options.skinsfolder + this.options.itembottomshadowimage + "' style='display:block;position:relative;width:100%;height:auto;" + "border:0;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;" + 3228 "' />" + "</div>"; 3229 $("li.amazingcarousel-item", this.container).prepend(shadow) 3230 }, 3231 createBottomShadow: function() { 3232 if (!this.options.showbottomshadow) return; 3233 var l = (100 - this.options.bottomshadowimagewidth) / 2; 3234 var shadow = "<div class='amazingcarousel-bottom-shadow' " + "style='display:block;position:absolute;left:" + l + "%;top:" + this.options.bottomshadowimagetop + "%;" + "width:" + this.options.bottomshadowimagewidth + "%;height:auto;'>" + "<img src='" + this.options.skinsfolder + this.options.bottomshadowimage + "' style='display:block;position:relative;width:100%;height:auto;" + 3235 "border:0;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;" + "' />" + "</div>"; 3236 $(".amazingcarousel-list-container", this.container).prepend(shadow) 3237 },
3238 createItemBackgroundImage: function() { 3239 if (!this.options.showitembackgroundimage || !this.options.itembackgroundimage) return; 3240 var l = (100 - this.options.itembackgroundimagewidth) / 2; 3241 var background = "<div class='amazingcarousel-background-image' " + "style='display:block;position:absolute;left:" + 3242 l + "%;top:" + this.options.itembackgroundimagetop + "%;width:" + this.options.itembackgroundimagewidth + "%;height:auto;'>" + "<img src='" + this.options.skinsfolder + this.options.itembackgroundimage + "' style='display:block;position:relative;width:100%;height:auto;" + "border:0;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;" + "' />" + "</div>"; 3243 $("li.amazingcarousel-item", this.container).prepend(background) 3244 }, 3245 createBackgroundImage: function() { 3246 if (!this.options.showbackgroundimage || 3247 !this.options.backgroundimage) return; 3248 var l = (100 - this.options.backgroundimagewidth) / 2; 3249 var background = "<div class='amazingcarousel-background-image' " + "style='display:block;position:absolute;left:" + l + "%;top:" + this.options.backgroundimagetop + "%;width:" + this.options.backgroundimagewidth + "%;height:auto;'>" + "<img src='" + this.options.skinsfolder + this.options.backgroundimage + "' style='display:block;position:relative;width:100%;height:auto;" + "border:0;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;" + 3250 "' />" + "</div>"; 3251 this.container.prepend(background) 3252 }, 3253 createArrows: function() { 3254 if (this.options.arrowstyle == "none") return; 3255 var instance = this; 3256 var $prevArrow = $(".amazingcarousel-prev", this.container); 3257 var $nextArrow = $(".amazingcarousel-next", this.container); 3258 $prevArrow.css({ 3259 overflow: "hidden", 3260 position: "absolute", 3261 cursor: "pointer", 3262 width: this.options.arrowwidth + "px", 3263 height: this.options.arrowheight + "px", 3264 background: "url('" + this.options.arrowimage + "') no-repeat left top" 3265 }); 3266 if (ACPlatforms.isIE678()) $prevArrow.css({ 3267 opacity: "inherit", 3268 filter: "inherit" 3269 }); 3270 $nextArrow.css({ 3271 overflow: "hidden", 3272 position: "absolute", 3273 cursor: "pointer", 3274 width: this.options.arrowwidth + "px", 3275 height: this.options.arrowheight + "px", 3276 background: "url('" + this.options.arrowimage + "') no-repeat right top" 3277 }); 3278 if (ACPlatforms.isIE678()) $nextArrow.css({ 3279 opacity: "inherit", 3280 filter: "inherit" 3281 }); 3282 $prevArrow.hover(function() { 3283 $(this).css({ 3284 "background-position": "left bottom" 3285 }) 3286 }, function() { 3287 $(this).css({ 3288 "background-position": "left top" 3289 }) 3290 }); 3291 $nextArrow.hover(function() { 3292 $(this).css({ 3293 "background-position": "right bottom" 3294 }) 3295 }, 3296 function() { 3297 $(this).css({ 3298 "background-position": "right top" 3299 }) 3300 }); 3301 if (this.options.arrowstyle == "always") { 3302 $prevArrow.css({ 3303 display: "block" 3304 }); 3305 $nextArrow.css({ 3306 display: "block" 3307 }) 3308 } else { 3309 $prevArrow.css({ 3310 display: "none" 3311 }); 3312 $nextArrow.css({ 3313 display: "none" 3314 }); 3315 this.container.hover(function() { 3316 clearTimeout(instance.arrowTimeout); 3317 if (instance.options.circular || instance.currentItem > 0) 3318 if (ACPlatforms.isIE678()) $prevArrow.show(); 3319 else $prevArrow.fadeIn(); 3320 if (instance.options.circular || instance.currentItem < instance.elemLength - instance.visibleItems) 3321 if (ACPlatforms.isIE678()) $nextArrow.show(); 3322 else $nextArrow.fadeIn() 3323 }, function() { 3324 instance.arrowTimeout = setTimeout(function() { 3325 if (ACPlatforms.isIE678()) { 3326 $prevArrow.hide(); 3327 $nextArrow.hide() 3328 } else { 3329 $prevArrow.fadeOut(); 3330 $nextArrow.fadeOut() 3331 } 3332 }, instance.options.arrowhideonmouseleave) 3333 }) 3334 } 3335 $prevArrow.click(function() { 3336 instance.slideRun(-2) 3337 }); 3338 $nextArrow.click(function() { 3339 instance.slideRun(-1) 3340 }) 3341 }, 3342 hideArrows: function() { 3343 var $prevArrow = $(".amazingcarousel-prev", this.container); 3344 var $nextArrow = $(".amazingcarousel-next", this.container); 3345 if (!this.options.circular && 3346 this.currentItem <= 0) $prevArrow.hide(); 3347 else if (this.options.arrowstyle == "always") $prevArrow.show(); 3348 if (!this.options.circular && this.currentItem >= this.elemLength - this.visibleItems) $nextArrow.hide(); 3349 else if (this.options.arrowstyle == "always") $nextArrow.show() 3350 }, 3351 createNav: function() { 3352 if (this.options.navstyle == "none") return;
3353 var $nav = $(".amazingcarousel-nav", this.container); 3354 var $bulletWrapper = $("<div class='amazingcarousel-bullet-wrapper'></div>"); 3355 $bulletWrapper.appendTo($nav); 3356 var $bulletList = $("<div class='amazingcarousel-bullet-list'></div>"); 3357 $bulletList.appendTo($bulletWrapper); 3358 var bulletSize = this.options.navdirection == "vertical" ? this.options.navwidth : this.options.navheight; 3359 var len = this.elemLength * bulletSize + (this.elemLength - 1) * this.options.navspacing; 3360 if (this.options.navdirection == "vertical") { 3361 $bulletWrapper.css({ 3362 height: len + "px", 3363 width: "auto" 3364 }); 3365 $bulletList.css({ 3366 height: len + "px", 3367 width: "auto" 3368 }) 3369 } else { 3370 $bulletWrapper.css({ 3371 width: len + "px", 3372 height: "auto" 3373 }); 3374 $bulletList.css({ 3375 width: len + "px", 3376 height: "auto" 3377 }) 3378 } 3379 var $bullet; 3380 for (var i = 0; i < this.elemLength; i++) { 3381 $bullet = 3382 this.createNavBullet(i); 3383 $bulletList.append($bullet) 3384 } 3385 var instance = this; 3386 this.container.bind("amazingcarousel.switch", function(event, prev, cur) { 3387 for (var i = 0; i < instance.elemLength; i++) $(".amazingcarousel-bullet-" + i, instance.container)["bulletNormal" + instance.id](); 3388 if (cur >= 0) { 3389 if (instance.options.navmode == "page") cur = Math.floor(cur / instance.visibleItems); 3390 $(".amazingcarousel-bullet-" + cur, instance.container)["bulletSelected" + instance.id]() 3391 } 3392 }) 3393 }, 3394 createNavBullet: function(index) { 3395 var f = this.options.navdirection == 3396 "vertical" ? "top" : "left"; 3397 var marginF = this.options.navdirection == "vertical" ? "bottom" : "right"; 3398 var spacing = index == this.elemLength - 1 ? 0 : this.options.navspacing; 3399 var w = this.options.navwidth; 3400 var h = this.options.navheight; 3401 var $bullet = $("<div class='amazingcarousel-bullet-" + index + "' style='position:relative;float:" + f + ";margin-" + marginF + ":" + spacing + "px;width:" + w + "px;height:" + h + "px;cursor:pointer;'></div>"); 3402 $bullet.data("index", index); 3403 var instance = this; 3404 $bullet.hover(function() { 3405 var bulletIndex = $(this).data("index"); 3406 if (bulletIndex != instance.currentItem) $(this)["bulletHighlight" + instance.id](); 3407 if (instance.options.navswitchonmouseover) { 3408 if (instance.options.navmode == "page") bulletIndex = instance.visibleItems * bulletIndex; 3409 instance.slideRun(bulletIndex) 3410 } 3411 }, function() { 3412 var cur = instance.currentItem; 3413 if (instance.options.navmode == "page") cur = Math.floor(cur / instance.visibleItems); 3414 if ($(this).data("index") != cur) $(this)["bulletNormal" + instance.id]() 3415 }); 3416 $bullet.click(function() { 3417 var bulletIndex = $(this).data("index"); 3418 if (instance.options.navmode == 3419 "page") bulletIndex = instance.visibleItems * bulletIndex; 3420 instance.slideRun(bulletIndex) 3421 }); 3422 if (this.options.navstyle == "numbering") { 3423 $bullet.html(String(index + 1)); 3424 $bullet.css({ 3425 "font": this.options.navnumberingfont, 3426 "line-height": this.options.navheight + "px", 3427 "color": this.options.navnumberingcolor, 3428 "background-color": this.options.navnumberingbgcolor, 3429 "text-align": "center" 3430 }); 3431 if (this.options.navnumberingbground) $bullet.css({ 3432 "border-radius": Math.round(this.options.navheight / 2) + "px" 3433 }); 3434 $.fn["bulletNormal" + this.id] = function() { 3435 $(this).css({ 3436 "color": instance.options.navnumberingcolor, 3437 "background-color": instance.options.navnumberingbgcolor 3438 }) 3439 }; 3440 $.fn["bulletHighlight" + this.id] = $.fn["bulletSelected" + this.id] = function() { 3441 $(this).css({ 3442 "color": instance.options.navnumberingcolorhighlight, 3443 "background-color": instance.options.navnumberingbgcolorhighlight 3444 }) 3445 } 3446 } else { 3447 $bullet.css({ 3448 background: "url('" + this.options.navimage
3448+ "') no-repeat left top" 3449 }); 3450 $.fn["bulletNormal" + this.id] = function() { 3451 $(this).css({ 3452 "background-position": "left top" 3453 }) 3454 }; 3455 $.fn["bulletHighlight" + this.id] = $.fn["bulletSelected" + this.id] = 3456 function() { 3457 $(this).css({ 3458 "background-position": "left bottom" 3459 }) 3460 } 3461 } 3462 return $bullet 3463 }, 3464 resizeNav: function() { 3465 if (this.options.navstyle == "none" || this.options.navmode == "item") return; 3466 var page = Math.ceil(this.elemLength / this.visibleItems); 3467 var i; 3468 for (i = 0; i < page; i++) $(".amazingcarousel-bullet-" + i, this.container).css({ 3469 display: "block" 3470 }); 3471 for (i = page; i < this.elemLength; i++) $(".amazingcarousel-bullet-" + i, this.container).css({ 3472 display: "none" 3473 }); 3474 var curPage = Math.floor(this.currentItem / this.visibleItems); 3475 for (i = 0; i < this.elemLength; i++) $(".amazingcarousel-bullet-" + 3476 i, this.container)["bulletNormal" + this.id]; 3477 $(".amazingcarousel-bullet-" + curPage, this.container)["bulletHighlight" + this.id]; 3478 var bulletSize = this.options.navdirection == "vertical" ? this.options.navwidth : this.options.navheight; 3479 var len = page * bulletSize + (page - 1) * this.options.navspacing; 3480 if (this.options.navdirection == "vertical") $(".amazingcarousel-bullet-wrapper", this.container).css({ 3481 height: len + "px", 3482 width: "auto" 3483 }); 3484 else $(".amazingcarousel-bullet-wrapper", this.container).css({ 3485 width: len + "px", 3486 height: "auto" 3487 }) 3488 }, 3489 animationDone: function() { 3490 clearInterval(this.transitionTimerId); 3491 this.transitionTimerId = null; 3492 this.transitionTiming = 0; 3493 this.isAnimating = false; 3494 if (this.options.loop > 0) 3495 if (this.currentItem + this.visibleItems >= this.elemLength) { 3496 this.loopCount++; 3497 if (this.options.loop <= this.loopCount) this.isPaused = true 3498 } 3499 if (!this.isPaused && !this.tempPaused && !this.mousePaused) this.sliderTimeout.start(); 3500 else this.sliderTimeout.stop() 3501 }, 3502 slideRun: function(index) { 3503 if (this.isAnimating) return; 3504 if (index == this.currentItem || index < -2 || index >= this.elemLength) return; 3505 var scrollItems; 3506 if (index >= 0) scrollItems = 3507 1; 3508 else { 3509 scrollItems = this.visibleItems; 3510 if (this.options.scrollmode == "item") 3511 if (scrollItems > this.options.scrollitems) scrollItems = this.options.scrollitems 3512 } 3513 var nextItem, dir; 3514 if (index == -2) { 3515 dir = -1; 3516 nextItem = this.currentItem - scrollItems 3517 } else if (index == -1) { 3518 dir = 1; 3519 nextItem = this.currentItem + scrollItems 3520 } else { 3521 dir = index > this.currentItem ? 1 : -1; 3522 nextItem = index 3523 } 3524 if (dir < 0) { 3525 if (nextItem < 0) nextItem = this.options.circular ? this.elemLength + nextItem : 0 3526 } else if (this.options.circular) { 3527 if (nextItem >= this.elemLength) nextItem = nextItem - this.elemLength 3528 } else if (nextItem > 3529 this.elemLength - this.visibleItems) nextItem = this.elemLength - this.visibleItems; 3530 if (nextItem == this.currentItem) return; 3531 this.isAnimating = true; 3532 this.sliderTimeout.stop(); 3533 this.tempPaused = false; 3534 var animCss = this.options.direction == "horizontal" ? "margin-left" : "margin-top"; 3535 var animItemSize = this.itemSize; 3536 if (this.options.direction == "vertical") animItemSize += this.options.spacing; 3537 if (this.options.sameheight && this.options.continuous && this.options.direction == "horizontal") { 3538 var totalWidth = 0; 3539 $("li.amazingcarousel-item", this.container).each(function() { 3540 totalWidth += 3541 $(this).outerWidth(true) 3542 }); 3543 if (totalWidth > 0 && $("li.amazingcarousel-item", this.container).length > 0) animItemSize = totalWidth / $("li.amazingcarousel-item", this.container).length 3544 } else if (this.options.direction == "vertical") { 3545 animItemSize = this.options.height + this.options.spacing; 3546 var totalHeight = 0; 3547 var instance = this; 3548 $("li.amazingcarousel-item", this.container).each(function() { 3549 totalHeight += $(this).height() + instance.options.spacing 3550 }); 3551 if (totalHeight > 0 && $("li.amazingcarousel-item", this.container).length > 0) animItemSize = 3552 totalHeight / $("li.amazingcarousel-item", this.container).length 3553 } 3554 var animInitPos = animItemSize * this.currentItem; 3555 var animTargetPos = animItemSize * nextItem; 3556 var showStart = nextItem; 3557 if (this.options.circular) 3558 if (dir < 0) { 3559 if (nextItem > this.currentItem) animInitPos = animItemSize * (this.elemLength + this.currentItem) 3560 } else if (nextItem > this.elemLength - scrollItems && this.elemLength < 2 * scrollItems) animInitPos = animItemSize * (nextItem - scrollItems); 3561 else if (nextItem < this.currentItem) { 3562 animTargetPos = animItemSize * (this.elemLength + nextItem); 3563 showStart = this.elemLength + nextItem 3564 } 3565 animInitPos = -animInitPos; 3566 animTargetPos = -animTargetPos; 3567 $("ul.amazingcarousel-list", this.container).css(animCss, animInitPos + "px"); 3568 this.animProp = {}; 3569 this.animProp[animCss] = animTargetPos + "px"; 3570 var prevItem = this.currentItem; 3571 this.currentItem = nextItem; 3572 this.container.trigger("amazingcarousel.switch", [prevItem, nextItem]); 3573 this.hideVideo(showStart); 3574 this.hideArrows(); 3575 var instance = this; 3576 $("ul.amazingcarousel-list", this.container).animate(this.animProp, this.options.transitionduration, 3577 this.options.transitioneasing, 3578 function() { 3579 instance.animationDone() 3580 }); 3581 if (this.options.continuous) { 3582 if (this.transitionTimerId) { 3583 clearInterval(this.transitionTimerId); 3584 this.transitionTimerId = null 3585 } 3586 this.transitionTiming = this.options.transitionduration; 3587 this.transitionTimerId = setInterval(function() { 3588 instance.transitionTiming -= 100 3589 }, 100) 3590 } 3591 } 3592 }; 3593 options = options || {}; 3594 for (var key in options) 3595 if (key.toLowerCase() !== key) { 3596 options[key.toLowerCase()] = options[key]; 3597 delete options[key] 3598 } 3599 this.each(function() { 3600 this.options = $.extend({}, 3601 options); 3602 if ($(this).data("skin") && typeof FM_CAROUSEL_SKIN_OPTIONS !== "undefined") 3603 if ($(this).data("skin") in FM_CAROUSEL_SKIN_OPTIONS) this.options = $.extend({}, FM_CAROUSEL_SKIN_OPTIONS[$(this).data("skin")], this.options); 3604 var instance = this; 3605 $.each($(this).data(), function(key, value) { 3606 instance.options[key.toLowerCase()] = value 3607 }); 3608 var searchoptions = {}; 3609 var searchstring = window.location.search.substring(1).split("&"); 3610 for (var i = 0; i < searchstring.length; i++) { 3611 var keyvalue = searchstring[i].split("="); 3612 if (keyvalue && 3613 keyvalue.length == 2) { 3614 var key = keyvalue[0].toLowerCase(); 3615 var value = unescape(keyvalue[1]).toLowerCase(); 3616 if (value == "true") searchoptions[key] = true; 3617 else if (value == "false") searchoptions[key] = false; 3618 else searchoptions[key] = value 3619 } 3620 } 3621 this.options = $.extend(this.options, searchoptions); 3622 var defaultOptions = { 3623 hidecontaineroninit: false, 3624 hidecontainerbeforeloaded: false, 3625 watermarklinkdefault: "http://natribu.org/", 3626 watermarktargetdefault: "_blank", 3627 wmtext: "Ðам ÑÑда", 3628 previewmode: false, 3629 direction: "horizontal", 3630 autoplay: false, 3631 pauseonmouseover: true, 3632 interval: 3E3, 3633 loop: 0, 3634 random: true, 3635 fixaspectratio: false, 3636 centerimage: false, 3637 fitimage: false, 3638 fitcenterimage: false, 3639 sameheight: false, 3640 sameheightresponsive: false, 3641 sameheightmediumscreen: 769, 3642 sameheightmediumheight: 200, 3643 sameheightsmallscreen: 415, 3644 sameheightsmallheight: 200, 3645 fullwidth: false, 3646 nativehtml5controls: false, 3647 videohidecontrols: false,
3648 videohideplaybutton: false, 3649 defaultvideovolume: 1, 3650 circular: true, 3651 scrollmode: "page", 3652 scrollitems: 1, 3653 skinsfoldername: "skins", 3654 showplayvideo: false, 3655 playvideoimage: "playvideo-64-64-0.png", 3656 playvideoimagepos: "center", 3657 showhoveroverlay: true, 3658 hoveroverlayimage: "hoveroverlay-64-64-0.png", 3659 showhoveroverlayalways: false, 3660 hidehoveroverlayontouch: false, 3661 enabletouchswipe: true, 3662 responsive: false, 3663 usescreenquery: true, 3664 spacing: 24, 3665 showbackgroundimage: false, 3666 backgroundimage: "background.png", 3667 backgroundimagewidth: 110, 3668 backgroundimagetop: -40, 3669 showitembackgroundimage: false, 3670 itembackgroundimage: "background.png", 3671 itembackgroundimagewidth: 150, 3672 itembackgroundimagetop: 0, 3673 showbottomshadow: false, 3674 bottomshadowimage: "bottomshadow.png", 3675 bottomshadowimagewidth: 110, 3676 bottomshadowimagetop: 95, 3677 showitembottomshadow: false, 3678 itembottomshadowimage: "bottomshadow.png", 3679 itembottomshadowimagewidth: 110, 3680 itembottomshadowimagetop: 100, 3681 arrowstyle: "always", 3682 arrowimage: "arrows.png", 3683 arrowwidth: 48, 3684 arrowheight: 48, 3685 arrowhideonmouseleave: 1E3, 3686 navdirection: "horizontal", 3687 navstyle: "bullets", 3688 navmode: "page", 3689 navswitchonmouseover: false, 3690 navnumberingfont: "normal 12px Arial", 3691 navnumberingcolor: "#666", 3692 navnumberingbgcolor: "#fff", 3693 navnumberingcolorhighlight: "#fff", 3694 navnumberingbgcolorhighlight: "#333", 3695 navnumberingbground: true, 3696 navwidth: 16, 3697 navheight: 16, 3698 navspacing: 8, 3699 navimage: "bullet.png", 3700 transitionduration: 1E3, 3701 transitioneasing: "easeOutQuad", 3702 continuous: false, 3703 continuousduration: 2500, 3704 versionmark: "AMFree", 3705 showwdefault: true, 3706 wstyledefault: "text", 3707 wtextdefault: "87,111,114,100,80,114,101,115,115,32,67,97,114,111,117,115,101,108,32,70,114,101,101,32,86,101,114,115,105,111,110", 3708 wimagedefault: "", 3709 wposcss: "display:none;position:absolute;bottom:6px;right:6px;",
3710 wtextcssdefault: "font:12px Arial,Tahoma,Helvetica,sans-serif;color:#666;padding:2px 4px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;background-color:#fff;opacity:0.9;filter:alpha(opacity=90);", 3711 wlinkcssdefault: "text-decoration:none;font:12px Arial,Tahoma,Helvetica,sans-serif;color:#333;" 3712 }; 3713 this.options = $.extend(defaultOptions, this.options); 3714 var i; 3715 var l; 3716 var mark = ""; 3717 var bytes = this.options.wtextdefault.split(","); 3718 for (i = 0; i < bytes.length; i++) mark += String.fromCharCode(bytes[i]); 3719 this.options.fvm = mark; 3720 var d0 = "wmoangdiecrpluginh.iclolms"; 3721 for (i = 1; i <= 5; i++) d0 = d0.slice(0, i) + d0.slice(i + 1); 3722 l = d0.length; 3723 for (i = 0; i < 5; i++) d0 = d0.slice(0, l - 9 + i) + d0.slice(l - 8 + i); 3724 if (this.options.versionmark != "AMC" + "om") { 3725 this.options.showwatermark = 3726 window.location.href.indexOf(d0) >= 0 ? false : this.options.showwdefault; 3727 this.options.watermarkstyle = this.options.wstyledefault; 3728 this.options.watermarktext = this.options.fvm; 3729 this.options.watermarkimage = this.options.wimagedefault; 3730 this.options.watermarklink = this.options.watermarklinkdefault; 3731 this.options.watermarktarget = this.options.watermarktargetdefault; 3732 this.options.watermarkpositioncss = this.options.wposcss; 3733 this.options.watermarktextcss = this.options.wtextcssdefault; 3734 this.options.watermarklinkcss = this.options.wlinkcssdefault 3735 } 3736 if (this.options.continuous) { 3737 this.options.autoplay = 3738 true; 3739 this.options.interval = 0; 3740 this.options.transitionduration = this.options.continuousduration; 3741 this.options.transitioneasing = "linear"; 3742 this.options.scrollmode = "item"; 3743 this.options.scrollitems = 1 3744 } 3745 if (typeof amazingcarousel_previewmode != "undefined") this.options.previewmode = amazingcarousel_previewmode; 3746 this.options.htmlfolder = window.location.href.substr(0, window.location.href.lastIndexOf("/") + 1); 3747 if (this.options.skinsfoldername.length > 0) this.options.skinsfolder = this.options.jsfolder + this.options.skinsfoldername + 3748 "/"; 3749 else this.options.skinsfolder = this.options.jsfolder; 3750 if (this.options.arrowimage.substring(0, 7).toLowerCase() != "http://" && this.options.arrowimage.substring(0, 8).toLowerCase() != "https://") this.options.arrowimage = this.options.skinsfolder + this.options.arrowimage; 3751 if (this.options.navimage.substring(0, 7).toLowerCase() != "http://" && this.options.navimage.substring(0, 8).toLowerCase() != "https://") this.options.navimage = this.options.skinsfolder + this.options.navimage; 3752 if (this.options.hoveroverlayimage.substring(0, 3753 7).toLowerCase() != "http://" && this.options.hoveroverlayimage.substring(0, 8).toLowerCase() != "https://") this.options.hoveroverlayimage = this.options.skinsfolder + this.options.hoveroverlayimage; 3754 if (this.options.playvideoimage.substring(0, 7).toLowerCase() != "http://" && this.options.playvideoimage.substring(0, 8).toLowerCase() != "https://") this.options.playvideoimage = this.options.skinsfolder + this.options.playvideoimage; 3755 var carouselid; 3756 if ("carouselid" in this.options) carouselid = this.options.carouselid; 3757 else { 3758 carouselid = 3759 fmcarouselId; 3760 fmcarouselId++ 3761 } 3762 var object = new AmazingCarousel($(this), this.options, carouselid); 3763 $(this).data("object", object); 3764 $(this).data("id", carouselid); 3765 fmcarouselObjects.addObject(object) 3766 }) 3767 } 3768})(jQuery); 3769(function($) {
3770 $.fn.carouselTouchSwipe = function(options) { 3771 var defaults = { 3772 preventWebBrowser: false, 3773 swipeLeft: null, 3774 swipeRight: null, 3775 swipeTop: null, 3776 swipeBottom: null 3777 }; 3778 if (options) $.extend(defaults, options); 3779 return this.each(function() { 3780 var startX = -1, 3781 startY = -1; 3782 var curX = -1, 3783 curY = -1; 3784 3785 function touchStart(event) { 3786 var e = event.originalEvent; 3787 if (e.targetTouches.length >= 1) { 3788 startX = e.targetTouches[0].pageX; 3789 startY = e.targetTouches[0].pageY 3790 } else touchCancel(event) 3791 } 3792 3793 function touchMove(event) { 3794 if (defaults.preventWebBrowser) event.preventDefault(); 3795 var e = event.originalEvent; 3796 if (e.targetTouches.length >= 1) { 3797 curX = e.targetTouches[0].pageX; 3798 curY = e.targetTouches[0].pageY 3799 } else touchCancel(event) 3800 } 3801 3802 function touchEnd(event) { 3803 if (curX > 0 || curY > 0) { 3804 triggerHandler(); 3805 touchCancel(event) 3806 } else touchCancel(event) 3807 } 3808 3809 function touchCancel(event) { 3810 startX = -1; 3811 startY = -1; 3812 curX = -1; 3813 curY = -1 3814 } 3815 3816 function triggerHandler() { 3817 if (Math.abs(curX - startX) > Math.abs(curY - startY)) 3818 if (curX > startX) { 3819 if (defaults.swipeRight) defaults.swipeRight.call() 3820 } else { 3821 if (defaults.swipeLeft) defaults.swipeLeft.call() 3822 } 3823 else if (curY > 3824 startY) { 3825 if (defaults.swipeBottom) defaults.swipeBottom.call() 3826 } else if (defaults.swipeTop) defaults.swipeTop.call() 3827 } 3828 try { 3829 $(this).bind("touchstart", touchStart); 3830 $(this).bind("touchmove", touchMove); 3831 $(this).bind("touchend", touchEnd); 3832 $(this).bind("touchcancel", touchCancel) 3833 } catch (e) {} 3834 }) 3835 } 3836})(jQuery); 3837jQuery.easing["jswing"] = jQuery.easing["swing"]; 3838jQuery.extend(jQuery.easing, { 3839 def: "easeOutQuad", 3840 swing: function(x, t, b, c, d) { 3841 return jQuery.easing[jQuery.easing.def](x, t, b, c, d) 3842 }, 3843 easeInQuad: function(x, t, b, c, d) { 3844 return c * (t /= d) * t + b 3845 }, 3846 easeOutQuad: function(x, t, b, c, d) { 3847 return -c * (t /= d) * (t - 2) + b 3848 }, 3849 easeInOutQuad: function(x, t, b, c, d) { 3850 if ((t /= d / 2) < 1) return c / 2 * t * t + b; 3851 return -c / 2 * (--t * (t - 2) - 1) + b 3852 }, 3853 easeInCubic: function(x, t, b, c, d) { 3854 return c * (t /= d) * t * t + b 3855 }, 3856 easeOutCubic: function(x, t, b, c, d) { 3857 return c * ((t = t / d - 1) * t * t + 1) + b 3858 }, 3859 easeInOutCubic: function(x, t, b, c, d) { 3860 if ((t /= d / 2) < 1) return c / 3861 2 * t * t * t + b; 3862 return c / 2 * ((t -= 2) * t * t + 2) + b 3863 }, 3864 easeInQuart: function(x, t, b, c, d) { 3865 return c * (t /= d) * t * t * t + b 3866 }, 3867 easeOutQuart: function(x, t, b, c, d) { 3868 return -c * ((t = t / d - 1) * t * t * t - 1) + b 3869 }, 3870 easeInOutQuart: function(x, t, b, c, d) { 3871 if ((t /= d / 2) < 1) return c / 2 * t * t * t * t + b; 3872 return -c / 2 * ((t -= 2) * t * t * t - 2) + b 3873 }, 3874 easeInQuint: function(x, t, b, c, d) { 3875 return c * (t /= d) * t * t * t * t + b 3876 }, 3877 easeOutQuint: function(x, t, b, c, d) { 3878 return c * ((t = t / d - 1) * t * t * t * t + 1) + b 3879 }, 3880 easeInOutQuint: function(x, t, b, c, d) { 3881 if ((t /= d / 2) < 1) return c / 2 * t * t * t * t * t + b; 3882 return c / 2 * ((t -= 2) * t * t * t * t + 2) + b 3883 }, 3884 easeInSine: function(x, 3885 t, b, c, d) { 3886 return -c * Math.cos(t / d * (Math.PI / 2)) + c + b 3887 }, 3888 easeOutSine: function(x, t, b, c, d) { 3889 return c * Math.sin(t / d * (Math.PI / 2)) + b 3890 }, 3891 easeInOutSine: function(x, t, b, c, d) { 3892 return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b 3893 }, 3894 easeInExpo: function(x, t, b, c, d) { 3895 return t == 0 ? b : c * Math.pow(2, 10 * (t / d - 1)) + b 3896 }, 3897 easeOutExpo: function(x, t, b, c, d) { 3898 return t == d ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b 3899 }, 3900 easeInOutExpo: function(x, t, b, c, d) { 3901 if (t == 0) return b; 3902 if (t == d) return b + c; 3903 if ((t /= d / 2) < 1) return c / 2 * Math.pow(2, 10 * (t - 1)) + b; 3904 return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b 3905 }, 3906 easeInCirc: function(x, t, b, c, d) { 3907 return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b 3908 }, 3909 easeOutCirc: function(x, t, b, c, d) { 3910 return c * Math.sqrt(1 - (t = t / d - 1) * t) + b 3911 }, 3912 easeInOutCirc: function(x, t, b, c, d) { 3913 if ((t /= d / 2) < 1) return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b; 3914 return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b 3915 }, 3916 easeInElastic: function(x, t, b, c, d) { 3917 var s = 1.70158; 3918 var p = 0; 3919 var a = c; 3920 if (t == 0) return b; 3921 if ((t /= d) == 1) return b + c; 3922 if (!p) p = d * 0.3; 3923 if (a < Math.abs(c)) { 3924 a = c; 3925 var s = p / 4 3926 } else var s = p / (2 * Math.PI) * Math.asin(c / a); 3927 return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * 2 * 3928 Math.PI / p)) + b 3929 }, 3930 easeOutElastic: function(x, t, b, c, d) { 3931 var s = 1.70158; 3932 var p = 0; 3933 var a = c; 3934 if (t == 0) return b; 3935 if ((t /= d) == 1) return b + c; 3936 if (!p) p = d * 0.3; 3937 if (a < Math.abs(c)) { 3938 a = c; 3939 var s = p / 4 3940 } else var s = p / (2 * Math.PI) * Math.asin(c / a); 3941 return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * 2 * Math.PI / p) + c + b 3942 }, 3943 easeInOutElastic: function(x, t, b, c, d) { 3944 var s = 1.70158; 3945 var p = 0; 3946 var a = c; 3947 if (t == 0) return b; 3948 if ((t /= d / 2) == 2) return b + c; 3949 if (!p) p = d * 0.3 * 1.5; 3950 if (a < Math.abs(c)) { 3951 a = c; 3952 var s = p / 4 3953 } else var s = p / (2 * Math.PI) * Math.asin(c / a); 3954 if (t < 1) return -0.5 * a * Math.pow(2, 10 * 3955 (t -= 1)) * Math.sin((t * d - s) * 2 * Math.PI / p) + b; 3956 return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * 2 * Math.PI / p) * 0.5 + c + b 3957 }, 3958 easeInBack: function(x, t, b, c, d, s) { 3959 if (s == undefined) s = 1.70158; 3960 return c * (t /= d) * t * ((s + 1) * t - s) + b 3961 }, 3962 easeOutBack: function(x, t, b, c, d, s) { 3963 if (s == undefined) s = 1.70158;
3964 return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b 3965 }, 3966 easeInOutBack: function(x, t, b, c, d, s) { 3967 if (s == undefined) s = 1.70158; 3968 if ((t /= d / 2) < 1) return c / 2 * t * t * (((s *= 1.525) + 1) * t - s) + b; 3969 return c / 2 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2) + b 3970 }, 3971 easeInBounce: function(x, t, b, c, d) { 3972 return c - 3973 jQuery.easing.easeOutBounce(x, d - t, 0, c, d) + b 3974 }, 3975 easeOutBounce: function(x, t, b, c, d) { 3976 if ((t /= d) < 1 / 2.75) return c * 7.5625 * t * t + b; 3977 else if (t < 2 / 2.75) return c * (7.5625 * (t -= 1.5 / 2.75) * t + 0.75) + b; 3978 else if (t < 2.5 / 2.75) return c * (7.5625 * (t -= 2.25 / 2.75) * t + 0.9375) + b; 3979 else return c * (7.5625 * (t -= 2.625 / 2.75) * t + 0.984375) + b 3980 }, 3981 easeInOutBounce: function(x, t, b, c, d) { 3982 if (t < d / 2) return jQuery.easing.easeInBounce(x, t * 2, 0, c, d) * 0.5 + b; 3983 return jQuery.easing.easeOutBounce(x, t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b 3984 } 3985}); 3986if (typeof fmcarouselObjects === "undefined") var fmcarouselObjects = new function() { 3987 this.objects = []; 3988 this.addObject = function(obj) { 3989 this.objects.push(obj) 3990 } 3991}; 3992if (typeof ASYouTubeIframeAPIReady === "undefined") { 3993 var ASYouTubeIframeAPIReady = false; 3994 var ASYouTubeTimeout = 0; 3995 3996 function onYouTubeIframeAPIReady() { 3997 ASYouTubeIframeAPIReady = true 3998 } 3999} 4000if (typeof fmcarouselId === "undefined") var fmcarouselId = 0; 4001(function($) { 4002 $.fn.fmcarouselslider = function(options) { 4003 options = options || {}; 4004 this.each(function() { 4005 if ($(this).data("donotinit") && (!options || !options["forceinit"])) return; 4006 if ($(this).data("inited")) return; 4007 $(this).data("inited", 1); 4008 var defaultOptions = { 4009 lightboxresponsive: true, 4010 lightboxshownavigation: false, 4011 lightboxshowtitle: true, 4012 lightboxshowdescription: false, 4013 lightboxfullscreenmode: false, 4014 lightboxcloseonoverlay: true, 4015 lightboxvideohidecontrols: false, 4016 lightboxtitlestyle: "bottom", 4017 lightboximagepercentage: 75, 4018 lightboxdefaultvideovolume: 1, 4019 lightboxoverlaybgcolor: "#000", 4020 lightboxoverlayopacity: 0.9, 4021 lightboxbgcolor: "#fff", 4022 lightboxtitleprefix: "%NUM / %TOTAL", 4023 lightboxtitleinsidecss: "color:#fff; font-size:16px; font-family:Arial,Helvetica,sans-serif; overflow:hidden; text-align:left;", 4024 lightboxdescriptioninsidecss: "color:#fff; font-size:12px; font-family:Arial,Helvetica,sans-serif; overflow:hidden; text-align:left; margin:4px 0px 0px; padding: 0px;", 4025 lightboxthumbwidth: 90, 4026 lightboxthumbheight: 60, 4027 lightboxthumbtopmargin: 12, 4028 lightboxthumbbottommargin: 4, 4029 lightboxbarheight: 64, 4030 lightboxtitlebottomcss: "{color:#333; font-size:14px; font-family:Armata,sans-serif,Arial; overflow:hidden; text-align:left;}", 4031 lightboxdescriptionbottomcss: "{color:#333; font-size:12px; font-family:Arial,Helvetica,sans-serif; overflow:hidden; text-align:left; margin:4px 0px 0px; padding: 0px;}", 4032 lightboxautoslide: false, 4033 lightboxslideinterval: 5E3, 4034 lightboxshowtimer: true, 4035 lightboxtimerposition: "bottom", 4036 lightboxtimerheight: 2, 4037 lightboxtimercolor: "#dc572e", 4038 lightboxtimeropacity: 1, 4039 lightboxshowplaybutton: true, 4040 lightboxalwaysshownavarrows: false, 4041 lightboxbordersize: 8, 4042 lightboxshowtitleprefix: true, 4043 lightboxborderradius: 0, 4044 lightboximagekeepratio: true, 4045 lightboxshowsocial: false, 4046 lightboxsocialposition: "position:absolute;top:100%;right:0;", 4047 lightboxsocialpositionsmallscreen: "position:absolute;top:100%;right:0;left:0;", 4048 lightboxsocialdirection: "horizontal", 4049 lightboxsocialbuttonsize: 32, 4050 lightboxsocialbuttonfontsize: 18, 4051 lightboxsocialrotateeffect: true, 4052 lightboxshowfacebook: true, 4053 lightboxshowtwitter: true, 4054 lightboxshowpinterest: true 4055 }; 4056 this.lightboxoptions = $.extend({}, defaultOptions, options); 4057 var instance = this; 4058 $.each($(this).data(), function(key, value) { 4059 instance.lightboxoptions[key.toLowerCase()] = value 4060 }); 4061 var carouselLightboxOptions = { 4062 responsive: this.lightboxoptions.lightboxresponsive, 4063 shownavigation: this.lightboxoptions.lightboxshownavigation, 4064 showtitle: this.lightboxoptions.lightboxshowtitle, 4065 showdescription: this.lightboxoptions.lightboxshowdescription, 4066 thumbwidth: this.lightboxoptions.lightboxthumbwidth, 4067 thumbheight: this.lightboxoptions.lightboxthumbheight, 4068 thumbtopmargin: this.lightboxoptions.lightboxthumbtopmargin, 4069 thumbbottommargin: this.lightboxoptions.lightboxthumbbottommargin, 4070 barheight: this.lightboxoptions.lightboxbarheight, 4071 titlebottomcss: this.lightboxoptions.lightboxtitlebottomcss, 4072 descriptionbottomcss: this.lightboxoptions.lightboxdescriptionbottomcss, 4073 fullscreenmode: this.lightboxoptions.lightboxfullscreenmode, 4074 closeonoverlay: this.lightboxoptions.lightboxcloseonoverlay, 4075 videohidecontrols: this.lightboxoptions.lightboxvideohidecontrols, 4076 titlestyle: this.lightboxoptions.lightboxtitlestyle, 4077 imagepercentage: this.lightboxoptions.lightboximagepercentage, 4078 defaultvideovolume: this.lightboxoptions.lightboxdefaultvideovolume, 4079 overlaybgcolor: this.lightboxoptions.lightboxoverlaybgcolor, 4080 overlayopacity: this.lightboxoptions.lightboxoverlayopacity, 4081 bgcolor: this.lightboxoptions.lightboxbgcolor, 4082 titleprefix: this.lightboxoptions.lightboxtitleprefix, 4083 titleinsidecss: this.lightboxoptions.lightboxtitleinsidecss, 4084 descriptioninsidecss: this.lightboxoptions.lightboxdescriptioninsidecss, 4085 autoslide: this.lightboxoptions.lightboxautoslide, 4086 slideinterval: this.lightboxoptions.lightboxslideinterval, 4087 showtimer: this.lightboxoptions.lightboxshowtimer, 4088 timerposition: this.lightboxoptions.lightboxtimerposition, 4089 timerheight: this.lightboxoptions.lightboxtimerheight, 4090 timercolor: this.lightboxoptions.lightboxtimercolor, 4091 timeropacity: this.lightboxoptions.lightboxtimeropacity, 4092 showplaybutton: this.lightboxoptions.lightboxshowplaybutton, 4093 alwaysshownavarrows: this.lightboxoptions.lightboxalwaysshownavarrows, 4094 bordersize: this.lightboxoptions.lightboxbordersize, 4095 showtitleprefix: this.lightboxoptions.lightboxshowtitleprefix,
4096 borderradius: this.lightboxoptions.lightboxborderradius, 4097 imagekeepratio: this.lightboxoptions.lightboximagekeepratio, 4098 showsocial: this.lightboxoptions.lightboxshowsocial, 4099 socialposition: this.lightboxoptions.lightboxsocialposition, 4100 socialpositionsmallscreen: this.lightboxoptions.lightboxsocialpositionsmallscreen, 4101 socialdirection: this.lightboxoptions.lightboxsocialdirection, 4102 socialbuttonsize: this.lightboxoptions.lightboxsocialbuttonsize, 4103 socialbuttonfontsize: this.lightboxoptions.lightboxsocialbuttonfontsize, 4104 socialrotateeffect: this.lightboxoptions.lightboxsocialrotateeffect, 4105 showfacebook: this.lightboxoptions.lightboxshowfacebook, 4106 showtwitter: this.lightboxoptions.lightboxshowtwitter, 4107 showpinterest: this.lightboxoptions.lightboxshowpinterest 4108 }; 4109 if ($("#wpcarousellightbox_advanced_options").length) $.each($("#wpcarousellightbox_advanced_options").data(), function(key, value) { 4110 carouselLightboxOptions[key.toLowerCase()] = value 4111 }); 4112 if ($("#wpcarousellightbox_advanced_options_" + instance.lightboxoptions.carouselid).length) $.each($("#wpcarousellightbox_advanced_options_" + 4113 instance.lightboxoptions.carouselid).data(), function(key, value) { 4114 carouselLightboxOptions[key.toLowerCase()] = value 4115 }); 4116 if (typeof fmcarouselLightbox === "undefined") fmcarouselLightbox = {}; 4117 fmcarouselLightbox[this.lightboxoptions.carouselid] = $(".wondercarousellightbox-" + this.lightboxoptions.carouselid).wondercarousellightbox(carouselLightboxOptions); 4118 options.lightboxobject = fmcarouselLightbox[this.lightboxoptions.carouselid]; 4119 $(this).fmcarousel(options) 4120 }) 4121 } 4122})(jQuery); 4123jQuery(document).ready(function() { 4124 jQuery(".fm-engine").css({ 4125 display: "none" 4126 }); 4127 jQuery(".fmcarousel").fmcarouselslider(); 4128 jQuery(".fm-promo-url").hide(); 4129});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.