Commit graph

219 commits

Author SHA1 Message Date
Bartosz Dziewoński c848d8a90e Parser tweaks
Follow-up to Ic1438d516e223db462cb227f6668e856672f538c.
Minor corrections and comment improvements in PHP parser,
and "backporting" some changes to JS parser that I like.

Change-Id: I5e54121914ec6b323e556dd133bcb71b3aefbb61
2020-05-18 19:53:26 +00:00
Ed Sanders d1e58841af Rename removeListItem to removeAddedListItem and remove in PHP
This method shouldn't be required on the server. Leave comments
relating to it in addListItem so JS & PHP can be kept in sync.

Change-Id: I849fac660faf6e750272c20776f96b9250f96b1b
2020-05-18 19:25:08 +00:00
jenkins-bot 2b7cca1380 Merge "ReplyWidget: Move all events bind to setup" 2020-05-18 19:19:47 +00:00
jenkins-bot a41eadfc51 Merge "Modifier: Pass document to createWikitext" 2020-05-18 17:54:15 +00:00
jenkins-bot 54ea65b27e Merge "Give username completion a min width of 10em" 2020-05-18 02:51:33 +00:00
jenkins-bot 55640a8a0d Merge "Show no remote users when input is empty" 2020-05-18 02:51:32 +00:00
Ed Sanders d56b512f2e ReplyWidget: Move all events bind to setup
Bug: T252439
Change-Id: I3c76e6364b63679fcbe40d256d9ba0c3eaba1578
2020-05-17 21:12:23 +01:00
Ed Sanders 5e996fdfdd Modifier: Pass document to createWikitext
Change-Id: I1793e1d690835af746a4e25a50e2e0a474811e8e
2020-05-15 22:47:54 +01:00
Ed Sanders b78fb3f4c1 Move all PHP to the MediaWiki\Extension\DiscussionTools namespace
Change-Id: I654ebb3e646a6d8d62f7bd14d48805e39f836d7e
2020-05-15 21:57:13 +02:00
Ed Sanders 340572bc05 Create a Utils class in PHP
Also move htmlTrim to utils in JS.

Change-Id: Ia5356d713c1c5d521c396cc28bcd4ecc7ee5bbbb
2020-05-15 00:25:32 +01:00
Bartosz Dziewoński 76289cdf73 tests: Fix failures due to CDATA handling in PHP
It appears PHP's DOM library always uses CDATA nodes for the contents of
<style> tags, even if there is no such markup in the source HTML.

Change-Id: Id04b27086c5e7a0b016a3a440b2b4895d6b13c93
2020-05-14 22:37:23 +00:00
Bartosz Dziewoński 33d69e26c9 tests: Fix different whitespace trimming in PHP and JS
Notably, JS trims the no-break space, while PHP doesn't. There are
some other differences that don't come up in our tests. What we really
want is to trim the ASCII whitespace as defined in the HTML spec.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim
https://www.php.net/manual/en/function.trim.php
https://infra.spec.whatwg.org/#ascii-whitespace

Change-Id: I95b8fb38878716a2fa7ec84c9f2e8065ebe77c0d
2020-05-14 21:37:26 +00:00
Ed Sanders 076c6d828a Parser: Use Element instead of Node when appropriate
Change-Id: I67015989954e61810302bf8931d05419f007ffeb
2020-05-13 14:46:36 +01:00
jenkins-bot 8415b44837 Merge "Modifier: Fix missing docs and variable names" 2020-05-11 22:17:41 +00:00
Ed Sanders 07439609c4 Modifier: Fix missing docs and variable names
Change-Id: Ia5a7974f1efbe7465235fd1f1f548f53848ca960
2020-05-11 22:56:21 +02:00
Ed Sanders 6aa2fac2f8 Give username completion a min width of 10em
Change-Id: Id98643714e092f33034dcc84a97845fb2945bfb0
2020-05-11 19:44:52 +01:00
Ed Sanders 76bd22fe59 Show no remote users when input is empty
This could cause unrelated remote users to be shown
if you typed '@x<backspace>'.

Change-Id: I03c63ede4fce53c201398b6ba5256b68aa90391c
2020-05-11 19:35:48 +01:00
jenkins-bot dc2fe46032 Merge "parser.js: Fix some typos and variable names" 2020-05-11 15:19:36 +00:00
Ed Sanders ea0b95be05 Manually clear out session storage on teardown
We used to rely on this happening in onInputChange but
that listener is now detached.

Bug: T252176
Change-Id: I6654d68dc6107cd78172c455db9cba6cb9eabddf
2020-05-08 23:01:17 +01:00
Ed Sanders 77f1be3bd1 parser.js: Fix some typos and variable names
Change-Id: Ib80fd87893f8fad47eaeac8edabe03472b78b75c
2020-05-08 20:22:49 +01:00
jenkins-bot 4c8e92e0fb Merge "Disable VisualEditor page takeovers while a reply widget is open" 2020-05-08 14:24:26 +00:00
Ed Sanders 4f22e32304 Fix typo in parser.js 'dl' => 'dd'
Doesn't actually affect the behaviour as we are
computing indentation level.

Change-Id: I8b6824460ffbee1c0acb361c26503d3b6c439025
2020-05-08 14:24:15 +01:00
David Lynch 2f92e5d114 Disable VisualEditor page takeovers while a reply widget is open
This allows the unload handler to trigger on these links.

Depends-On: If52aa9d619eac08456874fc75c0f6e1adff01246
Bug: T244942
Change-Id: I9904e8af4a60b0f5e9a6e263cd4fd8e1e3fd1f98
2020-05-07 21:46:15 +02:00
jenkins-bot f0f457562d Merge "Handle &nbsp; and other entities in the timestamp/timezone" 2020-05-07 19:44:12 +00:00
jenkins-bot 6ee5865228 Merge "Config: Separate useVisualEditor into enableVisual and use2017Wikitext" 2020-05-06 20:27:53 +00:00
jenkins-bot 6e8899ee10 Merge "Switching between VE & wikitext (plain)" 2020-05-06 20:27:51 +00:00
jenkins-bot 6078c5b1a2 Merge "Disable IP mentioning until outstanding issues resolved" 2020-05-06 19:57:29 +00:00
jenkins-bot 2d6c8bfa94 Merge "Allow visual mode to tested with ?dtvisual=1" 2020-05-06 19:14:05 +00:00
Ed Sanders 63492f1276 Disable IP mentioning until outstanding issues resolved
Bug: T251478
Change-Id: Ied56673c08d9a9803eb58b0e373a866d21a8945f
2020-05-06 19:15:19 +01:00
Ed Sanders cb90e6edee Move IP users to bottom of suggestions
Bug: T251478
Change-Id: I55088f9724303d2c46d829a14e0dc8abd5dc38b8
2020-05-06 18:53:02 +01:00
Ed Sanders 9fab4add17 Config: Separate useVisualEditor into enableVisual and use2017Wikitext
Currently use2017Wikitext is missing some implementations.

Change-Id: Ib5f9bcc588561a80ca11de85518e6fae64e5b104
2020-05-06 18:03:36 +01:00
Ed Sanders 56d8721fd7 Switching between VE & wikitext (plain)
Bug: T234403
Change-Id: I84a639ab8e31ec9f683a63b0ecf184f426df09dd
2020-05-06 18:03:36 +01:00
Ed Sanders d18496f025 Allow visual mode to tested with ?dtvisual=1
Bug: T251963
Change-Id: Ie86ed2097e3dc008f73d9b498627f9d025b865d5
2020-05-06 18:03:12 +01:00
Ed Sanders 44fd8ec0ef Parser: Return mw.Title from getTitleFromUrl
Change-Id: I2c3ce50c5ff7486d6c1f3a0c26cb3a9f1c252b60
2020-05-05 21:34:46 +00:00
Bartosz Dziewoński 0269626adc Handle &nbsp; and other entities in the timestamp/timezone
Bug: T251838
Change-Id: Iba8d7c71e332c63229eec4bc7c80b10627135784
2020-05-05 22:38:16 +02:00
David Lynch b7ad053105 @Username completion in VE (source or visual) mode
Bug: T232601
Depends-On: I075cac9aa195574c3d416a40bbdc5ec2d64424e2
Change-Id: Ie605e783b333be0f81099d8d953725c38eb4cee1
2020-05-05 09:44:08 -05:00
Ed Sanders 5da26e2d0b parser: Have getAuthors return a list
Change-Id: Ieda881a26f802a9e8c73822fcbcc70dd6035bbb6
2020-05-05 12:13:12 +01:00
Ed Sanders 5271b3eafd Move CommentController to separate file
Change-Id: I6dbf16801058e7e41d38a0ce5753c298d380b780
2020-04-30 17:05:04 +01:00
Ed Sanders 2aa6e5f583 Allow inspectors to position beyond the surface
Change-Id: I3cd0e433ea117b1b469e5a2111f4c7988c48abfd
2020-04-30 17:05:02 +01:00
Ed Sanders a5ed469843 Create CommentController class and move most Controller methods to it
This means we have an instance for each comment, which makes keeping
track of local variables much simpler, and will make switching out
the widgets easier.

Change-Id: I7584870225b1a14146852987d6a40ad05957387c
2020-04-29 22:21:32 +02:00
Ed Sanders 75da1e0b3a ReplyWidgetVisual: Use hasContent instead of hasBeenModified for isEmpty
Change-Id: I093a4b68573809e5222db01aead3ce00ed9a87ae
2020-04-29 16:32:00 +01:00
jenkins-bot 922443f68f Merge "ConfirmEdit CAPTCHA support" 2020-04-29 12:04:44 +00:00
jenkins-bot e624e17471 Merge "Remove client-side timeout when saving pages" 2020-04-28 22:38:27 +00:00
jenkins-bot bb096d8f50 Merge "Revise error messages when replying to comments affected by templates" 2020-04-28 22:35:47 +00:00
jenkins-bot 431716577b Merge "Add 'cursor: pointer' to the reply link" 2020-04-28 22:33:34 +00:00
jenkins-bot ba3fd84243 Merge "Minimum keyboard-accessibility for the reply link" 2020-04-28 22:33:33 +00:00
jenkins-bot 5fdf6ae466 Merge "Fix inserting replies inside a <pre>" 2020-04-28 22:31:45 +00:00
Bartosz Dziewoński 021c981817 Add utils.getNativeRange() method
Change-Id: Iab6c5fa092560ee9dff808bbcc405722914febe7
2020-04-28 23:11:26 +02:00
Ed Sanders 04f8e21554 Implement auto-save for ReplyWidgetPlain
Bug: T240257
Change-Id: Ica51fb51a5091b11aceb3cd5c484ef9c71b98af2
2020-04-28 20:32:20 +02:00
Bartosz Dziewoński 047e8eb82c Fix inserting replies inside a <pre>
In the future, we should think about a better solution that also
handles other elements (T250126), but this is an easy fix for now.

Bug: T250512
Change-Id: I1321f0da523ddb4a999b8c453b9094a267b38ae2
2020-04-27 23:23:31 +02:00