Biurokraci, Moderatorzy czatu, checkuser, commenters, Moderatorzy (CommentStreams), gitkursanci, Administratorzy interfejsu, Moderatorzy, odkrywajacy, Page Ownership admin, swiadomikursanci, Administratorzy, Redaktorzy widżetów
969
edycji
Swiadomosc (dyskusja | edycje) mNie podano opisu zmian |
Swiadomosc (dyskusja | edycje) mNie podano opisu zmian Znaczniki: Z urządzenia mobilnego Z wersji mobilnej (przeglądarkowej) |
||
| Linia 69: | Linia 69: | ||
document.addEventListener('DOMContentLoaded', function() { | document.addEventListener('DOMContentLoaded', function() { | ||
// | // Create the custom list item | ||
function createCustomLink(id, text, onclickAction) { | |||
var li = document.createElement('li'); | var li = document.createElement('li'); | ||
li.id = id; | li.id = id; | ||
var a = document.createElement('a'); | var a = document.createElement('a'); | ||
a.href = "#"; | a.href = "#"; | ||
a.textContent = | a.textContent = text; | ||
a.onclick = function(event) { | |||
event.preventDefault(); // Prevent the default anchor action | |||
onclickAction(); // Run the custom action | |||
}; | |||
li.appendChild(a); | li.appendChild(a); | ||
return li; | return li; | ||
} | } | ||
// | // Function to determine if the skin is Minerva (mobile) | ||
function isMinervaSkin() { | |||
return document.body.classList.contains('skin-minerva'); | |||
} | } | ||
// | // Function to add the custom link | ||
var | function addCustomFooterLink() { | ||
var customLinkAction = function() { | |||
// Custom action when clicking the link | |||
console.log('Privacy Control Center opened.'); // Replace with actual functionality | |||
}; | |||
if (isMinervaSkin()) { | |||
// Mobile (Minerva skin) | |||
var privacyPolicyLinkMobile = document.querySelector('.footer-places li#footer-places-privacy'); | |||
if (privacyPolicyLinkMobile) { | |||
var customLinkMobile = createCustomLink('custom-footer-privacy-link-mobile', 'Privacy Control Center', customLinkAction); | |||
privacyPolicyLinkMobile.parentNode.insertBefore(customLinkMobile, privacyPolicyLinkMobile.nextSibling); | |||
customLinkMobile.style.display = 'block'; // Ensure visibility on mobile | |||
} | |||
} else { | |||
// Desktop | |||
var privacyPolicyLinkDesktop = document.getElementById('footer-places-privacy'); | |||
if (privacyPolicyLinkDesktop) { | |||
var customLinkDesktop = createCustomLink('custom-footer-privacy-link', 'Privacy Control Center', customLinkAction); | |||
privacyPolicyLinkDesktop.parentNode.insertBefore(customLinkDesktop, privacyPolicyLinkDesktop.nextSibling); | |||
} | |||
} | |||
} | } | ||
addCustomFooterLink(); | |||
}); | }); | ||
edycji