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 {

1
src/img/expand.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path fill="#616161" d="M29.2,32l2.8-2.8l12,12L41.2,44L29.2,32z"/><path fill="#616161" d="M36,20c0,8.8-7.2,16-16,16S4,28.8,4,20S11.2,4,20,4S36,11.2,36,20"/><path fill="#37474F" d="M32.5,35.3l2.8-2.8l8.7,8.7L41.2,44L32.5,35.3z"/><path fill="#64B5F6" d="M7,20c0-7.2,5.8-13,13-13s13,5.8,13,13s-5.8,13-13,13S7,27.2,7,20"/><path fill="#E3F2FD" d="M23.9,14.1l2,2L16,26l-2-2L23.9,14.1z"/><path fill="#E3F2FD" d="M16.1,14.1L26,24l-2,2l-9.9-9.9L16.1,14.1z"/><path fill="#E3F2FD" d="M12 19L12 12 19 12M19 28L12 28 12 21M28 21L28 28 21 28M21 12L28 12 28 19"/></svg>

After

Width:  |  Height:  |  Size: 614 B