Commit graph

1346 commits

Author SHA1 Message Date
Translation updater bot 4113f7bb4c
Localisation updates from https://translatewiki.net.
Change-Id: I3c0b6e40bf26f0c19f57901eb3d571dcff5e8add
2024-11-07 08:19:38 +01:00
Translation updater bot a3b6cd9bea
Localisation updates from https://translatewiki.net.
Change-Id: I00893c86060c4e2ce17510dbff33025895860425
2024-11-04 08:23:33 +01:00
Ammarpad 863391d7b8 Define remote extension path for dynamic RL modules
This path is needed for URL expansion in debug mode.

Bug: T378878
Change-Id: Ic7b067df2c03286575d0a390d90d6d2d4b3169e5
2024-11-03 19:24:46 +01:00
libraryupgrader 011e252439 build: Updating mediawiki/mediawiki-codesniffer to 45.0.0
Change-Id: I63b74cc5c7f5b9512d94e8f166b1c2c309bdd067
2024-11-03 06:34:24 +00:00
Translation updater bot b3741ac9cf
Localisation updates from https://translatewiki.net.
Change-Id: I556b49276bd84987124328b2a1381550c99cd7c6
2024-11-01 08:36:39 +01:00
jenkins-bot 02203d171c Merge "links: show links in live previews and preserve fragments in links" 2024-10-29 15:51:23 +00:00
Translation updater bot 4c2104ae93
Localisation updates from https://translatewiki.net.
Change-Id: Ie1dfb156be110d3ec851d4ecf786f9a051541203
2024-10-28 08:24:23 +01:00
Translation updater bot 9158d4d13b
Localisation updates from https://translatewiki.net.
Change-Id: I9511a1d5265a81b1244d62b3d35e3aa2a51b805b
2024-10-25 09:52:32 +02:00
Translation updater bot 8b2f3c793a
Localisation updates from https://translatewiki.net.
Change-Id: Ia30e46bdf6acd52fb946e72a6e60ce2e33f037b0
2024-10-21 09:20:56 +02:00
Umherirrender 63fbfa541e Use namespaced classes
Changes to the use statements done automatically via script
Addition of missing use statement done manually

Change-Id: Iede38f051529229fce7660dce7d0dba64724ee8a
2024-10-20 11:56:25 +02:00
jenkins-bot ea888d62df Merge "Parsoid DOM compatibility for links and copy buttons" 2024-10-18 23:55:54 +00:00
Translation updater bot eeaef48f9b
Localisation updates from https://translatewiki.net.
Change-Id: I0e8a026a52c578422d864e382e1287ae18f86c2e
2024-10-17 09:22:42 +02:00
Ammarpad fea9546eb1 pygments.links.js: Handle empty wikilinks and pipe trick
Skip empty wikilink `[[]]` and reverse pipe trick `[[|foo]]` where valid
and correct title cannot be generated respectively.

Bug: T368166
Change-Id: I5df409c8aa104d93a62cd5c0dbd671d598b7c79e
2024-10-15 16:46:37 +01:00
Siddharth VP e1a747987f links: show links in live previews and preserve fragments in links
* Use wikipage.content hook event so that links are also applied on
content added through JS tools like live preview, real time preview,
DiscussionTools, etc. (Consider checking the diff with whitespaces
ignored.)
* Preserve fragments (anchors) in links by using mw.Title getUrl().

Bug: T368166
Change-Id: Ib3a4d03abf7401c39bc3261ca2056cce482edb13
2024-10-13 02:05:02 +05:30
Siddharth VP d9f5c2a60e Parsoid DOM compatibility for links and copy buttons
Change-Id: Ib3d30ba38753a060772029379675a5552c9631af
2024-10-12 22:57:59 +05:30
jenkins-bot 73f8f3ef71 Merge "Fix styling for code blocks with copy buttons next to floated content" 2024-10-11 15:31:47 +00:00
Siddharth VP f455864c7b links: fix JS error due to a missing non-null check
Causing a console error on a COBOL code block on
https://en.wikipedia.org/wiki/Visual_FoxPro.

The optional chaining operator should ideally be used here, too bad
it's ES2020.

Bug: T376958
Change-Id: Id4c604e4897d83cb51218e785db9f553b3f32fda
2024-10-11 17:52:14 +05:30
Translation updater bot 7dac7163cc
Localisation updates from https://translatewiki.net.
Change-Id: I9592dfd054c17cf0520ac4deec832153d0fca628
2024-10-10 09:22:22 +02:00
Bartosz Dziewoński 006e6c6f0f Fix styling for code blocks with copy buttons next to floated content
Make the wrapper div for code block create a block formatting
context. This changes how floated content is laid out: previously
the wrapper was taking 100% width and tried to wrap text around the
floated content, now its width is limited by the width of floated
content. This way absolutely positioned elements inside the code
block (like the copy buttons) won't overlap the floated content.
We've had this problem before when adding line numbers (T272853),
and the workaround we used there won't work for the copy buttons.
It also lets us remove the background-color override, previously
needed to avoid it leaking outside the code block (T126010).

Bug: T40932
Change-Id: I7f51ea78d7fcf07358c6ee45275b2bae2e1cbeb8
2024-10-09 21:48:52 +02:00
Translation updater bot 5cd66a9030
Localisation updates from https://translatewiki.net.
Change-Id: I5123a4e7a08693697b12bb9cd5c1f7a0a8dd488e
2024-10-08 09:45:02 +02:00
Translation updater bot 5f10b6bb35
Localisation updates from https://translatewiki.net.
Change-Id: I012ee0821475e1b0c3b700f933c159fe47689b3f
2024-10-07 09:26:52 +02:00
Translation updater bot 673ba809ec
Localisation updates from https://translatewiki.net.
Change-Id: I20c1075f235a317203fcc304f045d797c02bed36
2024-10-04 09:21:53 +02:00
Translation updater bot c1ee3d7dda
Localisation updates from https://translatewiki.net.
Change-Id: Ib711bbef3624489358eb8c15d30afa96e44f8696
2024-10-03 09:17:25 +02:00
Translation updater bot 3259da5e2c
Localisation updates from https://translatewiki.net.
Change-Id: I5f6157f8d43ad66dcd1d2df609c5ab48fbfe54a1
2024-10-02 09:24:47 +02:00
Translation updater bot cf161ac21b
Localisation updates from https://translatewiki.net.
Change-Id: I484960d61f616e7744ad4593146fdba075271e12
2024-10-01 09:38:28 +02:00
Siddharth VP e45a7eac30 Avoid PHP_EOL while generating CSS
Change-Id: I242abd8fe68fd08ddb3c6358aa88b6f3d382823b
2024-09-30 22:43:05 +05:30
Translation updater bot b32859f705
Localisation updates from https://translatewiki.net.
Change-Id: I950889f10b722cdf7fffb60396516ffcb8216a7c
2024-09-30 09:21:59 +02:00
jenkins-bot e8d00cc402 Merge "Make line numbering appear dark in dark mode" 2024-09-29 17:01:57 +00:00
jenkins-bot 21a2d96102 Merge "copy: Make use of Less nesting features" 2024-09-29 16:37:47 +00:00
Taavi Väänänen 66622c60a5
Make line numbering appear dark in dark mode
This includes some changes to the colors in light mode to make them
match Codex tokens.

Bug: T365926
Change-Id: Ifa5d762bffa3c4ebdcfa451cc4a9965cd7b1b064
2024-09-29 14:39:10 +03:00
Taavi Väänänen 5a748da27c
copy: Make use of Less nesting features
Change-Id: Ieb38d425a29baaa95188f553959dc21b9cd31b7b
2024-09-29 14:26:22 +03:00
Siddharth VP b8dd28343c Support dark mode for code blocks
Update the CSS generation script to generate styles for both light and
dark modes. The Pygments style 'default' is used for light mode, as
before, and 'monokai' for dark mode.

Bug: T365926
Change-Id: I0cc1f9a10d4ff8e0c279a12cacbb1c300225328f
2024-09-28 23:06:30 +05:30
Siddharth VP 38cbb6fed6 copy button: use Codex colors for dark mode compatibility
Bug: T40932
Change-Id: I9a809954f64c6d3a14cc3e2b3c2fd38824f803f3
2024-09-28 23:06:30 +05:30
jenkins-bot f4f8f00210 Merge "Add structure test to verify contents of pygments.generated.css" 2024-09-28 17:17:19 +00:00
jenkins-bot e02476e0d2 Merge "Link page references in Scribunto modules" 2024-09-28 17:17:17 +00:00
Siddharth VP c82db2de3e Add structure test to verify contents of pygments.generated.css
Verify that running Pygmentize::fetchGeneratedCss() (which gets invoked
from the updateCss.php maintenance script) gives CSS that matches the
generated file pygments.generated.css.

Change-Id: I454f287cb461b596178ee47c44634e2e127fe576
2024-09-28 21:59:47 +05:30
jenkins-bot e259797d98 Merge "modules: Remove width limit for code block with copy button" 2024-09-27 15:49:38 +00:00
Translation updater bot ca7fc85885
Localisation updates from https://translatewiki.net.
Change-Id: Ia662ccb23cc9eb2e9b7bb66581ea0aa2144ec0f2
2024-09-27 09:19:43 +02:00
Ammarpad ba35957b9b ode-link: Fix link for URLs without protocol
Prepend '//' to relative URLs to turn them to real new (root)
addresses instead of relative paths in current domain

Bug: T368166
Follow-up: I999937c1f6303ecc64adb6285e73a9ce10f67bd8
Change-Id: I2cf901c7b0454517dc93ea8113dcf69832584c08
2024-09-26 20:03:22 +01:00
Ammarpad e4684a751c modules: Remove width limit for code block with copy button
Enabling copy button should not affect block width.

Bug: T40932
Follow-up: Ic8ef030514c3b6dd2cb9b137f032588869ab3762
Change-Id: I47475fa5e974eb999386bd612e16898ebfbd3046
2024-09-26 17:47:50 +00:00
Translation updater bot 0159930cdd
Localisation updates from https://translatewiki.net.
Change-Id: I97ab3dbeb15021ee1796e97a9b417f484c3c8bf5
2024-09-26 09:20:34 +02:00
Translation updater bot d572751d2a
Localisation updates from https://translatewiki.net.
Change-Id: I7b91c2e90659b5be6ac17f3b519a8aadb9bd177d
2024-09-25 09:18:44 +02:00
jenkins-bot 4577cbe62f Merge "Fix bugs in link generation" 2024-09-24 23:33:22 +00:00
Siddharth VP 4c9ed25619 Link page references in Scribunto modules
In Scribunto modules, link page names used in require(), mw.loadData()
and mw.loadJsonData() invocations.

Inspired from the CodeLinks gadget[0] but rewritten for brevity,
avoiding Wiktionary specific code, making the code more generic,
and thereby adding support for mw.loadJsonData().

[0]: https://en.wiktionary.org/wiki/MediaWiki:Gadget-CodeLinks.js

Bug: T368166
Change-Id: Idc554269ee52a05660fa41f065a2b3c73e2e1b9b
2024-09-24 22:47:56 +05:30
jenkins-bot e58d391b91 Merge "Implement copy buttons for code blocks" 2024-09-24 13:10:37 +00:00
Siddharth VP 341cd2bc37 Fix bugs in link generation
* Use mw.Title so that template links work for templates outside
template namespace, and so that titles are normalized.
* Use recursion instead of while loop so that both the segments before
and after the inserted link are searched for further linking
possibilities. Among other cases, this fixes the case where a template
link before a wikilink (on the same line) was not working. This also
avoids infinite iteration if mw.Title.newFromText() failed to create a
valid Title object.

Bug: T368166
Bug: T374693
Change-Id: I4d485340928b81df26ca035874422fdb5930710f
2024-09-15 11:57:26 +05:30
Siddharth VP 55630cc5ea Implement copy buttons for code blocks
<syntaxhighlight> blocks with a boolean "copy" param will now have a
button next to them for copying the code to the clipboard. Not
applicable for inline code blocks.

Adapted from the mediawiki.org gadget written by Krinkle.

Bug: T40932
Change-Id: Ic8ef030514c3b6dd2cb9b137f032588869ab3762
2024-09-11 01:31:14 +05:30
Siddharth VP 16538948ae Fix accidental use of IIFE
The function was being invoked immediately instead of as the jQuery
ready callback.

Change-Id: I08c5a5dad6652a598a2b4a6bed196ab18bee452a
2024-09-11 00:11:59 +05:30
jenkins-bot f2d0dde88c Merge "Enable clicking on wikilinks and external links in highlighted code" 2024-09-09 13:29:52 +00:00
jenkins-bot 3ff590922e Merge "Fix forced light mode background-color applied to the wrong element" 2024-09-09 13:18:01 +00:00