Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add watchlist preference, never add recentPage to the watchlist #300

Merged
merged 7 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/modules/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,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 ) {
Expand Down Expand Up @@ -736,6 +742,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 } );
Expand Down Expand Up @@ -1214,7 +1224,8 @@
autoOpen: false,
logCsd: true,
launchLinkPosition: 'p-cactions',
logAfc: false
logAfc: false,
noWatch: false
};

/**
Expand Down
3 changes: 2 additions & 1 deletion src/modules/submissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2364,7 +2364,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'
NovemLinguae marked this conversation as resolved.
Show resolved Hide resolved
} );
} );

Expand Down
4 changes: 4 additions & 0 deletions src/templates/tpl-preferences.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
<label for="logAfc" class="afch-label">Log acceptances, declines, and rejects</label>
<input type="checkbox" id="logAfc" class="afch-input" {{#logAfc}}checked{{/logAfc}} />
</div>
<div id="noWatchWrapper">
<label for="noWatch" class="afch-label">Do not add pages to watchlist</label>
<input type="checkbox" id="noWatch" class="afch-input" {{#noWatch}}checked{{/noWatch}} />
</div>
</div>
<!-- /preferences -->

Expand Down
Loading