document.addEventListener("DOMContentLoaded", function() { // Function to handle the gallery titles function handleGalleryTitles() { var galleryTitles = document.querySelectorAll('.galleryTitle.gallery_shortTitle'); galleryTitles.forEach(function(title) { if (title.textContent.includes('OFFSITE')) { var bidSpan = title.querySelector('span.small'); if (bidSpan) { bidSpan.innerHTML += ' *OFFSITE PICKUP*'; } } }); } // Function to handle the LotDetails page function handleLotDetails() { if (window.location.href.includes('LotDetails')) { var detailTitle = document.querySelector('.detail__title'); if (detailTitle && detailTitle.textContent.includes('OFFSITE')) { var detailPrice = document.querySelector('.detail__submit-wrapper .detail__price'); if (detailPrice) { var offsitePickup = document.createElement('div'); offsitePickup.style.color = 'red'; offsitePickup.style.fontWeight = 'bold'; offsitePickup.innerHTML = '**OFFSITE PICKUP**'; detailPrice.parentNode.insertBefore(offsitePickup, detailPrice); } } } } // Function to handle modal mutations function handleModalMutations() { let observer; function checkAndAddOffsitePickup() { var modalTitle = document.querySelector('.bootstrap-dialog-title'); if (modalTitle && modalTitle.textContent.includes('OFFSITE')) { var bidConfirmation = document.querySelector('.modal-body .text-success strong'); if (bidConfirmation) { var existingOffsitePickup = document.querySelector('.modal-body .offsite-pickup'); if (existingOffsitePickup) { existingOffsitePickup.remove(); } var offsitePickupModal = document.createElement('div'); offsitePickupModal.style.color = 'red'; offsitePickupModal.style.fontWeight = 'bold'; offsitePickupModal.classList.add('offsite-pickup'); offsitePickupModal.innerHTML = '**OFFSITE PICKUP**'; bidConfirmation.appendChild(offsitePickupModal); } } } function observeModal() { if (observer) { observer.disconnect(); } observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { if (mutation.type === 'childList') { mutation.addedNodes.forEach(function(node) { if (node.nodeType === 1 && node.classList && (node.classList.contains('modal') || node.classList.contains('modal-backdrop'))) { setTimeout(checkAndAddOffsitePickup, 100); // Reduced delay for faster appearance } }); mutation.removedNodes.forEach(function(node) { if (node.nodeType === 1 && node.classList && (node.classList.contains('modal') || node.classList.contains('modal-backdrop'))) { setTimeout(observeModal, 100); } }); } }); }); var config = { childList: true, subtree: true }; observer.observe(document.body, config); } observeModal(); checkAndAddOffsitePickup(); } // Call the functions handleGalleryTitles(); handleLotDetails(); handleModalMutations(); });

Sorry, there were no results for your search.

Try using the Advanced Search