User:KnightMiner/editSummaryPresets.js/doc

This script creates a menu of custom edit summaries to insert into a page. It also allows creation of custom summaries, defining a group to only appear in a certain namespace, and calling the last editor's username for summaries.

Usage
 if (mw.config.get( 'wgAction' ) === 'edit' || mw.config.get( 'wgAction' ) === 'submit') { var customSummaries = [ 'An edit summary preset', 'Another edit summary preset', 'A preset [' + '[a wiki link]]' ];  importScript( 'User:KnightMiner/editSummaryPresets.js' ); }

This script supports virtually unlimited summaries and groups.

The last editor's username can be called using  anywhere within a string. For example, a summary might be

The extra single quotes and plus sign on the link is to prevent the wiki software from creating a link as the variables are loaded. This normally happens with templates being transcluded or substituted in scripts, so the single quotes and plus may not be needed.

Groups
Groups are created using a JavaScript object. Within that object, set  for the name of the option group and   as an array of options like before.

Namespace limitations can be set as an array called, which is simply any namespace numbers which this summary is valid in. The script also supports the keywords  for any talk page, and   for any content page. If no namespace is set, the group appears in all namespaces.