MediaWiki:Common.js: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| (7 intermediate revisions by the same user not shown) | |||
| Line 2: | Line 2: | ||
/* | /* Forçar links de "Buy Now" a abrir em novo separador */ | ||
$(document).ready(function() { | |||
$('.button-buy-now a').attr('target', '_blank').attr('rel', 'noopener'); | |||
}); | |||
$(document).ready(function() { | $(document).ready(function() { | ||
var footerLinks = document.getElementById('footer-places'); | var footerLinks = document.getElementById('footer-places'); | ||
if (footerLinks) { | if (footerLinks && !document.getElementById('footer-custom-buttons-container')) { | ||
var | var container = document.createElement('li'); | ||
container.id = 'footer-custom-buttons-container'; | |||
footerLinks. | container.style.display = 'flex'; | ||
container.style.gap = '10px'; | |||
container.style.alignItems = 'center'; | |||
// Botão de Topo (Seta) | |||
var topBtn = '<a href="#" class="footer-top-button" title="Voltar ao topo">' + | |||
'<span class="material-symbols-outlined">arrow_upward</span></a>'; | |||
// Teu botão atual da Atronia | |||
var siteBtn = '<a href="https://atronia.eu" class="footer-button-atronia-real" target="_blank" rel="noopener">atronia.eu</a>'; | |||
container.innerHTML = topBtn + siteBtn; | |||
footerLinks.appendChild(container); | |||
// Função para scroll suave ao clicar na seta | |||
$('.footer-top-button').click(function(e) { | |||
e.preventDefault(); | |||
$('html, body').animate({scrollTop: 0}, 'slow'); | |||
}); | |||
} | } | ||
}); | }); | ||