The Metrics.js script needs this, but the dependency is not specified
anywhere. This "accidentially" works because it's rather common that
the module is required by some other code on the page. I just found a
combination where this is not the case (a blank MediaWiki installation
with nothing but TemplateData, not even the WikiEditor).
Change-Id: I97a7c1d227316a222d7ca54adb400aa8dd769047
* This is most notably when adding a new parameter. The cursor should
start in the input field.
* Focus the first input field when editing a parameter, whatever that
input field is.
* Focus the big JSON editor when editing a map.
Change-Id: I5a3df626810007e83bd2300b540df75bc1b8cac4
There is sometimes a good reason to arrange code like this, especially
when the additional variable name acts as documentation and helps
explaining what's going on. I think this is not the case here.
Change-Id: I46f4a18a4f78f4b03cf063a226de3f43ba13b1a2
The short `|| defaultValue` pattern is very common in JavaScript.
Note that in JavaScript – in contrast to PHP – empty arrays and
objects are not considered "falsy".
Change-Id: I97935c4dc2276d48d53ade3f7b4fdc28b62d89ba
This was always comparing with the English description. The effect of
this was that the comparison was always false and the value always
set, even if it didn't change, resulting in unnecessary events being
fired. So this is only about performance but not really user facing.
Change-Id: Id7a46dbac81e2595478848bbf325eece21815bec
This patch includes two bugfixes:
1. The previous rule with a `p + p` didn't do what it was supposed to
do. It was adding a margin after the 2nd, 3rd and all following <p>
elements, but not between the 1st and the 2nd. It should have been
margin-top instead. The approach in this patch is different and
avoids the need to repead the 0.5em.
2. The red background color was not applied to the input fields any
more because OOUI doesn't use <input> elements any more.
Change-Id: Ia57b742e8b3cd29c1f55cd7e918f26f70eebab18
Some time ago there was a little bit of custom CSS applied to the HTML
table rendering. This is broken since patch I74214ea from 2016. This
patch renamed all CSS classes but forgot to update the PHP code
accordingly.
I decided to not change the HTML rendering because these class names
might already be used in custom per-wiki or per-user CSS. Instead I
partly revert I74214ea.
Unfortunately, some of the styles are quite dramatic, don't look good
or just don't work. I decided to remove some. The argument is that
the HTML rendering looks the same for 6 years now. I don't see a good
reason to change it now.
In detail:
* Suggested values are not aliases and should not be rendered in
gray.
* The message "no description" is rendered in gray and italics. But
this was applied to the wrong DOM element and made everything else
gray and italic as well.
* The color #777 is not readable, violating WCAG rules. While it's ok
to dim aliases and such, it must be at least #555 or darker.
* The "nowrap" destroys the table the moment one of the parameters
does have a longer name or alias. Let the browser handle this, as
it did for 6 years now.
* Same for rendering aliases as individual, indented blocks. This
makes the table unnecessarily big when there are many aliases, and
just doesn't look right. Again, let's stick to what we had for
6 years.
Change-Id: Idfa76eed6e2d68474c79d4674efce091cb031b66
It's required via the spec. We should act as if it's always there,
even when the actual "original data object" doesn't contain it.
Bug: T307331
Change-Id: I129b0c77e701df6ebbdc39432360cea8f10575e8
This only moves code around but doesn't change anything. The tests
should prove this. The only change is that validating if "inherits"
points to an existing parameter is now done a little earlier as part
of validateParameters().
Bug: T301337
Change-Id: I20865d8f93ea0f3cb1c0683804c7871056a700a8