PageSourceSearch

https://www.zlato-grad.ru/wa-apps/shop/plugins/autobadge/js/frontend.min.js?1.7.7

js zlato-grad.ru collected 2026-10-01 14:52:17 UTC 10,228 bytes, 1 lines download raw bytes

1if("undefined"==typeof jQuery){var script=document.createElement("script");script.src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js",document.getElementsByTagName("head")[0].appendChild(script)}!function(t){t.autobadgeFrontend={update:"",xhr:{},settings:{},wrapElements:[".dialog",".modal",".s-dialog-wrapper"],autosizeElements:[],forceParentVisible:!1,delayLoading:!1,delayLoadingAjax:!1,forceParentRelative:!0,showLoader:!0,ids:[],init:function(a){var e,o=this;this.update=a.update||"",this.delayLoading=a.delayLoading||!1,this.delayLoadingAjax=a.delayLoadingAjax||!1,this.settings=a.settings||{},this.initCountdown(),t(document).on("change","form",function(){o.onFormChange(t(this))}),t(document).on("click change",'input[name="sku_id"], .sku-feature',function(a){t(this).closest("form").change()}),t(document).on("click","a.plus, a.minus, .inc_cart, .dec_cart, .inc_product, .dec_product.dec_product",function(){var a=t(this);clearTimeout(e),e=setTimeout(function(){a.closest("form").change()},100)}),t(window).resize(function(){t.autobadgeFrontend.delayAutosize(200,void 0)}),t(document).on("mousedown touchend",".s-sorting-list a, .select-view > span, .view-select > span, #select-view li a, .product-view button, .catalog-view span, .product-view .view a, .f-view, .showvariant a"+(t.autobadgeFrontend.autosizeElements.length?", "+t.autobadgeFrontend.autosizeElements.join(","):""),function(){t.autobadgeFrontend.delayAutosize(450,void 0)}),this.delayLoadingAjax?t("form").each(function(){o.onFormChange(t(this))}):setTimeout(function(){t.autobadgeFrontend.workupBadges()},800)},onFormChange:function(a){var e=this,o=a.find("input[name='product_id']");o.length&&(e.ids.push({id:o.val(),form:a}),clearTimeout(a.data("autobadge-timer")),a.data("autobadge-timer",setTimeout(function(){e.ids.length&&(t.autobadgeFrontend.updateProductRules(e.ids),e.ids=[])},400)))},updateProductRules:function(a){var e={},o=null,i=0,n={},d={};t.each(a,function(a,d){var s=d.id,r=d.form,u=r.find("input[name='quantity']").val(),l=t.autobadgeFrontend.findWrap(r),c=l.find(".autobadge-pl.product-id-"+s);t.each(c,function(d){var c=t(this),g=c.find(".badge-text-block"),p=void 0!==c.attr("data-page")?c.attr("data-page"):"category",b=void 0!==c.attr("data-type")?c.attr("data-type"):"default",h=s+"-"+p+"-"+b+"-"+a+"-"+d;null===o&&(o=h),u=u||1,e[h]={product_id:s,quantity:u,params:r.serialize(),autobadgePage:p,autobadgeType:b},n[h]={wrap:l,textBlocks:g},void 0===t.autobadgeFrontend.xhr[h]||t.isEmptyObject(t.autobadgeFrontend.xhr[h])||4==t.autobadgeFrontend.xhr[h].readyState||t.autobadgeFrontend.xhr[h].abort(),t.autobadgeFrontend.addLoader(g),i++})}),1===i&&(d=t.autobadgeFrontend.xhr),d[o]=t.ajax({type:"post",url:t.autobadgeFrontend.update,cache:!1,dataType:"json",beforeSend:function(a,e){1===i&&(t.autobadgeFrontend.xhr[o]=a)},data:{products:e},success:function(a){"ok"==a.status&&a.data&&void 0!==a.data.products?(t.each(a.data.products,function(a,e){var o=n[a].wrap.find(".autobadge-pl.product-id-"+e.product_id+'[data-page="'+e.page+'"][data-type="'+e.type+'"]'),i=o.hasClass("autobadge-delay-loaded");if(o.length){var d=o.parent();o.remove(),""!==e.autobadge&&(d.append(e.autobadge),i&&d.find(".autobadge-pl.product-id-"+e.product_id+'[data-page="'+e.page+'"][data-type="'+e.type+'"]').addClass("autobadge-delay-loaded"))}n[a].wrap.find(".autobadge-default.product-id-"+e.product_id).replaceWith(e.default),t.autobadgeFrontend.editBadgeCss(e.css)}),void 0===a.data.js_settings||t.isEmptyObject(a.data.js_settings)||(void 0===t.autobadgeFrontend.settings?t.autobadgeFrontend.settings=a.data.js_settings:t.each(a.data.js_settings,function(a,e){void 0===t.autobadgeFrontend.settings[a]&&(t.autobadgeFrontend.settings[a]=e)})),t.autobadgeFrontend.reinit()):t.autobadgeFrontend.removeTextblocksLoader(n)},error:function(a,e,o){"abort"!==e&&(console&&console.log(a,e,o),t.autobadgeFrontend.removeTextblocksLoader(n))},complete:function(){delete d[o]}})},autoSize:function(){var a={},e="";t(".autoposition-h, .autoposition-w, .adjust-w").each(function(){var o=t(this);if(o.hasClass("autoposition-h")&&o.css("marginTop",-1*o.outerHeight()/2+(void 0!==o.attr("data-mtop")?parseFloat(o.attr("data-mtop")):0)),o.hasClass("autoposition-w")&&o.css("marginLeft",-1*o.outerWidth()/2+(void 0!==o.attr("data-mleft")?parseFloat(o.attr("data-mleft")):0)),o.hasClass("adjust-w")){var i=o.offsetParent().outerWidth(),n=o.attr("data-badge-class")+"-"+i;void 0===a[n]&&void 0!==t.autobadgeFrontend.settings[o.attr("data-badge-class")]&&(a[n]=1,e+=t.autobadgeFrontend.generateTailCss(o,t.autobadgeFrontend.settings[o.attr("data-badge-class")],i)),void 0===o.attr("data-orig-class")&&o.attr("data-orig-class",o.attr("class")),o.toggleClass(),o.attr("data-width",i).addClass(o.attr("data-orig-class")+" s-"+i)}}),t(".autobadge-tail-css").remove(),""!==e&&t("head").append('<style class="autobadge-tail-css">'+e+"</style>"),t(".badge-text-block").each(function(){var a=t(this),e=a.closest(".autobadge-pl"),o=e.attr("data-badge-id");if(!a.children().length||"auto"==e[0].style.height||"ribbon-6"==o||"ribbon-4"==o)return!0;a.css("marginTop",-1*a.height()/2)})},generateTailCss:function(a,e,o){var i="",n="autobadge-pl."+a.attr("data-badge-class")+".s-"+o,d=e.additional.all_tails,s=a[0].style.width,r=t.autobadgeFrontend.getTailSize(o,s.substring(0,s.length-1)),u=void 0!==e.border?-1*parseInt(e.border.width):0,l=-1===t.inArray("bottom_left",e.additional.all_tails.position)&&-1===t.inArray("top_left",e.additional.all_tails.position)||-1===t.inArray("bottom_right",e.additional.all_tails.position)&&-1===t.inArray("top_right",e.additional.all_tails.position),c=Math.ceil(Math.abs(r)/2+(void 0!==e.border?parseInt(e.border.width)/2:0))*(l?2:1),g=-1*c*2+u;for(var p in d.position){switch(d.position[p]){case"top_right":i+="."+n+":after{",i+="top:"+g+"px;",i+="right:"+u+"px;";break;
1case"top_left":i+="."+n+":before{",i+="top:"+g+"px;",i+="left:"+u+"px;";break;case"bottom_right":i+="."+n+" .autobadge-pl-tail:after{",i+="bottom:"+g+"px;",i+="right:"+u+"px;";break;case"bottom_left":i+="."+n+" .autobadge-pl-tail:before{",i+="bottom:"+g+"px;",i+="left:"+u+"px;"}i+="border-width:"+c+"px;",i+="}"}return i+=this.changePosition(n,e,c)},getTailSize:function(t,a){return 2*Math.ceil((1-a/100)*t/4)},changePosition:function(a,e,o){var i="";if(void 0!==e.position&&void 0!==e.position.value){var n=e.position.value?e.position.value.split("_"):["top","right"];for(var d in n)switch(n[d]){case"top":i+="top:",void 0===o||-1===t.inArray("top_left",e.additional.all_tails.position)&&-1===t.inArray("top_right",e.additional.all_tails.position)||(i+=2*o+"px !important");break;case"bottom":i+="bottom:",void 0===o||-1===t.inArray("bottom_left",e.additional.all_tails.position)&&-1===t.inArray("bottom_right",e.additional.all_tails.position)||(i+=2*o+"px !important")}i&&(i="."+a+"{"+i+"}")}return i},editBadgeCss:function(a){if(""!==a.google_fonts){var e=t(".autobadge-goog-f"),o=e.length?e.attr("data-fonts").split(","):"";if(""!==o){var i=t(a.google_fonts).attr("data-fonts").split(",");for(var n in i)-1===t.inArray(i[n],o)&&o.push(i[n]);e.attr("data-fonts",o.join(",")).attr("href","https://fonts.googleapis.com/css?family="+o.join("%7C"))}else t("head").append(a.google_fonts)}if(!t.isEmptyObject(a.inline_css)){t(".autobadge-inline-css").length||t("head").append('<style class="autobadge-inline-css" data-targets=""></style>');var d=t(".autobadge-inline-css"),s=d.attr("data-targets").split(","),r="",u=[];""!==s?(t.each(a.inline_css,function(a,e){if(""===e)return!0;-1===t.inArray(a,s)&&(r+=e,s.push(a))}),d.append(r).attr("data-targets",s.join(","))):(t.each(a.inline_css,function(t,a){if(""===a)return!0;r+=a,u.push(t)}),d.append(r).attr("data-targets",u.join(",")))}},addLoader:function(a){if(!t.autobadgeFrontend.showLoader)return!1;this.removeLoader(a);a.children().hide(),a.append('<i class="icon16-autobadge loading-icon"></i>')},removeLoader:function(a){if(!t.autobadgeFrontend.showLoader)return!1;a.children().show(),a.find(".icon16-autobadge.loading-icon").remove()},removeTextblocksLoader:function(a){t.each(a,function(a,e){t.autobadgeFrontend.removeLoader(e.textBlocks)})},reinit:function(){this.initCountdown(),t.autobadgeFrontend.workupBadges()},initCountdown:function(){t.fn.countdowntimerAB&&t(".autobadge-countdown").each(function(){if(!t(this).hasClass("inited")){var a=t(this).html(""),e=a.attr("id")||"autobadge-countdown"+(""+Math.random()).slice(2);a.attr("id",e);var o=a.data("start").replace(/-/g,"/"),i=a.data("end").replace(/-/g,"/");a.countdowntimerAB({startDate:o,dateAndTime:i,size:"medium"}),t(this).removeClass("icon16-autobadge loading-icon").addClass("inited")}})},delayAutosize:function(a,e){clearTimeout(e),e=setTimeout(function(){t.autobadgeFrontend.autoSize()},a)},workupBadges:function(){var a=t(".autobadge-inline-css").attr("data-targets");a=a?a.split(","):[];var e=[];t(".autobadge-pl").not(".autobadge-inited").each(function(){var o=t(this),i=o.parent();if(t.autobadgeFrontend.forceParentRelative&&!i.hasClass("autobadge-positioned")){var n=i.css("position");"absolute"!==n&&"fixed"!==n&&"relative"!==n&&i.css("position","relative").addClass("autobadge-positioned")}t.autobadgeFrontend.forceParentVisible&&((i=o.offsetParent()).hasClass("autobadge-visible")||"hidden"!=i.css("overflow")||i.css("overflow","visible").addClass("autobadge-visible")),o.data("load-css")&&-1===t.inArray("autobadge-pl."+o.data("load-css"),a)&&e.push({id:o.data("product-id"),form:o.parent()}),o.addClass("autobadge-inited")}),t.autobadgeFrontend.autoSize(),t.autobadgeFrontend.delayLoading&&t(".autobadge-pl").not(".autobadge-delay-loaded").animate({opacity:"1"},500,function(){t(this).addClass("autobadge-delay-loaded")}),Object.keys(e).length&&t.autobadgeFrontend.updateProductRules(e)},findWrap:function(a){var e=a.closest(".flexdiscount-product-wrap, .igaponov-product-wrap"+(t.autobadgeFrontend.wrapElements.length?", "+t.autobadgeFrontend.wrapElements.join(","):""));if(!e.length){var o=a.closest(".s-products-list, .product-list, .lazy-wrapper, ul.thumbnails, .product-thumbs, .product-list");o.length&&(e=t("> li, > div, > tr",o)),e.length&&e.addClass("igaponov-product-wrap")}return e.length?e:t(document)}}}(jQuery);

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.