User:Suffusion of Yellow/filterTest.js

Today, User:Suffusion of Yellow/filterTest.js is a topic that has captured the attention of millions of people around the world. With its impact on modern society, User:Suffusion of Yellow/filterTest.js has become a point of discussion in numerous fields, from politics and economics to popular culture and technology. With such a significant impact, it is crucial to understand the implications and ramifications of User:Suffusion of Yellow/filterTest.js in our daily lives. In this article, we will further explore User:Suffusion of Yellow/filterTest.js and its influence on different aspects of society, offering an informed and relevant perspective on the topic.
/*
 * filterTest: Adds a button at Special:AbuseFilter/nnn pages to open
 * Special:AbuseFilter/test with what's currently in the _edit window_.
 * The built-in link only tests the pattern currently in the _database_,
 * which is probably not what you want.
 */
//<nowiki>
(function() {
	/* globals $, mw, OO */
	'use strict';

	function openTest() {
		let id = mw.config.get('wgPageName').match(/\d+$/);
		let suffix = id ? "/" + id : "";

        let $form = $('<form></form>', {
            style: "display: none;",
            action: "https://wikifreehand.com/en/Special:AbuseFilter/test" + suffix,
            target: "_blank",
            method: "POST"
        });

        $('<input>', {
			type: 'hidden',
            name: 'wpFilterRules',
            value: $('#wpFilterRules').val()
        }).appendTo($form);

        $('<input>', {
			type: 'hidden',
            name: 'wpShowNegative',
            value: '1'
        }).appendTo($form);

        $form.appendTo('body').submit().remove();
	}

	function addButtons() {
		if (!$("#mw-abusefilter-editing-form").length)
			return;

		let testButton = new OO.ui.ButtonWidget({
			id: "efb-test-changes",
			label: "Test changes",
			title: "Test the modified pattern against recent changes",
		});

		testButton.on('click', openTest);

		$('#mw-abusefilter-syntaxcheck, #efb-show-changes')
			.last().after(testButton.$element);

		/* Prevent buttons from shifting when "Check syntax" is clicked */
		mw.util.addCSS(".mw-spinner { display: none; } ");
	}

	if (mw.config.get('wgCanonicalSpecialPageName') == "AbuseFilter")
		$.when($.ready,
			   mw.loader.using(['mediawiki.util',
								'oojs-ui',
							   ])).then(addButtons);
})();
//</nowiki>