Commit graph

749 commits

Author SHA1 Message Date
Ed Sanders f96678d562 Factor out availability check
Change-Id: Ibc3e43ea50b7a38cf36f3ee2e479701d4489182e
2020-09-10 15:25:49 +01:00
jenkins-bot 4940a9431f Merge "Use Language::formatNumNoSeparators where appropriate" 2020-09-10 09:00:00 +00:00
Translation updater bot bb734e92c8 Localisation updates from https://translatewiki.net.
Change-Id: I4666f1b5d3bfad00ebacaa1c0e3e841d5d59a449
2020-09-10 09:49:18 +02:00
C. Scott Ananian 965f317015 Use Language::formatNumNoSeparators where appropriate
Avoids using the deprecated $noSeparators parameter to Language::formatNum
in favor of Language::formatNumNoSeparators, which has been around since
MW 1.21.

Change-Id: I012434d5f6c749fec45a6c160e8d5d03686192e9
2020-09-09 18:15:08 -04:00
Bartosz Dziewoński a59dee8ec2 Fix 'discussiontoolsedit' API module description
The text of this message looks like a description for a 'summary'
parameter for the API (which doesn't exist, and if it did, we'd reuse
the message from core anyway). It's supposed to contain an overall
summary/description of the whole module.

Change-Id: I110d0ac6cd6fa9c2dc171615cbf1cd9629452d5a
2020-09-09 23:06:38 +02:00
Ed Sanders 2cc39f2b84 Add topic API
Bug: T259563
Change-Id: I93bb93c272f9b30df81f7f978a3952ca1d027fec
2020-09-09 20:26:41 +00:00
Ed Sanders ebe2071dfd Upstream setPending to ReplyWidget
Now consistently uses setReadOnly instead of setDisabled.

Slight styling regression was fixed in I01e11c2ed.

Change-Id: Ice7ce00929ff9a53d0fb533f1094e7324749f3a4
2020-09-09 19:23:34 +00:00
Translation updater bot 0ab29656b6 Localisation updates from https://translatewiki.net.
Change-Id: I79fb7660e898f47f71362bb2a8dbcb8fb31a1286
2020-09-09 09:54:28 +02:00
jenkins-bot 8736184d0b Merge "Match handling of "signature scan limit" between JS and PHP" 2020-09-08 11:09:34 +00:00
Translation updater bot fe8b9ec946 Localisation updates from https://translatewiki.net.
Change-Id: Icd04de603290ba820db353763e3fddf7d9d4c299
2020-09-08 10:24:02 +02:00
Bartosz Dziewoński 14fb013515 Match handling of "signature scan limit" between JS and PHP
PHP was counting UTF-8 bytes, JS was counting UTF-16 bytes.
Both should have been counting codepoints (although it doesn't
really matter as long as they both count the same things).

I noticed the issue after adding some tests using the Cyrillic
script, when one case had different results in PHP and JS:
Id25b537fecd789640c209ff7f30e777455a3aece.

Change-Id: Ic31240678f71ba48e6ec202126bf490cea12bb66
2020-09-08 03:27:01 +02:00
Translation updater bot 2ce305fcd0 Localisation updates from https://translatewiki.net.
Change-Id: I41e4d2cbd947dfa9093e1e73a49831966ed597cc
2020-09-06 20:55:30 +02:00
Translation updater bot 0af73e0e3f Localisation updates from https://translatewiki.net.
Change-Id: I069570b20447862c2cab1238699d3bd11c129ce9
2020-09-04 09:26:18 +02:00
jenkins-bot 37e6f64503 Merge "Improve error message for edit conflict" 2020-09-02 16:07:37 +00:00
Translation updater bot 8e96131491 Localisation updates from https://translatewiki.net.
Change-Id: Ie35073d495b233a3c79061f37b352c5b48b81617
2020-09-02 09:40:19 +02:00
Bartosz Dziewoński ff05e0c0b5 Improve error message for edit conflict
Bug: T261788
Change-Id: I079517ad6e258dd23b9048f4133f18cbb087acd9
2020-09-01 22:33:25 +02:00
jenkins-bot 48336f66b3 Merge "Add integration tests using pages from ckb.wp" 2020-09-01 17:17:33 +00:00
jenkins-bot 00b4f2217a Merge "Improve and document the files in tests/data/" 2020-09-01 17:17:10 +00:00
jenkins-bot 8bf420e869 Merge "Fix parsing localised digits in PHP discussion parser" 2020-09-01 17:16:29 +00:00
jenkins-bot 7e069cdb00 Merge "Update watchlist status from API result" 2020-09-01 00:29:03 +00:00
Bartosz Dziewoński 934872a170 Add integration tests using pages from ckb.wp
This is primarily to cover the handling of localised digits,
which previously wasn't being tested, leading to T261706.

Bug: T261706
Change-Id: I9de7f01f77e767e9048c85604b559af4bca0de91
2020-09-01 01:50:33 +02:00
Bartosz Dziewoński 084f45128c Improve and document the files in tests/data/
* Remove 'wgMetaNamespace' and 'wgMetaNamespaceTalk', the same data
  exists in 'wgFormattedNamespaces'.

* Rename 'wgContentLang' to 'wgContentLanguage', to match its real
  name in JS config. MediaWiki doesn't use 'wgContentLang' anywhere,
  although the related PHP global is called $wgContLang.

* Document how I made these files, previously only mentioned in the
  commit message of e9c401e3aa.

Change-Id: I67f962812c155aedf41154e0d837e7feb5af972d
2020-09-01 01:50:33 +02:00
Bartosz Dziewoński 2d3fe47ac1 Fix parsing localised digits in PHP discussion parser
The PHP code incorrectly assumed that the digits are single-byte in
UTF-8, which is never the case (except for 0-9).

The JS code worked correctly because it uses UTF-16 strings, so the
bug would only affect non-BMP digits there. This was noted in a TODO
comment, but we overlooked it when reimplementing in PHP.

Instead of a string of 10 characters, use an array of 10
single-character strings.

Bug: T261706
Change-Id: Ic5421382474c88f003424799c53ff473d99cce92
2020-09-01 01:50:33 +02:00
Thalia 240c766768 Remove extra blank line from .gitignore file
Change-Id: I883880f4552fa90ce9166440d026d49e1da10db6
2020-08-31 15:24:56 +01:00
Ed Sanders d664e0dae4 Update watchlist status from API result
Mirrors the change made in VE in I2c844223.

Bug: T260434
Change-Id: I013e6e7b3a267de09a4e8100b98c77c22cb5b1fd
2020-08-29 20:31:58 +00:00
Bartosz Dziewoński 5e1b6b1b81 Skip past our own reply buttons when displaying reply widget
Without this, the reply widget would be inserted before the reply button,
in the middle of the paragraph.

Follow-up to e36dc8e78a.

Change-Id: I5e22a0a0b70e8da395eb23dd6ae80af70840a2e2
2020-08-29 16:24:48 +02:00
jenkins-bot dbfbffd4f3 Merge "Improve documentation of source/visual tabs/tags" 2020-08-27 19:20:48 +00:00
jenkins-bot 8726e92b38 Merge "Pass through watchlist state to response data" 2020-08-27 19:20:46 +00:00
jenkins-bot d069b1c0f9 Merge "build: Update eslint-config-wikimedia to 0.17.0" 2020-08-27 19:20:44 +00:00
Ed Sanders 3ad904e143 Improve documentation of source/visual tabs/tags
This has lead to confusion where 'visual' as been translated
as 'VisualEditor', and 'source' has been translated as 'wikitext'
(although in the latter case that may be the least confusing
translation possible for some languages).

Change-Id: Ifa7897dfb9bafd8fe240fd84afc92ba88b978944
2020-08-27 19:53:10 +01:00
Translation updater bot 228efebaea Localisation updates from https://translatewiki.net.
Change-Id: I8599fa1945fdb751ea9289c48fef2af3866deff5
2020-08-27 09:51:38 +02:00
Ed Sanders c240f281a4 Pass through watchlist state to response data
This got lost when the watchlist updating code was refactored
out into controller.js, as it assumes that 'data' (the post data)
is still available.

Bug: T261362
Change-Id: Id274e7b8518b62dddbc3d4095d9f6cab17aa17cd
2020-08-26 23:50:06 +01:00
Ed Sanders d36ffeaa3d build: Update eslint-config-wikimedia to 0.17.0
Remove variable shadowing, and fix some documentation.

Change-Id: I08a7cbbdc0a1a409f9c4415b36c62c89535e12eb
2020-08-26 23:46:34 +01:00
jenkins-bot f167bfc5b1 Merge "Don't trust RESTBase to give us the correct revision" 2020-08-26 20:27:22 +00:00
jenkins-bot ca279832cc Merge "Fix reply widget documentation" 2020-08-25 19:10:11 +00:00
jenkins-bot bc80b51fcd Merge "Fix typo in API help message key" 2020-08-25 13:28:55 +00:00
Ed Sanders d3205b877f Fix typo in API help message key
Change-Id: Idb4e973f4adb3affa857f99680707e35676810fa
2020-08-25 13:24:31 +01:00
jenkins-bot f83e2370c1 Merge "Skip to the end of the paragraph in the parser, not modifier" 2020-08-25 11:56:10 +00:00
jenkins-bot 4218d930a7 Merge "Fix error handling in controller#getPageData" 2020-08-25 11:11:39 +00:00
jenkins-bot 4be90d7494 Merge "Re-apply new reply API patches (again)" 2020-08-25 11:11:12 +00:00
Translation updater bot 44eb15f1d5 Localisation updates from https://translatewiki.net.
Change-Id: I2a2093e29a3ce5c4a22363f02faf80579e7a9946
2020-08-25 09:46:20 +02:00
Ed Sanders 17ba57edd6 Don't trust RESTBase to give us the correct revision
As we do in VE, extract the revid from the document.

Unlike in VE we don't need to throw an error if there is
a mis-match, as we will likely be able to make the edit anyway.
Just use the ID we got from the document.

Log a warning if there is ever an ID mis-match so we
can evaluate if this check is actually needed.

Change-Id: I94c37980524a9faabac49495903a5262387af562
2020-08-24 17:24:50 +01:00
Translation updater bot 4fc4286be3 Localisation updates from https://translatewiki.net.
Change-Id: Id340cda545bf9a906ef1cb8911ba7cb8e943e93e
2020-08-24 11:57:51 +02:00
Translation updater bot 711350c948 Localisation updates from https://translatewiki.net.
Change-Id: Ibd69a94b7a8fef87955564cd69c446404009e427
2020-08-21 08:40:46 +02:00
jenkins-bot e1eb983d51 Merge "parser: Code quality tweaks" 2020-08-20 20:01:03 +00:00
Bartosz Dziewoński e36dc8e78a Skip to the end of the paragraph in the parser, not modifier
When a comment ended before the end of a paragraph, the next
comment would begin right there in the middle of the paragraph.
This could result in the detected indentation level of that
comment being incorrect, and replies being inserted in wrong
places, as seen in the 'signatures-funny' test case.

The code moved to the parser was previously repeated twice in
addListItem() and addReplyLink(), which should have been a hint
that something isn't quite right.

Also, fix the code guarding against overlapping signatures,
now that signatures may not be at the end of a comment.

Bug: T260855
Change-Id: Ic26a87642f8a15d5de2f7073d4d8176b299c7f94
2020-08-20 19:35:55 +00:00
Bartosz Dziewoński 84cb9d1dca parser: Code quality tweaks
Do things in a more intuitive order, avoid some repetition,
rename a vaguely named variable.

Change-Id: Ic1a0bb54134682eaf126231e04eb67847d6a5da6
2020-08-20 20:52:42 +02:00
jenkins-bot 8dc5f0b7ba Merge "More test cases for multiple signatures in funny places" 2020-08-20 12:10:45 +00:00
jenkins-bot 5f8214a2e4 Merge "parser: Fix comment ranges when timestamp has entities" 2020-08-20 12:10:43 +00:00
Translation updater bot dddfbc99de Localisation updates from https://translatewiki.net.
Change-Id: I10af141bbea61b5c5995a6fdaeeecd7e804948eb
2020-08-20 08:26:49 +02:00