Commit graph

16163 commits

Author SHA1 Message Date
James D. Forrester dec54cf56e build: Upgrade mediawiki-codesniffer to v28.0.0
Change-Id: I23702d16eee09292b63051f94103a3bca3b1dd13
2019-10-11 12:42:23 -07:00
jenkins-bot 389fd5c668 Merge "Catch errors during document initialization" 2019-10-11 16:24:02 +00:00
jenkins-bot b15eea1cb0 Merge "Fix Vector wikitext surface padding overrides when using custom browser font-size" 2019-10-11 15:23:17 +00:00
jenkins-bot cc1bd58e83 Merge "Parse relative hrefs on image nodes like on regular links" 2019-10-11 15:22:29 +00:00
Ed Sanders 57d8e53111 Catch errors during document initialization
Change-Id: I5dc29666f99ac10bbf63a56153ba9a32d3568daa
Depends-On: I57fb6319bc3a9cee347c39fc75f555543991d703
2019-10-11 15:13:10 +00:00
jenkins-bot 2c243647d3 Merge "Enforce that some files must not use the ve global" 2019-10-10 19:27:22 +00:00
James D. Forrester 8bb02cc454 Update VE core submodule to master (2f2cdd89d)
New changes:
8ff4683d3 libs: Update papaparse to 5.1.0
210518d4a eslint: Remove unused prefer-template rule; use proper globals values
fd8bf7425 Localisation updates from https://translatewiki.net.
f09a8f327 Remove <style> tags from $pasteTarget immediately
0f76791ac lib: Unset the executable bit on the papaparse.js library
8d05203fa TreeCursor: cross ignored nodes properly from the end of a text node

Bug: T234881
Bug: T235068
Change-Id: Icf9e0ca80575e45577ebf51764247da4dd82bdba
2019-10-10 12:02:20 -07: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
Translation updater bot 435d6d2a63 Localisation updates from https://translatewiki.net.
Change-Id: Iacfa47502110f9c0089f18f759603b4ff7a887fa
2019-10-10 09:34:02 +02:00
Translation updater bot 955a114c01 Localisation updates from https://translatewiki.net.
Change-Id: I7c04a8109d0a39803f028e9d2b5422b66d2a2c71
2019-10-08 09:34:53 +02:00
jenkins-bot 6096eccbf7 Merge "eslint: Remove unused prefer-template rule; use proper globals values" 2019-10-07 18:45:57 +00:00
Ed Sanders fd43701de2 eslint: Remove unused prefer-template rule; use proper globals values
Change-Id: If98be563304baa46a746d78c94dd8945f94d545c
2019-10-07 17:22:24 +00:00
Bartosz Dziewoński b8867f425b Merge "Update VE core submodule to master (2c8e48194)" 2019-10-07 16:04:23 +00:00
jenkins-bot def3261c49 Merge "Fix linking to pages in media dialog/media context/internal link context" 2019-10-07 15:13:02 +00:00
Bartosz Dziewoński 621c6f4759 Update VE core submodule to master (2c8e48194)
New changes:
fec3647e7 TreeModifier: return correct position in ensureNotText
2c8e48194 TreeModifier: Ignore more attributes when validating linear data

Bug: T234489
Bug: T234742
Change-Id: Ib83dfa2f2e02a63a8e9774f3383e5796a624cb64
2019-10-07 16:45:56 +02:00
Bartosz Dziewoński 55aec8f977 ve.ui.MWDefinedTransclusionContextItem: Fix handling of template names
The ...target.wt property contains the wikitext used to generate
the template name. It can contain trailing newlines (T234817) and
all kinds of funny wikitext syntax. Instead, use ...target.href,
which is the title of the page that is actually transcluded. Compare
the new code to ve.dm.MWTransclusionNode.prototype.getPartsList.

Additionally, fix some confusion about namespaces (treating template
names as titles in the main namespace). The template names in the
configuration page (visualeditor-template-tools-definition.json)
now support overriding namespaces in the same way as in wikitext.

Bug: T234817
Change-Id: I7c557d28e961d0b9117fc0380c65cdd42035ae96
2019-10-07 14:56:16 +02:00
Bartosz Dziewoński 7579f6eb1f Fix linking to pages in media dialog/media context/internal link context
If you had an image thumbnail for a file 'Foo?.png' on the page,
ve.ui.MWMediaContextItem and ve.ui.MWMediaDialog did not escape
the '?' when linking to it, which resulted in incorrect links.
Similarly, if you had an internal link to the page 'Foo?',
ve.ui.MWInternalLinkContextItem did not escape it.

Additionally, the links were always generated as if the wiki was
using short URLs, even when it is not (T233628).

The approach using mw.Title is copied from ve.ui.MWGalleryDialog.

Bug: T233628
Change-Id: I10256ed6883dae0ea216de4c0719f03d7fd19ae4
2019-10-07 14:27:02 +02:00
James D. Forrester 052a879c3c Update VE core submodule to master (8347ba91b)
New changes:
7cabb6fd2 build: Update eslint-config-wikimedia
8347ba91b Localisation updates from https://translatewiki.net.

Change-Id: I3260da9afe8f3230c124588419606ddbc42ae277
2019-10-03 14:26:19 -07:00
David Lynch d03db0e4f2 ui.MWSaveDialog: checkbox tracking was getting duplicated on every setup
Bug: T232790
Change-Id: Id19aa59c71432d0179fc06b6a30014d1037074ae
2019-10-03 12:44:43 -05:00
Translation updater bot 1c6baa06cb Localisation updates from https://translatewiki.net.
Change-Id: I9c1dae30cc92347719eedca4604976e0fc9677cf
2019-10-03 10:06:37 +02:00
jenkins-bot fc06416de8 Merge "build: Update eslint-config-wikimedia and fix" 2019-10-03 00:11:22 +00:00
Ed Sanders 41572f2595 build: Update eslint-config-wikimedia and fix
Change-Id: Ib9cf45a393438e2eb47fd1b0c837d2d6acb06541
2019-10-03 00:54:54 +01:00
jenkins-bot 964099043b Merge "Don't try to use structured data in structured logging, it doesn't work" 2019-10-02 21:32:33 +00:00
jenkins-bot 44e3319824 Merge "ApiVisualEditorEdit: Add logging for funny etags" 2019-10-02 21:32:30 +00:00
Bartosz Dziewoński 04407e9eb1 Don't try to use structured data in structured logging, it doesn't work
Our log messages were being silently dropped. Experimentation revealed
that our structured logging system doesn't actually like it when we
try to log structured data.

See: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/VisualEditor/+/540464/3/includes/ApiVisualEditorEdit.php

Put it all in the message strings, whatever.

Change-Id: Iae778f95774df2e24b30387221e39e097e25a4cf
2019-10-02 23:13:40 +02:00
jenkins-bot 55709912a7 Merge "ApiVisualEditor: Add logging for RESTBase HTTP errors" 2019-10-02 16:30:30 +00:00
Translation updater bot d3a4135854 Localisation updates from https://translatewiki.net.
Change-Id: I2d9fdb5e43b745203306f5ac7188ecc82743f6d3
2019-10-02 09:23:34 +02:00
Bartosz Dziewoński df0c8ad02d ApiVisualEditorEdit: Add logging for funny etags
Bug: T233320
Change-Id: I0f321df057068e1dd396a04a9e194853c2b0e9e4
2019-10-02 03:23:29 +02:00
Ed Sanders 877721fb55 Update VE core submodule to master (191f8c90c)
New changes:
25422cb06 Fix missing table cell "fake slugs"

Bug: T234108
Change-Id: I5de4940e7ee67799f8b60fa4cc5e277c1e3eff55
2019-10-02 00:17:21 +01:00
Bartosz Dziewoński 9ce8ae05c7 ApiVisualEditor: Add logging for RESTBase HTTP errors
Bug: T233127
Change-Id: Ide5138d8f8f462b9c3d7da10f26ff57c9d17f1c9
2019-10-02 01:00:32 +02: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
jenkins-bot 9dc3ecf4e4 Merge "Fix loading icons for historical diff mode switcher" 2019-10-01 15:28:26 +00:00
Translation updater bot cb5354b77e Localisation updates from https://translatewiki.net.
Change-Id: Ie95508ee53d56e140b70911d6df286e0be296a54
2019-10-01 09:26:53 +02:00
Bartosz Dziewoński ca3c887e36 Fix loading icons for historical diff mode switcher
The 'eye' icon is in the 'accessibility' pack, not 'alerts'.
Compare to the dependencies of 'ext.visualEditor.diffPage.init'.

Change-Id: Ie14ab6be756fd9e0bef59475466674a41273046f
2019-10-01 03:31:27 +02:00
jenkins-bot 73a92d847d Merge "ArticleTargetEvents: clean up some duplication" 2019-09-30 23:49:27 +00:00
jenkins-bot 78ed28fbf0 Merge "Update VE core submodule to master (084bdb77e)" 2019-09-30 18:09:46 +00:00
jenkins-bot 4d1d9677b5 Merge "Fix mw:MediaLink support" 2019-09-30 17:14:34 +00:00
David Lynch 651e00d529 ArticleTargetEvents: clean up some duplication
Change-Id: Ied2851f9d77d055db9fc22668b963a01ca098a95
2019-09-30 11:29:01 -05:00
James D. Forrester 3c9a8fe7f5 Update VE core submodule to master (084bdb77e)
New changes:
db8c96bc9 Localisation updates from https://translatewiki.net.
084bdb77e Localisation updates from https://translatewiki.net.

Change-Id: I527846592bc8f36c6e8197d3b861db96a1904ca7
2019-09-30 08:24:05 -07:00
Translation updater bot a70c9f4c1a Localisation updates from https://translatewiki.net.
Change-Id: I9899dde1be23258efba26d482e2315263f94b419
2019-09-27 09:22:04 +02:00
Translation updater bot 4d4228f7ad Localisation updates from https://translatewiki.net.
Change-Id: I217c3cf42562c1e12bb5785395e2243ec300eace
2019-09-26 09:15:40 +02:00
Bartosz Dziewoński da9b6fffbd Parse relative hrefs on image nodes like on regular links
* In normal images, parse relative 'href' attributes instead of
  expanding them to absolute, and parse 'resource' to keep it
  identical to 'href' if they refer to the same page (including
  same percent-encoding and space/underscore). This resolves Parsoid
  generating |link= options for copy-pasted images (T193253).

* In gallery images stuff, prefix the 'resource' attribute with './',
  same as normal images do. This causes no functional changes, but it
  makes updating tests easier, and the consistency is probably good.

* Update test examples to also prefix 'resource' and relative 'href'
  attributes with './', like the real Parsoid does.

Bug: T193253
Change-Id: If2d7f080d9d693568054f8311c1e1b15ca27ea5c
2019-09-25 00:25:04 +02:00
Bartosz Dziewoński e472a4bbd3 Fix mw:MediaLink support
* Handle mw:MediaLinks pointing to to non-existent files, which come
  with typeof="mw:Error" (similar to image nodes).

* Fix regression from c66f8e0547, which
  caused all mw:MediaLinks to be treated as plain external links again.

* Add test cases.

Bug: T232754
Change-Id: I9ae5bcfc4e24e8c0d22ef77d6a4d03f817fc9768
2019-09-24 22:46:03 +02:00
Translation updater bot 8e55547e4c Localisation updates from https://translatewiki.net.
Change-Id: Iba96ba8ec5658722dff777f62a3c906c748c83a4
2019-09-23 09:27:23 +02:00
TheSandDoctor 70e3e7cc8b VisualEditor: Replace deprecated editToken with csrfToken
The editToken key of mw.users.tokens is deprecated since MediaWiki 1.27.

Bug: T233528
Change-Id: I7297e6abb159e9bb758859454b1097292e607117
2019-09-22 10:22:01 -07:00
jenkins-bot 7f7cf6ce79 Merge "MWInternalLinkAnnotationWidget: adjust the input for relative links to subpages" 2019-09-20 11:23:40 +00:00
Translation updater bot 3193fc2543 Localisation updates from https://translatewiki.net.
Change-Id: I38e4369baaae5b2fa42527e287304e45b0895bf1
2019-09-19 10:00:31 +02:00
Bartosz Dziewoński 69147ce3bc Fix Vector wikitext surface padding overrides when using custom browser font-size
In order to get the desired padding, the `em` values were pre-multiplied
by the parent font-size, which was assumed to be `0.875em` for normal
surfaces and `(13.3333/16)em` for wikitext surfaces. (That should have
been `(13/16em)`, by the way, but that's a negligible difference.)

Unfortunately, the font-size for wikitext surfaces is actually `13px`.
Unlike `em`, `px` values are not affected by custom browser font-size,
so when one was set, the final padding was all out of whack.

Use `rem` units instead to respect the custom browser font-size,
without getting problems due to the parent element font-size.
We don't need separate rules for .ve-ui-mwWikitextSurface now.

Bug: T222217
Change-Id: Ib7ffbf09d5aa23fddb894aa3b081ec993ddcee2d
2019-09-18 22:24:47 +02:00
jenkins-bot 2de131d561 Merge "build: Update linters" 2019-09-18 18:44:54 +00:00
Ed Sanders 3bb8710715 build: Update linters
Change-Id: If2a45c63f435911ebd7a83df9c0723d45c040a5e
2019-09-18 19:11:45 +01:00