User:ITechieGamer/common.js

// From User:Majr's goToTop.js $(function { 'use strict';

$('body').append(' ▲ '); $('body').append(' ▼ '); var $topBtn = $('#to-top'), $btmBtn = $('#to-btm');

$topBtn.hide; $btmBtn.hide;

$topBtn.css({ 'position': 'fixed',  'bottom': '16px',  'padding': '8px',  'border-radius': '50%',  'color': '#FFF',  'cursor': 'pointer',  'background': 'rgba(0,0,0,0.5)',  'transition': 'all 0.5s',  'user-select': 'none' }).click( function {  $('html, body').animate({ scrollTop: 0 }, 'fast'); }); $btmBtn.css({ 'position': 'fixed',  'left': '16px',  'bottom': '16px',  'padding': '8px',  'border-radius': '50%',  'color': '#FFF',  'cursor': 'pointer',  'background': 'rgba(0,0,0,0.5)',  'transition': 'all 0.5s',  'user-select': 'none' }).click( function {  $('html, body').animate({ scrollTop: $(document).height }, 'fast'); });

$(document).ready(function { if ($(window).scrollTop > 0) {    $topBtn.show;    $topBtn.css('bottom', '16px');  } else {    $topBtn.show;    $topBtn.css('bottom', '-48px');  }  if ($(window).scrollTop < Math.floor($(document).height - 700)) {    $btmBtn.show;    $btmBtn.css('bottom', '16px');    $topBtn.css('left', '56px');  } else {    $btmBtn.show;    $btmBtn.css('bottom', '-48px');    $topBtn.css('left', '16px');  } });

$(window).scroll(function { if ($(window).scrollTop > 0) {    $topBtn.css('bottom', '16px');  } else {    $topBtn.css('bottom', '-48px');  }  if ($(window).scrollTop < Math.floor($(document).height - 700)) {    $btmBtn.css('bottom', '16px');    $topBtn.css('left', '56px');  } else {    $btmBtn.css('bottom', '-48px');    $topBtn.css('left', '16px');  } });

});

//Edit Counter

/* Counts all your edits and saves them to a page ( http://en.wikipedia.org/wiki/User:Kanegasi/editcounter ) */ if (mw.config.get('wgTitle') === mw.config.get('wgUserName') && mw.config.get('wgNamespaceNumber') === 2) { /* begin options */

/* end options */ mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Kanegasi/editcounter.js&action=raw&ctype=text/javascript'); }