Remove temporary code

pull/1/head
cpsdqs 7 years ago
parent 60a78afdab
commit c6b59f7094
Signed by untrusted user: cpsdqs
GPG Key ID: 3F59586BB7448DD1
  1. 21
      js/term/index.js
  2. 13
      js/term/screen.js

@ -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`

@ -78,6 +78,10 @@ module.exports = class TermScreen extends EventEmitter {
// mouse features // mouse features
this.mouseMode = { clicks: false, movement: false } this.mouseMode = { clicks: false, movement: false }
this.showLinks = false
this.showButtons = false
this.title = ''
this.bracketedPaste = false this.bracketedPaste = false
this.blinkingCellCount = 0 this.blinkingCellCount = 0
this.reverseVideo = false this.reverseVideo = false
@ -466,8 +470,9 @@ module.exports = class TermScreen extends EventEmitter {
this.window.debug &= 0b01 this.window.debug &= 0b01
this.window.debug |= (+update.debugEnabled << 1) this.window.debug |= (+update.debugEnabled << 1)
this.emit('TEMP:show-buttons', update.showButtons) this.showLinks = update.showConfigLinks
this.emit('TEMP:show-links', update.showConfigLinks) this.showButtons = update.showButtons
this.emit('opts-update')
break break
case 'cursor': case 'cursor':
@ -482,7 +487,7 @@ module.exports = class TermScreen extends EventEmitter {
break break
case 'title': case 'title':
this.emit('TEMP:update-title', update.title) this.emit('title-update', this.title = update.title)
break break
case 'button-labels': case 'button-labels':
@ -533,7 +538,7 @@ module.exports = class TermScreen extends EventEmitter {
break break
case 'full-load-complete': case 'full-load-complete':
this.emit('TEMP:hide-load-failed-msg') this.emit('full-load')
break break
case 'notification': case 'notification':

Loading…
Cancel
Save