User:Fred Gandt/showSpecialDiffLink.js

$( document ).ready( => {	"use strict";	const DIFF = mw.config.get( "wgDiffNewId" ),		OLDID = mw.config.get( "wgDiffOldId" );	if ( DIFF && OLDID ) {		const DT = document.querySelector( "tr.diff-title" );		if ( DT ) {			const OLD_DATE = document.querySelector( "#mw-diff-otitle1 a" ).textContent.replace( /^(?:latest )?revision as of /i, "" ),				NEW_DATE = document.querySelector( "#mw-diff-ntitle1 a" ).textContent.replace( /^(?:latest )?revision as of /i, "" ),				CODE = document.createElement( "code" ),				TR = document.createElement( "tr" ),				TD = document.createElement( "td" );			TD.setAttribute( "colspan", "4" );			TD.classList.add( "center" );			CODE.innerHTML = `${mw.config.get( "wgTitle" )}: ${OLD_DATE}–${NEW_DATE}`;			TD.append( CODE );			TR.append( TD );			DT.after( TR );		}	} } );