MediaWiki:Common.js: Difference between revisions
Appearance
No edit summary Tag: Manual revert |
No edit summary |
||
Line 1: | Line 1: | ||
$(function () { | $(function () { | ||
console.log('[ReportAbuseLink] | mw.loader.using('mediawiki.util').then(function () { | ||
console.log('[ReportAbuseLink] Inserting styled floating button...'); | |||
const pageTitle = 'Report_Animal_Abuse'; | |||
const linkHref = mw.util.getUrl(pageTitle); | |||
const linkText = '🚨 Report Abuse'; | |||
// Avoid duplication | |||
if (document.getElementById('report-abuse-button')) return; | |||
const container = document.createElement('div'); | |||
container.id = 'report-abuse-button'; | |||
container.innerHTML = `<a href="${linkHref}" style=" | |||
display: inline-block; | |||
background-color: #b10000; | |||
color: white; | |||
font-weight: bold; | |||
font-size: 14px; | |||
padding: 6px 12px; | |||
border-radius: 6px; | |||
text-decoration: none; | |||
position: fixed; | |||
top: 10px; | |||
right: 10px; | |||
z-index: 9999; | |||
box-shadow: 0 2px 5px rgba(0,0,0,0.2); | |||
">${linkText}</a>`; | |||
document.body.appendChild(container); | |||
console.log('[ReportAbuseLink] Done.'); | |||
}); | }); | ||
}); | }); |
Revision as of 05:58, 21 April 2025
$(function () { mw.loader.using('mediawiki.util').then(function () { console.log('[ReportAbuseLink] Inserting styled floating button...'); const pageTitle = 'Report_Animal_Abuse'; const linkHref = mw.util.getUrl(pageTitle); const linkText = '🚨 Report Abuse'; // Avoid duplication if (document.getElementById('report-abuse-button')) return; const container = document.createElement('div'); container.id = 'report-abuse-button'; container.innerHTML = `<a href="${linkHref}" style=" display: inline-block; background-color: #b10000; color: white; font-weight: bold; font-size: 14px; padding: 6px 12px; border-radius: 6px; text-decoration: none; position: fixed; top: 10px; right: 10px; z-index: 9999; box-shadow: 0 2px 5px rgba(0,0,0,0.2); ">${linkText}</a>`; document.body.appendChild(container); console.log('[ReportAbuseLink] Done.'); }); });