1//THIS JAVASCRIPT IS ALWAYS AVAILABLE FOR ALL PAGES Logout, logged in, Preview mode, ALWAYS AVAILABLE. 2 3$(".site-tooltip").hover(function () { 4 5 $(".site-tooltip-text").remove() 6 7 /* 8 $("<div>", { 9 'class': "custom-tooltip-text", 10 }).insertAfter($(this)); 11 */ 12 /* 13 $("<div>", { 14 'class': "iviewer_image_mask", 15 css: { 16 "background": "url('http://somesite.com/path/to/image.jpg')" 17 } 18 }).appendTo('#container'); 19 */ 20 21 $("<div>") 22 .addClass('site-tooltip-text') 23 .css({ "position": "absolute" }) 24 .appendTo('body'); 25 26 //$(this).next(".custom-tooltip-text").append($(this).attr("longdesc")); 27 28 $(".site-tooltip-text").append($(this).attr("longdesc")); 29 30 var topOffset = $(this).offset().top - $(window).scrollTop(); 31 32 var offset = $(this).offset(); 33 var height = $(this).height(); 34 var width = $(this).width(); 35 var top = offset.top + height + "px"; 36 //var left = offset.left + width + "px"; 37 38 //var top = offset.top + "px"; 39 var left = offset.left + "px"; 40 41 var halfleft = (offset.left + width) / 2 + "px" 42 43 $('.site-tooltip-text').css({ 44 'position': 'absolute', 45 'left': left, 46 'top': top 47 }); 48 49}, 50 function () { 51 $(".site-tooltip-text").remove() 52 53 }); 54 55 /* JS for CK5 style drop current year */ 56function getcurrentyear() { 57 if ($(".cms-current-year").length) { 58 $(".cms-current-year").each(function () { 59 $(this).text(new Date().getFullYear()); 60 }) 61 } 62} 63 64getcurrentyear(); 65 66setTimeout(function() { 67 getcurrentyear() 68},2000) 69 70 71 72$(".site-tooltip").click(function () { 73 $(".site-tooltip-text-popup").remove(); 74 75 $("<div>") 76 .addClass('site-tooltip-text-popup') 77 .css({}) 78 .appendTo('body'); 79 80 $("<div>") 81 .addClass('site-tooltip-text-popup-data') 82 .css({}) 83 .appendTo('.site-tooltip-text-popup'); 84 85 $("<div>") 86 .addClass('site-tooltip-text-popup-close') 87 .css({}) 88 .appendTo('.site-tooltip-text-popup-data'); 89 90 $("<div>") 91 .addClass('site-tooltip-text-popup-desc') 92 .css({}) 93 .appendTo('.site-tooltip-text-popup-data'); 94 95 $(".site-tooltip-text-popup-data").append($(this).attr("longdesc")); 96 97}); 98 99$(".site-tooltip-text-popup-close").click(function () { 100 $(".site-tooltip-text-popup").remove(); 101}); 102 103 104$(document.body).on('click', '.site-tooltip-text-popup-close', function () { 105 $(".site-tooltip-text-popup").remove(); 106}); 107 108 109$(".site-hover-change-text").hover(function () { 110 $(".site-hover-change-text strong").html($(this).attr("title")); 111 $(".site-hover-change-text strong").removeClass("site-updated-word"); 112 113 $(".site-hover-change-text strong").addClass("site-updated-word-hide"); 114 115 setTimeout(function () { 116 $(".site-hover-change-text strong").addClass("site-updated-word"); 117 }, 100); 118 119}, 120 function () { 121 $(".site-hover-change-text strong").html("..."); 122 $(".site-hover-change-text strong").removeClass("site-updated-word"); 123 $(".site-hover-change-text strong").removeClass("site-updated-word-hide"); 124 }); 125 126 127 128function determineDropDirection(){ 129 $(".cms-moving-block").each( function(){ 130 $(this).css({ 131 visibility: "hidden", 132 display: "block" 133 }); 134 135 136 $(this).parent().removeClass("dropup"); 137 $(this).parent().removeClass("dropleft"); 138 139 if ($(this).offset().top > $(window).innerHeight() - 360){ 140 console.log("write plz") 141 console.log("top 1: "+ $(this).offset().top + $(this).outerHeight()) 142 console.log("top 2: "+ $(window).innerHeight() + $(window).scrollTop()) 143 $(this).parent().addClass("dropup"); 144 } 145 146 if ($(this).offset().left < 310){ 147 148 console.log("$(this).offset().left: " + $(this).offset().left) 149 console.log("$(this).outerWidth(): " + $(this).outerWidth()) 150 console.log("left 1: " + $(this).offset().left + $(this).outerWidth()) 151 152 console.log("$(window).innerWidth(): " + $(window).innerWidth()) 153 console.log("$(window).scrollLeft(): " + $(window).scrollLeft()) 154 console.log("left 2: " + $(window).innerWidth() + $(window).scrollLeft()) 155 156 $(this).parent().addClass("dropleft"); 157 } 158 159 $(this).removeAttr("style"); 160 });
161} 162 163$(document).ready(function () { 164 165 166 if ($(".site-page-recommendation-wrapper").length) { 167 $(".site-page-recommendation-wrapper").hide(); 168 169 $(".site-page-recommendation-wrapper .site-pr-icon").click(function () { 170 $(".site-pr-list-wrapper").addClass("site-pr-list-wrapper-active"); 171 $(".site-pr-list").removeClass("site-pr-list-full"); 172 $(".site-pr-list-show-more").show(); 173 }); 174 175 $(".site-pr-list-show-more").click(function () { 176 $(".site-pr-list").addClass("site-pr-list-full"); 177 $(".site-pr-list-show-more").hide(); 178 }); 179 180 $(".site-pr-list-close").click(function () { 181 $(".site-pr-list-wrapper").removeClass("site-pr-list-wrapper-active"); 182 $(".site-pr-list").removeClass("site-pr-list-full"); 183 }); 184 185 var fixmeTop = $("body").height()/2; 186 187 188 $(document).on('scroll.recommendation', function () { 189 190 var currentScroll = $(window).scrollTop(); 191 192 if (currentScroll >= fixmeTop) { 193 $(".site-page-recommendation-wrapper").show(); 194 $(".site-pr-list-wrapper").addClass("site-pr-list-wrapper-active"); 195 $(document).off('scroll.recommendation') 196 } 197 }) 198 199 } 200 201 if ($('#moving-block').length) { 202 var div = document.getElementById('moving-block'); 203 var isDown = -1; 204 var offset = 0; 205 var mousePosition = 0; 206 document.addEventListener('mousemove', move); 207 208 div.addEventListener('mousedown', function (e) { 209 isDown = true; 210 offset = [ 211 div.offsetLeft - e.clientX, 212 div.offsetTop - e.clientY 213 ]; 214 console.log("1") 215 216 }, true); 217 218 div.addEventListener('mouseup', function (e) { 219 isDown = false; 220 determineDropDirection(); 221 console.log("2") 222 }, true); 223 224 function move(e) { 225 let event = e || window.event; 226 e.preventDefault(); 227 if (isDown) { 228 e.preventDefault(); 229 mousePosition = { 230 x: event.clientX, 231 y: event.clientY 232 }; 233 234 div.style.left = (mousePosition.x + offset[0]) + 'px'; 235 div.style.top = (mousePosition.y + offset[1]) + 'px'; 236 } 237 } 238 } 239/* 240 if ($('#OrphanedFeaturesContainer').length) { 241 var div = document.getElementById('OrphanedFeaturesContainer'); 242 var isDown = -1; 243 var offset = 0; 244 var mousePosition = 0; 245 document.addEventListener('mousemove', move); 246 247 div.addEventListener('mousedown', function (e) { 248 isDown = true; 249 offset = [ 250 div.offsetLeft - e.clientX, 251 div.offsetTop - e.clientY 252 ]; 253 console.log("1") 254 255 }, true); 256 257 div.addEventListener('mouseup', function (e) { 258 isDown = false; 259 determineDropDirection(); 260 console.log("2") 261 }, true); 262 263 function move(e) { 264 let event = e || window.event; 265 e.preventDefault(); 266 if (isDown) { 267 e.preventDefault(); 268 mousePosition = { 269 x: event.clientX, 270 y: event.clientY 271 }; 272 273 div.style.left = (mousePosition.x + offset[0]) + 'px'; 274 div.style.top = (mousePosition.y + offset[1]) + 'px'; 275 } 276 } 277 } 278 */ 279 280 /* 281 --------------------------------- 282 Remove deafult list custom style 283 --------------------------------- 284 */ 285 function removeCustomlistStyle() { 286 if ($("ul").length) { 287 $("ul[style*='list-style-type']").each(function() { 288 $(this).addClass("site-no-custom-link") 289 }); 290 } 291 292 if ($("ol").length) { 293 $("ol[style*='list-style-type']").each(function() { 294 $(this).addClass("site-no-custom-link") 295 }); 296 } 297 } 298 299 if ($("body:not(.cms-page-is-in-edit-mode)").length) { 300 removeCustomlistStyle(); 301 } 302 303 setTimeout (function() { 304 removeCustomlistStyle(); 305 }, 1000); 306 307 308 309 310 if ($(window).width() < 600) { 311 $(".site-display-filter-title").click(function () { 312 $(this).next(".site-display-filter-desc").slideToggle(); 313 $(this).toggleClass("site-display-filter-title-active") 314 }); 315 } 316 317 318 if ($("body:not(.cms-page-is-in-edit-mode) .ck5-site-table-accordion").length) { 319 $(".ck5-site-table-accordion").each(function () { 320 $(this).addClass("site-table-accordion"); 321 }); 322 } 323 324 325 if ($("body:not(.cms-page-is-in-edit-mode) .ck5-site-table-accordion-arrow-first").length) { 326 console.log("arrow first in if") 327 $(".ck5-site-table-accordion-arrow-first").each(function () { 328 console.log("arrow first in each") 329 $(this).addClass("site-table-accordion-arrow-first"); 330 $(this).addClass("site-table-accordion") 331 }); 332 } 333 334 335 if ($("body:not(.cms-page-is-in-edit-mode) .site-table-accordion").length) { 336 337 $(".site-table-accordion tr").each(function () { 338 $(this).addClass("site-tbl-accordion-row"); 339 340 $(this).children("th").each(function () { 341 $(this).parent("tr").addClass("site-tbl-accordion-header"); 342 }); 343 344 $(this).children("td").each(function () { 345 $(this).parent("tr").addClass("site-tbl-accordion-desc"); 346 }); 347 348 $(this).find("table").addClass("site-tbl-accordion-sub-tbl") 349 $(".site-tbl-accordion-sub-tbl").find("tr").removeClass() 350 $(".site-tbl-accordion-sub-tbl").find("th").removeClass() 351 $(".site-tbl-accordion-sub-tbl").find("td").removeClass() 352 }); 353 354 $(".site-table-accordion tr.site-tbl-accordion-header").each(function () { 355 }); 356 357 // Start JS for ck5-site-table-accordion - Appling same strture as old accordion so that FED dont need style again 358 if ($("body:not(.cms-page-is-in-edit-mode) .ck5-site-table-accordion").length) { 359 $(".ck5-site-table-accordion").each(function () { 360 $(this).find("tr").addClass("site-tbl-accordion-row"); 361 $(this).find("tr").addClass("site-tbl-accordion-desc"); 362 363 if($(this).find("td").hasClass("ck5-site-table-accordion-title")) { 364 $(this).find("td.ck5-site-table-accordion-title").parent("tr").addClass("site-tbl-accordion-header").removeClass("site-tbl-accordion-desc") 365 } 366 367 $(this).find("td.ck5-site-table-accordion-title").replaceWith(function () { 368 return $("<th>", { 369 html: $(this).html(), // keep content 370 class: $(this).attr("class"), // keep class 371 }); 372 }); 373 }); 374 } 375 376 // Start JS for ck5-site-table-accordion - Appling same strture as old accordion so that FED dont need style again 377 if ($("body:not(.cms-page-is-in-edit-mode) .ck5-site-table-accordion-arrow-first").length) { 378 $(".ck5-site-table-accordion-arrow-first").each(function () { 379 $(this).find("tr").addClass("site-tbl-accordion-row"); 380 $(this).find("tr").addClass("site-tbl-accordion-desc"); 381 382 if($(this).find("td").hasClass("ck5-site-table-accordion-title")) { 383 $(this).find("td.ck5-site-table-accordion-title").parent("tr").addClass("site-tbl-accordion-header").removeClass("site-tbl-accordion-desc") 384 } 385 386 $(this).find("td.ck5-site-table-accordion-title").replaceWith(function () { 387 return $("<th>", { 388 html: $(this).html(), // keep content 389 class: $(this).attr("class"), // keep class 390 }); 391 }); 392 }); 393 } 394 395 396 397 $(".site-table-accordion tr.site-tbl-accordion-header").each(function () { 398 $(this).nextUntil('tr.site-tbl-accordion-header').find(' > td').wrap("<div class='site-tbl-accordion-desc-wrapper'></div>"); 399 400 $(this).click(function () { 401 $(this).toggleClass("site-tbl-accordion-header-active"); 402 $(this).nextUntil('tr.site-tbl-accordion-header').toggleClass("site-tbl-accordion-desc-active"); 403 $(this).nextUntil('tr.site-tbl-accordion-header').find('.site-tbl-accordion-desc-wrapper').slideToggle(); 404 if ($(this).nextUntil('tr.site-tbl-accordion-header').find('.site-tbl-accordion-desc-wrapper').find("iframe")) { 405 406 var iframe_block = $(this).nextUntil('tr.site-tbl-accordion-header').find('.site-tbl-accordion-desc-wrapper').find("iframe"); 407 408 iframeReload(iframe_block.get(0)); 409 } 410 }); 411 412 }); 413 } 414 415 416 // Start JS for ck5-site-table-tabs - Appling same strture as old tabs so that FED dont need style again 417 if ($("body:not(.cms-page-is-in-edit-mode) .ck5-site-table-tabs").length) { 418 $(".ck5-site-table-tabs").each(function () { 419 $(this).addClass("site-table-tabs"); 420 if($(this).find("td").hasClass("ck5-site-table-tabs-title")) { 421 $(this).find("td.ck5-site-table-tabs-title").parent("tr").addClass("site-tbl-tab-header"); 422 } 423 424 $("td.ck5-site-table-tabs-title").replaceWith(function () { 425 return $("<th>", { 426 html: $(this).html(), // keep content 427 class: $(this).attr("class"), // keep class 428 }); 429 }); 430 }); 431 } 432 433 if ($("body:not(.cms-page-is-in-edit-mode) .site-table-tabs").length) { 434 $(".site-table-tabs").each(function() { 435 var $this = $(this); 436 var $table_tr = $this.find("tbody:first > tr"); 437 var $table_th = $this.find(".site-tbl-tab-header"); 438 439 //now next loop 440 $.each($table_tr, function(n, e) 441 { 442 $(this).children("th").each(function () { 443 $(this).parent("tr").addClass("site-tbl-tab-header"); 444 }); 445 }); 446 447 $('.site-tbl-tab-header').each(function () { 448 var $nextGroup = $(this).nextUntil('.site-tbl-tab-header'); 449 $nextGroup.add($nextGroup).wrapAll('<div class="site-tbl-tab-desc"><div class="site-tbl-tab-desc-block"></div></div>'); 450 }); 451 452 $this.find('.site-tbl-tab-header').wrapAll('<div class="site-tbl-tab-header-wrapper"></div>').andSelf(); 453 $this.find('.site-tbl-tab-header-wrapper').addClass("site-tbl-tab-header-"+$this.find('.site-tbl-tab-header-wrapper').children().length) 454 455 $this.find('.site-tbl-tab-desc').wrapAll('<div class="site-tbl-tab-desc-wrapper"></div>').andSelf(); 456 457 $this.find(".site-tbl-tab-header-wrapper .site-tbl-tab-header:first").addClass("site-tbl-tab-header-active"); 458 $this.find(".site-tbl-tab-desc-wrapper .site-tbl-tab-desc:first").addClass("site-tbl-tab-desc-active") 459 460 $this.find(".site-tbl-tab-header").click(function() { 461 $this.find(".site-tbl-tab-header").removeClass("site-tbl-tab-header-active"); 462 $this.find(".site-tbl-tab-desc").removeClass("site-tbl-tab-desc-active"); 463 464 $(this).addClass("site-tbl-tab-header-active"); 465 var tab_header_index = $(this).index(); 466 $this.find('.site-tbl-tab-desc-wrapper .site-tbl-tab-desc').eq(tab_header_index).addClass("site-tbl-tab-desc-active") 467 }); 468 469 $this.find('.site-tbl-tab-desc').each(function () { 470 $("<div class='site-tbl-tab-accordion-title'>accr titil</div>").prependTo($(this)); 471 }); 472 473 $this.find(".site-tbl-tab-header").each(function () { 474 var tab_header_index = $(this).index(); 475 $this.find('.site-tbl-tab-desc-wrapper .site-tbl-tab-desc .site-tbl-tab-accordion-title').eq(tab_header_index).text($(this).text()); 476 }); 477 478 $this.find(".site-tbl-tab-accordion-title").click(function() { 479 480 if($(this).hasClass("site-tbl-tab-accordion-title-active")) {
481 $this.find(".site-tbl-tab-desc-block").slideUp(); 482 $this.find(".site-tbl-tab-accordion-title").removeClass("site-tbl-tab-accordion-title-active") 483 return true; 484 } 485 486 $this.find(".site-tbl-tab-accordion-title").removeClass("site-tbl-tab-accordion-title-active") 487 $this.find(".site-tbl-tab-desc-block").slideUp() 488 $(this).addClass("site-tbl-tab-accordion-title-active") 489 $(this).next(".site-tbl-tab-desc-block").slideDown().addClass("site-tbl-tab-desc-block-active") 490 }) 491 }); 492 } 493 494 $(function () { 495 // CONFIG 496 const TYPING_INTERVAL = 300; 497 const DELETING_INTERVAL = 100; 498 const PAUSE_AFTER_TYPED = 600; 499 500 // For every block on page 501 $("ul.site-style-tt").each(function () { 502 503 const $block = $(this); 504 $block.hide(); 505 506 // Locate target, if missing create one 507 let $target = $block.find(".typewriter-target"); 508 if (!$target.length) { 509 $target = $('<div class="typewriter-target"></div>').insertBefore($block); 510 } 511 512 // The static text that is already inside typewriter-target 513 const staticText = $target.text().trim(); 514 515 // Collect words from UL inside this same block 516 const words = $block.find("li").map(function () { 517 return $(this).text().trim(); 518 }).get(); 519 520 if (!words.length) return; 521 522 let index = 0; 523 let letter = 0; 524 let deleting = false; 525 526 function loop() { 527 const word = words[index]; 528 const output = staticText + word.substring(0, Math.max(0, letter)); 529 530 $target.text(output); 531 532 if (!deleting) { 533 letter++; 534 } else { 535 letter--; 536 } 537 538 // Finished typing 539 if (!deleting && letter === word.length + 1) { 540 letter = word.length; 541 setTimeout(() => { 542 deleting = true; 543 loop();
544 }, PAUSE_AFTER_TYPED); 545 return; 546 } 547 548 // Finished deleting 549 if (deleting && letter === 0) { 550 deleting = false; 551 index = (index + 1) % words.length; 552 } 553 554 setTimeout(loop, deleting ? DELETING_INTERVAL : TYPING_INTERVAL); 555 } 556 557 loop(); 558 }); 559 }); 560 561 562 563 if ($(".site-thumbnail").length) { 564 565 $('.site-thumbnail:not(.site-thumbnail-show-desc-popup) .site-thumbnail-wrapper').each(function () { 566 var desc_data = ""; 567 568 $(this).magnificPopup({ 569 delegate: '.site-thumbnail-link', // the selector for gallery item 570 type: 'image', 571 mainClass: 'mfp-with-zoom', 572 gallery: { 573 enabled: true 574 }, 575 image: { 576 tError: 'Image could not load', 577 578 markup: '<div class="mfp-figure">' + 579 '<div class="mfp-close"></div>' + 580 '<figure><div class="mfp-img"></div>' + 581 '<figcaption><div class="mfp-bottom-bar">' + 582 '<div class="mfp-title"></div>' + 583 '<div class="mfp-counter"></div>' + 584 '</div></figcaption></figure>' + 585 '</div>', // Popup HTML markup. `.mfp-img` div will be replaced with img tag, 586 titleSrc: function (item) { 587 return item.el.parents(".site-thumbnail-block").find(".site-thumbnail-more-desc").clone(); 588 }, 589 }, 590 zoom: { 591 enabled: true, 592 593 duration: 300, // duration of the effect, in milliseconds 594 easing: 'ease-in-out', // CSS transition easing function 595 opener: function (openerElement) { 596 return openerElement.is('img') ? openerElement : openerElement.find('img'); 597 } 598 }, 599 600 }); 601 }); 602 603 604 $('.site-thumbnail.site-thumbnail-show-desc-popup .site-thumbnail-wrapper').each(function () { 605 var desc_data = ""; 606 607 $(this).magnificPopup({ 608 delegate: '.site-thumbnail-link', // the selector for gallery item 609 type: 'image', 610 mainClass: 'mfp-with-zoom', 611 gallery: { 612 enabled: true 613 }, 614 image: { 615 tError: 'Image could not load', 616 617 markup: '<div class="mfp-figure">' + 618 '<div class="mfp-close"></div>' + 619 '<figure><div class="mfp-img"></div>' + 620 '<figcaption><div class="mfp-bottom-bar">' + 621 '<div class="mfp-title"></div>' + 622 '<div class="mfp-counter"></div>' + 623 '</div></figcaption></figure>' + 624 '</div>', // Popup HTML markup. `.mfp-img` div will be replaced with img tag, 625 626 titleSrc: function (item) { 627 return item.el.parents(".site-thumbnail-block").find(".site-thumbnail-desc").clone(); 628 }, 629 630 }, 631 zoom: { 632 enabled: true, 633 634 duration: 300, // duration of the effect, in milliseconds 635 easing: 'ease-in-out', // CSS transition easing function 636 opener: function (openerElement) { 637 return openerElement.is('img') ? openerElement : openerElement.find('img'); 638 } 639 }, 640 641 }); 642 }); 643 } 644 645 646 647 $(".site-thumbnail-block .site-thumbnail-desc").each(function () { 648 if ($.trim($(this).html()) == '') { 649 $(this).remove(); 650 } 651 }); 652 653 $(".site-thumbnail-block .site-thumbnail-more-desc").each(function () { 654 if ($.trim($(this).html()) == '') { 655 $(this).parents(".site-thumbnail-block").addClass("site-thumbnail-no-more-desc") 656 $(this).remove(); 657 658 } 659 });
660 661 662 663 // POPUP SLIDER 664 $(".site-slider-pop-wrapper").each(function (index) { 665 $(this).click(function () { 666 if (!($(this).hasClass("site-active-slider-pop-wrapper"))) { 667 $(".site-slider-pop-wrapper").removeClass("site-active-slider-pop-wrapper"); 668 } 669 670 $(this).toggleClass("site-active-slider-pop-wrapper"); 671 $(".site-slider-popup .slick-arrow").toggleClass("hidden-block") 672 673 return true; 674 675 }); 676 }); 677 678 679 //We initialiaze Masonry only if there is an integration feature Directory present in the page 680 $("body:not(.cms-page-is-in-edit-mode) .site-feature-accordion-wrapper").each(function () { 681 $(this).find(".cms-feature-datablock").hide(); 682 }); 683 684 $("body:not(.cms-page-is-in-edit-mode) .site-feature-accordion-wrapper .cms-feature-title").click(function () { 685 686 $(this).parents(".site-feature-accordion-wrapper").toggleClass("site-feature-accordion-active").find(".cms-feature-datablock").slideToggle(); 687 688 if ($(this).parents(".site-feature-accordion-wrapper").find(".cms-feature-datablock").find("iframe")) { 689 var iframe_block = $(this).parents(".site-feature-accordion-wrapper").find(".cms-feature-datablock").find("iframe"); 690 691 iframeReload(iframe_block.get(0)); 692 } 693 694 }); 695 696 697}); 698 699function iframeReload(iframe) { 700 if (iframe) { 701 try { 702 iframe.contentDocument.location.reload(); 703 } catch (e) { 704 705 } 706 } 707} 708 709 710 711$(document).ready(function () { 712 $(window).scroll(function () { 713 $('*[class*="site-animation-"]').each(function () { 714 var pos = $(this).position(); 715 var windowpos = $(window).scrollTop(); 716 717 var a = $(window).innerHeight() + $(window).scrollTop() 718 719 //if (windowpos >= pos.top) { 720 if ($(this).offset().top < $(window).innerHeight() + $(window).scrollTop() - 300) { 721 $(this).addClass("site-animation-active"); // replace this by whatever class you want 722 723 } else { 724 725 if ($(this).hasClass('site-animation-right-wrapper') || $(this).hasClass('site-animation-left-wrapper')) { 726 return 727 } else if (!$(this).hasClass('site-animation-right-wrapper') || !$(this).hasClass('site-animation-left-wrapper')) { 728 $(this).removeClass("site-animation-active"); 729 } 730 } 731 }); 732 }); 733}); 734 735// .cms-drag-drop-block 736$(function () { 737 var $container = $('#OrphanedFeaturesContainer'); 738 var $handle = $container.find('.cms-drag-drop-block'); 739 var headerHeight = 72; 740 741 var isDragging = false; 742 var mouseDiffX = 0; 743 var mouseDiffY = 0; 744 745 $handle.on('mousedown', function (e) { 746 e.preventDefault(); 747 isDragging = true; 748 749 // Get container's current position 750 var containerPos = $container.position(); 751 752 // Get handle's position inside the container 753 var handlePos = $handle.position(); 754 755 // Calculate where the mouse is inside the handle 756 mouseDiffX = e.clientX - (containerPos.left + handlePos.left); 757 mouseDiffY = e.clientY - (containerPos.top + handlePos.top); 758 759 $container.css('z-index', 100001).addClass('dragging'); 760 }); 761 762 $(document).on('mousemove', function (e) { 763 if (!isDragging) return; 764 765 // Keep mouse locked to the handle 766 var handlePos = $handle.position(); 767 var newLeft = e.clientX - mouseDiffX - handlePos.left; 768 var newTop = e.clientY - mouseDiffY - handlePos.top; 769 770 // Clamp inside viewport 771 var winW = $(window).width(); 772 var winH = $(window).height(); 773 var cW = $container.outerWidth(); 774 var cH = $container.outerHeight(); 775 776 newLeft = Math.max(0, Math.min(newLeft, winW - cW)); 777 newTop = Math.max(headerHeight, Math.min(newTop, winH - cH)); 778 779 $container.css({ left: newLeft, top: newTop }); 780 });
781 782 $(document).on('mouseup', function () { 783 if (!isDragging) return; 784 isDragging = false; 785 $container.css('z-index', 100000).removeClass('dragging'); 786 }); 787}); 788 789 790 791
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.