|
|
|
@ -20,9 +20,16 @@ class FontFaceWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$service = MediaWikiServices::getInstance();
|
|
|
|
|
/** @var \MediaWiki\Parser\ParserOutput */
|
|
|
|
|
$out = $parser->getOutput();
|
|
|
|
|
|
|
|
|
|
$fontName = 'extra-' . $params['name'];
|
|
|
|
|
$existsFonts = $parser->extIsekaiWidgetsCache->get('extraFonts', INF, []);
|
|
|
|
|
|
|
|
|
|
$existsFonts = $out->getExtensionData('IsekaiWidgets.extraFonts');
|
|
|
|
|
if (!$existsFonts) {
|
|
|
|
|
$existsFonts = [];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isset($existsFonts[$fontName])) {
|
|
|
|
|
return '<span class="error">' .
|
|
|
|
|
wfMessage('isekai-fontface-error-font-already-defined', $params['name'])->parse() .
|
|
|
|
@ -48,7 +55,7 @@ class FontFaceWidget {
|
|
|
|
|
".isekai-extra-font.font-{$fontId}{font-family:'{$fontName}'}</style></span>";
|
|
|
|
|
|
|
|
|
|
$existsFonts[$fontName] = $fontId;
|
|
|
|
|
$existsFonts = $parser->extIsekaiWidgetsCache->set('extraFonts', $existsFonts);
|
|
|
|
|
$out->setExtensionData('IsekaiWidgets.extraFonts', $existsFonts);
|
|
|
|
|
|
|
|
|
|
return [$css, "markerType" => 'nowiki'];
|
|
|
|
|
}
|
|
|
|
|