mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-07 22:14:04 +08:00
微调
This commit is contained in:
parent
18c5b121fb
commit
42f50b26cf
@ -52,20 +52,20 @@ mainlistSubInput = () => {
|
|||||||
utools.removeSubInput();
|
utools.removeSubInput();
|
||||||
utools.setSubInput(({ text }) => {
|
utools.setSubInput(({ text }) => {
|
||||||
// 列表搜索
|
// 列表搜索
|
||||||
showList(text, index, 300);
|
showList(text, index, 100);
|
||||||
// 高亮结果
|
// 高亮结果
|
||||||
text.split(' ').forEach(keyword => {
|
text.split(' ').forEach(keyword => {
|
||||||
keyword && $(".name,.description").highlight(keyword, 'listFounds');
|
keyword && $(".name,.description").highlight(keyword, 'listFounds');
|
||||||
});
|
});
|
||||||
}, '空格 多关键词搜索;中键/shift+Enter发送选中条目到活动窗口');
|
}, '空格 多关键词搜索;中键发送选中条目到活动窗口');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 手册界面子输入框
|
// 手册界面子输入框
|
||||||
manualSubInput = () => {
|
manualSubInput = () => {
|
||||||
utools.removeSubInput();
|
utools.removeSubInput();
|
||||||
utools.setSubInput(({ text }) => {
|
utools.setSubInput(({ text }) => {
|
||||||
highlightManual("#manual", text);
|
highlightManual("#manualBody", text);
|
||||||
}, '空格 多关键词;选中:中键/shift+Enter发送,T翻译,S收藏;Tab切换界面');
|
}, '搜索全文;选中文本:中键发送,T翻译,S收藏;Tab切换界面');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -102,17 +102,18 @@ showManual = path => {
|
|||||||
Prism.highlightAll();
|
Prism.highlightAll();
|
||||||
location.href = e ? id : '#manualBody';
|
location.href = e ? id : '#manualBody';
|
||||||
$('#manualNavi').autoMenu();
|
$('#manualNavi').autoMenu();
|
||||||
if ($('h1,h2,h3').length < 10 && $('#manual ul').is(":visible")) {
|
if ($('h1,h2,h3').length < 10 && $('#manualNavi ul').is(":visible")) {
|
||||||
$('.btn-box span').removeClass('icon-minus-sign').addClass('icon-plus-sign')
|
$('.btn-box span').removeClass('icon-minus-sign').addClass('icon-plus-sign')
|
||||||
// $('#manualBody').removeClass('withNaviBar')
|
// $('#manualBody').removeClass('withNaviBar')
|
||||||
$('#manual ul').hide()
|
$('#manualNavi ul').hide()
|
||||||
// } else {
|
// } else {
|
||||||
// $('#manualBody').addClass('withNaviBar')
|
// $('#manualBody').addClass('withNaviBar')
|
||||||
|
// $('#manualNavi input').focus()
|
||||||
}
|
}
|
||||||
manualSubInput();
|
manualSubInput();
|
||||||
});
|
});
|
||||||
request.fail(function (xhr, err) {
|
request.fail(function (xhr, err) {
|
||||||
$(".load").html('404').fadeOut();
|
$(".load").html('err').fadeOut();
|
||||||
console.log(xhr, err);
|
console.log(xhr, err);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -319,7 +320,7 @@ $("#manual").on('mousedown', 'a', function (e) {
|
|||||||
|
|
||||||
// 滚动到边界加载列表
|
// 滚动到边界加载列表
|
||||||
$(document).scroll(() => {
|
$(document).scroll(() => {
|
||||||
loadList(300);
|
loadList(100);
|
||||||
})
|
})
|
||||||
|
|
||||||
// 按键监听
|
// 按键监听
|
||||||
@ -346,7 +347,11 @@ $(document).keydown(e => {
|
|||||||
var path = $(".select").attr('path');
|
var path = $(".select").attr('path');
|
||||||
path && showManual(path);
|
path && showManual(path);
|
||||||
// 手册/配置界面搜索下一个
|
// 手册/配置界面搜索下一个
|
||||||
} else if($('.founds').length){
|
} else if ($('.founds').length) {
|
||||||
|
if ($('#manualNavi ul').is(":visible")) {
|
||||||
|
$('.btn-box span').removeClass('icon-minus-sign').addClass('icon-plus-sign')
|
||||||
|
$('#manualNavi ul').hide()
|
||||||
|
}
|
||||||
if (window.manualVars.findex > 0) {
|
if (window.manualVars.findex > 0) {
|
||||||
$(`.founds:eq(${window.manualVars.findex - 1})`).removeClass('firstFound');
|
$(`.founds:eq(${window.manualVars.findex - 1})`).removeClass('firstFound');
|
||||||
} else {
|
} else {
|
||||||
@ -390,7 +395,7 @@ $(document).keydown(e => {
|
|||||||
if (next.offset().top >= $(window).scrollTop() + 550) {
|
if (next.offset().top >= $(window).scrollTop() + 550) {
|
||||||
$("html").animate({ scrollTop: "+=50" }, 0);
|
$("html").animate({ scrollTop: "+=50" }, 0);
|
||||||
}
|
}
|
||||||
loadList(300);
|
loadList(100);
|
||||||
next.addClass("select");
|
next.addClass("select");
|
||||||
$(".select:first").removeClass("select");
|
$(".select:first").removeClass("select");
|
||||||
// 到达边界闪烁移动选择条
|
// 到达边界闪烁移动选择条
|
||||||
|
Loading…
x
Reference in New Issue
Block a user