.png">

Mise Ă  niveau vers Pro

#jesus #blessed #Godisgood #peace #godisLove #ameen #foryou
#jesus #blessed #Godisgood #peace #godisLove #ameen #foryou
6
·2KB Vue ·44 Plays
document.addEventListener("DOMContentLoaded", function () { waitForPublisherAndInject(); const btn = document.getElementById("tiktokBtn"); if (btn) { btn.addEventListener("click", function () { openTikTokModal(); checkTikTokStatus(); }); } }); function openTikTokModal() { document.getElementById("tiktokModal").style.display = "block"; } function closeTikTokModal() { document.getElementById("tiktokModal").style.display = "none"; } function checkTikTokStatus() { fetch("tiktok-check.php") .then(res => res.json()) .then(data => { let statusDiv = document.getElementById("tiktokStatus"); let actionDiv = document.getElementById("tiktokActions"); if (data.connected) { statusDiv.innerHTML = "✅ Connected to TikTok"; actionDiv.innerHTML = ` `; } else { statusDiv.innerHTML = "❌ Not connected"; actionDiv.innerHTML = ` `; } }); } function connectTikTok() { window.location.href = "tiktok-login.php"; } function waitForPublisherAndInject() { const observer = new MutationObserver(() => { const container = document.querySelector(".publisher-footer"); if (container && !document.getElementById("tiktokBtn")) { injectTikTokButton(); } }); observer.observe(document.body, { childList: true, subtree: true }); } function injectTikTokButton() { const container = document.querySelector(".publisher-footer"); if (!container) return; const btn = document.createElement("button"); btn.type = "button"; btn.className = "btn btn-danger btn-mat"; btn.id = "tiktokBtn"; btn.innerText = "Post to TikTok"; const postBtn = container.querySelector(".js_publisher"); if (postBtn) { postBtn.insertAdjacentElement("afterend", btn); } else { container.appendChild(btn); } }