// Função para copiar o link base para a área de transferência
$(document).on('click', '.embedder_info', function() {
const linkToCopy = window.location.href.split('#')[0];
copyTextToClipboard(linkToCopy);
showCopiedMessage();
});
function copyTextToClipboard(text) {
const tempInput = document.createElement("input");
tempInput.value = text;
document.body.appendChild(tempInput);
tempInput.select();
document.execCommand("copy");
document.body.removeChild(tempInput);
}
function showCopiedMessage() {
const message = $('Link copiado!
');
$('body').append(message);
message.css({
position: 'fixed',
bottom: '20px',
right: '20px',
padding: '10px 20px',
backgroundColor: '#28a745',
color: '#fff',
fontSize: '16px',
borderRadius: '5px',
boxShadow: '0 4px 8px rgba(0, 0, 0, 0.2)',
zIndex: 1000
});
setTimeout(() => { message.fadeOut(500, () => message.remove()); }, 2000);
}
// Alterar de .embedder_info para .embedder_container
$(document).ready(function() {
$('.embedder_info').on('click', function(event) {
let dropdown = $(this).siblings('.embedder_dropdown');
if (dropdown.is(':visible')) {
dropdown.fadeOut(200);
} else {
dropdown.stop().fadeIn(200);
// Esconde após 3 segundos
setTimeout(() => { dropdown.fadeOut(200); }, 3000);
}
event.stopPropagation(); // Impede que o clique feche imediatamente
});
$(document).on('click', function(event) {
if (!$(event.target).closest('.embedder_container').length) {
$('.embedder_dropdown').fadeOut(200);
}
});
});
-->