移除FontAwesome,增加全屏按钮

master
落雨楓 2 years ago
parent 6f689ab895
commit 5bb602d909

@ -39,10 +39,9 @@ class Isekai {
$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') {

@ -90,16 +90,6 @@
"mobile" "mobile"
] ]
}, },
"ext.fontawesome": {
"styles": [
"lib/fontawesome/_fontawesome.css",
"fontawesome.less"
],
"targets": [
"desktop",
"mobile"
]
},
"lib.isekai.echarts": { "lib.isekai.echarts": {
"scripts": ["lib/echarts.custom.min.js"] "scripts": ["lib/echarts.custom.min.js"]
}, },
@ -121,6 +111,21 @@
"desktop", "desktop",
"mobile" "mobile"
] ]
},
"ext.isekai.function-btn": {
"scripts": ["ext.isekai.function-btn.js"],
"dependencies": [
"ext.isekai.baseWidgets",
"oojs-ui.styles.icons-media"
],
"targets": [
"desktop",
"mobile"
],
"messages": [
"isekai-function-btn-fullscreen",
"isekai-function-btn-exit-fullscreen"
]
} }
}, },
"VisualEditorPluginModules": [ "VisualEditorPluginModules": [

@ -32,5 +32,8 @@
"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"
} }

@ -8,5 +8,8 @@
"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-function-btn-fullscreen": "全画面",
"isekai-function-btn-exit-fullscreen": "全画面を終了"
} }

@ -32,5 +32,8 @@
"isekai-ads-prompt-content": "<p>目前,页面广告是异世界百科的唯一收入来源。</p><p>如果您想要支持异世界百科可以在此站点上关闭Adblock、Adblock Pro等插件。</p><p>如果想要移除广告空位,可以在用户-参数设置中关闭广告。</p>", "isekai-ads-prompt-content": "<p>目前,页面广告是异世界百科的唯一收入来源。</p><p>如果您想要支持异世界百科可以在此站点上关闭Adblock、Adblock Pro等插件。</p><p>如果想要移除广告空位,可以在用户-参数设置中关闭广告。</p>",
"isekai-ads-prompt-btn-cancel": "不再显示", "isekai-ads-prompt-btn-cancel": "不再显示",
"visualeditor-savedialog-label-set-categories": "设置分类" "visualeditor-savedialog-label-set-categories": "设置分类",
"isekai-function-btn-fullscreen": "全屏",
"isekai-function-btn-exit-fullscreen": "退出全屏"
} }

@ -32,5 +32,8 @@
"isekai-ads-prompt-content": "<p>目前,頁面廣告是異世界百科的唯一收入來源。</p><p>如果您想要支持異世界百科可以在此網站上關閉Adblock、Adblock Pro等擴展程式。</p><p>如果想要移除廣告空位,可以在用戶-參數設置中關閉廣告。</p>", "isekai-ads-prompt-content": "<p>目前,頁面廣告是異世界百科的唯一收入來源。</p><p>如果您想要支持異世界百科可以在此網站上關閉Adblock、Adblock Pro等擴展程式。</p><p>如果想要移除廣告空位,可以在用戶-參數設置中關閉廣告。</p>",
"isekai-ads-prompt-btn-cancel": "不再顯示", "isekai-ads-prompt-btn-cancel": "不再顯示",
"visualeditor-savedialog-label-set-categories": "設置分類" "visualeditor-savedialog-label-set-categories": "設置分類",
"isekai-function-btn-fullscreen": "全屏",
"isekai-function-btn-exit-fullscreen": "退出全屏"
} }

@ -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,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.

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save