Commit graph

834 commits

Author SHA1 Message Date
Ed Sanders 0169701257 getSelectedItem() -> findSelectedItem()
Change-Id: Idf90335d06800b690063c7b2a781e822f0ee7ba9
2018-01-17 13:39:13 +00:00
Ed Sanders e70fe7c1a1 Make visual diffs the default in visual mode
Bug: T178248
Change-Id: I9fe22862d4415df034a0054f934c9ebd1d731a5d
2018-01-17 13:31:07 +00:00
Ed Sanders 7661081ab9 Remember preferred diff viewer
Separate the preference by surface mode, so you can
use a different preference for NWE.

Bug: T178691
Change-Id: Ib8494a4562ce766a7c8ef7ec1447d06f5d0f17c5
2018-01-17 13:31:07 +00:00
jenkins-bot 2ea64bdd27 Merge "Change save dialog accesskey to be entirely off the trigger" 2018-01-10 21:30:51 +00:00
jenkins-bot 9768750cd3 Merge "Use findItemFromData instead getItemFromData" 2018-01-10 19:54:30 +00:00
David Lynch a89c79dc79 Change save dialog accesskey to be entirely off the trigger
Accesskeys in this situation are unreliable cross-browser. Firefox won't
trigger the accesskey inside the dialog. We can manually simulate it, via the
existing trigger.

Bug: T121183
Change-Id: Ib919d8b9fcd9324a517037bcc6ef93a26d1488b9
2018-01-08 11:52:06 -06:00
James D. Forrester 0a7a845a42 doc: Bump copyright year
Change-Id: I0b299c840ede1a1b8552cecfc70c5760ab036181
2018-01-03 17:45:07 +00:00
Prateek Saxena ecd663c4a0 Use findItemFromData instead getItemFromData
Depends-on: Ia2110f71d1642f61451cb8acc7e8a930d0feb31f
Bug: T76630
Change-Id: I379da96a42c440c7d2d5dc2f3de2773c03546c04
2017-12-28 11:53:29 +05:30
Ed Sanders 8a356b19d7 Enable spellchecking on media caption inputs
Bug: T182393
Change-Id: I23d3f1b37225f9e5a9a9651b6e7b590d38dc99b3
2017-12-12 16:42:55 +00:00
David Lynch 7777f69e7b Use rel="noopener" on links targeted at new windows
Bug: T180932
Change-Id: I93bda6aaebf97727a187774cccbeba4f27fcddd5
2017-11-30 13:15:38 -06:00
David Lynch efbfcd8b35 ui.MWSaveDialog: consistent handling of preview category links
Category links weren't being checked for redlink status, and weren't opening
in a new window.

Bug: T179913
Change-Id: Ic665583128bf51710178c5674cd35c273f5f207e
2017-11-29 11:24:32 -06:00
Ed Sanders 57bf86b69e Add mw-parser-output to preview elements
Bug: T180214
Change-Id: I74700061c89ab4004229e3b03353067e92031774
2017-11-10 15:34:51 +00:00
Ed Sanders 581847acb3 Show visual diffs in wikitext mode
Bug: T170371
Change-Id: I8fd9ed4f804444ec486c4df72125cdeb04da0d5f
2017-10-11 20:31:39 +01:00
James D. Forrester 2c70792c4f Replace constructive with progressive UI flag
Change-Id: Iae36e978978ed6642f44606a934c540cf5f8537f
2017-09-26 15:14:32 -04:00
jenkins-bot 1809344c8a Merge "URL decode file names in gallery, as in PHP parser" 2017-09-13 18:00:56 +00:00
Ed Sanders a6ac6d0cec Fix typos in gallery attribute names
The MW attributes are 'style' and 'class'. The plural
forms are used internally only to avoid JS keywords.

Change-Id: I1b7d14872aab4b6b3882d00165924fd1639e1744
2017-09-13 14:06:44 +01:00
Ed Sanders 280696ad3f URL decode file names in gallery, as in PHP parser
Bug: T175816
Change-Id: I3ec9c1f6db57798cdc1b5a787dd0bd9b4d3beef1
2017-09-13 14:03:20 +01:00
jenkins-bot 822db7eacf Merge "Add feedback link for visual diff inside save dialog" 2017-09-11 12:01:39 +00:00
Thalia a3902ebff8 Add feedback link for visual diff inside save dialog
Bug: T170665
Change-Id: I0b09b1089c834a013ad5fee4ecdf75b483b56323
2017-09-05 13:35:37 +01:00
Prateek Saxena 2b923c0346 MWTemplateDialog: BookletLayout: Use findClosestPage instead of getClosestPage
Bug: T76630
Depends-on: I068dad8c79c4bda6ea37ab6a1eb6ba72ab6f7dc0
Change-Id: Ib4e380aa6cd0cacbadd42bdf447ddee6443f22ef
2017-09-05 12:13:41 +10:00
jenkins-bot b73deb1690 Merge "Create wrapper paragraph when converting block image to inline" 2017-08-24 22:16:16 +00:00
Ed Sanders eb2ee52de0 Create wrapper paragraph when converting block image to inline
This prevents the image jumping into another paragraph,
e.g. in a different table cell.

Move the logic for removing the old image out of MWMediaDialog
and into MWImageModel#insertImageNode.

Bug: T121449
Change-Id: Ibd7c92f3f90c382ceffd3e0defb12ba36a3786d2
2017-08-24 15:56:22 +01:00
Ed Sanders b11b144ad6 Don't focus media dialog until ready process
Bug: T174027
Change-Id: I070b5538e12c8a165a714ac6c3fd172f0ed179d4
2017-08-24 15:38:11 +01:00
Ed Sanders 835a775a49 build: Upgrade grunt-eslint from 19.0.0 to 20.0.0
Mostly indent and regex fixes.

Change-Id: Iaf9d02363c78cb71deec5c4cab53a05b67f60600
2017-07-18 12:55:33 +01:00
jenkins-bot 1333373c3e Merge "Drop local 'template' icon, use 'puzzle' from upstream" 2017-07-17 15:09:28 +00:00
Bartosz Dziewoński 0e00b2c109 Fix wikitext preview in IE and Edge
In Internet Explorer and Edge, NodeList objects do not have the
'forEach' method. However, Array's 'forEach' can be applied to them,
as we do elsewhere in the code.

https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach

Bug: T170466
Change-Id: Icb19995e140607d45c47fb6ae8d60ac80b664d02
2017-07-14 15:30:27 +02:00
James D. Forrester 528942c2e1 Drop local 'template' icon, use 'puzzle' from upstream
Now that our template icon has been upstreamed thereto.

Bug: T111041
Change-Id: If101018de284dcc1be086d92427de0d88adb0e02
2017-07-06 09:52:56 -07:00
Bartosz Dziewoński 4c3c8b3d1e ve.ui.MWWikitextSwitchConfirmDialog: Remove broken "evil hack"
The promise #getTeardownProcess is trying to resolve/reject no longer
exists, causing exceptions. The code has been unnecessary for a while,
as we do all the work in #getActionProcess. (In the case that we do
switch, the teardown code isn't even called, since we navigate away.)

Cancelling the switch to wikitext works correctly after removing this
code.

Bug: T169588
Change-Id: I1b9b12edf12a0b91f06c13aa53024efb80868387
2017-07-04 21:49:15 +02:00
jenkins-bot 16f5bc609e Merge "TextInputWidgets: update for deprecated multiline behavior" 2017-07-03 21:21:20 +00:00
David Lynch cfe1d6c0c9 TextInputWidgets: update for deprecated multiline behavior
Remove config option `multiline` and change to MultilineTextInputWidget as
appropriate.

Bug: T169272
Change-Id: I45565f01de76a88d64d7b0691d1e7279354f375d
2017-07-03 22:09:58 +01:00
Ed Sanders dd54c9c95d Return truthy object when image info not found
A missing image should return some data to say the
image is missing, not just reject the promise.

Bug: T169337
Change-Id: Ib41a64a783c1baca88f428417c98e7fb913d14a1
2017-07-03 18:01:33 +00:00
Ed Sanders 915e818356 Clear all gallery state on teardown
Change-Id: I90662d02bd2d9768bdcf27e532ed8b8792f764c3
2017-07-03 17:48:06 +00:00
Ed Sanders 15af26876a GalleryDialog: Re-order and make margins even
Move image inside filename fieldset, and make
margins between fieldsets and button 1em.

Change-Id: I7f6789043f873f9da4e960c94e22a7ee096a352f
2017-06-23 12:16:35 -07:00
David Lynch 9ded195f7e MWTransclusionDialog: fix conditions for "show options" button disabling
As I understand it, the button should be enabled whenever there's more than
one option in the sidebar, and disabled otherwise. The previously chosen
conditions weren't perfectly proxying this, and the button would be disabled
whenever editing an already-existing transclusion.

Bug: T167710
Change-Id: Id303b680c072642ae7b66066e28ecc9f1dc90fd7
2017-06-22 17:58:52 +01:00
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
Ed Sanders 4d134cfefc Add shortcut for show preview and resolve access key conflicts
Refactor save dialog setup so logic for canPreview/canReview
is external and passed in.

'Show preview' will show in the VE command help dialog until
I56c1036e6 is merged in core.

Bug: T149914
Change-Id: Id718ad622be43c03df61d12b8688d53462c59f36
2016-12-16 13:33:57 +00:00
Ed Sanders 9728d78126 Resolve URLs in show preview against correct base
Bug: T153277
Change-Id: Icaa6de4618de008fb2024d1dd428114688cb1043
2016-12-15 03:19:16 +00:00
Ed Sanders 22f4614eee Show save button on show preview page
Bug: T151261
Change-Id: If80bb8e4e9e412572ab88d13d07a3f92dd353b31
2016-12-13 18:10:09 +00:00
jenkins-bot c4dacd9d24 Merge "Don't focus save dialog during setup to avoid scroll jumping" 2016-12-13 15:31:23 +00:00
Ed Sanders 4064c91b8e Don't focus save dialog during setup to avoid scroll jumping
Bug: T153010
Change-Id: Ia535cd5d4ebfc01994f4e440bb5cb7efa5c40802
2016-12-13 12:57:34 +00:00
Ed Sanders 5a8106773c Support section=new in NWE
Bug: T150709
Change-Id: I1002b97060d642df0988da15860a36c13712bade
2016-12-13 12:20:55 +00:00
Alex Monk c843824c97 Batch gallery imageinfo requests via ImageInfoCache subclass
Also get rid of .join( '|' ) for API request parameters per Bartosz

Bug: T147067
Change-Id: If4444cca300d65e28d6fb9003fcac5e076a5129a
2016-12-06 22:10:19 +00:00
jenkins-bot 446a4e40c4 Merge "SaveDialog inherits from plain dialog, not FragmentDialog" 2016-12-06 19:37:41 +00:00
jenkins-bot bdd1a1b78c Merge "Scroll highlighted item into view in gallery dialog" 2016-12-06 18:30:22 +00:00
jenkins-bot 9b4bc7a3f2 Merge "Disable heights option in gallery dialog when mode is slideshow" 2016-12-06 18:28:51 +00:00
jenkins-bot a2e4d9fa82 Merge "Decrease height of gallery search results for better fit" 2016-12-06 18:23:38 +00:00
Ed Sanders 4f7bba4de9 SaveDialog inherits from plain dialog, not FragmentDialog
Change-Id: I934ab41567ea68e58cfa27451faf499febd68bd1
2016-12-04 11:09:56 +00:00
Thalia 2fd30fb7c5 Decrease height of gallery search results for better fit
Bug: T151509
Change-Id: I92c812952457df99251fc0b8f1a17d4e55fe52f7
2016-12-03 16:31:23 +00:00
Thalia 1b4d70324b Disable heights option in gallery dialog when mode is slideshow
Also disable relevant fields the first time the dialog is
opened, not just when the dropdown is changed.

Bug: T151482
Bug: T151512
Change-Id: Ic511e1832a9fcaaeaed71c1d495aecc65fdd1d3b
2016-12-03 16:00:32 +00:00
Thalia 0b9228a926 Scroll highlighted item into view in gallery dialog
Bug: T152053
Change-Id: I6b77f6c27d5629dc18e421f984cf31badfb2ff04
2016-12-03 15:46:58 +00:00
jenkins-bot e1e55aa730 Merge "Correct class/classes typo in gallery dialog" 2016-12-03 15:20:53 +00:00
Thalia 295dd380de Correct class/classes typo in gallery dialog
Bug: T152226
Change-Id: I569df87cf82359c13ad61a3ddffacd83f5f03bae
2016-12-03 13:03:02 +00:00
jenkins-bot 36d976c4c0 Merge "Save Dialog: add shortcut for opening to the review panel" 2016-12-02 00:36:40 +00:00
David Lynch 2bd34cebd4 Save Dialog: add shortcut for opening to the review panel
Create a new MWSaveDialogAction, which can be hooked up to triggers. Switch
the existing save dialog accesskey to just use the trigger system.
(Maintaining all the accesskey logic, so we don't change the shortcut on
people.)

Bug: T149914
Change-Id: I9b4ef8504148703556f802b266a517dd5098c06b
2016-12-01 18:16:18 -06:00
James D. Forrester a835f4f9d5 Use canonical ve.dm.TransactionBuilder.static.newFrom* methods
Change-Id: I082048a677baa2699d94e21548373952d52db61b
2016-12-01 10:43:10 -08:00
Ed Sanders 218742d806 Update VE core submodule to master (ae30d71)
New changes:
f58ddea DiffElement: Use document slices with full internal lists
83800c0 DebugBar: Remove hard-coded i18n
b4f89e1 Update OOjs UI to v0.18.1
40c7bf6 Factor out active node functionality from SectionNode for captions
2d967be Move 'mode' property to surface, rename target property to 'defaultMode'
5d8c214 wrapAllNodes in sourcefragment
dd3d9e5 Refactor ve.dm.Transaction
9d61aca Use canonical ve.dm.TransactionBuilder.static.newFrom* methods
df4f72a Make table caption node an active node
b79f72d Core source mode
7533ac4 Localisation updates from https://translatewiki.net.
ae30d71 SourceSurfaceFragment: Check range is not collapsed

Local changes:
Get edit mode from surface where possible

Depends-On: Iec758c1892d518ad4bc2c0d1aaf6ca00fa354323
Change-Id: Ifaf6a26078b2731b374aaad2cb40c08928de9c84
2016-12-01 10:40:01 -08:00
Thalia 4b9d1bed4f Fix "Add new image" button in the gallery dialog
Make sure the button is always visible in the
gallery dialog menu by fixing it to the bottom.

Bug: T151506
Change-Id: I560b0dffbaad9e18c6f7f703cb155356470580ee
2016-11-30 22:38:11 +00:00
jenkins-bot 745e919f97 Merge "Update VE core submodule to master (9625e8f)" 2016-11-29 20:46:54 +00:00
jenkins-bot 33db54ef28 Merge "Use upstream media search widget from core" 2016-11-29 20:04:46 +00:00
Ed Sanders aeafa6afca Update VE core submodule to master (9625e8f)
New changes:
f1297b8 [BREAKING CHANGE] Allow target widgets to be re-used

Local changes:
Re-use target widgets

Change-Id: I5decb918f398704d4b6c108a16fbc1cc073ef077
2016-11-29 11:48:15 -08:00
jenkins-bot 28a4b9f362 Merge "Handle missing pipes in Gallery syntax, and remove them when caption is empty" 2016-11-29 19:27:52 +00:00
Ed Sanders 44fee9b61d Wait until search panel is shown before setting a search query
Bug: T151659
Change-Id: I3eb3b903a8df1c7732da2a08e4b46b13b162617e
2016-11-29 11:13:54 -08:00
Ed Sanders 2ee9e62a4d Use upstream media search widget from core
Bug: T140166
Depends-On: If53ef7f4b62c7a5d4da565c14dd2a353778694e5
Change-Id: I28845e9c143e78d3a377f067606c62da212e3bf1
2016-11-29 17:19:14 +00:00
Ed Sanders 240ec23113 Handle missing pipes in Gallery syntax, and remove them when caption is empty
Bug: T146190
Change-Id: I703bcdf68b9631a47d839baf3abb42ff98b36bf2
2016-11-28 17:36:29 +00:00
jenkins-bot 6bcfed97a5 Merge "Separate out ArticleTarget as a module" 2016-11-26 23:22:32 +00:00
Ed Sanders 4fe6be1f34 Separate out ArticleTarget as a module
Also move save button command help registration to ArticleTarget.

Bug: T151096
Change-Id: I941d17254a2e20a82aa46fd538abf887d757c0c3
2016-11-24 12:35:41 +00:00
jenkins-bot 1909c445bb Merge "Allow the gallery dialog to insert duplicate images initially" 2016-11-24 04:13:03 +00:00
Ed Sanders 0334263718 Missing i18n in gallery dialog
Change-Id: I369d5b9d42a5fd6b4d1afc12508632a282591320
2016-11-24 00:09:49 +00:00
Thalia 003ec7b653 Allow the gallery dialog to insert duplicate images initially
Change I94f4fadd84cd3e prevents the gallery dialog from inserting
duplicate images into the gallery dialog after one request (e.g.
so double-clicking on an image in the search widget doesn't cause
the image to be inserted twice). However, galleries can
intentionally contain duplicates of the same image, so it is
possible to make a spearate request to insert a duplicate image.

When the dialog is first opened, it requests all the images in
the gallery at once, so the above change was causing the
duplicates in an existing gallery to be dropped. Duplicates
should be allowed to be inserted following this initial request.

Bug: T150894
Change-Id: I34353bc9b8db947488474c4be52292e0a1447705
2016-11-23 01:02:35 +00:00
Thalia 2364f530a3 Let gallery dialog handle unprefixed filenames
The namespace prefix before image filenames is optional
in galleries, but the API requires it. If the prefix is
omitted, add the file namespace prefix.

Change-Id: I3d126550c2ad2e84454122f92307ba4bc943780b
2016-11-23 00:20:32 +00:00
James D. Forrester f24e34de3c build: Bump eslint-config-wikimedia to v0.3.0 and make pass
Change-Id: I7449c11aa63c50fda667265c32021439cc53471f
2016-11-15 15:05:05 -08:00
jenkins-bot 65604802ac Merge "Fix attribute.style typo in gallery dialog" 2016-11-15 22:09:57 +00:00
Thalia 97af378bb5 Fix attribute.style typo in gallery dialog
Change-Id: I71162652df5e09c4d974e0f863ea661c4bd7902e
2016-11-14 22:26:39 +00:00
Thalia 810202395e Normalise filename after image is chosen in gallery dialog
Bug: T150638
Change-Id: Iead7d0d3f8aa6c864dc6fba7089bab0767035812
2016-11-14 22:04:25 +00:00
Ed Sanders 37ccaca2ec eslint: Re-enable wrap-iife and partially enable dot-notation
Change-Id: I4420d66f528dcb18ebe2b9f63996661b2969f833
2016-11-12 14:43:43 +00:00
jenkins-bot bce6aeb92a Merge "build: Replace jscs and jshint with eslint" 2016-10-28 18:43:15 +00:00
James D. Forrester 36befda61c build: Replace jscs and jshint with eslint
It's new, it's fresh, it's amazing, it's here.

Change-Id: I5dc784411f704685ed5cc763a2b2b1c5d3e5a610
2016-10-28 18:33:15 +00:00
jenkins-bot 7085796ec3 Merge "Don't allow an image to be inserted into a gallery twice simultaneously" 2016-10-28 02:29:19 +00:00
Ed Sanders 7bc59cd65c Set mode of save dialog after setting size so footer is correct height
Bug: T149274
Change-Id: Ic88b1c861029495e6098686d847deb181f62288e
2016-10-26 20:09:21 -07:00
Alex Monk 8414490dbf Don't allow an image to be inserted into a gallery twice simultaneously
One after the other is okay though.
Also fix this so that, if the user is fast enough, two images simultaneously
also works.

Bug: T148558
Change-Id: I94f4fadd84cd3ed97d9676043cadc64f0e09f0b9
2016-10-20 02:22:34 +01:00
Thalia 91ca88f6e8 Set gallery dialog to larger size when search panel is focused
Bug: T145246
Change-Id: I49b218f704d31b4f699fe39f414a84abbfffc093
2016-10-12 17:42:54 -07:00
jenkins-bot 9da0eaef03 Merge "Pre-load the article title in gallery dialog search" 2016-10-04 16:24:00 +00:00
Thalia 1d8d4accff Pre-load the article title in gallery dialog search
Bug: T145243
Change-Id: I4cd04dee4c875524ecdf90027dc878eb15f47ce6
2016-09-27 14:01:31 -07:00
Matthias Mullie 2b4948b0b6 Change mid-upload 'cancel' button to 'back'
Bug: T114938
Change-Id: I964708e1267223b181630b9bea5b19e2bdf242be
2016-09-22 16:13:57 +02:00
Ed Sanders 5e22ef30fe Add show preview to save dialog when in NWE
Bug: T142642
Change-Id: I679eaddfe9037dcf258d3ff7d1eaa44214f0e730
2016-09-07 21:35:49 +00: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
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
Thalia d156af59aa Fetch default options for gallery dialog
Fetch default options for mode, image heights and image widths
rather than hard-coding them.

Bug: T139632
Change-Id: I1adc7987fdeb1258ee87ce46acbab469ea18116e
2016-08-05 14:08:20 -07:00
Ed Sanders 6064eb3dc4 Fix preview to use a valid document slice
An inline content node must exist inside a content branch node (paragraph).

Bug: T141306
Change-Id: I6bf2f99938940c1a5e34db16fbe582b15991a7c6
2016-07-26 16:06:07 +01:00
jenkins-bot 522b3498ce Merge "MWGalleryDialog: Add new 'slideshow' mode" 2016-07-21 00:54:08 +00:00
Thalia 84919b253b MWGalleryDialog: Don't set blank values for width, height
If width or height attributes are left empty in the form,
they are now undefined in mwData.

Bug: T140094
Change-Id: I76dadbd07a89ce762e42ce714f364ce74a9cc1f0
2016-07-12 22:14:59 +01:00
James D. Forrester 96ba688a87 MWGalleryDialog: Add new 'slideshow' mode
Change-Id: I73052def5e8c082f27606b2ff094834fd5d11908
2016-07-12 08:08:15 -07:00
Thalia 3e911ba266 Make gallery dialog caption field multiline
Also change remove button label from "Remove" to "Remove image".

Bug: T139421
Bug: T137982
Change-Id: I1b11eb44c672bad0d53d139d66e796a0657457f5
2016-07-06 17:24:12 +01:00
jenkins-bot 750078ab63 Merge "MWTemplateDialog: When opening the dialog, add in any unset suggested and required parameters" 2016-06-29 22:42:25 +00:00
James D. Forrester 832118e051 MWTemplateDialog: When opening the dialog, add in any unset suggested and required parameters
Bug: T97482
Change-Id: Iaf280355f442240aba4e1f74d3ee402fc5d329b0
2016-06-08 14:19:09 +00:00
Thalia 6fdbe9fd7e Make dialog for editing galleries
Make new graphical interface for editing existing
galleries and adding new galleries.

NB The dialog does not yet support rich text in the
image captions, nor does it provide separate fields for
e.g. link, alt text, etc. These are dependent on parsing
the text within the tag, which is yet to be implemented
by Parsoid. For now, these attributes should be
specified in wikitext in the image-specific caption
field.

Bug: T45037
Change-Id: I2b4082e991268241a15b9bbd6d85c94cdc2185f2
2016-06-07 13:53:02 +01:00
Ed Sanders 35c0a0dc69 Use cloneWithData
Change-Id: I7ffe3c7ab20d5f785a6642c8293f271f4dc08ff8
2016-05-30 21:40:07 +01:00
Ed Sanders 236e3d1241 [BREAKING CHANGE] Evalute block/inline state when inserting a transclusion node
Make some of the methods we currently use to render the node
static so we can re-use them before inserting. We do the evaluation
without inserting the node so as not to dirty the document and
transcation history.

In the unlikely case the request fails, just fallback to inline.

This only handles insertions for now as type changes on edit will be
very rare.

This changes the signature of insertTransclusionNode, which is used
in Cite and Citoid extensions.

Bug: T51784
Change-Id: Ibc2fc66e6866084b0a4deeb082c8a1ca412febb2
2016-05-16 09:19:13 +01:00
Alex Monk 349b1f5e57 Add WTE welcome dialog
Bug: T133800
Change-Id: I6eb43274e22f647958c3ab1b6d5c12b3dbea388e
2016-05-10 23:28:21 +00:00
Ed Sanders 3678b0c38a Attach template form after building
Building DOM trees while attached is much slower. This makes
things about twice as fast.

Remove unused StackLayout wrapper this.panels.

Bug: T134814
Change-Id: Idb269cf3f06c350ffe28b66e2e883c0a7a3348cd
2016-05-09 23:24:22 +01:00
Ed Sanders c516d897d2 Remove icon properties from windows
Windows stopped supporting icons a while ago.

Change-Id: I8a63152282a5968dcd17675330e31bd1ebe4b68b
2016-03-29 12:33:42 +01:00