MediaWiki:Common.js: Difference between revisions

From lotico
Jump to navigation Jump to search
Created page with "Any JavaScript here will be loaded for all users on every page load.: alert('JavaScript is working!');"
 
No edit summary
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
/* Any JavaScript here will be loaded for all users on every page load. */


alert('JavaScript is working!');
// Open links with class "popup-link" in popup window
document.addEventListener('DOMContentLoaded', function() {
    document.querySelectorAll('a.popup-link').forEach(function(link){
        link.addEventListener('click', function(e){
            e.preventDefault();
            window.open(
                this.href,
                'popupWindow',
                'width=600,height=400,scrollbars=yes,resizable=yes'
            );
        });
    });
});

Revision as of 20:26, 6 September 2025

/* Any JavaScript here will be loaded for all users on every page load. */

// Open links with class "popup-link" in popup window
document.addEventListener('DOMContentLoaded', function() {
    document.querySelectorAll('a.popup-link').forEach(function(link){
        link.addEventListener('click', function(e){
            e.preventDefault();
            window.open(
                this.href,
                'popupWindow',
                'width=600,height=400,scrollbars=yes,resizable=yes'
            );
        });
    });
});