Commit graph

83 commits

Author SHA1 Message Date
Volker E ba64a52368 styles: Replace mentioning of WikimediaUI Base and add skin variables
It makes no difference to directly assign Codex Design System for
Wikimedia colors as values instead of re-assigning the outdated
`@wmui-color-*` variables.

Bump to required MediaWiki core version >= v1.41.0.

Also put stylelint-disable before the block it's actually needed.

Bug: T334934
Change-Id: I5696f160d39ef4edec7a1b966fe7e73608c86bdc
2023-05-16 17:58:24 +02:00
Tim Starling 7a3f46b490 Migrate ResourceLoaderCodeMirrorModule to a virtual file callback
Bug: T47514
Depends-On: I97d61b5793159cea365740e0563f7b733e0f16de
Change-Id: I31b80fc1c7701fc1075d655270706e341942415d
2023-05-05 16:26:09 +10:00
s-mukuti af8302a46b extension.json: remove unnecessary target definitions
Bug: T329643
Change-Id: I109514e959fb3189282a0715874c09b9fbd00501
2023-03-31 10:25:19 +03:00
jenkins-bot 19359a15c6 Merge "Use HookHandlers and inject services" 2023-01-18 19:04:59 +00:00
jenkins-bot f20163f08a Merge "Enable CodeMirror code on mobile domain" 2023-01-18 18:49:51 +00:00
Jon Robson ed5a12fad2 Enable CodeMirror code on mobile domain
Bug: T324723
Depends-On: Ifa355f3821c72935c74650fa635a6ab863c70d39
Depends-On: I271e99c777b638bd4c4bae642f8c7c87fc0ae5cd
Change-Id: Ia6195a0771cf36ca739577687a6c1e8f64c78ac8
2023-01-18 18:41:39 +00:00
Func f233363636 Bump the required version of MediaWiki to 1.39
The master branch is not compatible with 1.38 since commit 3a0c4b1.

Depends-On: I2a86a37fe2853890742bea2e7180f7d6c5f9304c
Change-Id: Ic767cd476d504c1020c6ef8481b3cdee39f31bc7
2023-01-12 06:30:41 +00:00
Fomafix 81eb401a75 Use HookHandlers and inject services
Change-Id: Ia72968e53373d136efb75e6f82fb7bd27665f83d
2023-01-02 22:12:20 +00:00
Thiemo Kreuz 762c9e3eb4 Convert MediaWiki style sheet to LESS code
I did some reverse engeneering and derived the three base colors for
nested templates and parser functions as well as links, together with
a formula to calculate any mixture of the three.

You can manually compile the .less file:
lessc resources/mode/mediawiki/mediawiki.less resources/mode/mediawiki/mediawiki.css

Then compare:
git diff --word-diff=color -w HEAD^ -- resources/mode/mediawiki/mediawiki.css

You will see that some numbers change. These are rounding errors in
the old .css code.

Bug: T307188
Change-Id: Ic534a2fac73f9f737ae5238b87aa80b705b37786
2022-06-14 15:59:33 +00:00
WMDE-Fisch 574ceba9bf Remove $wgCodeMirrorColorblindColors feature flag
Bug: T307188
Change-Id: I7a8f2b02cad160df838ebfb167b63296123b4a08
2022-06-13 13:20:24 +02:00
Adam Wight 9f34c4d220 Remove $wgCodeMirrorEnableBracketMatching feature flag
Bug: T307188
Change-Id: Ibb21dea29c87d8fac898506c19f329273348c190
2022-06-13 10:34:41 +02:00
Adam Wight ba48e3c474 Merge accessibility-mindful colors into base styles
Bug: T307188
Change-Id: I32831cc546bc8fca2ee73e3d6742f87838791d1b
2022-06-10 16:20:43 +02:00
Adam Wight 396d50cd5d Remove $wgCodeMirrorAccessibilityColors feature flag
Get rid of the flag, without making any substantial changes to the
code.  A follow-up commit will merge the CSS into base rules.

Bug: T307188
Change-Id: I601df5047d0db3cfb9559538487d3d39bb6c7cf4
2022-06-10 16:18:42 +02:00
Umherirrender 0ce9a922dd Replace Action::getActionName by IContextSource::getActionName
Change-Id: Ica106d108f8930b93c9bbd4851d2915b40d7b343
2022-04-15 23:17:08 +02:00
WMDE-Fisch c3cda7edd7 Add colorblind-friendly scheme
Including an user options to enable/disable the scheme. Defaults
to false. Feature is only availible together with the new more
accessibile color scheme as the CSS depends on each other.

Set behind a new temporary feature flag.

Bug: T305027
Change-Id: I46d240a30eda5a1526ada1fe9b724f7b4594b426
2022-04-08 14:12:43 +02:00
WMDE-Fisch ede8b043bd Use less for accessible-colors.css
Change-Id: I4ed291ce0ef6e85b4540fcaef36892a521a99c17
2022-04-06 10:21:47 +00:00
Reedy 386bb03b01 Namespace extension
Change-Id: I83913927e86d44726d3a1c3a682cc1f6e2372f07
2022-02-06 15:16:42 +00:00
WMDE-Fisch 0673d75321 Change line numbers default to null
The current default does not work if the extension should be disabled
for the template namespace. See T225753

Should not be merged before the production config is adjusted in
I8be13e0442bc3f7af851f6d1ba8ba9f9011d4907

Bug: T290226
Depends-On: I8be13e0442bc3f7af851f6d1ba8ba9f9011d4907
Change-Id: I630c13f51c87fd801b14c3ada616e7da839240bd
2021-09-03 14:49:11 +02:00
MusikAnimal f7ef01b412 Set default for 'usecodemirror' preference
This preferably would be set to on by default so that the extension
works out of the box, but it causes tests to fail in Core (T286623).

Despite the previous state of CodeMirrorHooks::onGetPreferences(),
CodeMirror was never on by default anyway.

Bug: T286270
Change-Id: Ic702b868b55aaa8ab71ddedd289c25f36b34b112
2021-07-20 23:25:12 -04:00
Alexander Vorwerk 6bf535cffc Avoid using User::getOptionKinds()
User::getOptionKinds() is deprecated and should be replaced with UserOptionsManager::getOptionKinds()

Bug: T277600
Change-Id: Ie30ae74839f91aa48c53a5ebf680adb21eb9b047
2021-05-03 11:39:48 +00:00
Adam Wight ed2f9944ea Enable line numbering only on configured namespaces
Introduces a new config variable `CodeMirrorLineNumberingNamespaces`
that can restrict line numbering to only appear for specified
namespaces.  Setting to null enables everywhere.

This takes some liberties with the `lib` module, turning it into a
container for shared functionality.  This can be pursued in later
work, by cleaning up duplicated code in this repo.

FIXME: failed to deduplicate the code for now.

Bug: T267911
Change-Id: Ida2b33eef38edc57d29756ec472c6f2c83bd7b11
2021-04-12 12:05:14 +02:00
Andrew Kostka aaf67a9c0b Update color scheme to meet accessibility standards
These changes to the color scheme are hidden behind a feature
flag for the time being.

Bug: T271895
Change-Id: I0a4b03e0f3bc8239f31edbbd5ae55661607b76f6
2021-03-05 16:39:14 +01:00
Adam Wight 5956c74773 Finalize event platform migration
Bug: T275005
Change-Id: I55c4282dea0820a31bf8d7d428913512a35c6986
2021-02-24 16:38:09 +01:00
Adam Wight 36212a7877 Log user edit count bucket
Bug: T269986
Change-Id: Iff3c983a59738312bc39bf65e2428526724fe139
2021-01-27 09:03:28 +00:00
Thiemo Kreuz 473a711aaa Rename our customized matchbrackets addon
Bug: T269096
Change-Id: I5b58099166f71ccc1b3b19334f28e8bbaafaceb3
2021-01-20 11:17:59 +01:00
Adam Wight d8f4982e79 Added bracket matching
* using CodeMirror addon matchBrackets
* highlights the matching bracket of a pair
* highlights brackets when cursor is inside a pair
* feature usable in source code editor

Bug: T261857
Change-Id: Ib01d9919a47bb29684b54501644b01936b57972a
2020-12-15 13:09:06 +00:00
Andrew Kostka 7d01567c4f Record usage statistics for syntax highlighting
Bug: T260138
Change-Id: Ic9b95d6331bf85704822a69483880faaaa578a0e
2020-11-25 15:18:01 +01:00
Reedy 55e2bd0558 Move CodeMirrorPluginModules from config to attributes
Change-Id: I38c33f5d140a88f9eda1df7094a203fd7009412e
2020-05-12 18:29:44 +00:00
Reedy 58289325f4 Convert to manifest_version 2
Bug: T252470
Change-Id: I23fea7028e5adc0a95b783aa0a3caf80c04f6a00
2020-05-12 16:53:47 +00:00
James D. Forrester 63e30576de extension.json: Simplify hook calls as we only ever use one
Change-Id: Idcf9725791cc9f861ca2708c0cd25f45f0d9d68f
2020-05-11 20:20:08 +00:00
James D. Forrester 85e56bb200 Use QUnitTestModule instead of deprecated ResourceLoaderTestModules
Bug: T232875
Change-Id: I84276ff7c30b9c1db5dd8e9532512d7f586ab401
2020-05-11 20:19:57 +00:00
Ed Sanders 4d53bcbe09 VE: Don't load CodeMirror code until tool is activated
This saves about 300k uncompressed / 80k compressed whenever VE loads!

Change-Id: I7cf1c35292c2ea48cc15ceb4c22d4473a25484e9
2020-03-19 20:23:24 +00:00
Derk-Jan Hartman 99db78cd23 CodeMirror: Add COPYING file and credit for CodeMirror authors
Bug: T234086
Change-Id: I44460b26fc367f0415073a7221226069799e1b1c
2020-03-02 21:34:06 +00:00
AronDemian d70bd9d1ae Unify monospace font stack. Avoid potential sizing bug caused by weird browser behavior with font-family: monospace;
Problem: browsers implicitly and unexpectedly set the font-size to something around 13px with `font-family: monospace;`, but not with `font-family: monospace,monospace;`.
See:  http://code.iamkate.com/html-and-css/fixing-browsers-broken-monospace-font-handling/

Bug: T176636
Change-Id: Ied24a0cde7db4a6092d2cd7a6207d0a361424c3f
Related: T245568
Related: T245476
2020-02-28 04:44:07 +00:00
Timo Tijhof 1bfbc6e045 Remove use of jquery.ui module aliases
This increases the extension's dependency to MW 1.34+.

Bug: T219604
Change-Id: Ic78f8eba5c18bfa6ee3e70277504cf7b17975387
2019-11-25 22:45:01 +00:00
Derk-Jan Hartman 758523b65f Conditionally load CodeMirror lib
Also remove two unneeded dependencies

Bug: T209824
Change-Id: I5b528bde346780ca5ae5d615c4ca0d617a6cd615
2019-03-14 23:31:18 +00:00
Max Semenik c8f75d5ac5 Restore GetPreferences hook handler registration
Accidentally removed in I1ad451acfd1

Bug: T198537
Change-Id: I71788de31a23373f4e0528211ce3ec89fc5f9d3b
2018-07-03 14:25:01 -07:00
Max Semenik 63647bb5dc Remove all BetaFeatures support
Bug: T185030
Change-Id: I1ad451acfd163c783e7b8ec604d8695c14342667
2018-06-13 16:42:40 -07:00
Fomafix 31c24340f7 Remove dependencies on deprecated modules 'mediawiki.api.*'
In core the modules 'mediawiki.api.*' get merged into 'mediawiki.api'
and get deprecated in ecc812f06e included in MediaWiki 1.32.

Change-Id: I07471baa50edbd4d5a7ff904b46602729612ccde
2018-05-21 14:37:21 +02:00
Kunal Mehta c6d9adbe83 Set extension type to editor
This extension doesn't even register a parser hook.

Change-Id: Ia31cae5504f404e130bfd77322ec53c79e085f22
2018-04-26 00:33:09 -07:00
MusikAnimal 7d99bbefde Remove 'Try syntax highlighting' popup for all users
A Node script was used to remove the now unused i18n messages.
This same script sorts the messages alphabetically, so it looks
like some unrelated messages were changed, but they weren't.

Bug: T191297
Change-Id: I69cce06133c1d055d31d12ebc8408123c187b574
2018-04-12 18:22:31 -04:00
jenkins-bot 6772e087e5 Merge "Tests for MediaWiki CodeMirror syntax highlighting" 2018-03-29 23:17:39 +00:00
Ed Sanders 6d92dd818d Use upstream OOUI icons for WikiEditor toolbar
Also uses upstream tool-active styling, which was
based on cm-on.svg.

Depends-On: I3e6f65f6f290778d3fbfa22f5d212c26fee12a86
Change-Id: Ib42be9f8b87efe1387eb5c77698fd2f0af0a673d
2018-03-23 13:43:30 +00:00
MusikAnimal 4d2783eb3e Tests for MediaWiki CodeMirror syntax highlighting
Bug: T169592
Change-Id: I0750d3a320af5451f847e6062f82523fb18f12bc
2018-03-20 16:27:55 -04:00
jenkins-bot 220a68a9f9 Merge "textSelection: Replace encapsulateSelection with replaceSelection" 2018-02-13 17:25:25 +00:00
Kunal Mehta f7e5949334 Move classes into includes/
Depends-On: Idbcb76f54eb57b0a56b46188526858038d698627
Change-Id: I2858e848137336aeabb18513f073bfccf64c0a6b
2018-02-10 09:27:42 +00:00
Ed Sanders 3e0d9773d4 textSelection: Replace encapsulateSelection with replaceSelection
encapsulateSelection is now defined in terms of other methods,
so we don't need to duplicate it here.

Follows on from T185917.

Change-Id: I1f99b3140ed363658ed2724a58c8b34ef20769fa
2018-02-09 10:31:47 +00:00
Kunal Mehta e3f0df1cfc Use SPDX 3.0 license identifier
SPDX released version 3 of their license list (<https://spdx.org/licenses/>),
which changed the FSF licenses to explicitly end in -only or -or-later
instead of relying on an easy to miss + symbol.

Bug: T183858
Change-Id: Iddfe5ea4519690d2b14f6a363d87c648a0050e25
2018-01-04 02:55:40 -08:00
jenkins-bot d25705d804 Merge "Disable WebkitTextFillColor in Firefox+OSX" 2017-12-12 19:44:09 +00:00
Fomafix 63720b9c20 Rename CodeMirror.hooks.php to CodeMirrorHooks.php
This avoids the MediaWiki.Files.ClassMatchesFilename.NotMatch exception
in .phpcs.xml.

Change-Id: I599016f4754f24b16394bdf1ba45bb20862fcd2a
2017-12-02 20:27:01 +01:00