This code was written in 2014 and it seems that some change to
ve.ui.MWTemplateDialog since then made it not work. No idea why or
when it broke. But we can implement the functionality much more easily
now by overriding #setApplicableStatus, which works correctly.
Bug: T210796
Change-Id: I6e87ca979a96785fc74f1a57f7d80ba4b43705f2
This sets the label to be the same as the default value inherited from
ve.ui.MWTemplateDialog. Looks like it's no longer needed since change
Ia8fb88d3501ffa2c26add4419da5463a926f45d1 in VE-MW (2014).
Change-Id: Icd64d22aef29a3791352e1839993ea8462a147f3
The method #hasUsefulParameter has been accidentally made to always
return false in fdde5b71af.
Bug: T210686
Change-Id: I215924c2f693842abd8026404d17c725192272c3
This change makes the code much, much more robust. See, almost all HTML
relevant for this feature is encoded in messages. This allows unexpected
customizations that add additional HTML elements, change the order of DOM
elements, even remove class names and elements.
The <ol class="references"> is the only HTML snippet generated via code,
guaranteed to be there, and used as an entry point because of this.
Instead of the selector utilizing a "*" to detect references with "one"
vs. "many" backlinks, we check if a second backlink exists.
The .first() copies the browsers behavior to only respect the first anchor
in case an id="…" appears multiple times on a page.
The additional .length check further down is a missing sanity check,
currently relevant on frwiki where the expected class="mw-cite-backlink"
got localized.
Bug: T205270
Bug: T210520
Change-Id: Iba9aebfd01508b283933964cfb986d7239d4cf38
This changes the a11y support on the main backlinks by introducing the usage
of title and aria-labels. The support for these elements increased a lot since
the topic was first tackled and seems the appropriate way to go.
A new message was introduced for the link that will be set when directly
coming from a clicked refrence to emphasize that the can jump back to where
he came from.
Bug: T206323
Change-Id: Ifa56d41bcdb8100e19f29619796b62bb3c886d2f
The two message are not needed in case there is only one element.
Since fetching messages is a little expensive, I feel it's worth
rearranging this code.
Or not, because it seems this method is never called with one
element only.
Change-Id: Ie915278b41f053afe0d14a29d2aec54c98e5185e
This also includes putting the backling tests in their
own file due to the common setup needed.
Bug: T205271
Change-Id: Ica98c31bf0fddde9eb80f9c53b3dc089cb60e30c
I tried to arrange the new code in a way that it is compact, but still
readable. I think it's possible to arrange it even better, but browser
tests should be added first, in my opinion.
Bug: T205271
Change-Id: I1d579ef9d2787fc43c0a8bbf61c583f602dca5d4
This adds a test which checks if the extension appears on the
Special:Version page.
This is an initial step for adding more browser tests to check
changes done in I26fe41c328157233cc5b06d38d2ba0f7b036a853
Change-Id: I9a9d1cd2a25277f2c430f4e80b51b72c1621f91b
The separate "ext.cite.a11y" module is kept for (temporary)
compatibility with cached HTML, and should be removed in about
a month.
Browser tests will be added in a separate patch.
Bug: T205270
Change-Id: I26fe41c328157233cc5b06d38d2ba0f7b036a853
The iodea is to make the code simpler and easier to read. If no
code uses this feature, all it does is making the code unnecessary
complex.
Change-Id: I22747712a691443a29b57831d3a6926275ad986b