1// Get the current page URL 2var currentPageUrl = window.location.pathname; 3 4// Extract the group ID from the URL 5var match = currentPageUrl.match(/^\/group\/(\d+)/); 6if (match) { 7 var groupId = match[1]; 8 9 // Replace "{js:group_id}" string in href links with the group ID 10 var linksForGroupIdCheck = document.getElementsByTagName('a'); 11 for (var i = 0; i < linksForGroupIdCheck.length; i++) { 12 var href = linksForGroupIdCheck[i].getAttribute('href'); 13 if (href && href.includes("{js:group_id}")) { 14 // Use a regular expression with the global flag to replace all occurrences 15 href = href.replace(/\{js:group_id\}/g, groupId); 16 linksForGroupIdCheck[i].setAttribute('href', href); 17 } 18 } 19}
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.