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

Merge changes from upstream #59

Merged
merged 169 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
169 commits
Select commit Hold shift + click to select a range
66fe7ed
docs: update CONTRIBUTING.md (#1756)
NovemLinguae Mar 23, 2023
5657750
xfd: fix "undefined" error in userspace log XfD CfDS edit summary (#1…
NovemLinguae Apr 22, 2023
f3b186a
build(deps-dev): bump eslint from 8.33.0 to 8.37.0 (#1766)
dependabot[bot] Apr 22, 2023
518b3b8
tag: rename {{More footnotes}} to {{More footnotes needed}} (#1760)
anupvs77 Apr 29, 2023
b963121
warn: Add uw-translation (#1740)
earlt612 Apr 29, 2023
01027d2
block: fix extra period in {{uw-botuhblock}} edit summary (#1774)
NovemLinguae May 19, 2023
10d1f26
fix edit summary for uw-wrongsummary (#1773)
earlt612 May 19, 2023
8f35b6e
Add welcome-copyright (#1758)
Red-tailed-Hawk May 19, 2023
cb92ce7
build(deps-dev): bump eslint from 8.37.0 to 8.39.0 (#1772)
dependabot[bot] May 19, 2023
ecbbbcd
protect: add generic ECP option to protection module (#1762)
anupvs77 May 19, 2023
f1074a6
warn: add uw-fringe 1-4 (#1742)
lomrjyo May 20, 2023
2037033
ci: always run unit tests (#1781)
NovemLinguae May 27, 2023
cec581a
bump jest from v27 to v29 (#1787)
NovemLinguae Jun 6, 2023
514d076
add dependency notes to DEVELOPER.md (#1777)
NovemLinguae Jun 6, 2023
8b70c99
`npm update` everything (#1794)
NovemLinguae Jun 15, 2023
3f8bd25
twinkle.js: fix addPortlet() in vector-2022 (#1816)
NovemLinguae Jul 6, 2023
8e81ba3
fix twinkle menu background on vector-2022 zebra (#1799)
NovemLinguae Jul 19, 2023
ccae792
diff/welcome: readability refactor (#1802)
NovemLinguae Jul 19, 2023
fe1535b
welcome: minor refactor (#1804)
NovemLinguae Jul 19, 2023
d9520e8
tag: add namespace rules for redirect tags (#1467)
NovemLinguae Jul 19, 2023
f090f1e
protect: sanitized-css: don't tick <noinclude> check box (#1637)
NovemLinguae Jul 20, 2023
2d30272
twinkle: notifications for CSD C1 should default to true (#1706)
NovemLinguae Jul 20, 2023
c305fce
Added media related and emoji redirect templates (#1741)
Gonzom Jul 20, 2023
e9d2e09
Store module prefills under Twinkle.prefill (#1683)
nardog Jul 21, 2023
379cb18
Fix double punctuation issues at AIV (#1734)
Trialpearswiki Jul 21, 2023
e035dff
tag: fix pagetriagelist API undefined error (#1755)
NovemLinguae Jul 25, 2023
e9540b5
tag: add {{r from airport code}} and {{r from airline code}} (#1784)
lomrjyo Jul 25, 2023
97f3dd6
welcome: add {{WikiProject Women in Red invite}} (#1792)
earlt612 Jul 25, 2023
1d6b967
Alphabetized "Problem user welcome templates" (#1796)
Monik2002 Jul 25, 2023
55b0748
`npm update` (#1825)
NovemLinguae Jul 25, 2023
c977843
add documentation for deploying / sync.pl (#1823)
NovemLinguae Aug 10, 2023
42d61e4
switch dependabot from monthly to yearly (#1824)
NovemLinguae Aug 10, 2023
466443f
`npm update` (#1849)
NovemLinguae Aug 10, 2023
7133c38
Rmtr order (#1735)
Trialpearswiki Aug 10, 2023
5104bbf
Use separate template for two sections of WP:PNT (#1752)
HalHaynes Aug 10, 2023
383ce92
added {{uw-blar}} and {{uw-articletodraft}} (#1797)
Monik2002 Aug 10, 2023
19b092a
Added Template:uw-refspam as a single-issue notice #1666 (#1798)
Monik2002 Aug 10, 2023
62e0e67
Twinkle uses new mw.util.addPortlet API (#1881)
jdlrobson Nov 3, 2023
6a23a24
Fix RMTR bug (#1853)
NovemLinguae Nov 3, 2023
b827e65
fix hideReason not working when used without hideLinkedPage (#1851)
NovemLinguae Nov 3, 2023
43e77b5
hideReason=true for Uw-blar and Uw-articletodraft (#1850)
NovemLinguae Nov 3, 2023
6057e84
build(deps-dev): bump eslint from 8.46.0 to 8.52.0 (#1880)
dependabot[bot] Nov 3, 2023
e73a88b
build(deps-dev): bump jest-environment-jsdom from 29.6.2 to 29.7.0 (#…
dependabot[bot] Nov 3, 2023
e6e05d9
build(deps-dev): bump jest from 29.6.2 to 29.7.0 (#1873)
dependabot[bot] Nov 3, 2023
6e30957
twinkle: Put TW menu back on the right side of the More menu (#1887)
NovemLinguae Nov 23, 2023
4f31985
twinkle: fix vector-2022 TW menu bug (#1896)
NovemLinguae Dec 4, 2023
3cdc44d
DEVELOPER.md: update deploy section (#1894)
NovemLinguae Dec 4, 2023
3831de5
build(deps-dev): bump eslint from 8.52.0 to 8.54.0 (#1899)
dependabot[bot] Dec 4, 2023
27dd1a3
Update twinkle.css for Vector Zebra CSS refactor (#1906)
jandre3000 Dec 13, 2023
33970bc
xfd: add a line break to the end of some entries (#1904)
NovemLinguae Dec 15, 2023
9cf74ef
minor update to deploy documentation (#1902)
NovemLinguae Dec 15, 2023
c91bd69
twinkle-pagestyles.css: expand comment (#1893)
NovemLinguae Dec 15, 2023
e87b051
fix PR labeler (#1908)
NovemLinguae Jan 22, 2024
2ca34d2
Revert "fix PR labeler" (#1936)
NovemLinguae Jan 22, 2024
e5f2691
Fix PR labeler CI (#1928)
NovemLinguae Jan 22, 2024
02d0a5b
welcome: fix Women in Red typo (#1935)
NovemLinguae Jan 23, 2024
13dba69
warn: add uw-longsd (#1938)
earlt612 Jan 23, 2024
0961ff5
morebits: change default label from "Submit Query" to "Submit" (#1865)
ATREAY Jan 23, 2024
100cfbf
tag: improve readability of WP:PNT code (#1952)
NovemLinguae Mar 29, 2024
eedcfc4
tag: update template names, add {{BLP one source}}
Gonzom Jun 25, 2024
6d69a4b
warn: fix dark mode (#1982)
NovemLinguae Jul 26, 2024
a55cdcc
config: fix grammar in helptip (#1986)
NovemLinguae Aug 13, 2024
8e5fc21
xfd: widen cfd/s "new name" text box (#1989)
NovemLinguae Aug 13, 2024
3a9de06
tag: add {{No significant coverage (sports)}} and {{No significant co…
earlt612 Sep 6, 2024
ab73249
added 10 days, 6 months, 2 years in protect (#1869)
IamSudhir-Kumar Sep 6, 2024
011baf9
build: turn off dependabot (#2006)
NovemLinguae Sep 6, 2024
a026d76
See https://en.wikipedia.org/wiki/Template_talk:Welcome-unregistered-…
robertsky Sep 6, 2024
0e41347
Update friendlywelcome.js (#1943)
Sarodace Sep 6, 2024
c804c92
arv: censor username if offensive username is ticked (#1946)
darmanilink Sep 6, 2024
1c9836d
Update tag module to use longer template names for readability (#1953)
5Asim Sep 6, 2024
3d8fcf2
Fix removing tags for maintenance templates where |name= points to a …
9382 Sep 6, 2024
e478ee0
Add unsourced, and welcomeen-it/hi/id (#1963)
methecooldude Sep 6, 2024
d841a36
Use CodeQL v3 over v1 (#1964)
methecooldude Sep 6, 2024
bdb69a0
Update twinklewarn.js with {{uw-usertalk}} (#1973)
vanderwaalforces Sep 6, 2024
730599f
warn: fix typo in uw-longsd (#2015)
NovemLinguae Oct 16, 2024
0b1f5e1
speedy: replace db-templatecat with C4 (#1994) (#2004)
TollensWP Oct 16, 2024
bbfb4a2
twinkle: Move nuisance error to console (#1998) (#2002)
TollensWP Oct 16, 2024
a58009e
tag: fix multiple issues grouping (#1997) (#2003)
TollensWP Oct 16, 2024
3425932
tag: disable tagging of category redirects (#1947) (#2007)
TollensWP Oct 16, 2024
4a07910
Add dark mode compatibility to Twinkle (#2023)
Matr1x-101 Nov 6, 2024
7047d96
xfd: tag CfD/S C2F with cfm-speedy, not cfr-speedy (#2043)
fredster33 Nov 12, 2024
0c9c2ef
Closes #1788 - Change template to redirected template name (#2017)
TheOriginalSoni Nov 12, 2024
1207dc2
Performance optimizations in dev-server (#2030)
siddharthvp Nov 12, 2024
bb8181f
tag: add requested additional tags (#2005)
TollensWP Nov 12, 2024
c7a12e4
tag: add parenthetical referencing tag #2022 (#2024)
DreamRimmer Nov 12, 2024
6bfe9c1
tag: Adding {{Cleanup colors}} + {{Overcoloured}} (#2026)
DreamRimmer Nov 12, 2024
c443dc8
Remove IE 11 compatibility code (#1900)
siddharthvp Nov 12, 2024
0c311e0
add tags and warnings (#1991)
41922 Nov 12, 2024
93b67b9
speedy: update u5, tag: add {{User-generated}}, {{BLP one source}}, {…
rustykitty Nov 12, 2024
b957aa1
welcome: add {{Welcome draft}} #2020 (#2025)
DreamRimmer Nov 12, 2024
387bc1e
talkback: remove leading whitespace on new pages (#2028)
TollensWP Nov 13, 2024
b52e8be
protect: stop noincluded tags breaking headers (#2029)
TollensWP Nov 13, 2024
21daae9
Change markTalkbackAsMinor to default to off (#2033)
DreamRimmer Nov 13, 2024
a0ae537
update {{Advert}} tag according to TfD (#2036)
DreamRimmer Nov 13, 2024
e8985ba
Adding {{uw-pronouns1}}, {{uw-pronouns2}} and {{uw-pronouns3}} (#2037)
DreamRimmer Nov 13, 2024
7e9657b
tag: refactor file tag form validation code (#2047)
NovemLinguae Nov 14, 2024
257e210
tag: add {{Maybe free media}} and {{Fake SVG}} for files (#2041)
fredster33 Nov 14, 2024
976b9ba
gadget.txt: sync with what's onwiki (#2049)
NovemLinguae Nov 14, 2024
5cf6a0b
no longer allow users to set portlet preferences (#1978)
NovemLinguae Nov 17, 2024
e22234b
scripts: delete unused (#2045)
NovemLinguae Nov 17, 2024
844ff57
SECURITY.md: update (#2052)
NovemLinguae Nov 19, 2024
e48a9af
scripts: rename sync.pl to deploy.pl (#2051)
NovemLinguae Nov 19, 2024
ad1c5a1
config: fix loss of green box and background color for saving success…
NovemLinguae Nov 19, 2024
9b2ecba
welcome: add some {{Welcomeen-XX}} templates (#2042)
fredster33 Nov 19, 2024
e0e1b75
Support batch requested moves (#1888)
nardog Nov 19, 2024
cbf09f5
prevent placing of protection, XFD, or CSD tags on TimedText pages (…
TollensWP Nov 19, 2024
83dcdd2
xfd: refactor regex to use mw.Title (#2054)
NovemLinguae Nov 19, 2024
733993b
welcome: add level 2 headings for foreign language welcomes (#2053)
NovemLinguae Nov 21, 2024
35efcd8
rename modules/friendlyX.js to modules/twinkleX.js (#2055)
NovemLinguae Nov 21, 2024
4aaf6bd
eslint: switch from custom rules to eslint-config-wikimedia (#1976)
NovemLinguae Nov 21, 2024
6f795ab
rename twinklefluff.js to twinklerollback.js (#2056)
NovemLinguae Nov 22, 2024
cfd7b65
rollback: support older fluff preferences (#2059)
siddharthvp Nov 22, 2024
61ff536
arv: refactor AIV report generation (#2060)
TollensWP Nov 22, 2024
de88fac
config: don't ignore old fluff preferences (#2061)
NovemLinguae Nov 23, 2024
b3c4e3f
refactor UAA report generation logic (#2062)
TollensWP Nov 23, 2024
3da72fd
eslint: apply autofixes 1 (#2058)
NovemLinguae Nov 23, 2024
93d287e
rollback: fix "cannot read properties of undefined" (#2071)
NovemLinguae Nov 24, 2024
3aa633a
eslint: apply autofixes 2 (#2069)
NovemLinguae Nov 25, 2024
b0a8d38
Fix RM summary/log (#2085)
nardog Nov 26, 2024
ed4296f
eslint: apply autofixes 3 (#2079)
NovemLinguae Nov 26, 2024
f820cf8
simplify IIFEs (#2074)
NovemLinguae Nov 26, 2024
aad6000
gadget.txt: remove requiresES6 (#2075)
NovemLinguae Nov 26, 2024
001f236
twinkle.js: comments to docblocks (#2076)
NovemLinguae Nov 26, 2024
b487aeb
fix linter error no-jquery/variable-pattern (#2081)
NovemLinguae Nov 27, 2024
027743d
fix linter error jsdoc/no-undefined-types (#2082)
NovemLinguae Nov 27, 2024
9c55904
fix linter error no-sequences (#2083)
NovemLinguae Nov 27, 2024
d57392e
morebits: create capitalized aliases for classes (#2086)
NovemLinguae Nov 27, 2024
d45aaac
capitalize Morebit class names (#2087)
NovemLinguae Nov 29, 2024
e7d4c6c
fix some no-jquery/no-extend autofixes (#2088)
NovemLinguae Nov 29, 2024
6994d0b
autofix some eslint unicorn/prefer-string-slice (#2089)
NovemLinguae Dec 3, 2024
db0bcb7
eslint: revert $.extend autofixes (#2107)
NovemLinguae Dec 7, 2024
5152750
eslint: switch camelcase and underscore dangle from off to warn (#2108)
NovemLinguae Dec 7, 2024
dea355b
delete disabled files
mdaniels5757 Dec 8, 2024
4fec9a7
Merge branch 'changes-upstream' into merge-changes-upstream
mdaniels5757 Dec 8, 2024
ca13cbd
delete tests for deleted modules
mdaniels5757 Dec 8, 2024
96624ad
fix package-lock
mdaniels5757 Dec 8, 2024
b20e3a8
eslint: fix prefer-const (#2099)
NovemLinguae Dec 8, 2024
69de130
eslint: fix no-useless-concat (#2100)
NovemLinguae Dec 8, 2024
b9e02e2
eslint: fix no-throw-literal (#2102)
NovemLinguae Dec 8, 2024
303e29e
welcome: change {{welcomeunsourced}} to {{welcome-unsourced}} as resu…
rustykitty Dec 8, 2024
e38ebe3
arv: refactor SPI report generation (#2070)
TollensWP Dec 8, 2024
b6102de
tag: remove {{Now Commons}} (#2073)
fredster33 Dec 8, 2024
321fb37
warn: add {{uw-derogatory}} (#2104) (#2112)
rustykitty Dec 8, 2024
773a482
block: add regression test (#2110)
NovemLinguae Dec 9, 2024
6372b41
DEVELOPER.md: add checklist for CSD patches (#2113)
NovemLinguae Dec 9, 2024
04a3595
eslint: fix no-underscore-dangle (#2114)
NovemLinguae Dec 9, 2024
d582c2e
build: run `npm update` (#2116)
NovemLinguae Dec 9, 2024
1c6516c
config: delete 14 year old comment (#2117)
NovemLinguae Dec 9, 2024
e40b960
speedy: less sassy error message (#2118)
NovemLinguae Dec 9, 2024
bc79c32
tag: add tests for checkIncompatible() (#2120)
NovemLinguae Dec 9, 2024
fb98dfc
eslint: fix no-return-assign (#2103)
NovemLinguae Dec 10, 2024
04d11bb
eslint: fix some `camelcase` (#2111)
NovemLinguae Dec 10, 2024
37aa26c
npm update
mdaniels5757 Dec 10, 2024
226dc7a
Merge branch 'changes-upstream' into merge-changes-upstream
mdaniels5757 Dec 10, 2024
03f54c0
npm install
mdaniels5757 Dec 10, 2024
301400d
remove tests for removed functionality
mdaniels5757 Dec 10, 2024
6587bf0
fix eslint errors
mdaniels5757 Dec 10, 2024
9d763f9
deploy.pl: rm removed modules
mdaniels5757 Dec 10, 2024
a6afebb
tests: turn on eslint (#2123)
NovemLinguae Dec 11, 2024
ad012f7
eslint: replace es-x/no-array-prototype-includes with unicorn/prefer-…
NovemLinguae Dec 11, 2024
c7b2abe
eslint: apply autofixes to tests (#2126)
NovemLinguae Dec 12, 2024
6812d90
eslint: fix camelcase in tests (#2127)
NovemLinguae Dec 13, 2024
c2874ba
eslint: fix `strict` in tests (#2128)
NovemLinguae Dec 13, 2024
95efda0
eslint: fix new-cap in tests (#2129)
NovemLinguae Dec 13, 2024
2a38b76
eslint: fix no-undef in tests (#2130)
NovemLinguae Dec 13, 2024
58828bd
eslint: fix no-useless-escape in tests (#2131)
NovemLinguae Dec 13, 2024
2411a78
Merge remote-tracking branch 'upstream/master' into merge-changes-ups…
mdaniels5757 Dec 14, 2024
d4757cf
Merge branch 'master' into merge-changes-upstream
mdaniels5757 Dec 14, 2024
138d0d1
fix merge
mdaniels5757 Dec 14, 2024
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
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
scripts/
tests/
lib/
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"selector": "MemberExpression > Identifier[name=\"fail\"]"
}
],
"unicorn/prefer-includes": "error",

"camelcase": ["warn", {"properties": "never"}],
"es-x/no-array-prototype-includes": "warn",
Expand Down
2 changes: 1 addition & 1 deletion modules/twinklebatchdelete.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ Twinkle.batchdelete.callback.toggleSubpages = function twDbatchToggleSubpages(e)
const pageTitle = mw.Title.newFromText(pageName);

// No need to look for subpages in main/file/mediawiki space
if ([0, 6, 8].indexOf(pageTitle.namespace) > -1) {
if ([0, 6, 8].includes(pageTitle.namespace)) {
subpageLister.workerSuccess();
return;
}
Expand Down
8 changes: 4 additions & 4 deletions modules/twinkleconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -753,12 +753,12 @@ Twinkle.config.init = function twinkleconfigInit() {
check.setAttribute('type', 'checkbox');
check.setAttribute('id', pref.name + '_' + itemkey);
check.setAttribute('name', pref.name + '_' + itemkey);
if (gotPref && gotPref.indexOf(itemkey) !== -1) {
if (gotPref && gotPref.includes(itemkey)) {
check.setAttribute('checked', 'checked');
}
// cater for legacy integer array values for unlinkNamespaces (this can be removed a few years down the track...)
if (pref.name === 'unlinkNamespaces') {
if (gotPref && gotPref.indexOf(parseInt(itemkey, 10)) !== -1) {
if (gotPref && gotPref.includes(parseInt(itemkey, 10))) {
check.setAttribute('checked', 'checked');
}
}
Expand Down Expand Up @@ -896,7 +896,7 @@ Twinkle.config.init = function twinkleconfigInit() {
box.appendChild(document.createTextNode(', or by editing this page.'));
$(box).insertAfter($('#contentSub'));

} else if (['monobook', 'vector', 'vector-2022', 'cologneblue', 'modern', 'timeless', 'minerva', 'common'].indexOf(scriptPageName) !== -1) {
} else if (['monobook', 'vector', 'vector-2022', 'cologneblue', 'modern', 'timeless', 'minerva', 'common'].includes(scriptPageName)) {
// place "Looking for Twinkle options?" notice
box.setAttribute('class', 'config-userskin-box');

Expand Down Expand Up @@ -1119,7 +1119,7 @@ Twinkle.config.resetPref = function twinkleconfigResetPref(pref) {
case 'set':
$.each(pref.setValues, (itemkey) => {
if (document.getElementById(pref.name + '_' + itemkey)) {
document.getElementById(pref.name + '_' + itemkey).checked = Twinkle.defaultConfig[pref.name].indexOf(itemkey) !== -1;
document.getElementById(pref.name + '_' + itemkey).checked = Twinkle.defaultConfig[pref.name].includes(itemkey);
}
});
break;
Expand Down
2 changes: 1 addition & 1 deletion modules/twinkleimage.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Twinkle.image.callback.evaluate = function twinkleimageCallbackEvaluate(event) {
throw new Error('Twinkle.image.callback.evaluate: unknown criterion');
}

const lognomination = Twinkle.getPref('logSpeedyNominations') && Twinkle.getPref('noLogOnSpeedyNomination').indexOf(csdcrit.toLowerCase()) === -1;
const lognomination = Twinkle.getPref('logSpeedyNominations') && !Twinkle.getPref('noLogOnSpeedyNomination').includes(csdcrit.toLowerCase());
const templatename = input.derivative ? 'dw ' + input.type : input.type;

const params = $.extend({
Expand Down
28 changes: 14 additions & 14 deletions modules/twinklerollback.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ Twinkle.rollback.addLinks = {
if (mw.config.exists('wgRelevantUserName') || isRange) {
// Get the username these contributions are for
let username = mw.config.get('wgRelevantUserName');
if (Twinkle.getPref('showRollbackLinks').indexOf('contribs') !== -1 ||
(mw.config.get('wgUserName') !== username && Twinkle.getPref('showRollbackLinks').indexOf('others') !== -1) ||
(mw.config.get('wgUserName') === username && Twinkle.getPref('showRollbackLinks').indexOf('mine') !== -1)) {
if (Twinkle.getPref('showRollbackLinks').includes('contribs') ||
(mw.config.get('wgUserName') !== username && Twinkle.getPref('showRollbackLinks').includes('others')) ||
(mw.config.get('wgUserName') === username && Twinkle.getPref('showRollbackLinks').includes('mine'))) {
const $list = $('#mw-content-text').find('ul li:has(span.mw-uctop):has(.mw-changeslist-diff)');

$list.each((key, current) => {
Expand All @@ -218,7 +218,7 @@ Twinkle.rollback.addLinks = {
},

recentchanges: function() {
if (Twinkle.getPref('showRollbackLinks').indexOf('recent') !== -1) {
if (Twinkle.getPref('showRollbackLinks').includes('recent')) {
// Latest and revertable (not page creations, logs, categorizations, etc.)
let $list = $('.mw-changeslist .mw-changeslist-last.mw-changeslist-src-mw-edit');
// Exclude top-level header if "group changes" preference is used
Expand All @@ -238,7 +238,7 @@ Twinkle.rollback.addLinks = {
},

history: function() {
if (Twinkle.getPref('showRollbackLinks').indexOf('history') !== -1) {
if (Twinkle.getPref('showRollbackLinks').includes('history')) {
// All revs
const histList = $('#pagehistory li').toArray();

Expand Down Expand Up @@ -286,7 +286,7 @@ Twinkle.rollback.addLinks = {
extraParams += xtitle === 'otitle' ? mw.config.get('wgDiffOldId') : mw.config.get('wgDiffNewId');

const href = $talkLink.attr('href');
if (href.indexOf('?') === -1) {
if (!href.includes('?')) {
$talkLink.attr('href', href + '?' + extraParams);
} else {
$talkLink.attr('href', href + '&' + extraParams);
Expand All @@ -311,7 +311,7 @@ Twinkle.rollback.addLinks = {
// Not latest revision, add [restore this revision] link to newer revision
const newTitle = document.getElementById('mw-diff-ntitle1').parentNode;
newTitle.insertBefore(Twinkle.rollback.linkBuilder.restoreThisRevisionLink('wgDiffNewId'), newTitle.firstChild);
} else if (Twinkle.getPref('showRollbackLinks').indexOf('diff') !== -1 && mw.config.get('wgDiffOldId') && (mw.config.get('wgDiffOldId') !== mw.config.get('wgDiffNewId') || document.getElementById('differences-prevlink'))) {
} else if (Twinkle.getPref('showRollbackLinks').includes('diff') && mw.config.get('wgDiffOldId') && (mw.config.get('wgDiffOldId') !== mw.config.get('wgDiffNewId') || document.getElementById('differences-prevlink'))) {
// Normally .mw-userlink is a link, but if the
// username is hidden, it will be a span with
// .history-deleted as well. When a sysop views the
Expand Down Expand Up @@ -459,11 +459,11 @@ Twinkle.rollback.callbacks = {
undoafter: revertToRevID,
basetimestamp: touched,
starttimestamp: loadtimestamp,
minor: Twinkle.getPref('markRevertedPagesAsMinor').indexOf('torev') !== -1 ? true : undefined,
minor: Twinkle.getPref('markRevertedPagesAsMinor').includes('torev') ? true : undefined,
format: 'json'
};
// Handle watching, possible expiry
if (Twinkle.getPref('watchRevertedPages').indexOf('torev') !== -1) {
if (Twinkle.getPref('watchRevertedPages').includes('torev')) {
const watchOrExpiry = Twinkle.getPref('watchRevertedExpiry');

if (!watchOrExpiry || watchOrExpiry === 'no') {
Expand Down Expand Up @@ -541,7 +541,7 @@ Twinkle.rollback.callbacks = {
} else if (params.type === 'vand' &&
// Okay to test on user since it will either fail or sysop will correctly access it
// Besides, none of the trusted bots are going to be revdel'd
Twinkle.rollback.trustedBots.indexOf(top.user) !== -1 && revs.length > 1 &&
Twinkle.rollback.trustedBots.includes(top.user) && revs.length > 1 &&
revs[1].revid === params.revid) {
Morebits.Status.info('Info', [ 'Latest revision was made by ', Morebits.htmlNode('strong', lastuser), ', a trusted bot, and the revision before was made by our vandal, so we will proceed with the revert.' ]);
index = 2;
Expand All @@ -557,7 +557,7 @@ Twinkle.rollback.callbacks = {
userNorm = params.user || Twinkle.rollback.hiddenName;
}

if (Twinkle.rollback.trustedBots.indexOf(params.user) !== -1) {
if (Twinkle.rollback.trustedBots.includes(params.user)) {
switch (params.type) {
case 'vand':
Morebits.Status.info('Info', [ 'Vandalism revert was chosen on ', Morebits.htmlNode('strong', userNorm), '. As this is a trusted bot, we assume you wanted to revert vandalism made by the previous user instead.' ]);
Expand Down Expand Up @@ -685,7 +685,7 @@ Twinkle.rollback.callbacks = {
}

// Decide whether to notify the user on success
if (!Twinkle.rollback.skipTalk && Twinkle.getPref('openTalkPage').indexOf(params.type) !== -1 &&
if (!Twinkle.rollback.skipTalk && Twinkle.getPref('openTalkPage').includes(params.type) &&
!params.userHidden && mw.config.get('wgUserName') !== params.user) {
params.notifyUser = true;
// Pass along to the warn module
Expand All @@ -712,11 +712,11 @@ Twinkle.rollback.callbacks = {
undoafter: params.goodid,
basetimestamp: touched,
starttimestamp: loadtimestamp,
minor: Twinkle.getPref('markRevertedPagesAsMinor').indexOf(params.type) !== -1 ? true : undefined,
minor: Twinkle.getPref('markRevertedPagesAsMinor').includes(params.type) ? true : undefined,
format: 'json'
};
// Handle watching, possible expiry
if (Twinkle.getPref('watchRevertedPages').indexOf(params.type) !== -1) {
if (Twinkle.getPref('watchRevertedPages').includes(params.type)) {
const watchOrExpiry = Twinkle.getPref('watchRevertedExpiry');

if (!watchOrExpiry || watchOrExpiry === 'no') {
Expand Down
32 changes: 16 additions & 16 deletions modules/twinklespeedy.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,10 +441,10 @@ Twinkle.speedy.generateCsdList = function twinklespeedyGenerateCsdList(list, mod
return null;
}

if (criterion.showInNamespaces && criterion.showInNamespaces.indexOf(pageNamespace) < 0) {
if (criterion.showInNamespaces && !criterion.showInNamespaces.includes(pageNamespace)) {
return null;
}
if (criterion.hideInNamespaces && criterion.hideInNamespaces.indexOf(pageNamespace) > -1) {
if (criterion.hideInNamespaces && criterion.hideInNamespaces.includes(pageNamespace)) {
return null;
}

Expand Down Expand Up @@ -728,7 +728,7 @@ Twinkle.speedy.userList = [
tooltip:
'User requested deletion of their own user page or user-subpage. User pages that are blanked by the user may also be deleted under this criterion.',
subgroup:
mw.config.get('wgNamespaceNumber') === 3 && mw.config.get('wgTitle').indexOf('/') === -1 ? {
mw.config.get('wgNamespaceNumber') === 3 && !mw.config.get('wgTitle').includes('/') ? {
name: 'userreq_rationale',
parameter: '2',
type: 'input',
Expand Down Expand Up @@ -1283,12 +1283,12 @@ Twinkle.speedy.callbacks = {
params.utparams = buildData[1];

// Set the correct value for |ts= parameter in {{db-g13}}
if (params.normalizeds.indexOf('g13') !== -1) {
if (params.normalizeds.includes('g13')) {
code = code.replace('$TIMESTAMP', pageobj.getLastEditTime());
}

// Tag if possible, post on talk if not
if (pageobj.canEdit() && ['wikitext', 'Scribunto', 'javascript', 'css', 'sanitized-css'].indexOf(pageobj.getContentModel()) !== -1 && mw.config.get('wgNamespaceNumber') !== 710 /* TimedText */) {
if (pageobj.canEdit() && ['wikitext', 'Scribunto', 'javascript', 'css', 'sanitized-css'].includes(pageobj.getContentModel()) && mw.config.get('wgNamespaceNumber') !== 710 /* TimedText */) {
let text = pageobj.getPageText();

statelem.status('Checking for tags on the page...');
Expand Down Expand Up @@ -1326,11 +1326,11 @@ Twinkle.speedy.callbacks = {
if (mw.config.get('wgPageContentModel') === 'Scribunto') {
// Scribunto isn't parsed like wikitext, so CSD templates on modules need special handling to work
let equals = '';
while (code.indexOf(']' + equals + ']') !== -1) {
while (code.includes(']' + equals + ']')) {
equals += '=';
}
code = "require('Module:Module wikitext')._addText([" + equals + '[' + code + ']' + equals + ']);';
} else if (['javascript', 'css', 'sanitized-css'].indexOf(mw.config.get('wgPageContentModel')) !== -1) {
} else if (['javascript', 'css', 'sanitized-css'].includes(mw.config.get('wgPageContentModel'))) {
// Likewise for JS/CSS pages
code = '/* ' + code + ' */';
}
Expand All @@ -1351,7 +1351,7 @@ Twinkle.speedy.callbacks = {
}

// Blank attack pages
if (params.normalizeds.indexOf('g10') !== -1) {
if (params.normalizeds.includes('g10')) {
text = code;
} else {
// Insert tag after short description or any hatnotes
Expand Down Expand Up @@ -1778,18 +1778,18 @@ Twinkle.speedy.callback.evaluateSysop = function twinklespeedyCallbackEvaluateSy
// analyse each criterion to determine whether to watch the page, prompt for summary, or notify the creator
let watchPage, promptForSummary;
normalizeds.forEach((norm) => {
if (Twinkle.getPref('watchSpeedyPages').indexOf(norm) !== -1) {
if (Twinkle.getPref('watchSpeedyPages').includes(norm)) {
watchPage = Twinkle.getPref('watchSpeedyExpiry');
}
if (Twinkle.getPref('promptForSpeedyDeletionSummary').indexOf(norm) !== -1) {
if (Twinkle.getPref('promptForSpeedyDeletionSummary').includes(norm)) {
promptForSummary = true;
}
});

const warnusertalk = form.warnusertalk.checked && normalizeds.some((norm, index) => Twinkle.getPref('warnUserOnSpeedyDelete').indexOf(norm) !== -1 &&
const warnusertalk = form.warnusertalk.checked && normalizeds.some((norm, index) => Twinkle.getPref('warnUserOnSpeedyDelete').includes(norm) &&
!(norm === 'g6' && values[index] !== 'copypaste'));

const welcomeuser = warnusertalk && normalizeds.some((norm) => Twinkle.getPref('welcomeUserOnSpeedyDeletionNotification').indexOf(norm) !== -1);
const welcomeuser = warnusertalk && normalizeds.some((norm) => Twinkle.getPref('welcomeUserOnSpeedyDeletionNotification').includes(norm));

const params = {
values: values,
Expand Down Expand Up @@ -1831,12 +1831,12 @@ Twinkle.speedy.callback.evaluateUser = function twinklespeedyCallbackEvaluateUse
const normalizeds = values.map((value) => Twinkle.speedy.normalizeHash[value]);

// analyse each criterion to determine whether to watch the page/notify the creator
const watchPage = normalizeds.some((csdCriteria) => Twinkle.getPref('watchSpeedyPages').indexOf(csdCriteria) !== -1) && Twinkle.getPref('watchSpeedyExpiry');
const watchPage = normalizeds.some((csdCriteria) => Twinkle.getPref('watchSpeedyPages').includes(csdCriteria)) && Twinkle.getPref('watchSpeedyExpiry');

const notifyuser = form.notify.checked && normalizeds.some((norm, index) => Twinkle.getPref('notifyUserOnSpeedyDeletionNomination').indexOf(norm) !== -1 &&
const notifyuser = form.notify.checked && normalizeds.some((norm, index) => Twinkle.getPref('notifyUserOnSpeedyDeletionNomination').includes(norm) &&
!(norm === 'g6' && values[index] !== 'copypaste'));
const welcomeuser = notifyuser && normalizeds.some((norm) => Twinkle.getPref('welcomeUserOnSpeedyDeletionNotification').indexOf(norm) !== -1);
const csdlog = Twinkle.getPref('logSpeedyNominations') && normalizeds.some((norm) => Twinkle.getPref('noLogOnSpeedyNomination').indexOf(norm) === -1);
const welcomeuser = notifyuser && normalizeds.some((norm) => Twinkle.getPref('welcomeUserOnSpeedyDeletionNotification').includes(norm));
const csdlog = Twinkle.getPref('logSpeedyNominations') && normalizeds.some((norm) => !Twinkle.getPref('noLogOnSpeedyNomination').includes(norm));

const params = {
values: values,
Expand Down
4 changes: 2 additions & 2 deletions modules/twinkleunlink.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ Twinkle.unlink.callback.evaluate = function twinkleunlinkCallbackEvaluate(event)
const wikipedia_page = new Morebits.wiki.Page(pageName, 'Unlinking in page "' + pageName + '"');
wikipedia_page.setBotEdit(true); // unlink considered a floody operation
wikipedia_page.setCallbackParameters($.extend({
doBacklinks: input.backlinks.indexOf(pageName) !== -1,
doImageusage: input.imageusage.indexOf(pageName) !== -1
doBacklinks: input.backlinks.includes(pageName),
doImageusage: input.imageusage.includes(pageName)
}, params));
wikipedia_page.load(Twinkle.unlink.callbacks.unlinkBacklinks);
});
Expand Down
Loading
Loading