调整配置页面的样式

This commit is contained in:
fofolee 2020-04-10 17:48:01 +08:00
parent a67409fbbb
commit a604a04546
2 changed files with 14 additions and 11 deletions

View File

@ -137,12 +137,18 @@
#options table { #options table {
border-collapse: collapse; border-collapse: collapse;
table-layout:fixed;
width: 100%; width: 100%;
} }
#options table td { #options table td {
border-collapse: collapse; border-collapse: collapse;
padding: 3px; padding: 3px;
margin-right: 15px;
word-break:keep-all;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
} }
#options table tr:nth-child(odd) { #options table tr:nth-child(odd) {
@ -166,13 +172,6 @@
margin-right: 5px; margin-right: 5px;
} }
#options div.cmds {
width: 260px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
#options .keyword.re { #options .keyword.re {
color: rgb(105, 40, 97); color: rgb(105, 40, 97);
} }

View File

@ -135,14 +135,18 @@ programs = {
showOptions = () => { showOptions = () => {
var currentFts = utools.getFeatures(), var currentFts = utools.getFeatures(),
customFts = getCustomFts(); customFts = getCustomFts();
let featureList = '<table><tr><td></td><td>模式</td><td>说明</td><td>启用</td></tr>'; let featureList = '<table><tr><td width="40"></td><td width="240">模式</td><td width="270">说明</td><td>启用</td></tr>';
for (var fts in customFts) { for (var fts in customFts) {
let features = customFts[fts].features; let features = customFts[fts].features;
var cmds = ''; var cmds = '';
if (features.cmds[0].type == 'regex') { if (features.cmds[0].type == 'regex') {
cmds = `<span class="keyword re">正则: ${features.cmds[0].match}</span>`; var reg = features.cmds[0].match;
if (reg.length > 15) reg = reg.slice(0, 15) + '...';
cmds = `<span class="keyword re">正则: ${reg}</span>`;
} else if (features.cmds[0].type == 'window') { } else if (features.cmds[0].type == 'window') {
cmds = `<span class="keyword win">窗口: ${features.cmds[0].match.app}</span>`; var app = features.cmds[0].match.app
if (app.length > 15) app = app.slice(0, 15) + '...';
cmds = `<span class="keyword win">窗口: ${app}</span>`;
} else { } else {
features.cmds.forEach(cmd => { features.cmds.forEach(cmd => {
cmds += `<span class="keyword">${cmd}</span>`; cmds += `<span class="keyword">${cmd}</span>`;
@ -161,7 +165,7 @@ showOptions = () => {
window.messageBox({ type: 'error', icon: window.logo, message: e.toString(), buttons: ['啊嘞?!'] }) window.messageBox({ type: 'error', icon: window.logo, message: e.toString(), buttons: ['啊嘞?!'] })
} }
featureList += `<tr><td><img class="logo" src="${iconpath}"></td> featureList += `<tr><td><img class="logo" src="${iconpath}"></td>
<td><div class="cmds">${cmds}</div></td><td width="300px">${features.explain}</td><td> <td>${cmds}</td><td>${features.explain}</td><td>
<label class="switch-btn"> <label class="switch-btn">
<input class="checked-switch" id="${features.code}" type="checkbox" ${isChecked}> <input class="checked-switch" id="${features.code}" type="checkbox" ${isChecked}>
<span class="text-switch"></span> <span class="text-switch"></span>