diff --git a/src/modules/core.js b/src/modules/core.js index 50479055..69837ef5 100644 --- a/src/modules/core.js +++ b/src/modules/core.js @@ -604,10 +604,10 @@ /** * Modifies a page's content - * TODO the property name "contents" is quite silly, because people used to the MediaWiki API are gonna write "text" * + * @todo the property name "contents" is quite silly, because people used to the MediaWiki API are gonna write "text" * @param {string} pagename The page to be modified, namespace included - * @param {Object} options Object with properties: + * @param {Object} options Object with properties ('contents' is required, others are optional): * contents: {string} the text to add to/replace the page, * summary: {string} edit summary, will have the edit summary ad at the end, * createonly: {bool} set to true to only edit the page if it doesn't exist, @@ -615,6 +615,7 @@ * hide: {bool} Set to true to supress logging in statusWindow * statusText: {string} message to show in status; default: "Editing" * followRedirects: {boolean} true to follow redirects, false to ignore redirects + * watchlist: {string} 'nochange', 'preferences', 'unwatch', or 'watch' * @return {jQuery.Deferred} Resolves if saved with all data */ editPage: function ( pagename, options ) { @@ -652,6 +653,12 @@ request.minor = 'true'; } + if ( [ 'nochange', 'preferences', 'unwatch', 'watch' ].includes( options.watchlist ) ) { + request.watchlist = options.watchlist; + } else if ( AFCH.prefs.noWatch ) { + request.watchlist = 'nochange'; + } + // Depending on mode, set appendtext=text or prependtext=text, // which overrides the default text option if ( options.mode ) { @@ -737,6 +744,10 @@ reason: reason + AFCH.consts.summaryAd }, additionalParameters ); + if ( AFCH.prefs.noWatch ) { + request.watchlist = 'nochange'; + } + if ( AFCH.consts.mockItUp ) { AFCH.log( request ); deferred.resolve( { to: newTitle } ); @@ -1216,7 +1227,8 @@ autoOpen: false, logCsd: true, launchLinkPosition: 'p-cactions', - logAfc: false + logAfc: false, + noWatch: false }; /** diff --git a/src/modules/submissions.js b/src/modules/submissions.js index b3bdfa41..532f710a 100644 --- a/src/modules/submissions.js +++ b/src/modules/submissions.js @@ -2361,7 +2361,8 @@ recentPage.edit( { contents: newRecentText, - summary: 'Adding [[' + newPage + ']] to list of recent AfC creations' + summary: 'Adding [[' + newPage + ']] to list of recent AfC creations', + watchlist: 'nochange' } ); } ); diff --git a/src/templates/tpl-preferences.html b/src/templates/tpl-preferences.html index 589b694f..55c16ccf 100644 --- a/src/templates/tpl-preferences.html +++ b/src/templates/tpl-preferences.html @@ -25,6 +25,10 @@ +
+ + +