`;} else {this.dateStuff = ``;}if(this.heroText) {this.heroTextStuff = `
${this.heroText}
`;} else {this.heroTextStuff = ``;}if(this.showRebateButton) {this.rebateStuff = this.rebateButton;} else {this.rebateStuff = ``;}if(this.heroLink == ``) { this.heroStuff = ``;} else {this.heroStuff = ``;} this.doIt = function() { return `
`;}this.buildIt = function() {return this.doIt();}if(this.force) {return this.doIt();}};var promoDisclaimerLayout1 = function(stuff, περιεχόμενο = ``, force = true) {if(typeof stuff == 'object' && stuff != null) {this.newClasses = stuff.newClasses ? stuff.newClasses : ``;this.content = stuff.content ? stuff.content : ``;this.force = stuff.force ? stuff.force : true;} else {this.newClasses = stuff;this.content = content;this.force = force;}this.doIt = function() {return `
${this.content}
`;}this.buildIt = function() {return this.doIt();}if(force) {return this.doIt();}};var promoHeaderLayout1 = function(stuff, header2 = ``, header3 = `` , force = false) {if(typeof stuff == 'object' && stuff != null) {this.header1 = stuff.header1 ? stuff.header1 : ``;this.header2 = stuff.header2 ? stuff.header2 : ``;this.header3 = stuff.header3 ? stuff.header3 : ``;this.force = stuff.force ? stuff.force : true;} else {this.header1 = stuff;this.header2 = header2;this.header3 = header3;this.force = force;}this.doIt = function() {返回`
`;}this.buildIt = function() {return this.doIt();}if(force) {return this.doIt();}};var promoFooterLayout1 = function(stuff, footer2 = ``, footer3 = `` , force = false) {if(typeof stuff == 'object' && stuff != null) {this.footer1 = stuff.footer1 ? stuff.footer1 : ``;this.footer2 = stuff.footer2 ? stuff.footer2 : ``;this.footer3 = stuff.footer3 ? stuff.footer3 : ``;this.force = stuff.force ? stuff.force : true;} else {this.footer1 = stuff;this.footer2 = footer2;this.footer3 = footer3;this.force = force;}this.doIt = function() {返回`
`;}this.buildIt = function() {return this.doIt();}if(force) {return this.doIt();}};var promoSectionLayout1 = function(stuff, header2 = ``, header3 = `` , περιεχόμενο = ``, footer1 = ``, footer2 = ``, footer3 = ``, newClasses = ``, force = false) {if(typeof stuff == 'object' && stuff != null) {this.lock =东西.锁? stuff.lock : ``;this.header1 = stuff.header1 ? stuff.header1 : ``;this.header2 = stuff.header2 ? stuff.header2 : ``;this.header3 = stuff.header3 ? stuff.header3 : ``;this.content = stuff.content ? stuff.content : ``;this.footer1 = stuff.footer1 ? stuff.footer1 : ``;this.footer2 = stuff.footer2 ? stuff.footer2 : ``;this.footer3 = stuff.footer3 ? stuff.footer3 : ``;this.newClasses = stuff.newClasses ? stuff.newClasses : ``;this.force = stuff.force ? stuff.force : true;} else {this.header1 = stuff;this.header2 = header2;this.header3 = header3;this.content = content;this.footer1 = footer1;this.footer2 = footer2;this.footer3 = footer3 ;//以前没有被调用的新类this.newClasses = newClasses;this.force = force;}//default stuffthis.classes = `section-${this.newClasses.includes("no-count") == false ? promoSectionIndex++ :"0"} 行 ${this.lock ? "隐藏":""}`;if(typeof stuff == 'object' && stuff != null && stuff.contentContainer){this.contentContainer = function( επιστροφή stuff.contentContainer;}} else {this.contentContainer =函数(){返回`
${this.content}
`};}this.doIt = function() { return`
`;}this.buildIt = function() {return this.doIt();}if(this.force) {return this.doIt();}};var promoHeroSection = new promoHeroLayout1();var promoMainHero = function(bam =``){this.doIt = function() {return new promoHeroLayout1(bam).doIt();}return this.doIt();};var componentList = [];//gremlin 1function queryForJimCode(urlToGet, πράγμα) {return new Promise(function (resolve) {let request = new XMLHttpRequest();request.open('GET', `/promotions/assets/get-stuff/${urlToGet}?${thing}`);请求。 onload = function () {resolve(request.response);};request.send();});}异步函数 reallyGetStuff(typeOfStuff, data, identifier, extraData1="default", extraData2="default", extraData3=" default", extraData4="default", extraData5="default") {var showNegativeResults = false;delayLoad++;switch(typeOfStuff) {case "prod_loop" : var numberOfProducts = extraData1 == "προεπιλογή" ? "4":extraData1,buttonSuccessText = extraData2 =="默认"? "查看详细信息":extraData2;var αποτελέσματα = await queryForJimCode("prod_loop.&html", "$_ofnumberTuttss= =${ extraData2}&failButtonText=${extraData3}`);break;case "prod_loop_data ":var numberOfProducts = extraData1 =="默认"? "4":extraData1,buttonSuccessText = "extraData2" ”:extraData2 ;var results = await queryForJimCode("prod_loop_data.html", `${data}&number_of_products=${numberOfProducts}&successButtonText=${extraData2}&failButtonText=${extraData3}` "breakle extraData3}`); =="默认"; "查看详细信息":extraData1,buttonFailText = extraData2 =="默认"? "联系我们":extraData2;query"For results",$decovar"{101} ta}&successButtonText =${buttonSuccessText}&failButtonText=${buttonFailText}`);break;περίπτωση "single_prod_data" : var αποτελέσματα = await queryForJimCode("single_prod_data.html", `prodkey=${data}`);results(results=JSONspar. );break;case "shop_all_button" : var buttonSuccessText = extraData1 == "προεπιλογή" ? “全部购买”:extraData1,buttonFailText = extraData2 ==“默认”? “联raata糳; var αποτελέσματα = αναμένω queryForJimCode("shop_all_button.html", `${data}&successButtonText=${buttonSuccessText}&failButtonText=${buttonFailText}`);break;περίπτωση "shop_all_link" : var results = await queryForJim_allCode",{$_html" data}`);break;case "shop_all_link_update" : var results = "";var newLink = await queryForJimCode("shop_all_link.html", `${data} `);$(extraData1).attr("href", newLink );if(newLink.includes("locations.html")) {$(extraData1).addClass("no-results");} else {$( extraData1).addClass("has-results");}break; case "rebate_button" : var buttonSuccessText = extraData1 == "προεπιλογή" ? “下载回扣”:extraData1;var results = await queryForJimCode("rebate_button.html", `rebate_form_number=${data}&successButtonText=${button:SuccessText}`);break;περίπτωση "rebatery"ForJimCode" .html", `rebate_form_number=${data}`);break;case "brand_logo" : var results = await queryForJimCode("brand_logo.html", `brand=${data}`);break;case "svg_logo" : var results = await queryForJimCode("brand_logo.html", `brand=${data}`);break;default:var results = `"${typeOfStuff}" 不被识别为“getStuff”参数。`;διάλειμμα; }if(typeOfStuff == "rebate_link" || typeOfStuff == "shop_all_link" || typeOfStuff == "single_prod_data") {window[extraData1] = results;isVarSet[extraData1] = true;} other if(!(results.include) "无结果") || showNegativeResults) {$(`placeholderFor${typeOfStuff}[data-placeholder-ref='${identifier}']`).replaceWith(results);} other {$(`placeholderFor${ typeOfStuff [data-placeholder-ref='${identifier}']`).attr("data-placeholder-results", "fail");}delayLoad--;}function gremlin(typeOfStuff, data, extraData1="默认”, extraData2="默认", extraData3="默认", extraData4="默认", extraData5="默认") {let identifier = Math.random();let results = `
`;switch(typeOfStuff) {case "prod_loop" : if(effectiveDate != "") {data +="&" + effectDate;}reallyGetStuff(typeOfStuff, data, identifier, extraData1, extraData2, extraData3);break;case " prod_loop_data": if(effectiveDate != "") {data +="&" + effectDate;} results = reallyGetStuff(typeOfStuff, data, identifier, extraData1, extraData2, extraData3);break;case "single_prod" : if(Array. isArray(数据) || (τύπος δεδομένων == 'string' && data.includes("|")) {if(typeof data == 'string' || Array.isArray(data)) {if(data.includes ("|")) {data = data.split("|");}}var i = 0;while (i < data.length) {reallyGetStuff(typeOfStuff, data[i], identifier, extraData1, extraData2, extraData3 );i++;if(i < data.length) {identifier = Math.random();results += `
`;}}} else {reallyGetStuff(typeOfStuff, data, identifier, extraData1, extraData2, extraData3);}break;case "single_prod_data" : results = "";reallyGetStuff(typeOfStuff, data, identifier, extraData1,D); } break;case "shop_all_button" : if(effectiveDate != "") {data +="&" + effectDate;}reallyGetStuff(typeOfStuff, data, identifier, extraData1, extraData2);break;case "shop_all_link" : "结= " ;if(effectiveDate != "") {data +="&" + effectDate;}reallyGetStuff(typeOfStuff, data, identifier, extraData1, extraData2);break;case "shop_all_link_update" : results = "";if(effectiveDate ! = "") {data +="&" + effectDate;}reallyGetStuff(typeOfStuff, data, identifier, extraData1);break;case "rebate_button" : if(Array.isArray(data) || (typeof data == 'string ' && data.includes("|"))) {if(typeof data == 'string' || Array.isArray(data)) {if(data.includes("|")) {data = data.split( " |");}}var i = 0;while (i < data.length) {if(effectiveDate != "") {data[i] +="&" + effectDate;}reallyGetStuff(typeOfStuff, data[i ] , αναγνωριστικό, extraData1, extraData2, extraData3);i++;//即使我们遍历回扣列表,我们也不必添加更多我添加更多按遍历回扣列表,我们也不必添加更多我添加更多我同一回扣有多个回扣按钮。相反,它会显示第一个返回的。}} else {if(effectiveDate != "") {data +="&" + effectDate;}reallyGetStuff(typeOfStuff, data, identifier, extraData1, extraData2, extraData3);} break;case "rebate_link" : if (extraData1=="προεπιλογή") {console.warn(`gremlin 代码 'rebate_link' 有两个参数。1. Κωδικοί εκπτώσεων 2.包含结果的变量名收到结果后,您将需要自己插入结果。尝试使用延远加后做一些事情。例如://以下是页面上的加载或更高版本 daNewLink = '';gremlin ('rebate_link', 'rebateCodes', 'daNewLink');//下面是关于延迟加载的...1.创建一个变量。2.如果匹面是关于延迟加载的...1.创建一个变量。2.如果匹饢是关于延迟加载的...设置变量后,将锚链接地址更改为新变量值`);} else {window[extraData1] = "/locations.html";isVarSet[extraData1] = false;if(Array.isArray(data) || (τύπος δεδομένων == 'string' && data .includes("|")) {if(typeof data == 'string' || Array.isArray(data)) {if(data.includes("|")) {data = data.split("|" );}}var i = 0;while (i < data.length) {if(effectiveDate != "") {data[i] +="&" + effectDate;} reallyGetStuff(typeOfStuff, data[i], αναγνωριστικό , extraData1, extraData2, extraData3);i++;}} else {if(effectiveDate != "") {data +="&" + effectDate;}reallyGetStuff(typeOfStuff, 数据, 标识符, extraData1, extraData3); results = "";}break;case "brand_logo" : reallyGetStuff(typeOfStuff, data, identifier);break;case "svg_logo" : reallyGetStuff(typeOfStuff, data, identifier);break;default :results = `f"$tuff} " 未被识别为"gremlin"参数。`;διάλειμμα;}επιστροφή αποτελεσμάτων;}//promo carouselcomponentList.push("promoCarousel");componentList.push("promoCarousel2"); var promoCarouselHelp = `promoCarouselHelp`;var promoCarousel2Help = `promoCarousel2Help`;var carouselProdWrap= (insertHere)=> {var results = `
`;return results?};var carouselContent= (insertHere)=> {var results = "";$.each(insertHere, function(index, value) {results+= `${carouselProdWrap(value)}`;}); return results;};var promoCarousel= (insertHere)=> {var results=`
`return results;};var promoCarousel2= (codes)=> {var insertHere = ``;codes.forEach(function(value, index) {if(value == "" || value == null) {return;} if(Array.isArray(value)) {switch(value[0].toLowerCase()) {case "custom":insertHere += carouselProdWrap(value[1]);break;}} else {insertHere += carouselProdWrap(gremlin (`single_prod`, τιμή));}})var 结果=`
`return results;};//Get Stuff 1function getStuff(typeOfStuff, data, extraData1="none", extraData2="none", extraData3="none", extraData4="none", extraData5="none") {返回 gremlin (typeOfStuff, data, extraData1="none", extraData2="none", extraData3="none", extraData4="none", extraData5="none");}//图库1componentList.push("slideItGallery1"); var slideItGallery1Help = `slideItGallery1Help`;var slideItGallery1AutoNavActive = true;var slideItGallery1 = συνάρτηση(imageArray, λέξεις = "κενό", επιλογές = "κενό") {varoptionsDefaultNav0:True:Time:Προεπιλογή: {autoNaut: true,bottomNav: false};if(options == "κενό") {options = {autoNav: optionsDefault.autoNav,autoNavTime: optionsDefault.autoNavTime,sideButtons: optionsDefault.sideButtons,bottomNav:OptionsDefault.bottomNav(OhavTime.};) autoNav')) {options.autoNav = optionsDefault.autoNav;}if(!options.hasOwnProperty('autoNavTime')) {options.autoNavTime = optionsDefault.autoNavTime;}if(!options.has(')OwnProperty's .sideButtons = optionsDefault.sideButtons;}if(!options.hasOwnProperty('bottomNav')) {options.bottomNav = optionsDefault.bottomNav;}var αποτέλεσμα = `
`;if(options.sideButtons || typeof options.sideButtons == 'undefined') {result = result + `
<>
`;}$.each(imageArray, function(index, imageSrc) {if(words != "empty" && type of words[index] != 'undefined' && words[index] != "") {var wordStuff = `
`;} else {var wordStuff = "";}result = result + `
`;}); result = result + `
`;var slideCount = imageArray.length;var slideDots = ``;while(slideCount > 0) {slideDots = `${slideDots}`;slideCount--;}result = result + `${slideDots}
`;}result = result + ``;return αποτέλεσμα;};function slideGallery1ChangeSlide(galleryContainerElem, κατεύθυνση) {var newFirst = "";if(direction == "prev") {var elems = $(galleryContainerElem).find("figure");newFirst = elems[ elems.length-1];$(galleryContainerElem).children("div").eq(0).prepend($(elems[elems.length-1]));$(elems).css("左", "-100%");$(elems).animate({"left" : "0%"});} else if(direction == "next") {var elems = $(galleryContainerElem).find("图");newFirst = elems[1];$(elems).animate({"left" : "-100%"}, {complete : function() {$(galleryContainerElem).children("div").eq( 0).append($(elems[0]));$(elems).css("left", "0%");}});}if($(galleryContainerElem).find("[数据幻灯片-dot]").length > 0) {$(galleryContainerElem).find("[data-slide-dot]").removeClass("chosen");$(galleryContainerElem).find("[data-slide-dot] ] ='" + $(newFirst).children("img").eq(0).attr("数据幻灯片编号") + "']").addClass("επιλεγμένο");}}συνάρτηση slideGallery1Button( clickedElem) {var galleryContainerElem = $(clickedElem).closest(".slide-it-yo");slideGallery1ChangeSlide(galleryContainerElem, $(clickedElem).attr("data-slide-it-button"));setTimeout(凕); ) {let currentSlide = ()=> {return $(clickedElem).parentsUntil("section").find("figure").eq(0).attr("data-slide-it-slide");}; $(clickedElem).parentsUntil("section").attr("data-current-slide", currentSlide());}, 500);}var getCurrentSlide1Number = function(galleryContainerElem) {返回 $(galleryContainerElem).find("图").eq(0).children("img").data("slideNumber");};συνάρτηση slideGallery1GoToSlide(clickedElem, slideNumber = 0) {var galleryContainerElem = $(clickedElem).li-closest(s". -哟");var currentSlideShowing = $(galleryContainerElem).find("figure").eq(0).children("img").data("slideNumber");if(currentSlideShowing != slideNumber) {$(galleryContainerElem ).children("div").eq(0).append($(galleryContainerElem).children("div").eq(0).children("figure").eq(0));slideGallery1GoToSlide(clickedElem, slideNumber);}}συνάρτηση slideGallery1GoToSlideDirectly(daElem, slideNumber = 0) {var galleryContainerElem = $(daElem);var currentSlideShowing = $(galleryContainerElem).find("图)chi"ld"). data("slideNumber");if(currentSlideShowing != slideNumber) {$(galleryContainerElem).children("div").eq(0).append($(galleryContainerElem).children("div").eq(0) .children("figure").eq(0));slideGallery1GoToSlideDirectly(galleryContainerElem, slideNumber);return;}setTimeout(function() {let currentSlide = ()=> {return $(daElem).find("figure") .eq(0).attr("data-slide-it-slide");};$(daElem).attr("data-current-slide", currentSlide());$(galleryContainerElem).find("[数据幻灯片点]").each(function() {$(this).removeClass("chosen");});$(galleryContainerElem).find(`[data-slide-dot="${slideNumber} " ]`).addClass("chosen");}, 500);}function slideGallery1DotClick(clickedElem) {$(clickedElem).parent().find(".chosen").removeClass("chosen");$( clickedElem ).addClass("chosen");slideGallery1GoToSlide($(clickedElem), $(clickedElem).attr("data-slide-dot"));}function slideGallery1Functions() {$(".slide-it-yo . data -slide-it-button-box > *").on('click', function() {slideGallery1Button($(this));});$(".slide-it-yo .data-slide-it - nav-box > *").on('click', function() {slideGallery1DotClick($(this));});$(".slide-it-yo .data-slide-it-nav-box > * ").eq(0).addClass("επιλεγμένα");$(".slide-it-yo").each(function() {slideItGalleryAutoNav($(this));slideItHoverClass($(this)); });}συνάρτηση slideItHoverClass(elem) {$(elem).hover(function() {$(this).addClass("user-hover");}, function() {$(this).removeClass("用户-hover");});}συνάρτηση slideItGalleryAutoNav(elem) {currentSlideElemTime = $(elem).data("change-time");//我们必须检查字符串是否为曜,它不值得转换回 booleanif($(elem).attr("data-auto-change").toLowerCase() == "true") {setTimeout(function() {if(slideItGallery1AutoNavActive && !$(elem). user-hover")) {//检查选项卡是否可见(elem).find("figure").eq(0).attr("data-slide-it-slide");};$(elem). attr("data-current-slide", currentSlide()) 复制代码;}, 500);}}slideItGalleryAutoNav(elem);}, currentSlideElemTime);}}//Tabby 1componentList.pushby("Tabby"SpawnT); = `spawnTabbyMenuHelp`;/* -- tabby 部分 -- */var jsTabbyProdSetUp = (daQuery)=>{返回`
${gremlin("shop_all_button", daQuery)}${gremlin("prod_loop", daQuery)}
`;};var spawnTabbyButtons = function(prodSet) {let result = ``;$.each(prodSet, function(index, value) {if(index != "shopAll" && !value.prodSection.includes("no-结果")) {结果 += `${value.prodType}`}}); return result? }var tabbyContentTemplate1 = ( info ) => `
${info.prodType}
${info.shopAll}
${info.prodStuff}
`;var tabbyContentTemplate2 = (info) => `
${info.prodType}
${info.title}${info.description}${info.shopAll}
${info.prodStuff}
`;var spawnTabbyContent = function(prodSet) {let result = ``;$.each(prodSet, function(index, value) {if(index != "shopAll" && !value.prodSection.includes("no-results" )) {result += `${value.prodSection}`result=result.replace(`
`,`
${value.prodType}
`);}});返回结果;};var spawnTabbyContent2 = function(prodSet, tabbyType) {let result = ``;$.each(prodSet, function(index, value) {if(index != "shopAll" && !value.prodSection.includes("no-results")) {var tabType = (value.hasOwnProperty("tabType") ? value.tabType : tabbyType);if (tabType == 1 || tabType == 3) {result += tabbyContentTemplate1({prodType : value.prodType,prodStuff : value.prodSection,shopAll : value.shopAll});} αλλιώς εάν (tabType == 2) {result += tabbyContentTemplate2({title : value.description. .description,prodType: value.prodType,prodStuff: value.prodSection,menuImage: value.menuImage,shopAll: value.shopAll});}}});return αποτέλεσμα;};var spawnTabbyMenu = function(categories) {let result = `
${spawnTabbyButtons(class)}
${spawnTabbyContent(category)}`;return result;};var spawnTabbyMenu2 = function(categories, tabbyType = 1) {let classEdit = ` `;if(tabbyType == 2) {classEdit = `side-by-side-tabs`;} else if(tabbyType == 3) {classEdit = `center-tabs`;} let result = `
${spawnTabbyButtons(class)}
${spawnTabbyContent2(category, tabbyType)}`;return result?};var gremlinTabs = function(categories) {let result = `
${spawnTabbyButtons(class)}
${spawnTabbyContent(category)}`;return result?};/* -- end tabby part -- *///Youtube Video 1componentList.push("youtubeVideo"); var youtubeVideoHelp = `youtubeVideoHelp`; var youtubeVideo = function(vidSrc, size = [560, 315]){ return`
`;}; //ListIt 1componentList.push("listIt");var listItHelp = `listItHelp`;var listIt = συνάρτηση(listItems) {let result = `
- `;$.each(listItems, function(index, listItem) {result += `
- ${listItem} `;}); result += `
`;επιστρέφει το αποτέλεσμα;};//productSideScroller 1componentList.push("productSideScroller");var productSideScrollerHelp = `productSideScrollerHelp`;/* -- productSideScroller 部分 -- */var productSideScroller {var result(ds") //if == κενό remove$.each(prods, function(key, val) {if(val != "blank") {result+=val;}});result = `
${result}
`;return αποτέλεσμα;};/* -- end productSideScroller part -- *///sideBySideHtml 1componentList.push("sideBySideHtml");var sideBySideHtmlHelp= `side-by-side`;function sideBySideHtml(daImg=" ", title =" ", content=" ", sideNote=" ", postContent=" ", postNote=" ", reverse=false) { // print bvar newTitle = (title == " " ? " " : `${title}`);//print pvar newContent = (content == " " ? " " : `
${content}
`);//print ivar newSideNote = (sideNote == " " ? " " : `${side note}`);// print img tagvar newDaImg = (daImg == " " ? " " : `
`); // if i is empty // change i no result tagvar = `
${newTitle}${newContent}${postContent}${newSideNote}${postNote}
${newDaImg}
`;return result;}function sideBySideHtml2(daImg=" ", title=" ", content=" ", sideNote=" ", postContent=" ", postNote=" ", reverse=false) { //print text for bvar newTitle = (Title == ""?"":`${title}`);//print pvar newContent = (content == " " ? " " : `
${content}
`);//print ivar newSideNote = (sideNote == " " ? " " : `${side note}`);// print img tagvar newDaImg = (daImg == " " ? " " : `
`); // if i is empty // change i no result tagvar = `
${newTitle}${newContent}${newSideNote}${postContent}${postNote}
${newDaImg}
`;return result;}//call function function sideBySideHtmlLoop(stuff=[]) {var result = ` `;//traverse collection$.each(stuff, function() {//call function return htmlresult += sideBySideHtml(this [0], this[1], this[2], this[3], this[4], this[5]);});//return html return the result?}//Call function function sideBySideHtmlLoop2(stuff = [ ]) {var result = ` `;//Traverse collection$.each(stuff, function() { //Call the function to return the data in htmlresult += sideBySideHtml2(this[0], this[1] , this [2] , this[3], this[4], this[5]);});//return htmlreturn result?}//category builder 1var catBuilder = (category,imgPath,link,style=1, classes= "" ) => { let result =`
":"")}${(style > 2 ?"
`;return αποτέλεσμα;};var categoryBuilder = (category, imgPath, link, style=1) => {return catBuilder(category, imgPath, link, style);}; ψος , srcLocation, words1 = "", words2 = "", words3 = "", alignment = "left", wordBlock = "left" ) => { width = width - 2 ; height = height - 2 ; alignment = alignment.toLowerCase(); if(alignment == "alignment") { alignment = "alignment-alignment"; } else if ( alignment == " right " ) { alignment = " words - right " ; } else if(alignment == "center") { alignment = "words-center"; } Definition`
`;};var textOverlayImage2 = (width, height, srcLocation, words1 = "", words2 = "", words3 = "", alignment = "left", wordBlock = "left" ) => { if(!Array.isArray (srcLocation)) {width = width-2;height = height-2;} else {width[0] -= 2;width[1] -= 2;height[0] -= 2;height[1] -= 2;} alignment = alignment.toLowerCase(); if(alignment == "left") { alignment = "words-left"; } else if(alignment == "right") { alignment = "words-right"; } else if(alignment == "center") { alignment = "words-center"; } return`
${words1 ?`${words1}`:``}${words2 ?`${words2}`:``}${words3 ?`${words3}`:``}
`;};//Info drawer var buildDrawer = (info) => {return `
`;};var infoDrawers = (stuff) => {var result = ``;for(thing of stuff) {result+=buildDrawer(thing);}return result;};try {//put experiments here} catch(e ) { // Get errors here console.log(e); } var showComponentList = function() { var result = `
`;$.each(componentList, function(index, value) { result = result + `${value}
`;}); result = result + `
`;return result;};$(document).ready(function() {slideGallery1Functions();});// -- Create page variables here -- //// - rebatesvar promoRebate1 = `AVB_BOSCH_KPR2|MEGA_BOSCH_KPR2|NATIONCHKPR_2 | NECO_BOSCH_KPR2|INDP_BOSCH_KPR2`;var promoRebate2 = `daFail`;var promoRebate3 = `daFail`;// - queriesvar promoQuery1 = `key=TRAG:1DFL42LLA`;var promoQuery2 = `5var promoQuery2 = `key=TRAG:1DFL42LLA`; GSSMWW ` ;var promoQuery4 = `ge:GFW450SPMDG`; /* Use this to redefine variables in the inheritance page above */// - Variables to be set after the above aspect redefines them var promoRebateAll = setIfBlank(promoRebateAll, `$ { promoRebate1}|${promoRebate2}|${ promoRebate3}`); // -- create page stuff here -- //var hoverStuff = (allOfThem) => { var results = `
`;返回结果;};var imageList = [`${promoUrl}/images/slide_1.png`,`${promoUrl}/images/slide_2.png`,`${promoUrl}/images/slide_3.png`, `${promoUrl}/images/slide_4.png`,`${promoUrl}/images/slide_5.png`];var slideWords = [];var slideOptions = {autoNav: true,autoNavTime: 5000,sideButtomNav true: : false};var drawerCount = 0;var buildDrawer = (πληροφορίες) => {drawerCount++;return `
`;};var promoPopupBox = function(title, subtitle, imageSrc, dimensions) {let results = `
`;return result;};var promoSection1 = promoSectionLayout1({contentContainer : `
${gremlin("prod_loop", promoQuery1)}

flat rockChange game featuresFor every dish and every meal, Flatrock™It makes it easy to control advanced and deeper flavors.
`});var promoSection2 = promoSectionLayout1({contentContainer : `
${slideItGallery1(imageList, slideWords, slideOptions)}
`});var promoSection3 = promoSectionLayout1({contentContainer : `
FLATROCK pushes the boundaries of flat top grillingThe Flatrock Flat Top Grill opens up a whole new world to frying, grilling, steaming, sautéing and more, and delivers the innovative features and premium quality you've come to expect from Traeger. Flatrock's versatility will fire up any meal, giving you superior, fuller flavor and making cooking fun.
feature${listIt([`3 U-Burners`,`Inset Carbon Steel Stove`,`P.A.L. Pop-up Lock™Accessory rail, `EZ-Clean™Grease & Ash Keg», «Flamelock™Structure', 'Flame Sensor', 'Fuel Sensor', 'Two Folding Side Shelves 17', 'Premium Cover', '4 Casters']}
`});var promoSection4 = promoSectionLayout1({content : `${hoverStuff([[`/promotions/Traeger/2023/03-flatrock/images/hover_thing_1.png`,`Any dish, any meal`,`From sausages to grilling steaks, the Flatrock can last from your first meal to your last.`],[`/promotions/Traeger/2023/03-flatrock/images/hover_thing_2.png`,`Super tasty, fuller flavor` , `With Flatrock heat where it needs to be and multiple cooking zones, you can easily sear and sauté to a delicious finish.`],[`/promotions/Traeger/ 2023/03-flatrock/images/hover_thing_3.png`, `` Taste brings fun`, `Let your inner chef shine through active cooking experiences that make every meal delicious.`]])}` });var promoSection5 = promoSectionLayout1({content: `
Hiraiwa
feature
${infoDrawers([[`Simultaneous Cooking', `Three separate cooking zones let you cook at different temperatures simultaneously with TruZone™ total temperature control. Heat shield – separates each cooking zone for truly independent temperature control.`], [`STILL COOKING EVERYWHERE`, `Consistent heat is delivered over the entire grill surface so you can use every inch of space. Triple U-Shaped Burner Design - 2x more burner to hearth coverage compared to a standard patio grill.
`], [`Heat Lock, Air Block`, `FlameLock™The construction keeps heat where it should be for more consistent cooks using propane while using 28% less than standard cookware.
`], [`Never run out of fuel by accident`, `Fuel Gauge – Lets you know how much gas is in the tank.
`], [`Make it your own - endless customization`, `Use P.A.L. to set up your grill the way that works best for you. Pop-and-Lock™ accessory.
`]])}
`});var promoSection6 = promoSectionLayout1({newClasses:`daVidModal`,内容:`${youtubeVideo("https://www.youtube.com/embed/H5R7zkuFDl4", [560, 315])}
`});var promoSection7 = promoSectionLayout1({内容:`
`});var promoDisclaimerSection = promoDisclaimerLayout1(`boxed-container`, `Some Disclaimer Text`);/*Put all section functions below in the appender to appear on the page. You can also write pure html code and jim * //* If you need to redefine a js variable, use this aspect when inheriting. For example: if you need to change all the information in promoSection2, it would make more sense to redefine it here. JS will write again. You can also add more modules through it. */$(".section-container").append(`
${promoMainHero()}
${promoSection1}
${promoSection2}
${promoSection3}
${promoSection4}
${promoSection5}
${promoSection6}
${promoSection7}
Contact us for more details on this offer!
Call now!
`);
');});}if(giveReturnValue) {退货回扣;}}}συνάρτηση fixSvgs() {$("svg *").each(function() {var g = this,transform = getComputedStyle(g).getPropertyValue ('transform');if(typeof transform != 'undefined' && transform != 'none' && transform != null) { g.setAttribute('transform', transform);}});$("svg.fix -spacing").each(function() {var vB = $(this).get(0).getAttribute("viewBox").split(" ");var width = $(this).width();var ύψος = $(this).height();var newWidth = $(this).parent().width();var newHeight = vB[3] / vB[2] * width;$(this).width(newWidth );$(this).height(newHeight);$(this).attr("宽度", newWidth);$(this).attr("高度", newHeight);$(this).css("位置" , "相对");var newSVG = $(this).clone();$(this).replaceWith(newSVG);});}συνάρτηση updateShopAllButtonText() {$("[data-change-text]").每个(函数(){var shopButton = $(this).find(".shop-all-button"),newShopButtonText = $(this).attr("data-change-text");if(!shopButton. hasClass ("χωρίς αποτελέσματα")) {shopButton.html(newShopButtonText);$(this).css({"opacity" : 1});}});}function updateShopAllClasses() {$("[data-shop - classes]").each(function() {var shopButton = $(this).find(".shop-all-button"),newShopButtonClasses = $(this).attr("data-shop-classes");控制台.log(newShopButtonClasses);$(shopButton).addClass(newShopButtonClasses);});}函数 fixFrame() {$("#page-content-wrap iframe").each(function() {$(this) .css ({"ύψος" : $(this).first("svg").height});$(this).attr("width", $(this).parent().width()).attr (" height", $(this).parent().height());});}συνάρτηση shopAllTextAddOn() {$(".shop-all-button").each(函数() {$(this) .attr ("data-more-text", $(this).parent().attr("data-more-text"));});}συνάρτηση negativeImageHeightFix() {$("img").each( function( ) {if($(this).attr("src").indexOf("ύψος=-1") > -1) {$(this).attr("src", $(this).attr( "src ").split("height=-1")[0] + "&height=" + $(this).attr("src").split("height=-1")[0].substring( $( this).attr("src").split("ύψος=-1")[0].lastIndexOf("&width=") + 1, $(this).attr("src").split(" height= -1")[0].lastIndexOf("&")) + $(this).attr("src").split("height=-1")[1]);}});}συνάρτηση promoBurst( elem, text1="blank", text2="blank", text3="blank", burst=1, text4="blank") {if(text3 == "") { text3 = "空白"; }if(text2 == "") { text2 = "空白"; }var uniqueSelector = "rand-int-" + Math.floor((Math.random() * 9999) + 1);if(burst == 7) {var burst = `
`;} $(elem).append(burst);}function addBurstRibbon(bam, words1) {$.each(bam, function(index, value) {$(bam[index]).append(`
${words1}
`);});}function addMultiBurst(bam, words1="blank", words2="blank", words3="blank", burstType=2, words4="blank") {$.each(bam, function(index, value) {promoBurst(bam[index], words1, words2, words3, burstType, words4);});}//counts the elements on the page in respect to their parentsfunction elemCounter(elem, elemType) { if(!$(elem).is('[class*="' + elemType + '-"]') && !$(elem).is('[class*="hero-section"]') && !$(elem).is('[class*="disclaimer-section"]')){$(elem).addClass(`${elemType}-${$(elem).prevAll(elemType).length}`); }}function replaceTextBasedOnShopAllResultsForAllChosenElems() {$("[data-if-available-text]").each(function() {if($(this).hasClass("results")) {$(this).html($(this).attr("data-if-available-text"));}});$("[data-if-not-available-text]").each(function() {if($(this).hasClass("no-results")) {$(this).html($(this).attr("data-if-not-available-text"));}});}/* -- Scrollbar Junk-note for dev-I did NOT set up every scenario with height/vertical-scrolling and did NOT finish the set up for multiple scrollbars OR multiple scrolling areas based on single barsHOWEVER...MOST of the ground-work has been done and will only need to be finishedBlame this on high-priority work...-- */function sideScrollerButtonClick(elem) {if($(elem).attr("data-scroll-button") == "left") {console.log("left");} else {console.log("right");}}//return the scrollable areafunction getScrollingAreaFullDimensions(elem) {var fullHeight = 0,fullWidth = 0,lastKid = $(elem).children().last(); //last child in row//get the space from the edge of the screenfullWidth+=$(lastKid).get(0).offsetLeft;//get the width of the last objectfullWidth+=$(lastKid).width();//add the padding...fullWidth+=$(lastKid).css("padding-left").split("px")[0]*1;fullWidth+=$(lastKid).css("padding-right").split("px")[0]*1;//and the margin...fullWidth+=$(lastKid).css("margin-left").split("px")[0]*1;fullWidth+=$(lastKid).css("margin-right").split("px")[0]*1;//repeat for the heightfullHeight+=$(lastKid).get(0).offsetTop;fullHeight+=$(lastKid).height();fullHeight+=$(lastKid).css("padding-top").split("px")[0]*1;fullHeight+=$(lastKid).css("padding-bottom").split("px")[0]*1;fullHeight+=$(lastKid).css("margin-top").split("px")[0]*1;fullHeight+=$(lastKid).css("margin-bottom").split("px")[0]*1;//payload, baby...return [fullWidth, fullHeight];}//the goal here is to hide the scrollbar if it is unneeded - like the width does not exceed screen-sizefunction checkToHideScrollBar(elem) {//because there might be multiple scrolling things, we need to scroll through each$(elem).parents("section").eq(0).children("[data-scroll-target]").each(function() {//get the dimensions of this thing based on the last child position and widthvar dimensions = getScrollingAreaFullDimensions($(this));var fullHeight = dimensions[1],fullWidth = dimensions[0];//if the content is smaller than or equal to its container, hide the scrollbarif(fullWidth <= $(this).width() + 4) { //I added an extra 4 pixels because I noticed a flickering effect - band-aid solution :(//change it to its origin postion(almost like a refresh)$(this).css({"top":"0px","left":"0px"});//hide the scrollbar$(elem).css("display", "none");//if content is larger than its container} else {//unhide the scrollbar$(elem).css("display", "");}});}//this is the function for when someone clicks or touches the scrollbar without touching the scroller(scroll handle)function scrollerToClick(elem, point, scrollX=true, scrollY=true) {//get the point of contactvar scrollerSpotY = (scrollY ? point[1] : $(elem).css("top")) - $(elem).find("scroller").eq(0).height();var scrollerSpotX = (scrollX ? point[0] : $(elem).css("left")) - $(elem).find("scroller").eq(0).width();$(elem).find("scroller").animate({"top" : (scrollerSpotY > 0 ? scrollerSpotY : 0) + "px","left" : (scrollerSpotX > 0 ? scrollerSpotX : 0) + "px"}, 400);$(elem).parent().children("[data-scroll-target]").each(function() {//get the dimensions of this thing based on the last child position and widthvar dimensions = getScrollingAreaFullDimensions($(this));var fullHeight = dimensions[1],fullWidth = dimensions[0];var percentOfScrollX = point[0] / $(elem).width();var percentOfScrollY = point[1] / $(elem).height();fullHeight = fullHeight - $(this).height();fullWidth = fullWidth - $(this).width();$(this).animate({"top" : (scrollY ? percentOfScrollY * fullHeight * -1 + "px" : $(this).css("top")),"left" : (scrollX ? percentOfScrollX * fullWidth * -1 + "px" : $(this).css("left"))}, 400);});}function basicMakeScrollable(elem, scrollX=true, scrollY=true) { var pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0; elem.onmousedown = dragMouseDown; elem.addEventListener('touchstart', function(e){dragMouseDown(e); }, false); function dragMouseDown(e) {e = e || window.event;e.preventDefault();// get the mouse cursor position at startup:pos3 = e.clientX || e.targetTouches[0].pageX;pos4 = e.clientY || e.targetTouches[0].pageY;document.onmouseup = closeDragElement;document.touchend = closeDragElement;// call a function whenever the cursor moves:document.onmousemove = elementDrag;document.ontouchmove = elementDrag; } function elementDrag(e) { var newDragX = e.clientX || e.targetTouches[0].pageX; var newDragY = e.clientY || e.targetTouches[0].pageY;e = e || window.event;e.preventDefault();// calculate the new cursor position:pos1 = pos3 - newDragX;pos2 = pos4 - newDragY;pos3 = newDragX;pos4 = newDragY;// set the element's new position:if(scrollY) {elem.style.top = (elem.offsetTop - pos2) + "px";} else {elem.style.top = elem.offsetTop + "px";}if(scrollX) {let maxLeft = $(elem).parent().width() - $(elem).width();let newLeft = elem.offsetLeft - pos1;if(newLeft > maxLeft) {newLeft = maxLeft;} else if(newLeft < 0) {newLeft = 0;}elem.style.left = newLeft + "px";} else {elem.style.left = elem.offsetLeft + "px";}//go to parent -- find children with data scroll target -- if x do x if y do y if both do both$(elem).parent().parent().children("[data-scroll-target]").each(function() {//get the dimensions of this thing based on the last child position and widthvar dimensions = getScrollingAreaFullDimensions($(this));var fullHeight = dimensions[1],fullWidth = dimensions[0];var percentOfScrollX = $(elem).css("left").split("px")[0] / ($(elem).parent().width() - $(elem).width());var percentOfScrollY = $(elem).css("top").split("px")[0] / ($(elem).parent().height() - $(elem).height());fullWidth = fullWidth - $(this).width();fullHeight = fullHeight - $(this).height();if($(this).attr("data-scroll-target") == "x" || $(this).attr("data-scroll-target") == "both") {$(this).css("left", percentOfScrollX * fullWidth * -1 + "px");}if($(this).attr("data-scroll-target") == "y" || $(this).attr("data-scroll-target") == "both") {$(this).css("left", percentOfScrollY * fullHeight * -1 + "px");}}); } function closeDragElement() {/* stop moving when mouse button is released:*/document.onmouseup = null;document.onmousemove = null;document.touchend = null;document.ontouchmove = null; } }function stopDraging() {/* stop moving when mouse button is released:*/document.onmouseup = null;document.onmousemove = null;document.touchend = null;document.ontouchmove = null;}/* -- end Scrollbar Junk-- */function ScrollToThing (elem, scrollOffset = 0) {window.scrollTo(0, window.pageYOffset + $(elem).eq(0).get(0).getBoundingClientRect().top + (scrollOffset * -1));}function doOnceWhenVarIsSet(nameOfVar, callback) {if(!hasActionBeenCompleted.hasOwnProperty(nameOfVar)) {hasActionBeenCompleted[nameOfVar] = false;}if(isVarSet[nameOfVar] && !hasActionBeenCompleted[nameOfVar]) {hasActionBeenCompleted[nameOfVar] = true;delayedVarActionsActivated++;callback();}}//When document finishes loading$(document).ready(function() {//fixes plato...legacy$(".product_section .grid_3:nth-of-type(4n+1)").add('.product_section .grid_4:nth-of-type(3n+1)').add('.product_section .grid_6:nth-of-type(2n+1)').add('.paired_product_section :nth-child(2n+1)').add('[class^="grid_"]:first-of-type:not(:last-child):not(.grid_12)').addClass('first_child');//fixes plato...legacy$('.product_section .grid_3:nth-of-type(4n)').add('.product_section .grid_4:nth-of-type(3n)').add('.product_section .grid_6:nth-of-type(2n)').add('.paired_product_section :nth-child(2n)').add('[class^="grid_"]:last-of-type:not(:first-child):not(.grid_12)').addClass('last_child');//all videos will pause/play on button press$("video:not(.da-normals)").on('click', function() {if($(this).hasClass("playingVideo")) {pauseVideo($(this));}else {playVideo($(this));}});//lets me do things based on query stringscheckURLCodes();//rebate formatter - flex without making it full width$("header").each(function() {$(this).find(".rebate-link-check.factory").first().css({"display" : "inline-flex"})});//rebate formatter - flex without making it full width$("header").each(function() {$(this).find(".rebate-link-check.bonus").first().css({"display" : "inline-flex"})});//kill the blank features -- dumb problem with our apisetTimeout(function() {$(".feature-list li").each(function() {if($(this).html() == "") {$(this).remove();}});$(".feature-list li").css({"opacity" : "1"});}, 1000);//fix svg css problems on ie and safari/iosfixSvgs();//update shop all button text, if set by attributeupdateShopAllButtonText();updateShopAllClasses();//fix iframesfixFrame();//log the platformconsole.log(itsPlato ? "plates" : "socks");//add a class depending on the platform$(".promotion").addClass(itsPlato ? "plates" : "socks");//Appends text to shop all buttons$(".shop-all-button").ready(function() {shopAllTextAddOn();});/* -- tabby section -- */$(".promo-tab-menu:not(.gremlinized) > span").on('click', function(){ $(this).closest(".section-tabbed-section").find(".chosen").removeClass("chosen"); $(this).add("[data-tab-type='promo-tab-products-" + $(this).html().toLowerCase().trim().replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"") + "']").addClass("chosen");});$(".promo-tab-menu:not(.gremlinized) > span").each(function() {if($("[data-tab-type='promo-tab-products-" + $(this).html().toLowerCase().trim().replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"") + "'] figure").length < 1) {$(this).remove();}});$(".promo-tab-menu:not(.gremlinized) span:first-of-type").trigger('click');//js version below$(".section-tabbed-section:not(.gremlinized)").each(function(tabbyindex, tabbyElem){let prodCats = $(tabbyElem).find(".promo-tab-js-menu span");if($(prodCats).length > 0) {$.each(prodCats, function(index, value) {let prodCat = $(value).html().toLowerCase().trim().replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"");//give the div that holds the prods the proper identifier$(tabbyElem).find("[data-tab-js-type]").eq(index).attr("data-tab-js-type", prodCat);//give the span the proper tab match$(value).attr("data-tab-match", prodCat);});$(tabbyElem).find("[data-tab-match]").on('click', function() {$(tabbyElem).find(".chosen").removeClass("chosen");$(this).addClass("chosen");$($(tabbyElem).find("[data-tab-js-type='" + $(this).attr("data-tab-match") + "']")).addClass("chosen");});$(prodCats).eq(0).trigger('click');} else {$(tabbyElem).find(".promo-tab-js-menu").remove();}});/* -- end tabby section -- */replaceTextBasedOnShopAllResultsForAllChosenElems();$("scrollbar").on('click', function (e){var posX = $(this).offset().left, posY = $(this).offset().top,scrollTarget = $(this).parents().find("[data-scroll-target]").eq(0);var scrollX = (scrollTarget.attr("data-scroll-target") == "x" || scrollTarget.attr("data-scroll-target") == "both" ? true : false),scrollY = (scrollTarget.attr("data-scroll-target") == "y" || scrollTarget.attr("data-scroll-target") == "both" ? true : false);scrollerToClick($(this).get(0), [e.pageX - posX, e.pageY - posY], scrollX, scrollY);});$(".drag-target").each(function (){basicMakeScrollable($(this).get(0));checkToHideScrollBar($(this));});$(".drag-x-target").each(function (){basicMakeScrollable($(this).get(0), true, false);checkToHideScrollBar($(this));});$(".drag-y-target").each(function (){basicMakeScrollable($(this).get(0), false, true);checkToHideScrollBar($(this));});$("scrollbutton").on('click', function(){sideScrollerButtonClick($(this));});$(".promo-collapsible-container").each(function() {var theParent = $(this);$(theParent).children("promo-row:first-of-type").click(function() {var collapsed = $(theParent).attr("data-collapsed");if(collapsed == "true") {$(theParent).attr("data-collapsed", "false");if($(theParent).parent().is("[data-child-scroll-offset]")) {setTimeout(()=>{ScrollToThing($(theParent), parseInt($(theParent).parent().attr("data-child-scroll-offset")))}, 500);setTimeout(()=>{ScrollToThing($(theParent), parseInt($(theParent).parent().attr("data-child-scroll-offset")))}, 1000);}} else {$(theParent).attr("data-collapsed", "true");}});});$("[data-promo-drawer]").click( function(){$(this).addClass("temp-tag");$("[data-promo-drawer]").each(function() {if(!$(this).hasClass("temp-tag")) {$(this).attr(`data-collapsed`, `true`);}});$(`[data-drop-content]`).removeClass("show-me");$(`[data-drop-content="${$(this).attr("data-promo-drawer")}"]`).addClass("show-me");$(this).removeClass("temp-tag");});$(".promo-collapsible-container").eq(0).attr("data-collapsed", "false");$(".video-button-thing").click(function() {$(".daVidModal").addClass("show-da-modal");});$(".daVidModal").not("iframe").click(function() {$(".daVidModal").removeClass("show-da-modal");});$("promo-popup-box promo-text").click(function() {var alreadyOpen = false;if($(this).hasClass("promo-popup-open")) {alreadyOpen = true;}$(".promo-popup-open").removeClass("promo-popup-open");if(!alreadyOpen) {$(this).addClass("promo-popup-open");}}); });function delayLoaded() {if(delayLoad > 0 || delayedVarActionsActivated < Object.keys(hasActionBeenCompleted).length) {setTimeout(function(){delayLoaded();}, 300);}}delayLoaded();//When window size changes$(window).on('resize', function(){//svg fix for ie and safari/ios mobilefixSvgs();//fix iframesfixFrame();$(".drag-target").each(function (){checkToHideScrollBar($(this));});$(".drag-x-target").each(function (){checkToHideScrollBar($(this));});$(".drag-y-target").each(function (){checkToHideScrollBar($(this));});});