feat: 配置栏旁新增一个全屏按钮

This commit is contained in:
lee
2020-10-10 01:02:49 +08:00
parent 0f46af9f6c
commit 13b0b37f8f
3 changed files with 28 additions and 2 deletions

View File

@@ -621,7 +621,7 @@
<p><input type="text" id="code" style="display: none">
<span class="word">匹&#12288;配</span>
<select id="type"></select>
<span class="word" id="ruleWord">关键字</span><input class="customize" type="text" id="rule" placeholder="多个关键字用逗号隔开"></p>
<span class="word" id="ruleWord">关键字</span><input class="customize" type="text" id="rule" placeholder="多个关键字用逗号隔开"><img id="expandBtn" src="./img/expand.svg"></p>
<p><span class="word">说&#12288;明</span><input class="customize" type="text" id="desc" placeholder="命令功能的描述">
<img id="icon" src="">
</p>
@@ -1701,6 +1701,21 @@
runCurrentCommand()
})
// 配置栏扩大
$("#options").on('click', '#expandBtn', function () {
let placeholder = $('#rule').prop('placeholder')
let rule = $('#rule').val()
try {
rule = JSON.stringify(JSON.parse(rule), null, 4)
} catch (error) { }
quickcommand.showTextAera(placeholder, rule).then(x => {
try {
x = JSON.stringify(JSON.parse(x))
} catch (error) { }
$('#rule').val(x)
})
})
// 格式化
$("#options").on('click', '#beautifyCode', function () {
beautifyCode()

View File

@@ -439,7 +439,17 @@ body {
}
#options #customize input#rule {
width: 40%;
width: 38%;
}
#options #customize img#expandBtn {
max-width: 15px;
cursor: pointer;
}
#options #customize img#expandBtn:hover {
filter: drop-shadow(0 0 5px black);
transition: 0.2s;
}
#options #customize input#scptarg {