Commit graph

1944 commits

Author SHA1 Message Date
David Lynch 5eea2d42fb ReplyWidget: calling undefined clear method
Caused by 49edbb82ab.

Bug: T240729
Change-Id: I23bf7fcb7e0265f9770629590702a07a3dbed2b1
2019-12-13 16:49:10 -06:00
jenkins-bot 2680307b37 Merge "Prompt users when pressing 'cancel' with content in the widget" 2019-12-13 19:00:41 +00:00
jenkins-bot b1d5e2953a Merge "Add beforeunload handlers" 2019-12-13 19:00:40 +00:00
Ed Sanders 49edbb82ab Prompt users when pressing 'cancel' with content in the widget
And actually discard the contents when they confirm.

For now this uses the generic editor message, but that can
be tweaked later.

Bug: T240271
Change-Id: I2dfa19b2cc7ac49d7efea37ac8c9429c75934a91
2019-12-13 18:15:48 +00:00
Ed Sanders 179b29a598 Add beforeunload handlers
Bug: T240259
Change-Id: I376ea116a0fd1fdf794d9eb9e1d15f3d34babd88
2019-12-13 18:11:22 +00:00
Bartosz Dziewoński 0568d42042 Correct typos to fix edit conflict detection
* Query parameters for the API must be in lowercase.
* Also, 'starttimestamp' was misspelled.

Bug: T240643
Change-Id: I6497770dfc3a9512af063b846c3f73aa5603b637
2019-12-13 15:29:42 +01:00
Translation updater bot f83d3ca568 Localisation updates from https://translatewiki.net.
Change-Id: I049a8fffb56644798d8efff60ebce506ac8453fe
2019-12-13 09:28:10 +01:00
Ed Sanders ccbbf386d2 Live preview
Change-Id: I1654e95e94686b27818cbc465d5a9e8600404634
2019-12-12 23:59:24 +00:00
Ed Sanders fc55b452b3 Show 'terms' message
Copied from Flow.

Change-Id: I5fe67948ba41a5a3364d8b0237583548c787d772
2019-12-12 22:26:22 +01:00
Ed Sanders 83ddc3d627 Show anon warning
Message copied from Flow.

Change-Id: Id003a1e57447b3087cd973964b3a88886d2cb7d6
2019-12-12 15:53:18 +00:00
Ed Sanders 763450db24 Create autoSign method and add whitespace trimming.
Method can be used by preview logic later. Whitespace trimming
avoids sig ending up on newline in a <pre>.

Change-Id: If6f06f17395af0c6645082c1b9493be87422c059
2019-12-12 15:28:42 +00:00
Translation updater bot c513a66d5a Localisation updates from https://translatewiki.net.
Change-Id: I73d42b63abbd29ca6dc574dec3476b0f75e52345
2019-12-12 09:56:35 +01:00
James D. Forrester f69381ce05 extension.json: Add link to the extension page
Change-Id: I8c9292bc4ad93425ae3f3d7b315f5b95b63afe1f
2019-12-12 01:41:33 +00:00
Bartosz Dziewoński 3e5a67010f Use module.exports/require() rather than mw.dt namespace for defining classes
The packageFiles system makes it easier to export site config data
from PHP to JS, which we need a lot of, but it's awkward when mixing
it with defining and accessing classes via a namespace like mw.dt.

The only thing remaining in mw.dt is mw.dt.pageThreads, which is
described to be "for debugging", so we should keep it easy to type.
Also we still use the namespace for documenting classes.

Everything else can be reached by require()'ing a ResourceLoader
module, for example instead of `mw.dt.ui.ReplyWidget`
you'd do `require( 'ext.discussionTools.ReplyWidget' )`.
(When debugging from browser console, use `mw.loader.require` instead.)

Change-Id: I6496abcf58c21658d6fd0f3fc1db1f7380a89df7
2019-12-10 22:47:40 +01:00
Translation updater bot 9b95f121cf Localisation updates from https://translatewiki.net.
Change-Id: If0634f569300badcec0c81c5f5043e02e76daf18
2019-12-10 09:29:32 +01:00
jenkins-bot 187bd718e9 Merge "Don't load DT on edit pages" 2019-12-09 19:24:12 +00:00
jenkins-bot 2c5e125fe3 Merge "Disable buttons while posting" 2019-12-09 19:17:50 +00:00
Ed Sanders e2c31a8450 Don't load DT on edit pages
Bug: T239873
Change-Id: I2aaa2f008d08dd5be9e0dfa980a68a9bfda91b44
2019-12-09 14:43:39 +00:00
Bartosz Dziewoński da668b72d5 Identify comments by username+timestamp+seq
Possible use cases:
* Matching comments between PHP and Parsoid HTML [implemented here]
* Finding the same comment in a different revision of a page
  (e.g. while resolving an edit conflict, or to allow resuming
  composition of autosaved comments) [implemented for highlighting
  user's own posted comment only]
* Permanent links to comments [future]

The reasoning for this form of ID is:
* _Timestamp_ by itself is a nearly unique identifier, so it's a good
  thing to start with
* Users may post multiple comments in one edit (or in many edits in
  one minute), so we need the _sequential number_ to distinguish them
* _Username_ is probably not required, but it may reduce the need
  for sequential numbers, and will help with human-readability if we
  add permanent links

The ID remains stable when a new comment is added anywhere by anyone
(excepts comments within the same minute by the same user), or when a
section is renamed.

It's not always stable when a comment is moved or when an entire
section is moved or deleted (archived), but you can't have everything.

Change-Id: Idaae6427d659d12b82e37f1791bd03833632c7c0
2019-12-09 13:45:31 +00:00
Ed Sanders f59482d638 Disable buttons while posting
Bug: T239865
Change-Id: Id32e35e223def1f31f52d26284638a0f00338ea7
2019-12-09 13:41:54 +00:00
Translation updater bot 98e17fefe1 Localisation updates from https://translatewiki.net.
Change-Id: If5ea62ba7ad3b7f0479803672d5bfa1db5342e6f
2019-12-09 09:35:02 +01:00
jenkins-bot a2ab3188eb Merge "i18n all the things" 2019-12-07 22:20:49 +00:00
Ed Sanders 682732897d i18n all the things
Change-Id: I01da9a88cd69facfeb33b37a727d1cd65c12a78d
2019-12-06 18:51:02 +00:00
Ed Sanders 1de021e570 Disable widget and show as pending while posting
Change-Id: I4a820fdbe8cdc0702dd48ba6ee7e999916cfb599
2019-12-06 17:55:29 +00:00
Ed Sanders 308375ca4b Submit on ctrl+enter
Bug: T239859
Change-Id: I05cca4b7f841c317b35faecf61e30950e17c0e09
2019-12-06 17:55:13 +00:00
Translation updater bot 5181777ae9 Localisation updates from https://translatewiki.net.
Change-Id: Ie7c434d8e4980e9e3d65023d23af0a0805df9c02
2019-12-06 09:30:14 +01:00
Translation updater bot 212a8e45c1 Localisation updates from https://translatewiki.net.
Change-Id: Ib6d99d5e1666760658bb309708ddfc7e66f75b65
2019-12-05 09:46:00 +01:00
Bartosz Dziewoński 8b86d1abbc Document how to update the test JSON files
(And rebuild them using this method, the properties are in different
order, it's actually nice for readability to have 'replies' last)

Change-Id: Ib586e1081fa36cb9125db1b0b1d41f092350641c
2019-12-03 21:07:16 +01:00
jenkins-bot 689945bde8 Merge "Use editfont (monospace by default) for ReplyWidget" 2019-12-03 19:38:31 +00:00
jenkins-bot a7db61d43f Merge "Highlight comment after saving" 2019-12-03 16:49:01 +00:00
Ed Sanders a6147ffac8 Highlight comment after saving
* Init on wikipage.content hook
* Update page state variables after save

Change-Id: I05a3c766668999f05cfe06473652429025595196
2019-12-03 16:40:35 +00:00
Ed Sanders 723622ab5c Use editfont (monospace by default) for ReplyWidget
Change-Id: I6ebcb02402526044c5aac135d57276f23589579e
2019-12-03 16:29:25 +00:00
jenkins-bot f64ecd9904 Merge "Reserve space for the "Reply" link when hiding it" 2019-12-02 16:54:28 +00:00
jenkins-bot 39cb7bedef Merge "Add missing dependency to ReplyWidget" 2019-12-02 11:42:04 +00:00
Translation updater bot f83b47870a Localisation updates from https://translatewiki.net.
Change-Id: Ifb317b3cc6c7d96487edf4d0ac9238d62ba41c4c
2019-11-29 09:28:03 +01:00
Translation updater bot 7066439bc6 Localisation updates from https://translatewiki.net.
Change-Id: Idaa51415864d5b7c4dcefef96b85a0d9585f9daa
2019-11-27 09:36:56 +01:00
Bartosz Dziewoński 872c73e1b2 Reserve space for the "Reply" link when hiding it
Otherwise the rest of the page may shift if hiding the link changes
line-wrapping. It felt super confusing when it happened to me while
I was testing an unrelated thing.
https://phabricator.wikimedia.org/F31254175

Change-Id: I53aecdbf3bfba579b48875532d251de0f1c81d6c
2019-11-25 16:23:00 +00:00
Bartosz Dziewoński aeeeb0c0f8 Add missing dependency to ReplyWidget
The `mw.dt.ui` namespace is defined in dt.init.js, this must have
worked by accident before.

Change-Id: I000a33b9c51e77c87f12f71665b36273995b3d55
2019-11-24 16:50:43 +01:00
Ed Sanders 55b8405e22 Plain ReplyWidget styling
* Make full width
* Set min rows and autosize
* Position and align actions

Change-Id: I298629980a821c94e04d83c918f9b45dc9436c44
2019-11-22 16:55:15 -05:00
Ed Sanders a17fb49a68 Scroll ReplyWidget into view
Change-Id: I302346c85aacf9e410ff1468723b30fd04351032
2019-11-22 16:45:26 -05:00
Bartosz Dziewoński 994c38d68c Fix ReplyWidget dependencies
It needs just OOUI right now, not VE.

Change-Id: I17b03b8bcb6020ec956130c01dcd07fd4b16ec6d
2019-11-22 14:40:23 -05:00
jenkins-bot 59248558d1 Merge "Move postReply code to controller" 2019-11-22 19:35:59 +00:00
jenkins-bot 7a66c470d6 Merge "Implement basic saving" 2019-11-22 19:34:20 +00:00
jenkins-bot 3e709fea84 Merge "Fix opening/closing widgets multiple times" 2019-11-22 19:30:23 +00:00
jenkins-bot 124604f2b1 Merge "Wrap up the plain textbox in a ReplyWidget" 2019-11-21 14:21:19 +00:00
Ed Sanders 87696c9c3c Move postReply code to controller
Change-Id: Ie66273d9b9f70b625ab7757c93b5884a01c70751
2019-11-21 08:24:57 -05:00
Ed Sanders 2b36ebe668 Implement basic saving
Depends-On: I63fa04598e0d703fe1ba715c9c5a0abbb0d7ba5b
Change-Id: Ie15f94a2b779da559615c3b1fac55c98aca59fd4
2019-11-21 08:24:09 -05:00
Ed Sanders 8a0a400449 Fix opening/closing widgets multiple times
For now don't allow more that one widget to be open at once.

Change-Id: I3bb5ad8e79853f9b4115b761bd97e9d6d835a5c4
2019-11-21 08:22:25 -05:00
Ed Sanders 41676098fa Wrap up the plain textbox in a ReplyWidget
Depends-On: I765d657c172d96c3b2e2ae5998083e4926a31f15
Change-Id: I3c71fc014b723b0762e2c2be2e0295c57ecfb40d
2019-11-21 08:22:24 -05:00
Ed Sanders 9733f72354 Use Parsoid hack to remove whitespace from replies
Change-Id: I1ad0f5498c3c409df6d4eb2d400a0f714dff9908
2019-11-19 21:24:33 +00:00