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 by prefixing a summary with, for example,. All following summaries will be contained as items in that group. The title of the group will not work as a summary, and will not contain the group prefix or the namespace limitations.

Namespace limitations can be set after the group prefix by adding the namespace number followed by a colon. The script also supports the keywords  for any talk page, and   for any content page. Any number of namespaces and keywords can be added. If no namespace is set, the group appears in all namespaces. An example is  which would appear on talk pages or user pages.