Commit graph

409 commits

Author SHA1 Message Date
jenkins-bot 1962bf6dda Merge "Remove dead code in MWTemplatePlaceholderPage" 2022-06-20 08:53:46 +00:00
WMDE-Fisch 6396b030d5 Remove dead code in MWTemplatePlaceholderPage
Bug: T310859
Change-Id: I04de9c4bd3828e8769136d5776037e927ba7b4ab
2022-06-20 10:30:31 +02:00
jenkins-bot 30bd135a94 Merge "Remove small pieces of dead code from MWParameterPage" 2022-06-20 08:29:38 +00:00
Thiemo Kreuz b53c38f411 Remove small pieces of dead code from MWParameterPage
Small pieces we forgot to remove in Ie57f462.

Bug: T310859
Change-Id: I29afb65456c4a0a6f482fcdd56785bf6232c0470
2022-06-20 09:49:00 +02:00
WMDE-Fisch bf2f40e8d4 Remove dead code in MWTransclusionContentPage
The outline item is only used by the new sidebar for the move and
remove flags it seems.

Bug: T310859
Change-Id: Ia74e5b0e3dbf81e745137b181ed34a4d48dac42c
2022-06-17 16:46:30 +02:00
WMDE-Fisch 3273b7e5bd Remove dead code in MWParameterPage
Parameters do not have an "OutlineItem" anymore so the code for
that was completely removed.

Bug: T310859
Change-Id: Ie57f462b8fda4505b99ee5bc9d788908d18d9c64
2022-06-17 12:25:40 +02:00
Thiemo Kreuz 218ac78960 Remove obsolete "search for a parameter" page and widgets
… as well as messages, CSS, and icons that are now unused.

Bug: T310859
Change-Id: I1a2797728788cf1a86299414c1430ded0b362d4e
2022-06-17 10:23:00 +02:00
Thiemo Kreuz 1a2bb91310 Stop using deprecated "ParameterPlaceholderPage" class name
Removing a class name that's going to be deleted from places where
it's not strictly needed, e.g. comments.

Bug: T307188
Change-Id: Ifb14695d05510d2c0e25623afa99c4e84af3aaf9
2022-06-16 18:09:26 +02:00
Adam Wight 1b4c81c27d Remove $wgVisualEditorTransclusionDialogInlineDescriptions feature flag
The feature is always enabled now.

Bug: T307188
Change-Id: Id8b39d44901dee9118837fc4670d7faa4ef19b43
2022-06-15 12:09:47 +02:00
Adam Wight e1ea921f76 Remove $wgVisualEditorTemplateSearchImprovements feature flag
The feature is always enabled now.

Bug: T307188
Change-Id: I34a3db44355d93413f611b99cd80b876d8737413
2022-06-14 10:48:19 +02:00
WMDE-Fisch 13f5637290 Clean-up users storage after search message removal
I'm more in favor of leaving no garbage behind. The TODO with a date
is a good way of making sure this gets removed eventually.

This could have been part of Ie6eea76. The new code is added to the
same spot where the code removed in Ie6eea76 originally was.

Bug: T296471
Depends-On: Ie6eea76dacdc614ecb910c48e7e1f519b8c69322
Change-Id: Idec63201ff4aa52a0c53c6d007577a93c94e0ec0
2022-06-14 06:59:46 +00:00
jenkins-bot fcf849ddb0 Merge "Remove $wgVisualEditorTransclusionDialogBackButton feature flag" 2022-06-13 08:12:40 +00:00
Adam Wight 2e2e40e76e Remove $wgVisualEditorTransclusionDialogBackButton feature flag
Feature is always enabled now.

Bug: T307188
Change-Id: I70305ec3d2ed9cfb767ee9ea90e8ed6c93cfbdbb
2022-06-10 17:33:56 +02:00
Adam Wight 23f0bdf822 Remove $wgVisualEditorTransclusionDialogSuggestedValues feature flag
Feature is always enabled now.

Bug: T307188
Change-Id: I6f8288d31fecc6827a7a9e5e9705239e15c86ae2
2022-06-10 16:40:06 +02:00
Svantje Lilienthal 58fd0531d9 Remove updated feature message about search
Bug: T296471
Change-Id: Ie6eea76dacdc614ecb910c48e7e1f519b8c69322
2022-06-10 13:13:51 +00:00
WMDE-Fisch d996288169 Move message about missing parameters to sidebar
Will be removed when parameters are added. Needs different margins
depending on beeing shown in the single transclusion mode without
header or on multiple transclusions.

Bug: T300710
Change-Id: Ieb95d7276aa4d4b0fcbb74f87ab734e4a393dc21
2022-04-29 10:03:23 +02:00
jenkins-bot 401da7ee13 Merge "Remove MWDismissibleMessageWidget and use MessageWidget's showClose option instead" 2022-03-17 11:43:33 +00:00
Ed Sanders 1b5550f485 Move var declarations inline
Mostly ve-mw/ui and a few left overs.

Change-Id: Idea0c94d974e661c49af8ad4545cd8fd98179ca8
2022-03-01 17:50:24 +00:00
Thiemo Kreuz 5a92880da5 Fix bad visualization of empty suggested value
Bug: T299430
Change-Id: I9a0d26c7fc88e1a0c2c68152b3e15a9ba7662991
2022-02-28 08:49:08 +01:00
jenkins-bot 839a62829d Merge "Add and fix default values in parameter documentation" 2022-02-21 13:41:51 +00:00
Thiemo Kreuz bc0a34b0ed Add and fix default values in parameter documentation
Same random finds while working on something else. I carefully
checked and made sure these methods are actually called without the
optional parameter.

Change-Id: Iab36fd130258322985b5d6e7f8e1f7b4ee235ba2
2022-02-21 13:19:21 +00:00
Thiemo Kreuz 58e27f56d6 Remove not needed self = this indirections
These are only needed when we need to access a specific `this` from
within another `function () {}` context. This is not the case in the
situations here.

This is split from Ibf25d7e to make it smaller and easier to argue
about.

Change-Id: Ide1476de91fc343aa992ad92a1321d3a38b06dd0
2022-02-21 10:52:24 +01:00
Ed Sanders b0e32c22fa Remove MWDismissibleMessageWidget and use MessageWidget's showClose option instead
This option was added in 0.43.0. Now that the close button is handled,
the remaining functionality (store a flag in local storage, and fixing
link targets) doesn't really justify a separate class, especially as
it's currently only used once.

Change-Id: I0fd81cadccc077dbf957302f9f41409c5a1f4f20
2022-02-03 16:37:52 +00:00
Andrew Kostka 2e7d4dabd1 Fix positioning of the "add parameter" button on mobile
Bug: T292749
Change-Id: I8c73189fcb94541087c6d44fbe7a82d14f9c3483
2022-01-13 15:18:40 +01:00
jenkins-bot c92ea76af8 Merge "eslint: Enable no-jquery/no-append-html" 2021-12-17 16:42:42 +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 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
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
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
WMDE-Fisch 742aee7f9d Add link to undocumented parameter help
Bug: T284985
Change-Id: Ie5a61beed39aa3572c2a5e82dbc3711fdcd35ba8
2021-12-07 15:12:20 +01:00
Svantje Lilienthal a2afdee49f Remove suggested values message for custom inputs
Bug: T296915
Change-Id: Iecd90b02ea5bebceda1e87ddddb43fdb71b91d9e
2021-12-03 15:28:04 +00: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
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
Ed Sanders 86c405a2e1 Prefere ve.extendObject over $.extend
Change-Id: I37fef45701653cef08de9ec699865aa4fdf477bc
2021-11-15 21:30:19 +00:00
jenkins-bot 6484f8dad3 Merge "Rework all code using template type related conditions" 2021-10-25 08:55:32 +00:00
Svantje Lilienthal b2852f5cb5 Make text fields and related information accessible to screen readers
Bug: T291273
Change-Id: I0746bf42eee321a4c239dd56b2008610a0d21488
2021-10-22 13:49:41 +02:00
Thiemo Kreuz 29ef00fa29 Rework all code using template type related conditions
This is a more radical change, compared to the previous patch.
I will post more detailled explanations as comments on Gerrit.

Change-Id: I6909b3f0b2c153b7ee9995441e995ffa793eab40
2021-10-22 10:42:16 +00:00
Thiemo Kreuz 0a13fd9459 Use cheaper jQuery constructor for minor template param label
This is done for a lot of the elements in this class. They are trivial
jQuery elements instead of OOUI widgets. While we usually want to use
OOUI widgets, this is different in this case. Think of a template with
1000 parameters.

Bug: T291284
Change-Id: Ie1960ee706dca17aa4963c23a2e89c1cfff106f9
2021-10-21 15:55:13 +02:00
Thiemo Kreuz 1904698105 Move some logic into the TransclusionModel class
I moved some code around and found that quite a lot of code wants to
know:
* Is the length of this transclusion exactly 1?
* I need that 1st part.

There is more that can potentially moved from the dialog to the model.
But I don't want to make this patch to big.

Bug: T292371
Change-Id: Ia94ed0450d04dd97c4c41f5bf7c266f9a534e821
2021-10-06 16:00:18 +00:00
jenkins-bot 3f23cc79ee Merge "Add missing @fires documentation tags" 2021-09-30 16:35:02 +00:00
Thiemo Kreuz a625669380 Add missing @fires documentation tags
Change-Id: I0c9b2aa827a6806004480b642c23f320b190b6ab
2021-09-30 15:50:33 +00:00
Thiemo Kreuz 61df64d7ae Better method name for the parameter name validation update
It's not only used as an event handler, but called as an ordinary
method as well. Let the name reflect this better.

Change-Id: Ie5a0d9c4cd072063a164886f18d0859327b3f267
2021-09-27 18:24:20 +02:00
Thiemo Kreuz f68c1e3794 Add @private tags to template dialog related methods
… obviously only to methods that are meant to be private, i.e.
only called from within the class (and possibly tests).

Change-Id: I581558078dc7210abac5f5724f71316ac45745e6
2021-09-26 11:51:36 +02:00
jenkins-bot 228bf34ff7 Merge "Make up/down/remove buttons behave sane on …AddParameterPage" 2021-09-22 09:44:24 +00:00
Thiemo Kreuz 4ad151c13e Fix existing templates without TemplateData not showing a link
Bug: T290140
Change-Id: Ic6d5decbf3838868e8add1b860828a784dc8af3a
2021-09-22 08:58:27 +00:00
Thiemo Kreuz 224cc9ab12 Consolidate messages about missing/bad templates
This is mostly re-arranging existing code. Actual changes made:
* Remove the message that claims a template can't exist. We can't
  really know this.
* Instead show the message about "modifiers" in cases where curly
  braces and other wikitext syntax is involved.

Bug: T290140
Change-Id: I713d7f54cad2510f9a02c113600980cba8c3e58b
2021-09-22 10:12:16 +02:00
WMDE-Fisch 34cbc3f3b5 Use getTemplateDataQueryTitle to distinguish template title cases
The titles in the link cache do not include subst: anymore so to see
if these pages exist we need to use the same link title used in the
query.

Bug: T290140
Change-Id: I18de81e0bf46212c2199a948f7ca89182aa19eff
2021-09-21 12:47:02 +02:00