1var isswipe = 0; 2transspeed = 0; 3var SSslideshowtimer; 4 5 6 $(window).scroll(function () { 7 if($("#vinfo").attr("data-pic-key") !== "") { 8 if($(".mobileviewmessage").length > 0) { 9 p = $("#vinfo").attr("data-pic-key"); 10 h = $(window).height(); 11 k = $("#products-"+p).offset().top; 12 w = $(window).scrollTop(); 13 14 ph = h * .15; 15 pp = h * .60; 16 17 // $("#log").show().html(w+" "+k+" h: "+h+" ph: "+ph+" pp: "+pp); 18 19 if(w > ph && w < pp) { 20 $("#photoproductsbelow-"+p).fadeOut(200); 21 $("#viewphotoabove-"+p).fadeOut(200); 22 } else { 23 if(w > (k/2)) { 24 $("#photoproductsbelow-"+p).fadeOut(0); 25 $("#viewphotoabove-"+p).fadeIn(0); 26 } else { 27 $("#photoproductsbelow-"+p).fadeIn(0); 28 $("#viewphotoabove-"+p).fadeOut(0); 29 } 30 } 31 } 32 } 33 }); 34 35function addswipenav(id) { 36 $("#"+id).swipe( { 37 swipeLeft: function() { 38 $("#"+id).unbind( "click" ); 39 isswipe = 1; 40 transspeed = 100; 41 if($("body").attr("data-slideshow-running") == "1") { 42 stopslideshow(); 43 } 44 navigatephotos('next') 45 }, 46 swipeRight: function() { 47 $("#"+id).unbind( "click" ); 48 isswipe = 1; 49 transspeed = 100; 50 if($("body").attr("data-slideshow-running") == "1") { 51 stopslideshow(); 52 } 53 navigatephotos('prev'); 54 }, 55 allowPageScroll: 'vertical', 56 excludedElements: "button, input, select, textarea, .noSwipe", 57 tap: function(event, target) { 58 // window.open($(target).closest('.carusel-cnt').find('carusel-cnt-link').attr('href'), '_self'); 59 }, 60 threshold:60 61 62 }); 63} 64 65function photoviewscrollposition() { 66 var offset = $("#photoviewcontainer-"+$("#vinfo").attr("data-pic-key")).offset(); 67 var windowheight = $(window).height(); 68 69 70 $(window).scroll(function () { 71 var scrollTop = $(window).scrollTop(); // check the visible top of the browser 72 var containerheight = $("#photoviewcontainer-"+$("#vinfo").attr("data-pic-key")).height(); 73 74 bottoma = windowheight + scrollTop; 75 bottomb = containerheight + offset.top; 76 77 $("#log").show().html("Window: "+Math.round(scrollTop)+" viewtop: "+Math.round(offset.top)+" data-top: "+Math.round($("body").attr("data-view-top"))+" container height: "+Math.round(containerheight)+" window height: "+Math.round(windowheight)+" bottoms: "+Math.round(bottoma)+" "+Math.round(bottomb)+" stick top: "+$("body").attr("data-photo-stick-top")+" stick bottom: "+$("body").attr("data-photo-stick-bottom")); 78 79 if (scrollTop < offset.top && bottoma < bottomb) { 80 $("#photoviewcontainer-"+$("#vinfo").attr("data-pic-key")).css({"position":"fixed","top":"0px"}); 81 $("body").attr("data-photo-stick-top","1"); 82 } else { 83 $("#photoviewcontainer-"+$("#vinfo").attr("data-pic-key")).css({"position":"absolute", "top": $("body").attr("data-view-top")+"px"}); 84 $("body").attr("data-photo-stick-top","0"); 85 } 86 if($("body").attr("data-photo-stick-top") !== "1") { 87 88 if(bottoma > bottomb) { 89 $("body").attr("data-photo-stick-bottom","1"); 90 91 $("#photoviewcontainer-"+$("#vinfo").attr("data-pic-key")).css({"position":"fixed","bottom":"0px","top":"auto"}); 92 } else { 93 $("#photoviewcontainer-"+$("#vinfo").attr("data-pic-key")).css({"position":"absolute", "top": $("body").attr("data-view-top")+"px","bottom":"auto"}); 94 $("body").attr("data-photo-stick-bottom","0"); 95 } 96 } 97 }); 98 99} 100 101function newloadsytistphoto(pic_key) { 102 date_id = $("#vinfo").attr("did"); 103 sub_id = $("#vinfo").attr("sub_id"); 104 cat_id = $("#vinfo").attr("cat_id"); 105 $("#vinfo").attr("data-pic-key",pic_key); 106 if($("#photoviewbg").length <= 0) { 107 //$("#page-wrapper").css({"display":"none"}); 108 fixbackground(); 109 window.scrollTo(0,0); 110 $("body").prepend('<div id="photoviewbg" onclick="closephotoview();"><div id="stockphotoloading"><div class="loadingspinner"></div></div></div>'); 111 } 112 113 if($("#photoviewcontainer-"+pic_key).length <= 0) { 114 $.get(tempfolder+"/sy-inc/store/store_cart_actions.php?action=photoview&pic="+pic_key+"&date_id="+date_id+"&sub_id="+sub_id+"&cat_id="+cat_id+"&withphoto=1&group_id="+$("#vinfo").attr("group-id")+"&with_package="+$("#vinfo").attr("view_package")+"&package_id="+$("#vinfo").attr("package-id")+"&view="+$("#vinfo").attr("view")+"&album="+$("#album").val()+"&keyWord="+$("#vinfo").attr("keyWord")+"&kid="+$("#vinfo").attr("kid"), function(data) { 115 $("body").prepend('<div id="photoviewcontainer-'+pic_key+'" class="photoviewcontainer"><div id="photoview"><div id="photoviewinner">'+data+'</div></div></div>'); 116 117 // $("#log").show().append("Loading photo<br>"); 118 // PACKAGESCHANGES 119 adjustphotodisplayheightformanagepackage(); 120 121 photoloadv3(pic_key,data); 122 }); 123 } else { 124 125 // $("#log").show().prepend("loaded: "+pic_key+"<br>"); 126 var data; 127 photoloadv3(pic_key,data); 128 } 129} 130 131function playpauseslideshow() {
132 if($("body").attr("data-slideshow-running") !== "1") { 133 startslideshow(); 134 } else { 135 stopslideshow(); 136 } 137} 138 139 140 141function startslideshow() { 142 // $("#log").show().append($("body").attr("data-slideshow-running")); 143 if($("body").attr("data-slideshow-running") !== "1") { 144 isswipe = 0; 145 transspeed = $("#vinfo").attr("data-slideshow-transition"); 146 navigatephotos('next','0',transspeed); 147 $(".playslideshow").removeClass("icon-play").addClass("icon-pause"); 148 SSslideshowtimer = window.setInterval(function() { 149 if($("#photoview-"+$("#vinfo").attr("data-pic-key")).attr("data-next") !== "") { 150 151 navigatephotos('next','0',transspeed); 152 } else { 153 stopslideshow(); 154 } 155 },$("#vinfo").attr("data-slideshow-seconds")); 156 $("body").attr("data-slideshow-running","1") 157 } 158} 159 160function stopslideshow() { 161 $(".playslideshow").removeClass("icon-pause").addClass("icon-play"); 162 163 window.clearInterval(SSslideshowtimer); 164 $("body").attr("data-slideshow-running","0"); 165} 166 167 168 169var resizeTimer; 170 171$(window).on('resize', function(e) { 172 173 clearTimeout(resizeTimer); 174 resizeTimer = setTimeout(function() { 175 176 if($("#vinfo").attr("data-pic-key") !== "") { 177 if($("#photoview-"+$("#vinfo").attr("data-pic-key")).attr("data-video") == "1") { 178 sizevideoview("photoview-"+$("#vinfo").attr("data-pic-key")); 179 } 180 } 181 182 }, 100); 183 184}); 185 186 187function sizevideoview(id) { 188 setTimeout(function() { 189 190 ph = $("#"+id).closest(".thephotocontainer").height(); 191 pw = $("#"+id).closest(".thephotocontainer").width(); 192 vh = $("#"+id).attr("hh"); 193 vw = $("#"+id).attr("ww"); 194 195 if($("body").attr("data-video-fullscreen") == "1") { 196 $("#"+id+" video").css({"height":"100%", "width":"100%"}); 197 198 } else { 199 200 if(vw <= pw && vh <= ph) { 201 $("#"+id).css({"height":vh+"px", "width":vw+"px"}); 202 } else { 203 hperc = ph / vh; 204 wperc = pw / vw; 205 206 if(hperc < wperc) { 207 newheight = vh * hperc; 208 newwidth = vw * hperc; 209 } else { 210 newheight = vh * wperc; 211 newwidth = vw * wperc; 212 } 213 //$("#log").show().append(id+" newheight: "+newheight+" newwidth: "+newwidth+"<br>"); 214 $("#"+id+" video").css({"height":newheight+"px", "width":newwidth+"px"}); 215 $("#"+id).css({"height":newheight+"px", "width":newwidth+"px"}); 216 217 } 218 } 219 $("#"+id).closest(".thephotocontainer").animate({"opacity":"1"}, 100); 220 }, 100); 221 222} 223 224function pausevideos() { 225 $('.video-js').each(function () { 226 videojs(this.id).ready(function () { 227 myPlayer = this; 228 myPlayer.pause(); 229 }); 230 }); 231} 232 233function photoloadv3(pic_key,data) { 234 date_id = $("#vinfo").attr("did"); 235 sub_id = $("#vinfo").attr("sub_id"); 236 var player; 237 addswipenav("photoview-"+pic_key); 238 arrowkeynav(); 239 if(totalphotos < 4) { 240 $(".playslideshow").hide(); 241 } 242 243 // photoviewscrollposition(); 244 $("body").attr("disable-photo-nav","1"); 245 $("body").attr("data-next-loaded","0"); 246 $("body").attr("data-prev-loaded","0"); 247 // $("#log").show().prepend("Timer: "+$("body").attr("data-nav-timer")+" | "+pic_key); 248 // $("#photoviewcontainer").remove(); 249 250 $("#photoview-"+pic_key).imagesLoaded(function() { 251 252 if($("body").attr("data-last-photo-view")) { 253 lastpic = $("body").attr("data-last-photo-view"); 254 /* 255 if($("#"+lastpic).find(".photoviewphoto").attr("data-video") == "1") { 256 player.dispose(); 257 } 258 */ 259 } 260 261 /* Adding video player */ 262 if($("#photoview-"+pic_key).attr("data-video") == "1") { 263 $("#photoview-"+pic_key).attr("preload","auto") 264 $("#photoview-"+pic_key).closest(".thephotocontainer").css({"opacity":0}); 265 266 267 $("#photoview-"+pic_key).addClass("video-js vjs-default-skin vjs-big-play-centered"); 268 player = videojs("photoview-"+pic_key, {}, function(){ /* Player (this) is initialized and ready.*/ }); 269 player.on('fullscreenchange', function() { 270 // $(this).addClass("video-js-fullscreen"); 271 fullscreenOrNot = player.isFullscreen(); 272 if(fullscreenOrNot == true) { 273 $("body").attr("data-video-fullscreen","1"); 274 } else { 275 $("body").attr("data-video-fullscreen","0"); 276 } 277 // $("#log").show().append("fullscreenchange : "+fullscreenOrN
277ot+" player: "+$(this).attr("id")+"<br>"); 278 }); 279 sizevideoview("photoview-"+pic_key); 280 281 282 283 284 285 /* 286 $('video').each(function() { 287 if($(this).hasClass("pf-video")) { } else { 288 $(this).addClass("video-js vjs-default-skin vjs-big-play-centered"); 289 player = videojs($(this).attr("id"), {}, function(){ }); 290 player.on('fullscreenchange', function() { 291 // $(this).addClass("video-js-fullscreen"); 292 fullscreenOrNot = player.isFullscreen(); 293 if(fullscreenOrNot == true) { 294 $("body").attr("data-video-fullscreen","1"); 295 } else { 296 $("body").attr("data-video-fullscreen","0"); 297 } 298 $("#log").show().append("fullscreenchange : "+fullscreenOrNot+" player: "+$(this).attr("id")+"<br>"); 299 }); 300 sizevideoview($(this).attr("id")); 301 } 302 }); 303 304 */ 305 } 306 setTimeout(function() { 307 //$("#photoview-"+pic_key).css({"opacity":"1"}); 308 }, 200); 309 310 /* End video player */ 311 312 /* Preloading and adding navigation based on attributes from the new photos */ 313 314 if($("#photoview-"+pic_key).attr("data-next") !== "") { 315 $(".sy-photo-nav-next").show(); 316 } else { 317 $(".sy-photo-nav-next").hide(); 318 } 319 320 if($("#photoview-"+pic_key).attr("data-prev") !== "") { 321 $(".sy-photo-nav-prev").show(); 322 } else { 323 $(".sy-photo-nav-prev").hide(); 324 } 325 326 $(".photocount").html($("#photoview-"+pic_key).attr("data-photo-count")); 327 328 if($("body").attr("data-preloaded")) { 329 $("#"+$("body").attr("data-preloaded")).remove(); 330 } 331 332 dir = $("body").attr("data-nav-photos-direction"); 333 /* 334 if(dir !== "prev") { 335 if($("#photoview-"+pic_key).attr("data-next-photo-file") !== "") { 336 $("body").prepend('<img src="'+$("#photoview-"+pic_key).attr("data-next-photo-file")+'" class="hide" id="preload-'+$("#photoview-"+pic_key).attr("data-next")+'">'); 337 } 338 $("body").attr("data-preloaded","preload-"+$("#photoview-"+pic_key).attr("data-next")); 339 } 340 if(dir == "prev") { 341 if($("#photoview-"+pic_key).attr("data-prev-photo-file") !== "") { 342 $("body").prepend('<img src="'+$("#photoview-"+pic_key).attr("data-prev-photo-file")+'" class="hide" id="preload-'+$("#photoview-"+pic_key).attr("data-prev")+'">'); 343 } 344 $("body").attr("data-preloaded","preload-"+$("#photoview-"+pic_key).attr("data-prev")); 345 } 346 */ 347 /* ################################ */ 348 349 /* ######################### 350 Need to make it so it doesn't reset the scroll top if it isn't more than a few pixels away from the top 351 */ 352 353 if($("#selectgsbackground").length > 0) { 354 355 if($("#photoview-"+pic_key).attr("favbg") > 0) { 356 file = $("#photoview-"+pic_key).attr("favbgfile"); 357 fileid = $("#photoview-"+pic_key).attr("favbgkey"); 358 359 $("#gs-bgimage").val(file); 360 $("#gs-bgimage-id").val(fileid); 361 $(".gs-bgimage-id-free").val(fileid); 362 } 363 364 $(".photoviewphoto").css({"background-image":"url('"+$("#gs-bgimage").val()+"')","background-size":"cover","background-position":"center center"}); 365 } 366 if($("body").attr("data-slideshow-running") == "1") { 367 $(".playslideshow").removeClass("icon-play").addClass("icon-pause"); 368 } 369 370 371 // $("#log").show().append("has package: "+$("#vinfo").attr("has_package") +" placement: "+$("#photoview-"+pic_key).attr("prodplace")+" plid: "+$("#photoview-"+pic_key).attr("data-price-list")+" free only: "+$("#photoview-"+pic_key).attr("data-free-only")+"<br>"); 372 373 374 $(".photocontainerclass").removeClass("photocontainernopurchase photocontainerfull photocontainer"); 375 $(".productsclass").removeClass("productsnopurchase productsfull products"); 376 377 378 379 if($("#vinfo").attr("proofing") == "1") { 380 $(".photocontainerclass").addClass("photocontainerfull"); 381 $(".productsclass").addClass("productsfull"); 382 383 } else if($("#photoview-"+pic_key).attr("prodplace") == "1" && $("#vinfo").attr("has_package") == "0" && $("#vinfo").attr("prodplacebuyopen") !== "1") { 384 $(".photocontainerclass").addClass("photocontainerfull"); 385 $(".productsclass").addClass("productsfull"); 386 //$("#log").show().append("[A]<br>"); 387 } else if($("#vinfo").attr("prodplacebuyopen") == "1") { 388 //$("#log").show().append("[B]<br>"); 389 390 $(".photocontainerclass").addClass("photocontainer"); 391 $(".productsclass").addClass("products"); 392 $(".buyiconcancel").show(); 393 } else if(($("#photoview-"+pic_key).attr("data-price-list") <= "0" || $("#photoview-"+pic_key).attr("data-price-list") == "99999999" || $("#photoview-"+pic_key).attr("data-free-only") == "1") && $("#vinfo").attr("has_package") !== "1") { 394 //$("#log").show().append("[C]<br>"); 395 396 397 $(".photocontainerclass").addClass("photocontainernopurchase"); 398 $(".productsclass").addClass("productsnopurchase"); 399 } else { 400 //$("#log").show().append("[D]<br>"); 401 402 $(".photocontainerclass").addClass("photocontainer"); 403 $(".productsclass").addClass("products"); 404 } 405 if( $("#vinfo").attr("has_package") == "1") { 406 $(".buyphotoicon").hide(); 407 } 408 409 410 411 if(isswipe == 1) { 412 if(dir == "prev") { 413 coming = "right"; 414 going = "left"; 415 } else { 416 coming = "left"; 417 going = "right"; 418 } 419 if($("body").attr("data-last-photo-view")) { 420 lastpic = $("body").attr("data-last-photo-view"); 421 $("#"+lastpic).toggle("slide", { direction: coming }, transspeed, function() { 422 // $("#"+lastpic).remove(); 423 }); 424 }
425 /* To move container to top, add to css below: "top":$(window).scrollTop()+"px" */ 426 427 $("#photoviewcontainer-"+pic_key).css({}).toggle("slide", { direction: going }, transspeed, function() { 428 offset = $("#photoviewcontainer-"+pic_key).offset(); 429 $("body").attr("data-view-top",offset.top); 430 $("body").attr("data-last-photo-view","photoviewcontainer-"+pic_key+""); 431 logphotoview(pic_key); 432 if($("body").attr("data-nav-timer") !== "ON") { 433 navtimeer = setInterval("checknavigation()",20); 434 $("body").attr("data-nav-timer","ON"); 435 } 436 adddbclickenlarge(); 437 mytips(".tip","tooltip"); 438 439 }); 440 } else { 441 442 // $("#log").show().html($(window).scrollTop()+" | "+$("#photoviewcontainer-"+pic_key).offset().top); 443 444 /* To move container to top, add to css below: "top":$(window).scrollTop()+"px" */ 445 446 $("#photoviewcontainer-"+pic_key).css({}).fadeIn(0, function() { 447 offset = $("#photoviewcontainer-"+pic_key).offset(); 448 $("body").attr("data-view-top",offset.top); 449 450 if($("body").attr("data-last-photo-view")) { 451 lastpic = $("body").attr("data-last-photo-view"); 452 $("#"+lastpic).fadeOut(transspeed); 453 pausevideos(); 454 455 } 456 logphotoview(pic_key); 457 if($("body").attr("data-last-photo-view")) { 458 lastpic = $("body").attr("data-last-photo-view"); 459 }; 460 $("body").attr("data-last-photo-view","photoviewcontainer-"+pic_key+""); 461 if($("body").attr("data-nav-timer") !== "ON") { 462 navtimeer = setInterval("checknavigation()",20); 463 $("body").attr("data-nav-timer","ON"); 464 } 465 mytips(".tip","tooltip"); 466 adddbclickenlarge(); 467 468 469 }); 470 } 471 472 if($("#selectgsbackground").length > 0) { 473 if($(".viewimageshoppingcart").css("display") == "block") { 474 // $("#log").show().append($(".viewimageshoppingcart:visible").outerHeight()+" from gal.js<br>"); 475 if($("#mainpackagecontainer").length > 0) { 476 carttab = $("#managepackagecarttab").height(); 477 newbottom = Math.round($("#mainpackagecontainer").height() - carttab); 478 479 } else { 480 newbottom = $(".viewimageshoppingcart:visible").outerHeight(); 481 } 482 $("#selectgsbackground").css({"bottom": newbottom+"px"}); 483 } 484 } 485 486 487 /* Remove photo view elements that aren't next or previous */ 488 prev = $("#photoview-"+pic_key).attr("data-prev"); 489 next = $("#photoview-"+pic_key).attr("data-next"); 490 491 $(".photoviewcontainer").each(function() { 492 var remove_id = $(this).attr("id"); 493 if(remove_id !== "photoviewcontainer-"+pic_key && remove_id !== "photoviewcontainer-"+next && remove_id !== "photoviewcontainer-"+prev) { 494 // $("#log").show().prepend("Remove "+remove_id+"<br>"); 495 if($("#"+remove_id).find(".photoviewphoto").attr("data-video") == "1") { 496 videoid = $("#"+remove_id).find(".photoviewphoto").attr("id"); 497 // $("#"+remove_id).dispose(); 498 videojs(videoid).dispose(); 499 } 500 501 $("#"+remove_id).remove(); 502 } 503 }); 504 505 506 507 /* Let' try loading the next & previous screens if not loaded */ 508 // $("#log").show().append("next: "+$("#photoview-"+pic_key).attr("data-next")+" next length "+$("#photoviewcontainer-"+$("#photoview-"+pic_key).attr("data-next")).length+"<br>"); 509 // $("#log").show().append("prev: "+$("#photoview-"+pic_key).attr("data-prev")+" prev length "+$("#photoviewcontainer-"+$("#photoview-"+pic_key).attr("data-prev")).length+"<br>"); 510 511 if($("#photoview-"+pic_key).attr("data-next") !== "") { 512 if($("#photoviewcontainer-"+$("#photoview-"+pic_key).attr("data-next")).length <= 0) { 513 setTimeout(function() { 514 $.get(tempfolder+"/sy-inc/store/store_cart_actions.php?action=photoview&pic="+$("#photoview-"+pic_key).attr("data-next")+"&date_id="+date_id+"&sub_id="+sub_id+"&cat_id="+$("#vinfo").attr("cat_id")+"&withphoto=1&group_id="+$("#vinfo").attr("group-id")+"&with_package="+$("#vinfo").attr("view_package")+"&package_id="+$("#vinfo").attr("package-id")+"&view="+$("#vinfo").attr("view")+"&album="+$("#album").val()+"&keyWord="+$("#vinfo").attr("keyWord")+"&kid="+$("#vinfo").attr("kid"), function(data) { 515 $("body").prepend('<div id="photoviewcontainer-'+$("#photoview-"+pic_key).attr("data-next")+'" class="photoviewcontainer"><div id="photoview"><div id="photoviewinner">'+data+'</div></div></div>'); 516 $("body").attr("data-next-loaded","1"); 517 });
518 }, 100); 519 } else { 520 $("body").attr("data-next-loaded","1"); 521 } 522 } else { 523 $("body").attr("data-next-loaded","1"); 524 } 525 526 if($("#photoview-"+pic_key).attr("data-prev") !== "") { 527 if($("#photoviewcontainer-"+$("#photoview-"+pic_key).attr("data-prev")).length <= 0) { 528 setTimeout(function() { 529 $.get(tempfolder+"/sy-inc/store/store_cart_actions.php?action=photoview&pic="+$("#photoview-"+pic_key).attr("data-prev")+"&date_id="+date_id+"&sub_id="+sub_id+"&cat_id="+$("#vinfo").attr("cat_id")+"&withphoto=1&group_id="+$("#vinfo").attr("group-id")+"&with_package="+$("#vinfo").attr("view_package")+"&package_id="+$("#vinfo").attr("package-id")+"&view="+$("#vinfo").attr("view")+"&album="+$("#album").val()+"&keyWord="+$("#vinfo").attr("keyWord")+"&kid="+$("#vinfo").attr("kid"), function(data) { 530 $("body").prepend('<div id="photoviewcontainer-'+$("#photoview-"+pic_key).attr("data-prev")+'" class="photoviewcontainer"><div id="photoview"><div id="photoviewinner">'+data+'</div></div></div>'); 531 $("body").attr("data-prev-loaded","1"); 532 }); 533 }, 200); 534 } else { 535 $("body").attr("data-prev-loaded","1"); 536 } 537 } else { 538 $("body").attr("data-prev-loaded","1"); 539 } 540 541 // ADjust the photo viewing area for the manage gallery container 542 // PACKAGESCHANGES 543 // adjustphotodisplayheightformanagepackage(); 544 545 if(norightclick == "1") { 546 disablerightclick(); 547 } 548 $("#stockphotoloading").hide(); 549 }); 550} 551 552 553function logphotoview(pic_key) { 554 $.get(tempfolder+"/sy-inc/store/store_cart_actions.php?action=logphotoview&pic="+pic_key, function(data) { }); 555} 556 557 558 559function arrowkeynav() { 560 document.onkeydown = function(evt) { 561 evt = evt || window.event; 562 if($("#vinfo").attr("disablearrow")!=="1") { 563 switch (evt.keyCode) { 564 case 39: 565 navigatephotos('next',"1",0); 566 break; 567 case 37: 568 navigatephotos('prev',"1",0); 569 break; 570 case 27: 571 closephotoview(); 572 break; 573 case 80: 574 // toggleSpaceBar(); 575 break; 576 } 577 } 578 }; 579} 580 581function checknavigation() { 582 583 if($("body").attr("data-next-loaded") == "1" && $("body").attr("data-prev-loaded") == "1") { 584 // $("#log").show().html("All loaded"); 585 $("body").attr("disable-photo-nav","0"); 586 // clearInterval($("body").append("data-nav-timer")); 587 } else { 588 // $("#log").show().html("Disabled"); 589 } 590} 591 592function showproducts() { 593// $(".closephotoviewicon").hide(); 594 // $("#log").show().append($("#vinfo").attr("prodplacebuyopen")+"<br>"); 595 if($("body").attr("data-slideshow-running") == "1") { 596 stopslideshow(); 597 } 598 if($("#vinfo").attr("prodplacebuyopen") == "1") { 599 hideproducts(); 600 } else { 601 602 $(".photocontainerclass").css({"float":"left"}).animate({"width":"65%"}, 50, function() { 603 $(".photocontainerclass").css({"float":"left"}).addClass("photocontainer").removeClass("photocontainerfull"); 604 $(".productsclass").css({"width":"35%","float":"right"}).fadeIn(200); 605 $(".buyiconcancel").show(); 606 //$(".closephotoviewicon").show(); 607 $("#vinfo").attr("prodplacebuyopen","1") 608 609 }); 610 } 611} 612function hideproducts() { 613 //$(".closephotoviewicon").hide(); 614 615 $(".productsclass").fadeOut(20, function() { 616 $(".photocontainerclass").fadeOut(50, function() { 617 $(".photocontainerclass").css({"float":"none","width":"100%"}).removeClass("photocontainer").addClass("photocontainerfull").fadeIn(100); 618 $(".buyiconcancel").hide(); 619 setTimeout(function() { 620 // $(".closephotoviewicon").fadeIn(50); 621 }, 500); 622 $("#vinfo").attr("prodplacebuyopen","0") 623 624 }); 625 626 627 }); 628} 629
630function closephotoview(nohash) { 631 if(nohash == "1") { 632 // $("#log").show().append("<br>no hash "); 633 } else { 634 window.parent.location="#photo=thumbs"; 635 } 636 lastpic = $("body").attr("data-last-photo-view"); 637 if($("body").attr("data-slideshow-running") == "1") { 638 stopslideshow(); 639 } 640 $("#vinfo").attr("data-pic-key",""); 641 $(".photoviewcontainer").fadeOut(100, function() { 642 // $("#page-wrapper").css({"display":"block"}); 643 644 $("#photoviewbg").fadeOut(100, function() { 645 646 647 $(".photoviewcontainer").each(function() { 648 var remove_id = $(this).attr("id"); 649 // $("#log").show().append("Remove "+remove_id+"<br>"); 650 if($("#"+remove_id).find(".photoviewphoto").attr("data-video") == "1") { 651 videoid = $("#"+remove_id).find(".photoviewphoto").attr("id"); 652 // $("#"+remove_id).dispose(); 653 videojs(videoid).dispose(); 654 } 655 656 $("#"+remove_id).remove(); 657 }); 658 659 if($("#selectgsbackground").length > 0) { 660 if($("#mainpackagecontainer").length > 0) { 661 carttab = $("#managepackagecarttab").height(); 662 newbottom = Math.round($("#mainpackagecontainer").height() - carttab); 663 664 } else { 665 newbottom = 0; 666 } 667 $("#selectgsbackground").css({"bottom": newbottom+"px"}); 668 } 669 670 $("body").attr("data-last-photo-view",""); 671 $("#photoviewbg").remove(); 672 $(".photoviewcontainer").remove(); 673 $("body").attr("disable-photo-nav","0"); 674 $(".ui-effects-wrapper").remove(); 675 unfixbackground(); 676 }); 677 }); 678} 679 680 681function backtoproductlist(pic,scroll) { 682 $("#vinfo").attr("view_package",0) 683 showloadingbar(); 684 var i = 0; 685 stopslideshow(); 686 totalviewproducts = $('.photoviewproducts').length; 687 $('.photoviewproducts').each(function() { 688 var pic_key = $(this).attr("data-pic-key"); 689 $.get(tempfolder+"/sy-inc/store/store_cart_actions.php?action=photoviewlistproducts&pic="+pic_key+"&date_id="+$("#vinfo").attr("did")+"&sub_id="+$("#vinfo").attr("sub_id")+"&cat_id="+$("#vinfo").attr("cat_id")+"&group_id="+$("#vinfo").attr("group-id")+"&view="+$("#vinfo").attr("view")+"&album="+$("#album").val()+"&keyWord="+$("#vinfo").attr("keyWord")+"&kid="+$("#vinfo").attr("kid"), function(data) { 690 $("#photoviewproducts-"+pic_key).html(data); 691 692 // PACKAGESCHANGES 693 if(scroll == "1") { 694 $('html, body').animate({ 695 scrollTop: 0 696 }, 600); 697 } 698 i = i+1; 699 if(totalviewproducts == i) { 700 hideloadingbar(); 701 702 // scrollproduct(); 703 } 704 }); 705 }); 706 707} 708 709function navigatephotos(dir,click,speed) { 710 $("body").attr("data-nav-photos-direction",dir); 711 if(click == "1") { 712 isswipe = 0; 713 if($("body").attr("data-slideshow-running") == "1") { 714 stopslideshow(); 715 } 716 717 if(speed > 0) { 718 transspeed = speed; 719 } else { 720 transspeed = 0; 721 } 722 } 723 724 if($("body").attr("disable-photo-nav") !== "1") { 725 if(dir == "next") { 726 $("#photoview-"+$("#vinfo").attr("data-pic-key")).attr("data-next"); 727 next = $("#photoview-"+$("#vinfo").attr("data-pic-key")).attr("data-next"); 728 } 729 if(dir == "prev") { 730 next = $("#photoview-"+$("#vinfo").attr("data-pic-key")).attr("data-prev"); 731 } 732 window.location.href="#photo="+next; 733 } 734} 735 736 737 738 739function showaddphototopackage() {
740 // alert(con_id+" , "+pic+" , "+date_id+" , "+sub_id+" "); 741 $("#vinfo").attr("view_package",1) 742 showloadingbar(); 743 stopslideshow(); 744 $('.photoviewproducts').each(function() { 745 var pic_key = $(this).attr("data-pic-key"); 746 747 $.get(tempfolder+"/sy-inc/store/store_cart_actions.php?action=showaddphototopackage&pic="+pic_key+"&date_id="+$("#vinfo").attr("did")+"&sub_id="+$("#vinfo").attr("sub_id")+"&color_id="+$("#filter").attr("color_id")+"&withphoto=1&group_id="+$("#vinfo").attr("group-id")+"&kid="+$("#vinfo").attr("kid")+"&keyWord="+$("#vinfo").attr("keyWord")+"&view="+$("#vinfo").attr("view")+"&album="+$("#album").val()+"&from_time="+$("#vinfo").attr("from_time")+"&search_date="+$("#vinfo").attr("search_date")+"&passcode="+$("#vinfo").attr("passcode")+"&search_length="+$("#vinfo").attr("search_length")+"&package_id="+$("#vinfo").attr("package-id"), function(data) { 748 749 // $("#photoproductsnexttophoto .inner").empty().append(data); 750 $("#photoviewproducts-"+pic_key).empty().append(data); 751 hideloadingbar(); 752 scrollproduct(); 753 }); 754 }); 755} 756 757function scrollproduct() { 758 editoffsettop = $("#photoviewproducts-"+$("#vinfo").attr("data-pic-key")).offset().top; 759 editoffsettop = editoffsettop - 36; 760 761 $('html').animate({scrollTop:editoffsettop+"px"}, 400); 762 $('body').animate({scrollTop:editoffsettop+"px"}, 400); 763 // $("#log").show().append(windowscrolltop+" - "+editoffsettop+"<br>"); 764} 765 766 767function showaddphototoproduct() {
768 // alert(con_id+" , "+pic+" , "+date_id+" , "+sub_id+" "); 769 // $("#vinfo").attr("view_package",1) 770 showloadingbar(); 771 stopslideshow(); 772 $('.photoviewproducts').each(function() { 773 var pic_key = $(this).attr("data-pic-key"); 774 775 $.get(tempfolder+"/sy-inc/store/store_cart_actions.php?action=showaddphototoproduct&pic="+pic_key+"&date_id="+$("#vinfo").attr("did")+"&sub_id="+$("#vinfo").attr("sub_id")+"&color_id="+$("#filter").attr("color_id")+"&withphoto=1&group_id="+$("#vinfo").attr("group-id")+"&kid="+$("#vinfo").attr("kid")+"&keyWord="+$("#vinfo").attr("keyWord")+"&view="+$("#vinfo").attr("view")+"&album="+$("#album").val()+"&from_time="+$("#vinfo").attr("from_time")+"&search_date="+$("#vinfo").attr("search_date")+"&passcode="+$("#vinfo").attr("passcode")+"&search_length="+$("#vinfo").attr("search_length")+"&package_id="+$("#vinfo").attr("package-id"), function(data) { 776 777 // $("#photoproductsnexttophoto .inner").empty().append(data); 778 $("#photoviewproducts-"+pic_key).empty().append(data); 779 hideloadingbar(); 780 // scrollproduct(); 781 }); 782 }); 783} 784 785function showloadingbar() { 786 $("body").attr("data-loading-stuff-done","0"); 787 loadingtimer = setTimeout(function() { 788 if($("body").attr("data-loading-stuff-done") == "0") { 789 if($("#loadingstuff").length <= 0) { 790 $("body").prepend('<div style="position: fixed; width: 100%; height: 100%; top: 0; left: 0; text-align: center; z-index: 2001; padding-top: 20%; display: none;" id="loadingstuff"><div class="loadingspinner"></div></div>'); 791 $("#loadingstuff").fadeIn(100); 792 } 793 } 794 }, 500); 795 // $("#loadingbar").show(); 796} 797 798function hideloadingbar() { 799 $("body").attr("data-loading-stuff-done","1"); 800 801 $("#loadingstuff").fadeOut(50, function() { 802 $("#loadingstuff").remove(); 803 clearInterval(loadingtimer); 804 }); 805 806} 807 808 809 810 811function adddbclickenlarge() { 812 $( ".photoviewphoto" ).click(function() { 813 enlargephotoview($("#vinfo").attr("data-pic-key")); 814 }); 815} 816 817function adddbclickcloseenlarge() { 818 $("#largestockphoto").click(function() { 819 closeenlargephotoview(); 820 }); 821} 822 823 function closeenlargephotoview() { 824 $("#enlargecontain").fadeOut(100, function() { 825 const viewportmeta = document.querySelector('meta[name=viewport]'); 826 viewportmeta.setAttribute('content', "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=yes"); 827 828 $("#enlargecontainbackground").fadeOut(50, function() { 829 viewportmeta.setAttribute('content', "width=device-width, initial-scale=1.0, user-scalable=yes"); 830 }); 831 $("#enlargecontain").remove(); 832 $("#enlargecontainbackground").remove(); 833 $("#largestockphoto").remove(); 834 $("html").removeClass("magnifying"); 835 }); 836 } 837function enlargephotoview(id) { 838 // $("body").prepend('<div id="showstockphotobglarge" onclick="closestockphotolarge();"><div id="closestockphoto"><span class="the-icons icon-cancel"></div></div>'); 839 if($("#photoview-"+id).attr("data-video") !== "1") { 840 stopslideshow(); 841 if($("#enlargecontainbackground").length <= 0) { 842 $("body").append('<div id="enlargecontainbackground" onclick="closeenlargephotoview();"></div><div onclick="closeenlargephotoview();" id="enlargecontain" class="simpleview" style=" z-index: 1002; padding: 16px;"><img src="'+$("#photoview-"+id).attr("src")+'" width="'+$("#photoview-"+id).attr("width")+'" height="'+$("#photoview-"+id).attr("height")+'" style="position: relative; max-width: 100%; max-height: 100%; width: auto; height: auto; z-index: 1002; " id="largestockphoto" class="simplephotoview photoviewenlarged " onclick="closeenlargephotoview();" data-magnify-src="'+$("#photoview-"+id).attr("src")+'"></div>'); 843 844 if($("#selectgsbackground").length > 0) { 845 $("#largestockphoto").css({"background-image":"url('"+$("#gs-bgimage").val()+"')","background-size":"cover","background-position":"center center"}); 846 } 847 848 largewidth = $("#largestockphoto").width(); 849 largeheight = $("#largestockphoto").height(); 850 if($(window).width() > 1024 && $("#selectgsbackground").length <= 0) { 851 setTimeout(function() { 852 if($("#largestockphoto").attr("width") > ($("#largestockphoto").width() +40)) { 853 $('.photoviewenlarged').magnify(); 854 $("#largestockphoto").css({"width":largewidth+"px","height":largeheight+"px"}); 855 } 856 if(norightclick == "1") { 857 disablerightclick(); 858 } 859 860 }, 200); 861 } 862 if(norightclick == "1") { 863 disablerightclick(); 864 } 865 866 } 867 } 868} 869function getContainment($box, $drag, space) { 870 var x1 = $box.offset().left + space; 871 var y1 = $box.offset().top + space; 872 var x2 = $box.offset().left + $box.width() - $drag.width() - space; 873 var y2 = $box.offset().top + $box.height() - $drag.height() - space; 874 return [x1, y1, x2, y2]; 875} 876function loadsytistphoto(pickey) { 877 // $("#log").show().append("key: "+pickey+" full screen: "+$("#slideshow").attr("fullscreen")+" disable: "+$("#slideshow").attr("disablenav")+" "); 878 if($("#photo-"+pickey).length) { 879 if($("#slideshow").attr("fullscreen") == 1) { 880 navgallery(pickey,'0'); 881 } else { 882 $("#slideshow").attr("curphoto", pickey); 883 clickThumb(pickey); 884 } 885 window.scrollTo(0,0); 886 887 } else { 888 /* Added to make view background load faster 2.5 */ 889 $("#ssbackground").show(); 890 891 892 getsytistphoto(pickey, function() { 893 894 if($("#slideshow").attr("fullscreen") == 1) { 895 // $("#log").show().append("Nav "); 896 navgallery(pickey,'0'); 897 } else { 898 photo = document.location.hash; 899 photo = photo.replace("#",""); 900 p = photo.split("="); 901 if(p[0] == "photo" || p[0] == "gti" && p[1] !== "thumbs") { 902 $("#slideshow").attr("curphoto", pickey); 903 // $("#log").show().append("HERE, hash: "+document.location.hash+" p[0] = "+p[0]); 904 clickThumb(pickey); 905 window.scrollTo(0,0); 906 907 } 908 } 909 enableenlargephoto(); 910 }); 911 } 912} 913function docallback() { 914 915} 916 917function getsytistphoto(pickey,callback) { 918 $.get(tempfolder+"/sy-inc/store/photo.php?pic_key="+pickey+"&date_id="+$("#vinfo").attr("did")+"&sub_id="+$("#vinfo").attr("sub_id")+"&view="+$("#vinfo").attr("view")+"&album="+$("#album").val()+"&kid="+$("#vinfo").attr("kid")+"&keyWord="+$("#vinfo").attr("keyWord")+"&passcode="+$("#vinfo").attr("passcode")+"&view="+$("#vinfo").attr("view")+"&album="+$("#album").val()+"&from_time="+$("#vinfo").attr("from_time")+"&search_date="+$("#vinfo").attr("search_date")+"&search_length="+$("#vinfo").attr("search_length"), function(data) { 919 if(data == "notfound") { 920 // alert("NOT FOUND"); 921 } else { 922 // alert(data); 923 $("#slideshow").append(data); 924 enableenlargephoto(); 925 if(callback) { 926 callback(docallback); 927 } 928 if(norightclick == '1') { 929 disablerightclick(); 930 } 931 932 return true; 933 } 934 }); 935} 936 937 938function clickThumb(pos){ 939 940 arrowNavSS(); 941 $("#photo-"+pos).attr("src", $("#photo-"+pos).attr("thissrc")); 942 $("#photo-"+pos).removeClass("photo").addClass("photofull"); 943 stillload = setTimeout("slideshowloading()",500); 944 $("#slideshow").attr("curphoto", pos); 945 fullScreen(); 946} 947 948 949 950function closeFullScreenPhoto() { 951 window.parent.location="#photo=thumbs"; 952}
953function clickthumbnail(key) { 954 window.parent.location="#photo="+key; 955} 956 957function navthumbnails(n,stop) { 958 if(stop == "1") { 959 stopSlideshow(); 960 } 961 962 if(n == "next") { 963 next = $("#photo-"+$("#slideshow").attr("curphoto")).attr("data-next"); 964 } 965 if(n == "prev") { 966 next = $("#photo-"+$("#slideshow").attr("curphoto")).attr("data-previous"); 967 } 968 969 window.parent.location="#photo="+next; 970} 971 972function navgallery(pos,stop) { 973 if(sytiststore == 1) { 974 removeFilterPhoto(); 975 } 976 977 if($("#slideshow").attr("disablenav") !== "1") { ; 978 979 curphoto = $("#slideshow").attr("curphoto"); 980 // $("#log").show().append(":"+curphoto+" - "); 981 982 if(curphoto != pos) { 983 stillload = setTimeout("slideshowloading()",500); 984 $("#slideshow").attr("disablenav","1"); 985 986/* if(pos >= totalphotos) { 987 $("#ssNextPhoto").hide(); 988 } else { 989 $("#ssNextPhoto").show(); 990 } 991 if(pos <= 1) { 992 $("#ssPrevPhoto").hide(); 993 } else { 994 $("#ssPrevPhoto").show(); 995 } 996*/ 997 // alert(n+" "+curphoto+" - photo-"+pos+" width"+$("#photo-"+pos).attr("src")); 998 999 if($("#slideshow").attr("fullscreen") == 1) { 1000 $("#photo-"+pos).removeClass("photo").addClass("photofull"); 1001 } else { 1002 $("#photo-"+pos).removeClass("photofull").addClass("photo"); 1003 } 1004 1005 // $("#th-"+curphoto).removeClass("thumbon"); 1006 // $("#th-"+pos).addClass("thumbon"); 1007 1008 1009 $("#photo-"+pos).imagesLoaded(function() { 1010 sizePhoto(pos); 1011 slideshowdoneloading(); 1012 selectGSbackground('photoviewphoto',false); 1013 if(sytiststore == 1) { 1014 if($("#photo-"+pos).attr("fav") == "1") { 1015 $(".photo-fav").removeClass("icon-heart-empty").addClass("icon-heart"); 1016 } else { 1017 $(".photo-fav").removeClass("icon-heart").addClass("icon-heart-empty"); 1018 } 1019 if($("#photo-"+pos).attr("compare") == "1") { 1020 $(".checked").show(); 1021 } else { 1022 $(".checked").hide(); 1023 } 1024 1025 if(Math.abs($("#photo-"+$("#slideshow").attr("curphoto")).attr("pl")) > 0 && $("#vinfo").attr("prodplace")=="0") { 1026 $("#buy-photo").show(); 1027 } else { 1028 $("#buy-photo").hide(); 1029 } 1030 if(Math.abs($("#photo-"+pos).attr("pkgs")) > 0) { 1031 $("#buy-packages").show(); 1032 } else { 1033 $("#buy-packages").hide(); 1034 } 1035 1036 if(Math.abs($("#photo-"+pos).attr("share")) > 0) { 1037 $("#shareoptions").show(); 1038 } else { 1039 $("#shareoptions").hide(); 1040 } 1041 1042 if(Math.abs($("#photo-"+pos).attr("fd")) > 0) { 1043 $("#free-photo").show(); 1044 } else { 1045 $("#free-photo").hide(); 1046 } 1047 1048 if(Math.abs($("#photo-"+pos).attr("pic_hide")) > 0) { 1049 $("#hidden-full-photo").show(); 1050 } else { 1051 $("#hidden-full-photo").hide(); 1052 } 1053 $("#phototopcount").html(""+$("#photo-"+pos).attr("pos")+"/"+totalphotos+""); 1054 $("#photofilename").html($("#photo-"+pos).attr("org")); 1055 $("#photopagelink").html('<a href="'+$("#photo-"+pos).attr("pagelink")+'">'+$("#photo-"+pos).attr("pagetitle")+'</a>'); 1056 1057 if($("#photo-"+pos).attr("photofav") == "1") { 1058 $("#photographerfavoritefullstar").show(); 1059 } else { 1060 $("#photographerfavoritefullstar").hide(); 1061 } 1062 1063 } 1064 1065 1066 if (typeof stillload!=="undefined") { 1067 clearInterval(stillload); 1068 } 1069 1070 1071 $("#photocount").html(""+$("#photo-"+pos).attr("pos")+"/"+totalphotos+""); 1072 if($("#slideshow").attr("sson") == "1"){ 1073 $("#photo-"+pos+"-container").fadeIn(sstransition, function() { 1074 if($("#photo-"+pos).attr("data-next") !== "") { 1075 getsytistphoto($("#photo-"+pos).attr("data-next")); 1076 } 1077 $("#slideshow").attr("disablenav","0"); 1078 if(thumbnails == 1) { 1079 // $('#th-'+pos).scrollView(); 1080 } 1081 $("#slideshow").attr("disablenav","0"); 1082 if($("#slideshow").attr("fullscreen") == 1) { 1083 if($("#photo-"+pos).attr("ww") > $("#photo-"+pos).width()) { 1084 $("#photo-"+pos).addClass("zoomCur"); 1085 } else { 1086 $("#photo-"+pos).removeClass("zoomCur"); 1087 } 1088 if($("#vinfo").attr("proofing") == "1") { 1089 $.get(tempfolder+"/sy-inc/store/store_photos_menu.php?date_id="+$("#photo-"+pos).attr("did")+"&sub_id="+$("#vinfo").attr("sub_id")+"&view="+$("#vinfo").attr("view")+"&album="+$("#album").val()+"&need-login="+$("#vinfo").attr("need-login")+"&pic="+$("#photo-"+pos).attr("pkey"), function(data) { 1090 $("#ssheader").html(data); 1091 $("#phototopcount").html(""+$("#photo-"+pos).attr("pos")+"/"+totalphotos+""); 1092 $("#photofilename").html($("#photo-"+pos).attr("org")); 1093 $("#photopagelink").html('<a href="'+$("#photo-"+pos).attr("pagelink")+'">'+$("#photo-"+pos).attr("pagetitle")+'</a>'); 1094 1095 });
1096 } 1097 1098 if($("#vinfo").attr("viewing-store-photo-prod") == "1") { 1099 storeproductnexttophoto(pos); 1100 } else if($("#vinfo").attr("view_package") == "1") { 1101 packagenexttophoto(pos); 1102 } else { 1103 // alert("product next to photo"); 1104 1105 productsnexttophoto(pos); 1106 } 1107 } 1108 }); 1109 $("#photo-"+curphoto+"-container").fadeOut(sstransition); 1110 } else { 1111 $("#photo-"+pos+"-container").fadeIn(10, function() { 1112 getSSCaption("photo-"+pos); 1113 if($("#photo-"+pos).attr("data-next") !== "") { 1114 getsytistphoto($("#photo-"+pos).attr("data-next")); 1115 } 1116 if(thumbnails == 1) { 1117 // $('#th-'+pos).scrollView(); 1118 } 1119 $("#slideshow").attr("disablenav","0"); 1120 if($("#slideshow").attr("fullscreen") == 1) { 1121 1122 1123 if($("#photo-"+pos).attr("ww") > $("#photo-"+pos).width()) { 1124 $("#photo-"+pos).addClass("zoomCur"); 1125 } else { 1126 $("#photo-"+pos).removeClass("zoomCur"); 1127 } 1128 if($("#vinfo").attr("proofing") == "1") { 1129 $.get(tempfolder+"/sy-inc/store/store_photos_menu.php?date_id="+$("#photo-"+pos).attr("did")+"&sub_id="+$("#vinfo").attr("sub_id")+"&view="+$("#vinfo").attr("view")+"&album="+$("#album").val()+"&need-login="+$("#vinfo").attr("need-login")+"&pic="+$("#photo-"+pos).attr("pkey"), function(data) { 1130 $("#ssheader").html(data); 1131 $("#phototopcount").html(""+$("#photo-"+pos).attr("pos")+"/"+totalphotos+""); 1132 $("#photofilename").html($("#photo-"+pos).attr("org")); 1133 $("#photopagelink").html('<a href="'+$("#photo-"+pos).attr("pagelink")+'">'+$("#photo-"+pos).attr("pagetitle")+'</a>'); 1134 });
1135 } 1136 1137 if($("#slideshow").attr("fullscreen") == 1) { 1138 if($("#vinfo").attr("viewing-store-photo-prod") == "1") { 1139 storeproductnexttophoto(pos); 1140 } else if($("#vinfo").attr("view_package") == "1") { 1141 packagenexttophoto(pos); 1142 } else { 1143 1144 productsnexttophoto(pos); 1145 } 1146 } 1147 } 1148 }); 1149 $("#photo-"+curphoto+"-container").fadeOut(10, function() { 1150 $("#photo-"+curphoto+"-container").remove(); 1151 }); 1152 } 1153 if($("#slideshow").attr("sson") == "1"){ 1154 SSslideshowtimer = window.setTimeout("navSlides('next')",ssspeed); 1155 } 1156 1157 1158 if($("#photo-"+pos).attr("data-next") == "") { 1159 $("#ssNextPhoto").hide(); 1160 } else { 1161 $("#ssNextPhoto").show(); 1162 } 1163 if($("#photo-"+pos).attr("data-previous") == "") { 1164 $("#ssPrevPhoto").hide(); 1165 } else { 1166 $("#ssPrevPhoto").show(); 1167 } 1168 1169 1170 1171 1172 1173 $("#photo-"+(pos + 1)).attr("src", $("#photo-"+(pos + 1)).attr("thissrc")); 1174 if(pos > 0) { 1175 // alert(src); 1176 src = $("#photo-"+(pos - 1)).attr("src"); 1177 if (typeof src === "undefined") { 1178 // alert($("#photo-"+(pos)).attr("thissrc")); 1179 $("#photo-"+(pos - 1)).attr("src", $("#photo-"+(pos - 1)).attr("thissrc")); 1180 } 1181 } 1182 $("#slideshow").attr("curphoto",pos); 1183 if($("#vinfo").attr("has_package_one") == 1 && $("#vinfo").attr("has_package") == "1") { 1184 // showPackageOne(); 1185 } 1186 1187 if(thumbnails !== 1) { 1188 sizeContainer(); 1189 } 1190 1191 }); 1192 } 1193 } 1194} 1195 1196 1197function sizeGalPhoto(pickey) { 1198 closeenlargephoto(); 1199 if($("#slideshow").attr("fullscreen") == 1) { 1200 var photospacing = 32; 1201 } else { 1202 var photospacing = 0; 1203 } 1204 1205 if($("#slideshow").attr("fullscreen") == 1) { 1206 add_margin = add_margin_full; 1207 headerheight = $("#ssheader").height(); 1208 if($("#slideshow").attr("scrollthumbs") == "1" && thumbnails == 0) { 1209 sth = $("#thumbscroller").height() + add_margin_full + photospacing; 1210 } else { 1211 sth = 0; 1212 } 1213 1214 } else { 1215 add_margin = add_margin_page; 1216 sth = 0; 1217 headerheight = 0; 1218 } 1219 add_margin = add_margin + photospacing; 1220 1221 if($("#slideshow").attr("fullscreen") !== "1") { 1222 sizecontainer = 1; 1223 } else { 1224 sizecontainer = 0; 1225 } 1226 if($("#slideshow").attr("fullscreen") == 0) { 1227 if(first_landscape_width > 0 && use_first_lanscape_height == 1) { 1228 sizecontainer = 0; 1229 if((first_landscape_width + Math.abs(add_margin)) > $("#slideshow").width()) { 1230 wwp = $("#slideshow").width() / (first_landscape_width + Math.abs(add_margin)); 1231 wh = (first_landscape_height * wwp) + Math.abs(add_margin); 1232 } else { 1233 wh = first_landscape_height; 1234 1235 } 1236 $("#slideshow").css("height",wh + (add_margin / 2) +"px"); 1237 } else { 1238 wh = $(window).height(); 1239 } 1240 } else { 1241 wh = $(window).height(); 1242 } 1243 1244 1245 $("#photo-"+pickey).css({"left":"0px", "top":"0px", "margin":"0 0 0 0"}); 1246 dim = $("#photo-"+pickey).getHiddenDimensions(); 1247 //alert(dim.width); 1248 ww = Math.abs($("#photo-"+pickey).attr("ww")); 1249 hh = Math.abs($("#photo-"+pickey).attr("hh")); 1250 sth = Math.abs(sth); 1251 1252 if(ww <=1) { 1253 ww = dim.width; 1254 $("#photo-"+pickey).attr("ww",ww) 1255 } 1256 if(hh <=1) { 1257 hh = dim.height; 1258 $("#photo-"+pickey).attr("hh",hh) 1259 } 1260 1261 1262 if((ww + add_margin) > $("#photo-"+pickey+"-container").parent().width() || (hh + (add_margin*2) + sth) + 20 > (wh - sth)) { 1263 nwn = Math.abs(ww) + Math.abs(add_margin); 1264 wp = $("#photo-"+pickey+"-container").parent().width() / nwn; 1265 hp = wh / (Math.abs(hh) + sth + headerheight + add_margin); 1266 1267 1268 1269 if(hp > wp) { 1270 1271 1272 $("#photo-"+pickey).css({"width":($("#photo-"+pickey+"-container").parent().width() - add_margin)+"px", 1273 "height":hh * wp 1274 }); 1275 nw = ($("#photo-"+pickey+"-container").parent().width() - add_margin); 1276 nwp = nw / Math.abs(ww); 1277 nh = Math.abs(hh) * nwp; 1278 } else { 1279// $("#log").html( "header height: "+headerheight+" dim width: "+ww +" dim height: "+hh+" add margin: "+add_margin+" photo spacing" + photospacing+" > "+$("#photo-"+pickey+"-container").parent().width()+" || "+(hh + add_margin + sth + photospacing)+" > "+wh+" sth: "+sth+" ww: "+ww+" add_margin: "+add_margin+" photospacing: "+photospacing+" hh: "+hh); 1280 1281 1282 nw = nwn * hp; 1283 nh = Math.abs(hh) * hp; 1284 left = ($("#photo-"+pickey+"-container").parent().width() -(nw)) / 2; 1285 if($("#ssheader").css("display") == "block") { 1286 mh = $("#ssheader").height(); 1287 } else { 1288 mh = 0; 1289 } 1290 $("#photo-"+pickey).css({"height":(wh - add_margin - mh - sth)+"px", 1291 "width":"auto", 1292 "left":left+"px" 1293 }); 1294 // $("#log").show(); 1295 // $("#log").html(wh+" - "+add_margin+" - "+mh+" - "+sth+" - "+photospacing); 1296 1297 nh = wh - add_margin - mh - sth; 1298 nhp = nh / Math.abs(hh); 1299 nw = Math.abs(ww) * nhp; 1300 } 1301 1302 } else { 1303 1304 // alert($("#photo-"+pickey+"-container").parent().width()+" - "+ww); 1305 if($("#photo-"+pickey).width() < ww) { 1306 $("#photo-"+pickey).css({"width":ww+"px","height":"auto"}); 1307 } 1308 left = ($("#photo-"+pickey+"-container").parent().width() - Math.abs(ww)) / 2; 1309 $("#photo-"+pickey).css({"left":left+"px"}); 1310 nw = ww; 1311 nh = hh; 1312 1313 } 1314 1315 if($("#slideshow").attr("fullscreen") == "1") { 1316 1317 if(nh < ($("#slideshowcontainer").height() + sth + add_margin)) { 1318 mt = ($("#slideshowcontainer").height() - headerheight - nh); 1319 if(mt < 0) { 1320 mt = 0; 1321 } 1322 new_top = headerheight + (mt / 2) - (sth / 2) ; 1323 $("#photo-"+pickey).css({"top":new_top +"px"}); 1324 } else { 1325 $("#photo-"+pickey).css({"top":"0px"}); 1326 } 1327 left = ($("#photo-"+pickey+"-container").parent().width() - Math.abs(nw)) / 2 - 4; 1328 1329 // $("#log").show(); 1330 // $("#log").html($("#photo-"+pickey+"-container").parent().width()+" - "+Math.abs(nw)+" - "+add_margin); 1331 1332 $("#photo-"+pickey).css({"left":left+"px"}); 1333 1334 } 1335} 1336 1337 1338 1339function fullScreen() { 1340 $("#photo-"+$("#slideshow").attr("curphoto")).removeClass("photo").addClass("photofull"); 1341 $("#photo-"+$("#slideshow").attr("curphoto")+"-container").hide(); 1342 $("#slideshow").attr("fullscreen", "1"); 1343 $(".ssnavigation").hide(); 1344 $(".photocaptioncontainer").hide(); 1345 $("#ssbackground").fadeIn(0, function() { 1346 1347 if($("#vinfo").attr("viewing-store-photo-prod") == "1") { 1348 storeproductnexttophoto($("#slideshow").attr("curphoto")); 1349 } else if($("#vinfo").attr("view_package") == "1") { 1350 packagenexttophoto($("#slideshow").attr("curphoto")); 1351 } else { 1352 productsnexttophoto($("#slideshow").attr("curphoto")); 1353 } 1354 if(sytiststore == 1 && $("#vinfo").attr("plid") > 0) { 1355 $("#ssheader").fadeIn(100); 1356 $.get(tempfolder+"/sy-inc/store/store_photos_menu.php?date_id="+$("#photo-"+$("#slideshow").attr("curphoto")).attr("did")+"&sub_id="+$("#vinfo").attr("sub_id")+"&view="+$("#vinfo").attr("view")+"&album="+$("#album").val()+"&need-login="+$("#vinfo").attr("need-login")+"&pic="+$("#photo-"+$("#slideshow").attr("curphoto")).attr("pkey"), function(data) { 1357 $("#ssheader").html(data); 1358 if(mobile == "1") { 1359 checkforpackages();
1360 checkforpackagesone(); 1361 } 1362 adjustsite(); 1363 $("#ssClose").css({"top":$("#ssheader").height()+"px"}); 1364 pic = $("#photo-"+$("#slideshow").attr("curphoto")).attr("pkey"); 1365 if($("#photo-"+$("#slideshow").attr("curphoto")).attr("fav") == "1") { 1366 $(".photo-fav").removeClass("icon-heart-empty").addClass("icon-heart"); 1367 } else { 1368 $(".photo-fav").removeClass("icon-heart").addClass("icon-heart-empty"); 1369 } 1370 1371 if($("#photo-"+$("#slideshow").attr("curphoto")).attr("compare") == "1") { 1372 $(".checked").show(); 1373 } else { 1374 $(".checked").hide(); 1375 } 1376 1377 if(Math.abs($("#photo-"+$("#slideshow").attr("curphoto")).attr("pl")) > 0 && $("#vinfo").attr("prodplace")=="0") { 1378 $("#buy-photo").show(); 1379 } else { 1380 $("#buy-photo").hide(); 1381 } 1382 1383 if(Math.abs($("#photo-"+$("#slideshow").attr("curphoto")).attr("pkgs")) > 0) { 1384 $("#buy-packages").show(); 1385 } else { 1386 $("#buy-packages").hide(); 1387 } 1388 1389 if(Math.abs($("#photo-"+$("#slideshow").attr("curphoto")).attr("share")) > 0) { 1390 $("#shareoptions").show(); 1391 } else { 1392 $("#shareoptions").hide(); 1393 } 1394 if(Math.abs($("#photo-"+$("#slideshow").attr("curphoto")).attr("fd")) > 0) { 1395 $("#free-photo").show(); 1396 } else { 1397 $("#free-photo").hide(); 1398 } 1399 if(Math.abs($("#photo-"+$("#slideshow").attr("curphoto")).attr("pic_hide")) > 0) { 1400 $("#hidden-full-photo").show(); 1401 } else { 1402 $("#hidden-full-photo").hide(); 1403 } 1404 $("#phototopcount").html(""+$("#photo-"+$("#slideshow").attr("curphoto")).attr("pos")+"/"+totalphotos+""); 1405 $("#photofilename").html($("#photo-"+$("#slideshow").attr("curphoto")).attr("org")); 1406 $("#photopagelink").html('<a href="'+$("#photo-"+$("#slideshow").attr("curphoto")).attr("pagelink")+'">'+$("#photo-"+$("#slideshow").attr("curphoto")).attr("pagetitle")+'</a>'); 1407 if($("#photo-"+$("#slideshow").attr("curphoto")).attr("photofav") == "1") { 1408 $("#photographerfavoritefullstar").show(); 1409 } else { 1410 $("#photographerfavoritefullstar").hide(); 1411 } 1412 1413 1414 1415 1416 }); 1417 } 1418 $("#fullscreen").hide(); 1419 $("#shopmenucontainer").hide(); 1420 1421 1422 $("#ssholder").css({"width":$("#slideshowcontainer").width()+"px","height":$("#slideshowcontainer").height()+"px"}); 1423 $("#ssholder").show(); 1424 1425 $("#slideshowcontainer").addClass("sscontainerfull"); 1426 1427 $("#ssNextPhoto").addClass("the-icons-fullscreen"); 1428 $("#ssPrevPhoto").addClass("the-icons-fullscreen"); 1429 $("#ssClose").addClass("the-icons-fullscreen"); 1430 $("#ssPlay").addClass("the-icons-fullscreen"); 1431 $("#ssPause").addClass("the-icons-fullscreen"); 1432 1433 setTimeout(function(){ 1434 1435 $("#photo-"+$("#slideshow").attr("curphoto")).imagesLoaded(function() { 1436 // $("#log").show().append("image loaded: "+$("#slideshow").attr("curphoto")+" "); 1437 sizePhoto($("#slideshow").attr("curphoto")); 1438 selectGSbackground('photofull',false); 1439 slideshowdoneloading(); 1440 if (typeof stillload!=="undefined") { 1441 clearInterval(stillload); 1442 } 1443 1444 $("#photo-"+$("#slideshow").attr("curphoto")+"-container").fadeIn(10, function() { 1445 // fixbackground(); 1446 if($("#photo-"+$("#slideshow").attr("curphoto")).attr("data-next") !== "") { 1447 getsytistphoto($("#photo-"+$("#slideshow").attr("curphoto")).attr("data-next")); 1448 } 1449 if($("#photo-"+$("#slideshow").attr("curphoto")).width() < 100) { sizePhoto($("#slideshow").attr("curphoto")); } 1450 1451 // $("#log").html($("#photo-"+pos+"-container").parent().width()+" - "+Math.abs(nw)+" - "+add_margin); 1452 1453 if($("#photo-"+$("#slideshow").attr("curphoto")).attr("ww") > $("#photo-"+$("#slideshow").attr("curphoto")).width()) { 1454 $("#photo-"+$("#slideshow").attr("curphoto")).addClass("zoomCur"); 1455 } else { 1456 $("#photo-"+$("#slideshow").attr("curphoto")).removeClass("zoomCur"); 1457 } 1458 1459 placeNav($("#slideshow").attr("curphoto")); 1460 getSSCaption("photo-"+$("#slideshow").attr("curphoto")); 1461 $(".ssnavigation").fadeIn(100); 1462 headerheight = $("#ssheader").height(); 1463 $("#ssClose").css({"top":headerheight+"px"}); 1464 1465 $("#ssClose").fadeIn(100); 1466 1467 if(thumbnails == 1) { 1468 placeNav($("#slideshow").attr("curphoto")); 1469 if($("#slideshow").attr("sson") == "1") { 1470 $("#ssPlay").hide(); 1471 $("#ssPause").show(); 1472 } else { 1473 $("#ssPlay").show(); 1474 $("#ssPause").hide(); 1475 } 1476 if($("body").width() <= 800) { 1477 $("#controls").hide(); 1478 } else { 1479 $("#controls").children().hide(); 1480 } 1481 pos = Math.abs($("#slideshow").attr("curphoto")) + 1; 1482 1483 $("#photo-"+pos).attr("src", $("#photo-"+pos).attr("thissrc")); 1484 1485 $("#controls").mouseover(function(){ 1486 $(this).children().addClass("controlsbg"); 1487 $(this).children().show(); 1488 }).mouseout(function(){ 1489 $(this).children().removeClass("controlsbg"); 1490 $(this).children().hide();}); 1491 1492 } 1493 1494 if(thumbnails == 0) { 1495 fullScreenThumbScroller(); 1496 } 1497 1498 if($("#photo-"+$("#slideshow").attr("curphoto")).attr("data-next") == "") { 1499 $("#ssNextPhoto").hide(); 1500 } else { 1501 $("#ssNextPhoto").show(); 1502 } 1503 if($("#photo-"+$("#slideshow").attr("curphoto")).attr("data-previous") == "") { 1504 $("#ssPrevPhoto").hide(); 1505 } else { 1506 $("#ssPrevPhoto").show(); 1507 } 1508 1509 1510 $(".photocaptioncontainer").fadeIn(200); 1511 }); 1512 }); 1513 },200) 1514 1515 }); 1516} 1517 1518 1519 1520function closeFullScreen() { 1521// $("#thumbscroller").css("visibility", "hidden"); 1522 if(sytiststore == 1) { 1523 removeFilterPhoto(); 1524 closepackagetab(); 1525 closepackagetabone(); 1526 } 1527 $("#vinfo").attr("view-photo-fixed","0"); 1528 1529 $("#vinfo").attr("viewing_prods", "0"); 1530 1531 $("#photoproductsnexttophoto").hide(); 1532 $("#photoproductsnexttophoto .inner").html(""); 1533 $("#photoproductsnexttophotobg").hide(); 1534 1535 closeenlargephoto(); 1536 $("#shopmenucontainer").show(); 1537 $("#photo-"+$("#slideshow").attr("curphoto")).removeClass("photofull").addClass("photo"); 1538 $("#ssbackground").fadeOut(200, function() { 1539 if($("#page-wrapper").css("position") == "fixed") { 1540 unfixbackground(); 1541 } 1542 $('#th-'+$("#slideshow").attr("curphoto")).scrollView(); 1543 1544 }); 1545 $("#ssheader").fadeOut(200); 1546 1547 stopSlideshow(); 1548 1549 $("#photo-"+$("#slideshow").attr("curphoto")+"-container").hide(); 1550 $("#slideshow").attr("fullscreen", "0"); 1551 $(".ssnavigation").hide(); 1552 $(".photocaptioncontainer").hide(); 1553 $("#fullscreen").show(); 1554 $("#ssClose").hide(); 1555 $("#ssholder").hide(); 1556 $("#ssNextPhoto").removeClass("the-icons-fullscreen"); 1557 $("#ssPrevPhoto").removeClass("the-icons-fullscreen"); 1558 $("#ssClose").removeClass("the-icons-fullscreen"); 1559 $("#ssPlay").removeClass("the-icons-fullscreen"); 1560 $("#ssPause").removeClass("the-icons-fullscreen"); 1561 1562 $("#slideshowcontainer").removeClass("sscontainerfull"); 1563 if(scrollthumbnails == 1) { 1564 closeFullScreenThumbScroller(); 1565 } 1566 if(thumbnails !== 1) { 1567 setTimeout(function(){ 1568 1569 sizePhoto($("#slideshow").attr("curphoto")); 1570 $("#photo-"+$("#slideshow").attr("curphoto")+"-container").fadeIn(200, function() { 1571 placeNav($("#slideshow").attr("curphoto")); 1572 getSSCaption("photo-"+$("#slideshow").attr("curphoto")); 1573 sizeContainer(); 1574 $(".ssnavigation").fadeIn(200); 1575 $("#ssClose").fadeOut(200); 1576 1577 $(".photocaptioncontainer").fadeIn(200); 1578 }); 1579 },200) 1580 } 1581} 1582function closegsinfo() { 1583 $("#gsinfocontainer").fadeOut(300);
1584} 1585function selectGSbackground(c,showload,file,fileid) { 1586 if($("#selectgsbackground").length > 0) { 1587 if(showload == true) { 1588 $("#loading").show(); 1589 } 1590 if(!file) { 1591 $("body").append('<img id="gsbg" src="'+$("#gs-bgimage").val()+'" class="hide">'); 1592 } else { 1593 opengsbackground(); 1594 $("body").append('<img id="gsbg" src="'+file+'" class="hide">'); 1595 $("#gs-bgimage").val(file); 1596 $("#gs-bgimage-id").val(fileid); 1597 $(".gs-bgimage-id-free").val(fileid); 1598 } 1599 setTimeout(function() { 1600 $('#gsbg').imagesLoaded(function() { 1601 if(!file) { 1602 // Changes to get background from favorite 1603 if(Math.abs($("#photo-"+$("#slideshow").attr("curphoto")).attr("favbg")) > 0) { 1604 //alert($("#photo-"+$("#slideshow").attr("curphoto")).attr("favbgfile")); 1605 file = $("#photo-"+$("#slideshow").attr("curphoto")).attr("favbgfile"); 1606 fileid = $("#photo-"+$("#slideshow").attr("curphoto")).attr("favbgkey"); 1607 1608 $("#gs-bgimage").val(file); 1609 $("#gs-bgimage-id").val(fileid); 1610 $(".gs-bgimage-id-free").val(fileid); 1611 } 1612 } 1613 if(!file) { 1614 $("."+c).not(".gsbackground").css({"background-image":"url('"+$("#gs-bgimage").val()+"')","background-size":"cover","background-position":"center center"}); 1615 $("#minigsbg").attr("src",$("#gs-bgimage").val()); 1616 } else { 1617 $(".photoviewphoto").css({"background-image":"url('"+file+"')","background-size":"cover","background-position":"center center"}); 1618 $("."+c).not(".gsbackground").css({"background-image":"url('"+file+"')","background-size":"cover"," background-position":"center center"}); 1619 $("#minigsbg").attr("src",file); 1620 } 1621 $("#loading").hide(); 1622 $("#gsbg").remove(); 1623 }); 1624 },10); 1625 } 1626} 1627 1628function opengsbackground() { 1629 $("#selectgsbg").slideToggle(200); 1630} 1631
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.