Commit graph

25 commits

Author SHA1 Message Date
Fomafix 38051ed25e Update namespaces of PHP classes
Change-Id: I0bd63285afd4967c09ab046b012f8c4e62db2f2c
2024-10-03 20:01:46 +00:00
Fomafix d3ba6712ab Use PHP type hints
* Add PHP type hints where possible.
* Remove @var, @param and @return if redundant to type declaration.

Change-Id: Ief9f12370b094188b95fe48d3b1d68988da1e9b8
2024-09-16 07:20:43 +00:00
Fomafix 47ed85f491 Hooks: Use private instead of public for internal functions
Change-Id: I3566e8271ce37807f7d24867680d8229aa97302a
2024-03-09 16:21:17 +00:00
Nardog 1e646acfdb Avoid FOUCs more flexibly
Style the textbox to mimic when CodeEditor is enabled only if
"usecodeeditor" is set, and only before CodeEditor is loaded (I0ce663e
added a gutter even when CodeEditor was turned off, which no one asked
for).

.wikiEditor-ui-text is added client-side, so there's no point in styling
it.

Bug: T351487
Change-Id: I3918e1c120805ca007e8e7eb7e29304ddbb6af56
2024-02-22 18:33:14 +00:00
gerritbot dafb05f12d 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: I2af14da0c4f2d13e94b0301ae5d4d2589e05f0b7
2023-11-29 12:38:27 +00:00
Ed Sanders 9111107de8 CodeEditor: Avoid movement while loading
Bug: T73015
Change-Id: I0ce663ebad4bb9ab9f435aeba65c545ee21e0680
2023-10-15 07:21:36 +00:00
Fomafix 0094c01f7f Use namespaced classes
Change-Id: If12b9c731ff89e2ca2d855f9d3ed4b887f9a356e
2023-10-03 09:11:09 +00:00
gerritbot 4f513b6232 Replace some moved Title class uses, now MediaWiki\Title\Title
Bug: T321681
Change-Id: I1de316ddfa572a72ca68f9806b93f958286c8ef2
2023-08-19 04:14:04 +00:00
Umherirrender 4d6a470aae Create HookRunner class and the hook handler interface
Bug: T271013
Change-Id: Ie8e152530599d11da12cb9272a3b757da1cca1ab
2023-06-04 21:23:14 +02:00
gerritbot 417ce7bebf Update moved class EditPage
See T321882. Moved in Ibefc44eb64aed

Bug: T321681
Change-Id: I5a66b76658c3eb19f2afe5b9a8ce4748767e6c2d
2023-05-06 21:19:29 +00:00
Umherirrender 10dddec75b Replace deprecated Hooks::run
Bug: T335536
Change-Id: Ifc18d80c15f714d58aef33c9991079db9406a19e
2023-04-29 20:13:21 +02:00
Roman Stolar 51cd95fac9 Avoid using User::getOption and inject service UserOptionsLookup
Remove using of User:getOption since this method will be hard-deprecated. Now it is soft-deprecated

Bug: T296083
Change-Id: Iae0c0cd3ab4ffdfd6cfce5e7ced81dfae3d4a359
2021-11-26 08:36:11 +00:00
Fomafix ad1930d255 Use HookHandlers and implement hook interfaces
Change-Id: I9313f4cff24ceb9c83d5a529ec3064330eabb8c6
2021-11-25 20:14:37 +00:00
Fomafix d7117949b1 Use namespace MediaWiki\Extension\CodeEditor in PHP
An alias with the old class name CodeEditorHooks is not added because
there are no external findings on
https://codesearch.wmcloud.org/search/?q=CodeEditorHooks

Change-Id: I88cb3a506d196d918ce852e46433dad808ae2a6c
2021-11-25 19:41:48 +00:00
Fomafix bcb7eed32d Use single quotes instead of double quotes in PHP
Change-Id: I9d32e36a14c25139cd735bd6657c5d46df573e15
2021-10-30 19:14:59 +00:00
jenkins-bot d75911245e Merge "Revert "Directly use $wgTitle instead of relying on getContextTitle fallback"" 2020-01-01 23:31:56 +00:00
Legoktm 212477a083 Revert "Directly use $wgTitle instead of relying on getContextTitle fallback"
This reverts commit b3fb04b463.

The problem is *not* getContextTitle() - that's the correct
function to call here. The problem is that something is creating
an EditPage instance without calling setContextTitle() - that's
what needs to be fixed.

Change-Id: Ibc8280c7434bee4c4697142bcdbc1194f00c53c1
2020-01-01 23:16:28 +00:00
Brian Wolff f8d9cdebdb Make CodeEditor compatible with CSP
Adds a "script-src blob:" directive on pages using CodeEditor.
This should allow using the blob-based web-worker that ACE uses.

This bumps the MediaWiki dependency to current master (1.35.0+).

Bug: T214743
Depends-on: I68054644220cd03bc96cf8ffb9c7ee375be77f96
Change-Id: I40612274a7e1d964119433442d992a8bf67f61af
2019-10-28 12:41:05 +00:00
Daimona Eaytoy b3fb04b463 Directly use $wgTitle instead of relying on getContextTitle fallback
This is apparently the only code relying on the fallback. Since it seems to do this most of the time, use $wgTitle directly.

Bug: T176526
Change-Id: I9edc7c3cb7b0f2b024873b2f6fbdb8c275225854
2019-09-30 17:38:56 +00:00
James D. Forrester 988bc3c0b1 Drop wgCodeEditorEnableCore, default on, pointless to disable
Change-Id: I637ac6cc92183dbf73b6bb39d487c6d4099657be
2019-07-12 10:58:50 -07:00
Derick Alangi 92c432ab83 Remove "return true" legacy behavior from hook handler functions
Change-Id: Ie33721116c5ae665f45ed0a8baeace031cfeca89
2019-02-02 10:06:40 +01:00
Derick Alangi ef09440a94 Fix PHPDoc comment @return for CodeEditorHooks methods
Should return "true" (as there is no case for false) and not bool.

Change-Id: I2badcbb3b06c8a9593908b064629bfef8ea82488
2019-01-16 14:46:28 +01:00
Fomafix 6aa0a7016a Add typehints to function parameters
Change-Id: I820f7be8486c2f5d560eabe84629dd41db774735
2018-12-16 12:04:49 +01:00
Kunal Mehta fefe8893a4 Set an explicit visibility on getPageLanguage()
Change-Id: I37407f8aa5f0f9d3066583f1a54e79de0c5ca129
2018-04-14 01:44:58 +00:00
Kunal Mehta 99cd2828eb Move classes into includes/
Change-Id: I9ece489e16d214990191e5077e6271bd95fdb08c
2018-02-09 00:25:20 -08:00