Jump to content

MediaWiki:Common.js: Difference between revisions

From Raleighpedia
No edit summary
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. */
document.documentElement.setAttribute('data-commonjs', 'loaded');
document.addEventListener('DOMContentLoaded', function () {
document.addEventListener('DOMContentLoaded', function () {
   var panel = document.getElementById('mw-panel');
   var panel = document.getElementById('mw-panel');

Revision as of 15:26, 29 January 2026

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

document.documentElement.setAttribute('data-commonjs', 'loaded');


document.addEventListener('DOMContentLoaded', function () {
  var panel = document.getElementById('mw-panel');
  if (!panel) return;

  var container = document.createElement('div');
  container.style.marginTop = '0.75rem';

  var script = document.createElement('script');
  script.src = 'https://cdnjs.buymeacoffee.com/1.0.0/button.prod.min.js';
  script.setAttribute('data-name', 'bmc-button');
  script.setAttribute('data-slug', 'Raleighpedia');
  script.setAttribute('data-color', '#FFDD00');
  script.setAttribute('data-font', 'Lato');
  script.setAttribute('data-text', 'Buy Raleighpedia a coffee');
  script.setAttribute('data-outline-color', '#000000');
  script.setAttribute('data-font-color', '#000000');
  script.setAttribute('data-coffee-color', '#ffffff');

  container.appendChild(script);
  panel.appendChild(container);
});