1if(!funcDefined("sliceItemBlock")){ 2 sliceItemBlock = function(){ 3 /* 4 $('.cur .catalog_block .catalog_item_wrapp.catalog_item:visible').sliceHeight({ 5 classNull: '.footer_button', 6 item:'.cur .catalog_block .catalog_item_wrapp.catalog_item:visible', 7 classes: [ 8 '.item_info .item-title', 9 '.item_info .sa_block', 10 '.item_info .cost.prices', 11 ], 12 mobile: true, 13 blockNull: { 14 class: 'big', 15 width: 2, 16 }, 17 breakpoint: { 18 '(max-width: 600px)': { 19 blockNull: { 20 width: 1, 21 }, 22 autoslicecount: false, 23 slice: 999, 24 } 25 }, 26 }); 27 */ 28 29 InitCustomScrollBar(); 30 } 31} 32if(!funcDefined("sliceItemBlockSlide")){ 33 sliceItemBlockSlide = function(options){ 34 /*var settings = 35 { 36 classNull: '.footer_button', 37 item:'.cur .catalog_block.owl-carousel .catalog_item:not(.big)', 38 classes: [ 39 '.item_info .item-title', 40 '.item_info .sa_block', 41 '.item_info .cost.prices', 42 ], 43 mobile: true, 44 autoslicecount: false, 45 slice: 999, 46 }; 47 48 if(options !== undefined) { 49 settings = Object.assign(settings, options); 50 } 51 $('.cur .catalog_block.owl-carousel .catalog_item_wrapp.catalog_item').sliceHeight(settings); 52 */ 53 InitCustomScrollBar(); 54 } 55} 56 57$(document).ready(function(){ 58 if(!('SelectOfferProp' in window) && typeof window.SelectOfferProp != 'function') 59 { 60 SelectOfferProp1 = function(){ 61 // return false; 62 var _this = $(this), 63 obParams = {}, 64 obSelect = {}, 65 objUrl = parseUrlQuery(), 66 add_url = '', 67 container = _this.closest('.bx_catalog_item_scu'); 68 69 /* request params */ 70 obParams = { 71 'PARAMS': _this.closest('.js_wrapper_items').data('params'), 72 'ID': container.data('offer_id'), 73 'SITE_ID': container.data('site_id'), 74 'LINK_ID': container.data('id')+'_block', 75 'IBLOCK_ID': container.data('offer_iblockid'), 76 'PROPERTY_ID': container.data('propertyid'), 77 'DEPTH': _this.closest('.item_wrapper').index(), 78 'VALUE': _this.data('onevalue'), 79 'CLASS': 'inner_content', 80 'PICTURE': _this.closest('.catalog_item_wrapp').find('.thumb img').attr('src'), 81 'ARTICLE_NAME': _this.closest('.catalog_item_wrapp').find('.article_block').data('name'), 82 'ARTICLE_VALUE': _this.closest('.catalog_item_wrapp').find('.article_block').data('value'), 83 } 84 /**/ 85 86 if("clear_cache" in objUrl) 87 { 88 if(objUrl.clear_cache == "Y") 89 add_url += "?clear_cache=Y"; 90 } 91 92 /* save selected values */ 93 for (i = 0; i < obParams.DEPTH+1; i++) 94 { 95 strName = 'PROP_'+container.find('.item_wrapper:eq('+i+') > div').data('id'); 96 obSelect[strName] = container.find('.item_wrapper:eq('+i+') li.item.active').data('onevalue'); 97 obParams[strName] = container.find('.item_wrapper:eq('+i+') li.item.active').data('onevalue'); 98 } 99 100 // obParams.SELECTED = JSON.stringify(obSelect); 101 /**/ 102 103 _this.siblings().removeClass('active'); 104 _this.addClass('active'); 105 106 if(_this.attr('title')) 107 { 108 var skuVal = _this.attr('title').split(':')[1]; 109 _this.closest('.item_wrapper').find('.show_class .val').text(skuVal); 110 } 111 else 112 { 113 var img_row = _this.find(' > i'); 114 if(img_row.length && img_row.attr('title')) { 115 var skuVal = img_row.attr('title').split(':')[1]; 116 _this.closest('.item_wrapper').find('.show_class .val').text(skuVal); 117 } 118 } 119 120 /* get sku */ 121 $.ajax({ 122 url: arMaxOptions['SITE_DIR']+'ajax/js_item_detail.php'+add_url, 123 type: 'POST', 124 data: obParams, 125 }).success(function(html){ 126 var ob = BX.processHTML(html);BX.ajax.processScripts(ob.SCRIPT); 127 }) 128 } 129 $(document).on('click', '.bx_catalog_item_scu li.item', SelectOfferProp) 130 } 131}); 132 133(function (window) { 134if (!window.JCCatalogSectionOnlyElement) 135{ 136 137 window.JCCatalogSectionOnlyElement = function (arParams) 138 { 139 if (typeof arParams === 'object') 140 { 141 this.params = arParams; 142 143 this.obProduct = null; 144 this.set_quantity = 1; 145 146 this.currentPriceMode = ''; 147 this.currentPrices = []; 148 this.currentPriceSelected = 0; 149 this.currentQuantityRanges = []; 150 this.currentQuantityRangeSelected = 0; 151 152 if (this.params.MESS) 153 { 154 this.mess = this.params.MESS; 155 } 156 157 this.init(); 158 } 159 } 160 window.JCCatalogSectionOnlyElement.prototype = { 161 init: function() 162 { 163 var i = 0, 164 j = 0, 165 treeItems = null; 166 167 this.obProduct = BX(this.params.ID); 168 169 if(!!this.obProduct) 170 { 171 $(this.obProduct).find('.counter_wrapp .counter_block input').data('product', 'ob'+this.obProduct.id+'el'); 172 this.currentPriceMode = this.params.ITEM_PRICE_MODE; 173 this.currentPrices = this.params.ITEM_PRICES; 174 this.currentQuantityRanges = this.params.ITEM_QUANTITY_RANGES; 175 } 176 177 }, 178 179 setPriceAction: function() 180 { 181 this.set_quantity = this.params.MIN_QUANTITY_BUY; 182 if($(this.obProduct).find('input[name=quantity]').length) 183 this.set_quantity = $(this.obProduct).find('input[name=quantity]').val(); 184 185 this.checkPriceRange(this.set_quantity); 186 187 $(this.obProduct).find('.not_matrix').hide(); 188 $(this.obProduct).find('.with_matrix .price_value_block').html(getCurrentPrice(this.currentPrices[this.currentPriceSelected].PRICE, this.currentPrices[this.currentPriceSelected].CURRENCY, this.currentPrices[this.currentPriceSelected].PRINT_PRICE)); 189 190 if($(this.obProduct).find('.with_matrix .discount')) 191 { 192 $(this.obProduct).find('.with_matrix .discount').html(getCurrentPrice(this.currentPrices[this.currentPriceSelected].BASE_PRICE, this.currentPrices[this.currentPriceSelected].CURRENCY, this.currentPrices[this.currentPriceSelected].PRINT_BASE_PRICE)); 193 } 194 195 if(this.params.SHOW_DISCOUNT_PERCENT_NUMBER == 'Y') 196 { 197 if(this.currentPrices[this.currentPriceSelected].PERCENT > 0 && this.currentPrices[this.currentPriceSelected].PERCENT < 100) 198 { 199 if(!$(this.obProduct).find('.with_matrix .sale_block .sale_wrapper .value').length) 200 $('<div class="value"></div>').insertBefore($(this.obProduct).find('.with_matrix .sale_block .sale_wrapper .text')); 201 202 $(this.obProduct).find('.with_matrix .sale_block .sale_wrapper .value').html('-<span>'+this.currentPrices[this.currentPriceSelected].PERCENT+'</span>%'); 203 } 204 else 205 { 206 if($(this.obProduct).find('.with_matrix .sale_block .sale_wrapper .value').length) 207 $(this.obProduct).find('.with_matrix .sale_block .sale_wrapper .value').remove(); 208 } 209 } 210 $(this.obProduct).find('.with_matrix .sale_block .text .values_wrapper').html(getCurrentPrice(this.currentPrices[this.currentPriceSelected].DISCOUNT, this.currentPrices[this.currentPriceSelected].CURRENCY, this.currentPrices[this.currentPriceSelected].PRINT_DISCOUNT)); 211 212 if('NOT_SHOW' in this.params && this.params.NOT_SHOW != 'Y') 213 $(this.obProduct).find('.with_matrix').show(); 214 215 if(arMaxOptions['THEME']['SHOW_TOTAL_SUMM'] == 'Y') 216 { 217 if(typeof this.currentPrices[this.currentPriceSelected] !== 'undefined') 218 setPriceItem($(this.obProduct), this.set_quantity, this.currentPrices[this.currentPriceSelected].PRICE); 219 } 220 }, 221 222 checkPriceRange: function(quantity) 223 { 224 if (typeof quantity === 'undefined'|| this.currentPriceMode != 'Q') 225 return; 226 227 var range, found = false;
228 229 for (var i in this.currentQuantityRanges) 230 { 231 if (this.currentQuantityRanges.hasOwnProperty(i)) 232 { 233 range = this.currentQuantityRanges[i]; 234 235 if ( 236 parseInt(quantity) >= parseInt(range.SORT_FROM) 237 && ( 238 range.SORT_TO == 'INF' 239 || parseInt(quantity) <= parseInt(range.SORT_TO) 240 ) 241 ) 242 { 243 found = true; 244 this.currentQuantityRangeSelected = range.HASH; 245 break; 246 } 247 } 248 } 249 250 if (!found && (range = this.getMinPriceRange())) 251 { 252 this.currentQuantityRangeSelected = range.HASH; 253 } 254 255 for (var k in this.currentPrices) 256 { 257 if (this.currentPrices.hasOwnProperty(k)) 258 { 259 if (this.currentPrices[k].QUANTITY_HASH == this.currentQuantityRangeSelected) 260 { 261 this.currentPriceSelected = k; 262 break; 263 } 264 } 265 } 266 }, 267 268 getMinPriceRange: function() 269 { 270 var range; 271 272 for (var i in this.currentQuantityRanges) 273 { 274 if (this.currentQuantityRanges.hasOwnProperty(i)) 275 { 276 if ( 277 !range 278 || parseInt(this.currentQuantityRanges[i].SORT_FROM) < parseInt(range.SORT_FROM) 279 ) 280 { 281 range = this.currentQuantityRanges[i]; 282 } 283 } 284 } 285 286 return range; 287 } 288 } 289} 290})(window);
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.