Commit graph

783 commits

Author SHA1 Message Date
Alex Monk d15034011f Allow NWE on non-VE namespaces
Bug: T146182
Change-Id: I9547dfd591ad1e68e045b4928765a95895e37737
2016-10-03 22:20:18 +01:00
Alex Monk d0abe11aca NWE: Don't show button to switch to VE if it isn't available
Bug: T146182
Change-Id: I4bd039726ebccfd4351ecc68e6d7662752412d1b
2016-09-24 02:43:38 +01:00
Alex Monk 8a80b5bbc3 Split isAvailable from visual-specific checks
Not fully tested

Bug: T146182
Change-Id: I5d7ae6e49991660ecdc2daf46b319947f83a1018
2016-09-20 23:53:53 +01:00
jenkins-bot 089e22ff6c Merge "(attempt to) make NWE work with SET" 2016-09-20 22:45:14 +00:00
jenkins-bot f6b7c64e92 Merge "Open meta dialog to edit categories when user clicks on the category footer" 2016-09-20 00:58:29 +00:00
Alex Monk 0c07caafc7 Open meta dialog to edit categories when user clicks on the category footer
Bug: T145267
Change-Id: Ie88c4d9c6327baffdb83c1affbc0515a68c0fc03
2016-09-19 21:35:45 +01:00
jenkins-bot 376a4520ea Merge "Use correct switch type when opening welcome dialog on NWE" 2016-09-19 18:16:59 +00:00
Roan Kattouw cc8ca8e738 DesktopArticleTarget: Save scroll position before transformPage
transformPage() makes significant changes to the DOM, so measuring the
scroll position synchronously right after that results in a slow forced reflow.
Instead, measure the scroll position before reorganizing half the DOM.

Change-Id: I3baee5c11ca228696ddbfb30789745f5f0faa20a
2016-09-17 00:12:39 -07:00
Alex Monk edf5b60368 (attempt to) make NWE work with SET
Ugh.

Bug: T143578
Change-Id: I71e08508eb0914be9d624202b13a4369df512b80
2016-09-17 03:36:47 +01:00
Alex Monk 926212dbae Use correct switch type when opening welcome dialog on NWE
Bug: T145225
Change-Id: I032652733576d1a9797cc3dbb3dd24ca69cb30e5
2016-09-15 01:30:01 +01:00
jenkins-bot 9721998763 Merge "Provide the new wikitext editor as a beta feature" 2016-09-13 00:56:48 +00:00
James D. Forrester 1d64e3280c Provide the new wikitext editor as a beta feature
Still needs to be de-feature-flagged later.

Bug: T142644
Change-Id: I8e2588909ff95085b5a4d58f4394d9bc805f5598
2016-09-08 00:38:08 +00:00
Ed Sanders d0bb5511a5 Cleanup getDocToSave API and use in source mode
Instead of getting wikitext from the HTML, which is probably
slower and leads to issues with the whitespace stripping hack,
override getDocToSave and get text from the linmod directly.

Bug: T144621
Change-Id: I6b6cf16ee8f3720398ba8f5c85e7715c2e68329f
2016-09-07 12:09:41 -07:00
Ed Sanders 3c25f3aede Switch from NWE to VE using 'Edit' tab
Bug: T143577
Change-Id: I19d942c879c9ccf70e95beb5f8de589eb6363039
2016-09-06 17:23:24 -07:00
jenkins-bot 06ca8ea7ba Merge "Disable veaction=editsource if NWE is disabled" 2016-09-06 15:52:27 +00:00
Ed Sanders 7b3deab5a1 Disable veaction=editsource if NWE is disabled
Bug: T144651
Change-Id: I6a1e42b2da267bc42adeee0c818046eab0b387f8
2016-09-02 17:55:37 -07:00
Ed Sanders edadf530e1 Make VE<->NWE switching progress bars non-cancellable and labelled
Soft dependency on Ifa41578164 in core to support the
non-cancellable flag.

Bug: T143582
Change-Id: I886a8f5ca90737938e4c0fedb2b456d851a12326
2016-09-02 16:47:17 -07:00
jenkins-bot feb756dfb1 Merge "Update tab and history state when switching between NWE & VE" 2016-09-02 20:43:32 +00:00
Ed Sanders e3dcf029ce Update tab and history state when switching between NWE & VE
Bug: T143577
Change-Id: I729c0f4a8131f54f81be2d776bddf3020a21e704
2016-09-02 19:31:35 +00:00
jenkins-bot dcbb8e2e90 Merge "Fix restoration of redirect HTML after exiting without saving" 2016-09-01 16:12:05 +00:00
Alex Monk d907e973fd DesktopWikitextArticleTarget#switchToVisualEditor: Use correct revision ID property
So we ensure we send the actual revision ID, not potentially undefined, to the
method. If we send undefined, it'll give us an etag for revision number 0...
And that will cause issues when we later attempt (in a future editor switch) to
pass an etag for revision 0 along with the correct revision.

Bug: T143920
Change-Id: I0c27956abdd26ae4f5f1b91010a5eab8ee0354ab
2016-09-01 02:45:22 +01:00
jenkins-bot 572e7375d7 Merge "Preserve data when switching from NWE to VE" 2016-08-30 23:33:43 +00:00
James D. Forrester ba4532aa9d Rename EditButtonPublishNotSave to EditSubmitButtonLabelPublish
Depends-On: I4fbe54876095378a476399bf5e336c8df3e91e14
Change-Id: Iface24f77775216a0ab9eb464e7e10624af7719d
2016-08-29 10:46:49 -07:00
jenkins-bot f071b0380d Merge "Vary the 'save' labels to 'publish' for public wikis" 2016-08-25 21:36:41 +00:00
jenkins-bot 3063a9f23e Merge "init: Discard attempts to activate while we're already activating" 2016-08-25 20:12:45 +00:00
Ed Sanders 134b62eb09 Preserve data when switching from NWE to VE
Bug: T143917
Change-Id: I910e731914bd71fdb131dae79d233d4306facc5d
2016-08-25 11:06:40 -07:00
James D. Forrester deef47414a Vary the 'save' labels to 'publish' for public wikis
Bug: T131132
Change-Id: I4a497265661d5ce0f6144988b514509dfa1bddfd
Depends-On: I56634ed223778a0650cf36ac7256151b13c494f1
2016-08-25 09:37:52 -07:00
David Lynch c1a065295f init: Discard attempts to activate while we're already activating
Perhaps in the future we could enhance this so that clicking a different edit
link queues that up for after the current activation finishes / aborts the
current activation cleanly.

Also, error-checking on setting an invalid progress state when loading.

Bug: T143160
Change-Id: I6c78cb19953df6fb564c06bac807e6897b63df19
2016-08-24 19:57:47 -05:00
James D. Forrester b7c7d06968 Show a different label for buttons on create vs. modify
To align with the linked patch in MediaWiki core. Taking advantage of
the opportunity to use core's messages for these, and remove some dead
wood old messages that were never used like "restore" items in mobile.

Bug: T139033
Depends-On: Ie81b5edd275963a965cd44d0fd325cae9ee2f1a6
Change-Id: Ie00e94cc77cb750a7e8d1104366bb3dad65af8a4
2016-08-24 16:01:11 -07:00
David Lynch 11a4e4e6b9 init: port in isUnModifiedLeftClick without any VE core dependencies
Bug: T143467
Change-Id: I4c0ecf80ecfff04472e136801264d50dafe39575
2016-08-22 14:40:34 -05:00
Alex Monk 166588c726 Fix insertion of templates, media, and various other things into wikitext surface
Pretty much fix everything on the insert menu... RB doesn't like it when you
try to specify both title and revision ID, but don't provide an ETag.

Change-Id: Ib25d023309d984ed8848f67b349b23231f27a957
2016-08-17 21:12:00 -07:00
Alex Monk d24fd1e389 Don't show unsaved-changes warning if user has already saved in wikitext dialog
Add an extra surface check - makes sure it's attached.

Change-Id: I1720ba18b5966549fefb839013776ac9dfe0468a
2016-08-17 21:12:00 -07:00
Alex Monk f60730a580 Fix name of mweditmodeve-tool message
Change-Id: Ib48a61b4ea56221808d96efd5cf4a5c13b8aeb0c
2016-08-17 06:21:56 +01:00
Ed Sanders c452e134cc Wikitext surface alpha feature
Edit wikitext with the VE interace.

Bug: T104479
Bug: T142138
Change-Id: Ic95b47e0dd378578555c4a2342ca9c87064ed1d5
2016-08-12 18:37:29 +00:00
David Lynch 87ea771ae6 Centralize some checks for unmodified left clicks
Change-Id: I59cee4da9bbca4c8a29eaf9d52cb00ab6e70b670
Depends-On: I4f164f7cf1d755c3662571b2a1a8371d9fe756f9
2016-08-11 13:33:26 -07:00
Alex Monk 96421b283c Fix restoration of redirect HTML after exiting without saving
This feels like it's getting far more complicated than it should be.

Bug: T140032
Change-Id: Id951400cead61da37b8bdfa05cf8add6c115547d
2016-08-09 22:43:25 +01:00
jenkins-bot cf4c2d41b3 Merge "Rewrite TOCWidget based on Linker::generateTOC" 2016-08-05 22:18:22 +00:00
Ed Sanders bb7b38575f Rewrite TOCWidget based on Linker::generateTOC
Use the new node cache to find headings.

Change-Id: I5eb75c5db5ca466fd6f16a57c693c2a4458cff7c
2016-08-05 14:11:15 -07:00
Alex Monk 7f39d4e75d Use .textSelection( 'getContents' ) instead of .val() to get the value of #wpTextbox1
To allow gadgets like wikEd to use textSelection to return the latest value.

Bug: T135747
Change-Id: Ie353cf547dea6c100c5f01ab56c9b415be1ffdb8
2016-07-31 21:58:51 +01:00
Roan Kattouw 5483b25657 Reduce mayhem caused by ?oldid=currentRevId
If you viewed a page with an ?oldid= query parameter set to the ID
of the current revision, some parts of VE would believe we were
in oldid mode (because there's an oldid present), but others
wouldn't (because the revid we're editing equals the newest revid).
This caused bugs when opening the editor a second time after saving
(which is normally impossible to do after an oldid-mode edit, because
we navigate to a new page after an oldid save, but we don't do that
in this case).

Ensure that:
* The internal state of DesktopArticleTarget is updated correctly
  after saving in this case
* The ?oldid= parameter is removed from the URL after saving
* DesktopArticleTarget.init doesn't preload the article HTML
  on a second/subsequent editor load: this causes issues because
  it caches the oldid, and generally speaking the Target's internal
  state is not considered

Bug: T141330
Change-Id: I74034328797c59f7249f1f6f4f53a92ee1c26334
2016-07-25 20:04:47 -07:00
David Lynch e9b99d8181 MWSaveDialog: Give checkboxes a class based on their origin's name
Bug: T138631
Change-Id: I2c31becd57c7988c4dd26c09ee01b4f7820c7aaa
2016-07-19 11:21:36 -05:00
Ed Sanders e50aa6fa34 Pass ve.dm.Document to addSurface as documented
Change-Id: Ic4ef3763e20d0f954e21dd651309b0e9eee65fd2
2016-07-18 11:13:54 +01:00
jenkins-bot c3ab6950bc Merge "DAT.init#setEditorPreference: Change section edit alongside tab labels" 2016-07-14 16:26:02 +00:00
Ed Sanders c645295bee Fix vertical positioning of progress bar
Bug: T140029
Change-Id: I5b38d375559449eded559e4443131516b1937b6d
2016-07-12 15:56:50 +01:00
Alex Monk 16c38ec27a DAT.init#setEditorPreference: Change section edit alongside tab labels
When our remember-last preference changes work, alongside changing the
label of the edit tab, also change the label of the edit section links.

I seriously have no idea WTF I was thinking back in December when I
put some of this code into #activatePageTarget.

Bug: T137424
Change-Id: I581c0acf0a3ad11ad3bcf4e2e46242907ca9166f
2016-06-30 10:22:44 +00:00
jenkins-bot dc59190e64 Merge "Set an automatic summary of empty string when switching from VE into WTE" 2016-06-29 16:16:57 +00:00
jenkins-bot 0d45972cb3 Merge "Fix our display of redirects during and after editing" 2016-06-29 16:15:43 +00:00
Alex Monk 984823a77d Replace section edit click handlers in DAT instead of doing it badly in init
If you deactivate without saving (e.g. using the back button), the page
contents aren't replaced and so adding the page click handlers is pointless
and harmful because they will run twice.

This was my fault in Iad1713e1

Bug: T135387
Change-Id: I3c83009bfc0f42125cdcde7f7a51de9bc2f72abf
2016-06-29 03:58:57 +01:00
Tpt 2a2a041933 Allow extensions to register a specific target per content model
Bug: T138489
Change-Id: Ic9d2fa34b90afc58f7e31adf38f97a701aac64f9
2016-06-24 15:38:28 +00:00
Alex Monk 4382e18385 Fix our display of redirects during and after editing
Change-Id: Ib559eb8fb8a2643af25ad8df858212f3e9d14b13
2016-06-15 20:25:59 +01:00