Commit graph

700 commits

Author SHA1 Message Date
Ed Sanders 6f72ef82d9 Show simple category list in preview
Bug: T153534
Change-Id: Ie86abdad76a38855d5ad1a394c0bfb3c8dd5a8c6
2017-06-20 23:50:52 +00:00
Ed Sanders 9dd638a5ab Move preview document filtering into MWSaveDialog
Also:
* Make mw-content-DIR nest inside mw-body-content
* Use ve.filterMetaElements

Change-Id: Ic70c7dff0f74b81f92b8bd48e8092549947990ba
Depends-On: I478fe1f39164b9fd7e71987b818b8f668d1a7020
2017-06-20 23:50:44 +00:00
Bartosz Dziewoński 39b82f7b00 Revert 032fb292, a97eacd0
Reverting a new weird hack for an issue and bringing back the
old, tried and true hack that was removed in the mistaken belief
that if a bug is marked as fixed, it is really fixed.

* Revert "MWTransclusionDialog: size footer correctly"
  This reverts commit 032fb2924e.
* Revert "Remove dialog height hack tagged against resolved bug"
  This reverts commit a97eacd05b.

Bug: T93290
Bug: T167483
Change-Id: If1cc07837892bb0248c74025d5403f9698e77705
2017-06-14 20:38:38 +02:00
David Lynch 032fb2924e MWTransclusionDialog: size footer correctly
Changing label means a refresh is needed.

Bug: T167483
Change-Id: Ie4b35696bdf21d2a74e786875615d8753a57972d
2017-06-13 11:48:38 -05:00
Ed Sanders 4a163020a8 Add filename to gallery dialog page
Also add fieldset headings consistent with media dialog.

Bug: T167049
Change-Id: I8112b70d8e3ba19079fdab0806ad343b233c9c18
2017-06-06 15:48:24 +01:00
jenkins-bot c5bdd39a63 Merge "Update for deprecation of OOjs UI openWindow/closeWindow promise" 2017-06-02 00:32:39 +00:00
Bartosz Dziewoński 4f55d8066e Update for deprecation of OOjs UI openWindow/closeWindow promise
Bug: T166729
Change-Id: I95b85a8c0d488993c11da74e1d856fef6cf0ebb4
2017-06-02 00:21:58 +02:00
Bartosz Dziewoński 834539748c ve.ui.MWTemplateDialog: Use normal #getReadyProcess instead of custom stuff
This fixes the focussing problems from T166150.

As a separate consequence, when loading a template/transclusion
takes a while (it can take several seconds for e.g. a template with
100 parameters), we will now display nothing while the user waits.
Previously we displayed an empty frozen dialog (note that this only
worked the first time for some reason).

Bug: T166150
Change-Id: I414a72ee248517867eef63a75f2d327aa5d5b908
2017-06-01 16:31:05 +02:00
Ed Sanders a97eacd05b Remove dialog height hack tagged against resolved bug
Bug: T93290
Change-Id: Idbb20a0adf854ba68e10043608764891f3d8514d
2017-05-23 17:48:02 +01:00
Volker E f695877de7 Rename deprecated Card to current TabPanel
Renaming CardLayout to TabPanelLayout and all connected code instances.
Follow-up to Icfe1652cc038dc131b6b855ce9b45040b8ee5178

Bug: T164903
Change-Id: I9ce4e31e390522d469e126fb3a4b05787cef7fef
2017-05-10 11:46:49 -07:00
Ed Sanders debcd678b5 Generate visual diff only after switching to visual diff tab
Bug: T164724
Change-Id: I48e49d4b68cc769b3e9d061983de4c78b5ad5c34
2017-05-09 10:09:39 +00:00
Ed Sanders 54fc920622 Captcha improvements
* Fix focus and resize/scroll into view after the
  captcha has loaded (so after the image has loaded
  for FancyCaptch).
* Add margin between input and captcha
* Enable enter-to-submit on captch input field.
* Unify code for simple/math/questy and correctly
  render math as HTML (by looking at the mime type)

Change-Id: I10433cefbfea8569674c120dde5b489570e20966
2017-05-02 17:49:12 +01:00
Ed Sanders 3999fb1eb6 VisualDiff: Check save dialog is still visible when re-rendering diff
Change-Id: I1d740b767d150699863f18ee6dd9eca8a35b2bf1
2017-04-27 18:36:07 +01:00
Ed Sanders df3a4fb171 MWSaveDialog: Check diffElement still exists after setTimeout
Bug: T162642
Change-Id: Iec01a8ebbda39d83fd1c2f4dbbef17793d9af1e4
2017-04-24 18:03:35 +00:00
Ed Sanders a6b4258f47 ArticleTarget: Refactor savedialog/target interaction
* Pass a wikitext promise, instead of wikitext
* Handle writing of content to the dialog from within
  the dialog.
* Handle diff errors within the dialog.
* Never disable the 'Return to save form' (approve) button
* Remove redundant messages

Change-Id: Ibd76e8951998f751abfb4f407682202c2f73ac7e
2017-04-10 10:29:41 -07:00
Ed Sanders 7a66d4f08a Update VE core submodule to master (1338c50f5)
New changes:
ae0204885 stylelint: Remove no-unsupported-browser-features overrides
d744cd576 Localisation updates from https://translatewiki.net.
1338c50f5 [BREAKING CHANGE] Remove resize handlers from within DiffElement

Local changes:
Trigger diff element resize on dialog resize

Depends-On: I82a67a4309bf76db5407ea38c26c47d14c01e921
Change-Id: I912a99edca25ff576e2872723f91afe54e36a170
2017-04-10 10:29:18 -07:00
Ed Sanders 97f6bdd79a Make Target#getVisualDiff async
This will be required later when we have to fetch the original
document from the server before running a visual diff.

Change-Id: I351688f4d1fec892bc297f40c209939cbb2ccf95
2017-04-09 13:26:22 +01:00
James D. Forrester 8463524e18 MWSaveDialog: Run links through a render function for preview & visual diff
Provide a utility funcition in ve.init.mw.LinkCache to do this.

Also use this in ve.ce.MWTransclusionNode/ve.ui.MWPreviewElement, and
introduce to ve.ce.MWExtenionNode

Bug: T73900
Bug: T153535
Change-Id: Ieb9a0274b8c5ae1932c431546f09d18000fa6dd9
2017-03-31 10:51:35 +01:00
David Lynch 9e86d17260 MediaDialog: flag caption widget as being in a dialog
This means that cmd+enter won't add a newline when it closes the dialog.

Bug: T161555
Change-Id: I738c9acf8cce437ce6bc4c8db29f28d1fff3d2c9
2017-03-28 11:43:59 -05:00
Ed Sanders 4ac660ad48 Defer rendering of visual diff until tab is selected
Bug: T161355
Change-Id: I718a92f4c9f8c3a48e359da898ede7dccebcec5e
2017-03-25 13:23:28 +00:00
James D. Forrester 555aba7fe8 ve.ui.MWGalleryDialog: Don't die if the dropdown menu doesn't have a value
Bug: T160967
Change-Id: Ic83e204eb5c2d14baadf0e450a27ce836337b983
2017-03-22 13:49:49 -05:00
Ed Sanders 335b56728a Introduce visual differ in the save dialog
Bug: T143350
Change-Id: I1297d0f4bb87e69be3b50220c1830a22dac1bbae
2017-03-16 15:33:54 +00:00
Bartosz Dziewoński 49f603c703 Update <pre> support for Parsoid changes
After 79ccfb9372cb57afa569036ef39ead13abfba673, MediaWiki's `<pre>`
tags get rendered as `<pre typeof="mw:Extension/pre">` in Parsoid HTML.
MediaWiki's indent-pre syntax (block indented by a single space) is
still rendered as `<pre>` in Parsoid HTML, however.

Indent-pre is still handled by MWPreformattedNode (no changes).
Introducing MWPreNode, which will handle `<pre>` extension tags,
and MWPreDialog to change its contents (and allow converting
to MWPreformattedNode).

Pieces copied from MWGalleryNode, MWLinkNodeInspector, CommentInspector.

Possible future improvements:
* Add a specific icon for MWPreContextItem
* Avoid API roundtrips for rendering (but rendering wikitext <pre>
  is not as simple as it looks)
* Consider a way to insert these other than '<pre' sequence

Bug: T159900
Change-Id: I5bc4ea6e5d893736f65ef0dd43b08c18cb1a1e85
2017-03-14 14:08:50 -07:00
Thalia 586cb06821 Update gallery actions in response to changes
Bug: T62311
Change-Id: Icf51b92cb9a88471c5f11843473523787c177742
2017-03-14 19:10:34 +00:00
Bartosz Dziewoński 7b618c55aa ve.ui.MWGalleryDialog: Fix 'Display mode' dropdown options' styling
It's actually a bit surprising that the only thing broken by using
OptionWidget instead of MenuOptionWidget is some missing styles.

Change-Id: I3961fedbfc61f2f17d91dc7375d47a3cdff2a257
2017-03-09 16:16:21 +01:00
Ed Sanders 8802aa331b Add external classes to mw:ExtLinks in NWE preview
Bug: T153413
Change-Id: I118d3b1794b99ed2d120dd5c5201c1fd18b6245b
2017-03-03 22:46:21 +00:00
jenkins-bot ec897c120b Merge "Pass $overlay to FieldsetLayout and FieldLayout in various places" 2017-03-01 00:35:06 +00:00
jenkins-bot 97d689c824 Merge "MWSaveDialog: Switch to save panel when showing message" 2017-02-16 17:14:12 +00:00
David Lynch 288422cb9e MWSaveDialog: Switch to save panel when showing message
Fixing T107251 made it so that clicking "save" always switched back to the
save panel momentarily, causing a flicker of "maybe I can edit this"
experience. With this change, we can only switch back to the save panel when
saving from other panels if a message is being shown.

Bug: T156891
Change-Id: I8f67693283e61c39cfce40ee12d5c6788dd97932
2017-02-16 10:32:21 -06:00
Ed Sanders 9337e6ecbd Tables: Add support for editing mw-collapsible/mw-collapsed
We don't support editing <div>s right now (as they're BranchNodes) nor
<span>s (as they're annotations), but most of those are inside templates
and so not editable in VE anyway.

Bug: T157989
Change-Id: I647b2a544fd16952696d0de8d07cb72189b27ecb
2017-02-16 17:21:44 +01:00
Bartosz Dziewoński 22df25c108 Pass $overlay to FieldsetLayout and FieldLayout in various places
We now use dialog's overlay in every case where we have a FieldsetLayout
or a FieldLayout with a help popup inside a dialog.

Bug: T100571
Change-Id: I8bd0ed430637feca63ec0f13cb7e1e1c659391a5
2017-02-16 02:56:03 +01:00
Ed Sanders 08b3f73f16 MWTableDialog: Extend initial values so 'done' button behaves correctly
Depends-On: I608431365f2a482536affe1dae3fe21bc20e16b4
Change-Id: Idd468caa9417ffd8e0475083c884ef6c554ee152
2017-02-13 08:30:51 -08:00
Ed Sanders 444ed0b7d8 MWTableDialog: Inherit actions from core
Change-Id: Ice7f18ac2e1b7728a52a48482728d1b1278ca66f
2017-02-13 08:30:51 -08:00
Bartosz Dziewoński aa22a8c482 vw.ui.MWTableDialog: Add "Cancel" button
The dialog already supports cancelling by pressing Escape,
but the usual dedicated button was missing.

Change-Id: Ic63b5b59940a43474051466bdbbba0dbeb4342a9
2017-02-10 15:26:33 +01:00
Bartosz Dziewoński 5200f2ef34 ve.ui.MWSaveDialog: Show a hint to use Ctrl+Enter to submit when pressing Enter
Or Cmd+Enter for Mac.

Depends on VisualEditor core changes:
* I93f50e325f993d82a821bf02f5e7f56fe1b9de62
* Id0a357b038fc5730f61bcf3ba730838dcda9b00e

Bug: T153241
Change-Id: I6b0a5e2c4e4ec72016463c8ba6576d33d59be8e5
2017-02-09 16:47:41 +00:00
Bartosz Dziewoński e8d99c5536 ve.ui.MWSaveDialog: Prettify the 'messages' shown
This is currently used to display a warning about missing edit summary
and to display a CAPTCHA field. They now appear in a separated area at
the bottom of the dialog, which slides into view when a message is
added.

Change-Id: I7541284a92d5fd2fa8f469d479e059098c59c0ac
2017-01-31 17:37:00 +00:00
Bartosz Dziewoński a0cb3029cb ve.ui.MWSaveDialog: Remove unused $saveActions div
Change-Id: I47da48b29d3bddd598946de655cf1e8b086daf45
2017-01-31 13:43:47 +01:00
David Lynch b976f2cf38 MWSaveDialog: only focus summary if we're on the save panel
Firefox throws exceptions when trying to focus hidden inputs. Using the
"preview" keyboard shortcut entirely bypasses the save panel, but the ready
process assumes it'll always be opened first.

Bug: T153958
Change-Id: Ifb3861116565e77c30b3874fe47889298c3ace6d
2017-01-27 00:51:33 -06:00
Thalia 43c2865f90 Update actions on live inspectors and preview dialogs
Make inspectors inheriting from MWLiveExtensionInspector
and dialogs inheriting from MWExtensionPreviewDialog
update their 'done' action every time updatePreview is
called. Since both mix in ExtensionWindow, two new methods,
updateActions and isModified are added there.

This should make it more difficult to insert an empty node
accidentally or create a transaction just by opening and
closing an inspector or dialog.

For more complicated dialogs, or inspectors or dialogs
that don't live-update, this behaviour will have to be
implemented separately.

Bug: T155330
Change-Id: Iacafa01fcd419faaec9b112c96be86693a57d561
2017-01-21 18:29:18 +00:00
Ed Sanders 96a3d38cf9 Re-order all meta code to put categories first
For consistency.

Change-Id: Ia5e9728ca4f727f4ce30d5f0c88ac9df8c4d21d0
2017-01-17 00:19:38 +00:00
Ed Sanders 1aeec314d5 Fix correct default page for meta dialog in NWE
Bug: T154639
Change-Id: I49d0f2295b071ae667e111562e30d04b0174c251
2017-01-17 00:17:51 +00:00
James D. Forrester 6795430831 MWMetaDialog: Move categories to the top as they're used most
Bug: T74399
Change-Id: I696d8484ed00c92340f178d5c9dcfe978998dce0
2017-01-04 11:18:00 -08:00
Ed Sanders 808de2acea Add "templates used" page to meta dialog
Bug: T149009
Depends-On: Id617f9afbddf094140133f9659efc4b4e746148c
Change-Id: I63e663d05aefb47274f1f28bdcafc5317c2fc4f6
2017-01-04 18:30:11 +01:00
jenkins-bot d816492ca1 Merge "rm stray fileRepoPromise property from media dialog" 2017-01-03 20:24:34 +00:00
jenkins-bot 6599aaf3f4 Merge "Give focus to preview panel for keyboard scrolling" 2017-01-03 17:58:32 +00:00
James D. Forrester 122f49b2dd build: Bump file copyright notices for 2017
Change-Id: I3c20809e71cc0da58123e1b5f29c4f3aac945496
2017-01-03 08:58:33 -08:00
Ed Sanders c853475a1a Give focus to preview panel for keyboard scrolling
Bug: T154334
Change-Id: Ibc093e3111411b6183bf24528a2e0419ba8d40b6
2016-12-31 22:04:19 +00:00
Alex Monk d7cf29f1c0 rm stray fileRepoPromise property from media dialog
seems to have gone upstream to core's mw.widgets.APIResultsQueue

Change-Id: I3c2a6dbdca60ceadc9e7175e5f8ad83b7fc4b7a0
2016-12-24 18:59:48 +01:00
Bartosz Dziewoński 72569159b8 Add comments in some places where we really want to treat messages as HTML
Change-Id: I439338dabd4b031ed1c4cfc9d89af5a6f2971676
2016-12-20 10:50:15 +00:00
jenkins-bot 57d49550a0 Merge "Add shortcut for show preview and resolve access key conflicts" 2016-12-16 18:14:17 +00:00