Skip to content

Commit 25324cd

Browse files
authored
优化多人联机反馈页面 (#294)
1 parent db9e2bf commit 25324cd

File tree

5 files changed

+81
-56
lines changed

5 files changed

+81
-56
lines changed

_config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,8 @@ compress_html:
307307

308308
head_scripts:
309309
- /assets/js/theme.js
310+
after_footer_scripts:
311+
- /assets/js/plugins/jquery.auto-redirect.js
310312

311313
# jekyll-feed
312314
feed:

_multiplayer/feedback.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
---
2-
title: HMCL x Terracotta | 陶瓦联机
2+
title: 多人联机反馈
33
date: 2025-10-07 18:44:00 +0800
44
author: Burning_TNT
5+
classes: wide
6+
toc: false
57
---
68

7-
## 反馈
9+
## Terracotta | 陶瓦联机
810

9-
您即将被重定向到反馈表界面。
11+
<!--{% comment %}-->
12+
> [!TIP]
13+
> 欢迎您填写[反馈表单](https://account.wps.cn/?cb=https%3A%2F%2Faccount.kdocs.cn%2Fpassport%2Fsinglesign%3Fcb%3Dhttps%253A%252F%252Ff.kdocs.cn%252Fksform%252Fw%252Fwrite%252FnjMwdtgD%253Fchannel%253Dmdlsjp%2523routePromt%26form%3Df.kdocs.cn&reload=true&from=v1-wap-wps-login&wxpluginappid=wx53f22ed6915cdf17&wxpluginpath=pages%2Fweb%2Fweb&wxpluginquery=url%3Dhttps%3A%2F%2Ff.wps.cn%2Fksform%2Fw%2Fwrite%2FnjMwdtgD%3Fchannel%3Dmdlsjp%23routePromt%26source%3Dweb_login&qrcode=kdocs&plusreffer=f.kdocs.cn)
14+
<!--{% endcomment %}-->
1015
11-
## Terracotta | 陶瓦联机
16+
<!----{{ '>' }}
17+
18+
> 欢迎您填写<a href="https://account.wps.cn/?cb=https%3A%2F%2Faccount.kdocs.cn%2Fpassport%2Fsinglesign%3Fcb%3Dhttps%253A%252F%252Ff.kdocs.cn%252Fksform%252Fw%252Fwrite%252FnjMwdtgD%253Fchannel%253Dmdlsjp%2523routePromt%26form%3Df.kdocs.cn&reload=true&from=v1-wap-wps-login&wxpluginappid=wx53f22ed6915cdf17&wxpluginpath=pages%2Fweb%2Fweb&wxpluginquery=url%3Dhttps%3A%2F%2Ff.wps.cn%2Fksform%2Fw%2Fwrite%2FnjMwdtgD%3Fchannel%3Dmdlsjp%23routePromt%26source%3Dweb_login&qrcode=kdocs&plusreffer=f.kdocs.cn" data-delay="10" data-redirect>反馈表单</a>。
19+
{: .notice--success }
20+
21+
{{ '<' }}!---->
1222

1323
我们注意到了 EasyTier 项目。它提供了一种简单、安全、去中心化的异地组网方案,足以承载 Minecraft 的联机需求。
1424
在 EasyTier 开发团队的帮助下,我们决定重新在启动器内提供联机服务。
@@ -24,11 +34,3 @@ author: Burning_TNT
2434
它的主要目标依然是让朋友之间能共同游玩,而不是长时间的对外开放。
2535

2636
最后,我想感谢一切参与到 EasyTier、Terracotta \| 陶瓦联机开发和测试、为 EasyTier 提供打洞和中继服务器的社区志愿者。欢迎大家访问 easytier.cn 深入了解这一项目。
27-
28-
<script>
29-
/* TODO: Read info from query argument 'v' and 'launcher_version' to determine the 'channel' argument in url. */
30-
/* 等待 5 秒. */
31-
setTimeout(function() {
32-
window.location.href = "https://f.kdocs.cn/ksform/w/write/njMwdtgD?channel=mdlsjp";
33-
}, 5000);
34-
</script>

_multiplayer/help.md

Lines changed: 0 additions & 22 deletions
This file was deleted.

_multiplayer/token.md

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
(function ($) {
2+
var pluginName = "autoRedirect";
3+
4+
function Plugin(element, options) {
5+
this.$el = $(element);
6+
this.settings = $.extend({}, $.fn[pluginName].defaults, options, this.$el.data());
7+
this.timer = null;
8+
this.init();
9+
}
10+
11+
Plugin.prototype = {
12+
init: function () {
13+
var self = this;
14+
var delay = parseInt(self.settings.delay, 10);
15+
var href = self.$el.attr("href");
16+
17+
if (!href) return;
18+
19+
var $info = $("<span class=\"redirect-info\"> (将在 <span class=\"time\">" + delay + "</span> 秒后自动跳转,您也可以手动<a href=\"javascript:;\" class=\"cancel-redirect\">取消跳转</a>) </span>");
20+
self.$el.after($info);
21+
22+
self.timer = setInterval(function () {
23+
delay--;
24+
$info.find(".time").text(delay);
25+
if (delay <= 0) {
26+
clearInterval(self.timer);
27+
window.location.href = href;
28+
}
29+
}, 1000);
30+
31+
$info.on("click", ".cancel-redirect", function () {
32+
clearInterval(self.timer);
33+
$info.text("");
34+
});
35+
},
36+
destroy: function () {
37+
clearInterval(this.timer);
38+
this.$el.next(".redirect-info").remove();
39+
}
40+
};
41+
42+
$.fn[pluginName] = function (option) {
43+
return this.each(function () {
44+
var $this = $(this);
45+
var instance = $this.data(pluginName);
46+
47+
if (!instance) {
48+
$this.data(pluginName, new Plugin(this, option));
49+
} else if (typeof option === "string" && instance[option]) {
50+
instance[option]();
51+
}
52+
});
53+
};
54+
55+
$.fn[pluginName].defaults = {
56+
delay: 5
57+
};
58+
59+
$(function () {
60+
$("a[data-redirect]").each(function () {
61+
$(this)[pluginName]();
62+
});
63+
});
64+
65+
})(jQuery);

0 commit comments

Comments
 (0)