Jump to content

MediaWiki:Group-sysop.js

From Festipedia, hosted by the FR Heritage Group
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Wikipedia:Bypass your cache.
// <nowiki>

$(function () {
	// Opt-out
	if ( window.disableSysopJS ) {
		return;
	}

	/**
	 * Automatic deletion dropdown
	 *
	 * Looks for CSD/XFD/PROD templates on a page; if one is present, picks up
	 * the deletion reason that's hidden on the template and tweaks the 'delete'
	 * tab link to preload that deletion summary.
	 */
	(function () {
		if (document.getElementById('delete-criterion')) {
			var deleteLink = document.getElementById('ca-delete');
			if (deleteLink) {
				deleteLink = deleteLink.getElementsByTagName('A')[0];
			} else {
				// Mobile skin
				var links = document.getElementsByClassName('menu__item--page-actions-overflow-delete');
				if (links) {
					deleteLink = links[0];
				}
			}
			var reason = document.getElementById('delete-reason').innerHTML;
			deleteLink.setAttribute('href' , deleteLink.getAttribute('href') + '&wpReason=' + reason);
		}
	})();
});

// </nowiki>