Jump to content

MediaWiki:Common.js: Difference between revisions

From Artemis Archive
No edit summary
No edit summary
Tag: Reverted
Line 1: Line 1:
$(function () {
$(function () {
     console.log('[ReportAbuseLink] Running (Forced Float)...');
     console.log('[ReportAbuseLink] Running (Styled Float)...');


     // Check if already exists
     // Avoid duplicate buttons
     if (document.getElementById('report-abuse-button')) return;
     if (document.getElementById('report-abuse-button')) return;


    // Create the link
     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';


     // Style the link
     // Styling
     link.style.position = 'fixed';
     link.style.position = 'fixed';
     link.style.top = '10px';
     link.style.top = '16px';
     link.style.right = '10px';
     link.style.right = '90px'; // shift left to avoid overlapping menus
     link.style.backgroundColor = '#c00';
     link.style.backgroundColor = '#f8f9fa'; // vector skin bg
     link.style.color = '#fff';
     link.style.color = '#202122';
     link.style.padding = '8px 12px';
    link.style.border = '1px solid #a2a9b1';
     link.style.borderRadius = '8px';
     link.style.padding = '6px 10px';
     link.style.fontWeight = 'bold';
     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.3)';
     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)';
    });


    // Insert into body
     document.body.appendChild(link);
     document.body.appendChild(link);


     console.log('[ReportAbuseLink] Floating button inserted.');
     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.');
});