User:Gary/custom minor edits.js

The following article will address the topic of User:Gary/custom minor edits.js, a topic of great relevance today. Different aspects related to User:Gary/custom minor edits.js will be explored, from its origin to its impact on current society. The different perspectives and opinions regarding User:Gary/custom minor edits.js will be analyzed, in order to provide a comprehensive and objective vision of the topic. In addition, relevant data and recent studies will be presented that will allow us to better understand the importance and influence of User:Gary/custom minor edits.js in our environment.
/*
	CUSTOM MINOR EDITS
	Description: Force minor edits on whichever namespaces are specificed. Can either use names or numbers, from ].
	
	Example:
		minorEditNamespaces = ;
		
	The above example would set minor edits as default for the "Main" namespace (for Articles) and "2" namespace (ID number for "User").
	NOTE: "Wikipedia" namespace is "Project" in this script.
*/

if (typeof(unsafeWindow) != 'undefined')
{
	mw = unsafeWindow.mw;
}

function customMinorEdits()
{
	if (mw.config.get('wgAction') != 'edit' || typeof(minorEditNamespaces) == 'undefined' || minorEditNamespaces.length == 0) return false;
	
	var checkbox = $('#wpMinoredit');
	if (!checkbox.length) return false;
	
	if ($.inArray(mw.config.get('wgCanonicalNamespace'), minorEditNamespaces) != -1 || $.inArray(mw.config.get('wgNamespaceNumber'), minorEditNamespaces) != -1)
	{
		checkbox.attr('checked', true);
	}
}

$(document).ready(function()
{
	customMinorEdits();
});