PageSourceSearch

https://www.affingroup.com/themes/demo/js/affin-group-5-tabs.js

js affingroup.com collected 2026-10-02 17:45:21 UTC 1,704 bytes, 53 lines download raw bytes

1function switchAffinGroup5Tab(tabName, event) {
2    let parentClassName = event.parentElement.parentElement.className.replace(/\ /g, '.');
3
4    // const tabs = document.querySelectorAll(`.${parentClassName} .tab`);
5
6    const tabPanelSelector = `.${parentClassName} .content-container > .tab`;
7
8    const tabs = document.querySelectorAll(tabPanelSelector);
9
10    let tabsChecker = [];
11
12    for (let i = 0; i < tabs.length; i++) {
13        if(!tabsChecker.includes(tabs[i].className)) {
14            tabs[i].style.display = "none";
15            tabsChecker.push(tabs[i].className);
16        }
17    }
18
19    // const tab = document.querySelector(`.${parentClassName} .tab.${tabName}`);
20
21    const tab = document.querySelector(`${tabPanelSelector}.${tabName}`);
22
23    if (tab) {
24        tab.style.display = "block";
25    }
26
27    const headerTab = document.querySelectorAll(`.${parentClassName} .col.tab-col`);
28    if (headerTab) {
29        for (let j = 0; j < headerTab.length; j++) {
30            headerTab[j].classList.remove('active');
31        }
32        const selectedTab = document.querySelector(`.${parentClassName} .col.tab-col.${tabName}`);
33        if (selectedTab) {
34            selectedTab.classList.add('active');
35        }
36    }
37}
38
39function switchTab5FirstTab() {
40    // const allTabs = document.querySelectorAll(".block-affin-group-5-tabs .tab");
41    
42    const allTabs = document.querySelectorAll(".block-affin-group-5-tabs .content-container > .tab");
43
44    for (let i = 0; i < allTabs.length; i++) {
45        if(!allTabs[i].classList.contains("tab-1")) {
46            allTabs[i].style.display = "none";
47        }
48    }
49}
50
51if (document.querySelector('.block-affin-group-5-tabs')) {
52    switchTab5FirstTab();
53}

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.