|
|
@ -18,6 +18,7 @@ module.exports = function (opts) { |
|
|
|
const termUpload = TermUpload(conn, input, screen) |
|
|
|
const termUpload = TermUpload(conn, input, screen) |
|
|
|
input.termUpload = termUpload |
|
|
|
input.termUpload = termUpload |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// forward screen input events
|
|
|
|
screen.on('mousedown', (...args) => input.onMouseDown(...args)) |
|
|
|
screen.on('mousedown', (...args) => input.onMouseDown(...args)) |
|
|
|
screen.on('mousemove', (...args) => input.onMouseMove(...args)) |
|
|
|
screen.on('mousemove', (...args) => input.onMouseMove(...args)) |
|
|
|
screen.on('mouseup', (...args) => input.onMouseUp(...args)) |
|
|
|
screen.on('mouseup', (...args) => input.onMouseUp(...args)) |
|
|
@ -25,6 +26,7 @@ module.exports = function (opts) { |
|
|
|
screen.on('input-alts', (...args) => input.setAlts(...args)) |
|
|
|
screen.on('input-alts', (...args) => input.setAlts(...args)) |
|
|
|
screen.on('mouse-mode', (...args) => input.setMouseMode(...args)) |
|
|
|
screen.on('mouse-mode', (...args) => input.setMouseMode(...args)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// touch selection menu (the Copy button)
|
|
|
|
$.ready(() => { |
|
|
|
$.ready(() => { |
|
|
|
const touchSelectMenu = qs('#touch-select-menu') |
|
|
|
const touchSelectMenu = qs('#touch-select-menu') |
|
|
|
screen.on('show-touch-select-menu', (x, y) => { |
|
|
|
screen.on('show-touch-select-menu', (x, y) => { |
|
|
@ -40,14 +42,16 @@ module.exports = function (opts) { |
|
|
|
const copyButton = qs('#touch-select-copy-btn') |
|
|
|
const copyButton = qs('#touch-select-copy-btn') |
|
|
|
if (copyButton) { |
|
|
|
if (copyButton) { |
|
|
|
copyButton.addEventListener('click', () => { |
|
|
|
copyButton.addEventListener('click', () => { |
|
|
|
this.copySelectionToClipboard() |
|
|
|
screen.copySelectionToClipboard() |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// buttons
|
|
|
|
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('TEMP:hide-load-failed-msg', () => { |
|
|
|
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') |
|
|
@ -72,6 +76,8 @@ module.exports = function (opts) { |
|
|
|
qs('title').textContent = `${text} :: ESPTerm` |
|
|
|
qs('title').textContent = `${text} :: ESPTerm` |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// connection status
|
|
|
|
|
|
|
|
|
|
|
|
let showSplashTimeout = null |
|
|
|
let showSplashTimeout = null |
|
|
|
let showSplash = (obj, delay = 250) => { |
|
|
|
let showSplash = (obj, delay = 250) => { |
|
|
|
clearTimeout(showSplashTimeout) |
|
|
|
clearTimeout(showSplashTimeout) |
|
|
@ -126,6 +132,8 @@ module.exports = function (opts) { |
|
|
|
initSoftKeyboard(screen, input) |
|
|
|
initSoftKeyboard(screen, input) |
|
|
|
if (attachDebugger) attachDebugger(screen, conn) |
|
|
|
if (attachDebugger) attachDebugger(screen, conn) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// fullscreen mode
|
|
|
|
|
|
|
|
|
|
|
|
let fullscreenIcon = {} // dummy
|
|
|
|
let fullscreenIcon = {} // dummy
|
|
|
|
let isFullscreen = false |
|
|
|
let isFullscreen = false |
|
|
|
let properFullscreen = false |
|
|
|
let properFullscreen = false |
|
|
|