fix: unclosable console tab, compact grid with neon outline glow, naming fix
This commit is contained in:
@@ -51,6 +51,9 @@ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
||||
var first = document.querySelector('.dsh-wt_projects > *');
|
||||
out.firstIsConsole = !!(first && first.classList && first.classList.contains('dsh-wt_consoleEntry'));
|
||||
out.consoleName = first ? (first.querySelector('.dsh-wt_layoutName') ? first.querySelector('.dsh-wt_layoutName').textContent : null) : null;
|
||||
var handle = document.querySelector('.dsh-wt_title');
|
||||
out.sectionTitle = handle ? (handle.textContent || '').trim() : null;
|
||||
out.sectionTitleRight = out.sectionTitle === '工作台';
|
||||
out.consoleIcon = first ? (first.querySelector('.dsh-wt_layoutIcon') ? first.querySelector('.dsh-wt_layoutIcon').textContent : null) : null;
|
||||
out.consoleOrder = first ? getComputedStyle(first).order : null;
|
||||
out.consoleHasBindBtn = !!(first && first.querySelector('.dsh-wt_bindBtn'));
|
||||
@@ -113,6 +116,12 @@ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
||||
}
|
||||
out.bindPopClosed = !vis('.dsh-wt_consoleBindPop');
|
||||
out.specId = st.active && st.spec ? st.spec.id : null;
|
||||
// 控制室标签关不掉:标签栏存在但该标签无 ✕
|
||||
var tabBar = vis('.dsh-wt_tabBar');
|
||||
var ctab = tabBar && tabBar.querySelector('.dsh-wt_tab');
|
||||
out.consoleTabExists = !!ctab;
|
||||
out.consoleTabCloseGone = !!(ctab && !ctab.querySelector('.dsh-wt_tabClose'));
|
||||
out.consoleTabTitle = ctab ? (ctab.textContent || '').trim() : null;
|
||||
out.mainType = st.spec && st.spec.main[0] && st.spec.main[0].tabs && st.spec.main[0].tabs[0] ? st.spec.main[0].tabs[0].content.type : null;
|
||||
var saved = JSON.parse(localStorage.getItem('dsh.worktable.projects.v1'));
|
||||
out.savedConsoleBinding = saved.bindings['wt-console'];
|
||||
@@ -136,6 +145,7 @@ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
||||
if (cardEl) {
|
||||
var cr = cardEl.getBoundingClientRect();
|
||||
out.cardAspect = Math.round((cr.width / Math.max(1, cr.height)) * 100) / 100;
|
||||
out.cardWidth = Math.round(cr.width);
|
||||
var statusEl = cardEl.querySelector('.dsh-wt_consoleStatus');
|
||||
out.statusFont = statusEl ? getComputedStyle(statusEl).fontSize : null;
|
||||
cardEl.classList.add('dsh-wt_consoleCard-busy');
|
||||
@@ -147,7 +157,8 @@ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
||||
await sleep(300);
|
||||
var gs = getComputedStyle(cardEl, '::after');
|
||||
out.glowDoneBg = gs.backgroundImage ? gs.backgroundImage.slice(0, 60) : null;
|
||||
out.glowDoneShadow = getComputedStyle(cardEl).boxShadow.slice(0, 60);
|
||||
out.glowDoneShadow = getComputedStyle(cardEl).boxShadow.slice(0, 80);
|
||||
out.glowDoneBorder = getComputedStyle(cardEl).borderColor;
|
||||
cardEl.classList.remove('dsh-wt_consoleCard-glowDone');
|
||||
cardEl.classList.add('dsh-wt_consoleCard-glowNeed');
|
||||
await sleep(300);
|
||||
|
||||
Reference in New Issue
Block a user