1/** 2 * Copyright ETS Software Technology Co., Ltd 3 * 4 * NOTICE OF LICENSE 5 * 6 * This file is not open source! Each license that you purchased is only available for 1 website only. 7 * If you want to use this file on more websites (or projects), you need to purchase additional licenses. 8 * You are not allowed to redistribute, resell, lease, license, sub-license or offer our resources to any third party. 9 * 10 * DISCLAIMER 11 * 12 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer 13 * versions in the future. 14 * 15 * @author ETS Software Technology Co., Ltd 16 * @copyright ETS Software Technology Co., Ltd 17 * @license Valid for 1 website (or project) for each purchase of license 18 */ 19(function(e) { 20 function t() { 21 var e = location.href; 22 hashtag = e.indexOf("#prettyPhoto") !== -1 ? decodeURI(e.substring(e.indexOf("#prettyPhoto") + 1, e.length)) : false; 23 return hashtag 24 } 25 26 function n() { 27 if (typeof theRel == "undefined") return; 28 location.hash = theRel + "/" + rel_index + "/" 29 } 30 31 function r() { 32 if (location.href.indexOf("#prettyPhoto") !== -1) location.hash = "prettyPhoto" 33 } 34 35 function i(e, t) { 36 e = e.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); 37 var n = "[\\?&]" + e + "=([^&#]*)"; 38 var r = new RegExp(n); 39 var i = r.exec(t); 40 return i == null ? "" : i[1] 41 } 42 e.prettyPhoto = { 43 version: "3.1.5" 44 }; 45 e.fn.prettyPhoto = function(s) { 46 function g() { 47 e(".pp_loaderIcon").hide(); 48 projectedTop = scroll_pos["scrollTop"] + (d / 2 - a["containerHeight"] / 2); 49 if (projectedTop < 0) projectedTop = 0; 50 $ppt.fadeTo(settings.animation_speed, 1); 51 $pp_pic_holder.find(".pp_content").animate({ 52 height: a["contentHeight"], 53 width: a["contentWidth"] 54 }, settings.animation_speed); 55 $pp_pic_holder.animate({ 56 top: projectedTop, 57 left: v / 2 - a["containerWidth"] / 2 < 0 ? 0 : v / 2 - a["containerWidth"] / 2, 58 width: a["containerWidth"] 59 }, settings.animation_speed, function() { 60 $pp_pic_holder.find(".pp_hoverContainer,#fullResImage").height(a["height"]).width(a["width"]); 61 $pp_pic_holder.find(".pp_fade").fadeIn(settings.animation_speed); 62 if (isSet && S(pp_images[set_position]) == "image") { 63 $pp_pic_holder.find(".pp_hoverContainer").show() 64 } else { 65 $pp_pic_holder.find(".pp_hoverContainer").hide() 66 } 67 if (settings.allow_expand) { 68 if (a["resized"]) { 69 e("a.pp_expand,a.pp_contract").show() 70 } else { 71 e("a.pp_expand").hide() 72 } 73 } 74 if (settings.autoplay_slideshow && !m && !f) e.prettyPhoto.startSlideshow(); 75 settings.changepicturecallback(); 76 f = true 77 }); 78 C(); 79 s.ajaxcallback() 80 } 81 82 function y(t) { 83 $pp_pic_holder.find("#pp_full_res object,#pp_full_res embed").css("visibility", "hidden"); 84 $pp_pic_holder.find(".pp_fade").fadeOut(settings.animation_speed, function() { 85 e(".pp_loaderIcon").show(); 86 t() 87 }) 88 } 89 90 function b(t) { 91 t > 1 ? e(".pp_nav").show() : e(".pp_nav").hide() 92 } 93 94 function w(e, t) { 95 resized = false; 96 E(e, t); 97 imageWidth = e, imageHeight = t; 98 if ((p > v || h > d) && doresize && settings.allow_resize && !u) { 99 resized = true, fitting = false; 100 while (!fitting) { 101 if (p > v) { 102 imageWidth = v - 50; 103 imageHeight = t / e * imageWidth 104 } else if (h > d) { 105 imageHeight = d - 50; 106 imageWidth = e / t * imageHeight 107 } else { 108 fitting = true 109 } 110 h = imageHeight, p = imageWidth 111 } 112 if (p > v || h > d) { 113 w(p, h) 114 } 115 E(imageWidth, imageHeight) 116 } 117 return { 118 width: Math.floor(imageWidth), 119 height: Math.floor(imageHeight), 120 containerHeight: Math.floor(h), 121 containerWidth: Math.floor(p) + settings.horizontal_padding * 2, 122 contentHeight: Math.floor(l), 123 contentWidth: Math.floor(c), 124 resized: resized 125 } 126 } 127 128 function E(t, n) { 129 t = parseFloat(t); 130 n = parseFloat(n); 131 $pp_details = $pp_pic_holder.find(".pp_details"); 132 $pp_details.width(t); 133 detailsHeight = parseFloat($pp_details.css("marginTop")) + parseFloat($pp_details.css("marginBottom")); 134 $pp_details = $pp_details.clone().addClass(settings.theme).width(t).appendTo(e("body")).css({ 135 position: "absolute", 136 top: -1e4 137 }); 138 detailsHeight += $pp_details.height(); 139 detailsHeight = detailsHeight <= 34 ? 36 : detailsHeight; 140 $pp_details.remove(); 141 $pp_title = $pp_pic_holder.find(".ppt"); 142 $pp_title.width(t); 143 titleHeight = parseFloat($pp_title.css("marginTop")) + parseFloat($pp_title.css("marginBottom")); 144 $pp_title = $pp_title.clone().appendTo(e("body")).css({ 145 position: "absolute", 146 top: -1e4 147 }); 148 titleHeight += $pp_title.height(); 149 $pp_title.remove(); 150 l = n + detailsHeight; 151 c = t; 152 h = l + titleHeight + $pp_pic_holder.find(".pp_top").height() + $pp_pic_holder.find(".pp_bottom").height(); 153 p = t 154 } 155 156 function S(e) { 157 if (e.match(/youtube\.com\/watch/i) || e.match(/youtu\.be/i)) { 158 return "youtube" 159 } else if (e.match(/vimeo\.com/i)) { 160 return "vimeo" 161 } else if (e.match(/\b.mov\b/i)) { 162 return "quicktime" 163 } else if (e.match(/\b.swf\b/i)) { 164 return "flash" 165 } else if (e.match(/\biframe=true\b/i)) { 166 return "iframe" 167 } else if (e.match(/\bajax=true\b/i)) { 168 return "ajax" 169 } else if (e.match(/\bcustom=true\b/i)) { 170 return "custom" 171 } else if (e.substr(0, 1) == "#") { 172 return "inline" 173 } else { 174 return "image" 175 } 176 } 177 178 function x() { 179 if (doresize && typeof $pp_pic_holder != "undefined") { 180 scroll_pos = T(); 181 contentHeight = $pp_pic_holder.height(), contentwidth = $pp_pic_holder.width(); 182 projectedTop = d / 2 + scroll_pos["scrollTop"] - contentHeight / 2; 183 if (projectedTop < 0) projectedTop = 0; 184 if (contentHeight > d) return; 185 $pp_pic_holder.css({ 186 top: projectedTop, 187 left: v / 2 + scroll_pos["scrollLeft"] - contentwidth / 2 188 }) 189 } 190 } 191 192 function T() { 193 if (self.pageYOffset) { 194 return { 195 scrollTop: self.pageYOffset, 196 scrollLeft: self.pageXOffset 197 } 198 } else if (document.documentElement && document.documentElement.scrollTop) { 199 return { 200 scrollTop: document.documentElement.scrollTop, 201 scrollLeft: document.documentElement.scrollLeft 202 } 203 } else if (document.body) { 204 return { 205 scrollTop: document.body.scrollTop, 206 scrollLeft: document.body.scrollLeft 207 } 208 } 209 } 210 211 function N() { 212 d = e(window).height(), v = e(window).width(); 213 if (typeof $pp_overlay != "undefined") $pp_overlay.height(e(document).height()).width(v) 214 } 215 216 function C() { 217 if (isSet && settings.overlay_gallery && S(pp_images[set_position]) == "image") { 218 itemWidth = 52 + 5; 219 navWidth = settings.theme == "facebook" || settings.theme == "pp_default" ? 50 : 30; 220 itemsPerPage = Math.floor((a["containerWidth"] - 100 - navWidth) / itemWidth); 221 itemsPerPage = itemsPerPage < pp_images.length ? itemsPerPage : pp_images.length;
222 totalPage = Math.ceil(pp_images.length / itemsPerPage) - 1; 223 if (totalPage == 0) { 224 navWidth = 0; 225 $pp_gallery.find(".pp_arrow_next,.pp_arrow_previous").hide() 226 } else { 227 $pp_gallery.find(".pp_arrow_next,.pp_arrow_previous").show() 228 } 229 galleryWidth = itemsPerPage * itemWidth; 230 fullGalleryWidth = pp_images.length * itemWidth; 231 $pp_gallery.css("margin-left", -(galleryWidth / 2 + navWidth / 2)).find("div:first").width(galleryWidth + 5).find("ul").width(fullGalleryWidth).find("li.selected").removeClass("selected"); 232 goToPage = Math.floor(set_position / itemsPerPage) < totalPage ? Math.floor(set_position / itemsPerPage) : totalPage; 233 e.prettyPhoto.changeGalleryPage(goToPage); 234 $pp_gallery_li.filter(":eq(" + set_position + ")").addClass("selected") 235 } else { 236 $pp_pic_holder.find(".pp_content").unbind("mouseenter mouseleave") 237 } 238 } 239 240 function k(t) { 241 if (settings.social_tools) facebook_like_link = settings.social_tools.replace("{location_href}", encodeURIComponent(location.href)); 242 settings.markup = settings.markup.replace("{pp_social}", ""); 243 e("body").append(settings.markup); 244 $pp_pic_holder = e(".pp_pic_holder"), $ppt = e(".ppt"), $pp_overlay
244= e("div.pp_overlay"); 245 if (isSet && settings.overlay_gallery) { 246 currentGalleryPage = 0; 247 toInject = ""; 248 for (var n = 0; n < pp_images.length; n++) { 249 if (!pp_images[n].match(/\b(jpg|jpeg|png|gif)\b/gi)) { 250 classname = "default"; 251 img_src = "" 252 } else { 253 classname = ""; 254 img_src = pp_images[n] 255 } 256 toInject += "<li class='" + classname + "'><a href='#'><img src='" + img_src + "' width='50' alt='' /></a></li>" 257 } 258 toInject = settings.gallery_markup.replace(/{gallery}/g, toInject); 259 $pp_pic_holder.find("#pp_full_res").after(toInject); 260 $pp_gallery = e(".pp_pic_holder .pp_gallery"), $pp_gallery_li = $pp_gallery.find("li"); 261 $pp_gallery.find(".pp_arrow_next").click(function() { 262 e.prettyPhoto.changeGalleryPage("next"); 263 e.prettyPhoto.stopSlideshow(); 264 return false 265 }); 266 $pp_gallery.find(".pp_arrow_previous").click(function() { 267 e.prettyPhoto.changeGalleryPage("previous"); 268 e.prettyPhoto.stopSlideshow(); 269 return false 270 }); 271 $pp_pic_holder.find(".pp_content").hover(function() { 272 $pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeIn() 273 }, function() { 274 $pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeOut() 275 }); 276 itemWidth = 52 + 5; 277 $pp_gallery_li.each(function(t) { 278 e(this).find("a").click(function() { 279 e.prettyPhoto.changePage(t); 280 e.prettyPhoto.stopSlideshow(); 281 return false 282 }) 283 }) 284 } 285 if (settings.slideshow) { 286 $pp_pic_holder.find(".pp_nav").prepend('<a href="#" class="pp_play">Play</a>'); 287 $pp_pic_holder.find(".pp_nav .pp_play").click(function() { 288 e.prettyPhoto.startSlideshow(); 289 return false 290 }) 291 } 292 $pp_pic_holder.attr("class", "pp_pic_holder " + settings.theme); 293 $pp_overlay.css({ 294 opacity: 0, 295 height: e(document).height(), 296 width: e(window).width() 297 }).bind("click", function() { 298 if (!settings.modal) e.prettyPhoto.close() 299 }); 300 e("a.pp_close").bind("click", function() { 301 e.prettyPhoto.close(); 302 return false 303 }); 304 if (settings.allow_expand) { 305 e("a.pp_expand").bind("click", function(t) { 306 if (e(this).hasClass("pp_expand")) { 307 e(this).removeClass("pp_expand").addClass("pp_contract"); 308 doresize = false 309 } else { 310 e(this).removeClass("pp_contract").addClass("pp_expand"); 311 doresize = true 312 } 313 y(function() { 314 e.prettyPhoto.open() 315 }); 316 return false 317 }) 318 } 319 $pp_pic_holder.find(".pp_previous, .pp_nav .pp_arrow_previous").bind("click", function() { 320 e.prettyPhoto.changePage("previous"); 321 e.prettyPhoto.stopSlideshow(); 322 return false 323 }); 324 $pp_pic_holder.find(".pp_next, .pp_nav .pp_arrow_next").bind("click", function() { 325 e.prettyPhoto.changePage("next"); 326 e.prettyPhoto.stopSlideshow(); 327 return false 328 }); 329 x() 330 } 331 s = jQuery.extend({ 332 hook: "rel", 333 animation_speed: "fast", 334 ajaxcallback: function() {}, 335 slideshow: 5e3, 336 autoplay_slideshow: false, 337 opacity: .8, 338 show_title: true, 339 allow_resize: true, 340 allow_expand: true, 341 default_width: 500, 342 default_height: 344, 343 counter_separator_label: "/", 344 theme: "pp_default", 345 horizontal_padding: 20, 346 hideflash: false, 347 wmode: "opaque", 348 autoplay: true, 349 modal: false, 350 deeplinking: true, 351 overlay_gallery: true, 352 overlay_gallery_max: 30, 353 keyboard_shortcuts: true, 354 changepicturecallback: function() {}, 355 callback: function() {}, 356 ie6_fallback: true, 357 markup: '<div class="pp_pic_holder"> <div class="ppt"> </div> <div class="pp_top"> <div class="pp_left"></div> <div class="pp_middle"></div> <div class="pp_right"></div> </div> <div class="pp_content_container"> <div class="pp_left"> <div class="pp_right"> <div class="pp_content"> <div class="pp_loaderIcon"></div> <div class="pp_fade"> <a href="#" class="pp_expand" title="Expand the image">Expand</a> <div class="pp_hoverContainer"> <a class="pp_next" href="#">next</a> <a class="pp_previous" href="#">previous</a> </div> <div id="pp_full_res"></div> <div class="pp_details"> <div class="pp_nav"> <a href="#" class="pp_arrow_previous">Previous</a> <p class="currentTextHolder">0/0</p> <a href="#" class="pp_arrow_next">Next</a> </div> <p class="pp_description"></p> <div class="pp_social">{pp_social}</div> <a class="pp_close" href="#">Close</a> </div> </div> </div> </div> </div> </div> <div class="pp_bottom"> <div class="pp_left"></div> <div class="pp_middle"></div> <div class="pp_right"></div> </div> </div> <div class="pp_overlay"></div>', 358 gallery_markup: '<div class="pp_gallery"> <a href="#" class="pp_arrow_previous">Previous</a> <div> <ul> {gallery} </ul> </div> <a href="#" class="pp_arrow_next">Next</a> </div>', 359 image_markup: '<img id="fullResImage" src="{path}" />', 360 flash_markup: '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>', 361 quicktime_markup: '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>', 362 iframe_markup: '<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>', 363 inline_markup: '<div class="pp_inline">{content}</div>', 364 custom_markup: "", 365 social_tools: '<div class="twitter"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="facebook"><iframe src="//www.facebook.com/plugins/like.php?locale=en_US&href={location_href}&layout=button_count&show_faces=true&width=500&action=like&font&colorscheme=light&height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div>' 366 }, s); 367 var o = this, 368 u = false, 369 a, f, l, c, h, p, d = e(window).height(), 370 v = e(window).width(), 371 m; 372 doresize = true, scroll_pos = T(); 373 e(window).unbind("resize.prettyphoto").bind("resize.prettyphoto", function() { 374 x(); 375 N() 376 }); 377 if (s.keyboard_shortcuts) {
378 e(document).unbind("keydown.prettyphoto").bind("keydown.prettyphoto", function(t) { 379 if (typeof $pp_pic_holder != "undefined") { 380 if ($pp_pic_holder.is(":visible")) { 381 switch (t.keyCode) { 382 case 37: 383 e.prettyPhoto.changePage("previous"); 384 t.preventDefault(); 385 break; 386 case 39: 387 e.prettyPhoto.changePage("next"); 388 t.preventDefault(); 389 break; 390 case 27: 391 if (!settings.modal) e.prettyPhoto.close(); 392 t.preventDefault(); 393 break 394 } 395 } 396 } 397 }) 398 } 399 e.prettyPhoto.initialize = function() { 400 settings = s; 401 if (settings.theme == "pp_default") settings.horizontal_padding = 16; 402 theRel = e(this).attr(settings.hook); 403 galleryRegExp = /\[(?:.*)\]/; 404 isSet = galleryRegExp.exec(theRel) ? true : false; 405 pp_images = isSet ? jQuery.map(o, function(t, n) { 406 if (e(t).attr(settings.hook).indexOf(theRel) != -1) return e(t).attr("href") 407 }) : e.makeArray(e(this).attr("href")); 408 pp_titles = isSet ? jQuery.map(o, function(t, n) { 409 if (e(t).attr(settings.hook).indexOf(theRel) != -1) return e(t).find("img").attr("alt") ? e(t).find("img").attr("alt") : "" 410 }) : e.makeArray(e(this).find("img").attr("alt")); 411 pp_descriptions = isSet ? jQuery.map(o, function(t, n) { 412 if (e(t).attr(settings.hook).indexOf(theRel) != -1) return e(t).attr("title") ? e(t).attr("title") : "" 413 }) : e.makeArray(e(this).attr("title")); 414 if (pp_images.length > settings.overlay_gallery_max) settings.overlay_gallery = false; 415 set_position = jQuery.inArray(e(this).attr("href"), pp_images); 416 rel_index = isSet ? set_position : e("a[" + settings.hook + "^='" + theRel + "']").index(e(this)); 417 k(this); 418 if (settings.allow_resize) e(window).bind("scroll.prettyphoto", function() { 419 x() 420 }); 421 e.prettyPhoto.open(); 422 return false 423 }; 424 e.prettyPhoto.open = function(t) { 425 if (typeof settings == "undefined") { 426 settings = s; 427 pp_images = e.makeArray(arguments[0]); 428 pp_titles = arguments[1] ? e.makeArray(arguments[1]) : e.makeArray(""); 429 pp_descriptions = arguments[2] ? e.makeArray(arguments[2]) : e.makeArray(""); 430 isSet = pp_images.length > 1 ? true : false; 431 set_position = arguments[3] ? arguments[3] : 0; 432 k(t.target) 433 } 434 if (settings.hideflash) e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility", "hidden"); 435 b(e(pp_images).size()); 436 e(".pp_loaderIcon").show(); 437 if (settings.deeplinking) n(); 438 if (settings.social_tools) { 439 facebook_like_link = settings.social_tools.replace("{location_href}", encodeURIComponent(location.href)); 440 $pp_pic_holder.find(".pp_social").html(facebook_like_link) 441 } 442 if ($ppt.is(":hidden")) $ppt.css("opacity", 0).show(); 443 $pp_overlay.show().fadeTo(settings.animation_speed, settings.opacity); 444 $pp_pic_holder.find(".currentTextHolder").text(set_position + 1 + settings.counter_separator_label + e(pp_images).size()); 445 if (typeof pp_descriptions[set_position] != "undefined" && pp_descriptions[set_position] != "") { 446 $pp_pic_holder.find(".pp_description").show().html(unescape(pp_descriptions[set_position])) 447 } else { 448 $pp_pic_holder.find(".pp_description").hide() 449 } 450 movie_width = parseFloat(i("width", pp_images[set_position])) ? i("width", pp_images[set_position]) : settings.default_width.toString(); 451 movie_height = parseFloat(i("height", pp_images[set_position])) ? i("height", pp_images[set_position]) : settings.default_height.toString(); 452 u = false;
453 if (movie_height.indexOf("%") != -1) { 454 movie_height = parseFloat(e(window).height() * parseFloat(movie_height) / 100 - 150); 455 u = true 456 } 457 if (movie_width.indexOf("%") != -1) { 458 movie_width = parseFloat(e(window).width() * parseFloat(movie_width) / 100 - 150); 459 u = true 460 } 461 $pp_pic_holder.fadeIn(function() { 462 settings.show_title && pp_titles[set_position] != "" && typeof pp_titles[set_position] != "undefined" ? $ppt.html(unescape(pp_titles[set_position])) : $ppt.html(" "); 463 imgPreloader = ""; 464 skipInjection = false; 465 switch (S(pp_images[set_position])) { 466 case "image": 467 imgPreloader = new Image; 468 nextImage = new Image; 469 if (isSet && set_position < e(pp_images).size() - 1) nextImage.src = pp_images[set_position + 1]; 470 prevImage = new Image; 471 if (isSet && pp_images[set_position - 1]) prevImage.src = pp_images[set_position - 1]; 472 $pp_pic_holder.find("#pp_full_res")[0].innerHTML = settings.image_markup.replace(/{path}/g, pp_images[set_position]); 473 imgPreloader.onload = function() { 474 a = w(imgPreloader.width, imgPreloader.height); 475 g() 476 }; 477 imgPreloader.onerror = function() { 478 alert("Image cannot be loaded. Make sure the path is correct and image exist."); 479 e.prettyPhoto.close() 480 }; 481 imgPreloader.src = pp_images[set_position]; 482 break; 483 case "youtube": 484 a = w(movie_width, movie_height); 485 movie_id = i("v", pp_images[set_position]); 486 if (movie_id == "") { 487 movie_id = pp_images[set_position].split("youtu.be/"); 488 movie_id = movie_id[1]; 489 if (movie_id.indexOf("?") > 0) movie_id = movie_id.substr(0, movie_id.indexOf("?")); 490 if (movie_id.indexOf("&") > 0) movie_id = movie_id.substr(0, movie_id.indexOf("&")) 491 } 492 movie = "http://www.youtube.com/embed/" + movie_id; 493 i("rel", pp_images[set_position]) ? movie += "?rel=" + i("rel", pp_images[set_position]) : movie += "?rel=1"; 494 if (settings.autoplay) movie += "&autoplay=1"; 495 toInject = settings.iframe_markup.replace(/{width}/g, a["width"]).replace(/{height}/g, a["height"]).replace(/{wmode}/g, settings.wmode).replace(/{path}/g, movie); 496 break; 497 case "vimeo": 498 a = w(movie_width, movie_height); 499 movie_id = pp_images[set_position]; 500 var t = /http(s?):\/\/(www\.)?vimeo.com\/(\d+)/; 501 var n = movie_id.match(t); 502 movie = "http://player.vimeo.com/video/" + n[3] + "?title=0&byline=0&portrait=0"; 503 if (settings.autoplay) movie += "&autoplay=1;"; 504 vimeo_width = a["width"] + "/embed/?moog_width="
504+ a["width"]; 505 toInject = settings.iframe_markup.replace(/{width}/g, vimeo_width).replace(/{height}/g, a["height"]).replace(/{path}/g, movie); 506 break; 507 case "quicktime": 508 a = w(movie_width, movie_height); 509 a["height"] += 15; 510 a["contentHeight"] += 15; 511 a["containerHeight"] += 15; 512 toInject = settings.quicktime_markup.replace(/{width}/g, a["width"]).replace(/{height}/g, a["height"]).replace(/{wmode}/g, settings.wmode).replace(/{path}/g, pp_images[set_position]).replace(/{autoplay}/g, settings.autoplay); 513 break; 514 case "flash": 515 a = w(movie_width, movie_height); 516 flash_vars = pp_images[set_position]; 517 flash_vars = flash_vars.substring(pp_images[set_position].indexOf("flashvars") + 10, pp_images[set_position].length); 518 filename = pp_images[set_position]; 519 filename = filename.substring(0, filename.indexOf("?")); 520 toInject = settings.flash_markup.replace(/{width}/g, a["width"]).replace(/{height}/g, a["height"]).replace(/{wmode}/g, settings.wmode).replace(/{path}/g, filename + "?" + flash_vars); 521 break; 522 case "iframe": 523 a = w(movie_width, movie_height); 524 frame_url = pp_images[set_position]; 525 frame_url = frame_url.substr(0, frame_url.indexOf("iframe") - 1); 526 toInject = settings.iframe_markup.replace(/{width}/g, a["width"]).replace(/{height}/g, a["height"]).replace(/{path}/g, frame_url); 527 break; 528 case "ajax": 529 doresize = false; 530 a = w(movie_width, movie_height); 531 doresize = true; 532 skipInjection = true; 533 e.get(pp_images[set_position], function(e) { 534 toInject = settings.inline_markup.replace(/{content}/g, e); 535 $pp_pic_holder.find("#pp_full_res")[0].innerHTML = toInject; 536 g() 537 }); 538 break; 539 case "custom": 540 a = w(movie_width, movie_height); 541 toInject = settings.custom_markup; 542 break; 543 case "inline": 544 myClone = e(pp_images[set_position]).clone().append('<br clear="all" />').css({ 545 width: settings.default_width 546 }).wrapInner('<div id="pp_full_res"><div class="pp_inline"></div></div>').appendTo(e("body")).show(); 547 doresize = false; 548 a = w(e(myClone).width(), e(myClone).height()); 549 doresize = true; 550 e(myClone).remove(); 551 toInject = settings.inline_markup.replace(/{content}/g, e(pp_images[set_position]).html()); 552 break 553 } 554 if (!imgPreloader && !skipInjection) { 555 $pp_pic_holder.find("#pp_full_res")[0].innerHTML = toInject; 556 g() 557 } 558 }); 559 return false 560 }; 561 e.prettyPhoto.changePage = function(t) { 562 currentGalleryPage = 0; 563 if (t == "previous") { 564 set_position--; 565 if (set_position < 0) set_position = e(pp_images).size() - 1 566 } else if (t == "next") { 567 set_position++; 568 if (set_position > e(pp_images).size() - 1) set_position = 0 569 } else { 570 set_position = t 571 } 572 rel_index = set_position; 573 if (!doresize) doresize = true; 574 if (settings.allow_expand) { 575 e(".pp_contract").removeClass("pp_contract").addClass("pp_expand") 576 } 577 y(function() { 578 e.prettyPhoto.open() 579 }) 580 }; 581 e.prettyPhoto.changeGalleryPage = function(e) { 582 if (e == "next") { 583 currentGalleryPage++; 584 if (currentGalleryPage > totalPage) currentGalleryPage = 0 585 } else if (e == "previous") { 586 currentGalleryPage--; 587 if (currentGalleryPage < 0) currentGalleryPage = totalPage 588 } else { 589 currentGalleryPage = e 590 } 591 slide_speed = e == "next" || e == "previous" ? settings.animation_speed : 0; 592 slide_to = currentGalleryPage * itemsPerPage * itemWidth; 593 $pp_gallery.find("ul").animate({ 594 left: -slide_to 595 }, slide_speed) 596 }; 597 e.prettyPhoto.startSlideshow = function() { 598 if (typeof m == "undefined") { 599 $pp_pic_holder.find(".pp_play").unbind("click").removeClass("pp_play").addClass("pp_pause").click(function() { 600 e.prettyPhoto.stopSlideshow(); 601 return false 602 }); 603 m = setInterval(e.prettyPhoto.startSlideshow, settings.slideshow) 604 } else { 605 e.prettyPhoto.changePage("next") 606 } 607 }; 608 e.prettyPhoto.stopSlideshow = function() { 609 $pp_pic_holder.find(".pp_pause").unbind("click").removeClass("pp_pause").addClass("pp_play").click(function() { 610 e.prettyPhoto.startSlideshow(); 611 return false 612 }); 613 clearInterval(m); 614 m = undefined 615 }; 616 e.prettyPhoto.close = function() { 617 if ($pp_overlay.is(":animated")) return; 618 e.prettyPhoto.stopSlideshow(); 619 $pp_pic_holder.stop().find("object,embed").css("visibility", "hidden"); 620 e("div.pp_pic_holder,div.ppt,.pp_fade").fadeOut(settings.animation_speed, function() { 621 e(this).remove() 622 }); 623 $pp_overlay.fadeOut(settings.animation_speed, function() { 624 if (settings.hideflash) e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility", "visible"); 625 e(this).remove(); 626 e(window).unbind("scroll.prettyphoto"); 627 r(); 628 settings.callback(); 629 doresize = true; 630 f = false;
631 delete settings 632 }) 633 }; 634 if (!pp_alreadyInitialized && t()) { 635 pp_alreadyInitialized = true; 636 hashIndex = t(); 637 hashRel = hashIndex; 638 hashIndex = hashIndex.substring(hashIndex.indexOf("/") + 1, hashIndex.length - 1); 639 hashRel = hashRel.substring(0, hashRel.indexOf("/")); 640 setTimeout(function() { 641 e("a[" + s.hook + "^='" + hashRel + "']:eq(" + hashIndex + ")").trigger("click") 642 }, 50) 643 } 644 return this.unbind("click.prettyphoto").bind("click.prettyphoto", e.prettyPhoto.initialize) 645 }; 646})(jQuery); 647var pp_alreadyInitialized = false
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.