1$(document).on('inova_admin.toggle_ui', function (event, state) { 2 $('.uil-banner__click-counter').css('display', (state ? '' : 'none')); 3}); 4 5// УÑÑановка ÑавнÑÑ ÑазмеÑов Ð´Ð»Ñ Ð²ÑÐµÑ Ð±Ð°Ð½Ð½ÐµÑов ÑпиÑка 6$(window).on('load', function () { 7 8 var is_mobile = false; 9 try { 10 document.createEvent('TouchEvent'); 11 is_mobile = true; 12 } 13 catch (e) { 14 } 15 16 if (is_mobile) 17 $('.uil-banner').find('img').attr({'width': '', 'height': ''}); 18 else 19 $('.uil-banner').each(function () { 20 var $wrp = $(this); 21 var size = $wrp.attr('data-banner-size').split('x'), 22 wrp_attr_width = size[0] ? size[0] : 'auto', 23 wrp_attr_height = size[1] ? size[1] : 'auto'; 24 // console.log([wrapper_width, wrapper_height]); 25 if (wrp_attr_width !== 'auto' || wrp_attr_height !== 'auto') { 26 $wrp.css({ 27 'width': wrp_attr_width, 28 'height': wrp_attr_height, 29 'line-height': wrp_attr_height 30 }); 31 var wrp_real_width = $wrp.width(); 32 var wrp_real_height = $wrp.height(); 33 if (wrp_real_width < wrp_attr_width) { 34 wrp_real_height = parseInt(wrp_real_width / wrp_attr_width * wrp_attr_height); 35 $wrp.css({ 36 'width': wrp_real_width, 37 'height': wrp_real_height, 38 'line-height': wrp_real_height 39 }); 40 } 41 if ($wrp.hasClass('uil-banner_kind_image')) { 42 var $img = $wrp.find('img'); 43 var img_real_width = $img.width(); 44 var img_attr_width = $img.attr('width'); 45 var img_attr_height = $img.attr('height'); 46 if (img_attr_width && img_attr_height) { 47 img_attr_width = parseInt(img_attr_width); 48 img_attr_height = parseInt(img_attr_height); 49 if (img_real_width < img_attr_width) { 50 $img.attr('width', img_real_width); 51 $img.attr('height', parseInt(img_real_width / img_attr_width * img_attr_height)); 52 } 53 } 54 var img_real_height = $img.height(); 55 if (img_real_height && img_real_height < wrp_real_height) 56 $img.css('margin-top', wrp_real_height / 2 - img_real_height / 2); 57 } 58 if ($wrp.hasClass('uil-banner_kind_flash')) { 59 var $obj = $wrp.find('object'); 60 var obj_height = $obj.height(); 61 if (obj_height && obj_height < wrp_real_height) 62 $obj.css('margin-top', wrp_real_height / 2 - obj_height / 2); 63 } 64 } 65 }); 66 67 $('.uil-banner-list__card-link a').each(function () { 68 var $card_link = $(this); 69 var $body = $card_link.closest('.uil-banner-list__body'); 70 var $banner = $body.find('.uil-banner-list__banner-list__item').first(); 71 $card_link.css('top', ($body.outerHeight() - $card_link.outerHeight() - parseInt($banner.css('margin-bottom'), 10)) / 2); 72 }); 73 74}); 75 76$(function () { 77 // СÑÑÑ ÐºÐ»Ð¸ÐºÐ¾Ð² по баннеÑам 78 $('.uil-banner[data-click-url] a').click(function () { 79 80 var $link = $(this); 81 var $banner = $link.parent(); 82 83 if ($banner.attr('data-click-is-counted') === 'yes') 84 return true; 85 86 var is_tb = $link.attr('target') === '_blank'; 87 88 $.ajax({ 89 type: 'POST', 90 url: $banner.attr('data-click-url'), 91 dataType: 'text', 92 async: is_tb, 93 complete: function () { 94 $banner.attr('data-click-is-counted', 'yes'); 95 if (!is_tb) 96 $link[0].click(); 97 } 98 }); 99 100 return is_tb; 101 102 }); 103 104});
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.