1(function ($) { 2 'use strict'; 3 4 $(function () { 5 $(document).on('click', 'a[href*="/go/"]', function(e) { 6 const a = $(this); 7 $.post('/stats/go.php', { 8 link: a.attr('href'), 9 class: a.attr('class'), 10 num: $('a[href="' + a.attr('href') + '"]').index(e.target) + 1 11 }); 12 13 let m; 14 if (window.region && (m = a.attr('href').match(/\/go\/([\w\-]+)/))) { 15 const title = m[1].toLowerCase(); 16 try { 17 ym(15694972, 'reachGoal', title + '-' + window.region + '-2'); 18 } catch(e) { } 19 } 20 }); 21 }); 22 23 (function ($) { 24 $(function () { 25 $(document).on('click', '.tg-goal', function () { 26 try { 27 ym(15694972, 'reachGoal', 'sup-widget-room-tg-click', {url: window.location.href}); 28 } catch (e) {} 29 }); 30 31 $(document).on('click', '.live-chat-goal', function () { 32 try { 33 ym(15694972, 'reachGoal', 'sup-widget-room-webchat-click', {url: window.location.href}); 34 } catch (e) {} 35 }); 36 }); 37 })(jQuery); 38 39 $(function () { 40 $('.top_panel .panel_menu li.message.unread a').each(function () { 41 const t = $(this); 42 setInterval(function () { 43 t.toggleClass('bg'); 44 }, 1000); 45 }); 46 }); 47 48 // ctrl + arrows 49 $(function () { 50 $('body').on('keyup', function(e) { 51 if (-1 === $.inArray(e.target.tagName.toLowerCase(), ['input', 'textarea', 'select'])) { 52 if ((e.altKey || e.ctrlKey || e.metaKey) && e.which === 37) { 53 e.preventDefault(); 54 const link = $('link[rel=prev]'); 55 if (link && link.attr('href')) { 56 location.href = link.attr('href'); 57 } 58 } 59 if ((e.altKey || e.ctrlKey || e.metaKey) && e.which === 39) { 60 e.preventDefault(); 61 const link = $('link[rel=next]'); 62 if (link && link.attr('href')) { 63 location.href = link.attr('href'); 64 } 65 } 66 } 67 }); 68 }); 69 70 $(document).on('submit', 'form.disallow-double-submission', function(e) { 71 const form = $(this); 72 73 if (form.data('submitted') === true) { 74 e.preventDefault(); 75 } else { 76 if (window.getEditor) { 77 const editor = window.getEditor(); 78 if (!editor || !editor.plugins.get('PendingActions').hasAny) { 79 form.data('submitted', true); 80 } 81 } else { 82 form.data('submitted', true); 83 } 84 } 85 86 return this; 87 }); 88 89 $(function () { 90 function fixTitles() { 91 $('.user_info .group span').each(function () { 92 if ($(this).width() > $(this).closest('.user_info').width()) { 93 $(this).css({'font-size': (parseInt($(this).css('font-size')) - 1) + 'px'}); 94 } 95 }); 96 } 97 98 fixTitles(); 99 $('#commentContainer').on('commentsUpdated', fixTitles); 100 }); 101 102 // Tooltips 103 $(function () { 104 if ($.qtip) { 105 $(function () { 106 $('.tooltip').qtip({style: {classes: 'qtip-light'}}); 107 }); 108 } 109 }); 110 111 $(function () { 112 if ($.pjax) { 113 if ($.pjax.defaults) { 114 $.pjax.defaults.timeout = 5000; 115 $.pjax.defaults.dataType = 'html'; 116 } 117 $(document).on('pjax:send', function(event) { 118 $(event.target).addClass('pjax-loading'); 119 }).on('pjax:success', function(event) { 120 // commentContainer 121 $(event.target).trigger('commentsUpdated'); 122 123 // reportagePostContainer 124 $(event.target).trigger('reportagePostsUpdated'); 125 if ('reportagePostContainer' === $(event.target).prop('id')) { 126 (function(d, s, id) { 127 var js, fjs = d.getElementsByTagName(s)[0]; 128 if (!d.getElementById(id)) { 129 js = d.createElement(s); 130 js.id = id; 131 js.src = '//platform.twitter.com/widgets.js'; 132 js.onload = function () { 133 if (window.twttr && window.twttr.widgets) { 134 window.twttr.widgets.load() 135 } 136 } 137 fjs.parentNode.insertBefore(js, fjs); 138 } else if (window.twttr && window.twttr.widgets) { 139 window.twttr.widgets.load() 140 } 141 }(document, 'script', 'tw-js')); 142 143 (function(d, s, id) { 144 var js, fjs = d.getElementsByTagName(s)[0]; 145 if (!d.getElementById(id)) { 146 js = d.createElement(s); 147 js.id = id; 148 js.src = '//platform.instagram.com/en_US/embeds.js'; 149 js.onload = function () { 150 if (window.instgrm && window.instgrm.Embeds) { 151 window.instgrm.Embeds.process(); 152 } 153 } 154 fjs.parentNode.insertBefore(js, fjs); 155 } else if (window.instgrm && window.instgrm.Embeds) { 156 window.instgrm.Embeds.process(); 157 } 158 }(document, 'script', 'ig-js')); 159 } 160 }).on('pjax:complete', function(event, xhr, textStatus, options) { 161 if (false !== options.scrollTo) { 162 var a = document.createElement('a'); 163 a.href = location.href; 164 var hash = a.hash; 165 166 if (hash) { 167 window.setTimeout(function () { 168 var name = decodeURIComponent(hash.slice(1)); 169 var target = document.getElementById(name) || document.getElementsByName(name)[0]; 170 if (target) { 171 $(window).scrollTop($(target).offset().top); 172 } 173 174 $(event.target).removeClass('pjax-loading'); 175 }, 0); 176 } else { 177 $(event.target).removeClass('pjax-loading'); 178 } 179 } else { 180 $(event.target).removeClass('pjax-loading'); 181 } 182 }); 183 $(document).pjax('[data-pjax] a, a[data-pjax]', '#pjax-container'); 184 } 185 }); 186 187 // ÐÑенка поÑÑов ÑепоÑÑажа 188 $(function () { 189 $(document).on('click', '#reportagePostContainer .reportage-vote a.reportage-vote--plus', function (ev) { 190 var $this = $(this); 191 var id = $(this).data('id'); 192 $.getJSON($(this).prop('href'), function (data) { 193 if (data[0] === 'OK') { 194 $this.closest('.reportage-vote').find('.reportage-vote--rating').html(data[1].summary + '').removeClass('reportage-vote--rating_neutral').addClass(data[1].summary > 0 ? 'reportage-vote--rating_positive' : 'reportage-vote--rating_neutral'); 195 $this.hide(); 196 $('#rpostVotersContainer' + id).html('<img src="/images/loader/loader3.gif" width="43" alt="" />'); 197 $.get('/misc/rpvoters', {id: id}, function (data) { 198 $('#rpostVotersContainer' + id).html(data) 199 }, 'html'); 200 } 201 }); 202 ev.stopPropagation(); 203 return false;
204 }); 205 }); 206 207 // ÐÑенка комменÑаÑиев 208 $(function () { 209 // ÐовÑй дизайн 210 $(document).on('click', '#commentContainer .post-vote a', function (ev) { 211 var $this = $(this); 212 var id = $(this).data('id'); 213 $.getJSON($(this).prop('href'), function (data) { 214 if (data[0] === 'OK') { 215 var className = (data[1].summary > 0 ? 'positive' : (data[1].summary < 0 ? 'negative' : (data[1].count > 0 ? 'neutral' : ''))); 216 $this.closest('.post-vote').find('a.post-vote--rating:first').html(data[1].summary + '').removeClass('neutral').removeClass('negative').removeClass('positive').addClass(className); 217 $this.closest('.post-vote').find('a:not(.post-vote--rating)').toggle(); 218 $('#postVotersContainer' + id).html('<img src="/images/loader/loader3.gif" width="43" alt="" />'); 219 $.get('/misc/cvoters', {id: id}, function (data) { 220 $('#postVotersContainer' + id).html(data) 221 }, 'html'); 222 } 223 }); 224 ev.stopPropagation(); 225 return false; 226 }); 227 }); 228 229 $(function () { 230 if (typeof(autosize) == 'function') { 231 autosize($('#reportagePostContainer textarea, .block2 form[name=ReportagePost] textarea')); 232 233 $('#reportagePostContainer').on('reportagePostsUpdated', function () { 234 autosize($('#reportagePostContainer textarea')); 235 }); 236 } 237 238 $(document).on('keypress', '#reportagePostContainer textarea, .block2 form[name=ReportagePost] textarea', function (ev) { 239 if (ev.ctrlKey && (10 == ev.keyCode || 13 == ev.keyCode)) { 240 $(this).closest('form').trigger('submit'); 241 ev.stopPropagation(); 242 return false; 243 } 244 }); 245 }); 246 247 $(function () { 248 function parseSpoilers() { 249 $('span.spoiler,div.spoiler').each(function () { 250 $(this).html(window.getSpoilerHtml($(this).prop('title'), $(this).html(), !!$(this).closest('#reportageTopBlockContainer').length)); 251 }); 252 } 253 254 parseSpoilers(); 255 256 $(document).on('click', 'a.post-spoiler--button', function () { 257 $(this).toggleClass('show'); 258 $(this).closest('.spoilerWrapper').find('.spoilerContainer > div:first-child').toggle(); 259 }); 260 261 $('#reportagePostContainer').on('reportagePostsUpdated', parseSpoilers); 262 $('#commentContainer').on('commentsUpdated', parseSpoilers); 263 }); 264 265 // sochi 266 $(function () { 267 $('a.button-mobile-menu, a.button-mobile-menu--close').click(function () { 268 $('#mWarp').toggleClass('show'); 269 }); 270 }); 271 272 $.fn.gipsyteamVideo = function(options) { 273 return this.each(function() { 274 var id = $(this).prop('id'); 275 var item = options.playlist[0]; 276 if (/(i(phone|pad|pod))/i.test(navigator.userAgent)) { 277 var html = '<video width="' + options.width + '" height="' + options.height + '" poster="' + item.image + '" controls="controls" preload="none">'; 278 $.each(item.sources, function (i, source) { 279 html += '<source type="video/' + source.type + '" src="' + source.file + '" />'; 280 }); 281 html += '</video>'; 282 $(this).html(html); 283 } else { 284 var js, fjs = document.getElementsByTagName('script')[0]; 285 if (!document.getElementById('jw-js')) { 286 js = document.createElement('script'); 287 js.id = 'jw-js'; 288 js.async = true; 289 js.src = "/jwplayer/jwplayer.js"; 290 js.onload = function () { 291 window.jwplayer.key = 'Esk4CDrEyfTsj2nEWrJ8FrGr9
291+V4J9EMPpNmEA=='; 292 $(document).trigger('jwplayerLoaded'); 293 } 294 fjs.parentNode.insertBefore(js, fjs); 295 } 296 297 options.primary = 'flash'; 298 options.startparam = 'start'; 299 options.skin = '/jwplayer/skins/gt_/gt.xml'; 300 if (window.jwplayer && window.jwplayer.key) { 301 jwplayer(id).setup(options).setVolume(100); 302 } else { 303 $(document).on('jwplayerLoaded', function () { 304 jwplayer(id).setup(options).setVolume(100); 305 }); 306 } 307 } 308 }); 309 }; 310 311 $(function () { 312 // mobile menu 313 function openMobileMenu() { 314 $('.mobile-top--button').addClass('menu-opened'); 315 $('.mobile-top, .menu-top, .mobile-menu').addClass('menu-opened'); 316 $('body').addClass('lock-scroll'); 317 } 318 319 function closeMobileMenu() { 320 $('.mobile-top--button').removeClass('menu-opened'); 321 $('.mobile-top, .menu-top, .mobile-menu').removeClass('menu-opened'); 322 $('body').removeClass('lock-scroll'); 323 } 324 325 $(document).on('click', '.mobile-top--button:not(.submenu)', function() { 326 if ($('.mobile-top--button').hasClass('menu-opened')) { 327 closeMobileMenu(); 328 } else { 329 openMobileMenu(); 330 } 331 }); 332 333 $(document).on('click', '.widemenu-overlay', closeWideMenu); 334 335 $('.mobile-top--avatar').on('click', function() { 336 $(this).toggleClass('active'); 337 $('.mobile-user--options').toggleClass('show'); 338 }); 339 340 function closeWideMenu() { 341 $('.widemenu').removeClass('menu-opened'); 342 $('.menu-top--link_drop').removeClass('active'); 343 $('body').removeClass('widemenu-open'); 344 $('.mobile-top--button').removeClass('submenu'); 345 } 346 347 // wide menu 348 $(document).on('click', '.mobile-top--button.submenu', closeWideMenu); 349 350 $('.menu-top--link_drop').on('click', function(ev) { 351 ev.preventDefault(); 352 const active = $(this).hasClass('active'); 353 closeWideMenu(); 354 closeMobileMenu(); 355 if (!active) { 356 $(this).addClass('active'); 357 $(this).next('.widemenu').addClass('menu-opened'); 358 $('body').addClass('widemenu-open'); 359 openMobileMenu(); 360 $('.mobile-top--button').addClass('submenu'); 361 } 362 }); 363 364 // profile menu 365 $('.header-user').on('click', function (ev) { 366 if ($(ev.target).closest('.header-user--options').length == 0) { 367 $('.header-user--nick').toggleClass('active'); 368 $('.header-user--options').toggleClass('show'); 369 ev.preventDefault(); 370 ev.stopPropagation(); 371 } 372 }); 373 $(document).on('click', function () { 374 $('.header-user--nick').removeClass('active'); 375 $('.header-user--options').removeClass('show'); 376 }); 377 378 // extra menu 379 $('.extra-button').on('click', function(ev) { 380 $('.extra-button').toggleClass('active'); 381 $('.extra-menu').toggleClass('show'); 382 ev.preventDefault(); 383 ev.stopPropagation(); 384 }); 385 $(document).on('click', function() { 386 $('.extra-button').removeClass('active'); 387 $('.extra-menu').removeClass('show'); 388 }); 389 390 // login modal 391 $('.modal-login--close, .modal-login--open').on('click', function () { 392 $('.modal-login .modal-login--note').hide(); 393 $('.modal-login, .modal-login--overlay').toggleClass('hidden'); 394 }); 395 396 $('.modal-login--overlay').on('click', function () { 397 $('.modal-login, .modal-login--overlay').addClass('hidden'); 398 }); 399 }); 400 401 $(function () { 402 $('.lang-flag-wrap > svg').on('click', function () { 403 const fo = $('.flag-options'); 404 fo.toggleClass('flag-options_show'); 405 406 if (fo.hasClass('flag-options_show') && $('.mobile-top').is(':visible')) { 407 const mt = $('.menu-top'); 408 const delta = ($('.flag-options').offset().top - $('.menu-top').position().top + $('.flag-options').height()) - $('.menu-top').outerHeight(); 409 if (delta > 0) { 410 mt.animate({scrollTop: 10000}, 10); 411 } 412 } 413 }); 414 415 $('.lang-flag-wrap a').on('click', function () { 416 $('.flag-options').removeClass('flag-options_show'); 417 }); 418 419 $(document).on('click', function (ev) { 420 const target = $(ev.target); 421 if (target.is('.lang-flag-wrap a') || !$(target).closest('.lang-flag-wrap').length) { 422 $('.flag-options').removeClass('flag-options_show'); 423 } 424 }); 425 }); 426 427 $(function () { 428 $('.mod-stats--item .lightbox').magnificPopup({ 429 type: 'ajax', 430 closeBtnInside: false, 431 fixedContentPos: true 432 }); 433 }); 434 435 // cluvs 436 $(function() { 437 $('.js-dropmenu').on('click', function(e) { 438 $(this).toggleClass('active') 439 .find('.author-menu').toggleClass('open'); 440 e.stopPropagation(); 441 e.preventDefault(); 442 return false;
443 }); 444 $('.js-dropmenu a.author-menu--item').on('click', function(e) { 445 e.stopPropagation(); 446 }); 447 $('html').on('click', function() { 448 $('.author-menu').removeClass('open'); 449 $('.js-dropmenu').removeClass('active'); 450 }); 451 $('.js-dropmenu + .post-author--swap .post-author--nick a.post-author--link').on('click', function(e) { 452 $(this).closest('.post-author--inner') 453 .find('.js-dropmenu').click(); 454 e.stopPropagation(); 455 e.preventDefault(); 456 return false; 457 }); 458 }); 459 460 // rakeraces 461 $(function () { 462 // tabs 463 $(document).on('click', '.promo-leaderboard--top a', function () { 464 $(this).addClass('active').siblings().removeClass('active'); 465 $($(this).data('tabselector') ? $(this).data('tabselector') : '.promo-leaderboard--sub-container').hide(); 466 $($(this).data('tab')).show(); 467 }); 468 469 // search 470 $(document).on('click', '.promo-search--button', function(ev) { 471 var nick = $(this).prev().val(); 472 $('.table-promo-leader tbody tr td:nth-child(2)').each(function () { 473 if (nick === $.trim($(this).html())) { 474 $('.promo-leaderboard--sub-container').hide(); 475 $('.promo-leaderboard--sub-container tr').css({'backgroundColor': ''}); 476 $(this).closest('.promo-leaderboard--sub-container').show(); 477 $(this).closest('tr').css({'backgroundColor': 'lightgreen'}); 478 $('.promo-search--field').val(''); 479 return false; 480 } 481 }); 482 }); 483 }); 484 485 $(function () { 486 $(document).on('click', 'div.copy-link, a.copy-link', function (e) { 487 e.stopPropagation(); 488 e.preventDefault(); 489 490 const a = $(this); 491 let valueToCopy = a.prop('href'); 492 if (a.data('custom') !== undefined) { 493 valueToCopy = a.data('custom'); 494 } 495 if (typeof(navigator.clipboard) != 'undefined') { 496 navigator.clipboard.writeText(valueToCopy) 497 .then(() => { 498 a.children('span').show(); 499 setTimeout(() => { 500 a.children('span').hide().html(a.children('span').html()); 501 }, 1000); 502 }) 503 .catch(function () { 504 prompt(a.data('prompt'), valueToCopy); 505 }); 506 } else { 507 prompt(a.data('prompt'), valueToCopy); 508 } 509 510 return false; 511 }); 512 }); 513 514 $(function () { 515 let docElement = $(document.documentElement); 516 517 $(document).on('click', '.theme-button', function () { 518 let host = window.location.hostname; 519 let domainParts = window.location.hostname.split('.'); 520 if (domainParts.length > 1) { 521 host = domainParts.slice(-2).join('.'); 522 } 523 524 if (host === 'gipsyteam.ru') { 525 host = 'www.gipsyteam.ru'; 526 } 527 528 if (docElement.attr('theme')) { 529 docElement.attr('theme', ''); 530 Cookies.remove('theme', {domain: window.cookieDomain}); 531 532 $.getJSON(window.location.protocol + '//' + host + '/misc/theme/dark/0?callback=?'); 533 } else { 534 docElement.attr('theme', 'dark'); 535 536 $.getJSON(window.location.protocol + '//' + host + '/misc/theme/dark/1?callback=?').fail(function () { 537 Cookies.set('theme', 'dark', {domain: window.cookieDomain}); 538 }); 539 } 540 }); 541 }); 542 543 $(function () { 544 const widgets = [ 545 { 546 'class': '.widget-prlink', 547 'main': '.widget-prlink--main', 548 'nextButton': '.prl-control--button_next', 549 'prevButton': '.prl-control--button_prev', 550 'swiper': { 551 'wrapperClass': `widget-prlink--wrap`, 552 'slideClass': `widget-prlink--list`, 553 'slidesPerView': 1, 554 'spaceBetween': 20, 555 'navigation': { 556 'disabledClass': 'prl-control--button_disabled' 557 } 558 } 559 }, 560 { 561 'class': '.widget-prroom', 562 'main': '.widget-prroom--main', 563 'nextButton': '.prm-control--button_next', 564 'prevButton': '.prm-control--button_prev', 565 'swiper': { 566 'wrapperClass': 'widget-prroom--wrap', 567 'slideClass': 'widget-prroom--list', 568 'slidesPerView': 1, 569 'slidesPerGroup': 1, 570 'spaceBetween': 16, 571 'breakpoints': { 572 600: { 573 'slidesPerView': 2, 574 'slidesPerGroup': 2 575 }, 576 860: { 577 'slidesPerView': 3, 578 'slidesPerGroup': 3 579 } 580 }, 581 'navigation': { 582 'disabledClass': 'prm-control--button_disabled' 583 } 584 } 585 } 586 ];
587 widgets.forEach(function (value, key) { 588 $(`${value['class']}`).each(function (i) { 589 const className = `widget-${i}-${key}`; 590 $(this).find(value['main']).addClass(className); 591 $(this).find(value['nextButton']).addClass(`next-${className}`); 592 $(this).find(value['prevButton']).addClass(`prev-${className}`); 593 let swiperData = value['swiper']; 594 swiperData['navigation']['nextEl'] = `.next-${className}`; 595 swiperData['navigation']['prevEl'] = `.prev-${className}`; 596 new Swiper(`.${className}`, swiperData); 597 }); 598 }); 599 }); 600 601 // пеÑеклÑÑение Ñабов в обÑÑении 602 $(function() { 603 $('.tab-control').on('click', function() { 604 var tabClicked = $(this).data('tab-index'); 605 $('.market-mid .active').removeClass('active'); 606 $('.trainer-tab, .tab-control').each(function() { 607 $(this).data('tab-index') === tabClicked && $(this).addClass('active'); 608 }); 609 }); 610 }); 611 612 // Ð¿Ð¾Ð¿Ð°Ð¿Ñ Ð¸ копиÑование кодов 613 $(function () { 614 function makeTooltips() { 615 $('.simple-tip:not(.tooltipstered)').tooltipster({ 616 theme: 'tooltipster-simple', 617 animationDuration: 0, 618 trigger: 'custom', 619 triggerOpen: { 620 mouseenter: true, 621 tap: true 622 }, 623 triggerClose: { 624 mouseleave: true, 625 tap: true 626 }, 627 side: ['top', 'bottom'] 628 }); 629 630 $('.regcode-tip:not(.tooltipstered)').tooltipster({ 631 theme: 'tooltipster-regcode', 632 contentCloning: true, 633 animationDuration: 0, 634 trigger: 'custom', 635 triggerOpen: { 636 click: true, 637 tap: true 638 }, 639 triggerClose: { 640 click: true, 641 tap: true 642 }, 643 side: ['top', 'bottom'] 644 }); 645 646 // ÑÑлÑÐ¸Ð¿Ñ ÐºÐ¾Ð´Ð¾Ð² 647 $('.green-tip:not(.tooltipstered)').tooltipster({ 648 theme: 'tooltipster-green', 649 contentCloning: true, 650 animationDuration: 0, 651 trigger: 'custom', 652 triggerOpen: { 653 click: true, 654 tap: true 655 }, 656 triggerClose: { 657 click: true, 658 tap: true 659 }, 660 side: ['top', 'bottom'] 661 }); 662 663 // ÑÑÑаниÑа ÑегиÑÑÑаÑии 664 $('.white-tip:not(.tooltipstered)').tooltipster({ 665 theme: 'tooltipster-white', 666 animationDuration: 0, 667 distance: 0, 668 trigger: 'custom', 669 triggerOpen: { 670 mouseenter: true, 671 tap: true 672 }, 673 triggerClose: { 674 mouseleave: true, 675 tap: true 676 }, 677 side: ['top', 'bottom'] 678 }); 679 } 680 681 makeTooltips(); 682 $(document).on('makeTooltips', makeTooltips); 683 684 // копиÑование кода 685 $(document).on('click', '.copy-code', function () { 686 const that = $(this); 687 const code = that.data('code'); 688 const room = that.data('room'); 689 const elclass = that.attr('class'); 690 const num = $('[data-code="' + code + '"][data-room="' + room + '"]').index(that) + 1; 691 692 if (typeof(navigator.clipboard) != 'undefined') { 693 navigator.clipboard.writeText(code); 694 } else { 695 prompt(that.data('prompt'), code); 696 } 697 698 if (that.data('clicked')) { 699 return; 700 } 701 that.data('clicked', true); 702 703 try { 704 ym(15694972, 'reachGoal', 'copy-room-revcode'); 705 } catch (e) {} 706 707 $.post('/stats/cc.php', {code, room, class: elclass, num}); 708 }); 709 710 // анимаÑÐ¸Ñ ÐºÐ¾Ð¿Ð¸ÑÐ¾Ð²Ð°Ð½Ð¸Ñ ÐºÐ¾Ð´Ð° 711 $(document).on('click', '.s-copy-link', function () { 712 const codeNotify = $(this).find('.s-copy-link-notify'); 713 714 if (codeNotify.hasClass('animate')) { 715 return; 716 } 717 718 codeNotify.addClass('animate'); 719 setTimeout(() => { 720 codeNotify.removeClass('animate'); 721 }, 1500); 722 }); 723 }); 724 725 // ÑоÑÑмнÑе ÑÑаÑÑÑÑ 726 $(function () { 727 function statusSwap() { 728 $('.post-author--swap').each(function () { 729 const container = $(this); 730 const containerWidth = container.width(); 731 732 const rowWidth = Array.from(container.children()).reduce( 733 (acc, el) => $(el).width() + acc, 0 734 ); 735 736 const minDistance = 8; 737 const isOverflowing = (rowWidth + minDistance) > containerWidth; 738 739 if (isOverflowing) { 740 container.addClass('status-swap'); 741 } else { 742 container.removeClass('status-swap'); 743 } 744 }); 745 } 746 747 $(window).on('resize', statusSwap); 748 749 statusSwap(); 750 }); 751 752 $(function () { 753 $(document).on('click', '.post-content a.reply-circle', function (e) { 754 const cid = $('.post-content a.reply-circle').attr('href').match(/\/postid\/(\d+)/)[1]; 755 if (cid) { 756 const a = $('#comment' + cid); 757 if (a.length) { 758 $('html, body').animate({scrollTop: a.offset().top}, 10); 759 e.preventDefault() 760 e.stopPropagation(); 761 return false;
762 } 763 } 764 }); 765 }); 766})(jQuery); 767 768function PopUp(url) { 769 window.open(url, 'popup', 'top=0,left=0,width=' + screen.width + ',height=' + screen.height + ',resizable=1,scrollbars=1,location=no,directories=no,status=no,menubar=no,toolbar=no'); 770} 771 772function gtGetRangeObject() { 773 var selectionObject; 774 775 if (window.getSelection) { 776 selectionObject = window.getSelection(); 777 } else if (document.selection) { 778 selectionObject = document.selection.createRange(); 779 } 780 781 if (selectionObject) { 782 if (selectionObject.getRangeAt) { 783 if (selectionObject.rangeCount > 0) { 784 return selectionObject.getRangeAt(0); 785 } 786 } else if (document.createRange) { 787 var range = document.createRange(); 788 range.setStart(selectionObject.anchorNode,selectionObject.anchorOffset); 789 range.setEnd(selectionObject.focusNode,selectionObject.focusOffset); 790 return range; 791 } 792 } 793} 794 795function gtGetSelectedText(userSelection, html = false) { 796 if (window.getSelection) { 797 // W3C Ranges 798 799 const clonedSelection = userSelection.cloneContents(); 800 const div = document.createElement('div'); 801 div.appendChild(clonedSelection); 802 803 return html ? div.innerHTML : new String(userSelection); 804 } else if (document.selection) { 805 // Explorer selection, return the HTML 806 return userSelection.htmlText; 807 } else { 808 return ''; 809 } 810} 811 812function getVoters(id, bestComments = false) { 813 const container = $(`#postVotersContainer${id}${bestComments ? 'b' : ''}`); 814 if (container.is(':visible')) { 815 container.css({display: 'none'}); 816 } else { 817 container.html('<img src="/images/loader/loader3.gif" width="43" alt="" />'); 818 container.load(`/misc/cvoters`, {id: id}); 819 container.css({display: 'flex'}); 820 } 821 container.prev().find('.post-vote--rating').toggleClass('active'); 822 container.toggleClass('active'); 823}
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.