Commit graph

1019 commits

Author SHA1 Message Date
AntiCompositeNumber a84828c08c
Highlight headings with trailing comments
Bug: T171074
Change-Id: I1c8399b839a9be5e5aa0ece36dc86a5848936b5f
2022-03-11 17:13:14 -05:00
Translation updater bot b2e64db515 Localisation updates from https://translatewiki.net.
Change-Id: I9cdc1b25e4fe1d5e53b310f3b3ba0db83eac8826
2022-03-11 08:32:10 +01:00
jenkins-bot 5e28656544 Merge "Trigger focus/blur event handlers attached to textarea" 2022-03-10 22:53:23 +00:00
Thiemo Kreuz 40e4d6b1d0 Prepare tests for later change
Change-Id: Ib0bf448e68f3051d8f1072417927f9a047ed9f06
2022-03-10 18:47:17 +00:00
jenkins-bot c22868121e Merge "Highlight multi-line tags" 2022-03-04 21:09:42 +00:00
Thiemo Kreuz 20debba3b0 Enable eslint for our custom code in the matchbrackets addon
The resulting code style in this file is a little mixed. I tried to
stick to the existing style. Most notably is the indention with
2 spaces instead of 1 tab. But I couldn't disable the spaces inside
round brackets. They make the code so much more readable.

What this patch effectively does is enabling the eslint check for our
custom code in this addon, excluding all old code, and exclusing a few
rules that conflict to heavily with the old code style.

Change-Id: I12f953cb0a6fd35e405b6cc348abfb2c11e70696
2022-03-03 21:07:19 +00:00
jenkins-bot 53e0e1b311 Merge "Highlight tags in link text" 2022-02-28 20:21:19 +00:00
bhsd d23dc77d16 Highlight multi-line tags
CodeMirror is already able to highlight multi-line tags if the tag name is followed by any non-whitespace characters in the same line. This commit fixes the other condition where the tag name is followed by whitespace only in the same line.

Bug: T201684
Change-Id: I8cb4a53ee0fe7fc8612a58331a1a3e57d00d7630
2022-02-23 17:02:22 -08:00
jenkins-bot ab45c12361 Merge "Namespace extension" 2022-02-23 06:20:51 +00:00
AntiCompositeNumber b136622875
Add tags from CodeMirrorPluginModules to extension tags list
Currently, only registered parser tags are included in the list of
extension tags to be highlighted. This patch allows extensions that do
not register their tags as parser tags (Extension:Translate) to still
define them for highlighting using the existing CodeMirrorPluginModules
annotation.
This patch also removes the special-casing for <translate>, as it can be
defined in Translate instead.

Bug: T284883
Co-Authored-by: Tacsipacsi <tacsipacsi@jnet.hu>
Depends-On: I860c944eaeeb7771629a1ed2352c05cfd8d7ca80
Change-Id: Iba2b0b874ebbace7a892af9e1d9896e8b17ade78
2022-02-19 18:36:51 -05:00
bhsd b9abcbc12e Trigger focus/blur event handlers attached to textarea
When CodeMirror is focused/blurred, the same event will triggered on its corresponding textarea.

Bug: T197632
Change-Id: Ib71b6774a60dd434bdc8a27b9eab433dcc1c65f0
2022-02-19 12:23:17 -08:00
bhsd ca0e8f20a4 Highlight tags in link text
HTML and extension tags should be highlighted as the text of internal or external links.

Bug: T184341
Change-Id: Ib1f2047936b395afd86720e2a7c921e382229cdd
2022-02-19 06:11:34 +00:00
Translation updater bot 56f6731968 Localisation updates from https://translatewiki.net.
Change-Id: I41a6a83f84e48f5adabc9686a94eb3c7a47f65a6
2022-02-11 08:41:06 +01:00
Ed Sanders 0faac32661 eslint: Lint Gruntile.js using server rules
Change-Id: Ib0e7d62343689bb993476cb1ad40f93fc89a7190
2022-02-07 16:25:32 +00:00
Reedy 386bb03b01 Namespace extension
Change-Id: I83913927e86d44726d3a1c3a682cc1f6e2372f07
2022-02-06 15:16:42 +00:00
Thiemo Kreuz 963e636f83 Restore focus also when switching syntax highlighting on
The same already happens when switching it off, see line #249.

I noticed there is still a (random?) chance the selection gets lost
when switching back and forth between syntax highlighting on and off.
This is not what this patch is about.

Bug: T298488
Change-Id: I541f96be9e6fb2f9032df4b86657d01f0eac5679
2022-01-03 18:00:26 +01:00
jenkins-bot 92051b550f Merge "Reduce noise in syntax highlighting tests" 2021-12-22 13:52:04 +00:00
Thiemo Kreuz be08e04309 Reduce noise in syntax highlighting tests
* What we care about is the <pre>. The class="CodeMirror-line" is
  added to every <pre>. We don't really learn anything new when we
  include it in our tests.
* Testing the ARIA role is testing a CodeMirror feature, not a
  feature of the mediawiki mode under test.

Change-Id: I33bfedb304228240c4e835cc983117668c398c61
2021-12-16 06:53:47 +00:00
jenkins-bot 0f70fd33e5 Merge "Fix syntax highlighting test failing when Cite isn't loaded" 2021-12-14 07:26:21 +00:00
Func 189bef8288 Set the line-break attr to initial
Now css rules applied to pre tags can easily affect the appearance of CodeMirror output, may intentionally or not.
With the line-break attr set to initial can make the appearance more stable, users can still override this with the more specific rules if they do want to.

Bug: T252965
Change-Id: If0d29ad152151c09ace2bcd32d2953ec3c9cf1aa
2021-12-12 09:06:20 +00:00
Thiemo Kreuz 0968d3ea16 Fix syntax highlighting test failing when Cite isn't loaded
I forgot this when I added this test case in I03a1e1a.

Also:
* Use another method to detect if the Cite extension is active. This
  is the same method used in the actual code.
* Move a line of code into the `if` it belongs to.

Change-Id: I1efd3f945150aeb08db3c771e579d9a6114a4c21
2021-12-09 10:06:41 +01:00
jenkins-bot 6ad7f542f2 Merge "Fix invalid reference to core resources/ directory" 2021-12-07 23:01:02 +00:00
Bartosz Dziewoński 561ffca718 Don't mess up the page when running tests via Special:JavaScriptTest
* Append to the hidden #qunit-fixture instead of directly to the body
* Use the right selector when cleaning up

Change-Id: I8be38900e6c5f4592f06dfc8f7c2cfc348627716
2021-12-07 14:40:11 +01:00
Derk-Jan Hartman 73441687ae Add q to list of allowed html elements to syntax highlighting
Bug: T289289
Change-Id: I2ab550c9e992a9daae76287313c596db67182d09
2021-12-04 22:17:26 +01:00
vladshapik 60b14d1aa0 Avoid using User::getOption() method
Replace User::getOption() with UserOptionsLookup::getOption() since this method will be hard-deprecated.

Bug: T296083
Change-Id: I405251092fd94fa70a33319d313c5140c8cebc21
2021-11-30 09:12:09 +00:00
Timo Tijhof d97fa84d2b Fix invalid reference to core resources/ directory
This works by accident due to the CWD being mediawiki-core in most
cases during web requests, and Less.php implicitly falling back to that
as path expansion point when all attempts to expand the path fail (e.g.
relative to current file, and relative to a supported Less import dir
such as core `mediawiki.less/`.

Importing raw files from elsewhere in core is unstable, and is not
supported as this fails on some webserver configurations, as well as
in CLI contexts such as maintenance scripts that rebuild a cache, or
otherwise end up (in)directly computing part of a ResourceLoader
module.

The use case of themeing extension styles to the current skin (with
Vector using WikimediaUI) is subject of T112747 and T265941.

Follows-up I9eb07dd43.

Bug: T296639
Change-Id: I6d2be2941d6088b947ea7f18818add97f129760d
2021-11-30 00:58:58 +00:00
libraryupgrader 0acb7475bd build: Updating validator to 13.7.0
* https://npmjs.com/advisories/1004784 (CVE-2021-3765)

Change-Id: I056b958f41dc9453068a0226f12a29ae0b270047
2021-11-04 10:23:33 +00:00
Željko Filipin 3d72bc7fc4 selenium: Remove wdio-video-reporter npm package
The repository uses video recording from wdio-mediawiki package.

Bug: T294341
Change-Id: I2a353b8443d1e5b1b4da8e21952ab882de2b89ae
2021-10-26 14:59:55 +02:00
libraryupgrader 3dabc292ee build: Updating mediawiki/mediawiki-codesniffer to 38.0.0
Change-Id: I0c217f059a4bef30becbf49ce2683041863bd0d9
2021-10-24 01:04:14 +00:00
Alexander Vorwerk 7550ec896b MediaWikiTestCase -> MediaWikiIntegrationTestCase
MediaWikiTestCase has been renamed to MediaWikiIntegrationTestCase in 1.34.

Bug: T293043
Change-Id: I0c1dcff1e637743828793b30ca2c4a5113e0fa31
2021-10-12 21:29:45 +02:00
libraryupgrader 6c842629d9 build: Updating npm dependencies
* @wdio/mocha-framework: 7.4.6 → 7.13.2
  * https://npmjs.com/advisories/5197 (CVE-2021-3807)
* ansi-regex: 5.0.0 → 5.0.1
  * https://npmjs.com/advisories/5197 (CVE-2021-3807)

Additional changes:
* composer.json: Updated phpcs command in composer test (T280592).
* composer.json: Added phpcs command to scripts (T280592).

Change-Id: Ie856dccce0f190788f394f0fd22d3fcddacddb87
2021-10-04 15:31:26 +00:00
Translation updater bot 386bdf745e Localisation updates from https://translatewiki.net.
Change-Id: I9e89967be2f7ced7aa25238fee70f5ed1b1d04ed
2021-09-24 08:26:00 +02:00
Translation updater bot 2d39605442 Localisation updates from https://translatewiki.net.
Change-Id: I7e30b234c8b0d8c5060f722cbc00631301b11c48
2021-09-13 08:29:13 +02:00
libraryupgrader 82158e5324 build: Updating composer dependencies
* mediawiki/mediawiki-phan-config: 0.10.6 → 0.11.0
* php-parallel-lint/php-parallel-lint: 1.3.0 → 1.3.1

Change-Id: I3f027e302b5740d711697696e7015b76eda3e50f
2021-09-08 20:53:00 +00:00
jenkins-bot f45f5a8516 Merge "Change line numbers default to null" 2021-09-07 11:46:51 +00:00
libraryupgrader 71013b19ec build: Updating stylelint-config-wikimedia to 0.11.1
Change-Id: Ia9c3cbbff62e2363396741ec5655c0673e06c5cb
2021-09-04 19:10:40 +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
Thiemo Kreuz bab5c5232d Disable line numbering in all Android browser versions
This patch also minifies existing code. Note that [] is true in
JavaScript, unlike in PHP.

Bug: T285660
Change-Id: Ic80903ebd1364505fd4aaf7f53b53324a235fd79
2021-09-03 11:37:03 +00:00
WMDE-Fisch ade62be37e Improve text color & background in line numbers on VE
Bug: T287383
Change-Id: I1ece09c12bfbcb4709d5659d87f3045327729f10
2021-09-02 13:54:31 +02:00
libraryupgrader ad8dfbd770 build: Updating path-parse to 1.0.7
* https://npmjs.com/advisories/1773 (CVE-2021-23343)

Change-Id: I24cfa814a40ece25d83f969f68a0ce2352718cdd
2021-08-11 15:39:38 +00:00
libraryupgrader 0332e21139 build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0

npm:
* hosted-git-info: 2.8.8 → 2.8.9
* hosted-git-info: 2.7.1 → 3.0.8
  * https://npmjs.com/advisories/1677 (CVE-2021-23362)
* postcss: 7.0.35 → 7.0.36
  * https://npmjs.com/advisories/1693 (CVE-2021-23368)
* browserslist: 4.16.0 → 4.16.6
  * https://npmjs.com/advisories/1747 (CVE-2021-23364)
* ws: 7.4.1 → 7.5.3
  * https://npmjs.com/advisories/1748 (CVE-2021-32640)
* glob-parent: 5.1.0 → 5.1.2
  * https://npmjs.com/advisories/1751 (CVE-2020-28469)
* trim-newlines: None → 3.0.1
  * https://npmjs.com/advisories/1753 (CVE-2021-33623)
* normalize-url: 4.5.0 → 4.5.1
  * https://npmjs.com/advisories/1755 (CVE-2021-33502)

Change-Id: Ib03f54f3cf310e5e1abe3d3d773f8320a9b16828
2021-07-23 19:30:13 +00:00
jenkins-bot 017b3fd9e5 Merge "Set default for 'usecodemirror' preference" 2021-07-22 12:34:25 +00: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
jenkins-bot 79284952de Merge "Fire a hook when the CodeMirror editor is switched" 2021-07-13 04:39:52 +00:00
sahil daeaae012c selenium: Update wdio-mediawiki
wdio-mediawiki v1.1.1:
- Includes wdio-defaults.conf.js file that vastly simplifies wdio.conf.js.
- Replaces @wdio/spec-reporter with @wdio/dot-reporter.
- Introduces video recording.

Bug: T283597
Change-Id: I88096682276de901e9a9f0d406b7b2e5ca2d8875
2021-06-21 19:36:43 +05:30
Inductiveload a57d7b7c1c Fire a hook when the CodeMirror editor is switched
This allows gadgets to react to the changing editor (for example
to rebind event handlers on the new active editor) without having
to use something like an MutationObserver.

Bug: T284282
Change-Id: I83f0a3c29b01031ae370b7d1207457586f0d25d6
2021-06-16 02:29:55 +01:00
Ed Sanders 3be6ae4b12 Move var declarations inline
Change-Id: I5a390c5621cefce1b396831654d54a74d0a63e9f
2021-06-15 15:50:09 +01:00
sahil f1221d00ec selenium: Upgrade WebdriverIO to v7
Update npm packages: @wdio/* and webdriverio.

Bug: T274579
Change-Id: I6a154ffa5d00f86aa0718aacf5593259568f250d
2021-06-09 00:26:50 +05:30
Translation updater bot 2a4d6c0c08 Localisation updates from https://translatewiki.net.
Change-Id: I7a7e8b7dbe43f757ef04b0ba9696e9ffc9ac99fd
2021-05-27 12:05:00 +02:00
jenkins-bot 5018971a0e Merge "selenium: Update README.md file" 2021-05-25 14:04:40 +00:00