Commit graph

2525 commits

Author SHA1 Message Date
Ed Sanders 0c0dcbdcd8 build: Update eslint-config-wikimedia to 0.10.0
Change-Id: Iba24172bd492750b268d0afbeeaf84b12cca3e0b
2019-01-08 23:06:43 +00:00
Translation updater bot 9113267ab0 Localisation updates from https://translatewiki.net.
Change-Id: I82c56e9d26ce32015efaebf803cb31b93e1f3fa2
2019-01-08 22:29:29 +01:00
Translation updater bot 686006e44f Localisation updates from https://translatewiki.net.
Change-Id: I05fd70901a5783c8bf3bef7f0f319128cdbd0a1d
2019-01-05 22:33:37 +01:00
jenkins-bot 6a51ea98b3 Merge "ve.ui.MWCitationDialog: Unbreak the logic to enable/disable actions" 2019-01-03 18:41:09 +00:00
Subramanya Sastry c23cd59a53 Sync up with Parsoid citeParserTests.txt
This now aligns with Parsoid commit 2c0770eb3b441800b74651cf415de1edf29a5a5e

Change-Id: I0a28bbe9db3a7b8d09c14a2e6c1ad0d94c1591f6
2019-01-02 11:31:42 -06:00
Translation updater bot 7750d59dc0 Localisation updates from https://translatewiki.net.
Change-Id: If1bd77d24bfe7d26949cf88b173b82387900a40f
2019-01-01 22:20:21 +01:00
Translation updater bot 9b59a7d155 Localisation updates from https://translatewiki.net.
Change-Id: I231f1d6af08194f58aefa8f36206c431ca2cbf91
2018-12-27 09:50:54 +01:00
Krinkle ee38d4014c Merge "Fix test for img decoding="async"" 2018-12-21 21:46:09 +00:00
Gilles Dubuc ad559d4add Fix test for img decoding="async"
Bug: T212124
Depends-On: I79de6f3b0ec5529881525d32925519b47fed5311
Change-Id: I9bd9e24453838130eeb221c2f09961e1c4c15938
2018-12-20 13:42:30 +01:00
Translation updater bot 22acd9a29c Localisation updates from https://translatewiki.net.
Change-Id: Icc162281f1ddec0369b8447b3c10f0cd84df4205
2018-12-18 22:48:09 +01:00
Kunal Mehta 0395035789 build: Set "root": true, in .eslintrc.json
This ensures that each repository's "npm test" command is fully
independent of wherever it might be in the filesystem.

Bug: T206485
Change-Id: I54d052bed4ceed175a938896154fd6ad5c89f964
2018-12-18 10:47:31 +00:00
Translation updater bot cfb8412e11 Localisation updates from https://translatewiki.net.
Change-Id: I3f4d7fd126b48e103bce03b104db51edcccbd569
2018-12-15 22:23:48 +01:00
Translation updater bot 87c2b3ded4 Localisation updates from https://translatewiki.net.
Change-Id: Ia71b6012942934a135547e787ad9c74ae37f7563
2018-12-14 22:21:37 +01:00
jenkins-bot 4eef765808 Merge "Restructure highlighting code for improved readability" 2018-12-13 00:04:21 +00:00
Translation updater bot 0dca8d7428 Localisation updates from https://translatewiki.net.
Change-Id: Ieea1e84f17cf47832f8c83dcd802b94293ace8ee
2018-12-12 22:18:26 +01:00
Translation updater bot 075d391ace Localisation updates from https://translatewiki.net.
Change-Id: I84b3d49b0e3c7cb7edeb62096427e6c3bc13cedb
2018-12-11 22:39:36 +01:00
Thiemo Kreuz 3f22189998 Fix <ref> ignoring all parameters when there are more than two
We can resolve this bug by either replacing the bogus "return false"
with the intended "return [ false, … ]". Or rely on the code a few
lines below that also bails out with a "return [ false, … ]" when to
many parameters ($cnt is not 0 then) are present. The tests prove both
solutions are equally valid.

Bug: T211576
Change-Id: Iadd55c134dede7042cfd152c69bc8f27b59d8912
2018-12-11 20:49:40 +01:00
jenkins-bot b9783b1d17 Merge "Rewrite private Cite::refArg for readability" 2018-12-11 18:43:49 +00:00
jenkins-bot 1ee256aa76 Merge "Add "twice" instead of "2 times" in an English message" 2018-12-11 17:32:45 +00:00
Thiemo Kreuz (WMDE) 06b821a451 Rewrite private Cite::refArg for readability
The biggest issue with this code was that it was tracking the exact
same state in two ways: Processed array elements got removed from the
$argv array, *and* the $cnt was decremented the same time. This is not
necessary and a potential source of confusion and errors.

I carefully transformed the code. I'm sure it still does exactly what
it did before. The tests should prove this.

Change-Id: I642d38e7944aa3e2239179fa58e1e231b4698263
2018-12-11 17:58:19 +01:00
Thiemo Kreuz e32a76061c Restructure highlighting code for improved readability
This gives the code a little more structure without changing anything
it does. A section is extracted as a named function, and some lines
are moved and bundled where it made sense.

Change-Id: I51909517021bee9dc618efe5fbe40adfc29dc6af
2018-12-11 15:19:17 +01:00
jenkins-bot 9e981d28b6 Merge "Sanitize underscores as core does, to not create broken links" 2018-12-11 00:01:57 +00:00
jenkins-bot c4dc31b89e Merge "Add missing test cases for code in Cite::refArg" 2018-12-10 18:18:00 +00:00
Thiemo Kreuz 9a8c718c2a Add missing test cases for code in Cite::refArg
This is split from I642d38e and does nothing but adding test cases
that document the current (broken) behavior.

Bug: T211576
Change-Id: Iee313d26e7bed6deb34101e37736a1c697947905
2018-12-10 12:54:58 +01:00
Volker E b9ee8433f4 build: Update 'stylelint-config-wikimedia' to v0.5.0 and make pass
Change-Id: I05e257b3213dd4039455d7e55efeb72b58da67fb
2018-12-10 02:59:11 -08:00
Amir Aharoni af28eed881 Add "twice" instead of "2 times" in an English message
Change-Id: I53de963d71015dfd26692241b2a0ea5630be080c
2018-12-10 08:52:36 +02:00
Translation updater bot 626d8a75df Localisation updates from https://translatewiki.net.
Change-Id: I5a8df261ae60ded18ca4709af624aa4fa4bc4a72
2018-12-09 22:38:53 +01:00
Translation updater bot 004426b354 Localisation updates from https://translatewiki.net.
Change-Id: Ia52c3a211395f620147f63b9fae7f1781bb52719
2018-12-05 22:30:13 +01:00
Translation updater bot ad5fd43df9 Localisation updates from https://translatewiki.net.
Change-Id: Iafe3fa40062305c4dd0d8353bbe05896cb2f15e5
2018-12-03 22:35:12 +01:00
Translation updater bot 7a969c2dbc Localisation updates from https://translatewiki.net.
Change-Id: Ibe63f4543e5bacb89808be7f04d76ce2f76bcb06
2018-12-02 22:14:54 +01:00
Translation updater bot af9e6cb510 Localisation updates from https://translatewiki.net.
Change-Id: I8e590da0866f6ba21c58073ea436194e4539b2e8
2018-12-01 22:17:29 +01:00
jenkins-bot c6e13db74f Merge "Simplify weirdly complex [\n\t ] regex" 2018-11-30 23:50:55 +00:00
jenkins-bot 7ac91bef82 Merge "ve.ui.MWCitationDialog: Remove unneeded code re-setting insert label" 2018-11-30 22:42:44 +00:00
Translation updater bot 519157719b Localisation updates from https://translatewiki.net.
Change-Id: Iad5a14d487e2561133c7f9d0684de1955c247ee9
2018-11-30 22:49:44 +01:00
jenkins-bot e7b3167b31 Merge "Split overly long highlighting code into functions" 2018-11-30 15:00:09 +00:00
jenkins-bot 8ae3b13d1a Merge "Get rid of one nesting level in highlighting code" 2018-11-30 14:58:49 +00:00
jenkins-bot e353d36f3a Merge "Make backlink highlighting robust when "mw-cite-backlink" is missing" 2018-11-30 14:58:46 +00:00
Thiemo Kreuz 4d03f8f17f Split overly long highlighting code into functions
Change-Id: I055c21ee2202afea4751dd74fa389c55fdd30acf
2018-11-30 15:03:02 +01:00
Thiemo Kreuz 9ce4b959bc Get rid of one nesting level in highlighting code
The code before was not wrong, just deeply nested. The worst case was
that the final $upArrowLink.attr( … ) might have been called on zero
elements. jQuery is fine with this.

Change-Id: I62e7286c7fe906544fe148e1122c60cc8db070f3
2018-11-30 14:49:27 +01:00
Bartosz Dziewoński adc64b3002 ve.ui.MWCitationDialog: Unbreak the logic to enable/disable actions
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
2018-11-29 22:39:55 +00:00
Bartosz Dziewoński b7bdcaeccc ve.ui.MWCitationDialog: Remove unneeded code re-setting insert label
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
2018-11-29 23:09:23 +01:00
Translation updater bot c31c93f619 Localisation updates from https://translatewiki.net.
Change-Id: I58dfd99dd04e0d78298df7ad51286ba252019142
2018-11-29 22:26:44 +01:00
Bartosz Dziewoński 7f6ae77b3c ve.ui.MWCitationDialog: Fix condition for enabling insert/apply action
The method #hasUsefulParameter has been accidentally made to always
return false in fdde5b71af.

Bug: T210686
Change-Id: I215924c2f693842abd8026404d17c725192272c3
2018-11-29 04:02:44 +00:00
James D. Forrester 57aeb852ae eslint: Drop 'dot-notation' rule
Bug: T210552
Change-Id: Ia6bacf9aacd0167317cbd7d8348be1c2005b6562
2018-11-28 10:27:44 -08:00
Thiemo Kreuz 4152c6cdf4 Make backlink highlighting robust when "mw-cite-backlink" is missing
The class="mw-cite-backlink" is part of a message. It should be
considered code and not be customized, but can be. Frwiki for example
localized it.

The new code still hopes to find the class, and still hopes the first
child is the text node containing the plain text up arrow. (See the
message "cite_references_link_many" which contains all this.) This code
path is kept because it is more performant.

If the class is not found, the upwards traversal done via .closest()
stops at the <li>. It then traverses down into the firstChild nodes,
hoping to find the plain text up arrow this way.

This patch makes the code work with the customizations found in frwiki.

Bug: T205270
Bug: T210508
Change-Id: I32552ebe820ee12aea1a75aa17af11298dc7536a
2018-11-28 12:35:05 +01:00
jenkins-bot c88275c8d5 Merge "Make backlink highlighting robust for community customized HTML" 2018-11-28 11:34:32 +00:00
Thiemo Kreuz d7c1943b04 Make backlink highlighting robust for community customized HTML
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
2018-11-28 11:56:27 +01:00
Ed Sanders fdde5b71af Update eslint-config-wikimedia to 0.9.0
Change-Id: I7883af1f56c7f2f3eeff1f7a51b640a303bcab78
2018-11-27 22:23:57 +00:00
Translation updater bot 8991801975 Localisation updates from https://translatewiki.net.
Change-Id: If5195d61ed2642c4182de62f4ef12bc8b33a893c
2018-11-27 22:14:30 +01:00
WMDE-Fisch 6dda36a1e7 Improve a11y support on backlinks
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
2018-11-26 11:36:26 +01:00