MediaWiki:Common.js: Difference between revisions

From Noisebridge
Jump to navigation Jump to search
(Surrounding in document.ready as it's included in the head)
(Give donate button a class so it can be hidden in print stylesheet)
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
e.src='//www.google-analytics.com/analytics.js';
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
ga('create','UA-68102409-1','auto');ga('send','pageview');
$(function () {
$(function () {
   $('#mw-content-text').prepend("<div style='position: absolute; top: 10px; right: 0;'><a href='https://noisebridge.net/donate'><img src='https://noisebridge.net/images/5/55/Donate.png' alt="Donate"></a></div>");
   $('#content').prepend("<div class='noisebridge-donate-button' style='position: fixed; top: 50px; right: 0;'><a href='https://noisebridge.net/donate'><img src='https://noisebridge.net/images/5/55/Donate.png' alt='Donate'></a></div>");
  /* EFF borked their widget, try uncommenting to see if it's fixed
  var e = document.createElement('script'); e.type='text/javascript'; e.async = true;
  e.src = 'https://www.eff.org/doa/widget.min.js';
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(e, s);
  */
});
});

Revision as of 12:18, 17 October 2021

(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
e.src='//www.google-analytics.com/analytics.js';
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
ga('create','UA-68102409-1','auto');ga('send','pageview');

$(function () {
  $('#content').prepend("<div class='noisebridge-donate-button' style='position: fixed; top: 50px; right: 0;'><a href='https://noisebridge.net/donate'><img src='https://noisebridge.net/images/5/55/Donate.png' alt='Donate'></a></div>");
  /* EFF borked their widget, try uncommenting to see if it's fixed
  var e = document.createElement('script'); e.type='text/javascript'; e.async = true;
  e.src = 'https://www.eff.org/doa/widget.min.js';
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(e, s);
  */
});