diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 341ecf3e..578c667a 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -488,13 +488,14 @@ export default function App() { const [widgetsReady, setWidgetsReady] = useState(false); const [autoRunReady, setAutoRunReady] = useState(() => !!urlPreload); const ethicalSlotRef = useRef(null); + const ethicalStickyRef = useRef(null); const isLocalhost = typeof window !== "undefined" && /^(localhost|127(?:\\.[0-9]+){3}|mac)$/i.test(window.location.hostname); const ethicalAdsEnabled = Boolean(ethicalAdsPublisher) && (!isLocalhost || env.VITE_ETHICALADS_DEV === "true"); - const ethicalAdType = "text"; + const ethicalAdType = "image"; const backendBase = (env.VITE_BACKEND_URL || "").replace(/\/$/, ""); @@ -1500,21 +1501,21 @@ export default function App() { }, [ethicalAdsEnabled]); useEffect(() => { - if (!ethicalAdsEnabled || !ethicalAdsReady || !ethicalSlotRef.current) return; - const doLoad = () => { + if (!ethicalAdsEnabled || !ethicalAdsReady) return; + const loadSlot = (ref) => { try { - if (ethicalSlotRef.current) { - ethicalSlotRef.current.innerHTML = ""; - window.ethicalads?.load(ethicalSlotRef.current); + if (ref.current) { + ref.current.innerHTML = ""; + window.ethicalads?.load(ref.current); } } catch {} }; - doLoad(); - // Retry if slot still empty after 1.5s (race: ethicalads init vs load event) + loadSlot(ethicalSlotRef); + loadSlot(ethicalStickyRef); + // Retry if slots still empty after 1.5s const t = window.setTimeout(() => { - if (ethicalSlotRef.current && !ethicalSlotRef.current.children.length) { - doLoad(); - } + if (ethicalSlotRef.current && !ethicalSlotRef.current.children.length) loadSlot(ethicalSlotRef); + if (ethicalStickyRef.current && !ethicalStickyRef.current.children.length) loadSlot(ethicalStickyRef); }, 1500); return () => window.clearTimeout(t); }, [ethicalAdsEnabled, ethicalAdsReady]); @@ -1523,6 +1524,17 @@ export default function App() { return (

XSLT Playground - Online XSLT Editor and Tester

+ {ethicalAdsEnabled && ( +
+ )}
- {ethicalAdsEnabled && ( -
- )} {isRunning ? (
@@ -2240,30 +2241,43 @@ export default function App() {
-
- {effectiveResultView === "render" && canRenderHtml ? ( -
-