MediaWiki:Common.js: Difference between revisions

From wikilawschool.net. Wiki Law School does not provide legal advice. For educational purposes only.
(Created page with "→‎Any JavaScript here will be loaded for all users on every page load.: // The following snippet installs Wikipedia:User:Cacycle/wikEd in-browser text editor: (functi...")
 
No edit summary
 
(4 intermediate revisions by the same user not shown)
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. */


// The following snippet installs [[:Wikipedia:User:Cacycle/wikEd]] in-browser text editor:
/* Enable Template:Skip to top button to fade out */
(function ()
$(document).scroll(function() {
{
  var y = $(this).scrollTop();
var script = document.createElement('script');
  if (y < 800) {
script.src = '//en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js&action=raw&ctype=text/javascript';
    $('#skip-to-top-button').fadeOut();
script.async = true;
  } else {
document.getElementsByTagName('head')[0].appendChild(script);
    $('#skip-to-top-button').fadeIn();
}
  }
) ();
});

Latest revision as of 02:41, June 1, 2020

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

/* Enable Template:Skip to top button to fade out */
$(document).scroll(function() {
  var y = $(this).scrollTop();
  if (y < 800) {
    $('#skip-to-top-button').fadeOut();
  } else {
    $('#skip-to-top-button').fadeIn();
  }
});