mirror of
https://github.com/StarCitizenTools/mediawiki-extensions-TabberNeue.git
synced 2024-12-17 18:40:51 +00:00
perf: only call one instance of MediaWikiServices
This commit is contained in:
parent
a98f2f7791
commit
724e347ca1
|
@ -169,8 +169,9 @@ class TabberTransclude {
|
||||||
$frame
|
$frame
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
$service = MediaWikiServices::getInstance();
|
||||||
// Add a link placeholder, as a fallback if JavaScript doesn't execute
|
// Add a link placeholder, as a fallback if JavaScript doesn't execute
|
||||||
$linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
|
$linkRenderer = $service->getLinkRenderer();
|
||||||
$tabBody = sprintf(
|
$tabBody = sprintf(
|
||||||
'<div class="tabber__transclusion">%s</div>',
|
'<div class="tabber__transclusion">%s</div>',
|
||||||
$linkRenderer->makeLink( $title, null, [ 'rel' => 'nofollow' ] )
|
$linkRenderer->makeLink( $title, null, [ 'rel' => 'nofollow' ] )
|
||||||
|
@ -182,13 +183,13 @@ class TabberTransclude {
|
||||||
urlencode( $pageName )
|
urlencode( $pageName )
|
||||||
);
|
);
|
||||||
|
|
||||||
$utils = MediaWikiServices::getInstance()->getUrlUtils();
|
$utils = $service->getUrlUtils();
|
||||||
$utils->expand( wfScript( 'api' ) . $query, PROTO_CANONICAL );
|
$utils->expand( wfScript( 'api' ) . $query, PROTO_CANONICAL );
|
||||||
|
|
||||||
$dataProps['load-url'] = $utils->expand( wfScript( 'api' ) . $query, PROTO_CANONICAL );
|
$dataProps['load-url'] = $utils->expand( wfScript( 'api' ) . $query, PROTO_CANONICAL );
|
||||||
$oldTabBody = $tabBody;
|
$oldTabBody = $tabBody;
|
||||||
// Allow extensions to update the lazy loaded tab
|
// Allow extensions to update the lazy loaded tab
|
||||||
MediaWikiServices::getInstance()->getHookContainer()->run(
|
$service->getHookContainer()->run(
|
||||||
'TabberNeueRenderLazyLoadedTab',
|
'TabberNeueRenderLazyLoadedTab',
|
||||||
[ &$tabBody, &$dataProps, $parser, $frame ]
|
[ &$tabBody, &$dataProps, $parser, $frame ]
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue