Commit graph

1332 commits

Author SHA1 Message Date
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
Translation updater bot 57278f4509
Localisation updates from https://translatewiki.net.
Change-Id: I912e0272c518e2f27d168d3d1feb52c355f6f6fe
2024-09-09 09:23:12 +02:00
libraryupgrader 906294c858 build: Updating micromatch to 4.0.8
* https://github.com/advisories/GHSA-952p-6rrq-rcjv

Change-Id: Ie0006a39f08052ba94540ff30c8f8b0b166636b5
2024-08-31 07:52:05 +00:00
Bartosz Dziewoński 91f3235ed9 Fix forced light mode background-color applied to the wrong element
Changes for T356956 applied the styles in the wrong place.

`<div class="mw-highlight">` should have no background (and we need
to override the default Pygments styles that add it).

`<div class="mw-highlight"><pre>` and `<code class="mw-highlight">`
should have background (and we need to override core MediaWiki styles
that adapt to light/dark mode with forced light mode colors).

Bug: T365927
Change-Id: I473203b12673f7bc004f953ab33fe36fb897e095
2024-08-29 20:43:40 +02:00
Translation updater bot a8a6329362
Localisation updates from https://translatewiki.net.
Change-Id: I671f4de40302014c0df83d320ed09a25344be024
2024-08-28 09:40:23 +02:00
James D. Forrester d39e6b3a76 build: Update MediaWiki requirement to 1.43
All extensions in the MediaWiki tarball are expected to track MediaWiki's release directly.

Change-Id: I6866c9075b425e2fd83feff6b1af1271a736528c
2024-08-22 18:28:23 -04:00
Translation updater bot 603db26e10
Localisation updates from https://translatewiki.net.
Change-Id: I7ba935fe2bc28152ab72494ab5c4811eeaced186
2024-08-19 09:25:22 +02:00
libraryupgrader 0bfdeec707 build: Updating mediawiki/mediawiki-codesniffer to 44.0.0
The following sniffs now pass and were enabled:
* MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic
* MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationProtected

Change-Id: I90829d944447688b0e8ed20a89b5bdfddaea392b
2024-08-13 06:30:06 +00:00
Fomafix b58d0bded1 Use MainConfig instead of global variables
Also use MainConfigNames.

Change-Id: I5b61c2badd2aa2163cbc429003a890bf559dc4f6
2024-08-12 21:06:29 +00:00
Fomafix 173e215bde Use overrideConfigValues instead of setMwGlobals
Also use MainConfigNames.

Change-Id: Ic51c376be4642eecbeb29d2ec2d2b2de388c2f61
2024-08-05 18:34:51 +00:00
Translation updater bot c1c5c68f52
Localisation updates from https://translatewiki.net.
Change-Id: Ie71bad428dc48414bda06f2b7d2a5750634832b4
2024-08-02 09:40:59 +02:00
Translation updater bot de56f35c4d
Localisation updates from https://translatewiki.net.
Change-Id: I9945becb44e59cab2d7155fd4f9fbd781bbcf6b5
2024-07-30 09:44:33 +02:00
Translation updater bot 41d2c6e605
Localisation updates from https://translatewiki.net.
Change-Id: I9d36eba6fe2d7c16e0cbf348c888df14f6b5a2f6
2024-07-29 09:28:37 +02:00
Translation updater bot 6fa111de51
Localisation updates from https://translatewiki.net.
Change-Id: Ie993d9d55d0410b7c29ff716af1899a867d92fcb
2024-07-26 09:46:55 +02:00
Translation updater bot 79331f6677
Localisation updates from https://translatewiki.net.
Change-Id: Ib557d34447aa245abcf13ce60aa91e7f4519ccef
2024-07-19 09:41:56 +02:00