1/* Minification failed. Returning unminified contents. 2(232,26-27): run-time error JS1195: Expected expression: ) 3(232,29-30): run-time error JS1195: Expected expression: > 4(740,95-96): run-time error JS1003: Expected ':': , 5(741,96-97): run-time error JS1003: Expected ':': , 6(742,96-97): run-time error JS1003: Expected ':': , 7(747,92-93): run-time error JS1003: Expected ':': , 8(747,110-111): run-time error JS1003: Expected ':': } 9(750,92-93): run-time error JS1003: Expected ':': , 10(750,105-106): run-time error JS1003: Expected ':': } 11(1030,89-90): run-time error JS1195: Expected expression: > 12(1030,131-132): run-time error JS1004: Expected ';': ) 13(1057,21-22): run-time error JS1002: Syntax error: } 14(1064,30-31): run-time error JS1004: Expected ';': { 15(1067,18-19): run-time error JS1195: Expected expression: , 16(1074,27-28): run-time error JS1004: Expected ';': { 17(1090,44-45): run-time error JS1195: Expected expression: ) 18(1090,47-48): run-time error JS1195: Expected expression: > 19(1096,6-7): run-time error JS1195: Expected expression: ) 20(1098,1-2): run-time error JS1002: Syntax error: } 21(1101,15-16): run-time error JS1004: Expected ';': { 22(1192,2-3): run-time error JS1195: Expected expression: ) 23 */ 24function HelpfulJudge(itemId, helpful, reviewId, iHelpful, iTotalJudge, helpfulBlockId, reviewBlockId, of, people) { 25 var url = "../../../HelpfulJudge.ashx?Judge=" + helpful + "&ReviewId=" + reviewId + "&ItemId=" + itemId; 26 $.ajax({ url: url }); 27 28 if (helpful == "yes") { 29 iHelpful = iHelpful + 1; 30 } 31 iTotalJudge = iTotalJudge + 1; 32 33 var cHelpfulness = $("." + helpfulBlockId); 34 cHelpfulness.css({ display: "none" }); 35 var cReview = $("#" + reviewBlockId); 36 cReview.html(iHelpful + of + iTotalJudge + people); 37 cReview.css({ display: "block" }); 38} 39 40function downloadBlankImages() { 41 dataLayer.push({ 'event': 'downloadBlankImages' }); 42} 43 44function getRootPath() { 45 var strFullPath = window.document.location.href; 46 var strPath = window.document.location.pathname; 47 var pos = strFullPath.indexOf(strPath); 48 var prePath = strFullPath.substring(0, pos); 49 return prePath; 50} 51function WriteReview(itemid) { 52 //set the url of current page to the session 53 var retss = getRootPath() + "/Default.aspx?FocusId=Shopping/WriteReview.ascx&itemId=" + itemid; 54 location.href = retss; 55} 56 57function WriteFirstReviewAPL() { 58 var writeReview = $('#answ_write_review_link_two.acs_js_write_review'); 59 if (writeReview.length > 0) { 60 writeReview[0].click(); 61 } 62} 63 64var ProductDetail = { 65 sending: false, 66 rowPer: "", 67 isMobileDevice: "", 68 priceGroup: "", 69 dataType: "", 70 ifAccount: "", 71 accountId: "", 72 sortType: "", 73 ItemNumber: "", 74 ItemName: "", 75 isNDA: "False", 76 refid:"", 77 referrer: "", 78 vendorNumber: "", 79 thumbnailSwatchPath: "", 80 brand: { 81 company: "", 82 division: "", 83 rootDir: "" 84 }, 85 params: { 86 sortType: "", 87 filterOrder: "", 88 priorityCode: "" 89 }, 90 idSelector: { 91 upArrow: "#divCategoryUparrow", 92 productreview: ".pdr_reviews", 93 prodReviewTD: "#tdReviews" 94 }, 95 categoryLoadingWaitingCover: null, 96 // productDetailWaitingCover: null, 97 totalCount: 0, 98 currentCount: 0, 99 windowHeight: $(window).height(), 100 CreatePageList: function () { 101 $(".pagination_smaller_container").off(); 102 var pCount = Math.ceil(ProductDetail.totalCount / 10); 103 $(".pagination_smaller_container").createPage({ 104 pageCount: pCount, 105 current: 1 106 }); 107 }, 108 load: function () { 109 if (ProductDetail.currentCount < ProductDetail.totalCount) { 110 ProductDetail.sending = true; 111 ProductDetail.categoryLoadingShowWaitingCover(); 112 $.post( 113 "/Services/RetrieveReviews.ashx", 114 { 115 currentCount: ProductDetail.currentCount, 116 totalCount: ProductDetail.totalCount, 117 ifAccount: ProductDetail.ifAccount, 118 accountId: ProductDetail.accountId, 119 sortType: ProductDetail.sortType, 120 ItemNumber: ProductDetail.ItemNumber 121 }, 122 ProductDetail.drawHTML, 123 "json" 124 ); 125 } 126 }, 127 pushGaEvent: function (source) { 128 if (ProductDetail.ItemNumber) { 129 $.ajax({
130 type: "post", 131 dataType: 'json', 132 url: "/Services/ProductDetailHandler.ashx", 133 data: { 134 itemId: ProductDetail.ItemNumber, 135 source: source, 136 referrer: ProductDetail.referrer, 137 refid: ProductDetail.refid, 138 command:"ClickPath" 139 }, 140 success: function (response) { 141 window.dataLayer = window.dataLayer || []; 142 window.dataLayer.push({ 143 'itemName': ProductDetail.ItemName, 144 "category": response.categoryName, 145 "clickPath": response.clickPath, 146 "NDA": ProductDetail.isNDA 147 }); 148 if (response.clickPath) { 149 $("input[name$='hdnSampleClickPath']").val(response.clickPath); 150 } 151 }, 152 error: function (XMLHttpRequest, textStatus, errorThrown) { 153 console.error("Status: " + textStatus + "Error: " + errorThrown); 154 } 155 }); 156 } 157 158 }, 159 showProductDetailBadge: function () { 160 if (ProductDetail.ItemNumber) { 161 $.ajax({
162 type: "post", 163 dataType: 'json', 164 url: "/Services/ProductDetailHandler.ashx", 165 data: { 166 itemId: ProductDetail.ItemNumber, 167 command: "ProductDetail" 168 }, 169 success: function (response) { 170 if (response.isMadeInUSA) { 171 $("#UsaIcon").show(); 172 $("#UsaIcon").css("display", "flex"); 173 } 174 if (response.fullColor) { 175 $("#fullColorIcon").show(); 176 $("#fullColorIcon").css("display", "flex"); 177 } 178 if (response.productDetailBadge) { 179 $("#badgeView").css("display", ""); 180 $("#badge-container").html(response.productDetailBadge); 181 } 182 if (!response.isMadeInUSA && !response.fullColor) { 183 $("#productIconsView").css("display", "none"); 184 } 185 if (response.promoText) { 186 $("#discountId").css("display", "flex").find(".discount").text(response.promoText); 187 } 188 }, 189 error: function (XMLHttpRequest, textStatus, errorThrown) { 190 console.error("Status: " + textStatus + "Error: " + errorThrown); 191 } 192 }); 193 } 194 }, 195 showVendorSpecialCharge: function () { 196 if (ProductDetail.ItemNumber && ProductDetail.vendorNumber) { 197 $.ajax({
198 type: "post", 199 dataType: 'json', 200 url: "/Services/ProductDetailHandler.ashx", 201 data: { 202 itemId: ProductDetail.ItemNumber, 203 vendorNumber: ProductDetail.vendorNumber, 204 command: "VendorSpecialCharge" 205 }, 206 success: function (response) { 207 if (response.hasVendorSpecialCharge) { 208 $("#vendorSpecChg").show(); 209 } 210 else { 211 $("#vendorSpecChg").hide(); 212 } 213 }, 214 error: function (XMLHttpRequest, textStatus, errorThrown) { 215 console.error("Status: " + textStatus + "Error: " + errorThrown); 216 } 217 }); 218 } 219 }, 220 loadS7Script: function () { 221 var hasVideo = false; 222 223 $('.swatch_container').each(function () { 224 var onclickAttr = $(this).attr('onclick'); 225 if (onclickAttr && onclickAttr.includes('selectVideo')) { 226 hasVideo = true; 227 return false; 228 } 229 }); 230 if (hasVideo) { 231 loadScriptAsync('https://s7d4.scene7.com/s7viewers/html5/js/VideoViewer.js', function () { 232 }) 233 } 234 loadScriptAsync('https://s7d1.scene7.com/s7sdk/3.0/js/s7sdk/utils/Utils.js', function () { 235 s7sdk.Util.lib.include('s7sdk.common.Button'); 236 s7sdk.Util.lib.include('s7sdk.common.Container'); 237 s7sdk.Util.lib.include('s7sdk.event.Event'); 238 s7sdk.Util.lib.include('s7sdk.image.ZoomView'); 239 s7sdk.Util.lib.include('s7sdk.image.FlyoutZoomView'); 240 s7sdk.Util.init(); 241 loadScriptAsync('/JS/s7viewerzoomswatch.js'); 242 }) 243 }, 244 selectVideo: function (asset) { 245 const MAX_WAIT = 5000; 246 const INTERVAL = 200; 247 $("#gallerywrapper_container").show(); 248 if (this.videoViewerInstance) { 249 $("#galleryholder").hide(); 250 this.videoViewerInstance.setAsset(asset); 251 return; 252 } 253 const startTime = Date.now(); 254 255 const tryInit = () => { 256 if (window.s7viewers && window.s7viewers.VideoViewer) { 257 this.videoViewerInstance = new window.s7viewers.VideoViewer({ 258 containerId: "gallerywrapper", 259 params: { 260 asset: asset, 261 serverurl: 'https://images.promotionalstore.com/is/image', 262 videoserverurl: 'https://images.promotionalstore.com/is/content/', 263 }, 264 }); 265 $("#galleryholder").hide(); 266 this.videoViewerInstance.init(); 267 clearInterval(timer); 268 return; 269 } 270 271 if (Date.now() - startTime > MAX_WAIT) { 272 clearInterval(timer); 273 console.error('s7viewers loading timed out.'); 274 } 275 }; 276 277 if (window.s7viewers && window.s7viewers.VideoViewer) { 278 tryInit(); 279 } else { 280 var timer = setInterval(tryInit, INTERVAL); 281 } 282 }, 283 loadResellerratings: function () { 284 const resellerratingurl = 'https://www.resellerratings.com/productreviews/widget/app/AmsterdamPrinting.js?sku=' + ProductDetail.ItemNumber; 285 loadScriptAsync(resellerratingurl, function () { 286 runAfterElementExists('#acs_product_reviews_widget', function () { 287 $("#answ_widget_stars").click(function () { 288 if (dataLayer) { 289 dataLayer.push({ 'event': 'PDP_Reviews' }); 290 } 291 }); 292 $("#answ_read_reviews").click(function () { 293 if (dataLayer) { 294 dataLayer.push({ 'event': 'PDP_Reviews' }); 295 } 296 }); 297 $("#answ_write_review_link_two").click(function () { 298 if (dataLayer) { 299 dataLayer.push({ 'event': 'PDP_Write Review' }); 300 } 301 }); 302 //$("#acs_product_reviews_widget").appendTo($("#RR_PR_Wi
302dget_Wrapper_placeholder")); 303 var reviewHeight = $('#RR_PR_Frame_Wrapper').height(); 304 if (reviewHeight === 0) $('#APL_Review_Empty').css("display",""); 305 }); 306 }); 307 }, 308 drawHTML: function (data) { 309 ProductDetail.currentCount = data.NewCurrentCount; 310 $(ProductDetail.idSelector.prodReviewTD).empty(); 311 $(data.Html).appendTo($(ProductDetail.idSelector.prodReviewTD)); 312 ProductDetail.sending = false; 313 ProductDetail.categoryLoadingHideWaitingCover(); 314 if (ProductDetail.currentCount >= ProductDetail.totalCount) { 315 $("#divMoreReviews").css("display", "none"); 316 } 317 }, 318 sortReviews: function (sortType) { 319 ProductDetail.sortType = sortType; 320 ProductDetail.currentCount = 0; 321 $(ProductDetail.idSelector.prodReviewTD).empty(); 322 ProductDetail.load(); 323 }, 324 325 initializeUparrow: function () { 326 var left = 950; 327 $(ProductDetail.idSelector.upArrow).css({ left: left }); 328 ProductDetail.scrollUparrow(); 329 }, 330 331 scrollUparrow: function () { 332 var top = 0; 333 var arrowHeight = document.getElementById('divCategoryUparrow').clientHeight + 5; 334 var windowHeight = $(window).height(); 335 var documentTop = $(document).scrollTop(); 336 var contentTop = $(".pdr_left").offset().top; 337 var scrollBoundary = $(ProductDetail.idSelector.productreview).offset().top + $(ProductDetail.idSelector.productreview).height(); 338 if (documentTop + windowHeight < scrollBoundary) 339 top = documentTop + windowHeight - contentTop; 340 else 341 top = scrollBoundary - contentTop; 342 top -= arrowHeight; 343 if (documentTop > 0) 344 $(ProductDetail.idSelector.upArrow).css({ display: "block" }); 345 $(ProductDetail.idSelector.upArrow).css({ top: top }); 346 }, 347 348 loadReviews: function () { 349 ProductDetail.scrollUparrow(); 350 if (!ProductDetail.sending) { 351 //var documentHeight = $(document).height(); 352 //var scrollBoundary = $(ProductDetail.idSelector.productreview).offset().top + $(ProductDetail.idSelector.productreview).height(); 353 //var documentTop = $(document).scrollTop(); 354 //if (documentTop + ProductDetail.windowHeight >= scrollBoundary) { 355 ProductDetail.load(); 356 //} 357 //else if (documentTop + ProductDetail.windowHeight >= documentHeight) { 358 // ProductDetail.lazyLoad(); 359 //} 360 } 361 }, 362 363 categoryLoadingShowWaitingCover: function () { 364 WaitingCover(true); 365 }, 366 367 categoryLoadingHideWaitingCover: function () { 368 WaitingCover(false); 369 }, 370 371 navTop: function () { 372 $(document).scrollTop(0); 373 }, 374 375 LoadGalleryItem: function (elementId) { 376 $('.pd_GalleryItems').hide(); 377 $('#' + elementId).show(); 378 } 379}; 380function loadScriptAsync(src, callback) { 381 var headID = document.getElementsByTagName("head")[0]; 382 var newScript = document.createElement('script'); 383 newScript.type = 'text/javascript'; 384 newScript.src = src; 385 newScript.async = true; 386 if (callback) { 387 newScript.onload = callback; 388 } 389 headID.appendChild(newScript); 390}; 391 392function BindControlEvents() { 393 $(".tab-content").hide(); 394 $('.review_tab').click(function () { 395 var tab_id = $(this).attr('data-tab'); 396 $('.review_tab').removeClass('is-active'); 397 $(".tab-content").hide(); 398 $(this).addClass('is-active'); 399 $("#" + tab_id).show(); 400 }); 401 402 var reviewMoreMaxLength = 400; 403 $('.review_more').each(function () { 404 var content = $(this).text(); 405 406 if (content.length > reviewMoreMaxLength) { 407 408 var c = content.substr(0, reviewMoreMaxLength); 409 var index = Math.min(c.length, c.lastIndexOf(" ")); 410 c = c.substr(0, index); 411 var h = content.substr(index); 412 413 var html = c + '<span class="hidden">' + h + '</span> <a class="morelink">More</a>'; 414 415 $(this).html(html); 416 } 417 418 });
419 var imprintColorWidth = $(".imprint_color").width(); 420 var $imprint_color = $(".imprint_color"); 421 var imprint_content = $.trim($imprint_color.text()); 422 if (GetStringWidth(imprint_content) > imprintColorWidth) { 423 var c = trimByPixel(imprint_content, imprintColorWidth - 30); 424 var h = imprint_content.substr(c.length); 425 var html = c + '<span class="hidden">' + h + '</span> <a href="" class="more" id="imprint_morelink">More</a>'; 426 $imprint_color.html(html); 427 $("#imprint_morelink").click(function (e) { 428 e.preventDefault(); 429 if ($(this).hasClass("less")) { 430 $(this).removeClass("less"); 431 $(this).html(" More"); 432 } else { 433 $(this).addClass("less"); 434 $(this).html(" Less"); 435 }; 436 $(this).prev('span').toggle(); 437 }); 438 }; 439 440 441 442 $(".morelink").click(function (e) { 443 e.preventDefault(); 444 LoadReview(this); 445 $("#review_tab").click(); 446 var dialog = $("#review_popup").dialog({ 447 modal: true, 448 draggable: false, 449 resizable: false, 450 closeOnEscape: false, 451 zIndex: 200000, 452 width: "95%", 453 dialogClass: "popupContainer", 454 455 }); 456 }); 457 $(".review_thumbnails img").click(function (e) { 458 e.preventDefault(); 459 LoadReview(this); 460 $("#photo_tab").click(); 461 var dialog = $("#review_popup").dialog({ 462 modal: true, 463 draggable: false, 464 resizable: false, 465 closeOnEscape: false, 466 zIndex: 200000, 467 width: "95%", 468 dialogClass: "popupContainer", 469 470 }); 471 }); 472 473}; 474 475var prm = Sys.WebForms.PageRequestManager.getInstance(); 476if (prm != null) { 477 prm.add_endRequest(function (sender, e) { 478 if (sender._postBackSettings.panelsToUpdate != null) { 479 BindControlEvents(); 480 } 481 }); 482}; 483function CloseReviewPopup() { 484 $("#review_popup").dialog("close"); 485} 486function LoadReview(sender) 487{ 488 var $review_container = $(sender).parents(".review_container"); 489 $("#review_headline_pop").html($review_container.find(".review_headline").html()); 490 $("#pd_starRating_pop").html($review_container.find(".pd_starRating").html()); 491 $("#review_author_pop").html($review_container.find(".review_author").html()); 492 $("#review_content_pop").html($review_container.find(".review_content").html().replace(' <a class="morelink">More</a>', '').replace('<span class="hidden">', '<span>')); 493 var $review_resolution = $review_container.find(".review_resolution"); 494 $("#review_resolution_pop").empty(); 495 if ($review_resolution.length) { 496 $("#review_resolution_pop").html($review_container.find(".review_resolution").html()); 497 } 498 $("#photos_content").empty(); 499 var $img = $review_container.find(".review_thumbnails img"); 500 if($img.length) 501 { 502 $("#photo_tab").show(); 503 $img.each(function () { 504 $("#photos_content").append($("<div class='side_thumb'>").append($(this).clone().addClass("photo_thumb"))); 505 }); 506 $("#photos_content").append($("<div class='selected_thumb'>")); 507 $(".side_thumb img").click(function (e) { 508 e.preventDefault(); 509 $(".side_thumb").removeClass("selected"); 510 $(this).parent(".side_thumb").addClass("selected"); 511 $(".selected_thumb").empty(); 512 513 $(".selected_thumb").append($(this).clone().removeClass("photo_thumb").addClass("photo_main")); 514 }); 515 $(".selected_thumb").append($(".side_thumb img").first().clone().removeClass("photo_thumb").addClass("photo_main")); 516 } 517 else 518 { 519 $("#photo_tab").hide(); 520 } 521 522} 523var scoll = 0; 524function ScrollToReview() { 525 scoll = 1 526} 527function pageLoad() { 528 if (scoll == 1) 529 { 530 scoll = 0; 531 $('html, body').animate({ 532 scrollTop: $("#pd_reviews").offset().top 533 }, 200); 534 } 535 536} 537function GetStringWidth(str) 538{ 539 var span = $('<span style="white-space:nowrap;visibility:hidden">' + str + '</span>').appendTo(document.body); 540 var width = span.width(); 541 span.remove(); 542 return width; 543} 544function trimByPixel(str, width) 545{ 546 var span = $('<span style="white-space:nowrap;visibility:hidden">' + str + '</span>').appendTo(document.body); 547 var txt = str; 548 while (span.width() > width) { 549 var lastIndex = txt.lastIndexOf(","); 550 txt = txt.substring(0, lastIndex); 551 span.text(txt); 552 } 553 span.remove(); 554 return txt; 555} 556
557//Scripts for updated PD design 08/2017// 558 559// up/down scroll on vertical image views left of gallery image 560$('.upDown_arrows').on('click', function(e) { 561 if ($(this).find('.up').length !== 0) { 562 $('.upDown_arrows .down').removeClass('inactiveArrow'); 563 var toppos = $('.vertical_swatches').css('top'); 564 var topposplus = parseInt(toppos) + 90; 565 var topposnew = topposplus + 'px'; 566 if (topposplus > 0) { 567 topposnew = '0px'; 568 $(this).find('.up').addClass('inactiveArrow'); 569 } 570 e.preventDefault(); 571 $('.vertical_swatches').animate({ 572 'top': topposnew 573 }); 574 } else { 575 $('.upDown_arrows .up').removeClass('inactiveArrow'); 576 var contentwidth = 0; 577 $('.vertical_swatches .swatch_container').each(function () { 578 //Add each instance of the scrollcontainer with its margin(10px) 579 contentwidth = contentwidth + parseInt($(this).css('height'), 10) + 10; 580 }); 581 var scrollcontainer = parseInt($('.vertical_swatches').css('height'), 10); 582 var topmax = contentwidth - scrollcontainer; 583 var bottompos = $('.vertical_swatches').css('top'); 584 var bottomposplus = parseInt(bottompos) - 50; 585 586 var bottomposnew = bottomposplus + 'px'; 587 if (topmax < Math.abs(bottomposplus)) { 588 bottomposnew = -topmax + 'px'; 589 $(this).find('.down').addClass('inactiveArrow'); 590 } 591 592 e.preventDefault(); 593 $('.vertical_swatches').animate({ 594 'top': bottomposnew 595 }); 596 } 597}); 598 599 600// left/right scroll on bottom swatches under gallery image 601$('#gallerywrapper').on('click',".leftRight_arrows", function(e) { 602 if ($(this).find('.left').length !== 0) { 603 $('#gallerywrapper .leftRight_arrows .right').removeClass('inactiveArrow'); 604 var leftpos = $('#gallerywrapper .horizontal_swatches').css('left'); 605 var leftposplus = parseInt(leftpos) + 90; 606 var leftposnew = leftposplus + 'px'; 607 if (leftposplus > 0) { 608 leftposnew = '0px'; 609 $(this).find('.left').addClass('inactiveArrow'); 610 } 611 612 e.preventDefault(); 613 $('.horizontal_swatches').animate({ 614 'left': leftposnew 615 }); 616 } else { 617 $('#gallerywrapper .leftRight_arrows .left').removeClass('inactiveArrow'); 618 var scrollcontainer = parseInt($('#gallerywrapper .horizontal_scrollContainer').css('width'), 10); 619 var contentwidth = parseInt($('#gallerywrapper .horizontal_swatches').css('width'), 10); 620 var leftmax = contentwidth - scrollcontainer; 621 var leftpos = $('#gallerywrapper .horizontal_swatches').css('left'); 622 var leftposplus = parseInt(leftpos) - 90; 623 var leftposnew = leftposplus + 'px'; 624 if (leftmax < Math.abs(leftposplus)) { 625 leftposnew = -leftmax + 'px'; 626 $(this).find('.right').addClass('inactiveArrow'); 627 } 628 e.preventDefault(); 629 $('.horizontal_swatches').animate({ 630 'left': leftposnew 631 }); 632 } 633}); 634 635//scroll page down when anchor link when gallery 'More Colors Available' is clicked 636$("a[href='#goToProductColor']").click(function () { 637 scrollToSection($(this)); 638}); 639 640$("a[href='#pd_reviews']").click(function () { 641 scrollToSection($(this)); 642}); 643 644function scrollToSection(href) { 645 $('html, body').animate({ 646 scrollTop: $(href.attr('href')).offset().top 647 }, 500); 648 return false; 649} 650 651//Resize the S7 gallery image if the original width is greater than 295px so it doesn't break the page 652$.urlParam = function (name) { 653 var results = new RegExp('[&]' + name + '=([^&#]*)').exec($('.s7staticimage img').get(0).src); 654 if (results) { 655 return results[1] || 0; 656 } 657 return 0; 658} 659 660$(window).on('load resize', function () { 661 var cnt = 50000; 662 663 function init() { 664 if ($('.s7staticimage img').length > 0) { 665 if ($(".vertical_container").length > 0) { 666 var originalImageWidth = $.urlParam('wid'); 667 var originalImageHeight = $.urlParam('hei'); 668 //window width takes off 17px so this is actually > 949 && < 1070 669 if ((originalImageWidth > 295) && ($(window).width() > 932) && ($(window).width() < 1054)) { 670 var maxImageWidth = 295; 671 var newImageWidthPercentage = maxImageWidth / originalImageWidth; 672 var newImageWidth = originalImageWidth * newImageWidthPercentage; 673 var newImageHeight = originalImageHeight * newImageWidthPercentage; 674 $('.selected_photo, .s7flyoutzoomview, .s7staticimage, .s7staticimage img').width(newImageWidth);
675 $('.selected_photo, .s7flyoutzoomview, .s7staticimage, .s7staticimage img').height(newImageHeight); 676 } else if ($('.s7staticimage img').width() != originalImageWidth) { 677 $('.selected_photo, .s7flyoutzoomview, .s7staticimage, .s7staticimage img').width(originalImageWidth); 678 $('.selected_photo, .s7flyoutzoomview, .s7staticimage, .s7staticimage img').height(originalImageHeight); 679 } else if (($('#galleryholder').width() > originalImageWidth) && ($(window).width() > 932) && ($(window).width() < 1054)) { 680 $('#galleryholder').width(295); 681 } 682 } 683 } 684 else if (cnt > 0) { 685 cnt = cnt - 5; 686 setTimeout(init, 5); 687 } 688 else { 689 } 690 } 691 init(); 692}); 693//End Scripts for updated PD design 08/2017// 694 695//Scripts for Rich Content sections// 696var cnt = 50000; 697$(window).on('load resize', function () { 698 function init() { 699 if ($('.pd_richContent').length > 0) { 700 var img = document.getElementById('imgSize'); 701 var rev = document.getElementById('revSize'); 702 if (img != null) { 703 var imght = img.clientHeight; 704 $('.my-carousel').height(imght); 705 } 706 if (rev != null) { 707 var revght = rev.clientHeight; 708 $('.review-carousel').height(revght); 709 } 710 } else if (cnt > 0) { 711 cnt = cnt - 5; 712 setTimeout(init, 5); 713 } else { 714 } 715 } 716 init(); 717}); 718 719 720 721 function init() { 722 if ($("input[name='carousel']").length > 0) { 723 function autoSlider() { 724 var time = 4000; // Time in milliseconds. 725 var allInputs = $("input[name='carousel']"); 726 var i = 0; 727 loopSlider = setInterval(function() { 728 $('input[name="carousel"]').prop("checked", false); 729 $('#' + ((i % allInputs.length) + 1)).prop("checked", true); 730 i++; 731 }, time); 732 } 733 734 //$('.my-carousel').mouseenter(function() { 735 // clearInterval(loopSlider); 736 //}).mouseleave(function() { 737 // autoSlider(); 738 //}); 739 740 autoSlider(); 741 } else if (cnt > 0) { 742 cnt = cnt - 5; 743 setTimeout(init, 5); 744 } else { 745 } 746 } 747 748 init(); 749 750//End Scripts for Rich Content sections/ 751 752window.addEventListener('beforeunload', function () { 753 window.dataLayer.push({ 754 event: 'beforeunload', 755 "enteredStudio": window.enteredStudio 756 }); 757}); 758 759$(document).ready(function () { 760 761 if (typeof (loadControlHtml) == "function") { 762 // Recommendations Slider 763 loadControlHtml("RecommendationsSlider", "/", "pd_recommendations", null, { itemNumber, widget:"WIDGET1" }); 764 loadControlHtml("RecommendationsSlider", "/", "pd_recommendations2", null, { itemNumber, widget: "WIDGET2" }); 765 loadControlHtml("RecommendationsSlider", "/", "pd_recommendations3", null, { itemNumber, widget: "WIDGET3" }); 766 //product feature 767 //loadControlHtml("ProductFeature", "/", "pd_feature", showProp65Message, { itemNumber }); 768 //special charge 769 const imprintAreaCode = $('input[name$="hdnImprintAreaCode"]').val(); 770 loadControlHtml("ProductSpecialCharge", "/", "pd_charge", checkIsLast, { itemNumber, imprintAreaCode }); 771 //color swatch 772 if ($("#pd_colorSwatch").length > 0) { 773 loadControlHtml("ProductColorSwatch", "/", "pd_colorSwatch", null, { itemNumber, twinItemId }); 774 } 775 //product color 776 //loadControlHtml("ProductColor", "/", "pd_color", showMoreColor, { itemNumber, twinItemId }); 777 } 778 if (checkAPL === "True") { 779 var addDataLayer = setInterval(function () { 780 var writeReviewBtn = $(".acs_btn_write.rr-button.acs_js_write_review"); 781 if (writeReviewBtn.length > 0) { 782 writeReviewBtn.attr("onclick", "if (dataLayer) { dataLayer.push({ 'event': 'PDP_Write Review' }); }"); 783 clearInterval(addDataLayer); 784 } 785 }, 500); 786 } 787 788 //todoCheck 789 //loadbomOptions() 790 showMoreColor(); 791 var isFirst = true; 792 793 document.addEventListener('keydown', function (event) { 794 if (event.key === 'Tab' || event.keyCode === 9) { 795 if (isFirst) { 796 isFirst = false; 797 isPDP = true; 798 } 799 } 800 });
801 $('#addBtn').on('click', function () { 802 changeQuantity("add") 803 }); 804 805 $('#addBtn').on('keypress', function (e) { 806 if (e.which === 13 || e.keyCode === 13) { 807 changeQuantity("add") 808 } 809 }); 810 $('#subBtn').on('click', function () { 811 changeQuantity("sub") 812 }); 813 814 $('#subBtn').on('keypress', function (e) { 815 if (e.which === 13 || e.keyCode === 13) { 816 changeQuantity("sub") 817 } 818 }); 819 moveColorLimit(); 820}) 821function moveColorLimit() { 822 const imprintColorsLimit = $('.color-limit'); 823 if (imprintColorsLimit.length === 0) return; 824 825 const targetTitle = $('.details-view-title').filter(function () { 826 return $(this).text().trim() === 'Imprint Colors:'; 827 }).first(); 828 829 if (targetTitle.length === 0) return; 830 831 const parentDetailsView = targetTitle.closest('.details-view'); 832 833 if (!parentDetailsView.next().is(imprintColorsLimit)) { 834 imprintColorsLimit.insertAfter(parentDetailsView); 835 } 836} 837function checkIsLast() { 838 if (isDetailLast === "True") { 839 $("div[class=details-view]:last").css("border", "0"); 840 } 841} 842 843function changeQuantity(key) { 844 var id = "#" + txtQuantityClientID; 845 var txtQuantity = $(id) 846 var quantity = parseInt(txtQuantity.val()) || 0 847 if (key === "add") { 848 txtQuantity.val(quantity + 1) 849 } else if (key === "sub") { 850 if (quantity > 0 && quantity !== 1) { 851 txtQuantity.val(quantity - 1) 852 } else if (quantity === 1) { 853 txtQuantity.val("") 854 } 855 } 856} 857 858 859function showDesignServicePopup() { 860 window.dataLayer = window.dataLayer || []; 861 window.dataLayer.push({ 'event': 'PDP_Design_Service_Button' }); 862 863 $(".design_services_popup").dialog({ 864 modal: true, 865 width: 'auto', 866 height: 'auto', 867 draggable: false, 868 resizable: false, 869 dialogClass: "popupContainer", 870 zIndex: 200000, 871 position: { my: "center", at: "center", of: window } 872 }); 873} 874 875function closeDesignServicePopup() { 876 $(".design_services_popup").dialog("close"); 877} 878 879function showProp65Message() { 880 if (isFlaggedProp65 === "False") { 881 $(".prop65Message").hide(); 882 } 883} 884 885var setImageAltTag = function () { 886 $(".s7staticimage").children().attr('alt', imgAltTag); 887 $(".s7flyoutzoom").find("img").attr('alt', imgAltTag); 888 $("body").on("load", ".s7flyoutzoom img", function (event, showName) { 889 this.attr('alt', imgAltTag); 890 }); 891} 892 893function showMoreColor() { 894 $("#pd_color .details-view").each(function () { 895 const colorSwatches = $(this).find(".fd-color-swatches"); 896 const detailSwatches = $(this).find(".detail_swatch"); 897 const moreColor = $(this).find(".more_color"); 898 const maxSwatch = parseInt(colorSwatches.width() / 32) - 1; 899 if (detailSwatches.length > maxSwatch) { 900 moreColor.show(); 901 detailSwatches.slice(maxSwatch).hide(); 902 moreColor.click(function (e) { 903 e.preventDefault(); 904 if ($(this).hasClass("less")) { 905 $(this).removeClass("less"); 906 $(this).html("More"); 907 detailSwatches.slice(maxSwatch).hide(); 908 } else { 909 $(this).addClass("less"); 910 $(this).html("Less"); 911 detailSwatches.show(); 912 } 913 914 }); 915 }; 916 }) 917} 918 919 920function showSharePopup() { 921 $(".pd_secondary_media_popup").dialog({ 922 modal: true, 923 width: 'auto', 924 height: 'auto', 925 draggable: false, 926 resizable: false, 927 dialogClass: "popupContainer", 928 zIndex: 200000, 929 }); 930} 931function closeSharePopup() { 932 $(".pd_secondary_media_popup").dialog("close"); 933} 934var multiSelect = false; 935var bomColorOptions = []; 936function loadbomOptions(status, itemSku, zip, vendorId, returnUrl, refId, coupon, contactnumber, acctid, sessionId, scid, intcmp, rep, sample, quantityInCart, startingTotalPrice, aplToken, aplTokenTimeout, bomOptionsStr) { 937 if (window.promoStudio) { 938 $("#divBomOptions").css("margin-top", "20px")
939 var validationOff = sessionStorage.getItem('Test_Bom_Validation_Off'); 940 validationOff = (validationOff != null && validationOff.toLowerCase() === "true") && !(isNotStudio.toLowerCase() === 'true'); 941 window.promoStudio.bomOptions.renderWithFullData('divBomOptions', null, { 942 status: status, 943 itemSku: itemSku, 944 zip: zip, 945 vendorId: vendorId, 946 returnUrl: returnUrl, 947 refId: refId, 948 coupon: coupon, 949 contactnumber: contactnumber, 950 acctid: acctid, 951 sessionId: sessionId, 952 scid: scid, 953 intcmp: intcmp, 954 rep: rep, 955 sample: sample, 956 quantityInCart: quantityInCart, 957 startingTotalPrice: startingTotalPrice, 958 hasNoImprintOptions: isNotStudio, 959 bomOptionsValidationOff: validationOff 960 }, bomOptionsStr); 961 962 window.addEventListener( 963 window.promoStudio.bomOptions.bomOptionsSavingStartEvent, 964 function (e) { 965 }, 966 false 967 ); 968 969 window.addEventListener( 970 window.promoStudio.bomOptions.bomOptionsSavingCompletedEvent, 971 function (e) { 972 if (e.detail.target === 'preselect-bom') { 973 if (isNotStudio === "True") { 974 $.ajax({
975 type: "post", 976 dataType: 'json', 977 url: "/Services/UpsellsHandler.ashx", 978 data: { 979 cartId: e.detail.cartItemId, 980 }, 981 success: function (response) { 982 if (response.isUpsellsShow) { 983 parametersForUpsellsPop = response.upsellsItem; 984 ShowUpsellsPop(); 985 } else { 986 var random = Math.random(); 987 window.location = '/ConfiguratorCallback.axd?v=' + random; 988 } 989 }, 990 error: function (XMLHttpRequest, textStatus, errorThrown) { 991 console.error("Status: " + textStatus + "Error: " + errorThrown); 992 var random = Math.random(); 993 window.location = '/ConfiguratorCallback.axd?v=' + random; 994 } 995 }); 996 } else { 997 if (dataLayer) { 998 dataLayer.push({ 999 'event': 'studio_entry', 1000 'ecommerce': { 1001 'detail': { 1002 'products': [{ 1003 'id': itemNumber, 1004 'name': itemName, 1005 'category': categoryName, 1006 'metric1': '1' 1007 }] 1008 } 1009 } 1010 }); 1011 } 1012 storeMetricToSession(itemNumber, 1); 1013 window.location.href = PersonalizeItemLink; 1014 } 1015 1016 } else if (e.detail.target === 'design-later') { 1017 var random = Math.random(); 1018 window.location = '/ConfiguratorCallback.axd?v=' + random; 1019 } 1020 }, 1021 false 1022 ); 1023 1024 window.addEventListener( 1025 window.promoStudio.bomOptions.bomOptionsErrorEvent, 1026 function (e) { 1027 console.log(e); 1028 $(".pdqView").css("display", ""); 1029 $("#designDiv").css("display", ""); 1030 $("#divLoading").css("display", "none"); 1031 $("#pd_colorSwatch").css("display", ""); 1032 $("#divBomOptions").css("display", "none"); 1033 }, 1034 false 1035 ); 1036 1037 1038 if (isShowBomOptions === 'True') { 1039 if (showColorSwatch === 'True') { 1040 window.addEventListener( 1041 window.promoStudio.bomOptions.bomColorChangeEvent, 1042 function (e) { 1043 1044 var newMultiSelect = e.detail.isMultiSelect; 1045 var newOption = e.detail.option; 1046 1047 if (!!newOption) { 1048 if (newMultiSelect) { 1049 if (newOption.isSelected) { 1050 bomColorOptions.splice(bomColorOptions.length, 0, newOption); 1051 } else { 1052 if (multiSelect) { 1053 var index = bomColorOptions.findIndex((option) => option.codeValue === newOption.codeValue); 1054 if (index >= 0) { 1055 bomColorOptions.splice(index, 1); 1056 } 1057 } else { 1058 bomColorOptions = []; 1059 } 1060 } 1061 } else { 1062 bomColorOptions = newOption.isSelected ? [newOption] : []; 1063 } 1064 } 1065 multiSelect = newMultiSelect; 1066 1067 if (bomColorOptions.length > 0) { 1068 var option = bomColorOptions[bomColorOptions.length - 1]; 1069 displayColoredAsset(option.itemId, twinItemId, option.code, option.codeValue, option.description, '', 'h'); 1070 } else { 1071 var item = $(".swatch_first")
1072 if (ClickScene7ImgFunc === "selectVideo") { 1073 productDetailVideo.selectVideo(ClickScene7ImgName); 1074 Highlight(item, 'v'); 1075 } else if (ClickScene7ImgFunc === "selectSwatch") { 1076 s7zoomView.selectSwatch(ClickScene7ImgName); 1077 Highlight(item, 'v'); 1078 } 1079 } 1080 }, 1081 false 1082 ); 1083 } 1084 1085 window.addEventListener( 1086 window.promoStudio.bomOptions.bomOptionsValidationPassedEvent, 1087 function (e) { 1088 showDesignServicePopup(); 1089 //window.promoStudio.bomOptions.saveForDesignLater(); 1090 }, 1091 false 1092 ); 1093 } 1094 } 1095} 1096 1097function saveBomOptions() { 1098 if (window.promoStudio) { 1099 $(".design_services_popup_btn").css("display", "none"); 1100 $("#disableAddToCart").css("display", ""); 1101 window.promoStudio.bomOptions.saveForDesignLater(); 1102 } 1103} 1104 1105$(document).ready(function () { 1106 1107 const pricingSection = $(".pricing-section"); 1108 const staticEl = document.querySelector(".pdqView .add-to-cart"); 1109 if (staticEl && staticEl.offsetParent !== null) { 1110 pricingSection.insertBefore(staticEl); 1111 return; 1112 } 1113 const observer = new MutationObserver(() => { 1114 const dynamicEl = document.querySelector(".configurator-web-order-summary"); 1115 if (dynamicEl) { 1116 pricingSection.insertBefore(dynamicEl); 1117 observer.disconnect(); 1118 } 1119 }); 1120 observer.observe(document.body, { childList: true, subtree: true, attributes: false, characterData: false }); 1121}); 1122; 1123 1124(function ($) { 1125 var ms = { 1126 init:function(obj,args){ 1127 return (function(){ 1128 ms.fillHtml(obj,args); 1129 ms.bindEvent(obj,args); 1130 })(); 1131 }, 1132 //html 1133 fillHtml:function(obj,args){ 1134 return (function(){ 1135 obj.empty(); 1136 // 1137 if(args.current > 1){ 1138 obj.append('<a href="javascript:GoPage(' + (args.current - 1) + ');" class="pagination prevPage"> < </a>'); 1139 }else{ 1140 obj.append('<span class="pagination disabled"> < </span>'); 1141 } 1142 if(args.current !== 1 && args.current >= 3 && args.pageCount !== 3){ 1143 obj.append('<a href="javascript:GoPage(1);" class="pagination underline_page page_number">' + 1 + '</a>'); 1144 } 1145 if(args.current-1 > 2 && args.current <= args.pageCount && args.pageCount > 4){ 1146 obj.append('<span>...</span>'); 1147 } 1148 var start = args.current -1,end = args.current+1; 1149 if((start > 1 && args.current < 3)||args.current === 1){ 1150 end++; 1151 } 1152 if(args.current > args.pageCount-3 && args.current >= args.pageCount){ 1153 start--; 1154 } 1155 for (;start <= end; start++) { 1156 if(start <= args.pageCount && start >= 1){ 1157 if(start !== args.current){ 1158 obj.append('<a href="javascript:GoPage(' + start + ');" class="pagination underline_page page_number">' + start + '</a>'); 1159 }else{ 1160 obj.append('<span class="pagination active_pagination_page">' + start + '</span>'); 1161 } 1162 } 1163 } 1164 if(args.current + 2 < args.pageCount && args.current >= 1 && args.pageCount > 4){ 1165 obj.append('<span>...</span>'); 1166 } 1167 if(args.current !== args.pageCount && args.current < args.pageCount -1 && args.pageCount !== 3){ 1168 obj.append('<a href="javascript:GoPage(' + args.pageCount + ');" class="pagination underline_page page_number">' + args.pageCount + '</a>'); 1169 } 1170 //next page 1171 if(args.current < args.pageCount){ 1172 obj.append('<a href="javascript:GoPage(' + (args.current + 1) + ');" class="pagination nextPage"> > </a>'); 1173 }else{ 1174 obj.append('<span class="pagination disabled"> > </span>'); 1175 } 1176 })(); 1177 }, 1178 // 1179 bindEvent: function (obj, args) { 1180 return (function () { 1181 obj.on("click", "a.page_number", function () { 1182 var current = parseInt($(this).text()); 1183 ms.fillHtml(obj,{"current":current,"pageCount":args.pageCount}); 1184 if(typeof(args.backFn)=="function"){ 1185 args.backFn(current); 1186 } 1187 }); 1188 //prev page 1189 obj.on("click","a.prevPage",function(){ 1190 var current = parseInt(obj.children("span.active_pagination_page").text()); 1191 ms.fillHtml(obj,{"current":current-1,"pageCount":args.pageCount}); 1192 if(typeof(args.backFn)=="function"){ 1193 args.backFn(current-1); 1194 } 1195 }); 1196 //next page 1197 obj.on("click","a.nextPage",function(){ 1198 var current = parseInt(obj.children("span.active_pagination_page").text()); 1199 ms.fillHtml(obj,{"current":current+1,"pageCount":args.pageCount}); 1200 if(typeof(args.backFn)=="function"){ 1201 args.backFn(current+1); 1202 } 1203 }); 1204 })(); 1205 } 1206 } 1207 $.fn.createPage = function(options){ 1208 var args = $.extend({ 1209 pageCount : 10, 1210 current : 1, 1211 backFn : function(){} 1212 }, options); 1213 ms.init(this,args); 1214 } 1215})(jQuery); 1216;
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.