PageSourceSearch

https://shop.teachesofpeaches.com/cdn/shop/t/9/assets/bootstrapify…?v=75541735728428314571733334598

js teachesofpeaches.com collected 2026-10-02 16:40:56 UTC 4,314 bytes, 1 lines download raw bytes

1Shopify.BootstrapifyOptionSelectors=function(existingSelectorId,options){if(this.existingSelectorId=existingSelectorId,this.b_selectorDivClass="selector-wrapper form-group",this.b_selectorClass="single-option-selector form-control input-lg",this.b_linkOptions=options.linkOptions||!1,this.onVariantSelected=Shopify.isDefined(options.onVariantSelected)?options.onVariantSelected:function(){},this.product=new Shopify.Product(options.product),1===this.product.variants.length){var oldSelector=document.getElementById(existingSelectorId);oldSelector.style.display="none",this.displaySingleVariantTitle(oldSelector),this.onVariantSelected(this.product.variants[0],this)}else Shopify.BootstrapifyOptionSelectors.baseConstructor.call(this,existingSelectorId,options),this.bootstrapifyMarkup(),this.b_linkOptions&&this.product.available&&this.product.options.length>1&&Shopify.linkOptionSelectors(this.product,existingSelectorId)},Shopify.extend(Shopify.BootstrapifyOptionSelectors,Shopify.OptionSelectors),Shopify.BootstrapifyOptionSelectors.prototype.displaySingleVariantTitle=function(oldSelector){for(var options=this.product.variants[0].options,i=options.length;i--;)("Default Title"===options[i]||"Default"===options[i])&&options.splice(i,1);var ele=document.createElement("p");ele.className="lead",ele.innerHTML=options.join(" / "),oldSelector.parentNode.appendChild(ele)},Shopify.BootstrapifyOptionSelectors.prototype.bootstrapifyMarkup=function(){var self=this;Shopify.each(this.selectors,function(selector){var element=selector.element,parentElement=element.parentNode;element.className=self.b_selectorClass,parentElement.className=self.b_selectorDivClass,1===self.selectors.length&&"Title"!==selector.name&&parentElement.insertBefore(self.displaySingleOptionLable(selector),element)})},Shopify.BootstrapifyOptionSelectors.prototype.displaySingleOptionLable=function(selector){var label=document.createElement("label");return label.htmlFor=selector.element.id,label.innerHTML=selector.name,label};var Shopify=Shopify||{};Shopify.optionsMap={},Shopify.updateOptionsInSelector=function($productForm,selectorIndex){var key,selector;switch(selectorIndex){case 0:key="root",selector=$productForm.find(".single-option-selector:eq(0)");break;case 1:key=$productForm.find(".single-option-selector:eq(0)").val(),selector=$productForm.find(".single-option-selector:eq(1)");break;case 2:key=$productForm.find(".single-option-selector:eq(0)").val(),key+=" / "+$productForm.find(".single-option-selector:eq(1)").val(),selector=$productForm.find(".single-option-selector:eq(2)")}var initialValue=selector.val();selector.empty();for(var availableOptions=Shopify.optionsMap[key],i=0;i<availableOptions.length;i++){var option=availableOptions[i],newOption=jQuery("<option></option>").val(option).html(option);selector.append(newOption)}-1!==jQuery.inArray(initialValue,availableOptions)&&selector.val(initialValue),selector.trigger("change")},Shopify.linkOptionSelectors=function(product,existingSelectorId){for(var i=0;i<product.variants.length;i++){var key,variant=product.variants[i];variant.available&&(Shopify.optionsMap.root=Shopify.optionsMap.root||[],Shopify.optionsMap.root.push(variant.option1),Shopify.optionsMap.root=Shopify.uniq(Shopify.optionsMap.root),product.options.length>1&&(key=variant.option1,Shopify.optionsMap[key]=Shopify.optionsMap[key]||[],Shopify.optionsMap[key].push(variant.option2),Shopify.optionsMap[key]=Shopify.uniq(Shopify.optionsMap[key])),3===product.options.length&&(key=variant.option1+" / "+variant.option2,Shopify.optionsMap[key]=Shopify.optionsMap[key]||[],Shopify.optionsMap[key].push(variant.option3),Shopify.optionsMap[key]=Shopify.uniq(Shopify.optionsMap[key])))}var $productForm=$("#"+existingSelectorId).closest("form");Shopify.updateOptionsInSelector($productForm,0),product.options.length>1&&Shopify.updateOptionsInSelector($productForm,1),3===product.options.length&&Shopify.updateOptionsInSelector($productForm,2),$productForm.find(".single-option-selector:eq(0)").change(function(){return Shopify.updateOptionsInSelector($productForm,1),3===product.options.length&&Shopify.updateOptionsInSelector($productForm,2),!0}),$productForm.find(".single-option-selector:eq(1)").change(function(){return 3===product.options.length&&Shopify.updateOptionsInSelector($productForm,2),!0})};

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.