Commit graph

7272 commits

Author SHA1 Message Date
Timo Tijhof ef36f4b0a1 Move usePageImages/usePageDescriptions from page conf to site conf
These do not vary by user or page, and can thus be loaded asynchronously
via the startup module, rather than blocking rendering and fetching
of modules on all pages.

In a future change, it might be better to go a step further and bundle
these with a module so that they only load as-needed instead of still
on all page views, but this should be an improvement nonetheless.

Change-Id: Icae3712ac5546a90bc7ffd787b0f3285dff6a26f
2019-04-17 00:10:27 +01:00
Bartosz Dziewoński 80bfbfc54b ve.init.mw.DesktopArticleTarget: Validate 'veaction' parameter against available modes
If a page can't be edited in the requested mode (e.g. veaction=edit on
talk pages), the parameter will now do nothing (the editor won't
load), instead of trying to load the editor in another available mode.

Bug: T219457
Change-Id: I2cd78ea13ba13ff622f5e4b7db033f82dfa7875e
2019-04-16 20:19:37 +02:00
Bartosz Dziewoński 0e0bc12177 ve.ui.MWMagicLinkNodeInspector: Select annotation after converting
Currently, the selection is not updated, so we end up keeping the
first two characters selected. Same code as ve.ui.MWLinkNodeInspector,
see cb72eea2041bb35e02eb756be3f2c7e8e6c3b43c.

Change-Id: I2204643c41025ad69fa9e232edfc5a896f1b8bdf
2019-04-16 17:10:42 +02:00
Ed Sanders d14d443aff Use new CE Surface selectAnnotation method
Change-Id: Ic26c46d3cdabc7b9949527d04eada5203cf6f7d3
Depends-On: I23f3586e340899801c99b3015e51dd0965a8ef0b
2019-04-16 17:09:01 +02:00
jenkins-bot cf294a0c6d Merge "init: Bundle wgVisualEditorUnsupportedEditParams with DesktopArticleTarget.init" 2019-04-16 14:58:43 +00:00
Timo Tijhof cc599c2e36 init: Bundle wgVisualEditorUnsupportedEditParams with DesktopArticleTarget.init
Bug: T219342
Change-Id: I4b5a048779bd4b957cc5d99c3a7686363ffb3df9
2019-04-16 16:33:53 +02:00
jenkins-bot c0dc4f6e7e Merge "ve.init.mw.ArticleTarget: Add sanity check against loading content in wrong mode" 2019-04-16 12:38:57 +00:00
jenkins-bot b180d6d8f1 Merge "Only depend on ArticleTarget for diff viewer" 2019-04-12 17:56:28 +00:00
jenkins-bot f9f8ce8919 Merge "Fix mobile done/tick button" 2019-04-12 16:12:50 +00:00
Ed Sanders ef310f41a4 Only depend on ArticleTarget for diff viewer
Change-Id: I1680c9d184edac7b55bab205ff5d9c945cabde3a
2019-04-12 15:14:09 +01:00
Ed Sanders 79cee8d820 Fix mobile done/tick button
Change-Id: I53eebfe9b94354521763743ab70e4d1a919286f8
2019-04-10 22:51:08 +01:00
Bartosz Dziewoński b7f7cf3734 ve.ui.MWSaveDialog: Work around review panel disappearing on iOS Safari
No idea what causes it, but I've seen a similar issue when working on
Ic35f084d019afd1782292c831765ceb1444fb14a (in OOUI) and this hack
worked there too.

Bug: T219680
Change-Id: Ifb49ede450cabdcd8303b298b62f2ac632809b53
2019-04-10 22:56:08 +02:00
Bartosz Dziewoński 0498c03191 ve.init.mw.ArticleTarget: Add sanity check against loading content in wrong mode
In case we get confused and try to load the wrong kind of content for
a given mode, it will now fail with an error message rather than e.g.
display a source editor full of HTML.

Bug: T219457
Change-Id: Ic23c2bbda2931da8ca015b4ea3673dbce4e2d994
2019-04-10 21:49:27 +02:00
Esanders 23b5dbead2 Merge "SurfaceView: Use new #isDeactivated method" 2019-04-10 11:27:53 +00:00
Ed Sanders 72df5f690f Update VE core submodule to master (f039957f3)
New changes:
f039957f3 [BREAKING CHANGE] Use keyed objects for importRules blacklists

Local changes: Use extendObject to set importRules

This allows us to inherit the ruleset from the parent
so we don't have to worry about keeping it up to date.
(For example alienTableCell from upstream was missing
in MW).

Media/Gallery dialogs: Add missing mwTable types.

Change-Id: I366a091ff4def66cc25200b3d1b2c23ba6b716f7
Depends-On: I8ff7e8242c8db235a0f9e11e2e52f90d62d368a0
2019-04-09 16:58:26 -07:00
jenkins-bot afdd97c58f Merge "EditSummaryWidget: Disable pending animation" 2019-04-09 20:13:07 +00:00
jenkins-bot c5fb5b4562 Merge "EditSummaryWidget: Don't show suggestions on focus" 2019-04-09 20:11:19 +00:00
Ed Sanders ed0105b5a1 EditSummaryWidget: Disable pending animation
Animation shows breifly on every keystroke, even though
only one server request is made, as the promises always yield
to a browser animation frame.

A pending animation isn't really required for autocomplete
as the results are only optional suggestions.

Change-Id: Ifa257592b10d84dccfa3e0c819c1edf1f7ef9cfa
2019-04-09 19:54:39 +00:00
jenkins-bot 2ab08d7275 Merge "InternalLink: Add special case for fragment with no title" 2019-04-09 18:11:34 +00:00
jenkins-bot 1b2c1425ee Merge "Allow external link pasting to be enabled by config" 2019-04-09 16:05:26 +00:00
Ed Sanders 476d64957e SurfaceView: Use new #isDeactivated method
Change-Id: I5a53f331b6417b72b9f78f3f869579573ea05fef
Depends-On: I043a213fb4a06b02e160315fe3a846a1dd4d7cc1
2019-04-09 15:51:03 +00:00
Ed Sanders dbd692b5ed InternalLink: Add special case for fragment with no title
Bug: T218581
Change-Id: I11e2de90e582d184a3f8cdd65dfc0858571aa397
2019-04-09 14:43:24 +01:00
jenkins-bot 2fc64107f4 Merge "Give mobile document a min height based on 100vh" 2019-04-09 11:59:04 +00:00
jenkins-bot 49969c92d2 Merge "Use nullSelectionOnBlur=false for ArticleTargets" 2019-04-09 11:34:31 +00:00
jenkins-bot 6eb12b285e Merge "ve.init.mw.MobileArticleTarget: Remove code causing scrolling issues" 2019-04-08 18:37:17 +00:00
Ed Sanders d0a3237f1c Give mobile document a min height based on 100vh
Makes the whole page focusable.

Bug: T109508
Change-Id: I93e9269a89281d342551be5de43a2c60c848ef33
2019-04-08 13:32:31 +01:00
Ed Sanders 64b02f97ce Use nullSelectionOnBlur=false for ArticleTargets
Bug: T208826
Depends-On: I2c464ec2bbf799cbe1d9bfed1aad05c5a1bfb094
Change-Id: I5bcd6947c1c6e8f278d0cc9f9c95afb835d1b56b
2019-04-05 13:54:00 +00:00
Ed Sanders e2dfdf0ef7 EditSummaryWidget: Don't show suggestions on focus
Bug: T220176
Change-Id: Iffad075929d8835eb4f8677b33c3edd30a27b3f8
2019-04-05 14:04:29 +01:00
jenkins-bot 96dfb99016 Merge "Edit summary autocomplete" 2019-04-04 17:44:36 +00:00
Bartosz Dziewoński 17a0b407fc ve.init.mw.MobileArticleTarget: Remove code causing scrolling issues
This code is supposed to check if we have scrolled past the end of the
page, and if we did, scroll back up to a more reasonable position.

However, it seems to incorrectly trigger in other cases, and scroll
the page back to the top, because getBoundingClientRect() occasionally
still returns bogus values (even though we try to avoid that). This
happens inconsistently when focussing the surface or closing a dialog.

We can't correctly display the toolbar while scrolled past the end of
the page. Removing this code causes it to go into an endless animation
loop in that case. But that may be preferable…

Bug: T219200
Change-Id: I152f2b39351ffd3c9799eea33cce95e05d2f9ab9
2019-04-04 17:07:39 +00:00
Bartosz Dziewoński 362df66b47 Remove support for page title "hrefPrefix" other than './'
Parsoid does not use relative links anywhere anymore (T72743). There
is no reason for us to support this. And previous code allowed
"hrefPrefix" to be empty '' sometimes, which is scary, as it could
lead to XSS vulnerabilities if titles starting with 'JavaScript:' are
not handled correctly elsewhere.

Bug: T206357
Depends-On: I8728f63084902c76d1c61193be4367939b069f1a
Change-Id: I99be18877aae2b505cf261bd7cdef6cf0d7a8670
2019-04-03 20:10:05 +00:00
jenkins-bot 42eb7e0cf4 Merge "Suppress slugs between floated images" 2019-04-03 15:59:09 +00:00
jenkins-bot 0d4e843132 Merge "trackSubscriber: don't populate all fields, to make validation happy" 2019-04-03 13:18:19 +00:00
Bartosz Dziewoński ac3d5e7925 ve.init.mw.MobileArticleTarget: Fix placeholder being hidden by the toolbar
Follow-up to 500462f4b2.

Bug: T219066
Change-Id: Ie0c35339c440bf85545e51fb5398d0936757432a
2019-04-01 22:48:36 +00:00
David Lynch 415cc0d022 trackSubscriber: don't populate all fields, to make validation happy
The EditAttemptStep schema doesn't have some of the fields we attempt to
submit, because we're generalizing and it only wants specific ones. Be more
selective about what we submit, so validation messages in the console will be
quiet.

Bug: T218163
Change-Id: Iaf9f47b61c138bb0106b2dfc4be2caec02a10d1d
2019-04-01 11:56:15 -05:00
jenkins-bot ab17c1095a Merge "ve.init.mw.MobileArticleTarget: Save/restore scroll position on surface (de)activation" 2019-03-29 23:18:17 +00:00
jenkins-bot 1777203ace Merge "MWInlineImageNode: don't discard alt text when serializing" 2019-03-29 21:36:18 +00:00
Bartosz Dziewoński f46045b69e ve.init.mw.MobileArticleTarget: Save/restore scroll position on surface (de)activation
Bug: T218650
Depends-On: Ib943ca806b6eaaf1d7b650c8ebb24cc30d9fe700
Change-Id: I18047eaa1068b8d06cd708da9e3853abe6d252bb
2019-03-29 21:21:45 +00:00
David Lynch a976f0508f MWInlineImageNode: don't discard alt text when serializing
Bug: T216285
Change-Id: If81a9925cf32204f825e4da713aa07e860a29a46
2019-03-29 10:29:26 -05:00
jenkins-bot 0c4ee8528f Merge "ve.init.mw.MobileArticleTarget: Set 'padding-top' on the correct node when section-editing" 2019-03-28 20:54:59 +00:00
Bartosz Dziewoński ff88be0d35 ve.init.mw.MobileArticleTarget: Set 'padding-top' on the correct node when section-editing
Follow-up to 500462f4b2.

Bug: T219066
Change-Id: I7344fa8f4ad672e4be7a3b98c5b9a1b1c65131dc
2019-03-28 20:42:30 +00:00
jenkins-bot a2a42890dd Merge "Fix cursor on #firstHeading" 2019-03-28 20:18:36 +00:00
Ed Sanders 03240609d5 Fix cursor on #firstHeading
Bug: T214790
Change-Id: I68e3837cf71317a18a885d1dc16ad10523c464a3
2019-03-28 21:02:03 +01:00
Ed Sanders 592c84a529 Emit 'position' event on surface view after changing doc padding
Bug: T219508
Change-Id: I7ffb47e4ba031096879a88355f5fa3048a4ab09f
2019-03-28 14:40:44 +00:00
Bartosz Dziewoński 500462f4b2 ve.init.mw.MobileArticleTarget: Improve iOS Safari by moving 'padding-top' for toolbar
We need to set 'padding-top' matching the height of the toolbar
somewhere, so that the toolbar doesn't cover the top of the editing
surface. Apparently moving it from the current place (the top-level
wrapper for the MF overlay) to the document node (the node with the
'contenteditable' attribute) allows Safari to properly scroll the
cursor into view when focussing, rather than scrolling it offscreen.

Bug: T219066
Change-Id: Iee1e03bce24c2f149a0aa0f393a37b9db43eaca6
2019-03-27 22:06:14 +01:00
jenkins-bot 277e387295 Merge "MobileArticleTarget: When saving a section don't trust current page markup" 2019-03-27 17:16:17 +00:00
David Lynch 5496d18953 MobileArticleTarget: When saving a section don't trust current page markup
The edit might have changed the section title, which will change the
section-hash, which will make the redirect break. The only way to avoid this
is to use the HTML provided to saveComplete to check for the new hash.

Bug: T213120
Change-Id: I5adfdb44a8304ed4f30def74400e4512e9e8c0ae
2019-03-27 16:58:58 +00:00
Bartosz Dziewoński 21e9db7d13 Respect user preference for default thumbnail size while editing
Bug: T69047
Change-Id: Ibf90d290df5634cd89651a427a6aa1c6f9d7a553
2019-03-26 22:15:26 +01:00
jenkins-bot 455c95df32 Merge "ve.init.mw.MobileArticleTarget: Bring the toolbar back into view after it scrolls out" 2019-03-23 12:10:29 +00:00
jenkins-bot c02b357b39 Merge "ve.init.mw.MobileArticleTarget: Remove unused method" 2019-03-23 04:37:46 +00:00