1/* 2 * To change this license header, choose License Headers in Project Properties. 3 * To change this template file, choose Tools | Templates 4 * and open the template in the editor. 5 */ 6jQuery(document).ready(function ($) { 7 8 if (jQuery(document).find("#ez-toc-container").length > 0) { 9 var h2Count = 0; 10 var h3Count = 0; 11 jQuery(".post-content h2, .post-content h3").each(function (index) { 12 if (this.tagName.toLowerCase() === "h2") { 13 h2Count++; 14 h3Count = 0; 15 jQuery(this).attr("id", "toc-data-count-" + h2Count).attr("data-count", ("0" + h2Count).slice(-2)); 16 } else { 17 h3Count++; 18 jQuery(this).attr("id", "toc-data-count-" + h2Count + "-" + h3Count).attr("data-count", ("0" + h2Count).slice(-2) + h3Count); 19 } 20 }); 21 } 22 var tocLinks = jQuery(".ez-toc-link"); 23var headings = jQuery("h2[data-count], h3[data-count]"); 24function removeActiveClasses() { 25 jQuery(".ez-toc-list li").removeClass("active"); 26} 27// TOC click 28tocLinks.on("click", function (e) { 29 e.preventDefault(); 30 var target = jQuery(jQuery(this).attr("href")); 31 if (target.length) { 32 jQuery("html, body").stop().animate({ 33 scrollTop: target.offset().top - 150 34 }, 500); 35 } 36}); 37// Scroll 38jQuery(window).on("scroll", function () { 39 var scrollPosition = jQuery(window).scrollTop() + 160; 40 headings.each(function (index) { 41 42 var headingTop = jQuery(this).offset().top; 43 var headingBottom = headingTop + jQuery(this).outerHeight(); 44 if (scrollPosition >= headingTop && scrollPosition < headingBottom) { 45 removeActiveClasses(); 46 tocLinks.eq(index).parent().addClass("active"); 47 return false; // stop loop 48 } 49 }); 50}); 51// TOC toggle 52jQuery(".ez-toc-title-toggle").on("click", function (e) { 53 e.preventDefault(); 54 jQuery("#ez-toc-container nav").slideToggle(); 55}); 56 // COMMON ACCORDION 57 document.querySelectorAll("[accordion-wrapper]").forEach(wrapper => { 58 const items = wrapper.querySelectorAll("[accordion-item]"); 59 items.forEach((item, index) => { 60 const title = item.querySelector("[accordion-title]"); 61 const content = item.querySelector("[accordion-content]"); 62 const openAccordion = () => { 63 item.classList.add("active"); 64 const innerScroll = content.querySelector(".custom-scroll"); 65 if (innerScroll) { 66 const maxHeight = 138; 67 const height = Math.min(innerScroll.scrollHeight, maxHeight); 68 content.style.height = height + "px"; 69 } else { 70 content.style.height = content.scrollHeight + "px"; 71 } 72 }; 73 title.addEventListener("click", () => { 74 const isOpen = item.classList.contains("active"); 75 // close all items inside this wrapper 76 items.forEach(i => { 77 i.classList.remove("active"); 78 i.querySelector("[accordion-content]").style.height = "0px"; 79 }); 80 // open clicked item 81 if (!isOpen) { 82 openAccordion(); 83 } 84 }); 85 // Open first item by default 86 if (index === 0) { 87 openAccordion(); 88 } 89 }); 90 }); 91 /* 92 * Tab script for agile process section 93 */ 94 jQuery(function ($) { 95 jQuery(".tabs-container .tab-click").on("click", function (event) { 96 event.preventDefault(); 97 jQuery(this).addClass("current"); 98 if (jQuery(".scrum-events-section").length > 0 || jQuery(".pros-cons-section").length > 0) { 99 jQuery(this).parent().siblings().find("a").removeClass("current"); 100 } 101 var tab = jQuery(this).attr("data-tab"); 102 jQuery(this).parents(".tabs-container").siblings(".tab-content-wrapper").find(".tab-content").css("display", "none"); 103 jQuery(this).parents(".tab-wrapper").find(tab).fadeIn(); 104 }).filter(":first").click(); 105 if (jQuery(".scrum-events-section").length > 0) { 106 jQuery(".scrum-events-section .tabs-container ul li:first-child a").trigger("click"); 107 } 108 if ($(".scrum-events-section").length > 0 && $(window).width() < 992) { 109 //$('.scrum-events-section .event-tabs-wrapper').insertBefore('.scrum-events-section .event-tab-content .green-box'); 110 $(".scrum-events-section .tab-content-wrapper .tab-content").each(function () { 111 $(this).find(".event-tabs-wrapper").insertBefore($(this).find(".green-box")); 112 }); 113 } 114 if (jQuery(".pros-cons-section").length > 0) { 115 jQuery(".pros-cons-section .tabs-container ul li:first-child a").trigger("click"); 116 } 117 }); 118 if (jQuery(".tabbing-dropdown .tabs-dropdown").length > 0) { 119 jQuery(".tabbing-dropdown .tabs-dropdown").each(function (i, elm) { 120 jQuery(elm).text(jQuery(elm).next("div").find("a.active").text()); 121 }); 122 jQuery(".tabbing-dropdown .tabs-dropdown").on("click", function (e) { 123 e.preventDefault(); 124 jQuery(e.target).toggleClass("open").next("div").slideToggle(); 125 }); 126 } 127 jQuery(".tabbing-dropdown .nav-tabs a").click(function (e) { 128 e.preventDefault(); 129 jQuery(this)
130 .closest(".nav-tabs") 131 .hide() 132 .prev(".tabs-dropdown") 133 .removeClass("open") 134 .text(jQuery(this).text()); 135 var tab_id = jQuery(this).attr("data-tab"); 136 if (!tab_id) 137 return; 138 jQuery(".tabbing-dropdown .nav-tabs a").removeClass("active"); 139 jQuery(this).addClass("active"); 140 if (jQuery(".industries-innovative").length > 0) { 141 jQuery(tab_id).addClass("active").siblings().removeClass("active"); 142 } else { 143 jQuery(tab_id).addClass("active"); 144 } 145 }); 146 // jQuery('.center-mode .ai_tools_slider_two_clm, .center-mode .slider-two, .center-mode .slider-three').slick({ 147 // dots: true, 148 // }); 149}); 150jQuery(window).on('load', function () { 151 jQuery(function ($) { 152 $('[data-content-overflow] table').wrap('<div class="table-wrapper"></div>'); 153 }); 154}); 155jQuery(window).scroll(function () { 156 var scroll = jQuery(window).scrollTop(); 157 var header = jQuery('header'); // Cache the header element for performance 158 if (scroll >= 50) { 159 header.addClass("scrolled"); 160 } else { 161 header.removeClass("scrolled"); 162 } 163 var sections = jQuery('h2[id]'); 164 var navLinks = jQuery('.ez-toc-link'); 165 var currentScroll = jQuery(this).scrollTop(); 166 sections.each(function (index) { 167 var current = jQuery(this); 168 var next = sections.eq(index + 1); 169 var sectionTop = current.offset().top - 200; 170 var sectionBottom = next.length ? next.offset().top - 200 : jQuery(document).height(); 171 if (currentScroll >= sectionTop && currentScroll < sectionBottom) { 172 var id = current.attr('id'); 173 navLinks.removeClass('active'); 174 jQuery('.ez-toc-list li').removeClass('active'); 175 var activeLink = jQuery('.ez-toc-link[href="#' + id + '"]'); 176 activeLink.addClass('active'); 177 activeLink.closest('li').addClass('active'); 178 } 179 }); 180});
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.