移除FontAwesome,增加全屏按钮
parent
6f689ab895
commit
5bb602d909
@ -1,364 +1,363 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Isekai;
|
namespace Isekai;
|
||||||
|
|
||||||
use MediaWiki\MediaWikiServices;
|
use MediaWiki\MediaWikiServices;
|
||||||
use Config;
|
use Config;
|
||||||
use OutputPage;
|
use OutputPage;
|
||||||
use Html;
|
use Html;
|
||||||
use Title;
|
use Title;
|
||||||
use MediaWiki\Linker\LinkRenderer;
|
use MediaWiki\Linker\LinkRenderer;
|
||||||
use MediaWiki\Linker\LinkTarget;
|
use MediaWiki\Linker\LinkTarget;
|
||||||
use User;
|
use User;
|
||||||
use EditPage;
|
use EditPage;
|
||||||
|
|
||||||
class Isekai {
|
class Isekai {
|
||||||
public static function onLoad(OutputPage $output) {
|
public static function onLoad(OutputPage $output) {
|
||||||
$title = $output->getTitle();
|
$title = $output->getTitle();
|
||||||
|
|
||||||
self::setHeader($output);
|
self::setHeader($output);
|
||||||
|
|
||||||
if ($title->inNamespace(NS_USER)) {
|
if ($title->inNamespace(NS_USER)) {
|
||||||
self::onUserPage($output);
|
self::onUserPage($output);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($title->inNamespace(NS_MAIN)) {
|
if ($title->inNamespace(NS_MAIN)) {
|
||||||
self::handleSubpageTitle($output);
|
self::handleSubpageTitle($output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function setHeader(OutputPage $outputPage) {
|
public static function setHeader(OutputPage $outputPage) {
|
||||||
$outputPage->addHeadItem('dns-prefetch-main', Html::element('link', ['rel' => 'dns-prefetch', 'href' => '//www.isekai.cn']));
|
$outputPage->addHeadItem('dns-prefetch-main', Html::element('link', ['rel' => 'dns-prefetch', 'href' => '//www.isekai.cn']));
|
||||||
$outputPage->addHeadItem('sitemap-link', Html::element('link', [
|
$outputPage->addHeadItem('sitemap-link', Html::element('link', [
|
||||||
'rel' => 'sitemap', 'type' => 'application/xml',
|
'rel' => 'sitemap', 'type' => 'application/xml',
|
||||||
'title' => 'Sitemap', 'href' => '/sitemap/sitemap-index-wiki.xml',
|
'title' => 'Sitemap', 'href' => '/sitemap/sitemap-index-wiki.xml',
|
||||||
]));
|
]));
|
||||||
// $outputPage->addHeadItem('dns-prefetch-static', \Html::element('link', ['rel' => 'dns-prefetch', 'href' => '//static-www.isekai.cn']));
|
// $outputPage->addHeadItem('dns-prefetch-static', \Html::element('link', ['rel' => 'dns-prefetch', 'href' => '//static-www.isekai.cn']));
|
||||||
|
|
||||||
$outputPage->addMeta('robots', 'all');
|
$outputPage->addMeta('robots', 'all');
|
||||||
$outputPage->addMeta('revisit-after', '1 days');
|
$outputPage->addMeta('revisit-after', '1 days');
|
||||||
$outputPage->addMeta('author', '异世界百科');
|
$outputPage->addMeta('author', '异世界百科');
|
||||||
|
|
||||||
$outputPage->addModuleStyles('ext.isekai.styles');
|
$outputPage->addModuleStyles(['ext.isekai.styles']);
|
||||||
$outputPage->addModuleStyles('ext.fontawesome');
|
$outputPage->addModules(['ext.isekai', 'ext.isekai.function-btn']);
|
||||||
$outputPage->addModules('ext.isekai');
|
//$outputPage->addModules(['ext.treeview']);
|
||||||
//$outputPage->addModules('ext.treeview');
|
|
||||||
|
// 加载动画,三秒内未加载完成则强制显示
|
||||||
// 加载动画,三秒内未加载完成则强制显示
|
if ($outputPage->getSkin()->getSkinName() === 'timeless') {
|
||||||
if ($outputPage->getSkin()->getSkinName() === 'timeless') {
|
$outputPage->addHeadItem(
|
||||||
$outputPage->addHeadItem(
|
'loading-animate-script',
|
||||||
'loading-animate-script',
|
<<<HTML
|
||||||
<<<HTML
|
<script type="text/javascript">
|
||||||
<script type="text/javascript">
|
var c = document.documentElement.classList;
|
||||||
var c = document.documentElement.classList;
|
c.add('content-loading');
|
||||||
c.add('content-loading');
|
setTimeout(function() {
|
||||||
setTimeout(function() {
|
c.remove('content-loading');
|
||||||
c.remove('content-loading');
|
c.add('content-loaded');
|
||||||
c.add('content-loaded');
|
}, 3000);
|
||||||
}, 3000);
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
var b = getComputedStyle(document.body, null).backgroundColor;
|
||||||
var b = getComputedStyle(document.body, null).backgroundColor;
|
var a = document.createElement('div');
|
||||||
var a = document.createElement('div');
|
a.classList.add('page-loading-spinner');
|
||||||
a.classList.add('page-loading-spinner');
|
a.innerHTML = '<div class="spinner-box"><div class="circle-border"><div class="circle-core" style="background-color: ' + b + '"></div></div></div>';
|
||||||
a.innerHTML = '<div class="spinner-box"><div class="circle-border"><div class="circle-core" style="background-color: ' + b + '"></div></div></div>';
|
document.body.appendChild(a);
|
||||||
document.body.appendChild(a);
|
});
|
||||||
});
|
</script>
|
||||||
</script>
|
HTML
|
||||||
HTML
|
);
|
||||||
);
|
}
|
||||||
}
|
|
||||||
|
// 百度统计
|
||||||
// 百度统计
|
$outputPage->addHeadItem(
|
||||||
$outputPage->addHeadItem(
|
'baiduhm',
|
||||||
'baiduhm',
|
<<<HTML
|
||||||
<<<HTML
|
<script type="text/javascript">
|
||||||
<script type="text/javascript">
|
var _hmt = _hmt || [];
|
||||||
var _hmt = _hmt || [];
|
(function() {
|
||||||
(function() {
|
var hm = document.createElement("script");
|
||||||
var hm = document.createElement("script");
|
hm.src = "https://hm.baidu.com/hm.js?2f650f34db6f2bbffa0af4d4e91a09a9";
|
||||||
hm.src = "https://hm.baidu.com/hm.js?2f650f34db6f2bbffa0af4d4e91a09a9";
|
var s = document.getElementsByTagName("script")[0];
|
||||||
var s = document.getElementsByTagName("script")[0];
|
s.parentNode.insertBefore(hm, s);
|
||||||
s.parentNode.insertBefore(hm, s);
|
})();
|
||||||
})();
|
</script>
|
||||||
</script>
|
HTML
|
||||||
HTML
|
);
|
||||||
);
|
|
||||||
|
if ($outputPage->getUser() && $outputPage->getUser()->isRegistered()) {
|
||||||
if ($outputPage->getUser() && $outputPage->getUser()->isRegistered()) {
|
$outputPage->addBodyClasses(['logged-in']);
|
||||||
$outputPage->addBodyClasses(['logged-in']);
|
}
|
||||||
}
|
|
||||||
|
self::showAds($outputPage);
|
||||||
self::showAds($outputPage);
|
}
|
||||||
}
|
|
||||||
|
public static function showAds(OutputPage $outputPage) {
|
||||||
public static function showAds(OutputPage $outputPage) {
|
global $wgIsekaiShowAds;
|
||||||
global $wgIsekaiShowAds;
|
$service = MediaWikiServices::getInstance();
|
||||||
$service = MediaWikiServices::getInstance();
|
$isView = $outputPage->getContext()->getRequest()->getText( 'action', 'view' ) == 'view';
|
||||||
$isView = $outputPage->getContext()->getRequest()->getText( 'action', 'view' ) == 'view';
|
$showAdsSidebar = $service->getUserOptionsLookup()->getOption($outputPage->getUser(), 'isekai-show-ads-sidebar');
|
||||||
$showAdsSidebar = $service->getUserOptionsLookup()->getOption($outputPage->getUser(), 'isekai-show-ads-sidebar');
|
$showAdsBottom = $service->getUserOptionsLookup()->getOption($outputPage->getUser(), 'isekai-show-ads-bottom');
|
||||||
$showAdsBottom = $service->getUserOptionsLookup()->getOption($outputPage->getUser(), 'isekai-show-ads-bottom');
|
|
||||||
|
// 检测Adblock
|
||||||
// 检测Adblock
|
$outputPage->addHeadItem('adblock-detect', '<script src="/peel1.js"></script>');
|
||||||
$outputPage->addHeadItem('adblock-detect', '<script src="/peel1.js"></script>');
|
|
||||||
|
if($wgIsekaiShowAds
|
||||||
if($wgIsekaiShowAds
|
&& ($showAdsSidebar || $showAdsBottom)
|
||||||
&& ($showAdsSidebar || $showAdsBottom)
|
&& $outputPage->getTitle()->getNamespace() !== NS_SPECIAL
|
||||||
&& $outputPage->getTitle()->getNamespace() !== NS_SPECIAL
|
&& $isView){
|
||||||
&& $isView){
|
|
||||||
|
// 谷歌广告
|
||||||
// 谷歌广告
|
$outputPage->addHeadItem(
|
||||||
$outputPage->addHeadItem(
|
'googlead',
|
||||||
'googlead',
|
<<<HTML
|
||||||
<<<HTML
|
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8607817613161226" crossorigin="anonymous"></script>
|
||||||
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8607817613161226" crossorigin="anonymous"></script>
|
HTML
|
||||||
HTML
|
);
|
||||||
);
|
|
||||||
|
if ($showAdsSidebar && $outputPage->getSkin()->getSkinName() === 'timeless') {
|
||||||
if ($showAdsSidebar && $outputPage->getSkin()->getSkinName() === 'timeless') {
|
$outputPage->addHTML(
|
||||||
$outputPage->addHTML(
|
<<<HTML
|
||||||
<<<HTML
|
<script type="text/javascript">
|
||||||
<script type="text/javascript">
|
window.addEventListener('load', function () {
|
||||||
window.addEventListener('load', function () {
|
if (window.innerWidth >= 1100) {
|
||||||
if (window.innerWidth >= 1100) {
|
var adElem = document.createElement('div');
|
||||||
var adElem = document.createElement('div');
|
adElem.className = 'googlead-container googlead-container-sidebar';
|
||||||
adElem.className = 'googlead-container googlead-container-sidebar';
|
adElem.innerHTML = '<ins class="adsbygoogle" style="display:block;" data-ad-client="ca-pub-8607817613161226" data-ad-slot="8245595332" data-ad-format="rectangle" data-full-width-responsive="true"></ins>';
|
||||||
adElem.innerHTML = '<ins class="adsbygoogle" style="display:block;" data-ad-client="ca-pub-8607817613161226" data-ad-slot="8245595332" data-ad-format="rectangle" data-full-width-responsive="true"></ins>';
|
var relatedNav = document.querySelector('#mw-related-navigation');
|
||||||
var relatedNav = document.querySelector('#mw-related-navigation');
|
if (relatedNav) {
|
||||||
if (relatedNav) {
|
relatedNav.appendChild(adElem);
|
||||||
relatedNav.appendChild(adElem);
|
(adsbygoogle = window.adsbygoogle || []).push({});
|
||||||
(adsbygoogle = window.adsbygoogle || []).push({});
|
}
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
})
|
</script>
|
||||||
</script>
|
HTML
|
||||||
HTML
|
);
|
||||||
);
|
}
|
||||||
}
|
|
||||||
|
if ($showAdsBottom) {
|
||||||
if ($showAdsBottom) {
|
$outputPage->addHTML(
|
||||||
$outputPage->addHTML(
|
<<<HTML
|
||||||
<<<HTML
|
<div class="googlead-container googlead-container-bottom">
|
||||||
<div class="googlead-container googlead-container-bottom">
|
<ins class="adsbygoogle"
|
||||||
<ins class="adsbygoogle"
|
style="display:block"
|
||||||
style="display:block"
|
data-ad-client="ca-pub-8607817613161226"
|
||||||
data-ad-client="ca-pub-8607817613161226"
|
data-ad-slot="3245545943"
|
||||||
data-ad-slot="3245545943"
|
data-ad-format="horizontal"
|
||||||
data-ad-format="horizontal"
|
data-full-width-responsive="true"></ins>
|
||||||
data-full-width-responsive="true"></ins>
|
</div>
|
||||||
</div>
|
HTML
|
||||||
HTML
|
);
|
||||||
);
|
|
||||||
|
$outputPage->addHTML(
|
||||||
$outputPage->addHTML(
|
<<<HTML
|
||||||
<<<HTML
|
<script>
|
||||||
<script>
|
(adsbygoogle = window.adsbygoogle || []).push({});
|
||||||
(adsbygoogle = window.adsbygoogle || []).push({});
|
</script>
|
||||||
</script>
|
HTML
|
||||||
HTML
|
);
|
||||||
);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public static function onUserPage(OutputPage $outputPage) {
|
||||||
public static function onUserPage(OutputPage $outputPage) {
|
// 用户页
|
||||||
// 用户页
|
$title = $outputPage->getTitle();
|
||||||
$title = $outputPage->getTitle();
|
if ($title->inNamespace(NS_USER)) {
|
||||||
if ($title->inNamespace(NS_USER)) {
|
$userName = $title->getText();
|
||||||
$userName = $title->getText();
|
$user = MediaWikiServices::getInstance()->getUserFactory()->newFromName($userName);
|
||||||
$user = MediaWikiServices::getInstance()->getUserFactory()->newFromName($userName);
|
if ($user && $user->isRegistered()) {
|
||||||
if ($user && $user->isRegistered()) {
|
$showName = $user->getRealName();
|
||||||
$showName = $user->getRealName();
|
if (!$showName) {
|
||||||
if (!$showName) {
|
$showName = $userName;
|
||||||
$showName = $userName;
|
}
|
||||||
}
|
$outputPage->setPageTitle($showName);
|
||||||
$outputPage->setPageTitle($showName);
|
$outputPage->setSubtitle('@' . $title->getText());
|
||||||
$outputPage->setSubtitle('@' . $title->getText());
|
$outputPage->setHTMLTitle(wfMessage('group-user')->text() . ' - ' . $outputPage->getHTMLTitle());
|
||||||
$outputPage->setHTMLTitle(wfMessage('group-user')->text() . ' - ' . $outputPage->getHTMLTitle());
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public static function handleSubpageTitle(OutputPage $outputPage) {
|
||||||
public static function handleSubpageTitle(OutputPage $outputPage) {
|
if (!$outputPage->isArticle()) return;
|
||||||
if (!$outputPage->isArticle()) return;
|
|
||||||
|
$title = $outputPage->getTitle();
|
||||||
$title = $outputPage->getTitle();
|
if ($title) {
|
||||||
if ($title) {
|
if ($title->isSubpage()) {
|
||||||
if ($title->isSubpage()) {
|
//更改显示的标题
|
||||||
//更改显示的标题
|
$titleText = $title->getPrefixedText();
|
||||||
$titleText = $title->getPrefixedText();
|
|
||||||
|
$currentDisplayTitle = $outputPage->getDisplayTitle();
|
||||||
$currentDisplayTitle = $outputPage->getDisplayTitle();
|
$htmlTitle = $outputPage->getHTMLTitle();
|
||||||
$htmlTitle = $outputPage->getHTMLTitle();
|
if (strpos($htmlTitle, $currentDisplayTitle) === 0) {
|
||||||
if (strpos($htmlTitle, $currentDisplayTitle) === 0) {
|
// 将HTML标题替换为完整标题
|
||||||
// 将HTML标题替换为完整标题
|
$htmlTitleText = $currentDisplayTitle . ' (' . dirname($titleText) . ')';
|
||||||
$htmlTitleText = $currentDisplayTitle . ' (' . dirname($titleText) . ')';
|
$outputPage->setHTMLTitle($htmlTitleText . substr($htmlTitle, strlen($currentDisplayTitle)));
|
||||||
$outputPage->setHTMLTitle($htmlTitleText . substr($htmlTitle, strlen($currentDisplayTitle)));
|
$outputPage->addMeta('title', $htmlTitleText);
|
||||||
$outputPage->addMeta('title', $htmlTitleText);
|
}
|
||||||
}
|
|
||||||
|
//面包屑
|
||||||
//面包屑
|
$titlePathList = explode('/', $titleText);
|
||||||
$titlePathList = explode('/', $titleText);
|
$titlePathLen = count($titlePathList);
|
||||||
$titlePathLen = count($titlePathList);
|
$breadcrumbsHtml = [
|
||||||
$breadcrumbsHtml = [
|
Html::openElement('ol', ['class' => 'breadcrumb']),
|
||||||
Html::openElement('ol', ['class' => 'breadcrumb']),
|
];
|
||||||
];
|
$linkRender = MediaWikiServices::getInstance()->getLinkRenderer();
|
||||||
$linkRender = MediaWikiServices::getInstance()->getLinkRenderer();
|
foreach ($titlePathList as $key => $titleName) {
|
||||||
foreach ($titlePathList as $key => $titleName) {
|
if ($key === $titlePathLen - 1) {
|
||||||
if ($key === $titlePathLen - 1) {
|
$breadcrumbsHtml[] = Html::element('li', ['class' => 'active'], $titleName);
|
||||||
$breadcrumbsHtml[] = Html::element('li', ['class' => 'active'], $titleName);
|
} else {
|
||||||
} else {
|
$titleSubPath = implode('/', array_slice($titlePathList, 0, $key + 1));
|
||||||
$titleSubPath = implode('/', array_slice($titlePathList, 0, $key + 1));
|
$currentTitle = Title::newFromText($titleSubPath);
|
||||||
$currentTitle = Title::newFromText($titleSubPath);
|
if ($currentTitle) {
|
||||||
if ($currentTitle) {
|
$link = $linkRender->makeLink(Title::newFromText($titleSubPath), $titleName);
|
||||||
$link = $linkRender->makeLink(Title::newFromText($titleSubPath), $titleName);
|
} else {
|
||||||
} else {
|
$link = $titleSubPath;
|
||||||
$link = $titleSubPath;
|
}
|
||||||
}
|
|
||||||
|
if ($key === 0) {
|
||||||
if ($key === 0) {
|
$breadcrumbsHtml[] = Html::openElement('li', ['class' => 'root']) . $link . Html::closeElement('li');
|
||||||
$breadcrumbsHtml[] = Html::openElement('li', ['class' => 'root']) . $link . Html::closeElement('li');
|
} else {
|
||||||
} else {
|
$breadcrumbsHtml[] = Html::openElement('li') . $link . Html::closeElement('li');
|
||||||
$breadcrumbsHtml[] = Html::openElement('li') . $link . Html::closeElement('li');
|
}
|
||||||
}
|
|
||||||
|
$breadcrumbsHtml[] = Html::openElement('span', ['class' => 'breadcrumb-divider']) . '/' . Html::closeElement('span');
|
||||||
$breadcrumbsHtml[] = Html::openElement('span', ['class' => 'breadcrumb-divider']) . '/' . Html::closeElement('span');
|
}
|
||||||
}
|
}
|
||||||
}
|
$breadcrumbsHtml[] = Html::closeElement('ol');
|
||||||
$breadcrumbsHtml[] = Html::closeElement('ol');
|
$html = implode($breadcrumbsHtml);
|
||||||
$html = implode($breadcrumbsHtml);
|
|
||||||
|
// 阻止出现subtitle空行
|
||||||
// 阻止出现subtitle空行
|
$subtitle = $outputPage->getSubtitle();
|
||||||
$subtitle = $outputPage->getSubtitle();
|
$outputPage->setSubtitle($subtitle . $html);
|
||||||
$outputPage->setSubtitle($subtitle . $html);
|
} else {
|
||||||
} else {
|
$currentDisplayTitle = $outputPage->getDisplayTitle();
|
||||||
$currentDisplayTitle = $outputPage->getDisplayTitle();
|
if ($currentDisplayTitle) {
|
||||||
if ($currentDisplayTitle) {
|
$currentDisplayTitle = strip_tags($currentDisplayTitle);
|
||||||
$currentDisplayTitle = strip_tags($currentDisplayTitle);
|
$outputPage->addMeta('title', $currentDisplayTitle);
|
||||||
$outputPage->addMeta('title', $currentDisplayTitle);
|
|
||||||
|
if ($currentDisplayTitle !== $title->getPrefixedText()) {
|
||||||
if ($currentDisplayTitle !== $title->getPrefixedText()) {
|
// 输出原标题
|
||||||
// 输出原标题
|
$breadcrumbsHtml = [
|
||||||
$breadcrumbsHtml = [
|
Html::openElement('ol', ['class' => 'breadcrumb']),
|
||||||
Html::openElement('ol', ['class' => 'breadcrumb']),
|
Html::element('li', ['class' => 'root active'], $title->getPrefixedText()),
|
||||||
Html::element('li', ['class' => 'root active'], $title->getPrefixedText()),
|
Html::closeElement('ol'),
|
||||||
Html::closeElement('ol'),
|
];
|
||||||
];
|
$html = implode($breadcrumbsHtml);
|
||||||
$html = implode($breadcrumbsHtml);
|
|
||||||
|
$subtitle = $outputPage->getSubtitle();
|
||||||
$subtitle = $outputPage->getSubtitle();
|
$outputPage->setSubtitle($subtitle . $html);
|
||||||
$outputPage->setSubtitle($subtitle . $html);
|
}
|
||||||
}
|
} else {
|
||||||
} else {
|
$outputPage->addMeta('title', $title->getPrefixedText());
|
||||||
$outputPage->addMeta('title', $title->getPrefixedText());
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public static function onParserBeforeInternalParse(\Parser $parser, &$text, $strip_state) {
|
||||||
public static function onParserBeforeInternalParse(\Parser $parser, &$text, $strip_state) {
|
$title = $parser->getPage();
|
||||||
$title = $parser->getPage();
|
|
||||||
|
if ($title !== null && $title instanceof \Title && $title->isSubpage()) {
|
||||||
if ($title !== null && $title instanceof \Title && $title->isSubpage()) {
|
//更改显示的标题
|
||||||
//更改显示的标题
|
$titleText = $title->getPrefixedText();
|
||||||
$titleText = $title->getPrefixedText();
|
if ($titleText) {
|
||||||
if ($titleText) {
|
$parser->getOutput()->setTitleText(basename($titleText));
|
||||||
$parser->getOutput()->setTitleText(basename($titleText));
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public static function onHtmlPageLinkRendererBegin(
|
||||||
public static function onHtmlPageLinkRendererBegin(
|
LinkRenderer $linkRenderer, LinkTarget $target,
|
||||||
LinkRenderer $linkRenderer, LinkTarget $target,
|
&$text, &$extraAttribs, &$query, &$ret
|
||||||
&$text, &$extraAttribs, &$query, &$ret
|
) {
|
||||||
) {
|
if ($target->inNamespace(NS_USER)) {
|
||||||
if ($target->inNamespace(NS_USER)) {
|
$userName = $target->getText();
|
||||||
$userName = $target->getText();
|
$user = MediaWikiServices::getInstance()->getUserFactory()->newFromName($userName);
|
||||||
$user = MediaWikiServices::getInstance()->getUserFactory()->newFromName($userName);
|
if ($user && $user->isRegistered()) {
|
||||||
if ($user && $user->isRegistered()) {
|
$showName = $user->getRealName();
|
||||||
$showName = $user->getRealName();
|
if ($showName) {
|
||||||
if ($showName) {
|
$text = $showName;
|
||||||
$text = $showName;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public static function onAttemptSave(EditPage $editPage) {
|
||||||
public static function onAttemptSave(EditPage $editPage) {
|
$services = MediaWikiServices::getInstance();
|
||||||
$services = MediaWikiServices::getInstance();
|
$title = $editPage->getTitle();
|
||||||
$title = $editPage->getTitle();
|
if (
|
||||||
if (
|
!$title || !$title->inNamespace(NS_MAIN) ||
|
||||||
!$title || !$title->inNamespace(NS_MAIN) ||
|
!$title->isSubpage() || $title->exists()
|
||||||
!$title->isSubpage() || $title->exists()
|
) {
|
||||||
) {
|
return true;
|
||||||
return true;
|
}
|
||||||
}
|
$path = explode('/', $title->getBaseText());
|
||||||
$path = explode('/', $title->getBaseText());
|
$categoryList = [];
|
||||||
$categoryList = [];
|
$pathLen = count($path);
|
||||||
$pathLen = count($path);
|
for ($i = 0; $i < $pathLen; $i ++) {
|
||||||
for ($i = 0; $i < $pathLen; $i ++) {
|
if ($i === 0) {
|
||||||
if ($i === 0) {
|
$categoryList[] = $path[0];
|
||||||
$categoryList[] = $path[0];
|
} else {
|
||||||
} else {
|
$categoryList[] = implode('/', array_slice($path, 0, $i + 1));
|
||||||
$categoryList[] = implode('/', array_slice($path, 0, $i + 1));
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
$categorySyntaxList = [];
|
||||||
$categorySyntaxList = [];
|
$categoryNsText = $services->getContentLanguage()->
|
||||||
$categoryNsText = $services->getContentLanguage()->
|
getNsText($services->getNamespaceInfo()->getSubject(NS_CATEGORY));
|
||||||
getNsText($services->getNamespaceInfo()->getSubject(NS_CATEGORY));
|
foreach ($categoryList as $categoryName) {
|
||||||
foreach ($categoryList as $categoryName) {
|
$categorySyntaxList[] = "[[{$categoryNsText}:{$categoryName}]]";
|
||||||
$categorySyntaxList[] = "[[{$categoryNsText}:{$categoryName}]]";
|
}
|
||||||
}
|
if (substr($editPage->textbox1, -1, 1) !== "\n") {
|
||||||
if (substr($editPage->textbox1, -1, 1) !== "\n") {
|
$editPage->textbox1 .= "\n" . implode("", $categorySyntaxList);
|
||||||
$editPage->textbox1 .= "\n" . implode("", $categorySyntaxList);
|
} else {
|
||||||
} else {
|
$editPage->textbox1 .= implode("", $categorySyntaxList);
|
||||||
$editPage->textbox1 .= implode("", $categorySyntaxList);
|
}
|
||||||
}
|
return true;
|
||||||
return true;
|
}
|
||||||
}
|
|
||||||
|
public static function onResourceLoaderGetConfigVars(array &$vars, string $skin, Config $config){
|
||||||
public static function onResourceLoaderGetConfigVars(array &$vars, string $skin, Config $config){
|
$vars['wgIsekaiShowAds'] = $config->get('IsekaiShowAds');
|
||||||
$vars['wgIsekaiShowAds'] = $config->get('IsekaiShowAds');
|
}
|
||||||
}
|
|
||||||
|
public static function onGetPreferences(User $user, array &$preferences){
|
||||||
public static function onGetPreferences(User $user, array &$preferences){
|
$preferences['isekai-show-ads-bottom'] = [
|
||||||
$preferences['isekai-show-ads-bottom'] = [
|
'type' => 'toggle',
|
||||||
'type' => 'toggle',
|
'label-message' => 'isekai-show-ads-bottom',
|
||||||
'label-message' => 'isekai-show-ads-bottom',
|
'section' => 'misc/isekai-ads',
|
||||||
'section' => 'misc/isekai-ads',
|
];
|
||||||
];
|
|
||||||
|
$preferences['isekai-show-ads-sidebar'] = [
|
||||||
$preferences['isekai-show-ads-sidebar'] = [
|
'type' => 'toggle',
|
||||||
'type' => 'toggle',
|
'label-message' => 'isekai-show-ads-sidebar',
|
||||||
'label-message' => 'isekai-show-ads-sidebar',
|
'section' => 'misc/isekai-ads',
|
||||||
'section' => 'misc/isekai-ads',
|
];
|
||||||
];
|
}
|
||||||
}
|
|
||||||
|
public static function onCirrusSearchAnalysisConfig(array &$config, $builder) {
|
||||||
public static function onCirrusSearchAnalysisConfig(array &$config, $builder) {
|
if (isset($config['filter']['smartcn_stop'])) { // 处理中文Analysis Config
|
||||||
if (isset($config['filter']['smartcn_stop'])) { // 处理中文Analysis Config
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public static function onMugenAppGetAvatar(&$avatarUrl, $size, $user) {
|
||||||
public static function onMugenAppGetAvatar(&$avatarUrl, $size, $user) {
|
if (!$user) {
|
||||||
if (!$user) {
|
$avatarUrl = "https://account.isekai.cn/realms/isekai/avatar/default";
|
||||||
$avatarUrl = "https://account.isekai.cn/realms/isekai/avatar/default";
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
$userName = $user->getName();
|
||||||
$userName = $user->getName();
|
|
||||||
|
$avatarBase = 'https://account.isekai.cn/realms/isekai/avatar/by-username/' . $userName;
|
||||||
$avatarBase = 'https://account.isekai.cn/realms/isekai/avatar/by-username/' . $userName;
|
|
||||||
|
if ($size <= 64) {
|
||||||
if ($size <= 64) {
|
$avatarUrl = "$avatarBase?size=md";
|
||||||
$avatarUrl = "$avatarBase?size=md";
|
} else if ($size <= 128) {
|
||||||
} else if ($size <= 128) {
|
$avatarUrl = "$avatarBase?size=lg";
|
||||||
$avatarUrl = "$avatarBase?size=lg";
|
} else if ($size <= 256) {
|
||||||
} else if ($size <= 256) {
|
$avatarUrl = "$avatarBase?size=xl";
|
||||||
$avatarUrl = "$avatarBase?size=xl";
|
} else {
|
||||||
} else {
|
$avatarUrl = "$avatarBase?size=xxl";
|
||||||
$avatarUrl = "$avatarBase?size=xxl";
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,143 +1,148 @@
|
|||||||
{
|
{
|
||||||
"name": "Isekai wiki misc",
|
"name": "Isekai wiki misc",
|
||||||
"namemsg": "isekaiwiki-misc-name",
|
"namemsg": "isekaiwiki-misc-name",
|
||||||
"author": "Hyperzlib",
|
"author": "Hyperzlib",
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"url": "https://www.isekai.cn",
|
"url": "https://www.isekai.cn",
|
||||||
"descriptionmsg": "isekaiwiki-misc-desc",
|
"descriptionmsg": "isekaiwiki-misc-desc",
|
||||||
"license-name": "MIT",
|
"license-name": "MIT",
|
||||||
"type": "other",
|
"type": "other",
|
||||||
"requires": {
|
"requires": {
|
||||||
|
|
||||||
},
|
},
|
||||||
"MessagesDirs": {
|
"MessagesDirs": {
|
||||||
"IsekaiMisc": [
|
"IsekaiMisc": [
|
||||||
"i18n"
|
"i18n"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"AutoloadClasses": {
|
"AutoloadClasses": {
|
||||||
"Isekai\\InfoBox": "InfoBox.class.php",
|
"Isekai\\InfoBox": "InfoBox.class.php",
|
||||||
"Isekai\\IsekaiChart": "IsekaiChart.class.php",
|
"Isekai\\IsekaiChart": "IsekaiChart.class.php",
|
||||||
"Isekai\\Isekai": "Isekai.class.php"
|
"Isekai\\Isekai": "Isekai.class.php"
|
||||||
},
|
},
|
||||||
"ExtensionMessagesFiles": {
|
"ExtensionMessagesFiles": {
|
||||||
"IsekaiMagic": "Isekai.i18n.php"
|
"IsekaiMagic": "Isekai.i18n.php"
|
||||||
},
|
},
|
||||||
"Hooks": {
|
"Hooks": {
|
||||||
"ParserFirstCallInit": [
|
"ParserFirstCallInit": [
|
||||||
"Isekai\\InfoBox::onParserSetup",
|
"Isekai\\InfoBox::onParserSetup",
|
||||||
"Isekai\\IsekaiChart::onParserSetup"
|
"Isekai\\IsekaiChart::onParserSetup"
|
||||||
],
|
],
|
||||||
"BeforePageDisplay": [
|
"BeforePageDisplay": [
|
||||||
"Isekai\\Isekai::onLoad"
|
"Isekai\\Isekai::onLoad"
|
||||||
],
|
],
|
||||||
"ParserBeforeInternalParse": [
|
"ParserBeforeInternalParse": [
|
||||||
"Isekai\\Isekai::onParserBeforeInternalParse"
|
"Isekai\\Isekai::onParserBeforeInternalParse"
|
||||||
],
|
],
|
||||||
"HtmlPageLinkRendererBegin": [
|
"HtmlPageLinkRendererBegin": [
|
||||||
"Isekai\\Isekai::onHtmlPageLinkRendererBegin"
|
"Isekai\\Isekai::onHtmlPageLinkRendererBegin"
|
||||||
],
|
],
|
||||||
"ResourceLoaderGetConfigVars": [
|
"ResourceLoaderGetConfigVars": [
|
||||||
"Isekai\\Isekai::onResourceLoaderGetConfigVars"
|
"Isekai\\Isekai::onResourceLoaderGetConfigVars"
|
||||||
],
|
],
|
||||||
"GetPreferences": [
|
"GetPreferences": [
|
||||||
"Isekai\\Isekai::onGetPreferences"
|
"Isekai\\Isekai::onGetPreferences"
|
||||||
],
|
],
|
||||||
"EditPage::attemptSave": [
|
"EditPage::attemptSave": [
|
||||||
"Isekai\\Isekai::onAttemptSave"
|
"Isekai\\Isekai::onAttemptSave"
|
||||||
],
|
],
|
||||||
"CirrusSearchAnalysisConfig": [
|
"CirrusSearchAnalysisConfig": [
|
||||||
"Isekai\\Isekai::onCirrusSearchAnalysisConfig"
|
"Isekai\\Isekai::onCirrusSearchAnalysisConfig"
|
||||||
],
|
],
|
||||||
"MugenAppGetAvatar": [
|
"MugenAppGetAvatar": [
|
||||||
"Isekai\\Isekai::onMugenAppGetAvatar"
|
"Isekai\\Isekai::onMugenAppGetAvatar"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"ResourceModules": {
|
"ResourceModules": {
|
||||||
"ext.isekai": {
|
"ext.isekai": {
|
||||||
"scripts": ["ext.isekai.js"],
|
"scripts": ["ext.isekai.js"],
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"oojs-ui-core",
|
"oojs-ui-core",
|
||||||
"oojs-ui-windows",
|
"oojs-ui-windows",
|
||||||
"mediawiki.user"
|
"mediawiki.user"
|
||||||
],
|
],
|
||||||
"targets": [
|
"targets": [
|
||||||
"desktop",
|
"desktop",
|
||||||
"mobile"
|
"mobile"
|
||||||
],
|
],
|
||||||
"messages": [
|
"messages": [
|
||||||
"isekai-collapse-show",
|
"isekai-collapse-show",
|
||||||
"isekai-collapse-hide",
|
"isekai-collapse-hide",
|
||||||
"isekai-editor-prompt-content",
|
"isekai-editor-prompt-content",
|
||||||
"isekai-editor-prompt-btn-cancel",
|
"isekai-editor-prompt-btn-cancel",
|
||||||
"isekai-editor-prompt-btn-use-mobile",
|
"isekai-editor-prompt-btn-use-mobile",
|
||||||
"isekai-editor-prompt-btn-use-desktop",
|
"isekai-editor-prompt-btn-use-desktop",
|
||||||
"isekai-login-prompt-content",
|
"isekai-login-prompt-content",
|
||||||
"isekai-login-prompt-btn-login",
|
"isekai-login-prompt-btn-login",
|
||||||
"isekai-login-prompt-btn-createaccount",
|
"isekai-login-prompt-btn-createaccount",
|
||||||
"isekai-login-prompt-btn-cancel",
|
"isekai-login-prompt-btn-cancel",
|
||||||
"isekai-ads-prompt-title",
|
"isekai-ads-prompt-title",
|
||||||
"isekai-ads-prompt-content",
|
"isekai-ads-prompt-content",
|
||||||
"isekai-ads-prompt-btn-cancel",
|
"isekai-ads-prompt-btn-cancel",
|
||||||
"nav-login-createaccount",
|
"nav-login-createaccount",
|
||||||
"visualeditor-savedialog-label-set-categories"
|
"visualeditor-savedialog-label-set-categories"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"ext.isekai.styles": {
|
"ext.isekai.styles": {
|
||||||
"styles": ["ext.isekai.less"],
|
"styles": ["ext.isekai.less"],
|
||||||
"targets": [
|
"targets": [
|
||||||
"desktop",
|
"desktop",
|
||||||
"mobile"
|
"mobile"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"ext.fontawesome": {
|
"lib.isekai.echarts": {
|
||||||
"styles": [
|
"scripts": ["lib/echarts.custom.min.js"]
|
||||||
"lib/fontawesome/_fontawesome.css",
|
},
|
||||||
"fontawesome.less"
|
"ext.isekai.chart": {
|
||||||
],
|
"scripts": ["ext.isekai.chart.js"],
|
||||||
"targets": [
|
"styles": ["ext.isekai.chart.less"]
|
||||||
"desktop",
|
},
|
||||||
"mobile"
|
"ext.treeview": {
|
||||||
]
|
"scripts": ["ext.treeview.js"],
|
||||||
},
|
"styles": ["ext.treeview.css"],
|
||||||
"lib.isekai.echarts": {
|
"targets": [
|
||||||
"scripts": ["lib/echarts.custom.min.js"]
|
"desktop",
|
||||||
},
|
"mobile"
|
||||||
"ext.isekai.chart": {
|
]
|
||||||
"scripts": ["ext.isekai.chart.js"],
|
},
|
||||||
"styles": ["ext.isekai.chart.less"]
|
"ext.isekai.ve": {
|
||||||
},
|
"scripts": ["ext.isekai.ve.js"],
|
||||||
"ext.treeview": {
|
"targets": [
|
||||||
"scripts": ["ext.treeview.js"],
|
"desktop",
|
||||||
"styles": ["ext.treeview.css"],
|
"mobile"
|
||||||
"targets": [
|
]
|
||||||
"desktop",
|
},
|
||||||
"mobile"
|
"ext.isekai.function-btn": {
|
||||||
]
|
"scripts": ["ext.isekai.function-btn.js"],
|
||||||
},
|
"dependencies": [
|
||||||
"ext.isekai.ve": {
|
"ext.isekai.baseWidgets",
|
||||||
"scripts": ["ext.isekai.ve.js"],
|
"oojs-ui.styles.icons-media"
|
||||||
"targets": [
|
],
|
||||||
"desktop",
|
"targets": [
|
||||||
"mobile"
|
"desktop",
|
||||||
]
|
"mobile"
|
||||||
}
|
],
|
||||||
},
|
"messages": [
|
||||||
"VisualEditorPluginModules": [
|
"isekai-function-btn-fullscreen",
|
||||||
"ext.isekai.ve"
|
"isekai-function-btn-exit-fullscreen"
|
||||||
],
|
]
|
||||||
"ResourceFileModulePaths": {
|
}
|
||||||
"localBasePath": "modules",
|
},
|
||||||
"remoteExtPath": "IsekaiMisc/modules"
|
"VisualEditorPluginModules": [
|
||||||
},
|
"ext.isekai.ve"
|
||||||
"DefaultUserOptions": {
|
],
|
||||||
"isekai-show-ads-bottom": true,
|
"ResourceFileModulePaths": {
|
||||||
"isekai-show-ads-sidebar": true
|
"localBasePath": "modules",
|
||||||
},
|
"remoteExtPath": "IsekaiMisc/modules"
|
||||||
"config": {
|
},
|
||||||
"IsekaiShowAds": {
|
"DefaultUserOptions": {
|
||||||
"value": false
|
"isekai-show-ads-bottom": true,
|
||||||
}
|
"isekai-show-ads-sidebar": true
|
||||||
},
|
},
|
||||||
"manifest_version": 2
|
"config": {
|
||||||
|
"IsekaiShowAds": {
|
||||||
|
"value": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"manifest_version": 2
|
||||||
}
|
}
|
@ -1,36 +1,39 @@
|
|||||||
{
|
{
|
||||||
"isekaiwiki-misc-name": "IsekaiWiki Misc",
|
"isekaiwiki-misc-name": "IsekaiWiki Misc",
|
||||||
"isekaiwiki-misc-desc": "Isekai wiki performance plugin",
|
"isekaiwiki-misc-desc": "Isekai wiki performance plugin",
|
||||||
|
|
||||||
"isekai-collapse-show": "Show",
|
"isekai-collapse-show": "Show",
|
||||||
"isekai-collapse-hide": "Hide",
|
"isekai-collapse-hide": "Hide",
|
||||||
|
|
||||||
"isekai-login-prompt-content": "Share your imagine world, contribute your fictional settings, and help more people! now, let's join the Fantasy World wiki.",
|
"isekai-login-prompt-content": "Share your imagine world, contribute your fictional settings, and help more people! now, let's join the Fantasy World wiki.",
|
||||||
"isekai-login-prompt-btn-login": "Login",
|
"isekai-login-prompt-btn-login": "Login",
|
||||||
"isekai-login-prompt-btn-createaccount": "Create Account",
|
"isekai-login-prompt-btn-createaccount": "Create Account",
|
||||||
"isekai-login-prompt-btn-cancel": "Cancel",
|
"isekai-login-prompt-btn-cancel": "Cancel",
|
||||||
|
|
||||||
"isekai-background-param-error": "Background image parameter error: ",
|
"isekai-background-param-error": "Background image parameter error: ",
|
||||||
|
|
||||||
"isekai-editor-prompt-content": "Please select the editor, use the Standard Editor will get a better writing experience.",
|
"isekai-editor-prompt-content": "Please select the editor, use the Standard Editor will get a better writing experience.",
|
||||||
"isekai-editor-prompt-btn-cancel": "Cancel",
|
"isekai-editor-prompt-btn-cancel": "Cancel",
|
||||||
"isekai-editor-prompt-btn-use-mobile": "Mobile Editor",
|
"isekai-editor-prompt-btn-use-mobile": "Mobile Editor",
|
||||||
"isekai-editor-prompt-btn-use-desktop": "Standard Editor",
|
"isekai-editor-prompt-btn-use-desktop": "Standard Editor",
|
||||||
|
|
||||||
"isekai-userpage": "User",
|
"isekai-userpage": "User",
|
||||||
|
|
||||||
"isekai-chart-undefined-type": "Undefined chart type",
|
"isekai-chart-undefined-type": "Undefined chart type",
|
||||||
"isekai-chart-unknow-type": "Unknow chart type: {0}",
|
"isekai-chart-unknow-type": "Unknow chart type: {0}",
|
||||||
"isekai-chart-transform-error": "Data conversion errors: {0}",
|
"isekai-chart-transform-error": "Data conversion errors: {0}",
|
||||||
"isekai-chart-default-row-name": "Data {0}",
|
"isekai-chart-default-row-name": "Data {0}",
|
||||||
|
|
||||||
"prefs-isekai-ads": "Support Fanta World Wiki",
|
"prefs-isekai-ads": "Support Fanta World Wiki",
|
||||||
"isekai-show-ads-bottom": "Display ads at the bottom of the content page",
|
"isekai-show-ads-bottom": "Display ads at the bottom of the content page",
|
||||||
"isekai-show-ads-sidebar": "Display ads in the sidebar of the PC version",
|
"isekai-show-ads-sidebar": "Display ads in the sidebar of the PC version",
|
||||||
|
|
||||||
"isekai-ads-prompt-title": "Please allow ads on Fanta World Wiki",
|
"isekai-ads-prompt-title": "Please allow ads on Fanta World Wiki",
|
||||||
"isekai-ads-prompt-content": "<p>Looks like you're using an ad blocker.</p><p>Fanta World Wiki rely on advertising to help fund our site.</p><p>If you want to support Fanta World Wiki, you can turn off Adblock, Adblock Pro, and other plugins on this site.</p>",
|
"isekai-ads-prompt-content": "<p>Looks like you're using an ad blocker.</p><p>Fanta World Wiki rely on advertising to help fund our site.</p><p>If you want to support Fanta World Wiki, you can turn off Adblock, Adblock Pro, and other plugins on this site.</p>",
|
||||||
"isekai-ads-prompt-btn-cancel": "No longer display",
|
"isekai-ads-prompt-btn-cancel": "No longer display",
|
||||||
|
|
||||||
"visualeditor-savedialog-label-set-categories": "Select categories"
|
"visualeditor-savedialog-label-set-categories": "Select categories",
|
||||||
|
|
||||||
|
"isekai-function-btn-fullscreen": "Full screen",
|
||||||
|
"isekai-function-btn-exit-fullscreen": "Exit full screen"
|
||||||
}
|
}
|
@ -0,0 +1,57 @@
|
|||||||
|
var fullScreenBtn;
|
||||||
|
var exitFullScreenBtn;
|
||||||
|
|
||||||
|
function onFullScreenChange() {
|
||||||
|
if (document.fullscreenElement || document.webkitFullscreenElement ||
|
||||||
|
document.mozFullScreenElement || document.msFullscreenElement) {
|
||||||
|
|
||||||
|
$(fullScreenBtn).hide();
|
||||||
|
$(exitFullScreenBtn).show();
|
||||||
|
} else {
|
||||||
|
$(fullScreenBtn).show();
|
||||||
|
$(exitFullScreenBtn).hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
if (mw.config.get('wgIsArticle')) {
|
||||||
|
var fullScreenIcon = new OO.ui.IconWidget({ icon: 'fullScreen' });
|
||||||
|
var exitFullScreenIcon = new OO.ui.IconWidget({ icon: 'exitFullScreen' });
|
||||||
|
|
||||||
|
fullScreenBtn = isekai.bottomNav.addButton({
|
||||||
|
id: 'fullscreen',
|
||||||
|
label: mw.msg('isekai-function-btn-fullscreen'),
|
||||||
|
icon: fullScreenIcon.$element[0],
|
||||||
|
priority: 60,
|
||||||
|
onClick: function() {
|
||||||
|
if (document.documentElement.requestFullscreen) {
|
||||||
|
document.documentElement.requestFullscreen();
|
||||||
|
} else if (document.documentElement.webkitRequestFullscreen) {
|
||||||
|
document.documentElement.webkitRequestFullscreen();
|
||||||
|
} else if (document.documentElement.mozRequestFullScreen) {
|
||||||
|
document.documentElement.mozRequestFullScreen();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
exitFullScreenBtn = isekai.bottomNav.addButton({
|
||||||
|
id: 'exit-fullscreen',
|
||||||
|
label: mw.msg('isekai-function-btn-exit-fullscreen'),
|
||||||
|
icon: exitFullScreenIcon.$element[0],
|
||||||
|
priority: 60,
|
||||||
|
onClick: function() {
|
||||||
|
if (document.exitFullscreen) {
|
||||||
|
document.exitFullscreen();
|
||||||
|
} else if (document.webkitExitFullscreen) {
|
||||||
|
document.webkitExitFullscreen();
|
||||||
|
} else if (document.mozCancelFullScreen) {
|
||||||
|
document.mozCancelFullScreen();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$(exitFullScreenBtn).hide();
|
||||||
|
|
||||||
|
document.addEventListener('fullscreenchange', onFullScreenChange);
|
||||||
|
}
|
||||||
|
});
|
@ -1,287 +1,287 @@
|
|||||||
// 页面加载动画
|
// 页面加载动画
|
||||||
body.skin-timeless {
|
body.skin-timeless {
|
||||||
#mw-content-container,
|
#mw-content-container,
|
||||||
#mw-footer-container {
|
#mw-footer-container {
|
||||||
transition: opacity 150ms linear;
|
transition: opacity 150ms linear;
|
||||||
}
|
}
|
||||||
|
|
||||||
#mw-overscroll-bottom-cover {
|
#mw-overscroll-bottom-cover {
|
||||||
transition: opacity 0ms linear 150ms;
|
transition: opacity 0ms linear 150ms;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-loading-spinner {
|
.page-loading-spinner {
|
||||||
display: none;
|
display: none;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 30vh;
|
top: 30vh;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.skin-timeless {
|
body.skin-timeless {
|
||||||
.spinner-box {
|
.spinner-box {
|
||||||
width: 300px;
|
width: 300px;
|
||||||
height: 300px;
|
height: 300px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
|
|
||||||
.circle-border {
|
.circle-border {
|
||||||
width: 150px;
|
width: 150px;
|
||||||
height: 150px;
|
height: 150px;
|
||||||
padding: 3px;
|
padding: 3px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background: #3f51b5;
|
background: #3f51b5;
|
||||||
background: linear-gradient(0deg,rgba(63, 81, 181, 0.1) 33%,#3f51b5 100%);
|
background: linear-gradient(0deg,rgba(63, 81, 181, 0.1) 33%,#3f51b5 100%);
|
||||||
animation: spin .8s linear 0s infinite;
|
animation: spin .8s linear 0s infinite;
|
||||||
}
|
}
|
||||||
|
|
||||||
.circle-core {
|
.circle-core {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-color: #f3f3f3;
|
background-color: #f3f3f3;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 850px) {
|
@media screen and (max-width: 850px) {
|
||||||
.circle-core {
|
.circle-core {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes spin {
|
@keyframes spin {
|
||||||
0% {
|
0% {
|
||||||
transform: rotate(0);
|
transform: rotate(0);
|
||||||
}
|
}
|
||||||
99% {
|
99% {
|
||||||
transform: rotate(356.4deg);
|
transform: rotate(356.4deg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
html.content-loading body.skin-timeless {
|
html.content-loading body.skin-timeless {
|
||||||
#mw-content-container,
|
#mw-content-container,
|
||||||
#mw-footer-container {
|
#mw-footer-container {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#mw-overscroll-bottom-cover {
|
#mw-overscroll-bottom-cover {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-loading-spinner {
|
.page-loading-spinner {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
html.content-unloading body.skin-timeless {
|
html.content-unloading body.skin-timeless {
|
||||||
#mw-content-container,
|
#mw-content-container,
|
||||||
#mw-footer-container {
|
#mw-footer-container {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#mw-overscroll-bottom-cover {
|
#mw-overscroll-bottom-cover {
|
||||||
transition: none;
|
transition: none;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
html.content-loaded body.skin-timeless {
|
html.content-loaded body.skin-timeless {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 折叠区域
|
// 折叠区域
|
||||||
.mw-collapse-content {
|
.mw-collapse-content {
|
||||||
display: none;
|
display: none;
|
||||||
margin: 1em 0 0;
|
margin: 1em 0 0;
|
||||||
}
|
}
|
||||||
.mw-collapse-toggle {
|
.mw-collapse-toggle {
|
||||||
-webkit-user-select: none;
|
-webkit-user-select: none;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wikitable-container .wikitable {
|
.wikitable-container .wikitable {
|
||||||
min-width: 200px;
|
min-width: 200px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 850px){
|
@media screen and (max-width: 850px){
|
||||||
.wikitable-container {
|
.wikitable-container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
float: none;
|
float: none;
|
||||||
margin-left: 0px;
|
margin-left: 0px;
|
||||||
margin-right: 0px;
|
margin-right: 0px;
|
||||||
|
|
||||||
.wikitable {
|
.wikitable {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.black-space {
|
.black-space {
|
||||||
background-color: #252525;
|
background-color: #252525;
|
||||||
color: #252525;
|
color: #252525;
|
||||||
transition: color .15s;
|
transition: color .15s;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
transition: color .15s;
|
transition: color .15s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.ve-init-target-visual .black-space {
|
.ve-init-target-visual .black-space {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
body.auto-color-scheme .black-space {
|
body.auto-color-scheme .black-space {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: #222;
|
color: #222;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#toc > ul {
|
#toc > ul {
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
max-height: 50vh;
|
max-height: 50vh;
|
||||||
scrollbar-width: thin;
|
scrollbar-width: thin;
|
||||||
|
|
||||||
&::-webkit-scrollbar {
|
&::-webkit-scrollbar {
|
||||||
width: 8px;
|
width: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&::-webkit-scrollbar-thumb {
|
&::-webkit-scrollbar-thumb {
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
background: #cdcdcd;
|
background: #cdcdcd;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: #a6a6a6;
|
background: #a6a6a6;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:active {
|
&:active {
|
||||||
background: #606060;
|
background: #606060;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&::-webkit-scrollbar-track {
|
&::-webkit-scrollbar-track {
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
background: #f0f0f0;
|
background: #f0f0f0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (min-width: 851px){
|
@media screen and (min-width: 851px){
|
||||||
#mw-footer .footer-places li {
|
#mw-footer .footer-places li {
|
||||||
white-space: pre;
|
white-space: pre;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 850px){
|
@media screen and (max-width: 850px){
|
||||||
#mw-footer #copyright {
|
#mw-footer #copyright {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 面包屑
|
// 面包屑
|
||||||
.breadcrumb {
|
.breadcrumb {
|
||||||
padding: 8px 15px;
|
padding: 8px 15px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
margin-block-start: 0;
|
margin-block-start: 0;
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
|
||||||
> li {
|
> li {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|
||||||
&.active {
|
&.active {
|
||||||
color: #777;
|
color: #777;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.breadcrumb-divider {
|
.breadcrumb-divider {
|
||||||
padding: 0 5px;
|
padding: 0 5px;
|
||||||
color: #ccc;
|
color: #ccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
> li.root:before {
|
> li.root:before {
|
||||||
padding: 0 5px 0 0;
|
padding: 0 5px 0 0;
|
||||||
color: #ccc;
|
color: #ccc;
|
||||||
content: "/";
|
content: "/";
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media print {
|
@media print {
|
||||||
#toc,
|
#toc,
|
||||||
#contentSub .breadcrumb,
|
#contentSub .breadcrumb,
|
||||||
#flowthread {
|
#flowthread {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.subpages {
|
.subpages {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#content {
|
#content {
|
||||||
.user-heading {
|
.user-heading {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
|
|
||||||
.user-avatar {
|
.user-avatar {
|
||||||
width: 64px;
|
width: 64px;
|
||||||
height: 64px;
|
height: 64px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#firstHeading {
|
#firstHeading {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
margin: 0 0.5em 0.25em 0;
|
margin: 0 0.5em 0.25em 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.oo-ui-messageDialog-actions-horizontal .oo-ui-actionWidget {
|
.oo-ui-messageDialog-actions-horizontal .oo-ui-actionWidget {
|
||||||
width: auto !important;
|
width: auto !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.googlead-container-bottom {
|
.googlead-container-bottom {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-height: 90px;
|
min-height: 90px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-minerva .googlead-container-bottom {
|
.skin-minerva .googlead-container-bottom {
|
||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
margin-left: 16px;
|
margin-left: 16px;
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
margin-right: 16px;
|
margin-right: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 1099px) {
|
@media screen and (max-width: 1099px) {
|
||||||
.googlead-container-sidebar {
|
.googlead-container-sidebar {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 对登录用户隐藏标题
|
// 对登录用户隐藏标题
|
||||||
@media (max-width: 576px) {
|
@media (max-width: 576px) {
|
||||||
.logged-in #p-logo-text {
|
.logged-in #p-logo-text {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,33 +0,0 @@
|
|||||||
:root,
|
|
||||||
:host {
|
|
||||||
--fa-style-family-classic: 'Font Awesome 6 Free';
|
|
||||||
--fa-font-solid: normal 900 1em/1 'Font Awesome 6 Free';
|
|
||||||
--fa-font-regular: normal 400 1em/1 'Font Awesome 6 Free';
|
|
||||||
}
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Font Awesome 6 Free';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 900;
|
|
||||||
font-display: block;
|
|
||||||
src: url("fonts/fa-solid-900.woff2") format("woff2"), url("fonts/fa-solid-900.ttf") format("truetype");
|
|
||||||
}
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Font Awesome 6 Free';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 400;
|
|
||||||
font-display: block;
|
|
||||||
src: url("fonts/fa-regular-400.woff2") format("woff2"), url("fonts/fa-regular-400.ttf") format("truetype");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.fas,
|
|
||||||
.fa-solid {
|
|
||||||
font-weight: 900;
|
|
||||||
}
|
|
||||||
|
|
||||||
.far,
|
|
||||||
.fa-regular {
|
|
||||||
font-weight: 400;
|
|
||||||
}
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Isekai\Specials;
|
namespace Isekai\Specials;
|
||||||
|
|
||||||
class SpecialGetPageModules {
|
class SpecialGetPageModules {
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue