Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// {{BadGIF}} tagger
function BadGIF() {
if (document.editform) {
document.editform.wpTextbox1.value += "\n{{BadGIF}}";
document.editform.wpSummary.value = "{{[[Template:BadGIF|BadGIF]]}}";
document.editform.wpWatchthis.checked = false;
document.editform.wpMinoredit.checked = true;
document.editform.submit();
} else
document.location = mw.config.get('wgServer') + mw.config.get('wgScript') + "?title=" + wgPageName + "&action=edit&BadGIF=1";
}
function addBadGIF(){
if (wgCanonicalNamespace == "Image")
mw.util.addPortletLink("p-cactions", "javascript:BadGIF()", "{{BadGIF}}", "");
if (document.location.href.indexOf("BadGIF=1") > 0)
BadGIF();
}
$(addBadGIF);