Commit graph

7370 commits

Author SHA1 Message Date
Ed Sanders 22f43207fe Apply active external link fix to all skins
Change-Id: Ic66082fca53f803f9ede6c100beb9072b40a0c00
2019-06-18 15:23:10 +01:00
jenkins-bot 69ff78868f Merge "Remove 'mobile-ab' config for section editing" 2019-06-17 20:37:51 +00:00
Ed Sanders df8feb6faf Move mobile context to bottom of page
Hidden behind ve.newMobileContext feature flag.

Bug: T204733
Depends-On: Id276686a0e82c12c457c81eaec9939722c65c7ec
Depends-On: Id5f7ead769dc30c0fbd2a8b8f6f6c4d68dcfabac
Change-Id: Ibd4b699dfe4bb9bcaec6898b6b82357eb287d128
2019-06-14 20:57:22 +00:00
jenkins-bot 8cce3fa72a Merge "Avoid setting '&section' (with no equals or value) when switching to OWE" 2019-06-14 18:41:19 +00:00
Bartosz Dziewoński a68cc38b22 Avoid setting '&section' (with no equals or value) when switching to OWE
mw.Uri requires undefined rather than null to unset a parameter;
null instead generates a parameter with no value (and no equals sign).
Our own code in ve.init.mw.DesktopArticleTarget.init.js parseSection()
can't parse that and causes an exception.

Change-Id: I783ea6b91c115b79bbd9deac6669bea0661139af
2019-06-14 20:20:26 +02:00
jenkins-bot 355a54b792 Merge "trackSubscriber: Migrate away from deprecated 'schema.' modules" 2019-06-14 00:27:11 +00:00
jenkins-bot ed6d540289 Merge "MobileArticleTarget: Update loading interface for new design" 2019-06-13 20:00:34 +00:00
Timo Tijhof fda2729ebc trackSubscriber: Migrate away from deprecated 'schema.' modules
The EventLogging extension no longer uses these internal modules.
They were phased out as part of last year's "lightweight EventLogging"
project (detailed at T187207). Migration notes at T205744.

VisualEditor has migrated already, mostly. It still depended
on the existence of these module names for some condition guards.

* The subscriber for 'mwTimingHandler' was guarded by 'schema.EditAttemptStep',
  but did not emit events of that schema. What 'mwTimingHandler' really
  needs is the '*SamplingRate' variable for its call to 'inSample()'.
  This previously worked because the variable and the schema are both
  provided by the WikimediaEvents extension.

* The subscriber for 'activityHandler' had a separate schema guard. This
  might suggest an intent for the code to silently degrade if WikimediaEvents
  were to be changed to no longer supply the second schema, or for the code
  to work for third-parties without WikimediaEvents if they register only
  the schema. However, this subscriber too calls 'inSample()' and needs those
  variables.

I've assumed for now that it is okay for these to all be guarded together.
Even if the schemas were to be removed and we were to forget updating this
code, the new EventLogging client degrades gracefully from this (no errors).

Bug: T221281
Change-Id: I260c25752c3becfe6e499813197fbf7a3dba88c3
2019-06-13 18:28:49 +00:00
Ed Sanders 87a3402203 Remove 'mobile-ab' config for section editing
Test is over.

Reverts I2c22d7636ae11d2db7780ae5adb3abe9df532b7c

Change-Id: I883dc8d6de6f2f39afc6b42c60503c3155f9fd8f
Depends-On: If3d24b44e37ca53826c60ada02cdf5636aa8606a
Bug: T225645
2019-06-12 17:45:20 +01:00
jenkins-bot 9114e5403b Merge "Reorder calls so that window is scrollable when trying to scroll to section" 2019-06-11 22:18:13 +00:00
Bartosz Dziewoński baa8bcb476 Reorder calls so that window is scrollable when trying to scroll to section
Bug: T225292
Change-Id: I07d899098cff13cf4f8224c45f118290bc392c53
2019-06-11 22:02:39 +00:00
Ed Sanders 2b7bbf0737 Cleanup mwcore messages and dependencies
* Move many messages from mwcore to articletarget or mwsave
* Delete old unused messages
  - visualeditor-beta-label
  - visualeditor-toolbar-savedialog
  - visualeditor-toolbar-savedialog-short
* Remove unused core messages (showtoc/hidetoc)
* Fix typos in comments

Change-Id: I59455f4cad272db9fd05f45f8a66069e5da0421d
2019-06-11 20:42:01 +00:00
Ed Sanders 7ad624f0a3 Remove switch confirm dialogs
Bug: T220007
Change-Id: I81b39a02d573d96bcb6b4238aabbcd077e874906
2019-06-11 22:35:34 +02:00
Bartosz Dziewoński eb8aede95f MobileArticleTarget: Update loading interface for new design
* Remove animation for toolbar sliding into place. It now happens on
  the fake toolbar in MobileFrontend shown before the real toolbar
  loads, and our toolbar just transparently replaces it.

Bug: T217784
Depends-On: If21aa0ea619ec2500ce5fca6fe81eb27f26bb047
Change-Id: Ib6ff7594e1982d1b46e9ca89d6b9722d025e8207
2019-06-05 12:43:33 -04:00
Bartosz Dziewoński f48b5bcc9a MobileArticleTarget: Fix silly indirection via a global variable
Change-Id: I71349313b493c18cebe30df0b1b03defe81bb80e
2019-06-05 16:40:18 +00:00
Bartosz Dziewoński 9cbc22c70d MobileArticleTarget: Remove a method that just calls the parent
Follow-up to 500462f4b2.

Change-Id: I1916a58b8814d1f03a14a35881f531d9de319736
2019-06-04 15:52:13 -04:00
Bartosz Dziewoński 4184d44dc5 MobileArticleTarget: Remove duplicate way to trigger abandon warnings
Abandon warnings are already handled by the code in MobileFrontend's
EditorOverlayBase. Using window.history.back() causes that code to run.
Having a duplicate way to trigger them only results in inconsistencies
because our dialogs animate in a different way.

Bug: T222315
Change-Id: I19c5616a6aeecf0ac63f37a564ef44f11df010b0
2019-06-04 15:50:59 -04:00
Bartosz Dziewoński 8ae4925676 Allow switching from WTE to VE with changes in non-RESTBase mode
* Change the query in ve.init.mw.ArticleTargetLoader#requestParsoidData
  so that in non-RESTBase mode with wikitext it still returns the
  metadata required to initialize the editor, using the backend API
  code added in I1b35b28e428a1f86d2e34d90ddbe73361ce14818. This fixes
  the exception from T222312.

* Introduce new configuration option $wgVisualEditorAllowLossySwitching
  to control this feature. It is enabled by default, fixing T214542.
  We allow it to be disabled because switching in non-RESTBase mode may
  cause "dirty diffs" (non-semantic changes to the wikitext), which are
  undesirable on wikis where users carefully review all changes.

Bug: T214542
Bug: T222312
Change-Id: I58879cba5612002c70c24731306214d2577c2c52
2019-05-30 20:18:53 +02:00
Ed Sanders b1ac5b74d3 Update VE core submodule to master (06f1ebb8e)
New changes:
06f1ebb8e Local/SessionStorage refactor

Local changes:
* Update for core storage refactor

Depends-On: I3cc1d5adfbce794e8345b7f1090c10fb0d42d150
Change-Id: If855ee33b0993788cc159d8c3acf03070e6a9566
2019-05-29 14:49:53 -07:00
jenkins-bot 4ec7272876 Merge "MWEditSummaryWidget: Use showSuggestionsOnFocus flag" 2019-05-29 15:29:13 +00:00
jenkins-bot 795e7b13fb Merge "Special-case redlink URLs to load preferred editor" 2019-05-28 23:21:28 +00:00
Ed Sanders 4dc8ee52a1 Use nullSelectionOnBlur when section=new
Section=new behaves more like a form than a full
document editor, so allow focus to be fully moved
to the title input without leaving a deactivated
cursor behind.

Change-Id: I7e3835da925b27f5df79dcbdd4550445795cdc51
2019-05-27 12:39:19 +01:00
Ed Sanders 4a692e762d Special-case redlink URLs to load preferred editor
In general action=edit could be bound to a wikitext-specific
edit link, but in the case of redlinks we can use the
preferred editor instead.

Bug: T223793
Change-Id: Ib0851e9e2ce441ae93311153801e2c3de0a2063d
2019-05-26 17:55:38 +01:00
Bartosz Dziewoński fbb56d66fa Store 'canEdit' property when auto-saving or switching editors
Added in b9835f75d3.

Bug: T224319
Change-Id: I05d6aa500ba921d114f33972369ad4dd53b8e140
2019-05-24 23:15:38 +02:00
jenkins-bot 9dac4f7746 Merge "MWInternalLinkAnnotation: handle non-internal links that say they're mw:WikiLink" 2019-05-24 16:54:15 +00:00
Ed Sanders 5b4158860a 'scrollCursorIntoView' -> 'scrollSelectionIntoView'
Change-Id: I202b1bdb3196b318c26422577b66de66d37080c8
Depends-On: Iac446ce9fce170b43c96001ca89e8af4825522ca
2019-05-24 10:11:38 +00:00
Ed Sanders c1130d386c MWEditSummaryWidget: Use showSuggestionsOnFocus flag
Bug: T169484
Depends-On: Ib47c9831ea712bf92b56a88474c3419067124458
Change-Id: I8697e153d4ed0bfbc8d89b65ff63a302c11a27ea
2019-05-24 11:09:26 +01:00
Bartosz Dziewoński d43262feb6 ve.ui.MWEditSummaryWidget: Remove a hack for T220204
Change-Id: I1539eb72b9b313c32743b300a58a734f3eaafef4
2019-05-23 21:30:15 +02:00
jenkins-bot 603223152c Merge "Replace call to setToolbarHeight with setPadding" 2019-05-23 18:25:46 +00:00
Ed Sanders 617e4d8d61 Replace call to setToolbarHeight with setPadding
Bug: T224126
Depends-On: Id5f7ead769dc30c0fbd2a8b8f6f6c4d68dcfabac
Change-Id: I140cdb320dbb0368bc36a0a0210523937b9f7dea
2019-05-23 18:11:03 +00:00
jenkins-bot 9482cc3ec5 Merge "Debounce calls to 'adjustContentPadding'" 2019-05-23 17:57:14 +00:00
Ed Sanders 9bc0383733 Debounce calls to 'adjustContentPadding'
Change-Id: I045ad541c5997a7d9c0f24b4e097057524756def
2019-05-22 15:06:12 +01:00
Ed Sanders 4beab42217 Switch to wikitext: Don't set oldid if unmodified current ID
Bug: T223651
Change-Id: I5a896cd98d304c419e61c5f56adb6175bc1c72a8
2019-05-22 14:32:54 +01:00
Bartosz Dziewoński b9835f75d3 Check if page is really editable and call #setReadOnly accordingly
There are various circumstances where the wgIsProbablyEditable check
gives incorrect results (hence the 'probably'):

* User is blocked (T111217)
* Page is protected from creation (T173763)
* Page is transcluded on a cascade-protected page (T217217)

Bug: T111217
Bug: T173763
Bug: T217217
Change-Id: I7df8909c31f29d2e7521bef8612c27cb61146a4d
2019-05-18 17:23:31 +02:00
jenkins-bot 7dc2fee2f7 Merge "MobileCollabTarget: Cleanup toolbar" 2019-05-17 16:55:29 +00:00
Ed Sanders b6704010fa Automatically add a template when chosen from the autocomplete list
This behaves in the same way as the link inspector.

Change-Id: I8901c636cd5c74023f4c6c562b410f55afe91124
2019-05-17 13:15:07 +02:00
David Lynch c66f8e0547 MWInternalLinkAnnotation: handle non-internal links that say they're mw:WikiLink
The likely case for this is: copying from within VE in one wiki, and pasting
into VE in another wiki. This change will notice this happening, and fall back
to treat it as an external link. (For the wiki-internal links, this will turn
them into interwiki links rather than raw external links.)

Bug: T223322
Change-Id: Ie0157fc3aee6e5fd9973a2889be7ebd287bc90a5
2019-05-14 14:35:39 -05:00
Ed Sanders 47af04b8d9 MobileCollabTarget: Cleanup toolbar
Change-Id: I4b2e21ce61cb647ca6a74bdbdd8def614ed41341
2019-05-14 20:19:54 +01:00
Bartosz Dziewoński aadec90f0f DesktopArticleTarget.init: Fix wrong message used for 'Edit' tab in rare cases
If a new namespace was added to $wgVisualEditorAvailableNamespaces,
but VE was loaded on a page with old cached HTML, the 'Edit' tab's
text would incorrectly be 'Edit source'.

If $wgVisualEditorTabMessages['edit'] or ...['create'] was changed
from non-null to null, but VE was loaded on a page with old cached
HTML, the tab would still use the old text.

Change-Id: I2d5c7b922ba480eb90fa0a6da7a1901f062c96df
2019-05-14 00:19:08 +02:00
Bartosz Dziewoński a76d3daf54 DesktopArticleTarget.init: Allow veaction=edit to override namespace settings
Prior to 80bfbfc54b this worked by
accident, and with a number of bugs depending on your settings (see
T219457). It turns out that Wikipedia users have invented various
workflows that depended on this bug (mostly involving sandbox pages in
namespaces where VE is not enabled). Restore it as a supported
feature, and in a way that avoids the problems it previously caused.

Bug: T221892
Change-Id: I62714b6f2905efd1d1b34c7a13b9917cb6c609fc
2019-05-14 00:18:47 +02:00
jenkins-bot e59da0183f Merge "Section switch from wikitext to VE" 2019-05-13 19:24:58 +00:00
Ed Sanders 3a4822c2fe Section switch from wikitext to VE
Use an API 'parse' call with a sectionid to trigger
a full document expansion using replaceSectionAtRev.

Then send this off the RESTBase to convert to HTML
and statsh.

Ensure the etag is passed back to the API response.

Bug: T117716
Bug: T223023
Change-Id: I1b35b28e428a1f86d2e34d90ddbe73361ce14818
2019-05-13 19:49:10 +01:00
jenkins-bot a0a1f5422e Merge "Fix inheritance of isResizable" 2019-05-13 18:11:44 +00:00
Ed Sanders 4c8346f822 Fix API request for media dialog preview
Regressed with upgrade to apiversion 2.

Change-Id: I257c367b8f639a389002fefcd074e2fffe5a3bd4
2019-05-13 12:51:54 +01:00
Ed Sanders 20f876ca69 Fix inheritance of isResizable
Bug: T223086
Change-Id: Ib57b9a0173903db438120b94ffa391e734aee614
2019-05-13 12:00:05 +01:00
Ed Sanders a424bc3da5 SaveDialog: Move iOS Safari hack to avoid losing focus
Bug: T222859
Change-Id: I07b530573a8f5b900bdb5cbc15314f5758baf36a
2019-05-13 11:50:55 +01:00
jenkins-bot e46debccea Merge "Fix edit summary preview" 2019-05-12 12:03:47 +00:00
jenkins-bot 4197941786 Merge "Fix visual diff in 2017 WTE" 2019-05-12 11:55:31 +00:00
Ed Sanders 95b9bb7e71 Fix visual diff in 2017 WTE
Change-Id: Iaa4c470f8677b83af92138ee44d57fb6a6e903d0
2019-05-11 22:02:19 +01:00
Ed Sanders 83b1e02286 MobileArticleTarget: Fix typo in tool config
Change-Id: Ib465ac175a3ab40584c0199b7801eca03644b2d5
2019-05-11 21:36:42 +01:00