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 headers and the calling of the last editor's username for the summaries.

Place the following in your common.js page or skin script page to use:  if (mw.config.get( 'wgAction' ) === 'edit' || mw.config.get( 'wgAction' ) === 'submit') { var customSummaries = [ 'An edit summary preset', 'A second preset {user}', '== A header', 'A third preset [' + '[a wiki link]]' ];  mw.loader.load( 'User:KnightMiner/editSummaryPresets.js' ); }

Headers are created by prefixing a summary with " ". The script supports virtually unlimited summaries and headers.

The last editor's username can be called using " " anywhere within a string.

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.

Sources: This is a modified version of User:Kanegasi/editsummarypresets.js so you may add custom headers, and to contain the generic "rollback" summary. That script used code from the following scripts:
 * Wikipedia:User:ErrantX/defaultsummaries.js
 * Wikipedia:User:MC10/defaultsummaries.js.
 * Wikipedia:User:Equazcion/CustomSummaryPresets.js