MediaWiki:Common.js: Difference between revisions
Appearance
No edit summary |
No edit summary Tag: Reverted |
||
Line 1: | Line 1: | ||
$(function () { | $(function () { | ||
console.log('[ReportAbuseLink] Running ( | console.log('[ReportAbuseLink] Running (Styled Float)...'); | ||
// | // Avoid duplicate buttons | ||
if (document.getElementById('report-abuse-button')) return; | if (document.getElementById('report-abuse-button')) return; | ||
const link = document.createElement('a'); | const link = document.createElement('a'); | ||
link.id = 'report-abuse-button'; | link.id = 'report-abuse-button'; | ||
Line 11: | Line 10: | ||
link.textContent = '🐾 Report Abuse'; | link.textContent = '🐾 Report Abuse'; | ||
// | // Styling | ||
link.style.position = 'fixed'; | link.style.position = 'fixed'; | ||
link.style.top = ' | link.style.top = '16px'; | ||
link.style.right = ' | link.style.right = '90px'; // shift left to avoid overlapping menus | ||
link.style.backgroundColor = '# | link.style.backgroundColor = '#f8f9fa'; // vector skin bg | ||
link.style.color = '# | link.style.color = '#202122'; | ||
link.style.padding = ' | link.style.border = '1px solid #a2a9b1'; | ||
link.style.borderRadius = ' | link.style.padding = '6px 10px'; | ||
link.style.fontWeight = ' | link.style.borderRadius = '6px'; | ||
link.style.fontSize = '14px'; | |||
link.style.fontFamily = 'system-ui, sans-serif'; | |||
link.style.fontWeight = 'normal'; | |||
link.style.zIndex = '9999'; | link.style.zIndex = '9999'; | ||
link.style.textDecoration = 'none'; | link.style.textDecoration = 'none'; | ||
link.style.boxShadow = '0 2px 6px rgba(0,0,0,0. | link.style.boxShadow = '0 1px 3px rgba(0,0,0,0.1)'; | ||
link.style.transition = 'background-color 0.2s, box-shadow 0.2s'; | |||
// Hover effect | |||
link.addEventListener('mouseenter', () => { | |||
link.style.backgroundColor = '#eaf3ff'; | |||
link.style.boxShadow = '0 2px 6px rgba(0,0,0,0.2)'; | |||
}); | |||
link.addEventListener('mouseleave', () => { | |||
link.style.backgroundColor = '#f8f9fa'; | |||
link.style.boxShadow = '0 1px 3px rgba(0,0,0,0.1)'; | |||
}); | |||
document.body.appendChild(link); | document.body.appendChild(link); | ||
console.log('[ReportAbuseLink] | console.log('[ReportAbuseLink] Button inserted.'); | ||
}); | }); |
Revision as of 05:41, 21 April 2025
$(function () { console.log('[ReportAbuseLink] Running (Styled Float)...'); // Avoid duplicate buttons if (document.getElementById('report-abuse-button')) return; const link = document.createElement('a'); link.id = 'report-abuse-button'; link.href = mw.util.getUrl('Report_Animal_Abuse'); link.textContent = '🐾 Report Abuse'; // Styling link.style.position = 'fixed'; link.style.top = '16px'; link.style.right = '90px'; // shift left to avoid overlapping menus link.style.backgroundColor = '#f8f9fa'; // vector skin bg link.style.color = '#202122'; link.style.border = '1px solid #a2a9b1'; link.style.padding = '6px 10px'; link.style.borderRadius = '6px'; link.style.fontSize = '14px'; link.style.fontFamily = 'system-ui, sans-serif'; link.style.fontWeight = 'normal'; link.style.zIndex = '9999'; link.style.textDecoration = 'none'; link.style.boxShadow = '0 1px 3px rgba(0,0,0,0.1)'; link.style.transition = 'background-color 0.2s, box-shadow 0.2s'; // Hover effect link.addEventListener('mouseenter', () => { link.style.backgroundColor = '#eaf3ff'; link.style.boxShadow = '0 2px 6px rgba(0,0,0,0.2)'; }); link.addEventListener('mouseleave', () => { link.style.backgroundColor = '#f8f9fa'; link.style.boxShadow = '0 1px 3px rgba(0,0,0,0.1)'; }); document.body.appendChild(link); console.log('[ReportAbuseLink] Button inserted.'); });