Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
// <nowiki>varns=mw.config.get('wgNamespaceNumber'),ti=mw.config.get('wgTitle');$.when(mw.loader.using(['mediawiki.util']),$.ready).done(function(){// if File: namespaceif(ns===6){// Files only// and title ends in "svg"if(/SVG/i.test(ti.slice(-3))){// SVG// SVG editimportScript('User:Rillke/SVGedit.js');}}});// copied from https://commons.wikimedia.org/w/index.php?title=Commons:Village_pump/Technical&diff=prev&oldid=826080394if(mw.config.get('wgNamespaceNumber')===6&&mw.config.get('wgIsArticle')&&/(PNG|GIF|JPE?G|TIF?F|WEBP)$/i.test(mw.config.get('wgTitle'))){$(function(){varfile=document.getElementById('file');if(file){mw.util.addPortletLink('p-tb',newmw.Uri('https://ocr.wmcloud.org/').extend({image:file.querySelector('a').href}).toString(),'OCR','t-ocr','Transcribe text in the image');}});}//</nowiki>