vendor
7 years ago
admin.js
1 year ago
ads.js
1 year ago
carousel.js
1 year ago
carousel.min.js
2 years ago
documents-viewer-script.js
3 years ago
embed-ui.min.js
11 months ago
front.js
1 year ago
gallery-justify.js
1 year ago
glider.js
1 year ago
glider.min.js
2 years ago
gutneberg-script.js
1 year ago
index.html
7 years ago
initCarousel.js
2 years ago
initplyr.js
2 years ago
instafeed.js
2 years ago
license.js
2 years ago
pdfobject.js
1 year ago
plyr.js
1 year ago
plyr.polyfilled.js
3 years ago
preview.js
10 months ago
remove-round-button.js
11 months ago
settings.js
6 years ago
vimeo-player.js
2 years ago
ytiframeapi.js
2 years ago
remove-round-button.js
143 lines
| 1 | /** |
| 2 | * Alternative approach to remove jx-svg-round-button |
| 3 | * This script intercepts iframe creation and modifies the content |
| 4 | */ |
| 5 | |
| 6 | (function() { |
| 7 | 'use strict'; |
| 8 | |
| 9 | // Store original createElement method |
| 10 | const originalCreateElement = document.createElement; |
| 11 | |
| 12 | // Override createElement to intercept iframe creation |
| 13 | document.createElement = function(tagName) { |
| 14 | const element = originalCreateElement.call(this, tagName); |
| 15 | |
| 16 | if (tagName.toLowerCase() === 'iframe') { |
| 17 | // Add load event listener to remove round buttons |
| 18 | element.addEventListener('load', function() { |
| 19 | setTimeout(() => { |
| 20 | try { |
| 21 | const iframeDoc = element.contentDocument || element.contentWindow.document; |
| 22 | if (iframeDoc) { |
| 23 | // Remove existing round buttons |
| 24 | const roundButtons = iframeDoc.querySelectorAll('.jx-svg-round-button, .jx-carousel-title'); |
| 25 | roundButtons.forEach(button => { |
| 26 | button.style.display = 'none'; |
| 27 | button.remove(); |
| 28 | }); |
| 29 | |
| 30 | // Add CSS to prevent future round buttons |
| 31 | const style = iframeDoc.createElement('style'); |
| 32 | style.textContent = '.jx-svg-round-button, .jx-carousel-title { display: none !important; }'; |
| 33 | iframeDoc.head.appendChild(style); |
| 34 | |
| 35 | // Watch for dynamically added round buttons |
| 36 | const observer = new MutationObserver(function(mutations) { |
| 37 | mutations.forEach(function(mutation) { |
| 38 | mutation.addedNodes.forEach(function(node) { |
| 39 | if (node.nodeType === 1) { |
| 40 | if (node.classList && node.classList.contains('jx-svg-round-button')) { |
| 41 | node.remove(); |
| 42 | } else if (node.querySelectorAll) { |
| 43 | const newRoundButtons = node.querySelectorAll('.jx-svg-round-button, .jx-carousel-title'); |
| 44 | newRoundButtons.forEach(button => button.remove()); |
| 45 | } |
| 46 | } |
| 47 | }); |
| 48 | }); |
| 49 | }); |
| 50 | |
| 51 | observer.observe(iframeDoc.body, { |
| 52 | childList: true, |
| 53 | subtree: true |
| 54 | }); |
| 55 | } |
| 56 | } catch (e) { |
| 57 | // Cross-origin iframe, try alternative approach |
| 58 | console.log('Cross-origin iframe detected, using alternative method'); |
| 59 | |
| 60 | // Try to modify the iframe src to include custom CSS |
| 61 | const src = element.getAttribute('src'); |
| 62 | if (src && !src.includes('hide-round-button')) { |
| 63 | // This would need to be implemented based on the specific iframe source |
| 64 | console.log('Would need to modify iframe source:', src); |
| 65 | } |
| 66 | } |
| 67 | }, 100); |
| 68 | }); |
| 69 | } |
| 70 | |
| 71 | return element; |
| 72 | }; |
| 73 | |
| 74 | // Also handle existing iframes |
| 75 | function processExistingIframes() { |
| 76 | const iframes = document.querySelectorAll('iframe'); |
| 77 | iframes.forEach(iframe => { |
| 78 | if (!iframe.dataset.processedForRoundButton) { |
| 79 | iframe.dataset.processedForRoundButton = 'true'; |
| 80 | |
| 81 | if (iframe.contentDocument) { |
| 82 | // Same-origin iframe |
| 83 | try { |
| 84 | const iframeDoc = iframe.contentDocument; |
| 85 | const roundButtons = iframeDoc.querySelectorAll('.jx-svg-round-button, .jx-carousel-title'); |
| 86 | roundButtons.forEach(button => button.remove()); |
| 87 | |
| 88 | const style = iframeDoc.createElement('style'); |
| 89 | style.textContent = '.jx-svg-round-button, .jx-carousel-title { display: none !important; }'; |
| 90 | iframeDoc.head.appendChild(style); |
| 91 | } catch (e) { |
| 92 | console.log('Cannot access iframe content'); |
| 93 | } |
| 94 | } else { |
| 95 | // Cross-origin iframe, add load listener |
| 96 | iframe.addEventListener('load', function() { |
| 97 | try { |
| 98 | const iframeDoc = iframe.contentDocument || iframe.contentWindow.document; |
| 99 | if (iframeDoc) { |
| 100 | const roundButtons = iframeDoc.querySelectorAll('.jx-svg-round-button, .jx-carousel-title'); |
| 101 | roundButtons.forEach(button => button.remove()); |
| 102 | } |
| 103 | } catch (e) { |
| 104 | console.log('Cross-origin iframe, cannot access content'); |
| 105 | } |
| 106 | }); |
| 107 | } |
| 108 | } |
| 109 | }); |
| 110 | } |
| 111 | |
| 112 | // Process existing iframes when DOM is ready |
| 113 | if (document.readyState === 'loading') { |
| 114 | document.addEventListener('DOMContentLoaded', processExistingIframes); |
| 115 | } else { |
| 116 | processExistingIframes(); |
| 117 | } |
| 118 | |
| 119 | // Watch for new iframes |
| 120 | const observer = new MutationObserver(function(mutations) { |
| 121 | mutations.forEach(function(mutation) { |
| 122 | mutation.addedNodes.forEach(function(node) { |
| 123 | if (node.nodeType === 1) { |
| 124 | if (node.tagName === 'IFRAME') { |
| 125 | processExistingIframes(); |
| 126 | } else if (node.querySelectorAll) { |
| 127 | const newIframes = node.querySelectorAll('iframe'); |
| 128 | if (newIframes.length > 0) { |
| 129 | processExistingIframes(); |
| 130 | } |
| 131 | } |
| 132 | } |
| 133 | }); |
| 134 | }); |
| 135 | }); |
| 136 | |
| 137 | observer.observe(document.body, { |
| 138 | childList: true, |
| 139 | subtree: true |
| 140 | }); |
| 141 | |
| 142 | })(); |
| 143 |