Commit graph

2206 commits

Author SHA1 Message Date
Bartosz Dziewoński 035f34dac9 DesktopArticleTarget.init: Improve handling of 'preloadparams'
Depends on MediaWiki change I48d4bb3f, which adds the 'arrayParams'
option to handle explicitly indexed array parameters like
`&preloadparams[0]=a&preloadparams[1]=b`. Previously we only handled
implicit indexes like `&preloadparams[]=a&preloadparams[]=b`.

Bug: T231382
Depends-On: I48d4bb3fdf0ea7f5eb133c59bf63651ba356fc42
Change-Id: I8c899bce1b19fa286bd385f89e102a4b87db4db3
2019-08-27 22:32:13 +02:00
Ed Sanders 042bfdfd9d Update VE core submodule to master (07687721b)
New changes:
77076f828 LinkAnnotationInspector: add a "label" field on mobile

Local changes:
* Updates for mobile link label editing

Bug: T229431
Change-Id: Ib0489f6f59b228ebc4a20f7a0a515be938a8f6d3
2019-08-23 00:25:51 +02:00
Bartosz Dziewoński 84d548e7b1 Remove redundant @method annotations
A @method annotation is only necessary when the docblock is not
directly followed by a function declaration (in which case JSDuck
assumes it documents a property), e.g. when defining an abstract
function or referencing a function from another library.

I verified that JSDuck generates exactly the same output before and
after this change (docs/data-<hash>.js files are identical).

Change-Id: I7edf51a8560ab9978b42800ab1026f0b5555c3bf
2019-08-21 23:33:15 +02:00
Bartosz Dziewoński e14e24f037 MobileArticleTarget: Tweak styling for editor switcher
The .oo-ui-popupToolGroup-handle styles only need to apply to the
editTools toolbar, where they override OOUI styles so that our
"stretched" toolbar works; they don't need to apply to the pageTools
toolbar, which contains just the editor switcher, and where they make
it look different from the MF wikitext editor toolbar for no reason.

Change-Id: I21315b34be0a7c3938f84ada720ff5754d953879
2019-08-08 19:47:14 +02:00
Ed Sanders bae45b63d2 Use flexbox for mobile toolbar
* Makes edit tools equal width
* Improves horizontal alignment within tools

Change-Id: I01b9668b638c21607b12381efc198edfe02f23da
2019-08-05 12:01:32 +01:00
James D. Forrester 05fb44ae56 build: Upgrade eslint-config-wikimedia from 0.12.0 to 0.13.1
Change-Id: I43f407da92f59a8bf758cc2586e84aa5e18d9ab0
2019-08-02 09:51:07 -07:00
Bartosz Dziewoński 7d3154fea8 ve.init.mw.DesktopArticleTarget: Fix generated URL when loaded using veaction=edit in single-tab mode
We were incorrectly always adding action=edit to the URL in that case.
The condition was always passing because `this.section` is `null` when
unset, but `this.currentUri.query.section` is `undefined` when unset.
This is a similar fix/bug to a68cc38b22.

Bug: T209163
Change-Id: Ic80ac377b763aea53678c4209ba6b3a6ba2996c9
2019-07-31 01:10:56 +02:00
Ed Sanders 32042d76e8 Update VE core submodule to master (fbbb9c4cb)
New changes:
854a1fa2c Distinguish active link styling

Local changes:
* Pull through active link styling

Bug: T228220
Change-Id: I925f88d32a514a749b96f501a211003bc4c924f0
2019-07-25 20:25:54 +00:00
jenkins-bot ef25e831b9 Merge "MobileArticleTarget: Compat for OOUI scrolling fix on iOS Safari" 2019-07-24 11:34:23 +00:00
Bartosz Dziewoński cc1cb63aca targets: Fix silly indirection via a global variable
Since we're inside the Target instance, `ve.init.target` refers to
this object. Some of the code I'm changing even uses `this` instead
of `ve.init.target` on the next or previous line.

Most of the mistakes are a result of mass search-and-replace changes
(478b0bcb, e1a887cc), or moving the code from other classes (d294006d).
But I can't explain the "ve.init.target.getSurface().getDom()" line,
it would be good to figure out why it was this way before we change it.

Change-Id: I0d7c6a48369242d4c99620fcd775ab537420d84a
2019-07-23 22:39:47 +00:00
Bartosz Dziewoński 0fb7d5efda Update VE core submodule to 962335a40293cf4b1314c0236788f35f080ae877
New changes:
a06204317 Fix TableNode unit test getOffsetFromCoords failure on Firefox
dfe0eb025 Refactor mobile context logic into ve.ui.MobileContext

Local changes:
* Pull through for edit cards refactor

Bug: T227532
Bug: T228767
Change-Id: I6c043e039fbef62a56f475b0dc365e171ab7bf59
2019-07-23 22:13:27 +00:00
Ed Sanders 393de5985f Update VE core submodule to abf2bfa85e64e67cdf963601fe1da2a11fd9e89a
New changes:
1a7460058 Remove ve.newMobileContext feature flag

Local changes:
* Remove ve.newMobileContext feature flag

Change-Id: Ia8def997b7cba4623866080752b06068d2118cc3
2019-07-23 22:12:48 +00:00
Bartosz Dziewoński a5867818ff MWEditingTabDialog: Don't use ve.init.target because it may not be loaded
We also show this dialog on the old wikitext editor, where
ve.init.target is not set, because the relevant code is not loaded.

Follow-up to 478b0bcbb9.

Similar to e88cd81f94, which fixed the
same issue in a different file.

I checked all uses of ve.init.target in files under ve-mw/init/ and I
think this was the only remaining mistake.

Bug: T228684
Change-Id: I15551870cdb01d570e24ba9668e67330b8072e01
2019-07-23 19:09:37 +00:00
Bartosz Dziewoński b00190a398 MobileArticleTarget: Compat for OOUI scrolling fix on iOS Safari
Our overlay could be higher than the viewport, allowing the viewport
to scroll again.

Bug: T212159
Change-Id: I1e97d1963b214fc7673c33ae6c14ab7b0b80f31d
2019-07-18 02:11:53 +02:00
Ed Sanders 5aea61add7 Update OOUI icons names for article icons in link cache
Bug: T222079
Change-Id: I8ac2d02dfeaec3a197432d1718792a458d626917
2019-07-17 13:08:50 +01:00
James D. Forrester 18472d84a2 Follow-up Id330efac: Only hide the welcome dialog on mobile
Change-Id: I8fa3c6100652d2f29a60bc22c8e08a4d9e79d37a
2019-07-10 13:10:27 -07:00
Bartosz Dziewoński cde7946bdc MobileArticleTarget: Don't show the welcome dialog
Bug: T227670
Change-Id: Id330eface30d5fad8c7264a2be1ceeb4df3a4952
2019-07-10 18:28:02 +00:00
jenkins-bot 454a4da6b1 Merge "Log editor switches to visualeditorfeatureuse" 2019-07-04 19:30:42 +00:00
David Lynch 38e3c3fbdb Log editor switches to visualeditorfeatureuse
Depends lightly on a patch to WikiEditor, which will hook up the logging there
for the case where the switch is happening from WikiEditor to VisualEditor on
the same pageload.

Bug: T221191
Change-Id: Ibafec77b2eabd3b3b3767472b7b5a40e3312bf18
2019-07-03 23:58:30 -05:00
jenkins-bot a5e87bca9a Merge "Pass newRevId through to MobileFrontend" 2019-07-02 19:16:07 +00:00
jenkins-bot bad500da7b Merge "ArticleTarget: saveSuccess wasn't receiving expected arguments" 2019-07-02 19:16:03 +00:00
David Lynch 4d3ddb07e0 Pass newRevId through to MobileFrontend
Bug: T226847
Change-Id: I22daf4e7637c412aa444d98ec971bb294e4ade06
2019-07-01 15:59:55 -05:00
jenkins-bot 7796b569c9 Merge "MobileArticleTarget: Prevent unwanted page zooming on focus on iOS" 2019-07-01 16:14:35 +00:00
David Lynch c898838585 ArticleTarget: saveSuccess wasn't receiving expected arguments
Way back in 2c24efae in 2015 this got disconnected, which resulted in
saveComplete logging not having the expected updated revision_id.

Bug: T226847
Change-Id: I6dc14bb4b2dacedbe27493a97fa25c9b0542818c
2019-07-01 11:06:16 -05:00
Bartosz Dziewoński 2563bb3d89 MobileArticleTarget: Prevent unwanted page zooming on focus on iOS
Bug: T216446
Change-Id: I48beb1e120b5b087533b0827904212be9286529f
2019-07-01 15:53:29 +02:00
jenkins-bot 2699566577 Merge "iOS browser menu bar tap stealing hack for bottom contexts" 2019-06-26 20:38:47 +00:00
Ed Sanders 5c62ae20ef Clear edit summary when switching section and discarding changes
Bug: T191590
Change-Id: I1d3c4528dd07fcff90ffa378ade1d6982fc68791
2019-06-26 19:51:16 +00:00
jenkins-bot 552c5e3331 Merge "Improve debug bar margins on mobile" 2019-06-22 21:14:23 +00:00
jenkins-bot 115382f4db Merge "Prevent text on save/publish button from wrapping on mobile" 2019-06-20 19:20:51 +00:00
Bartosz Dziewoński 0af3ea84de Prevent text on save/publish button from wrapping on mobile
If the translations of save/publish button messages like
'visualeditor-savedialog-label-publish-short-start' contain spaces
(e.g. in Bengali 'bn'), the button on mobile would wrap over two
or more lines, due to weird styles we have for the mobile toolbar.

Change-Id: Ieb439ae489ab7110b81382ffdcf0d3d3ad2f84ac
2019-06-20 20:29:52 +02:00
Ed Sanders ad87c6c009 Improve debug bar margins on mobile
Change-Id: I6fd8b89dd44d5d8d933822851499264e4d0f4585
2019-06-20 13:15:52 +01:00
Timo Tijhof 45f3b5644c trackSubscriber: Remove use of 'ext.eventLogging.subscriber' alias
Deprecated in favour of 'ext.eventLogging'.

Bug: T221281
Change-Id: I16ca136be84b9c50208c4e702ec75d7ca33afd96
2019-06-20 00:57:17 +01:00
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
Bartosz Dziewoński 600e369347 iOS browser menu bar tap stealing hack for bottom contexts
Change-Id: I7607bef4253fde894e307bcecaac6bd342864c0c
2019-06-14 23:49:38 +02: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