Animate

From Support Wiki
Jump to navigation Jump to search

Animate is a gadget for wikis that animates images.

Installation instructions

Important

Remember, JavaScript can be used maliciously; please make sure you trust the source of any JS you're copying to your wiki! A protected namespace on the wiki.gg Support Wiki should be safe, but it's still a good idea to check the version history and make sure there aren't any suspect recent changes (e.g., if someone's account was compromised).

  1. You need to be a local/community admin on your wiki to follow these steps, since it involves editing pages in the MediaWiki namespace.
  2. Copy the contents of MediaWiki:Gadget-animate to your wiki. This is the translation string that will display when people look at information about the gadget, so you can modify it if needed.
  3. Copy the source code to your wiki. This includes the contents of the following pages:
  4. At MediaWiki:Gadgets-definition on your wiki, APPEND ONE of the following three options, depending on what config option you want.
    • * animate[ResourceLoader|default|hidden|type=general]|animate.js = it's available to everyone with no opt-out ability (RECOMMENDED)
    • * animate[ResourceLoader|default|type=general]|animate.js = it's available to everyone but you can opt out in your user page
    • * animate[ResourceLoader|type=general]|animate.js = by default it's not turned on, but you can turn it on in settings
  5. You may have to wait somewhere between 5 and 15 minutes at this time for server-side cache to update.
  6. Done! Make sure you cache refresh on your browser (Ctrl+F5) on the upload page to see changes.

Templates

These templates are needed for the gadget to work properly.

Template name: Animate

<includeonly>{{ {{{|safesubst:}}}#invoke:animate|animate}}</includeonly>
<noinclude>{{Documentation}}</noinclude>
<!-- Original template https://minecraft.wiki/w/Template:Animate -->

MediaWiki name: MediaWiki:Common.css

/* Element animator / Created by PCJ */

.mw-body-content .animated > *:not(.animated-active),
.mw-body-content .animated > .animated-subframe > *:not(.animated-active) {
	display: none
}
.mw-body-content span.animated,
.mw-body-content span.animated.animated-visible > *,
.mw-body-content span.animated.animated-visible > .animated-subframe > * {
	display: inline-block;
}
.mw-body-content div.animated.animated-visible > *,
.mw-body-content div.animated.animated-visible > .animated-subframe > * {
	display: block;
}

See also