1class ExpertenForum { 2 constructor () { 3 this.init() 4 } 5 6 init () { 7 this.observeMutations() 8 this.modifyNavTabs() 9 this.modifyLandingPageRow() 10 this.removeCardBodies() 11 //this.modifyListGroupItemHeadings() 12 //this.addThemeButton() 13 } 14 15 observeMutations () { 16 const observer = new MutationObserver(mutations => { 17 mutations.forEach(mutation => { 18 if (mutation.type === 'childList') { 19 mutation.addedNodes.forEach(node => { 20 if (node.nodeType === 1 && node.matches('.list-events-year')) { 21 const parent = node.parentNode 22 const day = parent.querySelector('.list-events-day') 23 const month = parent.querySelector('.list-events-month') 24 const year = parent.querySelector('.list-events-year') 25 if (day && month && year) { 26 parent.insertBefore(day, month) 27 observer.disconnect() 28 } 29 } 30 }) 31 } 32 }) 33 }) 34 observer.observe(document.body, { childList: true, subtree: true }) 35 } 36 37 modifyNavTabs () { 38 document.querySelectorAll('.nav.nav-tabs').forEach(tabs => { 39 if (tabs) { 40 tabs.classList.add('nav-pills') 41 tabs.classList.remove('nav-tabs') 42 console.log('Tabs class modified:', tabs) 43 } 44 }) 45 } 46 47 modifyLandingPageRow () { 48 const landingPageRow = document.querySelector('#LandingPage > .row') 49 if (landingPageRow) { 50 landingPageRow.classList.remove('row-cols-lg-4') 51 console.log('Landing page row class modified') 52 } 53 } 54 55 removeCardBodies () { 56 document.querySelectorAll('#LandingPage .card-body').forEach(cardBody => { 57 if (cardBody) { 58 cardBody.remove() 59 console.log('Card body removed:', cardBody) 60 } 61 }) 62 } 63 64 modifyListGroupItemHeadings () { 65 document.querySelectorAll('.list-group-item-heading').forEach(element => { 66 element.innerHTML = element.innerHTML.replace(/\-+/g, '<br>-<br>') 67 }) 68 } 69 70 addThemeButton () { 71 const navItem = document.createElement('li') 72 navItem.className = 'nav-item' 73 navItem.innerHTML = ` 74 <div class="form-check form-switch nav-link"> 75 <input class="form-check-input" type="checkbox" checked id="custom-css-switch"> 76 <label class="form-check-label" for="custom-css-switch">Custom CSS</label> 77 </div> 78 ` 79 80 const homeNavItem = document.querySelector('.fa-home').closest('.nav-item') 81 homeNavItem.parentNode.insertBefore(navItem, homeNavItem) 82 83 document.getElementById('custom-css-switch').addEventListener('change', function () { 84 const regex = /\/ticket\-logos\/images\/.*\.css/ 85 const links = document.getElementsByTagName('link') 86 for (let i = links.length - 1; i >= 0; i--) { 87 if (regex.test(links[i].href)) { 88 links[i].disabled = !this.checked 89 } 90 } 91 }) 92 } 93} 94 95new ExpertenForum() 96 97class MischAboJS { 98 constructor () { 99 this.init() 100 } 101 102 init () { 103 this.updateButtons() 104 this.removeProgressBarClass() 105 this.addCardBodyClass() 106 this.replaceATags() 107 this.removeClassAttributes() 108 this.replaceButtonWrapperClass() 109 } 110 111 updateButtons () { 112 const buttonWrapper = document.querySelector('.button-wrapper') 113 if (buttonWrapper) { 114 const buttons = buttonWrapper.querySelectorAll('.btn-outline-dark, .btn-outline-success') 115 buttons.forEach(button => { 116 button.className = 'btn btn-primary mb-3' 117 button.addEventListener('click', function () { 118 if (button.getAttribute('aria-expanded') === 'true') { 119 button.style.borderBottomLeftRadius = '0' 120 button.style.borderBottomRightRadius = '0' 121 button.classList.remove('mb-3') 122 } else { 123 button.style.borderBottomLeftRadius = '' 124 button.style.borderBottomRightRadius = '' 125 button.classList.add('mb-3') 126 } 127 }) 128 }) 129 } 130 } 131 132 removeProgressBarClass () { 133 const progressBars = document.querySelectorAll('.progress-bar.bg-success')
134 progressBars.forEach(progressBar => { 135 progressBar.classList.remove('bg-success') 136 }) 137 } 138 139 wrapCardElement () { 140 const cardElement = document.querySelector('.card') 141 if (cardElement) { 142 const wrapperDiv = document.createElement('div') 143 wrapperDiv.className = 'col-12' 144 cardElement.parentNode.insertBefore(wrapperDiv, cardElement) 145 wrapperDiv.appendChild(cardElement) 146 147 cardElement.classList.add('bg-light') 148 cardElement.style.borderTopLeftRadius = '0' 149 150 const buttonSuccess = cardElement.querySelector('.btn.btn-outline-success.btn-event-list.list-item-search.my-auto') 151 if (buttonSuccess) { 152 buttonSuccess.className = 'btn btn-success' 153 } 154 } 155 } 156 157 addCardBodyClass () { 158 const rowNoGutters = document.querySelector('.row.no-gutters') 159 if (rowNoGutters) { 160 rowNoGutters.classList.add('card-body') 161 } 162 } 163 164 replaceATags () { 165 const aTags = document.querySelectorAll('a.card-title.list-group-item:not(.carousel-inner a.card-title.list-group-item)') 166 console.log('aTags:', aTags) 167 aTags.forEach((aTag) => { 168 console.log('aTag:', aTag) 169 const pTag = document.createElement('p') 170 pTag.innerHTML = aTag.innerHTML 171 aTag.parentNode.replaceChild(pTag, aTag) 172 }) 173 } 174 175 removeClassAttributes () { 176 const elementsToRemoveClasses = document.querySelectorAll('.card-title.list-group-item, .card-title') 177 elementsToRemoveClasses.forEach(element => { 178 element.classList.remove('card-title', 'list-group-item') 179 }) 180 } 181 182 replaceButtonWrapperClass () { 183 const buttonWrapper = document.querySelector('.button-wrapper:not(#event-calendar .list-group-events > article .button-wrapper)') 184 if (buttonWrapper) { 185 buttonWrapper.className = 'col-12' 186 } 187 } 188} 189 190document.addEventListener('DOMContentLoaded', () => { 191 new MischAboJS() 192})
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.