Commit graph

1278 commits

Author SHA1 Message Date
jenkins-bot bba0007d44 Merge "parser: Return signature and timestamp ranges" 2020-03-05 14:46:00 +00:00
Bartosz Dziewoński 0ca851aa92 parser: Return signature and timestamp ranges
Currently not used for anything. May be used later for editing
comments (T245225) or reformatting timestamps (T240360).

Note that a comment may have multiple signatures+timestamps,
and we return them all so that you have to deal with that.

Fix some unrelated incorrect documentation comments.

Bug: T245220
Change-Id: I51b8bf4a3bb7968f35e32c7e44c95c2ab079d9ac
2020-03-05 14:28:17 +01:00
Bartosz Dziewoński 898db0d57a Only allow opening one reply widget at once (on IE 11)
We disable the other reply links using 'pointer-events: none' in CSS,
but IE 11 doesn't support that.

I tried hiding them instead and using @supports rules in CSS to apply
'pointer-events: none', but the result was worse than this.

Change-Id: Iab2bfe9c623f3d32cce9776277f33483155a0c42
2020-03-05 13:31:29 +01:00
Bartosz Dziewoński efbda1b853 Minor tweaks to messages
Changing things I found awkward while translating to Polish.

Change-Id: Iba8119bc75e49580011d931be8431b04a9453a5a
2020-03-05 13:26:21 +01:00
jenkins-bot 38bb0b9d2f Merge "ReplyWidget: Set line-height to match normal wikitext editor" 2020-03-05 12:05:01 +00:00
Translation updater bot 6722975763 Localisation updates from https://translatewiki.net.
Change-Id: If96e77582475e45e066f48459daea05d7a56a445
2020-03-05 08:38:04 +01:00
David Lynch 0085b7c912 controller: apply ve.fixBase to the parsed Parsoid response
Also, add the missing dependency on ext.visualEditor.core.utils.parsing.

Bug: T245781
Change-Id: I26130f1afd7dd93012aea8a24943d966250c2472
2020-03-04 15:46:08 -06:00
Bartosz Dziewoński 6ab57649a7 ReplyWidget: Set line-height to match normal wikitext editor
Now it also matches the font in the reply editor used when
$wgDiscussionToolsUseVisualEditor is true.

Depends-On: Ia866af0163b538596bfbb8c96a330186b667f85f
Bug: T246846
Change-Id: I21bdbe798949c0027eea16904ec6bc125c4746d8
2020-03-04 15:45:04 +01:00
Translation updater bot fd74b988a3 Localisation updates from https://translatewiki.net.
Change-Id: I47fa6518d5856dc4e524730be7b6cd62f52c7765
2020-03-04 08:53:33 +01:00
Translation updater bot 25df22fd3a Localisation updates from https://translatewiki.net.
Change-Id: I24387b93782a8142d130fcd52d7adc22c3cddb42
2020-03-04 08:19:40 +01:00
jenkins-bot fa47fc9dee Merge "Move edit conflict retry code to controller" 2020-03-03 23:45:18 +00:00
jenkins-bot a8de849a4e Merge "Remove somewhat useless ReplyWidget.prototype.getParsoidCommentData" 2020-03-03 23:45:17 +00:00
jenkins-bot f1fc955dc3 Merge "Reply-to placeholder" 2020-03-03 22:59:44 +00:00
Ed Sanders 3274b0c9df Move edit conflict retry code to controller
Change-Id: Id14e93624d1828253402c04c97193fd686f67d9f
2020-03-03 13:25:14 +00:00
Ed Sanders 126266c741 Remove somewhat useless ReplyWidget.prototype.getParsoidCommentData
We always pass the same arguments to the controller method and
two of those are global config values, so just pass the comment ID
each time it is used instead.

Change-Id: Ic68c70bdadb29310e930dd10fd6c6137d01ad22f
2020-03-03 13:20:23 +00:00
Bartosz Dziewoński 606d6b34ec Add reply links at the end of a line, even if the signature is in the middle
Previously they were added at the end of the text node containing the
timestamp, which was usually the end of the line, but not always.

And also fix the same problem for inserting the actual replies (or
reply widgets). This replaces an undocumented hack that prevented our
own reply links from triggering this bug (without it, the reply widget
would be inserted before the reply link rather than after).

While we're here, remove unintentional spacing that appeared before
some reply links, caused by trailing whitespace in text nodes.

Add tests for all of the above.

Bug: T245695
Change-Id: I354b63e2446bb996176a2e3d76abf944127f307e
2020-03-02 21:39:37 +01:00
Bartosz Dziewoński 711d5c4371 Parse Parsoid document as XHTML to avoid IE 11 bugs
This is the same as in VisualEditor. ve.parseXhtml has workarounds for
IE 11 bugs that would cause dirty diffs when saving.

Note that we must use ve.serializeXhtml to convert the document back
to a HTML string, but this is already the case (the conversion happens
in mw.libs.ve.targetSaver.saveDoc).

Change-Id: Ib6dec0002eaf33fc0d4a45331a6d38e5c5d7ab8c
2020-03-02 18:14:35 +01:00
Bartosz Dziewoński 85b2cf00b1 modifier: Fix IE 11 incompatibility due to 'parentElement'
On IE 11, the 'parentElement' property is only supported on element
nodes, not on text nodes.

https://developer.mozilla.org/en-US/docs/Web/API/Node/parentElement#Browser_compatibility

There's no reason to use it here, 'parentNode' is the same for the
nodes we're concerned with.

Also remove the use in code adapted from MDN to avoid repeating this
issue in the future.

Bug: T246565
Change-Id: I0120feb3737c462f2a64e4ec084249a0fd57d0f0
2020-03-02 18:14:35 +01:00
Translation updater bot 55babd2b1c Localisation updates from https://translatewiki.net.
Change-Id: I1cd5d7fa58ecd0e71ce17c316645b95fe47e4adb
2020-03-02 09:09:50 +01:00
Bartosz Dziewoński ea26009896 Work around mw.Uri crash on fallback encoding in links
Bug: T245889
Change-Id: I182f9ffa84a3b3cf4afafd536360572eda9d2714
2020-02-29 19:08:01 +01:00
Ed Sanders 7cb82b6862 Reply-to placeholder
Sets the placeholder text to "Reply to <user>".

Bug: T245227
Depends-On: I7f3a58b7093d00aace9f9c6a95a121ba4e901ad8
Change-Id: Ie51f1848c17bb892e7f64adf6f7f19fc38e56202
2020-02-29 17:29:07 +00:00
Bartosz Dziewoński 656b413b4b ReplyWidget: Disable "Reply" button if input is empty
Bug: T246058
Change-Id: Ib46f265eff3a4b4f59b5085ab33c5ebbef76003c
2020-02-29 03:58:28 +01:00
jenkins-bot 054b50bbdd Merge "Correct the integration for logging" 2020-02-28 17:56:45 +00:00
DLynch 2b21314671 Correct the integration for logging
Bug: T244874
Change-Id: I12d1a92f9a72b0ecd3fa7e2aa20289d1f57a46dc
2020-02-28 17:42:21 +00:00
Thiemo Kreuz d217b2b85f Replace deprecated Language class properties with constants
These are going to be removed via Id370937.

Change-Id: I87b3d13f66f0f449fead49865af9f9242717c568
2020-02-28 09:19:21 +01:00
jenkins-bot 9a1921488e Merge "Instrumentation: abort-navigate case" 2020-02-27 23:24:01 +00:00
jenkins-bot 0e22b4c79f Merge "Clean up the interface after discarding a reply" 2020-02-27 23:05:00 +00:00
Bartosz Dziewoński d068d2ef2c Clean up the interface after discarding a reply
Bug: T245574
Change-Id: I016a7a5c44e0d15a153143177976cceb8d6d3d1b
2020-02-27 18:09:34 +01:00
Translation updater bot 869f69f38c Localisation updates from https://translatewiki.net.
Change-Id: Ib4870fa8cc1eaf733210512d5d5574d12a9ae32b
2020-02-27 08:36:37 +01:00
Translation updater bot 6c194ff5a9 Localisation updates from https://translatewiki.net.
Change-Id: I61d6a31002ae369c5cbf8f63dee42163b74b5ff3
2020-02-26 08:24:43 +01:00
David Lynch e2bf0d25d2 Instrumentation: abort-navigate case
Bug: T244874
Change-Id: I0f8030e17d09d5b828732fc386b0b899f8c32564
2020-02-25 23:28:24 -06:00
jenkins-bot 3fbabb73e9 Merge "Ignore LRM and RLM before timezone indicator" 2020-02-25 13:10:49 +00:00
jenkins-bot ec887b950d Merge "Rearrange test cases" 2020-02-25 13:10:49 +00:00
Translation updater bot e7f72cc35d Localisation updates from https://translatewiki.net.
Change-Id: I84432367314fb0bea5ec09ab80d841342dd20432
2020-02-25 09:36:31 +01:00
Bartosz Dziewoński e9c401e3aa Ignore LRM and RLM before timezone indicator
They are not generated by MediaWiki, but they often appear when users
sign others' unsigned comments by copy-pasting the timestamp from the
history page.

Add test config data for nlwiki, exported by running this in the
browser console:

  copy(
    JSON.stringify( { wgArticlePath, wgNamespaceIds, wgFormattedNamespaces }, null, 2 ) + '\n' +
    JSON.stringify( mw.loader.moduleRegistry['ext.discussionTools.parser'].packageExports['data.json'], null, 2 )
  );

Bug: T245784
Change-Id: Icbcdc5a028e9ce2cb09173f87769e525ec3082fc
2020-02-25 00:20:00 +00:00
Bartosz Dziewoński 2a93ed11b4 Rearrange test cases
I think directories like this make more sense for adding more test cases.

Depends-On: I9153851fe162c012967fda00d3e1f81964a8dce9
Change-Id: Ibc72b747a75c72643c1fc04eae49bd15656e8104
2020-02-25 00:19:30 +00:00
jenkins-bot b350305c36 Merge "Adjust change tag display" 2020-02-24 19:47:24 +00:00
David Lynch 2085c76433 Adjust change tag display
* Hide the top-level discussiontools tag
* Change the wording of others to be more compact and consistent with the tense requested

Bug: T242184
Change-Id: Id7ba7fd7d0a387a3ca198fd546edf65fb663a9f8
2020-02-24 19:27:27 +00:00
David Lynch fb006e6373 Instrumentation
Bug: T243364
Change-Id: I8573993db0dad408f09202e548206b009c106cc9
2020-02-24 19:50:27 +01:00
jenkins-bot 37bf81bf37 Merge "When launched from an old revision, reply to latest revision" 2020-02-24 16:23:21 +00:00
jenkins-bot 4d6bdcafb1 Merge "Try to resolve edit conflicts" 2020-02-24 16:23:20 +00:00
jenkins-bot 1dfa501cc6 Merge "Rebuild Parsoid document before attempting to save" 2020-02-24 15:53:54 +00:00
jenkins-bot e94ebddaa4 Merge "Use built-in mw.Api 'badtoken' handling, also 'assert'/'assertuser'" 2020-02-24 15:48:01 +00:00
jenkins-bot 12275aa6f1 Merge "Only detect comments with real signatures" 2020-02-24 15:08:46 +00:00
jenkins-bot 1001d9f00d Merge "Fix edit summary for comments in 0th section (no heading)" 2020-02-24 15:08:17 +00:00
Translation updater bot fd4432bb69 Localisation updates from https://translatewiki.net.
Change-Id: I8c9b7d87e79afa0c4cd886269bdb5f268580ad0f
2020-02-24 09:02:19 +01:00
jenkins-bot fcb935a2ba Merge "Add beta feature preference" 2020-02-21 22:00:44 +00:00
jenkins-bot cf8913d6a0 Merge "Don't use globals to access config" 2020-02-21 21:16:04 +00:00
Bartosz Dziewoński da11a3be73 When launched from an old revision, reply to latest revision
The "Reply" buttons were active when viewing an old revision of the
page (&oldid=1234). This was probably unintentional, and it would undo
all more recent comments if you saved yours.

However, I think it would be a useful feature. You often end up
viewing old revisions when reviewing changes to pages from your
watchlist or email notifications.

Now, when the reply widget is launched from an old revision, it will
try to find the relevant parent comment in the latest revision of the
page, and edit that revision when inserting the reply. If the parent
comment is gone, it shows a useful error message.

Bug: T235761
Change-Id: I8c5b631d3bfb62196fd219cbcd7d497408d187a7
2020-02-21 17:09:47 +00:00
Ed Sanders 2577d5aa28 Add beta feature preference
Bug: T245539
Change-Id: I8bb2c10255a13c291bc97c591612cadaf0e4339f
2020-02-21 15:20:48 +00:00