1document.addEventListener("DOMContentLoaded", function () { 2 // topç³» 3 if (window.location.pathname === "/" || window.location.pathname === "/index.html") { 4 const sections = [ 5 { selector: '.section-top_latest a', module: 'toppage_new' }, 6 { selector: '.section-top_brandvoice a', module: 'toppage_bs' }, 7 { selector: '.section-top_feature a', module: 'toppage_feature' }, 8 { selector: '.section-top_career a', module: 'toppage_career' }, 9 { selector: '.section-ranking a', module: 'toppage_popular' }, 10 { selector: '.section-top_award a', module: 'toppage_award' }, 11 { selector: '.section-top_issue a', module: 'toppage_specialissue' }, 12 { 13 selector: '.section-top_magazine a', 14 module: 'toppage_magazine', 15 condition: (href) => href.includes("/magazine/list/forbesjapan") 16 }, 17 { selector: '.section-top-main__list .section-top-main__item > a' } 18 ]; 19 20 sections.forEach(section => { 21 const elements = document.querySelectorAll(section.selector); 22 23 if (elements && elements.length > 0) { 24 elements.forEach((elem, index) => { 25 if (!section.condition || (section.condition && section.condition(elem.getAttribute("href")))) { 26 let moduleValue = section.module; 27 28 if (section.selector === '.section-top-main__list .section-top-main__item > a') { 29 const sNum = index + 1; 30 moduleValue = `toppage_1st_0${sNum}`; 31 } 32 33 elem.setAttribute("href", elem.getAttribute("href") + `?module=${moduleValue}`); 34 } 35 }); 36 } 37 }); 38 } 39});
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.