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

tag: remove {{Now Commons}} #2072

Closed
wants to merge 2 commits into from
Closed
Changes from all 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
18 changes: 1 addition & 17 deletions modules/twinkletag.js
Original file line number Diff line number Diff line change
Expand Up @@ -1215,16 +1215,6 @@ Twinkle.tag.fileList = {
label: 'Name on Commons:',
tooltip: 'Name of the image on Commons (if different from local name), excluding the File: prefix:'
}
},
{
label: '{{Now Commons}}: file has been copied to Commons',
value: 'Now Commons',
subgroup: {
type: 'input',
name: 'nowcommonsName',
label: 'Commons image name if different:',
tooltip: 'Name of the image on Commons (if different from local name), excluding the File: prefix:'
}
}
],
'Cleanup tags': [
Expand Down Expand Up @@ -1912,19 +1902,13 @@ Twinkle.tag.callbacks = {
let tagtext = '', currentTag;
$.each(params.tags, (k, tag) => {
// when other commons-related tags are placed, remove "move to Commons" tag
if (['Keep local', 'Now Commons', 'Do not move to Commons'].indexOf(tag) !== -1) {
if (['Keep local', 'Do not move to Commons'].indexOf(tag) !== -1) {
text = text.replace(/\{\{(mtc|(copy |move )?to ?commons|move to wikimedia commons|copy to wikimedia commons)[^}]*\}\}/gi, '');
}

currentTag = tag;

switch (tag) {
case 'Now Commons':
currentTag = 'subst:' + currentTag; // subst
if (params.nowcommonsName !== '') {
currentTag += '|1=' + params.nowcommonsName;
}
break;
case 'Keep local':
if (params.keeplocalName !== '') {
currentTag += '|1=' + params.keeplocalName;
Expand Down
Loading