Commit graph

1315 commits

Author SHA1 Message Date
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
Andrea Denisse Gómez-Martínez 0249ef7273 Migrate MediaWiki.syntaxhighlight_shell.*.rate to statslib
This patch migrates the `syntaxhighlight_shell` metric to the new Prometheus
format while copying the equivalent graphite counterpart to Graphite for
backwards compatibility with the existing Grafana dashboards.

Bug: T359270
Change-Id: I95bc2e749324092aae5db9135847c28aa16c64ea
2024-07-05 10:30:25 -06:00
Translation updater bot 70d0df0867
Localisation updates from https://translatewiki.net.
Change-Id: Ib4ebbe058df8b943147c1e37ca812e65d291b14a
2024-07-01 09:26:30 +02:00
Translation updater bot e3f230f6a4
Localisation updates from https://translatewiki.net.
Change-Id: Idc1ed49426b8c1aea103bce0cedc2a1507419669
2024-06-28 09:42:51 +02:00
Siddharth VP 7fa3abe91e Enable clicking on wikilinks and external links in highlighted code
It's common practise to use [[wikilink]] syntax to mention page names
in comments of JS/CSS/Scribunto code where the links ordinarily don't
work. Using JavaScript to actually make the syntax clickable makes
navigation easier.

{{Templates links}} and external links are also supported.

Bug: T368166
Change-Id: I999937c1f6303ecc64adb6285e73a9ce10f67bd8
2024-06-22 12:35:22 +05:30
libraryupgrader dbb735bda8 build: Updating npm dependencies
* eslint-config-wikimedia: 0.28.0 → 0.28.2
* grunt-stylelint: 0.20.0 → 0.20.1
* stylelint-config-wikimedia: 0.17.1 → 0.17.2

Change-Id: Ie72ab806709d12d2f143de7da9f019b4263498fd
2024-06-22 02:53:34 +00:00
Translation updater bot 69a8a31c0a
Localisation updates from https://translatewiki.net.
Change-Id: I42587706b1faa5f4950b1b92da837871d9a6cd50
2024-06-17 09:33:01 +02:00
Translation updater bot 4127ae3181
Localisation updates from https://translatewiki.net.
Change-Id: Icb85b207b548bbaa0116697d20a401d5dd4ab01f
2024-06-12 09:22:59 +02:00
Umherirrender 888aa0e373 Use namespaced classes
Changes to the use statements done automatically via script

Change-Id: Ifa5d93fd8c4b96fa22e6c4bbadc0e9c5315d7be1
2024-06-10 20:40:28 +02:00
libraryupgrader a3a2e5a060 build: Updating npm dependencies
* grunt-stylelint: 0.19.0 → 0.20.0
* stylelint-config-wikimedia: 0.16.1 → 0.17.1

Change-Id: Iee3227463ce4544d7a2ea7d3bf3b4fb0f3e77df9
2024-06-08 04:58:42 +00:00
Ed Sanders cd421a4b1d build: Update eslint-config-wikimedia to 0.28.0
Change-Id: Ia565bd4d314b7b512a46c4bb2af74784d5c2edc1
2024-06-06 16:33:02 +01:00
jenkins-bot 780b3baf13 Merge "JSDoc: @mixins -> @mixes" 2024-06-03 21:11:47 +00:00
Translation updater bot c4ce195386 Localisation updates from https://translatewiki.net.
Change-Id: I0891fa3810ca390e8778fc8ed4ae8ac488de1a83
2024-06-03 09:33:08 +02:00
Novem Linguae 859db0ef3d JSDoc: @mixins -> @mixes
Convert old JSDuck syntax to new JSDoc syntax

Bug: T366230
Change-Id: If1103a5945f6be02f9f6d81ec361e873e40d0192
2024-05-31 15:38:02 +00:00
Steven Rawson 8662badc21 SyntaxHighlight: Add color to override skin
Bug: T356956
Bug: T365774
Change-Id: I968aa7c9fe28ee83cb62dfd78575e426da5daf5e
2024-05-25 23:32:36 +00:00
jenkins-bot 4688fe720a Merge "Apply background to pre tags" 2024-05-20 19:25:47 +00:00
jenkins-bot ce65160b40 Merge "Pygmentize: report stderr when exit code != 0 and stdout is empty" 2024-05-20 13:31:10 +00:00
libraryupgrader 8edabdced1 build: Updating grunt-banana-checker to 0.13.0
Change-Id: I9ccd09b18e0f89bd5a2a6be83dbb62a925041ed0
2024-05-19 04:06:16 +00:00