From 18ea2c327e89f82e01cc48622a2ed95d8039170b Mon Sep 17 00:00:00 2001 From: Lex Lim Date: Fri, 6 Dec 2024 10:44:51 +0000 Subject: [PATCH] Update for MW 1.42.0 --- includes/BlockQuoteTagHandler.php | 8 ++-- includes/Isekai.php | 17 +++---- includes/IsekaiChart.php | 2 +- includes/Job/CheckActivatedEditorJob.php | 3 +- includes/MiscUtils.php | 4 +- maintenance/UpdateActivatedEditor.php | 6 +-- modules/ext.isekai.ve.js | 2 +- modules/ve.ext.isekai.misc.js | 57 ++++++++++++++++++++++++ 8 files changed, 76 insertions(+), 23 deletions(-) diff --git a/includes/BlockQuoteTagHandler.php b/includes/BlockQuoteTagHandler.php index fc709ae..e02e54c 100644 --- a/includes/BlockQuoteTagHandler.php +++ b/includes/BlockQuoteTagHandler.php @@ -1,6 +1,7 @@ extTagToDOM( $extArgs, - '', $src, [ 'wrapperTag' => 'span', 'parseOpts' => [ 'extTag' => 'blockquote', ], - ], + ] ); } - public function getInnerWikitext(ParsoidExtensionAPI $extApi, \DOMElement $dom) { + public function getInnerWikitext(ParsoidExtensionAPI $extApi, Element $dom) { $wikiText = ''; foreach($dom->childNodes as $child){ if($child instanceof \DOMText){ @@ -31,7 +31,7 @@ class BlockQuoteTagHandler extends ExtensionTagHandler { return $wikiText; } - public function domToWikitext(ParsoidExtensionAPI $extApi, \DOMElement $node, bool $wrapperUnmodified): string { + public function domToWikitext(ParsoidExtensionAPI $extApi, Element $node, bool $wrapperUnmodified): string { $innerCode = $this->getInnerWikitext($extApi, $node); return "\n{$innerCode}\n"; } diff --git a/includes/Isekai.php b/includes/Isekai.php index c4b86bd..66fda91 100644 --- a/includes/Isekai.php +++ b/includes/Isekai.php @@ -3,14 +3,15 @@ namespace Isekai; use MediaWiki\MediaWikiServices; -use Config; -use OutputPage; -use Html; -use Title; +use MediaWiki\Config\Config; +use MediaWiki\Output\OutputPage; +use MediaWiki\Html\Html; +use MediaWiki\Title\Title; +use MediaWiki\User\User; +use MediaWiki\EditPage\EditPage; use MediaWiki\Linker\LinkRenderer; use MediaWiki\Linker\LinkTarget; -use User; -use EditPage; +use MediaWiki\Parser\Parser; use Isekai\Job\CheckActivatedEditorJob; class Isekai { @@ -265,10 +266,10 @@ HTML } } - public static function onParserBeforeInternalParse(\Parser $parser, &$text, $strip_state) { + public static function onParserBeforeInternalParse(Parser $parser, &$text, $strip_state) { $title = $parser->getPage(); - if ($title !== null && $title instanceof \Title && $title->isSubpage()) { + if ($title !== null && $title instanceof Title && $title->isSubpage()) { //更改显示的标题 $titleText = $title->getPrefixedText(); if ($titleText) { diff --git a/includes/IsekaiChart.php b/includes/IsekaiChart.php index 38ed701..db9294a 100644 --- a/includes/IsekaiChart.php +++ b/includes/IsekaiChart.php @@ -1,7 +1,7 @@