User:DannyS712/AbuseFilterMessageLinks.js

In this article, we will explore the impact of User:DannyS712/AbuseFilterMessageLinks.js on various aspects of contemporary society. From its influence on popular culture to its relevance in academia, User:DannyS712/AbuseFilterMessageLinks.js has generated extensive debate and controversy that deserves to be analyzed in detail. Throughout these pages, we will analyze the different perspectives that exist around User:DannyS712/AbuseFilterMessageLinks.js and how it has shaped the current landscape. Likewise, we will examine its historical role and its projection into the future, in order to understand its true scope and meaning in our daily lives.
// <nowiki>
// Quick script to add links to the "warn" and "disallow" messages used in
// edit filters
// @author DannyS712
$(() => {
const AbuseFilterMessageLinks = {};
window.AbuseFilterMessageLinks = AbuseFilterMessageLinks;

AbuseFilterMessageLinks.init = function () {
	mw.loader.using(
		,
		AbuseFilterMessageLinks.run
	);
};

AbuseFilterMessageLinks.addHandler = function ( selectId, inputId, toggleId ) {
	const selectWidget = OO.ui.infuse( $( '#' + selectId ) );
	const inputWidget = OO.ui.infuse( $( '#' + inputId ) );

	const $link = $( '<a>' ).attr( 'target', '_blank' );
	const updateLink = ( messageName ) => {
		$link.text( 'MediaWiki:' + messageName );
		$link.attr( 'href', 'https://wikifreehand.com/en/MediaWiki:' + messageName );
	};
	updateLink( inputWidget.getValue() );
	$( '#' + toggleId ).after( ' ', $link );
	
	selectWidget.on( 'change', updateLink );
	inputWidget.on( 'change', updateLink );
};

AbuseFilterMessageLinks.run = function () {
	// Warn
	AbuseFilterMessageLinks.addHandler(
		'mw-abusefilter-warn-message-existing',
		'mw-abusefilter-warn-message-other',
		'mw-abusefilter-warn-preview-button'
	);
	// Disallow
	AbuseFilterMessageLinks.addHandler(
		'mw-abusefilter-disallow-message-existing',
		'mw-abusefilter-disallow-message-other',
		'mw-abusefilter-disallow-preview-button'
	);
};


});

$(document).ready(() => {
	if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'AbuseFilter'
		&& mw.config.get( 'wgPageName' ).match( /^Special:AbuseFilter\/\d+$/ )
	) {
		window.AbuseFilterMessageLinks.init();
	}
});

// </nowiki>