Commit graph

426 commits

Author SHA1 Message Date
jenkins-bot b1804fbb8b Merge "Add content getters to Thread/Comment items" 2020-09-21 22:35:24 +00:00
jenkins-bot e7206488a8 Merge "Collapse advanced drawer when clearing" 2020-09-21 21:08:03 +00:00
jenkins-bot db82dce31f Merge "Only reset summaryPrefixLength on user event" 2020-09-21 21:06:29 +00:00
jenkins-bot e4fa3d3593 Merge "Always send edit summary, regardless of visibility" 2020-09-21 21:06:28 +00:00
Ed Sanders e6b91ced43 Collapse advanced drawer when clearing
Bug: T263061
Change-Id: Ibcd95ce1c86548962b9b7ff7b62bd0d127f53b76
2020-09-21 20:52:47 +01:00
Ed Sanders 9d3eea5fdf Only reset summaryPrefixLength on user event
Bug: T263062
Change-Id: I323ce4dab0a430e2aeb906ae9cd5d6b48a179cff
2020-09-21 20:39:21 +01:00
David Lynch b988eca191 When preventing switching modes, don't log a type-specific action
Just log dialog-prevent-show.

Bug: T259673
Change-Id: I336ad745a3bd92b9a5d40fc0962be2084a6cc589
2020-09-17 16:52:32 -05:00
jenkins-bot 636ca06e7e Merge "Fix parsing links in Parsoid documents without short URLs" 2020-09-17 20:40:40 +00:00
Ed Sanders 5c2abccf2a Always send edit summary, regardless of visibility
Bug: T262501
Change-Id: If5a8837afc8d91f4d46db1d928142d775da010c1
2020-09-17 20:06:51 +01:00
jenkins-bot 328674d042 Merge "Parsing discussions converted to language variants" 2020-09-16 22:52:37 +00:00
Bartosz Dziewoński 329df8c953 Parsing discussions converted to language variants
* Export parser data (date format, digits, timezone names, and
  messages for weekday/month names) converted to language variants
* Update the parsers to try matching using every variant, in case
  the page is displayed in non-default variant (and to avoid
  problems with incomplete variant conversion)

Bug: T259818
Change-Id: I04d73992cd31ce06fa79f87df0c0a53d7efc3c58
2020-09-16 22:07:07 +00:00
jenkins-bot 53cb5a3b19 Merge "'transcludedfrom' API response is an object, not array" 2020-09-16 22:02:16 +00:00
jenkins-bot 75f073759f Merge "Bypass useless API requests on non-existent pages" 2020-09-16 20:40:01 +00:00
Bartosz Dziewoński 39f4bf8626 'transcludedfrom' API response is an object, not array
Change-Id: Ibad2190cdf79b677cdf021f3253d1f432860f6e6
2020-09-16 22:30:11 +02:00
Ed Sanders fe8c40759b Bypass useless API requests on non-existent pages
The reply tool will do nothing on a new page, but we will
soon have the new discussion tool here.

Change-Id: Id772f7cc1f8701d659f3c7209c07dc4eb857e1fc
2020-09-16 12:19:42 +01:00
jenkins-bot 55a4e376fe Merge "Documentation fix" 2020-09-14 23:46:08 +00:00
Ed Sanders 92a8ca3469 Documentation fix
Change-Id: Ic37bb713bed8af7390a3e8be7ea0203b4687ce0e
2020-09-15 01:38:54 +02:00
DLynch aab80e8641 Merge "Log when the advanced mode panel is toggled" 2020-09-14 22:39:32 +00:00
jenkins-bot c02f54a848 Merge "Edit summary in advanced mode" 2020-09-14 22:29:59 +00:00
David Lynch 5b20503ec2 Log when the advanced mode panel is toggled
Bug: T261816
Change-Id: Iadd17b4f5280fc09d7a16a64bb709bab1a1a09d5
2020-09-14 22:14:40 +00:00
Ed Sanders ebaa132ebf Edit summary in advanced mode
Bug: T249391
Change-Id: Ibfd1cf77293d30b8e0d9869bbdc9aae2aa830a06
2020-09-14 22:29:54 +01:00
Ed Sanders 5ced26b718 Add content getters to Thread/Comment items
Change-Id: I29cd36eb63bfa00e333efb3c6d7d7e1cdc58cf65
2020-09-12 13:19:36 +01:00
jenkins-bot fa2ee6cfe6 Merge "Skip over whitespace when looking for trailing comments" 2020-09-11 18:46:17 +00:00
Bartosz Dziewoński 34fb7c6497 utils: Avoid Node#contains for IE 11 support
Bug: T260061
Change-Id: Ifd1e9067ab16a65349a460e935bb95f5895432db
2020-09-11 18:06:44 +00:00
Ed Sanders d4f67918b2 Skip over whitespace when looking for trailing comments
Bug: T257651
Change-Id: Icce377f1833b80bd066622d6be3e711a18c58eea
2020-09-11 15:37:09 +01: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
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
Bartosz Dziewoński 10899af666 Fix parsing links in Parsoid documents without short URLs
Move the code so that we check for "?title=" query parameter first,
because we don't handle this right in the other code path.

Use parse_url() instead of wfParseUrl() because the latter doesn't
accept relative URLs, and we don't care about the other differences.

Bug: T261711
Depends-On: I4da952876e1c3d1a41d06b51f7e26015ff5e34d7
Change-Id: I70fac2b41befd782b0a47a4f726ae748dc0f775d
2020-09-02 23:42:37 +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 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 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
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
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 ca279832cc Merge "Fix reply widget documentation" 2020-08-25 19:10:11 +00: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
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 5f8214a2e4 Merge "parser: Fix comment ranges when timestamp has entities" 2020-08-20 12:10:43 +00:00
Bartosz Dziewoński 03539527b4 Fix error handling in controller#getPageData
We were accidentally resolving the promise with `undefined`, rather
than rejecting it. This later caused "TypeError: Cannot read property
'linterrors' of undefined" in controller#checkCommentOnPage.

Bug: T260294
Change-Id: I29418988023d86140cfa110c0c348059b293a716
2020-08-19 20:06:09 +00:00
Ed Sanders c32a8996c7 Fix reply widget documentation
Change-Id: I46d033595ecf6c226ae23aefb03884841a3299c7
2020-08-19 20:05:55 +00:00
Bartosz Dziewoński b706eac8bc Re-apply new reply API patches (again)
This reverts commit 4d7c98b97c.

Change-Id: I4100521efb687ec324d25e273a9c986fd5dac0d0
2020-08-19 20:05:42 +00:00
jenkins-bot 1159172e32 Merge "Fix crash when trying to mention invalid usernames" 2020-08-18 15:35:29 +00:00
jenkins-bot 470c630662 Merge "Revert new reply API (again)" 2020-08-17 20:22:58 +00:00
Bartosz Dziewoński e0312957e6 Fix crash when trying to mention invalid usernames
Change-Id: I1e7213c38067e3c3107752705c4d3e4ed64a9258
2020-08-16 22:50:32 +02:00