Commit graph

1253 commits

Author SHA1 Message Date
Adam Wight 8d0202a664 Minor logic cleanup
This didn't mean what it looked like: `||` has higher priority, so an
undefined elem would not result in an empty string.

Change-Id: I1e361842f060815b04802a1ab8f077faa1a8bc6b
2024-02-29 12:12:56 +00:00
Adam Wight 73c90a0e7d Clean up and fix some jsdoc annotations
Some of the annotations were used in a way that confused jsdoc.  This
cleans up redundant annotations and uses more canonical tags.

These changes cause all classes to now appear in the generated pages.

Includes linking to external docs.

Bug: T358641
Change-Id: Iaee1dadcc19a70c27839d0d27dfa6a07a70fb46b
2024-02-29 13:05:42 +01:00
jenkins-bot 5bad2b183f Merge "Revert "Avoid creating a MWReferenceModel if not needed"" 2024-02-16 08:30:13 +00:00
DLynch 6bc1ae4146 Revert "Avoid creating a MWReferenceModel if not needed"
This reverts commit 74f66bc478.

Reason for revert: this broke reference reuse from Citoid

Change-Id: I86efea4945c1795dbfd61f4e020d78ca81a6f4d1
2024-02-16 03:54:34 +00:00
Translation updater bot 11591f72cd Localisation updates from https://translatewiki.net.
Change-Id: I6fa8273a3bb51c75ec72e928d78d00a0ed66e137
2024-02-14 08:18:28 +01:00
jenkins-bot 882f3e5ee7 Merge "Revert "Accessors to find MWReferenceNode in the document"" 2024-02-13 14:51:09 +00:00
Esanders f7c8b63ed1 Revert "Accessors to find MWReferenceNode in the document"
This reverts commit 0566a495f3.

Reason for revert: Merged too soon, while discussion of the whole
approach is still ongoing.

Change-Id: I2d3d6455cd4ea12067e2020f6b41cfbb4672bbb5
2024-02-13 12:57:02 +00:00
jenkins-bot 49e3ab6595 Merge "Accessors to find MWReferenceNode in the document" 2024-02-12 15:55:17 +00:00
Translation updater bot a68be1ceda Localisation updates from https://translatewiki.net.
Change-Id: I65f69dd188a5745c2161492029dcac902a76bce9
2024-02-12 14:49:05 +01:00
Adam Wight 0566a495f3 Accessors to find MWReferenceNode in the document
These are provides as a replacement for internalList indexes.

Bug: T336417
Change-Id: Ifd3a1b667369074e2cefa4d70e4c090e91b010b5
2024-02-09 15:37:27 +01:00
Adam Wight 74f66bc478 Avoid creating a MWReferenceModel if not needed
It's fine to copy attributes directly from the reference node rather
than go through the specialized model object.

Bug: T336417
Change-Id: Idaca192137dc762ddced2ee8446a7d838f97e317
2024-02-07 15:24:12 +01:00
Translation updater bot 8333e70453 Localisation updates from https://translatewiki.net.
Change-Id: Ic325aea9e6f28d870f3bfe5ad4962419723267ce
2024-02-01 09:01:15 +01:00
Adam Wight b0b628afd5 First tests for ve.dm.MWReferenceModel
Begin a QUnit test module for the reference model.  Tests demonstrate
that a new ref and a normal ref reuse from the full document both
behave as expected.

Bug: T336417
Change-Id: I1337806d41b50329ba971c8e68e1a62b52cc9a52
2024-01-31 13:52:40 +01:00
Translation updater bot f7d1ecb84b Localisation updates from https://translatewiki.net.
Change-Id: I4c21c3ea065de3e17672e19a7cb86907b4467d1c
2024-01-31 08:28:49 +01:00
Adam Wight 9535126304 [lint] Satisfy max-len rule
These changes mostly improve the code, and align the lint rules with
the MediaWiki base.

Change-Id: Ib4b0595fd9a9298039b8b44a0f1d4a9e90731527
2024-01-30 12:18:52 +01:00
Translation updater bot 723571b5d3 Localisation updates from https://translatewiki.net.
Change-Id: Ic56560791c1d93bde35617b594126fec2c578f9a
2024-01-28 16:05:40 +01:00
thiemowmde 16711d681b Group and nest stylesheets now they are .less files
Change-Id: Iedd9748cf9f38847ef4553459d533a67a0950645
2024-01-21 15:59:20 +01:00
thiemowmde 80c8eaf3ce Convert (almost) all .css files to .less
Intentionally no other change is made (yet). This is for a later,
separate patch.

Intentionally not touching the huge list of per-language
ext.cite.style.*.css files for the moment. Again, I would prefer to
do this in a separate patch.

Change-Id: I4e392c7bd1c69849a6c7946676a64c749ddbcd60
2024-01-21 15:39:08 +01:00
jenkins-bot 030e9a2a7e Merge "Fix event logging for the reference previews baseline" 2024-01-18 13:16:31 +00:00
Translation updater bot 2c84fbbc08 Localisation updates from https://translatewiki.net.
Change-Id: I34a16a2997cfad7578aa05a5704059a78c66b134
2024-01-18 09:24:42 +01:00
WMDE-Fisch b59eef1cfe Fix event logging for the reference previews baseline
The current tracking is wrong for several reasons. Mainly because
of a race condition if the Popups extension fininshed loading
before the Cite tracking script is executed. But further more
wgPopupsReferencePreviews was not a good choice to see if the user
sees previews or not.

The logging now uses the monoschema and only checks for enabled
previews when the click events are fired. The chances that Popups
finished initilizing then are much higher then. We still can see
if the init is not finished and the variable not set though.

Also we won't track the overall pageviews in here but use the
generic pageview_hourly from the data lake instead.

Bug: T353798
Depends-On: I1c434f0098ae23bd62256686a658e3d5ef7f70b9
Change-Id: I7a9524274efb58286f520c6148d5463bb0a78dbf
2024-01-17 13:11:17 +01:00
Translation updater bot 33f5611e1c Localisation updates from https://translatewiki.net.
Change-Id: If1cd1df28a06c68d35ee4b03e6ad3c9e7b01820a
2024-01-16 08:25:24 +01:00
Translation updater bot 7f71ada8f8 Localisation updates from https://translatewiki.net.
Change-Id: I14dfb64deb13f0113940b6e295fba232f941e2f6
2024-01-15 08:23:57 +01:00
Translation updater bot 9156975dae Localisation updates from https://translatewiki.net.
Change-Id: I0d9d5f9812c30d615bf8b150204ab5cab2d30858
2024-01-10 08:32:37 +01:00
thiemowmde ddda536792 Drop unused cite_reference(s)_link_prefix messages
Same as Icfa8215 where we removed the …_suffix messages.

This patch is not blocked on anything according to CodeSearch:
https://codesearch.wmcloud.org/search/?q=cite_references%3F_link_prefix

According to GlobalSearch there are 2 usages we need to talk about:
https://global-search.toolforge.org/?q=.&regex=1&namespaces=8&title=Cite.references%3F.link.prefix.*

zh.wiktionary replaces "cite_ref-" with "_ref-", and "cite_note-"
with "_note-", i.e. they did nothing but remove the word "cite". This
happened in 2006, with no explanation.

ka.wikibooks and ka.wikiquote replace "cite_note-" with "_შენიშვნა-",
which translates back to "_note-". One user did this in 2007,
16 seconds apart.

It appears like both are attempts to localize what can be localized,
no matter if it's really necessary or not.
https://zh.wiktionary.org/wiki/Special:Contributions/Shibo77?offset=20060510
https://ka.wikiquote.org/wiki/Special:Contributions/Trulala?offset=20070219
Note how one user experimented with an "a" in some of the edits to
see what effect the change might have, to imediatelly revert it.

The modifications don't really have an effect on anything, except on
the anchors in the resulting <a href="#_ref-5"> and <sup id="_ref-5">
HTML. It might also be briefly visible in the browser's address bar
when such a link is clicked. We can only assume the two users did this
to make the URL appear shorter (?). A discussion apparently never
happened. Bot users are inactive.

Both pieces of HTML are generated in the Cite code. Removing the
messages will change all places the same time. All links will
continue to work. The only possible effect is that hard-coded
weblinks to an individual reference will link to the top of the
article instead. But:
a) This is extremely unlikely to happen. There is no reason to link
   to a reference from outside of the article.
b) Such links are not guaranteed to work anyway as they can break
   for a multitude of other reasons, e.g. the <ref> being renamed,
   removed, or replaced.
c) Even if such a link breaks, it still links to the correct article.

There is also no on-wiki code on zh.wiktionary that would do anything
with the shortened prefix:
https://zh.wiktionary.org/w/index.php?search=insource%3A%2F_%28ref%7Cnote%29-%2F&title=Special%3A%E6%90%9C%E7%B4%A2&profile=advanced&fulltext=1&ns2=1&ns4=1&ns8=1&ns10=1&ns12=1&ns828=1&ns2300=1

I argue this is safe to remove, even without contacting the mentioned
communities first.

Bug: T321217
Change-Id: I160a119710dc35679dbdc2f39ddf453dbd5a5dfa
2024-01-04 13:17:42 +01:00
jenkins-bot 533869a8de Merge "Use 'html' instead of 'text' on headings in WikiEditor toolbar config" 2024-01-03 12:46:31 +00:00
Translation updater bot 086f5af8f8 Localisation updates from https://translatewiki.net.
Change-Id: I26541cfb187ee00cfee76e74d57ef702adcd8fed
2024-01-03 08:34:14 +01:00
Translation updater bot 07d75d4ebe Localisation updates from https://translatewiki.net.
Change-Id: Ie77f4c3e4e29cb1a67e40438443d4ad560404d7b
2024-01-02 08:48:22 +01:00
Translation updater bot 81502b4294 Localisation updates from https://translatewiki.net.
Change-Id: I540883ba46e78aaf77d20714bb3975ede2d676c3
2023-12-26 14:42:33 +01:00
Translation updater bot 12c414f4c4 Localisation updates from https://translatewiki.net.
Change-Id: Iaab9324e298b755d96678ac8868cbd98fc9d82f8
2023-12-22 17:45:28 +01:00
Fomafix 184fc92c3f Use 'html' instead of 'text' on headings in WikiEditor toolbar config
WikiEditor also uses 'html' instead of 'text' on headings. At the
moment both keys have the same behavior, but the original intended idea
is to have 'html' as already valid HTML (like on .parse()) and 'text'
on plain text which has to be escaped.

Change-Id: I1b4035a86ed56bfeb12d33b463d67099f7ae40e3
2023-12-22 13:29:39 +00:00
Translation updater bot 9b11e93bbe Localisation updates from https://translatewiki.net.
Change-Id: I04ba74f6fae07793f3a3180b204f3fbe89b16949
2023-12-21 19:45:01 +01:00
Translation updater bot e64d944194 Localisation updates from https://translatewiki.net.
Change-Id: Ice9b812492a0bce8ef003413a66501d9db1c75e2
2023-12-18 18:16:28 +01:00
WMDE-Fisch 2a02f5311d build: Update linter libs
* "eslint-config-wikimedia": "0.26.0"
* "grunt-eslint": "24.3.0"
* "grunt-stylelint": "0.19.0"
* "stylelint-config-wikimedia": "0.16.1"

Including auto fixes.

Change-Id: Iadacfc781a48675022144bb8c9489073d0bc19e3
2023-12-12 14:21:07 +01:00
thiemowmde 202c0d3636 Drop unused …_suffix and …_key_with_num messages
The three messages cite_reference_link_key_with_num,
cite_reference_link_suffix, and cite_references_link_suffix are not
used for anything.

According to CodeSearch:
https://codesearch.wmcloud.org/search/?i=1&q=cite_references?_link_(key|suffix)

According to GlobalSearch:
https://global-search.toolforge.org/?q=.&regex=1&namespaces=8&title=Cite.references?.link.(key|suffix).*
For comparison:
https://global-search.toolforge.org/?q=.&regex=1&namespaces=8&title=Cite.references?.link.prefix.*

They are not meant to be localized, as noted in qqq.json. As many
messages in Cite the idea is that individual wikis can customize the
generated HTML (!) via such messages. These particular ones apparently
have been introduced just because it's technically possible, but never
been used for anything. They exist since the very first commit from
2005: https://phabricator.wikimedia.org/rECITb714bf09

Note how these messages aren't even visible anywhere, except in the
browser's address bar as part of a #… fragment.

This obviously doesn't solve T321217 but helps minimizing the
surface.

Bug: T321217
Change-Id: Icfa82155e3b02df39bb6e924bc472f6edc565d5f
2023-12-08 09:26:05 +01:00
Translation updater bot d368264120 Localisation updates from https://translatewiki.net.
Change-Id: Icdbb6a0468db59a04887413a83afe7a90e02ea64
2023-12-05 09:14:17 +01:00
Translation updater bot c784c47de5 Localisation updates from https://translatewiki.net.
Change-Id: Ie8a88219eb6691d249af60195724a3ef428c5ef2
2023-12-04 09:03:37 +01:00
Translation updater bot 30607b4cf0 Localisation updates from https://translatewiki.net.
Change-Id: I840e39ba3d0fa4cc0687e148d865da0262373f12
2023-12-01 09:38:44 +01:00
Translation updater bot f8967415a8 Localisation updates from https://translatewiki.net.
Change-Id: I191f8a688ccf3b2085d9d993265f304da45d5085
2023-11-29 08:30:38 +01:00
Translation updater bot f8010df944 Localisation updates from https://translatewiki.net.
Change-Id: I981c304635cffc265ae0aed53db3829bc569471d
2023-11-27 08:31:55 +01:00
Translation updater bot c60d8d1f2f Localisation updates from https://translatewiki.net.
Change-Id: Ia43cb04dbac14774f8bad377c23f25b76fa93009
2023-11-23 11:55:51 +01:00
Translation updater bot eb2bd5ff15 Localisation updates from https://translatewiki.net.
Change-Id: I64d02118866e006a197e094f827696f3dc014573
2023-11-22 08:19:39 +01:00
Translation updater bot a56fc64d18 Localisation updates from https://translatewiki.net.
Change-Id: I9250b0f75e11df2b8ff685a8cb0a6fe22f2a2261
2023-11-20 08:50:57 +01:00
Translation updater bot 463e002854 Localisation updates from https://translatewiki.net.
Change-Id: Icb4e8c538d29fa667786df48b99ed3fa56fa0245
2023-11-17 08:52:12 +01:00
Translation updater bot f649124a7f Localisation updates from https://translatewiki.net.
Change-Id: I86b6ea8d3c0d85f4510dc71139c229b4fde5bf20
2023-11-16 09:08:57 +01:00
Translation updater bot 7ce0bb218c Localisation updates from https://translatewiki.net.
Change-Id: Idb7a47793b233425ecc0885910c9c2acdfd8a561
2023-11-15 15:43:23 +01:00
jenkins-bot 8ef6751c55 Merge "VE: Update group ordering when node is converted from placeholder" 2023-11-10 21:54:42 +00:00
Translation updater bot 483d5ad545 Localisation updates from https://translatewiki.net.
Change-Id: Ib733e398de88a624f11420d94bc1fbec444c83a1
2023-11-09 10:40:29 +01:00
Ed Sanders ada0820622 ve-cite: Remove unused messages for fake refernce headings
These were removed upstream in Iedc17c8ac9c.

Change-Id: Ic1240329de348a687db0373a9d247d3cd0780b46
2023-11-08 12:07:47 +00:00
Translation updater bot 2e006087fb Localisation updates from https://translatewiki.net.
Change-Id: I5520d02cb371d264d307fcf1e791b95d3123e131
2023-11-06 08:55:50 +01:00