MediaWiki:Common.js: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
$(function () { | $(function () { | ||
mw.loader.using('mediawiki.util').then(function () { | mw.loader.using('mediawiki.util').then(function () { | ||
console.log('[ReportAbuseLink] Inserting styled | console.log('[ReportAbuseLink] Inserting LARGE styled button...'); | ||
const pageTitle = 'Report_Animal_Abuse'; | const pageTitle = 'Report_Animal_Abuse'; | ||
const linkHref = mw.util.getUrl(pageTitle); | const linkHref = mw.util.getUrl(pageTitle); | ||
const linkText = '🚨 Report Abuse'; | const linkText = '🚨 Report Animal Abuse'; | ||
// Avoid duplication | // Avoid duplication | ||
Line 15: | Line 15: | ||
display: inline-block; | display: inline-block; | ||
background-color: #b10000; | background-color: #b10000; | ||
color: | color: #fff; | ||
font-weight: bold; | font-weight: bold; | ||
font-size: | font-size: 18px; | ||
padding: | padding: 10px 18px; | ||
border-radius: | border-radius: 8px; | ||
text-decoration: none; | text-decoration: none; | ||
position: fixed; | position: fixed; | ||
top: | top: 12px; | ||
right: | right: 12px; | ||
z-index: 9999; | z-index: 9999; | ||
box-shadow: 0 | box-shadow: 0 4px 8px rgba(0,0,0,0.25); | ||
">${linkText}</a>`; | ">${linkText}</a>`; | ||
document.body.appendChild(container); | document.body.appendChild(container); | ||
console.log('[ReportAbuseLink] | console.log('[ReportAbuseLink] Button rendered.'); | ||
}); | }); | ||
}); | }); |
Revision as of 06:02, 21 April 2025
$(function () { mw.loader.using('mediawiki.util').then(function () { console.log('[ReportAbuseLink] Inserting LARGE styled button...'); const pageTitle = 'Report_Animal_Abuse'; const linkHref = mw.util.getUrl(pageTitle); const linkText = '🚨 Report Animal 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: #fff; font-weight: bold; font-size: 18px; padding: 10px 18px; border-radius: 8px; text-decoration: none; position: fixed; top: 12px; right: 12px; z-index: 9999; box-shadow: 0 4px 8px rgba(0,0,0,0.25); ">${linkText}</a>`; document.body.appendChild(container); console.log('[ReportAbuseLink] Button rendered.'); }); });