优化关闭右键菜单报错
This commit is contained in:
parent
839531f343
commit
478dfd1594
|
@ -544,6 +544,7 @@ spec:
|
||||||
label: 个人卡片
|
label: 个人卡片
|
||||||
value:
|
value:
|
||||||
profileStyle: default
|
profileStyle: default
|
||||||
|
helloText: 🤖️ 数码科技爱好者, 🔍 分享与热心帮助, 🏠 智能家居小能手, 🔨 设计开发一条龙, 🤝 专修交互与设计, 🏃 脚踏实地行动派, 🧱 团队小组发动机, 💢 壮汉人狠话不多
|
||||||
children:
|
children:
|
||||||
- $formkit: select
|
- $formkit: select
|
||||||
name: profileStyle
|
name: profileStyle
|
||||||
|
@ -570,7 +571,6 @@ spec:
|
||||||
name: helloText
|
name: helloText
|
||||||
label: 作者打招呼
|
label: 作者打招呼
|
||||||
placeholder: 请填写作者打招呼
|
placeholder: 请填写作者打招呼
|
||||||
value: 🤖️ 数码科技爱好者, 🔍 分享与热心帮助, 🏠 智能家居小能手, 🔨 设计开发一条龙, 🤝 专修交互与设计, 🏃 脚踏实地行动派, 🧱 团队小组发动机, 💢 壮汉人狠话不多
|
|
||||||
help: 注意格式 (🤖️ 数码科技爱好者, 🔍 分享与热心帮助 ) 以逗号隔开
|
help: 注意格式 (🤖️ 数码科技爱好者, 🔍 分享与热心帮助 ) 以逗号隔开
|
||||||
- $formkit: text
|
- $formkit: text
|
||||||
name: profileName
|
name: profileName
|
||||||
|
@ -1047,14 +1047,13 @@ spec:
|
||||||
name: footer_group
|
name: footer_group
|
||||||
label: 页脚友链
|
label: 页脚友链
|
||||||
value:
|
value:
|
||||||
enable_footer_group:
|
enable_footer_group: true
|
||||||
num:
|
num: 3
|
||||||
children:
|
children:
|
||||||
- $formkit: radio
|
- $formkit: radio
|
||||||
name: enable_footer_group
|
name: enable_footer_group
|
||||||
id: enable_footer_group
|
id: enable_footer_group
|
||||||
key: enable_footer_group
|
key: enable_footer_group
|
||||||
value: true
|
|
||||||
options:
|
options:
|
||||||
- label: 启用
|
- label: 启用
|
||||||
value: true
|
value: true
|
||||||
|
@ -1064,7 +1063,6 @@ spec:
|
||||||
if: $get(enable_footer_group).value
|
if: $get(enable_footer_group).value
|
||||||
name: num
|
name: num
|
||||||
label: 友链数
|
label: 友链数
|
||||||
value: 3
|
|
||||||
validation: required
|
validation: required
|
||||||
- $formkit: group
|
- $formkit: group
|
||||||
name: footerContent
|
name: footerContent
|
||||||
|
|
|
@ -294,7 +294,9 @@ var heo = {
|
||||||
btf.snackbarShow("✨ 已开启评论弹幕", false, 2000)
|
btf.snackbarShow("✨ 已开启评论弹幕", false, 2000)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(GLOBAL_CONFIG.rightMenuEnable){
|
||||||
rm.hideRightMenu();
|
rm.hideRightMenu();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//隐藏cookie窗口
|
//隐藏cookie窗口
|
||||||
|
@ -372,20 +374,26 @@ var heo = {
|
||||||
let msgPause = '<i class="haofont hao-icon-pause"></i><span>暂停音乐</span>';
|
let msgPause = '<i class="haofont hao-icon-pause"></i><span>暂停音乐</span>';
|
||||||
if (heo_musicPlaying) {
|
if (heo_musicPlaying) {
|
||||||
navMusicEl.classList.remove("playing");
|
navMusicEl.classList.remove("playing");
|
||||||
|
if(GLOBAL_CONFIG.rightMenuEnable){
|
||||||
document.getElementById("menu-music-toggle").innerHTML = msgPlay;
|
document.getElementById("menu-music-toggle").innerHTML = msgPlay;
|
||||||
|
}
|
||||||
document.getElementById("nav-music-hoverTips").innerHTML = "音乐已暂停";
|
document.getElementById("nav-music-hoverTips").innerHTML = "音乐已暂停";
|
||||||
document.querySelector("#consoleMusic").classList.remove("on");
|
document.querySelector("#consoleMusic").classList.remove("on");
|
||||||
heo_musicPlaying = false;
|
heo_musicPlaying = false;
|
||||||
navMusicEl.classList.remove("stretch");
|
navMusicEl.classList.remove("stretch");
|
||||||
} else {
|
} else {
|
||||||
navMusicEl.classList.add("playing");
|
navMusicEl.classList.add("playing");
|
||||||
|
if(GLOBAL_CONFIG.rightMenuEnable){
|
||||||
document.getElementById("menu-music-toggle").innerHTML = msgPause;
|
document.getElementById("menu-music-toggle").innerHTML = msgPause;
|
||||||
|
}
|
||||||
document.querySelector("#consoleMusic").classList.add("on");
|
document.querySelector("#consoleMusic").classList.add("on");
|
||||||
heo_musicPlaying = true;
|
heo_musicPlaying = true;
|
||||||
navMusicEl.classList.add("stretch");
|
navMusicEl.classList.add("stretch");
|
||||||
}
|
}
|
||||||
if (changePaly) document.querySelector("#nav-music meting-js").aplayer.toggle();
|
if (changePaly) document.querySelector("#nav-music meting-js").aplayer.toggle();
|
||||||
|
if(GLOBAL_CONFIG.rightMenuEnable){
|
||||||
rm.hideRightMenu();
|
rm.hideRightMenu();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 音乐绑定事件
|
// 音乐绑定事件
|
||||||
|
|
|
@ -324,6 +324,30 @@ var navFn = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//引用到评论
|
||||||
|
function rightMenuCommentText(txt) {
|
||||||
|
if (GLOBAL_CONFIG.rightMenuEnable) {
|
||||||
|
rm.hideRightMenu();
|
||||||
|
}
|
||||||
|
var input = document.getElementsByClassName('el-textarea__inner')[0];
|
||||||
|
let evt = document.createEvent('HTMLEvents');
|
||||||
|
evt.initEvent('input', true, true);
|
||||||
|
let inputValue = replaceAll(txt, '\n', '\n> ')
|
||||||
|
input.value = '> ' + inputValue + '\n\n';
|
||||||
|
input.dispatchEvent(evt);
|
||||||
|
var domTop = document.querySelector("#post-comment").offsetTop;
|
||||||
|
window.scrollTo(0, domTop - 80);
|
||||||
|
input.focus();
|
||||||
|
input.setSelectionRange(-1, -1);
|
||||||
|
if (document.getElementById("comment-tips")) {
|
||||||
|
document.getElementById("comment-tips").classList.add("show");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//替换所有内容
|
||||||
|
function replaceAll(string, search, replace) {
|
||||||
|
return string.split(search).join(replace);
|
||||||
|
}
|
||||||
|
|
||||||
// 移除赞赏蒙版
|
// 移除赞赏蒙版
|
||||||
function RemoveRewardMask() {
|
function RemoveRewardMask() {
|
||||||
if (!document.querySelector(".reward-main")) return;
|
if (!document.querySelector(".reward-main")) return;
|
||||||
|
@ -347,11 +371,15 @@ document.addEventListener('touchstart', e => {
|
||||||
|
|
||||||
//监听ctrl+C
|
//监听ctrl+C
|
||||||
$(document).unbind('keydown').bind('keydown', function (e) {
|
$(document).unbind('keydown').bind('keydown', function (e) {
|
||||||
|
if (GLOBAL_CONFIG.rightMenuEnable) {
|
||||||
if ((e.ctrlKey || e.metaKey) && (e.keyCode == 67) && (selectTextNow != '')) {
|
if ((e.ctrlKey || e.metaKey) && (e.keyCode == 67) && (selectTextNow != '')) {
|
||||||
btf.snackbarShow('复制成功,复制和转载请标注本文地址');
|
btf.snackbarShow('复制成功,复制和转载请标注本文地址');
|
||||||
rm.rightmenuCopyText(selectTextNow);
|
rm.rightmenuCopyText(selectTextNow);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
//判断国内国外
|
//判断国内国外
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
<a class="equipment-item-content-item-link" th:href="${equipment.url}"
|
<a class="equipment-item-content-item-link" th:href="${equipment.url}"
|
||||||
target="_blank">[[${equipment.button}]]</a>
|
target="_blank">[[${equipment.button}]]</a>
|
||||||
<a class="bber-reply"
|
<a class="bber-reply"
|
||||||
th:onclick="rm.rightMenuCommentText([['"'+${equipment.name}+' '+${equipment.model}+' '+${equipment.description}+'"']]);"
|
th:onclick="rightMenuCommentText([['"'+${equipment.name}+' '+${equipment.model}+' '+${equipment.description}+'"']]);"
|
||||||
data-pjax-state="">
|
data-pjax-state="">
|
||||||
<i class="fa-solid fa-message" style="font-size: 18px;"></i>
|
<i class="fa-solid fa-message" style="font-size: 18px;"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -209,6 +209,7 @@
|
||||||
helloText: [[${#strings.listSplit(theme.config.sidebar.profile.helloText, ',')}]],
|
helloText: [[${#strings.listSplit(theme.config.sidebar.profile.helloText, ',')}]],
|
||||||
assetsLink: [[${assets_link}]],
|
assetsLink: [[${assets_link}]],
|
||||||
profileStyle: [[${theme.config.sidebar.profile.profileStyle}]],
|
profileStyle: [[${theme.config.sidebar.profile.profileStyle}]],
|
||||||
|
rightMenuEnable: [[${theme.config.tool.rightMenu.rightMenuEnable}]],
|
||||||
source: {
|
source: {
|
||||||
links: {
|
links: {
|
||||||
linksUrl: [[${ theme.config.link.linksUrl }]],
|
linksUrl: [[${ theme.config.link.linksUrl }]],
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
<!-- 切换模式 -->
|
<!-- 切换模式 -->
|
||||||
<div class="nav-button" th:if="${theme.config.nav.right.darkMode}">
|
<div class="nav-button" th:if="${theme.config.nav.right.darkMode}">
|
||||||
<a class="console_switchbutton" href="javascript:void(0);" onclick="rm.switchDarkMode()" rel="external nofollow"
|
<a class="console_switchbutton" href="javascript:void(0);" onclick="navFn.switchDarkMode();" rel="external nofollow"
|
||||||
title="切换模式 - 日夜交替,黑白互换。">
|
title="切换模式 - 日夜交替,黑白互换。">
|
||||||
<i class="haofont hao-icon-circle-half-stroke" style="font-size: 1rem; font-weight: 700;"></i>
|
<i class="haofont hao-icon-circle-half-stroke" style="font-size: 1rem; font-weight: 700;"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a class="bber-reply"
|
<a class="bber-reply"
|
||||||
th:onclick="rm.rightMenuCommentText([[${content.html}]]);"
|
th:onclick="rightMenuCommentText([[${content.html}]]);"
|
||||||
data-pjax-state=""> <i class="fa-solid fa-message"></i>
|
data-pjax-state=""> <i class="fa-solid fa-message"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue