|
|
@ -51,26 +51,29 @@ module.exports = function (opts) { |
|
|
|
const buttons = initButtons(input) |
|
|
|
const buttons = initButtons(input) |
|
|
|
screen.on('button-labels', labels => { buttons.labels = labels }) |
|
|
|
screen.on('button-labels', labels => { buttons.labels = labels }) |
|
|
|
|
|
|
|
|
|
|
|
// TEMPORARY CODE
|
|
|
|
screen.on('full-load', () => { |
|
|
|
screen.on('TEMP:hide-load-failed-msg', () => { |
|
|
|
|
|
|
|
let scr = qs('#screen') |
|
|
|
let scr = qs('#screen') |
|
|
|
let errmsg = qs('#load-failed') |
|
|
|
let errmsg = qs('#load-failed') |
|
|
|
if (scr) scr.classList.remove('failed') |
|
|
|
if (scr) scr.classList.remove('failed') |
|
|
|
if (errmsg) errmsg.parentNode.removeChild(errmsg) |
|
|
|
if (errmsg) errmsg.parentNode.removeChild(errmsg) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
screen.on('TEMP:show-config-links', show => { |
|
|
|
let setLinkVisibility = visible => { |
|
|
|
let buttons = [...document.querySelectorAll('.x-term-conf-btn')] |
|
|
|
let buttons = [...document.querySelectorAll('.x-term-conf-btn')] |
|
|
|
if (show) buttons.forEach(x => x.classList.remove('hidden')) |
|
|
|
if (visible) buttons.forEach(x => x.classList.remove('hidden')) |
|
|
|
else buttons.forEach(x => x.classList.add('hidden')) |
|
|
|
else buttons.forEach(x => x.classList.add('hidden')) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
let setButtonVisibility = visible => { |
|
|
|
screen.on('TEMP:show-buttons', show => { |
|
|
|
if (visible) qs('#action-buttons').classList.remove('hidden') |
|
|
|
if (show) qs('#action-buttons').classList.remove('hidden') |
|
|
|
|
|
|
|
else qs('#action-buttons').classList.add('hidden') |
|
|
|
else qs('#action-buttons').classList.add('hidden') |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
screen.on('opts-update', () => { |
|
|
|
|
|
|
|
setLinkVisibility(screen.showLinks) |
|
|
|
|
|
|
|
setButtonVisibility(screen.showButtons) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
screen.on('TEMP:update-title', text => { |
|
|
|
screen.on('title-update', text => { |
|
|
|
qs('#screen-title').textContent = text |
|
|
|
qs('#screen-title').textContent = text |
|
|
|
if (!text) text = 'Terminal' |
|
|
|
if (!text) text = 'Terminal' |
|
|
|
qs('title').textContent = `${text} :: ESPTerm` |
|
|
|
qs('title').textContent = `${text} :: ESPTerm` |
|
|
|