Commit graph

13319 commits

Author SHA1 Message Date
Ed Sanders 6c471c5b1e Introduce ArticleTarget#afterSurfaceReady
This method should be called once the surface is visible
and ready to be focused.

Change-Id: I43a1d9cabd59181d2beab8f4a29700d031903c22
2022-01-11 03:33:04 +00:00
Ed Sanders 93df71af77 ArticleTarget#scrollToHeading fixes
* Use this.getElementWindow
* Use this.surface.padding to avoid race condition
  when the toolbar hasn't fully rendered yet.

Change-Id: I055b1d9458d73e435ede6096941a3e72c9c1ce74
2022-01-11 03:32:52 +00:00
jenkins-bot b92f414e23 Merge "Use new wikipage.watchlistChange hook" 2022-01-10 22:42:17 +00:00
Ed Sanders 3800daf354 Use new wikipage.watchlistChange hook
Bug: T294254
Depends-On: I88af8585e8fc75f77ebef867d267199aeb2c6592
Change-Id: I60400124976093060b3b5478c6d7d9e6844cc217
2022-01-10 23:16:41 +01:00
jenkins-bot ccb74dc828 Merge "Enforce formatversion=2 in template search" 2022-01-10 12:57:05 +00:00
jenkins-bot 8886773548 Merge "DiffPage: Only set user pref on 'choose' event" 2022-01-08 01:33:31 +00:00
jenkins-bot 67aad36acb Merge "DiffPage.init: Move and rename some vars" 2022-01-08 01:33:29 +00:00
jenkins-bot 451555ac64 Merge "Tests: Fix unbalanced HTML" 2022-01-08 00:26:53 +00:00
Ed Sanders 40a50cac4a DiffPage: Only set user pref on 'choose' event
This prevents your preference being changed if you just
followed a link with a diffmode parameter.

Change-Id: I755563bde285e95c0367119d49a40e1dd3c5e178
2022-01-06 16:48:02 +00:00
Ed Sanders 302303de46 DiffPage.init: Move and rename some vars
Change-Id: Ibcef23650e6c77d9142055e9e7357ce095ba3b49
2022-01-06 16:47:35 +00:00
Thiemo Kreuz 579cdaa145 Enforce formatversion=2 in template search
This is guaranteed via ve.init.mw.Target.getContentApi(). But the
ContentTranslation extension replaces this, and does not set a
formatversion. See e.g. SectionTranslationTarget.getContentApi().

Bug: T298599
Change-Id: I8768cae3153e9cbc29a8796ec21ef249f80471ed
2022-01-05 12:49:44 +01:00
mewoph 93d54c701b Check for saveDialog in ve.init.mw.DesktopArticleTarget.saveComplete
In case the save is triggered without the save dialog (for example, when a null edit is made during suggested edits task in GrowthExperiments)

Bug: T298552
Change-Id: Id49b967cfa52d33848e9c911086000fa4501fa7f
2022-01-04 13:35:21 -08:00
Ed Sanders 9e4915d7c3 Tests: Fix unbalanced HTML
Change-Id: I997c68ce33263004b8ae9b686aae7295eec12ea7
2022-01-04 02:01:38 +00:00
Ed Sanders 1c6dbf433f Remove more DOM garbage introduced by 'Web of Trust' extension
Bug: T297862
Change-Id: Ib6efe0c4ea68a1b17efd37839cec428dc9ebf6b7
2021-12-20 17:54:20 +00:00
Ed Sanders b57fe3e8ba Only set diffmode-historical user option when it has changed
Bug: T290703
Change-Id: I289e0c20db9235a432f7f49a425328ab617d57f3
2021-12-20 14:27:37 +00:00
jenkins-bot 717b5cf534 Merge "Use no-jquery/no-html to warn against writing HTML strings to the DOM" 2021-12-17 16:42:53 +00:00
jenkins-bot c92ea76af8 Merge "eslint: Enable no-jquery/no-append-html" 2021-12-17 16:42:42 +00:00
jenkins-bot 53ad459b27 Merge "ve.ui.MWMediaDialog: Clean up image metadata display" 2021-12-17 16:42:39 +00:00
jenkins-bot 6dc75d8283 Merge "Remove obsolete performance bottleneck from TransclusionModel" 2021-12-17 13:24:19 +00:00
jenkins-bot 26d22ee4bc Merge "Delay initialization of all invisible "add parameter" components" 2021-12-17 11:52:48 +00:00
jenkins-bot 4a1063e87a Merge "Skip bad suggestedvalues and aliases in the template dialog" 2021-12-17 11:16:21 +00:00
Ed Sanders 2098292318 Use no-jquery/no-html to warn against writing HTML strings to the DOM
This forces us to comment when we are doing this deliberately.

Change-Id: Ide1bcb64f6c6076b48e88f1f27045bd93392f8a0
2021-12-16 01:28:42 +00:00
Ed Sanders 4d13a4f4ed eslint: Enable no-jquery/no-append-html
Prevents accidentally treating plain text or user input
as HTML, which could be an XSS vulnerability.

Change-Id: Id4af48447a0907962a57340cb60aca08df9cc505
2021-12-16 02:04:11 +01:00
Bartosz Dziewoński 97be4e21ad ve.ui.MWMediaDialog: Clean up image metadata display
* Fix incorrect use of .append() instead of .text() (which was causing
  some l10n messages to be treated as raw HTML)
* Avoid escaping and parsing HTML several times when plain text was
  intended
* Remove some unused options and variables

Follow-up to 839b64d882.

Change-Id: I124257c73fe09713afefccdec8e90200e6ae433d
2021-12-16 01:52:54 +01:00
sbassett 839b64d882 SECURITY: ve.ui.MWMediaDialog: Escape plaintext image metadata fields
CVE-2021-44855

Bug: T293589
Change-Id: I691b4065e67c53c4276599c8d16c31ab5591db3a
2021-12-15 16:14:35 +00:00
Thiemo Kreuz 7cf10ea474 Delay initialization of all invisible "add parameter" components
The "Add parameter" page always starts collapsed. Even if a template
doesn't contain anything but this. But most of the content isn't
visible, unless the user presses the button. It's not only a lot of
content, it's also rather expensive, including .parseDom(),
LinkCache.styleElement(), and ve.targetLinksToNewWindow(). This adds
up in large multi-part transclusions. In an example with 200 parts
the total blocking time goes down from 2.9s to 2.4s. Which means this
is not a major bottleneck, but still worth it.

Bug: T296335
Change-Id: Ieab9fd35d145142b04d2267d8e5a2e10a4c02784
2021-12-15 08:28:16 +00:00
jenkins-bot 6bfd3ab7c0 Merge "Add link to undocumented parameter help" 2021-12-13 13:56:52 +00:00
Thiemo Kreuz 66636e1dd8 Skip bad suggestedvalues and aliases in the template dialog
Bug: T297386
Change-Id: I6456d720c923e8cff9b4500b6cfe52bc6fbc9dad
2021-12-09 16:58:13 +00:00
Thiemo Kreuz 845cd69bf5 Don't scroll to template parameters while the dialog loads
Bug: T296743
Change-Id: Icd501ae89695a202e8c264d1b5e9811e812a56d1
2021-12-09 14:57:20 +01:00
Andrew Kostka 887a01a355 Revert "Hide more button on parameter descriptions for screen readers"
This reverts commit 3e23d78d32.

Bug: T296997
Change-Id: I74a338aa4e8cb7754feaabc348b6c308f7f2eeae
2021-12-09 10:10:53 +01:00
jenkins-bot abc7a7d4b6 Merge "Use new select[First|Last]SelectableContentOffset methods" 2021-12-08 16:43:53 +00:00
Ed Sanders 5c0344aeda Use new select[First|Last]SelectableContentOffset methods
* Make ve.ce.MWBlockImageNode autofocus=false, remove
  unused transition property
* Remove ignoreChildren from ve.dm.MWBlockImageNode
  based on new definition
* Remove tests which assert that deleting in a list next
  to a block image always de-indents. If this is desired
  behaviour it should be fixed without reference to
  ignoreChildren.

Bug: T295905
Depends-On: Idc0cccbe73d1b49d07b60c14a192a40f47d64608
Change-Id: Ib79a070f5d36dbe7742fa0760f8cdf55fe3046ed
2021-12-08 15:53:35 +00:00
jenkins-bot 39199ae44f Merge "Remove unused CSS from template dialog" 2021-12-07 14:43:51 +00:00
WMDE-Fisch 742aee7f9d Add link to undocumented parameter help
Bug: T284985
Change-Id: Ie5a61beed39aa3572c2a5e82dbc3711fdcd35ba8
2021-12-07 15:12:20 +01:00
Thiemo Kreuz 847ab1800b Remove unused CSS from template dialog
These pieces are only relevant when the new "inlineDescription"
feature is enabled. In other words: This can't have an effect on
the old dialog.

The 2.5em left and right are from an old styling when the
parameter pages have been indented.

Change-Id: I022b0dd94ee66f7de114c055c3f453317a7f6131
2021-12-07 13:57:18 +00:00
jenkins-bot 131f7e940d Merge "Add safe-guard for early template dialog resize events" 2021-12-07 13:08:42 +00:00
Thiemo Kreuz fd669a4d16 Remove obsolete performance bottleneck from TransclusionModel
This sorting algorithm was introduced via Ic6bc348 (T274544). Note
there is no index parameter in the .onReplacePart() handler at this
point. When a part was moved, it was removed and simply appended
to the end. The additional sorting was needed to move it back to the
correct position.

This changed a few days later via Iafe29f1. There is now an index
parameter. The .onReplacePart() handler does the same as before, but
puts the part at the correct position right away. The additional
sorting is pointless since then.

The removed code alone is responsible for 1/3 of the total blocking
time when the template dialog opens.

Bug: T296335
Change-Id: I6c3fa70b532d34cd29d59c3b48ab81ebf608d548
2021-12-06 17:36:53 +00:00
Svantje Lilienthal 65bef19f73 Prepend multipart message in onReplacePart to prevent it from moving around
onReplacePart is being called when templates are being moved up or down. 
To prevent that the multipart message gets moved around passively e.g. 
by one element being added above it, this patch adds it to the top after each movement.

Bug: T292829
Change-Id: I946c9bc4ba5e1d261aefbb28a8c642bb58964842
2021-12-06 13:58:09 +00:00
Svantje Lilienthal a2afdee49f Remove suggested values message for custom inputs
Bug: T296915
Change-Id: Iecd90b02ea5bebceda1e87ddddb43fdb71b91d9e
2021-12-03 15:28:04 +00:00
WMDE-Fisch eef0ce91f7 Parse new link in multipart message
We forgot change the way that message is build while adding the link
in 07f105fd7. Now it gets parsed correctly and the link will open in
a new tab.

Bug: T284985
Change-Id: I1ed9dfdafd08d08c5aff45f4b74c540b35ec14a1
2021-12-03 10:36:44 +00:00
WMDE-Fisch 1467800331 Remove temporary hacks that got fixed upstream
Fixes are part of OOUI v0.42.1

Change-Id: Ic133d6cc503538fb8b4319bed037bc6e8596bd1c
2021-12-02 13:27:40 +01:00
Thiemo Kreuz 35bc600aa9 Fix action icons breaking into multiple lines on narrow screens
This is only relevant with the old design. It's only noticable when
a field shows all 3 action icons: info, raw wikitext mode, and
trashcan. The last icon can wrap to the next line when the screen
is very narrow.

I tried to apply nowrap, but this causes other style issues.

Removing the arbitrary width allows the action container to be
as wide as it needs to be. I can't tell why this restriction was
there. It is in no way necessary, as far as I can see. I can only
guess it's a temporary artifact from when the dialog was designed.

Bug: T296730
Change-Id: I77129ccc3afe002ba697b1787b41d0a388d5f4b8
2021-12-01 14:57:49 +01:00
jenkins-bot 85d64d57bc Merge "Performance: Don't add empty action <div>s to template dialog" 2021-11-30 13:59:53 +00:00
Adam Wight e82eb4832c Cleanups
Split from I280f814e72.  Should have no effect on behavior.

Change-Id: I4a43cbc863c58a4977e8093fa8c1371b56ec9b90
2021-11-30 14:07:32 +01:00
Thiemo Kreuz a40947ed18 Performance: Don't add empty parameter descriptions to dialog
This does have a significant impact on the performance of the
template dialog. Not only on construction time, but also because
MWExpandableContentElement objects do some quite expensive
.updateSize() calculations the moment they become visible.

I profiled a template with (only) 200 undocumented parameters.
Construction time goes down from ~600ms to ~520ms. The mentioned
.updateSize() runtime goes down from ~300ms to ~10ms.

Bug: T296335
Change-Id: I280f814e722b299aae0ec6a5a2fa59292e3e5887
2021-11-30 14:07:11 +01:00
WMDE-Fisch f65eac3d66 Add placeholder for finding a template
Bug: T296465
Change-Id: I07c6e601111073b1269a3ab6c552f83e12196156
2021-11-26 16:30:19 +01:00
WMDE-Fisch bc89f1d8fd Set search icon on template placeholder search
Bug: T296465
Change-Id: I02932821b26c21eb559fdb391054b83d1da41d2a
2021-11-26 14:34:44 +00:00
jenkins-bot 9853498756 Merge "Update multi-tab code after changes in Minerva" 2021-11-25 11:22:30 +00:00
Thiemo Kreuz b435f02efc Performance: Don't add empty action <div>s to template dialog
This doesn't have much of an impact on performance according to my
profiling. But I think it's worth it nevertheless. The idea is to
skip that <div> entirely when it's empty.

Bug: T296335
Change-Id: Id155725fbc2e3453acc1cdcabfdc2d687285d694
2021-11-23 21:38:19 +00:00
jenkins-bot e6b9a91ee9 Merge "Fix missing Meta+D shortcut on Mac" 2021-11-23 10:32:37 +00:00