1jQuery(document).ready(function($) { 2 $('.messanger').not('.messanger_no-fixed').appendTo('body'); 3 4 $('.messanger__item > a').each(function(i, e) { 5 if ($(e).attr('href') == 'javascript:void(0);') { 6 $(e).removeAttr('target'); 7 } 8 }); 9 10 $('.messanger').each(function(i, e) { 11 var $items = $(e).find('.messanger__item'); 12 $items.sort(function(a, b) { 13 return $(a).data("sort") - $(b).data("sort") 14 }); 15 $(e).find('.messanger__items').append($items); 16 }); 17 18 $('.messanger__close_widget').click(function() { 19 $(this).closest('.messanger').hide(); 20 }); 21 $('.messanger__close_modal').click(function() { 22 $(this).closest('.messanger').find('.messanger__popup').hide(); 23 }); 24 25 $('.messanger__item_max').click(function() { 26 var isVisible = $(this).closest('.messanger').find('.messanger__popup_max').is(":visible"); 27 $('.messanger__popup').hide(); 28 if (!isVisible) { 29 $(this).closest('.messanger').find('.messanger__popup_max').show(); 30 } 31 }); 32 $('.messanger__item_vb').click(function() { 33 var isVisible = $(this).closest('.messanger').find('.messanger__popup_vb').is(":visible"); 34 $('.messanger__popup').hide(); 35 if (!isVisible) { 36 $(this).closest('.messanger').find('.messanger__popup_vb').show(); 37 } 38 }); 39 $('.messanger__item_wa').click(function() { 40 var isVisible = $(this).closest('.messanger').find('.messanger__popup_wa').is(":visible"); 41 $('.messanger__popup').hide(); 42 if (!isVisible) { 43 $(this).closest('.messanger').find('.messanger__popup_wa').show(); 44 } 45 }); 46 $('.messanger__item_tg').click(function() { 47 var isVisible = $(this).closest('.messanger').find('.messanger__popup_tg').is(":visible"); 48 $('.messanger__popup').hide(); 49 if (!isVisible) { 50 $(this).closest('.messanger').find('.messanger__popup_tg').show(); 51 } 52 }); 53 $('.messanger__item_sk').click(function() { 54 var isVisible = $(this).closest('.messanger').find('.messanger__popup_sk').is(":visible"); 55 $('.messanger__popup').hide(); 56 if (!isVisible) { 57 $(this).closest('.messanger').find('.messanger__popup_sk').show(); 58 } 59 }); 60 $('.messanger__item_ap').click(function() { 61 var isVisible = $(this).closest('.messanger').find('.messanger__popup_ap').is(":visible"); 62 $('.messanger__popup').hide(); 63 if (!isVisible) { 64 $(this).closest('.messanger').find('.messanger__popup_ap').show(); 65 } 66 }); 67 68 $('.messanger-icon-wrap_all').click(function() { 69 let messanger = $(this).closest('.messanger'); 70 71 if (messanger.hasClass('messanger_active')) { 72 //document.cookie = "chats_mini=0; path=/; max-age=604800"; 73 messanger.removeClass('messanger_active'); 74 messanger.find('.messanger__items').removeClass('is_active'); 75 } else { 76 //document.cookie = "chats_mini=1; path=/; max-age=604800"; 77 if (messanger.find('.messanger__items').hasClass('is_active')) { 78 messanger.find('.messanger__items').addClass('messanger_active'); 79 } else { 80 messanger.find('.messanger__items').removeClass('messanger_active'); 81 } 82 messanger.addClass('messanger_active'); 83 } 84 //messanger.find('.messanger__items').toggleClass('is_active'); 85 //messanger.toggleClass('messanger_active'); 86 messanger.find('.messanger__popup').hide(); 87 }); 88 89 90 // ÐÐ°Ñ Ð¾Ð´Ð¸Ð¼ вÑе конÑейнеÑÑ Ð´Ð»Ñ QR-кодов 91 const qrContainers = document.querySelectorAll('.messanger__popup--primium'); 92 qrContainers.forEach(container => { 93 // ÐÐ°Ñ Ð¾Ð´Ð¸Ð¼ ÑÑÑÐ»ÐºÑ Ñ Ð°ÑÑибÑÑом data-qr-href внÑÑÑи конÑейнеÑа 94 const qrLink = container.querySelector('.messanger__qr-href'); 95 // ÐеÑем URL из href аÑÑибÑÑа ÑÑÑлки 96 const qrHref = qrLink ? qrLink.getAttribute('href') : null; 97 if (qrHref) { 98 const qrCodeDiv = container.querySelector('.messanger__qr'); 99 if (qrCodeDiv) { 100 // ÐолÑÑаем вÑе паÑамеÑÑÑ Ð¸Ð· data-аÑÑибÑÑов 101 const dataColor = qrCodeDiv.getAttribute('data-color') || '#000000'; 102 const dataWidth = parseInt(qrCodeDiv.getAttribute('data-width')) || 150; 103 const dataHeight = parseInt(qrCodeDiv.getAttribute('data-height')) || 150; 104 const dataLightColor = qrCodeDiv.getAttribute('data-light-color') || '#ffffff'; 105 // ÐÑиÑаем ÑÑÑеÑÑвÑÑÑее ÑодеÑжимое 106 qrCodeDiv.innerHTML = ''; 107 // Создаем новÑй QR-код Ñ ÐºÐ°ÑÑомнÑми наÑÑÑойками
108 try { 109 const qrcode = new QRCode(qrCodeDiv, { 110 width: dataWidth, 111 height: dataHeight, 112 colorDark: dataColor, 113 colorLight: dataLightColor, 114 correctLevel: QRCode.CorrectLevel.H, // УÑÐ¾Ð²ÐµÐ½Ñ ÐºÐ¾ÑÑекÑии оÑибок 115 text: qrHref 116 }); 117 // ÐÐ»Ñ Ð¾Ñладки 118 console.log(`QR-код Ñоздан длÑ: ${qrHref}`, { 119 color: dataColor, 120 width: dataWidth, 121 height: dataHeight 122 }); 123 } catch (error) { 124 console.error('ÐÑибка пÑи Ñоздании QR-кода длÑ', qrHref, ':', error); 125 } 126 } else { 127 console.warn('Ðе найден ÑÐ»ÐµÐ¼ÐµÐ½Ñ .qrcode в конÑейнеÑе:', container); 128 } 129 } else { 130 console.warn('Ðе найдена ÑÑÑлка Ñ data-qr-href в конÑейнеÑе:', container); 131 } 132 }); 133 134 135 // ÐнимаÑÐ¸Ñ Ð¸ÐºÐ¾Ð½Ð¾Ðº 136 $(function() { 137 const $messenger = $('.messanger_animation-icons'); 138 if (!$messenger.length) return; 139 140 const $iconsWrap = $messenger.find('.messanger-icon-wrap_all'); 141 if (!$iconsWrap.length) return; 142 143 // СобиÑаем иконки Ð´Ð»Ñ ÑоÑаÑии 144 const $icons = $messenger.find('.messanger__items .messanger-icon-wrap').not('.messanger-icon-wrap_all'); 145 if (!$icons.length) return; // минимÑм 2 иконки Ð´Ð»Ñ Ð·Ð°Ð¿ÑÑка ÑоÑаÑии 146 147 let currentIndex = 0; 148 let isActive = false; 149 let rotationTimer = null; 150 151 // УпÑавление ÑоÑÑоÑнием блока 152 function setActiveState(active) { 153 isActive = active; 154 $messenger.toggleClass('messanger_animation-icons--is-active', active); 155 $iconsWrap.toggleClass('messanger-icon-wrap_all--active', active); 156 } 157 158 // ÐоказаÑÑ Ð¸ÐºÐ¾Ð½ÐºÑ Ð¿Ð¾ индекÑÑ 159 function showIcon(index) { 160 $iconsWrap.html($icons.eq(index).clone()); 161 } 162 163 // ÐеÑеклÑÑиÑÑ Ð½Ð° ÑледÑÑÑÑÑ Ð¸ÐºÐ¾Ð½ÐºÑ 164 function nextIcon() { 165 if (!isActive) return; 166 167 currentIndex = (currentIndex + 1) % $icons.length; 168 169 $iconsWrap.fadeOut(300, () => { 170 showIcon(currentIndex); 171 $iconsWrap.fadeIn(300); 172 }); 173 } 174 175 // ÐапÑÑк ÑоÑаÑии 176 function startRotation() { 177 if (isActive) return; 178 179 setActiveState(true); 180 showIcon(0); 181 182 rotationTimer = setInterval(nextIcon, 4000); 183 } 184 185 // ÐÑÑановка ÑоÑаÑии 186 function stopRotation() { 187 if (!isActive) return; 188 189 setActiveState(false); 190 clearInterval(rotationTimer); 191 rotationTimer = null; 192 193 $iconsWrap.empty(); 194 } 195 196 // ÐеÑеклÑÑение Ñежима 197 function toggleRotation(e) { 198 e.preventDefault(); 199 e.stopPropagation(); 200 201 isActive ? stopRotation() : startRotation(); 202 } 203 204 // ÐниÑиализаÑÐ¸Ñ Ð¿Ð¾ клаÑÑÑ messanger_active 205 $messenger.hasClass('messanger_active') ? startRotation() : stopRotation(); 206 207 // ÐбÑабоÑÑики ÑобÑÑий 208 $iconsWrap.on('click', toggleRotation); 209 210 // ÐÑиÑÑка ÑаймеÑа пÑи закÑÑÑии ÑÑÑаниÑÑ 211 $(window).on('beforeunload', () => { 212 if (rotationTimer) clearInterval(rotationTimer); 213 }); 214 }); 215 216});
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.