Commit graph

667 commits

Author SHA1 Message Date
Ed Sanders 1bb72f0bb5 Replace deprecated easy-deflate.deflate with mediawiki.deflate
Change-Id: I5c77d4818074fd3dc937d7688d449952b92ee358
2019-10-30 19:13:47 +00:00
Bartosz Dziewoński 372f04fc6f Tweak dependency on 'mediawiki.diff.styles'
It's only needed for the save dialog.

Change-Id: Ifada463e95e2e911161f6ba898de6656412b4f83
2019-10-24 18:35:53 +02:00
Ed Sanders b676b2295b Update VE core submodule to master (3fac5f1f2)
New changes:
8cbedc3c8 build: Update linters
a211e9fd8 TargetWidget: Use surface view focus/blur events
57aeb8b38 Separate utilities required for DOM parsing into separate file

Local changes:
* Setup modules for new parsing utils files

Change-Id: Ie4e59650fdb869e7e4148c97cd03d79ce35187dc
2019-10-23 18:34:17 +02:00
Bartosz Dziewoński 3f0f302577 Enforce that some files must not use the ve global
Previously, the ve-mw/init/ directory contained two kinds of files:
those that were used when initializing VE, and those that may be
loaded even if VE is not going to be initialized at all. The latter
kind must not use the `ve` global variable.

After moving those files to ve-mw/preinit/ we can enforce this with
.eslintrc.json in that directory. This would have prevented T228684.

(Technically they merely must not use `ve.init`, and may use `ve`,
but that's harder to enforce. We should instead move the few non-init
methods out of `ve`: now, track, trackSubscribe, trackSubscribeAll).

Also, group some files under ve-mw/init/: targets/ now (only)
contains ve.init.mw.Target and its subclasses, apiresponsecache/
now contains ve.init.mw.ApiResponseCache and its subclasses.

Bug: T228684
Change-Id: I945249a27f6a0fa10a432d5c5dc57bc7e0461fd8
2019-10-10 15:15:40 +00:00
James D. Forrester 673d2bc657 Update VE core submodule to master (163767591)
New changes:
05306a572 ve.ui.SpecialCharacterPage: Remove unused icon handling
738244b1f Localisation updates from https://translatewiki.net.
7527b151c Upgrade DOMPurify 1.0.10 -> 2.0.0
ff5c1def9 Catch errors when applying initial history

Change-Id: I43c2668ddf1c2a15d724b24532256fc2d222facd
2019-10-01 14:37:01 -07:00
Timo Tijhof aae62a87be Remove cache group setting from styles modules
Follows-up 35eead0f3. This caused an extra stylesheet and HTTP
request to be added to all page views, because
'ext.visualEditor.desktopArticleTarget.noscript' is a styles
module, which should be allowed to join the regular batch.

Also remove it from other styles-only modules known to be loaded
with addModuleStyles().

Bug: T233095
Change-Id: Iea1f33199ec8dc83a42ac7102595a033300e33e6
2019-09-17 19:06:23 +01:00
jenkins-bot cc5a5dfaff Merge "Break up our massive load.php request to work around network issues" 2019-08-30 22:25:16 +00:00
jenkins-bot bc963f4155 Merge "Support for defined template context items" 2019-08-30 18:50:27 +00:00
Ed Sanders e5f5a49344 Support for defined template context items
Context items can be created for specific template titles. Titles
are mapped to context items using an on-wiki message.

Bug: T211243
Change-Id: Icfc39e350452da238d0e0c17cb2305c60d9ca16a
2019-08-30 13:02:47 +01:00
David Lynch 1761b6d6d6 MobileArticleTarget: v1 of toolbar refresh
Bug: T211789
Bug: T230807
Change-Id: Ifd2319039628a8143dc09f6fa35e4a9825d3062c
2019-08-29 15:27:56 +00:00
jenkins-bot dd86fc76aa Merge "Use upstream pulsating dot" 2019-08-28 17:31:52 +00:00
Ed Sanders 7cc538fe51 Use upstream pulsating dot
Bug: T226719
Depends-On: Ibd035ea48b7d0316a7627a91623ff6116ccbae31
Change-Id: Iedf88e9c5ac8efa809ccb25f2081eff9946da395
2019-08-28 13:40:29 +01:00
Bartosz Dziewoński 756572ed8a ve.init.mw.ArticleTarget: Use errorformat=html when saving
When saving fails for a reason we don't handle explicitly, the error
message will have HTML formatting and will respect any on-wiki
overridden messages, rather than being plain text generic message.

Extensions providing custom SaveErrorHandlers may need to be updated.
The only one in Gerrit that requires a fix is TitleBlacklist:
Ibeae79c95557a7af699716c9d921f34c310bee6d.

* Remove handling for errors returned in .visualeditoredit.edit.info
  rather than .errors (.error in old format). AFAIK this is only used
  by some extensions, it is probably incorrect to do (T229539) and all
  extensions I know of that do this (AbuseFilter, SpamBlacklist,
  ConfirmEdit) have custom SaveErrorHandlers.

* Remove custom error messages for 'readonly' (identical to API
  response) and for 'hookaborted' (very unhelpful and there is a
  chance that the API response is better, if the extension causing
  this error generates any error message).

* Add a silly shim for MobileFrontend integration, because we allow it
  to handle error responses, and it expects them in the old format.
  This is probably subtly wrong in many ways, but MobileFrontend code
  only uses this for logging, so it shouldn't explode. In the future
  we will hopefully change it to use errorformat=html (T228897#5366960).

Bug: T229532
Change-Id: I3b9c4fefc0869ef7999c21cef754434febd852ec
2019-08-22 00:37:15 +00:00
Ed Sanders 9a1994e47c Update VE core submodule to master (7cb9caca1)
New changes:
28aea2e4d Edit cards v2 design
739017973 Track usage of the new "close context" button

Local changes:
* Edit cards v2 pull through

Bug: T222396
Change-Id: I1ca885e8d8127e7827a059755315ed789a7b9210
2019-07-25 22:24:48 +02: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 59bc6f6a76 Add dependency on 'mediawiki.interface.helpers.styles'
This module is now needed to correctly display log excerpts,
like in our edit notices popup for protected pages.

Bug: T227190
Change-Id: I19dec69a33a2b3246ff1abe6bec90b2359ac36a4
2019-07-16 20:58:38 +00:00
jenkins-bot 2d25d15a39 Merge "Add number of images to gallery context" 2019-07-15 23:26:30 +00:00
Ed Sanders c958ea383d Add number of images to gallery context
Change-Id: I3e54c6cb2b29ecb1153afd5f2f61adaabceb095b
2019-07-16 01:04:08 +02:00
Ed Sanders fba9585dbf Add validation feedback to external link
Bug: T227899
Change-Id: I165ed59402bdffb63b0c79b68a41d509c4574837
2019-07-15 22:35:46 +00:00
Ed Sanders b64cd4ced1 Update VE core submodule to master (213b79783)
New changes:
6cd9ba63f Localisation updates from https://translatewiki.net.
c9cebed32 Update OOUI to v0.33.2
65c66b8a6 Localisation updates from https://translatewiki.net.
8d94ad13f Replace unrendered parts of the view tree with a stub node
213b79783 Basic unit tests for attachedRoot functionality

Bug: T215717
Change-Id: I7bd8106a82e4fa7c912ce9f8d4fab86bfb546702
2019-07-14 15:26:28 +01:00
Bartosz Dziewoński 35eead0f3d Break up our massive load.php request to work around network issues
I suspect that the size of our singular load.php request (~600 KB
after gzip, depending on the installed extensions) is somehow
triggering the network problems on T213214. To test this theory,
break it up by putting some modules (all that start with
'ext.visualEditor.') into a separate ResourceLoader group.

Now we have two load.php requests (~300 KB each after gzip).
This may increase load times (it will be interesting to see by
how much), but may also fix T213214.

Bug: T213214
Bug: T221197
Change-Id: I0b1a65963267ba52d7962ce31db5a8e6f913322d
2019-07-09 21:35:37 +02:00
James D. Forrester 56df3cc4cb Update VE core submodule to master (75510a515)
New changes:
a3d860daf Localisation updates from https://translatewiki.net.
0421bf6f0 Gather annotations from clicked node where possible
2d2491877 Change#squash: Compact multiple transactions into one
dc0e4650e Fix documentation of ve.dm.Change#serialize
a40f8314f Fix contexedAnnotations equality check
ec62ccb34 Use 16px font size on SA mobile demo
57984c072 Update OOUI to v0.33.1

Add lib/ve/src/dm/ve.dm.TransactionSquasher.js to debugScripts.

Bug: T188026
Bug: T226708
Change-Id: I6eb4ab50ef2c6774963f692f600f059662bf0ac3
2019-07-04 00:31:57 +00:00
jenkins-bot 7796b569c9 Merge "MobileArticleTarget: Prevent unwanted page zooming on focus on iOS" 2019-07-01 16:14:35 +00: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
James D. Forrester 34158b8568 Stop loading oojs-ui.styles.textures, gone as of OOUI 0.33.0
Change-Id: I38aa1ce529bed43175d2ecdcecd1c6a2a0ed603f
2019-06-26 20:54:49 -07: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
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 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
James D. Forrester 0e7e88c43e Update VE core submodule to master (d9ece414a)
New changes:
c0799b060 Source mode performance optimizations
d9ece414a ve.dm.MetaItem: Add removable flag

Bug: T96528
Change-Id: Ifc0d3322c0ab0c0384fd179281cb1ed7f3ff6b31
2019-05-29 12:31:24 -07:00
David Lynch 5c7d913f62 Add missing translations from VE submodule
New table context keys were missing from extension.json.

Bug: T211240
Change-Id: I10acc3fc7191441e5c454ed869dc6b1db717b6bf
2019-05-13 11:07:11 -05:00
James D. Forrester 622e77d620 Update VE core submodule to master (6fc2d029c)
New changes:
8df948f5d TableLineContext: add context for the entire table
aae86a822 TableNode: Change mobile behavior so initial tap enters the cell
195d8cb3a Check resizeable node is focused before rendering handles

Bug: T211240
Change-Id: Ib2430c521abb4e59aaa2c5e4f9b26a16437db02e
2019-05-13 13:30:15 +01:00
Bartosz Dziewoński 636531808c ApiVisualEditor: Fix use of getBlockInfo()
The method ApiQueryUserInfo::getBlockInfo() was removed in unannounced
breaking change in MW core: I84ed21641c44b2f65ebe1980b0893d1846db3b34.
Apparently we're supposed to use the method from ApiBlockInfoTrait now.

Bug: T209599
Change-Id: I7ab5492310980b1527c7329faf65655330b8bef0
2019-05-08 22:36:38 +02:00
Ed Sanders c035073cf9 Fix abandon edit warning message
This message was upstreamed to core and later renamed.

Use the upstreamed dialog itself when switching sections.

Bug: T222525
Change-Id: Ibd2d75ec503e92b5ddec2105f762b0c9f0dc96fb
2019-05-06 15:11:58 -05:00
Ed Sanders f9330c8564 Replace the save button with a save tool
Now shows correct tooltip for save button (including
the access key).

Bug: T163142
Change-Id: If14a1a5a5829fc215cb79827392173dc05c4bdd7
2019-04-30 19:32:33 +00:00
Ed Sanders a7149cc3ee Update VE core submodule to master (7cd15cfe9)
New changes:
9b162a5da Localisation updates from https://translatewiki.net.
10dbdabf4 Remove valid-jsdoc exceptions for @chainable
a424f804d Make blockquote a non-content branch node

Local changes:
* Update stuff for making blockquote a non-content branch node

Bug: T76426
Change-Id: I95ae25f20d3d102da69bf5ffdff55335f6c07635
2019-04-22 12:39:14 +01:00
jenkins-bot 8401da1073 Merge "Move autosave logic up to mw.Target" 2019-04-18 22:36:47 +00:00
Ed Sanders 1123c1eadc Move autosave logic up to mw.Target
This would allow non-article targets to implement
autosave more easily.

Change-Id: Icc945575d0982cf82647c9078caf9a39bb715c2e
2019-04-18 15:21:33 -07:00
jenkins-bot ebe04bb856 Merge "Apply styles for WikimediaUI theme by default rather than only Vector and Minerva" 2019-04-17 19:13:41 +00:00
jenkins-bot b17acda9b6 Merge "Remove unnecessary duplications of 'default' theme files" 2019-04-16 15:47:56 +00:00
Bartosz Dziewoński b1d3fdbb0c Apply styles for WikimediaUI theme by default rather than only Vector and Minerva
They will now apply for other skins not mentioned here, e.g. Timeless.
The most noticeable change is proper styling for target widgets.

Change-Id: Ibf4c080aaaeedd65144ac5e95ed2f48a1cd17635
2019-04-16 17:35:56 +02:00
jenkins-bot 7197fd49c3 Merge "Update VE core submodule to master (6590e0ac5)" 2019-04-16 14:58:46 +00:00
Timo Tijhof cc599c2e36 init: Bundle wgVisualEditorUnsupportedEditParams with DesktopArticleTarget.init
Bug: T219342
Change-Id: I4b5a048779bd4b957cc5d99c3a7686363ffb3df9
2019-04-16 16:33:53 +02:00
James D. Forrester 51b68049d1 Update VE core submodule to master (6590e0ac5)
New changes:
6590e0ac5 Create generic command to move focus to context

Change-Id: Iba309ca5f7299f4157a3a43836064e17b5f4d62b
2019-04-15 14:13:42 -07:00
jenkins-bot 1b2c1425ee Merge "Allow external link pasting to be enabled by config" 2019-04-09 16:05:26 +00:00
Ed Sanders c1bc3f00e0 Remove unnecessary duplications of 'default' theme files
Change-Id: I52b4851a44ad9e472f006d4a892d8cc54c7ab5db
2019-04-05 14:47:58 +01:00
jenkins-bot 96dfb99016 Merge "Edit summary autocomplete" 2019-04-04 17:44:36 +00:00