Commit graph

125 commits

Author SHA1 Message Date
Moritz Schubotz (physikerwelt) 277663b822 Add MathJax rendering option
When collecting user feedback regarding the native
rendering option on the German Wikipedia (T346795)
it became apparent that some power users aim for bigger
and bolder fonts and a more LaTeX-like layout.
MathML, however, aims to format math as an integral part
of the text with uniform fonts and spacing.

To match both user needs, this patch adds a new rendering
option that uses client-side MathJax (without a need for
restbase or mathoid).

* Adjust MathJax`s loader to be compatible with the mw loader
* Add new rendering mode
* Copy MathJax source to resource module as foreign repo

Bug: T354136
Change-Id: I1ecf9c77fefc3b0f717107d81979276023f6cb84
2024-05-24 03:30:05 +00:00
Reedy 4c2401961f Conditionally register popup RestRoute using ExtensionFunctions
Bug: T362027
Change-Id: Id1329c72b81372468a98da3b47b101302c07b40d
2024-04-07 20:30:04 +00:00
Ed Sanders 183c6907cd MWLatexDialog: Rename CSS to LESS
Change-Id: Ica7bd525ffeb640308bf715042035d2d483093db
2024-03-21 13:33:22 +00:00
Ed Sanders 8d6ad58768 Use new SymbolListBookletLayout instead of MWLatexPage
Depends-On: I357595ae490b36bcf5dd477a95c5684f3a246753
Bug: T120512
Change-Id: Ifbfb8e9d20c12d1ad8c347bb56a54d9e4eaf236f
2024-03-19 18:46:58 +00:00
James D. Forrester a479de3bde extension.json: Drop 'es6' flag, always true since MediaWiki 1.41
Change-Id: Ic1310ae35e47e1527a16bd7b604dd48c612437a5
2024-01-12 19:03:10 -05:00
Jon Robson b99c3800d0 Should be possible to disable the Math preview
Bug: T334261
Change-Id: I46e7641d22f4c17ba318a106a62518e4ca3e3c55
2024-01-11 18:53:09 +00:00
jenkins-bot 7d1d07948b Merge "Update UserOptionsLookup's FQN" 2023-11-30 14:15:05 +00:00
jenkins-bot b5e0d80740 Merge "Remove confusing version information" 2023-11-30 12:55:22 +00:00
gerritbot 2b2f48cd69 Update UserOptionsLookup's FQN
User-options related classes are being moved to the MediaWiki\User\Options namespace in MediaWiki Core; reflect that change here.

Bug: T352284
Depends-On: I9822eb1553870b876d0b8a927e4e86c27d83bd52
Change-Id: I33cc5e1bfb2dd6877a45a11e253d81babe055391
2023-11-29 12:39:28 +00:00
Stegmujo a82727f61f
Rename TexVC in PHP to WikiTexVC
Change-Id: Idd98205ea291640b01946374f15c807da7fc26e5
2023-11-24 16:41:30 +01:00
Moritz Schubotz (physikerwelt) 4a9ee3c047
Remove confusing version information
Change-Id: I85710c472b7bb82279e9fdcd6ca2cca19877bab2
2023-11-22 11:25:06 +01:00
jenkins-bot 008759c331 Merge "Remove references to VisualEditorFullRestbaseURL" 2023-08-25 11:21:39 +00:00
James D. Forrester 33ddbf9f4d build: Update MediaWiki requirement to 1.41
All extensions in the MediaWiki tarball are expected to track MediaWiki's release directly.

Change-Id: I62fce93c9c2a454cfe556c2f3da49a6b32b04106
2023-08-19 13:31:14 +08:00
Bartosz Dziewoński 8c05a71beb Remove references to VisualEditorFullRestbaseURL
The VisualEditorFullRestbaseURL config variable is no longer used by
VisualEditor and is no longer set in Wikimedia production
configuration.

Bug: T344458
Change-Id: Ifd0b9f919f7a9bdceb8761125588fe72e8d1e50c
2023-08-18 20:17:48 +02:00
Umherirrender fb29f08e74 Use HookHandlers for core hooks
The use of "HookHandlers" attribute in extension.json makes it possible
to inject services into hook handler classes in a future patch.

Bug: T263364
Change-Id: Id8d9d0dcc6bb6ab60c5df3074803d132393415e9
2023-08-16 01:12:17 +00:00
daniel 43dd9c7f63 Introduce MathInternalRestbaseURL setting.
This new MathInternalRestbaseURL setting allows the internal URL of
Mathoid to be configured directly, instead of relying on
VirtualRestConfig.

This patch moves the fallback logic for the internal and external API
URL into an extension registration callback. This way, we can keep the
application logic simple, and we can issue config warnings that will
cause the updater to fail, forcing wiki owners to update their config.

Bug: T334842
Change-Id: I2fbc441955a1fe417f264f31f3729ce0715f7f16
2023-05-30 09:48:03 +00:00
Umherirrender 35660f4e78 Replace deprecated Hooks::run
Bug: T335536
Change-Id: I6968c26df6819f0c83105e92c03d1d204f90db27
2023-05-06 23:11:13 +02:00
Moritz Schubotz (physikerwelt) 8619ba0841 Modules target desktop and mobile by default now
* Removing redundant code.
* Require MW 1.40+, cf. I15ee8b4f3785984042673710f6cf785a1627f578

Bug: T328497
Change-Id: I0de36b394443b23cf40249784907e0fad088aaeb
2023-03-15 09:20:41 +00:00
Moritz Schubotz (physikerwelt) c560ff0cd8
Remove MathPlayer
* MathPlayer stopped working around IE8

Bug: T298971
Change-Id: I759a5dc61eaf27a99d952366cf9c4380748f8e82
2023-03-15 10:20:13 +01:00
Stegmujo 17d9ade3f2 Insert MathML-Comparator features in MathML-Tests
Bug: T327393
Change-Id: I1d781587cf62d034493a06a4a9640d0dd14c8386
2023-02-03 14:58:52 +00:00
Stegmujo 783797bb9a
Add test for basic MML Methods
Bug: T302628
Change-Id: Ib3d781a516e53392fb09a2c70b322805dcb43fcf
2022-12-23 22:46:59 +01:00
Jon Robson 571e624c4e Load Math ResourceLoader modules on mobile
The default for a module is desktop and all of these modules
at a glance look like they should be loaded on mobile as
well.

Bug: T324723
Change-Id: I606b75d6524692e4183cd71a991140976d04d23f
2022-12-13 16:47:31 +00:00
AndreG-P 95c5757ee5 Enable popups for annotated math formulae
Enable popup extension for annotated math expressions. The popup shows a short summary of the formula and is generated via the Popup API introduced with I65fcbf25ac5818f6c649daf494c719921247e8f5. It is a follow up of Iefe98c1f0422dbf034e385b1a41a859d030a2cf4.

Bug: T208758
Change-Id: I8c45b7e441083c240bbf2e0217ec219df7dcc351
2022-12-06 06:07:22 +00:00
jenkins-bot 4d3cb0dc69 Merge "Simplify VE data modules using 'packageFiles'" 2022-11-29 01:14:00 +00:00
jenkins-bot e0f6e21ac7 Merge "Remove PNG rendering mode" 2022-11-22 19:07:20 +00:00
Bartosz Dziewoński 9207931f53 Simplify VE data modules using 'packageFiles'
We can now serve the JSON data almost directly (although, curiously,
we need a main file in the module that is JavaScript, not JSON),
and without using global state in the JS code.

Change-Id: I203b3e396b28f4b4ef49c3c0918a4025082308c4
2022-11-22 18:43:04 +01:00
Moritz Schubotz (physikerwelt) 110656335f Remove PNG rendering mode
Removes functionality to
* select PNG rendering mode
* automated fallback to PNG images for SVG rendering
* PNG mode related class and tests

However, PNG images received from mathoid / restbase are still stored.

Bug: T311620
Change-Id: I595926027433182cc0396570bc3f1ce0cd2cafb3
2022-11-21 18:57:27 +00:00
jenkins-bot 4b6137bed4 Merge "Avoid try…catch where if…else will do when using LanguageFactory" 2022-11-21 08:57:13 +00:00
Bartosz Dziewoński 1b7a46ff4f Avoid try…catch where if…else will do when using LanguageFactory
Needed for I869af06896b9757af18488b916211c5a41a8c563, where I am
trying to change LanguageFactory in MediaWiki core not to use
MWException.

I truly feel mocked after working with this code. See if you can find
the two lines in this diff where the meaningful changes are.

Change-Id: Ifcb31dbb7113ce57526f06558cde2abedee317d7
2022-11-18 21:08:24 +01:00
Stegmujo c27f7edef9 Add Integration for the TexVC-PHP check to Math
Bug: T312528

Change-Id: I0eda7d4213a5f703ab7ae7887aa364af9e576dbe
2022-10-20 16:39:19 +00:00
AndreG-P 951dec1fab
REST API endpoint for popups
Implement a rest API endpoint that displays the popup that is currently
only shown on a special page.

Code was revived from Idd22057a88312bf1a1cb5546d0a6edca5678d80d

Bug: T288076
Bug: T233099
Change-Id: I65fcbf25ac5818f6c649daf494c719921247e8f5
2022-08-05 17:47:44 +09:00
AndreG-P 14c4df1336
Support new properties 'Symbol Represents' and 'In Defining Formula'
Add support for the new properties 'P9758' (symbol represents) and
'P2534' (in defining formula) for the special page that shows
in depth information about tagged formulae.

Bug: T312893
Change-Id: I39551e04487f77cca60c89e8c95293032fd5bd6a
2022-07-27 22:30:54 +09:00
Moritz Schubotz (physikerwelt) 480d241f97
Make dependency to Wikibase client config optional
The MathEntitySelector gets its config from wbRepo which caused a hard
dependency on the Wikibase client.
If the Wikibase client config is not available a default value (wikidata)
is used to determine the URL of the foreign repo.
As the dropdown will never do write operations, we restrict the repo
access to anonymous read only.

Bug: T313143
Change-Id: Iba33dfd32a78f4ad7c2e99a1f56218458ab884b4
2022-07-25 09:51:47 +02:00
Physikerwelt 63e19a8c69 Revert "Revert "Add wbEntitySelector widget to edit qid in VE""
This reverts commit 2dc6bcac48.

Reason for revert: Re-enable functionality with fix

Bug: T313143 
Change-Id: I7536ae187872b9c0a6abab18861499290ad621e0
2022-07-23 07:57:54 +00:00
Reedy 2dc6bcac48 Revert "Add wbEntitySelector widget to edit qid in VE"
This reverts commit 422be143f6.

Reason for revert: Caused hard dependancy on Wikibase

Bug: T313143
Change-Id: Ia6f551307f0fbaa2a3fc5747ed180e588c60b02f
2022-07-16 17:40:09 +00:00
Fwolz 422be143f6 Add wbEntitySelector widget to edit qid in VE
Add the MathWbEntitySelector field to provide a dropdown menu which retrieves
the expression or qid from wikidata instead of the simple  TextInputWidget to
edit the qid in the Visual Editor.

Change-Id: I0a6fddd2c2978c9c4f195d668458b8d2ed478d98
2022-07-06 12:13:28 +00:00
Fwolz 74bd7c4730 Add text field in VE to change QID
Makes it possilbe to change the QID of a formula in the visual editor
quick editor and in the dialog editor inside the options panel.

Change-Id: Ie4cb651939a59bf4446cd3e5327522d100eac5bf
2022-06-01 12:27:43 +02:00
jenkins-bot 9e420ab960 Merge "Use new ResourceLoader namespace" 2022-05-24 23:44:32 +00:00
Tim Starling a5c7506265 Use new ResourceLoader namespace
Extensions using Phan need to be updated simultaneously with core due
to T308443.

Bug: T308718
Depends-On: Id08a220e1d6085e2b33f3f6c9d0e3935a4204659
Change-Id: I6d355e7037186e840a76f319886ed870419d9fc8
2022-05-24 22:59:43 +00:00
lens0021 cb9b94c0bc
extension.json: Fix the invalid name of $wgMathUseInternalRestbasePath
Bug: T308546

Change-Id: I63592f4cfdd4ec8f7774bf75fb847ffedfe6934d
2022-05-17 22:29:27 +09:00
lens0021 72a537e8a8 Add $wgMathUseInternalRestbasePath
Adds a new configuration variable that can be used to run RESTBase
independently from Math.

Bug: T306572
Change-Id: Ie40bd36a53fa5018364cf9268fee29533f4aa23b
2022-05-17 07:32:57 +00:00
Reedy df89742072 Remove global namespace class aliases
Depends-On: I7e8e7f5ec0ac2f995489a559e88fc55ab877e06e
Change-Id: Ie3f5d5880363777eda4608fe8753a69e7ff3c5f9
2021-10-01 16:30:09 +00:00
Petr Pchelko cfc2f4f319 Register 'math' parser option
Instead of modifying a page rendering hash,
use the proper mechanism of parser option
registration. The cache is still split on parser
option value. The 'math' option is lazy, since
not all pages contain 'math' tag and we want to
avoid an user preference lookup for every parse.

WARNING: this will invalidate ParserCache for
all pages that contain <math> tags, but according
to Moritz, this is about 1% of all pages, so we
should be fine.

Setting up the test is still rather hard and weird
due to very hacky rendering mode to user option
converter, and math renderer interaction with the DB.
This will be cleaned up later.

Depends-On: I92b3e18fabef4eecac2ec2a4844f1be2716e5d89
Change-Id: I3bce04684070ad306685dabbc51267def25773cd
2021-09-30 06:55:54 -07:00
Petr Pchelko b458303fed Move rendering modes name resolution to MathConfig
Change-Id: Ie1926f1da02f6ab585d3efbc71abe1716dac66e5
2021-09-30 06:29:36 -07:00
Petr Pchelko a3306b24df Clean up handling of user preferences
Change-Id: I3e8f0a0be16d92a411de796b8e25df3a7760099f
2021-09-29 10:28:03 -07:00
Petr Pchelko 9b7205599c Move math configuration methods into a service
This is doing a bulk of the job of creating a service
for working with math modes configuration. There's
still things to do, like moving math mode names,
and perhaps depending on default user options to
provide a bit more convenience, but that will be the
next step.

Change-Id: I1259a93651920f44104f2f5135e3e620c858be8d
2021-09-28 13:31:08 -07:00
Petr Pchelko da8e918fb3 Enable most tests which were previously disabled
Additionally - remove RestbaseInterface::checkBackend.
When HTTP requests are banned from unit tests this method
makes no sence.

MathoidCli tests were not reenabled cause it's a bit hard
to mock shell acceess. Hopefully as part of Shellbox
transition we can have MockShell trait in core and reenable
those tests

Bug: T265628
Depends-On: I350ed59af603a0504704af3265787a4be8f2dc2a
Change-Id: I294d0ed905193850dc38cb3071eb9b31c8863121
2021-08-12 08:57:58 -07:00
physikerwelt (Moritz Schubotz) be9d701825
Add JS unit test
Add a first test to check that the testing framework is functional.

Bug: T288074
Change-Id: If4a6d14f14d7b964db31781b3caf23eb383c06c1
2021-08-05 09:54:10 +02:00
Petr Pchelko 45090ad369 Make use of MockHttpTrait instead of custom mechanism
Depends-On: I4c3aab6ab88695729b4f398dacf3575fbdb4dad4
Change-Id: I60b192c9b9c2ae434fb3f9aff8c460e0fc0806b1
2021-08-02 13:46:44 -07:00
Petr Pchelko e6507e95d7 Create Math.RendererFactory service
Change-Id: I474d746bae81ddf4322814c45141c981ecdb077b
2021-08-02 11:57:57 -07:00