You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
228 KiB
1 lines
228 KiB
{"version":3,"sources":["../../js/lib/chibi.js","../../js/lib/keymaster.js","../../js/lib/polyfills.js","../../js/utils.js","../../js/modal.js","../../js/notif.js","../../js/appcommon.js","../../js/demo.js","../../js/lang.js","../../js/wifi.js","../../js/term_conn.js","../../js/term_input.js","../../js/term_screen.js","../../js/term_upload.js","../../js/debug_screen.js","../../js/soft_keyboard.js","../../js/term.js"],"names":[],"mappings":"mOAGC,WAAY,CACZ,aAUA,YAAqB,CACpB,GAAI,EAAJ,CAEA,IADA,IACA,CAAK,EAAI,CAAT,CAAY,EAAI,EAAQ,MAAxB,CAAgC,GAAK,CAArC,CACC,OAED,IACA,CAGD,YAAsB,CACrB,GAAI,EAAJ,CAMA,IALA,IAKA,IAFC,GAED,CAAK,EAAI,CAAT,CAAY,EAAI,EAAS,MAAzB,CAAiC,GAAK,CAAtC,CACC,OAED,IACA,CAoBD,eAA6B,CAC5B,GAAI,EAAJ,CAEA,IAAK,EAAI,EAAM,MAAN,CAAe,CAAxB,CAAgC,CAAL,GAA3B,CAAmC,GAAK,CAAxC,CACC,EAAG,IAAH,CAED,CAGD,aAA4B,CAC3B,MAAO,GAAS,OAAT,CAAiB,MAAjB,CAAyB,WAAkB,CACjD,MAAO,GAAO,MAAP,CAAc,CAAd,EAAiB,WAAjB,EACP,CAFM,CAGP,CAGD,eAAqC,CAEpC,MAAQ,GAAI,YAAL,CAAqB,EAAI,YAAJ,CAAiB,IAAjB,CAArB,CAA6D,EAAE,gBAAH,CAAuB,EAAE,gBAAF,GAAwB,IAAxB,EAA8B,gBAA9B,GAAvB,CAAkF,IAErJ,CAGD,eAAgC,CAC/B,MAAO,uBAAyB,OAAzB,CAAiC,MAAjC,CAAyC,GAAzC,EAAgD,GAAhD,CAAsD,sBAA0B,OAA1B,CAAkC,MAAlC,CAA0C,GAA1C,CAC7D,CAGD,iBAAsC,CACrC,GAA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,MAAH,CAAX,CACA,EAAK,WAAL,CAAmB,YA3BiE,CA4BpF,EAAO,WAAP,GA5BoF,CA6BpF,GAAG,WAAH,EAAgB,YAAhB,GAAqC,GAAG,WAAH,EAAgB,UAArD,CACD,CAGD,OAAO,UAAP,EAzFoD,CA0FpD,OAAO,IAAP,EA1FoD,CA2FpD,OAAO,KAAP,EA3FoD,CA4FpD,OAAO,OAAP,EACD,C","file":"app.6241b01.js","sourcesContent":["/*!chibi 3.0.7, Copyright 2012-2016 Kyle Barrow, released under MIT license */\n\n// MODIFIED VERSION.\n(function () {\n\t'use strict';\n\n\tvar readyfn = [],\n\t\tloadedfn = [],\n\t\tdomready = false,\n\t\tpageloaded = false,\n\t\td = document,\n\t\tw = window;\n\n\t// Fire any function calls on ready event\n\tfunction fireReady() {\n\t\tvar i;\n\t\tdomready = true;\n\t\tfor (i = 0; i < readyfn.length; i += 1) {\n\t\t\treadyfn[i]();\n\t\t}\n\t\treadyfn = [];\n\t}\n\n\t// Fire any function calls on loaded event\n\tfunction fireLoaded() {\n\t\tvar i;\n\t\tpageloaded = true;\n\t\t// For browsers with no DOM loaded support\n\t\tif (!domready) {\n\t\t\tfireReady();\n\t\t}\n\t\tfor (i = 0; i < loadedfn.length; i += 1) {\n\t\t\tloadedfn[i]();\n\t\t}\n\t\tloadedfn = [];\n\t}\n\n\t// Check DOM ready, page loaded\n\tif (d.addEventListener) {\n\t\t// Standards\n\t\td.addEventListener('DOMContentLoaded', fireReady, false);\n\t\tw.addEventListener('load', fireLoaded, false);\n\t} else if (d.attachEvent) {\n\t\t// IE\n\t\td.attachEvent('onreadystatechange', fireReady);\n\t\t// IE < 9\n\t\tw.attachEvent('onload', fireLoaded);\n\t} else {\n\t\t// Anything else\n\t\tw.onload = fireLoaded;\n\t}\n\n\t// Utility functions\n\n\t// Loop through node array\n\tfunction nodeLoop(fn, nodes) {\n\t\tvar i;\n\t\t// Good idea to walk up the DOM\n\t\tfor (i = nodes.length - 1; i >= 0; i -= 1) {\n\t\t\tfn(nodes[i]);\n\t\t}\n\t}\n\n\t// Convert to camel case\n\tfunction cssCamel(property) {\n\t\treturn property.replace(/-\\w/g, function (result) {\n\t\t\treturn result.charAt(1).toUpperCase();\n\t\t});\n\t}\n\n\t// Get computed style\n\tfunction computeStyle(elm, property) {\n\t\t// IE, everything else or null\n\t\treturn (elm.currentStyle) ? elm.currentStyle[cssCamel(property)] : (w.getComputedStyle) ? w.getComputedStyle(elm, null).getPropertyValue(property) : null;\n\n\t}\n\n\t// Returns URI encoded query string pair\n\tfunction queryPair(name, value) {\n\t\treturn encodeURIComponent(name).replace(/%20/g, '+') + '=' + encodeURIComponent(value).replace(/%20/g, '+');\n\t}\n\n\t// Set CSS, important to wrap in try to prevent error thown on unsupported property\n\tfunction setCss(elm, property, value) {\n\t\ttry {\n\t\t\telm.style[cssCamel(property)] = value;\n\t\t} catch (e) {\n\t\t}\n\t}\n\n\t// Show CSS\n\tfunction showCss(elm) {\n\t\telm.style.display = '';\n\t\t// For elements still hidden by style block\n\t\tif (computeStyle(elm, 'display') === 'none') {\n\t\t\telm.style.display = 'block';\n\t\t}\n\t}\n\n\t// Serialize form & JSON values\n\tfunction serializeData(nodes) {\n\t\tvar querystring = '', subelm, i, j;\n\t\tif (nodes.constructor === Object) { // Serialize JSON data\n\t\t\tfor (subelm in nodes) {\n\t\t\t\tif (nodes.hasOwnProperty(subelm)) {\n\t\t\t\t\tif (nodes[subelm].constructor === Array) {\n\t\t\t\t\t\tfor (i = 0; i < nodes[subelm].length; i += 1) {\n\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm, nodes[subelm][i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tquerystring += '&' + queryPair(subelm, nodes[subelm]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // Serialize node data\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (elm.nodeName === 'FORM') {\n\t\t\t\t\tfor (i = 0; i < elm.elements.length; i += 1) {\n\t\t\t\t\t\tsubelm = elm.elements[i];\n\n\t\t\t\t\t\tif (!subelm.disabled) {\n\t\t\t\t\t\t\tswitch (subelm.type) {\n\t\t\t\t\t\t\t\t// Ignore buttons, unsupported XHR 1 form fields\n\t\t\t\t\t\t\t\tcase 'button':\n\t\t\t\t\t\t\t\tcase 'image':\n\t\t\t\t\t\t\t\tcase 'file':\n\t\t\t\t\t\t\t\tcase 'submit':\n\t\t\t\t\t\t\t\tcase 'reset':\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'select-one':\n\t\t\t\t\t\t\t\t\tif (subelm.length > 0) {\n\t\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'select-multiple':\n\t\t\t\t\t\t\t\t\tfor (j = 0; j < subelm.length; j += 1) {\n\t\t\t\t\t\t\t\t\t\tif (subelm[j].selected) {\n\t\t\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm[j].value);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'checkbox':\n\t\t\t\t\t\t\t\tcase 'radio':\n\t\t\t\t\t\t\t\t\tif (subelm.checked) {\n\t\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t// Everything else including shinny new HTML5 input types\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t}\n\t\t// Tidy up first &\n\t\treturn (querystring.length > 0) ? querystring.substring(1) : '';\n\t}\n\n\t// Class helper\n\tfunction classHelper(classes, action, nodes) {\n\t\tvar classarray, search, i, replace, has = false;\n\t\tif (classes) {\n\t\t\t// Trim any whitespace\n\t\t\tclassarray = classes.split(/\\s+/);\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tfor (i = 0; i < classarray.length; i += 1) {\n\t\t\t\t\tvar clz = classarray[i];\n\t\t\t\t\tif (action === 'remove') {\n\t\t\t\t\t\telm.classList.remove(clz);\n\t\t\t\t\t}\n\t\t\t\t\telse if (action === 'add') {\n\t\t\t\t\t\telm.classList.add(clz);\n\t\t\t\t\t}\n\t\t\t\t\telse if (action === 'toggle') {\n\t\t\t\t\t\telm.classList.toggle(clz);\n\t\t\t\t\t}\n\t\t\t\t\telse if (action === 'has') {\n\t\t\t\t\t\tif (elm.classList.contains(clz)) {\n\t\t\t\t\t\t\thas = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// search = new RegExp('\\\\b' + classarray[i] + '\\\\b', 'g');\n\t\t\t\t\t// replace = new RegExp(' *' + classarray[i] + '\\\\b', 'g');\n\t\t\t\t\t// if (action === 'remove') {\n\t\t\t\t\t// \telm.className = elm.className.replace(search, '');\n\t\t\t\t\t// } else if (action === 'toggle') {\n\t\t\t\t\t// \telm.className = (elm.className.match(search)) ? elm.className.replace(replace, '') : elm.className + ' ' + classarray[i];\n\t\t\t\t\t// } else if (action === 'has') {\n\t\t\t\t\t// \tif (elm.className.match(search)) {\n\t\t\t\t\t// \t\thas = true;\n\t\t\t\t\t// \t\tbreak;\n\t\t\t\t\t// \t}\n\t\t\t\t\t// }\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t}\n\t\treturn has;\n\t}\n\n\t// HTML insertion helper\n\tfunction insertHtml(value, position, nodes) {\n\t\tvar tmpnodes, tmpnode;\n\t\tif (value) {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\t// No insertAdjacentHTML support for FF < 8 and IE doesn't allow insertAdjacentHTML table manipulation, so use this instead\n\t\t\t\t// Convert string to node. We can't innerHTML on a document fragment\n\t\t\t\ttmpnodes = d.createElement('div');\n\t\t\t\ttmpnodes.innerHTML = value;\n\t\t\t\twhile ((tmpnode = tmpnodes.lastChild) !== null) {\n\t\t\t\t\t// Catch error in unlikely case elm has been removed\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (position === 'before') {\n\t\t\t\t\t\t\telm.parentNode.insertBefore(tmpnode, elm);\n\t\t\t\t\t\t} else if (position === 'after') {\n\t\t\t\t\t\t\telm.parentNode.insertBefore(tmpnode, elm.nextSibling);\n\t\t\t\t\t\t} else if (position === 'append') {\n\t\t\t\t\t\t\telm.appendChild(tmpnode);\n\t\t\t\t\t\t} else if (position === 'prepend') {\n\t\t\t\t\t\t\telm.insertBefore(tmpnode, elm.firstChild);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t}\n\t}\n\n\t// Get nodes and return chibi\n\tfunction chibi(selector) {\n\t\tvar cb, nodes = [], json = false, nodelist, i;\n\n\t\tif (selector) {\n\n\t\t\t// Element node, would prefer to use (selector instanceof HTMLElement) but no IE support\n\t\t\tif (selector.nodeType && selector.nodeType === 1) {\n\t\t\t\tnodes = [selector]; // return element as node list\n\t\t\t} else if (typeof selector === 'object') {\n\t\t\t\t// JSON, document object or node list, would prefer to use (selector instanceof NodeList) but no IE support\n\t\t\t\tjson = (typeof selector.length !== 'number');\n\t\t\t\tnodes = selector;\n\t\t\t} else if (typeof selector === 'string') {\n\t\t\t\tnodelist = d.querySelectorAll(selector);\n\n\t\t\t\t// Convert node list to array so results have full access to array methods\n\t\t\t\t// Array.prototype.slice.call not supported in IE < 9 and often slower than loop anyway\n\t\t\t\tfor (i = 0; i < nodelist.length; i += 1) {\n\t\t\t\t\tnodes[i] = nodelist[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Only attach nodes if not JSON\n\t\tcb = json ? {} : nodes;\n\n\t\t// Public functions\n\n\t\t// Executes a function on nodes\n\t\tcb.each = function (fn) {\n\t\t\tif (typeof fn === 'function') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t// <= IE 8 loses scope so need to apply\n\t\t\t\t\treturn fn.apply(elm, arguments);\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Find first\n\t\tcb.first = function () {\n\t\t\treturn chibi(nodes.shift());\n\t\t};\n\t\t// Find last\n\t\tcb.last = function () {\n\t\t\treturn chibi(nodes.pop());\n\t\t};\n\t\t// Find odd\n\t\tcb.odd = function () {\n\t\t\tvar odds = [], i;\n\t\t\tfor (i = 0; i < nodes.length; i += 2) {\n\t\t\t\todds.push(nodes[i]);\n\t\t\t}\n\t\t\treturn chibi(odds);\n\t\t};\n\t\t// Find even\n\t\tcb.even = function () {\n\t\t\tvar evens = [], i;\n\t\t\tfor (i = 1; i < nodes.length; i += 2) {\n\t\t\t\tevens.push(nodes[i]);\n\t\t\t}\n\t\t\treturn chibi(evens);\n\t\t};\n\t\t// Hide node\n\t\tcb.hide = function () {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\telm.style.display = 'none';\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Show node\n\t\tcb.show = function () {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tshowCss(elm);\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Toggle node display\n\t\tcb.toggle = function (state) {\n\t\t\tif (typeof state != 'undefined') { // ADDED\n\t\t\t\tif (state)\n\t\t\t\t\tcb.show();\n\t\t\t\telse\n\t\t\t\t\tcb.hide();\n\t\t\t} else {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t// computeStyle instead of style.display == 'none' catches elements that are hidden via style block\n\t\t\t\t\tif (computeStyle(elm, 'display') === 'none') {\n\t\t\t\t\t\tshowCss(elm);\n\t\t\t\t\t} else {\n\t\t\t\t\t\telm.style.display = 'none';\n\t\t\t\t\t}\n\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Remove node\n\t\tcb.remove = function () {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\t// Catch error in unlikely case elm has been removed\n\t\t\t\ttry {\n\t\t\t\t\telm.parentNode.removeChild(elm);\n\t\t\t\t} catch (e) {\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t\treturn chibi();\n\t\t};\n\t\t// Get/Set CSS\n\t\tcb.css = function (property, value) {\n\t\t\tif (property) {\n\t\t\t\tif (value || value === '') {\n\t\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t\tsetCss(elm, property, value);\n\t\t\t\t\t}, nodes);\n\t\t\t\t\treturn cb;\n\t\t\t\t}\n\t\t\t\tif (nodes[0]) {\n\t\t\t\t\tif (nodes[0].style[cssCamel(property)]) {\n\t\t\t\t\t\treturn nodes[0].style[cssCamel(property)];\n\t\t\t\t\t}\n\t\t\t\t\tif (computeStyle(nodes[0], property)) {\n\t\t\t\t\t\treturn computeStyle(nodes[0], property);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Get class(es)\n\t\tcb.getClass = function () {\n\t\t\tif (nodes[0] && nodes[0].className.length > 0) {\n\t\t\t\t// Weak IE trim support\n\t\t\t\treturn nodes[0].className.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '').replace(/\\s+/, ' ');\n\t\t\t}\n\t\t};\n\t\t// Set (replaces) classes\n\t\tcb.setClass = function (classes) {\n\t\t\tif (classes || classes === '') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\telm.className = classes;\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Add class\n\t\tcb.addClass = function (classes) {\n\t\t\tclassHelper(classes, 'add', nodes);\n\t\t\t// if (classes) {\n\t\t\t// \tnodeLoop(function (elm) {\n\t\t\t// \t\telm.className += ' ' + classes;\n\t\t\t// \t}, nodes);\n\t\t\t// }\n\t\t\treturn cb;\n\t\t};\n\t\t// Remove class\n\t\tcb.removeClass = function (classes) {\n\t\t\tclassHelper(classes, 'remove', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Toggle class\n\t\tcb.toggleClass = function (classes, set) {\n\t\t\tvar method = ((typeof set === 'undefined') ? 'toggle' : (+set ? 'add' : 'remove'));\n\t\t\tclassHelper(classes, method, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Has class\n\t\tcb.hasClass = function (classes) {\n\t\t\treturn classHelper(classes, 'has', nodes);\n\t\t};\n\t\t// Get/set HTML\n\t\tcb.html = function (value) {\n\t\t\tif (value || value === '') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\telm.innerHTML = value;\n\t\t\t\t}, nodes);\n\t\t\t\treturn cb;\n\t\t\t}\n\t\t\tif (nodes[0]) {\n\t\t\t\treturn nodes[0].innerHTML;\n\t\t\t}\n\t\t};\n\t\t// Insert HTML before selector\n\t\tcb.htmlBefore = function (value) {\n\t\t\tinsertHtml(value, 'before', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Insert HTML after selector\n\t\tcb.htmlAfter = function (value) {\n\t\t\tinsertHtml(value, 'after', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Insert HTML after selector innerHTML\n\t\tcb.htmlAppend = function (value) {\n\t\t\tinsertHtml(value, 'append', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Insert HTML before selector innerHTML\n\t\tcb.htmlPrepend = function (value) {\n\t\t\tinsertHtml(value, 'prepend', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Get/Set HTML attributes\n\t\tcb.attr = function (property, value) {\n\t\t\tif (property) {\n\t\t\t\tproperty = property.toLowerCase();\n\t\t\t\t// IE < 9 doesn't allow style or class via get/setAttribute so switch. cssText returns prettier CSS anyway\n\t\t\t\tif (typeof value !== 'undefined') {//FIXED BUG HERE\n\t\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t\tif (property === 'style') {\n\t\t\t\t\t\t\telm.style.cssText = value;\n\t\t\t\t\t\t} else if (property === 'class') {\n\t\t\t\t\t\t\telm.className = value;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\telm.setAttribute(property, value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, nodes);\n\t\t\t\t\treturn cb;\n\t\t\t\t}\n\t\t\t\tif (nodes[0]) {\n\t\t\t\t\tif (property === 'style') {\n\t\t\t\t\t\tif (nodes[0].style.cssText) {\n\t\t\t\t\t\t\treturn nodes[0].style.cssText;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (property === 'class') {\n\t\t\t\t\t\tif (nodes[0].className) {\n\t\t\t\t\t\t\treturn nodes[0].className;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (nodes[0].getAttribute(property)) {\n\t\t\t\t\t\t\treturn nodes[0].getAttribute(property);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Get/Set HTML data property\n\t\tcb.data = function (key, value) {\n\t\t\tif (key) {\n\t\t\t\treturn cb.attr('data-' + key, value);\n\t\t\t}\n\t\t};\n\t\t// Get/Set form element values\n\t\tcb.val = function (value) {\n\t\t\tvar values, i, j;\n\t\t\tif (typeof value != 'undefined') { // FIXED A BUG HERE\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\tswitch (elm.nodeName) {\n\t\t\t\t\t\tcase 'SELECT':\n\t\t\t\t\t\t\tif (typeof value === 'string' || typeof value === 'number') {\n\t\t\t\t\t\t\t\tvalue = [value];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor (i = 0; i < elm.length; i += 1) {\n\t\t\t\t\t\t\t\t// Multiple select\n\t\t\t\t\t\t\t\tfor (j = 0; j < value.length; j += 1) {\n\t\t\t\t\t\t\t\t\telm[i].selected = '';\n\t\t\t\t\t\t\t\t\tif (elm[i].value === \"\"+value[j]) {\n\t\t\t\t\t\t\t\t\t\telm[i].selected = 'selected';\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'INPUT':\n\t\t\t\t\t\tcase 'TEXTAREA':\n\t\t\t\t\t\tcase 'BUTTON':\n\t\t\t\t\t\t\telm.value = value;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}, nodes);\n\n\t\t\t\treturn cb;\n\t\t\t}\n\t\t\tif (nodes[0]) {\n\t\t\t\tswitch (nodes[0].nodeName) {\n\t\t\t\t\tcase 'SELECT':\n\t\t\t\t\t\tvalues = [];\n\t\t\t\t\t\tfor (i = 0; i < nodes[0].length; i += 1) {\n\t\t\t\t\t\t\tif (nodes[0][i].selected) {\n\t\t\t\t\t\t\t\tvalues.push(nodes[0][i].value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn (values.length > 1) ? values : values[0];\n\t\t\t\t\tcase 'INPUT':\n\t\t\t\t\tcase 'TEXTAREA':\n\t\t\t\t\tcase 'BUTTON':\n\t\t\t\t\t\treturn nodes[0].value;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Return matching checked checkbox or radios\n\t\tcb.checked = function (check) {\n\t\t\tif (typeof check === 'boolean') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\tif (elm.nodeName === 'INPUT' && (elm.type === 'checkbox' || elm.type === 'radio')) {\n\t\t\t\t\t\telm.checked = check;\n\t\t\t\t\t}\n\t\t\t\t}, nodes);\n\t\t\t\treturn cb;\n\t\t\t}\n\t\t\tif (nodes[0] && nodes[0].nodeName === 'INPUT' && (nodes[0].type === 'checkbox' || nodes[0].type === 'radio')) {\n\t\t\t\treturn (!!nodes[0].checked);\n\t\t\t}\n\t\t};\n\t\t// Add event handler\n\t\tcb.on = function (event, fn) {\n\t\t\tif (selector === w || selector === d) {\n\t\t\t\tnodes = [selector];\n\t\t\t}\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (d.addEventListener) {\n\t\t\t\t\telm.addEventListener(event, fn, false);\n\t\t\t\t} else if (d.attachEvent) {\n\t\t\t\t\t// <= IE 8 loses scope so need to apply, we add this to object so we can detach later (can't detach anonymous functions)\n\t\t\t\t\telm[event + fn] = function () {\n\t\t\t\t\t\treturn fn.apply(elm, arguments);\n\t\t\t\t\t};\n\t\t\t\t\telm.attachEvent('on' + event, elm[event + fn]);\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Remove event handler\n\t\tcb.off = function (event, fn) {\n\t\t\tif (selector === w || selector === d) {\n\t\t\t\tnodes = [selector];\n\t\t\t}\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (d.addEventListener) {\n\t\t\t\t\telm.removeEventListener(event, fn, false);\n\t\t\t\t} else if (d.attachEvent) {\n\t\t\t\t\telm.detachEvent('on' + event, elm[event + fn]);\n\t\t\t\t\t// Tidy up\n\t\t\t\t\telm[event + fn] = null;\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\treturn cb;\n\t}\n\n\t// Basic XHR\n\tchibi.ajax = function (options) { // if options is a number, it's timeout in ms\n\t\tvar opts = Object.assign({\n\t\t\tmethod: 'GET',\n\t\t\tnocache: true,\n\t\t\ttimeout: 5000,\n\t\t\tloader: true,\n\t\t\tcallback: null\n\t\t}, options);\n\t\topts.method = opts.method.toUpperCase();\n\n\t\tvar loaderFn = opts.loader ? chibi._loader : function(){};\n\t\tvar url = opts.url;\n\t\tvar method = opts.method;\n\t\tvar query = null;\n\n\t\tif (opts.data) {\n\t\t\tquery = serializeData(opts.data);\n\t\t}\n\n\t\tif (query && (method === 'GET')) {\n\t\t\turl += (url.indexOf('?') === -1) ? '?' + query : '&' + query;\n\t\t\tquery = null;\n\t\t}\n\n\t\tvar xhr = new XMLHttpRequest();\n\n\t\t// prevent caching\n\t\tif (opts.nocache) {\n\t\t\tvar ts = (+(new Date())).toString(36);\n\t\t\turl += ((url.indexOf('?') === -1) ? '?' : '&') + '_=' + ts;\n\t\t}\n\n\t\tloaderFn(true);\n\n\t\txhr.open(method, url, true);\n\t\txhr.timeout = opts.timeout;\n\n\t\t// Abort after given timeout\n\t\tvar abortTmeo = setTimeout(function () {\n\t\t\tconsole.error(\"XHR timed out.\");\n\t\t\txhr.abort();\n\t\t\tloaderFn(false);\n\t\t}, opts.timeout + 10);\n\n\t\txhr.onreadystatechange = function () {\n\t\t\tif (xhr.readyState === 4) {\n\t\t\t\tloaderFn(false);\n\n\t\t\t\topts.callback && opts.callback(xhr.responseText, xhr.status);\n\n\t\t\t\tclearTimeout(abortTmeo);\n\t\t\t}\n\t\t};\n\n\t\txhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n\t\tif (method === 'POST') {\n\t\t\txhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n\t\t}\n\n\t\txhr.send(query);\n\t\treturn xhr;\n\t};\n\n\tchibi._loader = function(){};\n\n\t// Alias to cb.ajax(url, 'get', callback)\n\tchibi.get = function (url, callback, opts) {\n\t\topts = opts || {};\n\t\topts.url = url;\n\t\topts.callback = callback;\n\t\topts.method = 'GET';\n\t\treturn chibi.ajax(opts);\n\t};\n\n\t// Alias to cb.ajax(url, 'post', callback)\n\tchibi.post = function (url, callback, opts) {\n\t\topts = opts || {};\n\t\topts.url = url;\n\t\topts.callback = callback;\n\t\topts.method = 'POST';\n\t\treturn chibi.ajax(opts);\n\t};\n\n\t// Fire on DOM ready\n\tchibi.ready = function (fn) {\n\t\tif (fn) {\n\t\t\tif (domready) {\n\t\t\t\tfn();\n\t\t\t\treturn chibi;\n\t\t\t} else {\n\t\t\t\treadyfn.push(fn);\n\t\t\t}\n\t\t}\n\t};\n\n\t// Fire on page loaded\n\tchibi.loaded = function (fn) {\n\t\tif (fn) {\n\t\t\tif (pageloaded) {\n\t\t\t\tfn();\n\t\t\t\treturn chibi;\n\t\t\t} else {\n\t\t\t\tloadedfn.push(fn);\n\t\t\t}\n\t\t}\n\t};\n\n\tvar entityMap = {\n\t\t'&': '&',\n\t\t'<': '<',\n\t\t'>': '>',\n\t\t'\"': '"',\n\t\t\"'\": ''',\n\t\t'/': '/',\n\t\t'`': '`',\n\t\t'=': '='\n\t};\n\n\tchibi.htmlEscape = function(string) {\n\t\treturn String(string).replace(/[&<>\"'`=\\/]/g, function (s) {\n\t\t\treturn entityMap[s];\n\t\t});\n\t};\n\n\t// Set Chibi's global namespace here ($)\n\tw.$ = chibi;\n}());\n","// keymaster.js\n// (c) 2011-2013 Thomas Fuchs\n// keymaster.js may be freely distributed under the MIT license.\n\n;(function(global){\n var k,\n _handlers = {},\n _mods = { 16: false, 18: false, 17: false, 91: false },\n _scope = 'all',\n // modifier keys\n _MODIFIERS = {\n '⇧': 16, shift: 16,\n '⌥': 18, alt: 18, option: 18,\n '⌃': 17, ctrl: 17, control: 17,\n '⌘': 91, command: 91\n },\n // special keys\n _MAP = {\n backspace: 8, tab: 9, clear: 12,\n enter: 13, 'return': 13,\n esc: 27, escape: 27, space: 32,\n left: 37, up: 38,\n right: 39, down: 40,\n del: 46, 'delete': 46,\n home: 36, end: 35,\n pageup: 33, pagedown: 34,\n ',': 188, '.': 190, '/': 191,\n '`': 192, '-': 189, '=': 187,\n ';': 186, '\\'': 222,\n '[': 219, ']': 221, '\\\\': 220,\n // added:\n insert: 45,\n np_0: 96, np_1: 97, np_2: 98, np_3: 99, np_4: 100, np_5: 101,\n\t np_6: 102, np_7: 103, np_8: 104, np_9: 105, np_mul: 106,\n\t np_add: 107, np_sub: 109, np_point: 110, np_div: 111, numlock: 144,\n },\n code = function(x){\n return _MAP[x] || x.toUpperCase().charCodeAt(0);\n },\n _downKeys = [];\n\n for(k=1;k<20;k++) _MAP['f'+k] = 111+k;\n\n // IE doesn't support Array#indexOf, so have a simple replacement\n function index(array, item){\n var i = array.length;\n while(i--) if(array[i]===item) return i;\n return -1;\n }\n\n // for comparing mods before unassignment\n function compareArray(a1, a2) {\n if (a1.length != a2.length) return false;\n for (var i = 0; i < a1.length; i++) {\n if (a1[i] !== a2[i]) return false;\n }\n return true;\n }\n\n var modifierMap = {\n 16:'shiftKey',\n 18:'altKey',\n 17:'ctrlKey',\n 91:'metaKey'\n };\n function updateModifierKey(event) {\n for(k in _mods) _mods[k] = event[modifierMap[k]];\n };\n\n function isModifierPressed(mod) {\n if (mod=='control'||mod=='ctrl') return _mods[17];\n\tif (mod=='shift') return _mods[16];\n\tif (mod=='meta') return _mods[91];\n\tif (mod=='alt') return _mods[18];\n\treturn false;\n }\n\n // handle keydown event\n function dispatch(event) {\n var key, handler, k, i, modifiersMatch, scope;\n key = event.keyCode;\n\n if (index(_downKeys, key) == -1) {\n _downKeys.push(key);\n }\n\n // if a modifier key, set the key.<modifierkeyname> property to true and return\n if(key == 93 || key == 224) key = 91; // right command on webkit, command on Gecko\n if(key in _mods) {\n _mods[key] = true;\n // 'assignKey' from inside this closure is exported to window.key\n for(k in _MODIFIERS) if(_MODIFIERS[k] == key) assignKey[k] = true;\n return;\n }\n updateModifierKey(event);\n\n // see if we need to ignore the keypress (filter() can can be overridden)\n // by default ignore key presses if a select, textarea, or input is focused\n if(!assignKey.filter.call(this, event)) return;\n\n // abort if no potentially matching shortcuts found\n if (!(key in _handlers)) return;\n\n scope = getScope();\n\n // for each potential shortcut\n for (i = 0; i < _handlers[key].length; i++) {\n handler = _handlers[key][i];\n\n // see if it's in the current scope\n if(handler.scope == scope || handler.scope == 'all'){\n // check if modifiers match if any\n modifiersMatch = handler.mods.length > 0;\n for(k in _mods)\n if((!_mods[k] && index(handler.mods, +k) > -1) ||\n (_mods[k] && index(handler.mods, +k) == -1)) modifiersMatch = false;\n // call the handler and stop the event if neccessary\n if((handler.mods.length == 0 && !_mods[16] && !_mods[18] && !_mods[17] && !_mods[91]) || modifiersMatch){\n if(handler.method(event, handler)===false){\n if(event.preventDefault) event.preventDefault();\n else event.returnValue = false;\n if(event.stopPropagation) event.stopPropagation();\n if(event.cancelBubble) event.cancelBubble = true;\n }\n }\n }\n }\n };\n\n // unset modifier keys on keyup\n function clearModifier(event){\n var key = event.keyCode, k,\n i = index(_downKeys, key);\n\n // remove key from _downKeys\n if (i >= 0) {\n _downKeys.splice(i, 1);\n }\n\n if(key == 93 || key == 224) key = 91;\n if(key in _mods) {\n _mods[key] = false;\n for(k in _MODIFIERS) if(_MODIFIERS[k] == key) assignKey[k] = false;\n }\n };\n\n function resetModifiers() {\n for(k in _mods) _mods[k] = false;\n for(k in _MODIFIERS) assignKey[k] = false;\n };\n\n // parse and assign shortcut\n function assignKey(key, scope, method){\n var keys, mods;\n keys = getKeys(key);\n if (method === undefined) {\n method = scope;\n scope = 'all';\n }\n\n // for each shortcut\n for (var i = 0; i < keys.length; i++) {\n // set modifier keys if any\n mods = [];\n key = keys[i].split('+');\n if (key.length > 1){\n mods = getMods(key);\n key = [key[key.length-1]];\n }\n // convert to keycode and...\n key = key[0]\n key = code(key);\n // ...store handler\n if (!(key in _handlers)) _handlers[key] = [];\n _handlers[key].push({ shortcut: keys[i], scope: scope, method: method, key: keys[i], mods: mods });\n }\n };\n\n // unbind all handlers for given key in current scope\n function unbindKey(key, scope) {\n var multipleKeys, keys,\n mods = [],\n i, j, obj;\n\n multipleKeys = getKeys(key);\n\n for (j = 0; j < multipleKeys.length; j++) {\n keys = multipleKeys[j].split('+');\n\n if (keys.length > 1) {\n mods = getMods(keys);\n }\n\n key = keys[keys.length - 1];\n key = code(key);\n\n if (scope === undefined) {\n scope = getScope();\n }\n if (!_handlers[key]) {\n return;\n }\n for (i = 0; i < _handlers[key].length; i++) {\n obj = _handlers[key][i];\n // only clear handlers if correct scope and mods match\n if (obj.scope === scope && compareArray(obj.mods, mods)) {\n _handlers[key][i] = {};\n }\n }\n }\n };\n\n // Returns true if the key with code 'keyCode' is currently down\n // Converts strings into key codes.\n function isPressed(keyCode) {\n if (typeof(keyCode)=='string') {\n keyCode = code(keyCode);\n }\n return index(_downKeys, keyCode) != -1;\n }\n\n function getPressedKeyCodes() {\n return _downKeys.slice(0);\n }\n\n function filter(event){\n var tagName = (event.target || event.srcElement).tagName;\n // ignore keypressed in any elements that support keyboard data input\n return !(tagName == 'INPUT' || tagName == 'SELECT' || tagName == 'TEXTAREA');\n }\n\n // initialize key.<modifier> to false\n for(k in _MODIFIERS) assignKey[k] = false;\n\n // set current scope (default 'all')\n function setScope(scope){ _scope = scope || 'all' };\n function getScope(){ return _scope || 'all' };\n\n // delete all handlers for a given scope\n function deleteScope(scope){\n var key, handlers, i;\n\n for (key in _handlers) {\n handlers = _handlers[key];\n for (i = 0; i < handlers.length; ) {\n if (handlers[i].scope === scope) handlers.splice(i, 1);\n else i++;\n }\n }\n };\n\n // abstract key logic for assign and unassign\n function getKeys(key) {\n var keys;\n key = key.replace(/\\s/g, '');\n keys = key.split(',');\n if ((keys[keys.length - 1]) == '') {\n keys[keys.length - 2] += ',';\n }\n return keys;\n }\n\n // abstract mods logic for assign and unassign\n function getMods(key) {\n var mods = key.slice(0, key.length - 1);\n for (var mi = 0; mi < mods.length; mi++)\n mods[mi] = _MODIFIERS[mods[mi]];\n return mods;\n }\n\n // cross-browser events\n function addEvent(object, event, method) {\n if (object.addEventListener)\n object.addEventListener(event, method, false);\n else if(object.attachEvent)\n object.attachEvent('on'+event, function(){ method(window.event) });\n };\n\n // set the handlers globally on document\n addEvent(document, 'keydown', function(event) { dispatch(event) }); // Passing _scope to a callback to ensure it remains the same by execution. Fixes #48\n addEvent(document, 'keyup', clearModifier);\n\n // reset modifiers to false whenever the window is (re)focused.\n addEvent(window, 'focus', resetModifiers);\n\n // store previously defined key\n var previousKey = global.key;\n\n // restore previously defined key and return reference to our key object\n function noConflict() {\n var k = global.key;\n global.key = previousKey;\n return k;\n }\n\n // set window.key and window.key.set/get/deleteScope, and the default filter\n global.key = assignKey;\n global.key.setScope = setScope;\n global.key.getScope = getScope;\n global.key.deleteScope = deleteScope;\n global.key.filter = filter;\n global.key.isPressed = isPressed;\n global.key.isModifier = isModifierPressed;\n global.key.getPressedKeyCodes = getPressedKeyCodes;\n global.key.noConflict = noConflict;\n global.key.unbind = unbindKey;\n\n if(typeof module !== 'undefined') module.exports = assignKey;\n\n})(window);\n\n","/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */\nif (!String.fromCodePoint) {\n (function () {\n var defineProperty = (function () {\n // IE 8 only supports `Object.defineProperty` on DOM elements\n try {\n var object = {};\n var $defineProperty = Object.defineProperty;\n var result = $defineProperty(object, object, object) && $defineProperty;\n } catch (error) {\n }\n return result;\n }());\n var stringFromCharCode = String.fromCharCode;\n var floor = Math.floor;\n var fromCodePoint = function () {\n var MAX_SIZE = 0x4000;\n var codeUnits = [];\n var highSurrogate;\n var lowSurrogate;\n var index = -1;\n var length = arguments.length;\n if (!length) {\n return '';\n }\n var result = '';\n while (++index < length) {\n var codePoint = Number(arguments[index]);\n if (\n !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`\n codePoint < 0 || // not a valid Unicode code point\n codePoint > 0x10FFFF || // not a valid Unicode code point\n floor(codePoint) != codePoint // not an integer\n ) {\n throw RangeError('Invalid code point: ' + codePoint);\n }\n if (codePoint <= 0xFFFF) { // BMP code point\n codeUnits.push(codePoint);\n } else { // Astral code point; split in surrogate halves\n // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n codePoint -= 0x10000;\n highSurrogate = (codePoint >> 10) + 0xD800;\n lowSurrogate = (codePoint % 0x400) + 0xDC00;\n codeUnits.push(highSurrogate, lowSurrogate);\n }\n if (index + 1 == length || codeUnits.length > MAX_SIZE) {\n result += stringFromCharCode.apply(null, codeUnits);\n codeUnits.length = 0;\n }\n }\n return result;\n };\n if (defineProperty) {\n defineProperty(String, 'fromCodePoint', {\n 'value': fromCodePoint,\n 'configurable': true,\n 'writable': true\n });\n } else {\n String.fromCodePoint = fromCodePoint;\n }\n }());\n}\n","/** Make a node */\nfunction mk (e) {\n return document.createElement(e)\n}\n\n/** Find one by query */\nfunction qs (s) {\n return document.querySelector(s)\n}\n\n/** Find all by query */\nfunction qsa (s) {\n return document.querySelectorAll(s)\n}\n\n/** Convert any to bool safely */\nfunction bool (x) {\n return (x === 1 || x === '1' || x === true || x === 'true')\n}\n\n/**\n * Filter 'spacebar' and 'return' from keypress handler,\n * and when they're pressed, fire the callback.\n * use $(...).on('keypress', cr(handler))\n */\nfunction cr (hdl) {\n return function (e) {\n if (e.which === 10 || e.which === 13 || e.which === 32) {\n hdl()\n }\n }\n}\n\n/** HTML escape */\nfunction esc (str) {\n return $.htmlEscape(str)\n}\n\n/** Check for undefined */\nfunction undef (x) {\n return typeof x == 'undefined'\n}\n\n/** Safe json parse */\nfunction jsp (str) {\n try {\n return JSON.parse(str)\n } catch (e) {\n console.error(e)\n return null\n }\n}\n\n/** Create a character from ASCII code */\nfunction Chr (n) {\n return String.fromCharCode(n)\n}\n\n/** Decode number from 2B encoding */\nfunction parse2B (s, i = 0) {\n return (s.charCodeAt(i++) - 1) + (s.charCodeAt(i) - 1) * 127\n}\n\n/** Decode number from 3B encoding */\nfunction parse3B (s, i = 0) {\n return (s.charCodeAt(i) - 1) + (s.charCodeAt(i + 1) - 1) * 127 + (s.charCodeAt(i + 2) - 1) * 127 * 127\n}\n\n/** Encode using 2B encoding, returns string. */\nfunction encode2B (n) {\n let lsb, msb\n lsb = (n % 127)\n n = ((n - lsb) / 127)\n lsb += 1\n msb = (n + 1)\n return Chr(lsb) + Chr(msb)\n}\n\n/** Encode using 3B encoding, returns string. */\nfunction encode3B (n) {\n let lsb, msb, xsb\n lsb = (n % 127)\n n = (n - lsb) / 127\n lsb += 1\n msb = (n % 127)\n n = (n - msb) / 127\n msb += 1\n xsb = (n + 1)\n return Chr(lsb) + Chr(msb) + Chr(xsb)\n}\n","/** Module for toggling a modal overlay */\n(function () {\n let modal = {}\n let curCloseCb = null\n\n modal.show = function (sel, closeCb) {\n let $m = $(sel)\n $m.removeClass('hidden visible')\n setTimeout(function () {\n $m.addClass('visible')\n }, 1)\n curCloseCb = closeCb\n }\n\n modal.hide = function (sel) {\n let $m = $(sel)\n $m.removeClass('visible')\n setTimeout(function () {\n $m.addClass('hidden')\n if (curCloseCb) curCloseCb()\n }, 500) // transition time\n }\n\n modal.init = function () {\n // close modal by click outside the dialog\n $('.Modal').on('click', function () {\n if ($(this).hasClass('no-close')) return // this is a no-close modal\n modal.hide(this)\n })\n\n $('.Dialog').on('click', function (e) {\n e.stopImmediatePropagation()\n })\n\n // Hide all modals on esc\n $(window).on('keydown', function (e) {\n if (e.which === 27) {\n modal.hide('.Modal')\n }\n })\n }\n\n window.Modal = modal\n})()\n","window.Notify = (function () {\n let nt = {}\n const sel = '#notif'\n let $balloon\n\n let timerHideBegin // timeout to start hiding (transition)\n let timerHideEnd // timeout to add the hidden class\n let timerCanCancel\n let canCancel = false\n\n let stopTimeouts = function () {\n clearTimeout(timerHideBegin)\n clearTimeout(timerHideEnd)\n }\n\n nt.show = function (message, timeout, isError) {\n $balloon.toggleClass('error', isError === true)\n $balloon.html(message)\n Modal.show($balloon)\n stopTimeouts()\n\n if (undef(timeout) || timeout === null || timeout <= 0) {\n timeout = 2500\n }\n\n timerHideBegin = setTimeout(nt.hide, timeout)\n\n canCancel = false\n timerCanCancel = setTimeout(function () {\n canCancel = true\n }, 500)\n }\n\n nt.hide = function () {\n let $m = $(sel)\n $m.removeClass('visible')\n timerHideEnd = setTimeout(function () {\n $m.addClass('hidden')\n }, 250) // transition time\n }\n\n nt.init = function () {\n $balloon = $(sel)\n\n // close by click outside\n $(document).on('click', function () {\n if (!canCancel) return\n nt.hide(this)\n })\n\n // click caused by selecting, prevent it from bubbling\n $balloon.on('click', function (e) {\n e.stopImmediatePropagation()\n return false\n })\n\n // stop fading if moused\n $balloon.on('mouseenter', function () {\n stopTimeouts()\n $balloon.removeClass('hidden').addClass('visible')\n })\n }\n\n return nt\n})()\n","/** Global generic init */\n$.ready(function () {\n // Checkbox UI (checkbox CSS and hidden input with int value)\n $('.Row.checkbox').forEach(function (x) {\n let inp = x.querySelector('input')\n let box = x.querySelector('.box')\n\n $(box).toggleClass('checked', inp.value)\n\n let hdl = function () {\n inp.value = 1 - inp.value\n $(box).toggleClass('checked', inp.value)\n }\n\n $(x).on('click', hdl).on('keypress', cr(hdl))\n })\n\n // Expanding boxes on mobile\n $('.Box.mobcol,.Box.fold').forEach(function (x) {\n let h = x.querySelector('h2')\n\n let hdl = function () {\n $(x).toggleClass('expanded')\n }\n $(h).on('click', hdl).on('keypress', cr(hdl))\n })\n\n $('form').forEach(function (x) {\n $(x).on('keypress', function (e) {\n if ((e.keyCode === 10 || e.keyCode === 13) && e.ctrlKey) {\n x.submit()\n }\n })\n })\n\n // loader dots...\n setInterval(function () {\n $('.anim-dots').each(function (x) {\n let $x = $(x)\n let dots = $x.html() + '.'\n if (dots.length === 5) dots = '.'\n $x.html(dots)\n })\n }, 1000)\n\n // flipping number boxes with the mouse wheel\n $('input[type=number]').on('mousewheel', function (e) {\n let $this = $(this)\n let val = +$this.val()\n if (isNaN(val)) val = 1\n\n const step = +($this.attr('step') || 1)\n const min = +$this.attr('min')\n const max = +$this.attr('max')\n if (e.wheelDelta > 0) {\n val += step\n } else {\n val -= step\n }\n\n if (undef(min)) val = Math.max(val, +min)\n if (undef(max)) val = Math.min(val, +max)\n $this.val(val)\n\n if ('createEvent' in document) {\n let evt = document.createEvent('HTMLEvents')\n evt.initEvent('change', false, true)\n $this[0].dispatchEvent(evt)\n } else {\n $this[0].fireEvent('onchange')\n }\n\n e.preventDefault()\n })\n\n // populate the form errors box from GET arg ?err=...\n // (a way to pass errors back from server via redirect)\n let errAt = location.search.indexOf('err=')\n if (errAt !== -1 && qs('.Box.errors')) {\n let errs = location.search.substr(errAt + 4).split(',')\n let humanReadableErrors = []\n errs.forEach(function (er) {\n let lbl = qs('label[for=\"' + er + '\"]')\n if (lbl) {\n lbl.classList.add('error')\n humanReadableErrors.push(lbl.childNodes[0].textContent.trim().replace(/: ?$/, ''))\n }\n // else {\n // hres.push(er)\n // }\n })\n\n qs('.Box.errors .list').innerHTML = humanReadableErrors.join(', ')\n qs('.Box.errors').classList.remove('hidden')\n }\n\n Modal.init()\n Notify.init()\n\n // remove tabindices from h2 if wide\n if (window.innerWidth > 550) {\n $('.Box h2').forEach(function (x) {\n x.removeAttribute('tabindex')\n })\n\n // brand works as a link back to term in widescreen mode\n let br = qs('#brand')\n br && br.addEventListener('click', function () {\n location.href = '/' // go to terminal\n })\n }\n})\n\n// setup the ajax loader\n$._loader = function (vis) {\n $('#loader').toggleClass('show', vis)\n}\n\n// reveal content on load\nfunction showPage () {\n $('#content').addClass('load')\n}\n\n// Auto reveal pages other than the terminal (sets window.noAutoShow)\n$.ready(function () {\n if (window.noAutoShow !== true) {\n setTimeout(function () {\n showPage()\n }, 1)\n }\n})\n","class ANSIParser {\n constructor (handler) {\n this.reset()\n this.handler = handler\n this.joinChunks = true\n }\n reset () {\n this.currentSequence = 0\n this.sequence = ''\n }\n parseSequence (sequence) {\n if (sequence[0] === '[') {\n let type = sequence[sequence.length - 1]\n let content = sequence.substring(1, sequence.length - 1)\n\n let numbers = content ? content.split(';').map(i => +i.replace(/\\D/g, '')) : []\n let numOr1 = numbers.length ? numbers[0] : 1\n if (type === 'H') {\n this.handler('set-cursor', (numbers[0] | 0) - 1, (numbers[1] | 0) - 1)\n } else if (type >= 'A' && type <= 'D') {\n this.handler(`move-cursor-${type <= 'B' ? 'y' : 'x'}`, ((type === 'B' || type === 'C') ? 1 : -1) * numOr1)\n } else if (type === 'E' || type === 'F') {\n this.handler('move-cursor-line', (type === 'E' ? 1 : -1) * numOr1)\n } else if (type === 'G') {\n this.handler('set-cursor-x', numOr1 - 1)\n } else if (type === 'J') {\n let number = numbers.length ? numbers[0] : 2\n if (number === 2) this.handler('clear')\n } else if (type === 'P') {\n this.handler('delete', numOr1)\n } else if (type === '@') {\n this.handler('insert-blanks', numOr1)\n } else if (type === 'q') this.handler('set-cursor-style', numOr1)\n else if (type === 'm') {\n if (!numbers.length || numbers[0] === 0) {\n this.handler('reset-style')\n return\n }\n let type = numbers[0]\n if (type === 1) this.handler('add-attrs', 1) // bold\n else if (type === 2) this.handler('add-attrs', 1 << 1) // faint\n else if (type === 3) this.handler('add-attrs', 1 << 2) // italic\n else if (type === 4) this.handler('add-attrs', 1 << 3) // underline\n else if (type === 5 || type === 6) this.handler('add-attrs', 1 << 4) // blink\n else if (type === 7) this.handler('add-attrs', -1) // invert\n else if (type === 9) this.handler('add-attrs', 1 << 6) // strike\n else if (type === 20) this.handler('add-attrs', 1 << 5) // fraktur\n else if (type >= 30 && type <= 37) this.handler('set-color-fg', type % 10)\n else if (type >= 40 && type <= 47) this.handler('set-color-bg', type % 10)\n else if (type === 39) this.handler('set-color-fg', 7)\n else if (type === 49) this.handler('set-color-bg', 0)\n else if (type >= 90 && type <= 98) this.handler('set-color-fg', (type % 10) + 8)\n else if (type >= 100 && type <= 108) this.handler('set-color-bg', (type % 10) + 8)\n else if (type === 38 || type === 48) {\n if (numbers[1] === 5) {\n let color = (numbers[2] | 0) & 0xFF\n if (type === 38) this.handler('set-color-fg', color)\n if (type === 48) this.handler('set-color-bg', color)\n }\n }\n } else if (type === 'h' || type === 'l') {\n if (content === '?25') {\n if (type === 'h') this.handler('show-cursor')\n else if (type === 'l') this.handler('hide-cursor')\n }\n }\n }\n }\n write (text) {\n for (let character of text.toString()) {\n let code = character.codePointAt(0)\n if (code === 0x1b) this.currentSequence = 1\n else if (this.currentSequence === 1 && character === '[') {\n this.currentSequence = 2\n this.sequence += '['\n } else if (this.currentSequence && character.match(/[\\x40-\\x7e]/)) {\n this.parseSequence(this.sequence + character)\n this.currentSequence = 0\n this.sequence = ''\n } else if (this.currentSequence > 1) this.sequence += character\n else if (this.currentSequence === 1) {\n // something something nothing\n this.currentSequence = 0\n this.handler('write', character)\n } else if (code < 0x03) this.handler('_null')\n else if (code === 0x03) this.handler('sigint')\n else if (code <= 0x06) this.handler('_null')\n else if (code === 0x07) this.handler('bell')\n else if (code === 0x08) this.handler('back')\n else if (code === 0x0a) this.handler('new-line')\n else if (code === 0x0d) this.handler('return')\n else if (code === 0x15) this.handler('delete-line')\n else if (code === 0x17) this.handler('delete-word')\n else this.handler('write', character)\n }\n if (!this.joinChunks) this.reset()\n }\n}\nconst TERM_DEFAULT_STYLE = 7\nconst TERM_MIN_DRAW_DELAY = 10\n\nlet getRainbowColor = t => {\n let r = Math.floor(Math.sin(t) * 2.5 + 2.5)\n let g = Math.floor(Math.sin(t + 2 / 3 * Math.PI) * 2.5 + 2.5)\n let b = Math.floor(Math.sin(t + 4 / 3 * Math.PI) * 2.5 + 2.5)\n return 16 + 36 * r + 6 * g + b\n}\n\nclass ScrollingTerminal {\n constructor (screen) {\n this.width = 80\n this.height = 25\n this.termScreen = screen\n this.parser = new ANSIParser((...args) => this.handleParsed(...args))\n\n this.reset()\n\n this._lastLoad = Date.now()\n this.termScreen.load(this.serialize(), 0)\n }\n reset () {\n this.style = TERM_DEFAULT_STYLE\n this.cursor = { x: 0, y: 0, style: 1, visible: true }\n this.trackMouse = false\n this.theme = 0\n this.rainbow = false\n this.parser.reset()\n this.clear()\n }\n clear () {\n this.screen = []\n for (let i = 0; i < this.width * this.height; i++) {\n this.screen.push([' ', this.style])\n }\n }\n scroll () {\n this.screen.splice(0, this.width)\n for (let i = 0; i < this.width; i++) {\n this.screen.push([' ', TERM_DEFAULT_STYLE])\n }\n this.cursor.y--\n }\n newLine () {\n this.cursor.y++\n if (this.cursor.y >= this.height) this.scroll()\n }\n writeChar (character) {\n this.screen[this.cursor.y * this.width + this.cursor.x] = [character, this.style]\n this.cursor.x++\n if (this.cursor.x >= this.width) {\n this.cursor.x = 0\n this.newLine()\n }\n }\n moveBack (n = 1) {\n for (let i = 0; i < n; i++) {\n this.cursor.x--\n if (this.cursor.x < 0) {\n if (this.cursor.y > 0) this.cursor.x = this.width - 1\n else this.cursor.x = 0\n this.cursor.y = Math.max(0, this.cursor.y - 1)\n }\n }\n }\n moveForward (n = 1) {\n for (let i = 0; i < n; i++) {\n this.cursor.x++\n if (this.cursor.x >= this.width) {\n this.cursor.x = 0\n this.cursor.y++\n if (this.cursor.y >= this.height) this.scroll()\n }\n }\n }\n deleteChar () {\n this.moveBack()\n this.screen.splice((this.cursor.y + 1) * this.width, 0, [' ', TERM_DEFAULT_STYLE])\n this.screen.splice(this.cursor.y * this.width + this.cursor.x, 1)\n }\n deleteForward (n) {\n n = Math.min(this.width, n)\n for (let i = 0; i < n; i++) this.screen.splice((this.cursor.y + 1) * this.width, 0, [' ', TERM_DEFAULT_STYLE])\n this.screen.splice(this.cursor.y * this.width + this.cursor.x, n)\n }\n clampCursor () {\n if (this.cursor.x < 0) this.cursor.x = 0\n if (this.cursor.y < 0) this.cursor.y = 0\n if (this.cursor.x > this.width - 1) this.cursor.x = this.width - 1\n if (this.cursor.y > this.height - 1) this.cursor.y = this.height - 1\n }\n handleParsed (action, ...args) {\n if (action === 'write') {\n this.writeChar(args[0])\n } else if (action === 'delete') {\n this.deleteForward(args[0])\n } else if (action === 'insert-blanks') {\n this.insertBlanks(args[0])\n } else if (action === 'clear') {\n this.clear()\n } else if (action === 'bell') {\n this.terminal.load('B')\n } else if (action === 'back') {\n this.moveBack()\n } else if (action === 'new-line') {\n this.newLine()\n } else if (action === 'return') {\n this.cursor.x = 0\n } else if (action === 'set-cursor') {\n this.cursor.x = args[1]\n this.cursor.y = args[0]\n this.clampCursor()\n } else if (action === 'move-cursor-y') {\n this.cursor.y += args[0]\n this.clampCursor()\n } else if (action === 'move-cursor-x') {\n this.cursor.x += args[0]\n this.clampCursor()\n } else if (action === 'move-cursor-line') {\n this.cursor.x = 0\n this.cursor.y += args[0]\n this.clampCursor()\n } else if (action === 'set-cursor-x') {\n this.cursor.x = args[0]\n } else if (action === 'set-cursor-style') {\n this.cursor.style = Math.max(0, Math.min(6, args[0]))\n } else if (action === 'reset-style') {\n this.style = TERM_DEFAULT_STYLE\n } else if (action === 'add-attrs') {\n if (args[0] === -1) {\n this.style = (this.style & 0xFF0000) | ((this.style >> 8) & 0xFF) | ((this.style & 0xFF) << 8)\n } else {\n this.style |= (args[0] << 16)\n }\n } else if (action === 'set-color-fg') {\n this.style = (this.style & 0xFFFF00) | args[0]\n } else if (action === 'set-color-bg') {\n this.style = (this.style & 0xFF00FF) | (args[0] << 8)\n } else if (action === 'hide-cursor') {\n this.cursor.visible = false\n } else if (action === 'show-cursor') {\n this.cursor.visible = true\n }\n }\n write (text) {\n this.parser.write(text)\n this.scheduleLoad()\n }\n serialize () {\n let serialized = 'S'\n serialized += encode2B(this.height) + encode2B(this.width)\n serialized += encode2B(this.cursor.y) + encode2B(this.cursor.x)\n\n let attributes = +this.cursor.visible\n attributes |= (3 << 5) * +this.trackMouse // track mouse controls both\n attributes |= 3 << 7 // buttons/links always visible\n attributes |= (this.cursor.style << 9)\n serialized += encode3B(attributes)\n\n let lastStyle = null\n let index = 0\n for (let cell of this.screen) {\n let style = cell[1]\n if (this.rainbow) {\n let x = index % this.width\n let y = Math.floor(index / this.width)\n style = (style & 0xFF0000) | getRainbowColor((x + y) / 10 + Date.now() / 1000)\n index++\n }\n if (style !== lastStyle) {\n let foreground = style & 0xFF\n let background = (style >> 8) & 0xFF\n let attributes = (style >> 16) & 0xFF\n let setForeground = foreground !== (lastStyle & 0xFF)\n let setBackground = background !== ((lastStyle >> 8) & 0xFF)\n let setAttributes = attributes !== ((lastStyle >> 16) & 0xFF)\n\n if (setForeground && setBackground) serialized += '\\x03' + encode3B(style & 0xFFFF)\n else if (setForeground) serialized += '\\x05' + encode2B(foreground)\n else if (setBackground) serialized += '\\x06' + encode2B(background)\n if (setAttributes) serialized += '\\x04' + encode2B(attributes)\n\n lastStyle = style\n }\n serialized += cell[0]\n }\n return serialized\n }\n scheduleLoad () {\n clearTimeout(this._scheduledLoad)\n if (this._lastLoad < Date.now() - TERM_MIN_DRAW_DELAY) {\n this.termScreen.load(this.serialize(), this.theme)\n } else {\n this._scheduledLoad = setTimeout(() => {\n this.termScreen.load(this.serialize())\n }, TERM_MIN_DRAW_DELAY - this._lastLoad)\n }\n }\n rainbowTimer () {\n if (!this.rainbow) return\n clearInterval(this._rainbowTimer)\n this._rainbowTimer = setInterval(() => {\n if (this.rainbow) this.scheduleLoad()\n }, 50)\n }\n}\n\nclass Process {\n constructor (args) {\n // event listeners\n this._listeners = {}\n }\n on (event, listener) {\n if (!this._listeners[event]) this._listeners[event] = []\n this._listeners[event].push({ listener })\n }\n once (event, listener) {\n if (!this._listeners[event]) this._listeners[event] = []\n this._listeners[event].push({ listener, once: true })\n }\n off (event, listener) {\n let listeners = this._listeners[event]\n if (listeners) {\n for (let i in listeners) {\n if (listeners[i].listener === listener) {\n listeners.splice(i, 1)\n break\n }\n }\n }\n }\n emit (event, ...args) {\n let listeners = this._listeners[event]\n if (listeners) {\n let remove = []\n for (let listener of listeners) {\n try {\n listener.listener(...args)\n if (listener.once) remove.push(listener)\n } catch (err) {\n console.error(err)\n }\n }\n for (let listener of remove) {\n listeners.splice(listeners.indexOf(listener), 1)\n }\n }\n }\n write (data) {\n this.emit('in', data)\n }\n destroy () {\n // death.\n this.emit('exit', 0)\n }\n run () {\n // noop\n }\n}\n\nlet demoData = {\n buttons: {\n 1: '',\n 2: '',\n 3: '',\n 4: '',\n 5: function (terminal, shell) {\n if (shell.child) shell.child.destroy()\n let chars = 'info\\r'\n let loop = function () {\n shell.write(chars[0])\n chars = chars.substr(1)\n if (chars) setTimeout(loop, 100)\n }\n setTimeout(loop, 200)\n }\n },\n mouseReceiver: null\n}\n\nlet demoshIndex = {\n clear: class Clear extends Process {\n run () {\n this.emit('write', '\\x1b[2J\\x1b[1;1H')\n this.destroy()\n }\n },\n screenfetch: class Screenfetch extends Process {\n run () {\n let image = `\n ###. ESPTerm Demo\n '###. Hostname: ${window.location.hostname}\n '###. Shell: ESPTerm Demo Shell\n '###. Resolution: 80x25@${window.devicePixelRatio}x\n :###-\n .###'\n .###'\n .###' ###############\n ###' ###############\n `.split('\\n').filter(line => line.trim())\n\n let chars = ''\n for (let y = 0; y < image.length; y++) {\n for (let x = 0; x < 80; x++) {\n if (image[y][x]) {\n chars += `\\x1b[38;5;${getRainbowColor((x + y) / 10)}m${image[y][x]}`\n } else chars += ' '\n }\n }\n\n this.emit('write', '\\r\\n\\x1b[?25l')\n let loop = () => {\n this.emit('write', chars.substr(0, 80))\n chars = chars.substr(80)\n if (chars.length) setTimeout(loop, 50)\n else {\n this.emit('write', '\\r\\n\\x1b[?25h')\n this.destroy()\n }\n }\n loop()\n }\n },\n 'local-echo': class LocalEcho extends Process {\n run (...args) {\n if (!args.includes('--suppress-note')) {\n this.emit('write', '\\x1b[38;5;239mNote: not all terminal features are supported or and may not work as expected in this demo\\x1b[0m\\r\\n')\n }\n }\n write (data) {\n this.emit('write', data)\n }\n },\n 'info': class Info extends Process {\n run (...args) {\n let fast = args.includes('--fast')\n this.showSplash().then(() => {\n this.printText(fast)\n })\n }\n showSplash () {\n let splash = `\n -#####- -###*..#####- ######-\n -#* -#- .## .##. *#-\n -##### .-###*..#####- *#- -*##*- #*-#--#**#-*##-\n -#* -#-.##. *#- *##@#* ##. -#* *# .#*\n -#####--####- .##. *#- -*#@@- ##. -#* *# .#*\n `.split('\\n').filter(line => line.trim())\n let levels = {\n ' ': -231,\n '.': 4,\n '-': 8,\n '*': 17,\n '#': 24\n }\n for (let i in splash) {\n if (splash[i].length < 79) splash[i] += ' '.repeat(79 - splash[i].length)\n }\n this.emit('write', '\\r\\n'.repeat(splash.length + 1))\n this.emit('write', '\\x1b[A'.repeat(splash.length))\n this.emit('write', '\\x1b[?25l')\n\n let cursorX = 0\n let cursorY = 0\n let moveTo = (x, y) => {\n let moveX = x - cursorX\n let moveY = y - cursorY\n this.emit('write', `\\x1b[${Math.abs(moveX)}${moveX > 0 ? 'C' : 'D'}`)\n this.emit('write', `\\x1b[${Math.abs(moveY)}${moveY > 0 ? 'B' : 'A'}`)\n cursorX = x\n cursorY = y\n }\n let drawCell = (x, y) => {\n moveTo(x, y)\n if (splash[y][x] === '@') {\n this.emit('write', '\\x1b[48;5;8m\\x1b[38;5;255m▄\\b')\n } else {\n this.emit('write', `\\x1b[48;5;${231 + levels[splash[y][x]]}m \\b`)\n }\n }\n return new Promise((resolve, reject) => {\n const self = this\n let x = 14\n let cycles = 0\n let loop = function () {\n for (let y = 0; y < splash.length; y++) {\n let dx = x - y\n if (dx > 0) drawCell(dx, y)\n }\n\n if (++x < 79) {\n if (++cycles >= 3) {\n setTimeout(loop, 20)\n cycles = 0\n } else loop()\n } else {\n moveTo(0, splash.length)\n self.emit('write', '\\x1b[m\\x1b[?25h')\n resolve()\n }\n }\n loop()\n })\n }\n printText (fast = false) {\n // lots of printing\n let parts = [\n '',\n ' ESPTerm is a VT100-like terminal emulator running on the ESP8266 WiFi chip.',\n '',\n ' \\x1b[93mThis is an online demo of the web user interface, simulating a simple ',\n ' terminal in your browser.\\x1b[m',\n '',\n ' Type \\x1b[92mls\\x1b[m to list available commands.',\n ' Use the \\x1b[94mlinks\\x1b[m below this screen for a demo of the options and more info.',\n ''\n ]\n\n if (fast) {\n this.emit('write', parts.join('\\r\\n') + '\\r\\n')\n this.destroy()\n } else {\n const self = this\n let loop = function () {\n self.emit('write', parts.shift() + '\\r\\n')\n if (parts.length) setTimeout(loop, 17)\n else self.destroy()\n }\n loop()\n }\n }\n },\n colors: class PrintColors extends Process {\n run () {\n this.emit('write', '\\r\\n')\n let fgtext = 'foreground-color'\n this.emit('write', ' ')\n for (let i = 0; i < 16; i++) {\n this.emit('write', '\\x1b[' + (i < 8 ? `3${i}` : `9${i - 8}`) + 'm')\n this.emit('write', fgtext[i] + ' ')\n }\n this.emit('write', '\\r\\n ')\n for (let i = 0; i < 16; i++) {\n this.emit('write', '\\x1b[' + (i < 8 ? `4${i}` : `10${i - 8}`) + 'm ')\n }\n this.emit('write', '\\x1b[m\\r\\n')\n for (let r = 0; r < 6; r++) {\n this.emit('write', ' ')\n for (let g = 0; g < 6; g++) {\n for (let b = 0; b < 6; b++) {\n this.emit('write', `\\x1b[48;5;${16 + r * 36 + g * 6 + b}m `)\n }\n this.emit('write', '\\x1b[m')\n }\n this.emit('write', '\\r\\n')\n }\n this.emit('write', ' ')\n for (let g = 0; g < 24; g++) {\n this.emit('write', `\\x1b[48;5;${232 + g}m `)\n }\n this.emit('write', '\\x1b[m\\r\\n\\n')\n this.destroy()\n }\n },\n ls: class ListCommands extends Process {\n run () {\n this.emit('write', '\\x1b[92mList of demo commands\\x1b[m\\r\\n')\n for (let i in demoshIndex) {\n if (typeof demoshIndex[i] === 'string') continue\n this.emit('write', i + '\\r\\n')\n }\n this.destroy()\n }\n },\n theme: class SetTheme extends Process {\n constructor (shell) {\n super()\n this.shell = shell\n }\n run (...args) {\n let theme = args[0] | 0\n if (!args.length || !Number.isFinite(theme) || theme < 0 || theme > 5) {\n this.emit('write', '\\x1b[31mUsage: theme [0–5]\\r\\n')\n this.destroy()\n return\n }\n this.shell.terminal.theme = theme\n // HACK: reset drawn screen to prevent only partly redrawn screen\n this.shell.terminal.termScreen.drawnScreenFG = []\n this.emit('write', '')\n this.destroy()\n }\n },\n cursor: class SetCursor extends Process {\n run (...args) {\n let steady = args.includes('--steady')\n if (args.includes('block')) {\n this.emit('write', `\\x1b[${0 + 2 * steady} q`)\n } else if (args.includes('line')) {\n this.emit('write', `\\x1b[${3 + steady} q`)\n } else if (args.includes('bar') || args.includes('beam')) {\n this.emit('write', `\\x1b[${5 + steady} q`)\n } else {\n this.emit('write', '\\x1b[31mUsage: cursor [block|line|bar] [--steady]\\r\\n')\n }\n this.destroy()\n }\n },\n rainbow: class ToggleRainbow extends Process {\n constructor (shell) {\n super()\n this.shell = shell\n }\n run () {\n this.shell.terminal.rainbow = !this.shell.terminal.rainbow\n this.shell.terminal.rainbowTimer()\n this.emit('write', '')\n this.destroy()\n }\n },\n mouse: class ShowMouse extends Process {\n constructor (shell) {\n super()\n this.shell = shell\n }\n run () {\n this.shell.terminal.trackMouse = true\n demoData.mouseReceiver = this\n this.randomData = []\n this.highlighted = {}\n let characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'\n for (let i = 0; i < 23; i++) {\n let line = ''\n for (let j = 0; j < 79; j++) {\n line += characters[Math.floor(characters.length * Math.random())]\n }\n this.randomData.push(line)\n }\n this.scrollOffset = 0\n this.render()\n }\n render () {\n this.emit('write', '\\x1b[m\\x1b[2J\\x1b[1;1H')\n this.emit('write', '\\x1b[97m\\x1b[1mMouse Demo\\r\\n\\x1b[mMouse movement, clicking and scrolling!')\n\n // render random data for scrolling\n for (let y = 0; y < 23; y++) {\n let index = y + this.scrollOffset\n // proper modulo:\n index = ((index % this.randomData.length) + this.randomData.length) % this.randomData.length\n let line = this.randomData[index]\n let lineData = `\\x1b[${3 + y};1H\\x1b[38;5;239m`\n for (let x in line) {\n if (this.highlighted[(y + 2) * 80 + (+x)]) lineData += '\\x1b[97m'\n lineData += line[x]\n if (this.highlighted[(y + 2) * 80 + (+x)]) lineData += '\\x1b[38;5;239m'\n }\n this.emit('write', lineData)\n }\n\n // move cursor to mouse\n if (this.mouse) {\n this.emit('write', `\\x1b[${this.mouse.y + 1};${this.mouse.x + 1}H`)\n }\n }\n mouseMove (x, y) {\n this.mouse = { x, y }\n this.render()\n }\n mouseDown (x, y, button) {\n if (button === 4) this.scrollOffset--\n else if (button === 5) this.scrollOffset++\n else this.highlighted[y * 80 + x] = !this.highlighted[y * 80 + x]\n this.render()\n }\n mouseUp (x, y, button) {}\n destroy () {\n this.shell.terminal.write('\\x1b[2J\\x1b[1;1H')\n this.shell.terminal.trackMouse = false\n if (demoData.mouseReceiver === this) demoData.mouseReceiver = null\n super.destroy()\n }\n },\n sudo: class Sudo extends Process {\n constructor (shell) {\n super()\n this.shell = shell\n }\n run (...args) {\n if (args.length === 0) {\n this.emit('write', '\\x1b[31mUsage: sudo <command>\\x1b[m\\r\\n')\n this.destroy()\n } else if (args.length === 4 && args.join(' ').toLowerCase() === 'make me a sandwich') {\n const b = '\\x1b[33m'\n const r = '\\x1b[0m'\n const l = '\\x1b[32m'\n const c = '\\x1b[38;5;229m'\n const h = '\\x1b[38;5;225m'\n this.emit('write',\n ` ${b}_.---._\\r\\n` +\n ` _.-~ ~-._\\r\\n` +\n ` _.-~ ~-._\\r\\n` +\n ` _.-~ ~---._\\r\\n` +\n ` _.-~ ~\\\\\\r\\n` +\n ` .-~ _.;\\r\\n` +\n ` :-._ _.-~ ./\\r\\n` +\n ` \\`-._~-._ _..__.-~ _.-~\\r\\n` +\n ` ${c}/ ${b}~-._~-._ / .__..--${c}~-${l}---._\\r\\n` +\n `${c} \\\\_____(_${b};-._\\\\. _.-~_/${c} ~)${l}.. . \\\\\\r\\n` +\n `${l} /(_____ ${b}\\\\\\`--...--~_.-~${c}______..-+${l}_______)\\r\\n` +\n `${l} .(_________/${b}\\`--...--~/${l} _/ ${h} ${b}/\\\\\\r\\n` +\n `${b} /-._${h} \\\\_ ${l}(___./_..-~${h}__.....${b}__..-~./\\r\\n` +\n `${b} \\`-._~-._${h} ~\\\\--------~ .-~${b}_..__.-~ _.-~\\r\\n` +\n `${b} ~-._~-._ ${h}~---------\\` ${b}/ .__..--~\\r\\n` +\n `${b} ~-._\\\\. _.-~_/\\r\\n` +\n `${b} \\\\\\`--...--~_.-~\\r\\n` +\n `${b} \\`--...--~${r}\\r\\n`)\n this.destroy()\n } else {\n let name = args.shift()\n if (this.shell.index[name]) {\n let Process = this.shell.index[name]\n if (Process instanceof Function) {\n let child = new Process(this)\n let write = data => this.emit('write', data)\n child.on('write', write)\n child.on('exit', code => {\n child.off('write', write)\n this.destroy()\n })\n child.run(...args)\n } else {\n this.emit('write', Process)\n this.destroy()\n }\n } else {\n this.emit('write', `sudo: ${name}: command not found\\r\\n`)\n this.destroy()\n }\n }\n }\n },\n make: class Make extends Process {\n run (...args) {\n if (args.length === 0) this.emit('write', '\\x1b[31mmake: *** No targets specified. Stop.\\x1b[0m\\r\\n')\n else if (args.length === 3 && args.join(' ').toLowerCase() === 'me a sandwich') {\n this.emit('write', '\\x1b[31mmake: me a sandwich : Permission denied\\x1b[0m\\r\\n')\n } else {\n this.emit('write', `\\x1b[31mmake: *** No rule to make target '${args.join(' ').toLowerCase()}'. Stop.\\x1b[0m\\r\\n`)\n }\n this.destroy()\n }\n },\n pwd: '/this/is/a/demo\\r\\n',\n cd: '\\x1b[38;5;239mNo directories to change to\\r\\n',\n whoami: `${window.navigator.userAgent}\\r\\n`,\n hostname: `${window.location.hostname}`,\n uname: 'ESPTerm Demo\\r\\n',\n mkdir: '\\x1b[38;5;239mDid not create a directory because this is a demo.\\r\\n',\n rm: '\\x1b[38;5;239mDid not delete anything because this is a demo.\\r\\n',\n cp: '\\x1b[38;5;239mNothing to copy because this is a demo.\\r\\n',\n mv: '\\x1b[38;5;239mNothing to move because this is a demo.\\r\\n',\n ln: '\\x1b[38;5;239mNothing to link because this is a demo.\\r\\n',\n touch: '\\x1b[38;5;239mNothing to touch\\r\\n',\n exit: '\\x1b[38;5;239mNowhere to go\\r\\n',\n github: class GoToGithub extends Process {\n run () {\n window.open('https://github.com/espterm/espterm-firmware')\n this.destroy()\n }\n }\n}\n\nclass DemoShell {\n constructor (terminal, printInfo) {\n this.terminal = terminal\n this.terminal.reset()\n this.parser = new ANSIParser((...args) => this.handleParsed(...args))\n this.history = []\n this.historyIndex = 0\n this.cursorPos = 0\n this.child = null\n this.index = demoshIndex\n\n if (printInfo) this.run('info')\n else this.prompt()\n }\n write (text) {\n if (this.child) {\n if (text.codePointAt(0) === 3) this.child.destroy()\n else this.child.write(text)\n } else this.parser.write(text)\n }\n prompt (success = true) {\n if (this.terminal.cursor.x !== 0) this.terminal.write('\\x1b[m\\x1b[38;5;238m⏎\\r\\n')\n this.terminal.write('\\x1b[34;1mdemosh \\x1b[m')\n if (!success) this.terminal.write('\\x1b[31m')\n this.terminal.write('$ \\x1b[m')\n this.history.unshift('')\n this.cursorPos = 0\n }\n copyFromHistoryIndex () {\n if (!this.historyIndex) return\n let current = this.history[this.historyIndex]\n this.history[0] = current\n this.historyIndex = 0\n }\n handleParsed (action, ...args) {\n this.terminal.write('\\b\\x1b[P'.repeat(this.cursorPos))\n if (action === 'write') {\n this.copyFromHistoryIndex()\n this.history[0] = this.history[0].substr(0, this.cursorPos) + args[0] + this.history[0].substr(this.cursorPos)\n this.cursorPos++\n } else if (action === 'back') {\n this.copyFromHistoryIndex()\n this.history[0] = this.history[0].substr(0, this.cursorPos - 1) + this.history[0].substr(this.cursorPos)\n this.cursorPos--\n if (this.cursorPos < 0) this.cursorPos = 0\n } else if (action === 'move-cursor-x') {\n this.cursorPos = Math.max(0, Math.min(this.history[this.historyIndex].length, this.cursorPos + args[0]))\n } else if (action === 'delete-line') {\n this.copyFromHistoryIndex()\n this.history[0] = ''\n this.cursorPos = 0\n } else if (action === 'delete-word') {\n this.copyFromHistoryIndex()\n let words = this.history[0].substr(0, this.cursorPos).split(' ')\n words.pop()\n this.history[0] = words.join(' ') + this.history[0].substr(this.cursorPos)\n this.cursorPos = words.join(' ').length\n } else if (action === 'move-cursor-y') {\n this.historyIndex -= args[0]\n if (this.historyIndex < 0) this.historyIndex = 0\n if (this.historyIndex >= this.history.length) this.historyIndex = this.history.length - 1\n this.cursorPos = this.history[this.historyIndex].length\n }\n\n this.terminal.write(this.history[this.historyIndex])\n this.terminal.write('\\b'.repeat(this.history[this.historyIndex].length))\n this.terminal.moveForward(this.cursorPos)\n this.terminal.write('') // dummy. Apply the moveFoward\n\n if (action === 'return') {\n this.terminal.write('\\r\\n')\n this.parse(this.history[this.historyIndex])\n }\n }\n parse (input) {\n if (input === 'help') input = 'info'\n // TODO: basic chaining (i.e. semicolon)\n this.run(input)\n }\n run (command) {\n let parts = ['']\n\n let inQuote = false\n for (let character of command.trim()) {\n if (inQuote && character !== inQuote) {\n parts[parts.length - 1] += character\n } else if (inQuote) {\n inQuote = false\n } else if (character === '\"' || character === \"'\") {\n inQuote = character\n } else if (character.match(/\\s/)) {\n if (parts[parts.length - 1]) parts.push('')\n } else parts[parts.length - 1] += character\n }\n\n let name = parts.shift()\n\n if (name in this.index) {\n this.spawn(name, parts)\n } else {\n this.terminal.write(`demosh: Unknown command: ${name}\\r\\n`)\n this.prompt(false)\n }\n }\n spawn (name, args = []) {\n let Process = this.index[name]\n if (Process instanceof Function) {\n this.child = new Process(this)\n let write = data => this.terminal.write(data)\n this.child.on('write', write)\n this.child.on('exit', code => {\n if (this.child) this.child.off('write', write)\n this.child = null\n this.prompt(!code)\n })\n this.child.run(...args)\n } else {\n this.terminal.write(Process)\n this.prompt()\n }\n }\n}\n\nwindow.demoInterface = {\n input (data) {\n let type = data[0]\n let content = data.substr(1)\n\n if (type === 's') {\n this.shell.write(content)\n } else if (type === 'b') {\n let button = content.charCodeAt(0)\n let action = demoData.buttons[button]\n if (action) {\n if (typeof action === 'string') this.shell.write(action)\n else if (action instanceof Function) action(this.terminal, this.shell)\n }\n } else if (type === 'm' || type === 'p' || type === 'r') {\n let row = parse2B(content, 0)\n let column = parse2B(content, 2)\n let button = parse2B(content, 4)\n let modifiers = parse2B(content, 6)\n\n if (demoData.mouseReceiver) {\n if (type === 'm') demoData.mouseReceiver.mouseMove(column, row, button, modifiers)\n else if (type === 'p') demoData.mouseReceiver.mouseDown(column, row, button, modifiers)\n else if (type === 'r') demoData.mouseReceiver.mouseUp(column, row, button, modifiers)\n }\n }\n },\n init (screen) {\n this.terminal = new ScrollingTerminal(screen)\n this.shell = new DemoShell(this.terminal, true)\n }\n}\n","// Generated from PHP locale file\nlet _tr = {\n \"wifi.connected_ip_is\": \"Connected, IP is \",\n \"wifi.not_conn\": \"Not connected.\",\n \"wifi.enter_passwd\": \"Enter password for \\\":ssid:\\\"\"\n};\n\nfunction tr (key) { return _tr[key] || '?' + key + '?' }\n","(function (w) {\n const authStr = ['Open', 'WEP', 'WPA', 'WPA2', 'WPA/WPA2']\n let curSSID\n\n // Get XX % for a slider input\n function rangePt (inp) {\n return Math.round(((inp.value / inp.max) * 100)) + '%'\n }\n\n // Display selected STA SSID etc\n function selectSta (name, password, ip) {\n $('#sta_ssid').val(name)\n $('#sta_password').val(password)\n\n $('#sta-nw').toggleClass('hidden', name.length === 0)\n $('#sta-nw-nil').toggleClass('hidden', name.length > 0)\n\n $('#sta-nw .essid').html(esc(name))\n const nopw = undef(password) || password.length === 0\n $('#sta-nw .passwd').toggleClass('hidden', nopw)\n $('#sta-nw .nopasswd').toggleClass('hidden', !nopw)\n $('#sta-nw .ip').html(ip.length > 0 ? tr('wifi.connected_ip_is') + ip : tr('wifi.not_conn'))\n }\n\n /** Update display for received response */\n function onScan (resp, status) {\n // var ap_json = {\n // \"result\": {\n // \"inProgress\": \"0\",\n // \"APs\": [\n // {\"essid\": \"Chlivek\", \"bssid\": \"88:f7:c7:52:b3:99\", \"rssi\": \"204\", \"enc\": \"4\", \"channel\": \"1\"},\n // {\"essid\": \"TyNikdy\", \"bssid\": \"5c:f4:ab:0d:f1:1b\", \"rssi\": \"164\", \"enc\": \"3\", \"channel\": \"1\"},\n // ]\n // }\n // };\n\n if (status !== 200) {\n // bad response\n rescan(5000) // wait 5sm then retry\n return\n }\n\n try {\n resp = JSON.parse(resp)\n } catch (e) {\n console.log(e)\n rescan(5000)\n return\n }\n\n const done = !bool(resp.result.inProgress) && (resp.result.APs.length > 0)\n rescan(done ? 15000 : 1000)\n if (!done) return // no redraw yet\n\n // clear the AP list\n let $list = $('#ap-list')\n // remove old APs\n $('#ap-list .AP').remove()\n\n $list.toggleClass('hidden', !done)\n $('#ap-loader').toggleClass('hidden', done)\n\n // scan done\n resp.result.APs.sort(function (a, b) {\n return b.rssi - a.rssi\n }).forEach(function (ap) {\n ap.enc = parseInt(ap.enc)\n\n if (ap.enc > 4) return // hide unsupported auths\n\n let item = mk('div')\n\n let $item = $(item)\n .data('ssid', ap.essid)\n .data('pwd', ap.enc)\n .attr('tabindex', 0)\n .addClass('AP')\n\n // mark current SSID\n if (ap.essid === curSSID) {\n $item.addClass('selected')\n }\n\n let inner = mk('div')\n let escapedSSID = $.htmlEscape(ap.essid)\n $(inner).addClass('inner')\n .htmlAppend(`<div class=\"rssi\">${ap.rssi_perc}</div>`)\n .htmlAppend(`<div class=\"essid\" title=\"${escapedSSID}\">${escapedSSID}</div>`)\n .htmlAppend(`<div class=\"auth\">${authStr[ap.enc]}</div>`)\n\n $item.on('click', function () {\n let $th = $(this)\n\n const conn_ssid = $th.data('ssid')\n let conn_pass = ''\n\n if (+$th.data('pwd')) {\n // this AP needs a password\n conn_pass = prompt(tr('wifi.enter_passwd').replace(':ssid:', conn_ssid))\n if (!conn_pass) return\n }\n\n $('#sta_password').val(conn_pass)\n $('#sta_ssid').val(conn_ssid)\n selectSta(conn_ssid, conn_pass, '')\n })\n\n item.appendChild(inner)\n $list[0].appendChild(item)\n })\n }\n\n function startScanning () {\n $('#ap-loader').removeClass('hidden')\n $('#ap-scan').addClass('hidden')\n $('#ap-loader .anim-dots').html('.')\n\n scanAPs()\n }\n\n /** Ask the CGI what APs are visible (async) */\n function scanAPs () {\n if (_demo) {\n onScan(_demo_aps, 200)\n } else {\n $.get('http://' + _root + '/cfg/wifi/scan', onScan)\n }\n }\n\n function rescan (time) {\n setTimeout(scanAPs, time)\n }\n\n /** Set up the WiFi page */\n function wifiInit (cfg) {\n // Update slider value displays\n $('.Row.range').forEach(function (x) {\n let inp = x.querySelector('input')\n let disp1 = x.querySelector('.x-disp1')\n let disp2 = x.querySelector('.x-disp2')\n let t = rangePt(inp)\n $(disp1).html(t)\n $(disp2).html(t)\n $(inp).on('input', function () {\n t = rangePt(inp)\n $(disp1).html(t)\n $(disp2).html(t)\n })\n })\n\n // Forget STA credentials\n $('#forget-sta').on('click', () => {\n selectSta('', '', '')\n return false\n })\n\n selectSta(cfg.sta_ssid, cfg.sta_password, cfg.sta_active_ip)\n curSSID = cfg.sta_active_ssid\n }\n\n w.init = wifiInit\n w.startScanning = startScanning\n})(window.WiFi = {})\n","/** Handle connections */\nwindow.Conn = function (screen) {\n let ws\n let heartbeatTout\n let pingIv\n let xoff = false\n let autoXoffTout\n let reconTout\n\n let pageShown = false\n\n function onOpen (evt) {\n console.log('CONNECTED')\n heartbeat()\n doSend('i')\n }\n\n function onClose (evt) {\n console.warn('SOCKET CLOSED, code ' + evt.code + '. Reconnecting...')\n clearTimeout(reconTout)\n reconTout = setTimeout(function () {\n init()\n }, 2000)\n // this happens when the buffer gets fucked up via invalid unicode.\n // we basically use polling instead of socket then\n }\n\n function onMessage (evt) {\n try {\n // . = heartbeat\n switch (evt.data.charAt(0)) {\n case '.':\n // heartbeat, no-op message\n break\n\n case '-':\n // console.log('xoff');\n xoff = true\n autoXoffTout = setTimeout(function () {\n xoff = false\n }, 250)\n break\n\n case '+':\n // console.log('xon');\n xoff = false\n clearTimeout(autoXoffTout)\n break\n\n default:\n screen.load(evt.data)\n if (!pageShown) {\n showPage()\n pageShown = true\n }\n break\n }\n heartbeat()\n } catch (e) {\n console.error(e)\n }\n }\n\n function canSend () {\n return !xoff\n }\n\n function doSend (message) {\n if (_demo) {\n if (typeof demoInterface !== 'undefined') {\n demoInterface.input(message)\n } else {\n console.log(`TX: ${JSON.stringify(message)}`)\n }\n return true // Simulate success\n }\n if (xoff) {\n // TODO queue\n console.log(\"Can't send, flood control.\")\n return false\n }\n\n if (!ws) return false // for dry testing\n if (ws.readyState !== 1) {\n console.error('Socket not ready')\n return false\n }\n if (typeof message != 'string') {\n message = JSON.stringify(message)\n }\n ws.send(message)\n return true\n }\n\n function init () {\n if (window._demo) {\n if (typeof demoInterface === 'undefined') {\n alert('Demoing non-demo demo!') // this will catch mistakes when deploying to the website\n } else {\n demoInterface.init(screen)\n showPage()\n }\n return\n }\n\n clearTimeout(reconTout)\n clearTimeout(heartbeatTout)\n\n ws = new WebSocket('ws://' + _root + '/term/update.ws')\n ws.onopen = onOpen\n ws.onclose = onClose\n ws.onmessage = onMessage\n console.log('Opening socket.')\n heartbeat()\n }\n\n function heartbeat () {\n clearTimeout(heartbeatTout)\n heartbeatTout = setTimeout(heartbeatFail, 2000)\n }\n\n function heartbeatFail () {\n console.error('Heartbeat lost, probing server...')\n pingIv = setInterval(function () {\n console.log('> ping')\n $.get('http://' + _root + '/system/ping', function (resp, status) {\n if (status === 200) {\n clearInterval(pingIv)\n console.info('Server ready, reloading page...')\n location.reload()\n }\n }, {\n timeout: 100\n })\n }, 1000)\n }\n\n return {\n ws: null,\n init,\n send: doSend,\n canSend // check flood control\n }\n}\n","/**\n * User input\n *\n * --- Rx messages: ---\n * S - screen content (binary encoding of the entire screen with simple compression)\n * T - text labels - Title and buttons, \\0x01-separated\n * B - beep\n * . - heartbeat\n *\n * --- Tx messages ---\n * s - string\n * b - action button\n * p - mb press\n * r - mb release\n * m - mouse move\n */\nwindow.Input = function (conn) {\n let cfg = {\n np_alt: false,\n cu_alt: false,\n fn_alt: false,\n mt_click: false,\n mt_move: false,\n no_keys: false,\n crlf_mode: false\n }\n\n /** Send a literal message */\n function sendStrMsg (str) {\n return conn.send('s' + str)\n }\n\n /** Send a button event */\n function sendBtnMsg (n) {\n conn.send('b' + String.fromCharCode(n))\n }\n\n /** Fn alt choice for key message */\n function fa (alt, normal) {\n return cfg.fn_alt ? alt : normal\n }\n\n /** Cursor alt choice for key message */\n function ca (alt, normal) {\n return cfg.cu_alt ? alt : normal\n }\n\n /** Numpad alt choice for key message */\n function na (alt, normal) {\n return cfg.np_alt ? alt : normal\n }\n\n function bindFnKeys (allFn) {\n const keymap = {\n 'tab': '\\x09',\n 'backspace': '\\x08',\n 'enter': cfg.crlf_mode ? '\\x0d\\x0a' : '\\x0d',\n 'ctrl+enter': '\\x0a',\n 'esc': '\\x1b',\n 'up': ca('\\x1bOA', '\\x1b[A'),\n 'down': ca('\\x1bOB', '\\x1b[B'),\n 'right': ca('\\x1bOC', '\\x1b[C'),\n 'left': ca('\\x1bOD', '\\x1b[D'),\n 'home': ca('\\x1bOH', fa('\\x1b[H', '\\x1b[1~')),\n 'insert': '\\x1b[2~',\n 'delete': '\\x1b[3~',\n 'end': ca('\\x1bOF', fa('\\x1b[F', '\\x1b[4~')),\n 'pageup': '\\x1b[5~',\n 'pagedown': '\\x1b[6~',\n 'f1': fa('\\x1bOP', '\\x1b[11~'),\n 'f2': fa('\\x1bOQ', '\\x1b[12~'),\n 'f3': fa('\\x1bOR', '\\x1b[13~'),\n 'f4': fa('\\x1bOS', '\\x1b[14~'),\n 'f5': '\\x1b[15~', // note the disconnect\n 'f6': '\\x1b[17~',\n 'f7': '\\x1b[18~',\n 'f8': '\\x1b[19~',\n 'f9': '\\x1b[20~',\n 'f10': '\\x1b[21~', // note the disconnect\n 'f11': '\\x1b[23~',\n 'f12': '\\x1b[24~',\n 'shift+f1': fa('\\x1bO1;2P', '\\x1b[25~'),\n 'shift+f2': fa('\\x1bO1;2Q', '\\x1b[26~'), // note the disconnect\n 'shift+f3': fa('\\x1bO1;2R', '\\x1b[28~'),\n 'shift+f4': fa('\\x1bO1;2S', '\\x1b[29~'), // note the disconnect\n 'shift+f5': fa('\\x1b[15;2~', '\\x1b[31~'),\n 'shift+f6': fa('\\x1b[17;2~', '\\x1b[32~'),\n 'shift+f7': fa('\\x1b[18;2~', '\\x1b[33~'),\n 'shift+f8': fa('\\x1b[19;2~', '\\x1b[34~'),\n 'shift+f9': fa('\\x1b[20;2~', '\\x1b[35~'), // 35-38 are not standard - but what is?\n 'shift+f10': fa('\\x1b[21;2~', '\\x1b[36~'),\n 'shift+f11': fa('\\x1b[22;2~', '\\x1b[37~'),\n 'shift+f12': fa('\\x1b[23;2~', '\\x1b[38~'),\n 'np_0': na('\\x1bOp', '0'),\n 'np_1': na('\\x1bOq', '1'),\n 'np_2': na('\\x1bOr', '2'),\n 'np_3': na('\\x1bOs', '3'),\n 'np_4': na('\\x1bOt', '4'),\n 'np_5': na('\\x1bOu', '5'),\n 'np_6': na('\\x1bOv', '6'),\n 'np_7': na('\\x1bOw', '7'),\n 'np_8': na('\\x1bOx', '8'),\n 'np_9': na('\\x1bOy', '9'),\n 'np_mul': na('\\x1bOR', '*'),\n 'np_add': na('\\x1bOl', '+'),\n 'np_sub': na('\\x1bOS', '-'),\n 'np_point': na('\\x1bOn', '.'),\n 'np_div': na('\\x1bOQ', '/')\n // we don't implement numlock key (should change in numpad_alt mode,\n // but it's even more useless than the rest and also has the side\n // effect of changing the user's numlock state)\n }\n\n const blacklist = [\n 'f5', 'f11', 'f12', 'shift+f5'\n ]\n\n for (let k in keymap) {\n if (!allFn && blacklist.includes(k)) continue\n if (keymap.hasOwnProperty(k)) {\n bind(k, keymap[k])\n }\n }\n }\n\n /** Bind a keystroke to message */\n function bind (combo, str) {\n // mac fix - allow also cmd\n if (combo.indexOf('ctrl+') !== -1) {\n combo += ',' + combo.replace('ctrl', 'command')\n }\n\n // unbind possible old binding\n key.unbind(combo)\n\n key(combo, function (e) {\n if (cfg.no_keys) return\n e.preventDefault()\n sendStrMsg(str)\n })\n }\n\n /** Bind/rebind key messages */\n function initKeys ({ allFn }) {\n // This takes care of text characters typed\n window.addEventListener('keypress', function (evt) {\n if (cfg.no_keys) return\n let str = ''\n if (evt.key) str = evt.key\n else if (evt.which) str = String.fromCodePoint(evt.which)\n if (str.length > 0 && str.charCodeAt(0) >= 32) {\n // console.log(\"Typed \", str);\n // prevent space from scrolling\n if (evt.which === 32) evt.preventDefault()\n sendStrMsg(str)\n }\n })\n\n // ctrl-letter codes are sent as simple low ASCII codes\n for (let i = 1; i <= 26; i++) {\n bind('ctrl+' + String.fromCharCode(96 + i), String.fromCharCode(i))\n }\n /* eslint-disable */\n bind('ctrl+]', '\\x1b') // alternate way to enter ESC\n bind('ctrl+\\\\', '\\x1c')\n bind('ctrl+[', '\\x1d')\n bind('ctrl+^', '\\x1e')\n bind('ctrl+_', '\\x1f')\n\n // extra ctrl-\n bind('ctrl+left', '\\x1f[1;5D')\n bind('ctrl+right', '\\x1f[1;5C')\n bind('ctrl+up', '\\x1f[1;5A')\n bind('ctrl+down', '\\x1f[1;5B')\n bind('ctrl+home', '\\x1f[1;5H')\n bind('ctrl+end', '\\x1f[1;5F')\n\n // extra shift-\n bind('shift+left', '\\x1f[1;2D')\n bind('shift+right', '\\x1f[1;2C')\n bind('shift+up', '\\x1f[1;2A')\n bind('shift+down', '\\x1f[1;2B')\n bind('shift+home', '\\x1f[1;2H')\n bind('shift+end', '\\x1f[1;2F')\n\n // macOS editing commands\n bind('⌥+left', '\\x1bb') // ⌥← to go back a word (^[b)\n bind('⌥+right', '\\x1bf') // ⌥→ to go forward one word (^[f)\n bind('⌘+left', '\\x01') // ⌘← to go to the beginning of a line (^A)\n bind('⌘+right', '\\x05') // ⌘→ to go to the end of a line (^E)\n bind('⌥+backspace', '\\x17') // ⌥⌫ to delete a word (^W)\n bind('⌘+backspace', '\\x15') // ⌘⌫ to delete to the beginning of a line (^U)\n /* eslint-enable */\n\n bindFnKeys(allFn)\n }\n\n // mouse button states\n let mb1 = 0\n let mb2 = 0\n let mb3 = 0\n\n /** Init the Input module */\n function init (opts) {\n initKeys(opts)\n\n // Button presses\n $('#action-buttons button').forEach(s => {\n s.addEventListener('click', function (evt) {\n sendBtnMsg(+this.dataset['n'])\n })\n })\n\n // global mouse state tracking - for motion reporting\n window.addEventListener('mousedown', evt => {\n if (evt.button === 0) mb1 = 1\n if (evt.button === 1) mb2 = 1\n if (evt.button === 2) mb3 = 1\n })\n\n window.addEventListener('mouseup', evt => {\n if (evt.button === 0) mb1 = 0\n if (evt.button === 1) mb2 = 0\n if (evt.button === 2) mb3 = 0\n })\n }\n\n /** Prepare modifiers byte for mouse message */\n function packModifiersForMouse () {\n return (key.isModifier('ctrl') ? 1 : 0) |\n (key.isModifier('shift') ? 2 : 0) |\n (key.isModifier('alt') ? 4 : 0) |\n (key.isModifier('meta') ? 8 : 0)\n }\n\n return {\n /** Init the Input module */\n init,\n\n /** Send a literal string message */\n sendString: sendStrMsg,\n\n /** Enable alternate key modes (cursors, numpad, fn) */\n setAlts: function (cu, np, fn, crlf) {\n if (cfg.cu_alt !== cu || cfg.np_alt !== np || cfg.fn_alt !== fn || cfg.crlf_mode !== crlf) {\n cfg.cu_alt = cu\n cfg.np_alt = np\n cfg.fn_alt = fn\n cfg.crlf_mode = crlf\n\n // rebind keys - codes have changed\n bindFnKeys()\n }\n },\n\n setMouseMode (click, move) {\n cfg.mt_click = click\n cfg.mt_move = move\n },\n\n // Mouse events\n onMouseMove (x, y) {\n if (!cfg.mt_move) return\n const b = mb1 ? 1 : mb2 ? 2 : mb3 ? 3 : 0\n const m = packModifiersForMouse()\n conn.send('m' + encode2B(y) + encode2B(x) + encode2B(b) + encode2B(m))\n },\n\n onMouseDown (x, y, b) {\n if (!cfg.mt_click) return\n if (b > 3 || b < 1) return\n const m = packModifiersForMouse()\n conn.send('p' + encode2B(y) + encode2B(x) + encode2B(b) + encode2B(m))\n // console.log(\"B \",b,\" M \",m);\n },\n\n onMouseUp (x, y, b) {\n if (!cfg.mt_click) return\n if (b > 3 || b < 1) return\n const m = packModifiersForMouse()\n conn.send('r' + encode2B(y) + encode2B(x) + encode2B(b) + encode2B(m))\n // console.log(\"B \",b,\" M \",m);\n },\n\n onMouseWheel (x, y, dir) {\n if (!cfg.mt_click) return\n // -1 ... btn 4 (away from user)\n // +1 ... btn 5 (towards user)\n const m = packModifiersForMouse()\n const b = (dir < 0 ? 4 : 5)\n conn.send('p' + encode2B(y) + encode2B(x) + encode2B(b) + encode2B(m))\n // console.log(\"B \",b,\" M \",m);\n },\n\n /**\n * Prevent capturing keys. This is used for text input\n * modals on the terminal screen\n */\n blockKeys (yes) {\n cfg.no_keys = yes\n }\n }\n}\n","// Some non-bold Fraktur symbols are outside the contiguous block\nconst frakturExceptions = {\n 'C': '\\u212d',\n 'H': '\\u210c',\n 'I': '\\u2111',\n 'R': '\\u211c',\n 'Z': '\\u2128'\n}\n\n// constants for decoding the update blob\nconst SEQ_REPEAT = 2\nconst SEQ_SET_COLORS = 3\nconst SEQ_SET_ATTRS = 4\nconst SEQ_SET_FG = 5\nconst SEQ_SET_BG = 6\n\nconst SELECTION_BG = '#b2d7fe'\nconst SELECTION_FG = '#333'\n\nconst themes = [\n [ // Tango\n '#111213', '#CC0000', '#4E9A06', '#C4A000', '#3465A4', '#75507B', '#06989A', '#D3D7CF',\n '#555753', '#EF2929', '#8AE234', '#FCE94F', '#729FCF', '#AD7FA8', '#34E2E2', '#EEEEEC'\n ],\n [ // Linux\n '#000000', '#aa0000', '#00aa00', '#aa5500', '#0000aa', '#aa00aa', '#00aaaa', '#aaaaaa',\n '#555555', '#ff5555', '#55ff55', '#ffff55', '#5555ff', '#ff55ff', '#55ffff', '#ffffff'\n ],\n [ // xterm\n '#000000', '#cd0000', '#00cd00', '#cdcd00', '#0000ee', '#cd00cd', '#00cdcd', '#e5e5e5',\n '#7f7f7f', '#ff0000', '#00ff00', '#ffff00', '#5c5cff', '#ff00ff', '#00ffff', '#ffffff'\n ],\n [ // rxvt\n '#000000', '#cd0000', '#00cd00', '#cdcd00', '#0000cd', '#cd00cd', '#00cdcd', '#faebd7',\n '#404040', '#ff0000', '#00ff00', '#ffff00', '#0000ff', '#ff00ff', '#00ffff', '#ffffff'\n ],\n [ // Ambience\n '#2e3436', '#cc0000', '#4e9a06', '#c4a000', '#3465a4', '#75507b', '#06989a', '#d3d7cf',\n '#555753', '#ef2929', '#8ae234', '#fce94f', '#729fcf', '#ad7fa8', '#34e2e2', '#eeeeec'\n ],\n [ // Solarized\n '#073642', '#dc322f', '#859900', '#b58900', '#268bd2', '#d33682', '#2aa198', '#eee8d5',\n '#002b36', '#cb4b16', '#586e75', '#657b83', '#839496', '#6c71c4', '#93a1a1', '#fdf6e3'\n ]\n]\n\n// TODO move this to the initializer so it's not run on non-terminal pages\n\n// 256color lookup table\n// should not be used to look up 0-15 (will return transparent)\nconst colorTable256 = new Array(16).fill('rgba(0, 0, 0, 0)')\n\n// fill color table\n// colors 16-231 are a 6x6x6 color cube\nfor (let red = 0; red < 6; red++) {\n for (let green = 0; green < 6; green++) {\n for (let blue = 0; blue < 6; blue++) {\n let redValue = red * 40 + (red ? 55 : 0)\n let greenValue = green * 40 + (green ? 55 : 0)\n let blueValue = blue * 40 + (blue ? 55 : 0)\n colorTable256.push(`rgb(${redValue}, ${greenValue}, ${blueValue})`)\n }\n }\n}\n// colors 232-255 are a grayscale ramp, sans black and white\nfor (let gray = 0; gray < 24; gray++) {\n let value = gray * 10 + 8\n colorTable256.push(`rgb(${value}, ${value}, ${value})`)\n}\n\nwindow.TermScreen = class TermScreen {\n constructor () {\n this.canvas = mk('canvas')\n this.ctx = this.canvas.getContext('2d')\n\n if ('AudioContext' in window || 'webkitAudioContext' in window) {\n this.audioCtx = new (window.AudioContext || window.webkitAudioContext)()\n } else {\n console.warn('No AudioContext!')\n }\n\n // dummy\n this.input = new Proxy({}, {\n get () {\n return () => console.warn('TermScreen#input not set!')\n }\n })\n\n this.cursor = {\n x: 0,\n y: 0,\n blinkOn: false,\n blinking: true,\n visible: true,\n hanging: false,\n style: 'block',\n blinkInterval: null\n }\n\n this._palette = null\n\n this._window = {\n width: 0,\n height: 0,\n devicePixelRatio: 1,\n fontFamily: '\"DejaVu Sans Mono\", \"Liberation Mono\", \"Inconsolata\", \"Menlo\", monospace',\n fontSize: 20,\n gridScaleX: 1.0,\n gridScaleY: 1.2,\n blinkStyleOn: true,\n blinkInterval: null,\n fitIntoWidth: 0,\n fitIntoHeight: 0,\n debug: false,\n graphics: 0\n }\n\n // scaling caused by fitIntoWidth/fitIntoHeight\n this._windowScale = 1\n\n // properties of this.window that require updating size and redrawing\n this.windowState = {\n width: 0,\n height: 0,\n devicePixelRatio: 0,\n gridScaleX: 0,\n gridScaleY: 0,\n fontFamily: '',\n fontSize: 0,\n fitIntoWidth: 0,\n fitIntoHeight: 0\n }\n\n // current selection\n this.selection = {\n // when false, this will prevent selection in favor of mouse events,\n // though alt can be held to override it\n selectable: true,\n\n // selection start and end (x, y) tuples\n start: [0, 0],\n end: [0, 0]\n }\n\n // mouse features\n this.mouseMode = { clicks: false, movement: false }\n\n // event listeners\n this._listeners = {}\n\n // make writing to window update size and draw\n const self = this\n this.window = new Proxy(this._window, {\n set (target, key, value, receiver) {\n target[key] = value\n self.scheduleSizeUpdate()\n self.scheduleDraw(`window:${key}=${value}`)\n return true\n }\n })\n\n this.bracketedPaste = false\n this.blinkingCellCount = 0\n\n this.screen = []\n this.screenFG = []\n this.screenBG = []\n this.screenAttrs = []\n\n // used to determine if a cell should be redrawn; storing the current state\n // as it is on screen\n this.drawnScreen = []\n this.drawnScreenFG = []\n this.drawnScreenBG = []\n this.drawnScreenAttrs = []\n this.drawnCursor = [-1, -1, '']\n\n // start blink timers\n this.resetBlink()\n this.resetCursorBlink()\n\n let selecting = false\n\n let selectStart = (x, y) => {\n if (selecting) return\n selecting = true\n this.selection.start = this.selection.end = this.screenToGrid(x, y, true)\n this.scheduleDraw('select-start')\n }\n\n let selectMove = (x, y) => {\n if (!selecting) return\n this.selection.end = this.screenToGrid(x, y, true)\n this.scheduleDraw('select-move')\n }\n\n let selectEnd = (x, y) => {\n if (!selecting) return\n selecting = false\n this.selection.end = this.screenToGrid(x, y, true)\n this.scheduleDraw('select-end')\n Object.assign(this.selection, this.getNormalizedSelection())\n }\n\n // bind event listeners\n\n this.canvas.addEventListener('mousedown', e => {\n if ((this.selection.selectable || e.altKey) && e.button === 0) {\n selectStart(e.offsetX, e.offsetY)\n } else {\n this.input.onMouseDown(...this.screenToGrid(e.offsetX, e.offsetY),\n e.button + 1)\n }\n })\n\n window.addEventListener('mousemove', e => {\n selectMove(e.offsetX, e.offsetY)\n })\n\n window.addEventListener('mouseup', e => {\n selectEnd(e.offsetX, e.offsetY)\n })\n\n // touch event listeners\n\n let touchPosition = null\n let touchDownTime = 0\n let touchSelectMinTime = 500\n let touchDidMove = false\n\n let getTouchPositionOffset = touch => {\n let rect = this.canvas.getBoundingClientRect()\n return [touch.clientX - rect.left, touch.clientY - rect.top]\n }\n\n this.canvas.addEventListener('touchstart', e => {\n touchPosition = getTouchPositionOffset(e.touches[0])\n touchDidMove = false\n touchDownTime = Date.now()\n })\n\n this.canvas.addEventListener('touchmove', e => {\n touchPosition = getTouchPositionOffset(e.touches[0])\n\n if (!selecting && touchDidMove === false) {\n if (touchDownTime < Date.now() - touchSelectMinTime) {\n selectStart(...touchPosition)\n }\n } else if (selecting) {\n e.preventDefault()\n selectMove(...touchPosition)\n }\n\n touchDidMove = true\n })\n\n this.canvas.addEventListener('touchend', e => {\n if (e.touches[0]) {\n touchPosition = getTouchPositionOffset(e.touches[0])\n }\n\n if (selecting) {\n e.preventDefault()\n selectEnd(...touchPosition)\n\n // selection ended; show touch select menu\n let touchSelectMenu = qs('#touch-select-menu')\n touchSelectMenu.classList.add('open')\n let rect = touchSelectMenu.getBoundingClientRect()\n\n // use middle position for x and one line above for y\n let selectionPos = this.gridToScreen(\n (this.selection.start[0] + this.selection.end[0]) / 2,\n this.selection.start[1] - 1\n )\n selectionPos[0] -= rect.width / 2\n selectionPos[1] -= rect.height / 2\n touchSelectMenu.style.transform = `translate(${selectionPos[0]}px, ${\n selectionPos[1]}px)`\n }\n\n if (!touchDidMove) {\n this.emit('tap', Object.assign(e, {\n x: touchPosition[0],\n y: touchPosition[1]\n }))\n }\n\n touchPosition = null\n })\n\n this.on('tap', e => {\n if (this.selection.start[0] !== this.selection.end[0] ||\n this.selection.start[1] !== this.selection.end[1]) {\n // selection is not empty\n // reset selection\n this.selection.start = this.selection.end = [0, 0]\n qs('#touch-select-menu').classList.remove('open')\n this.scheduleDraw('select-reset')\n } else {\n e.preventDefault()\n this.emit('open-soft-keyboard')\n }\n })\n\n $.ready(() => {\n let copyButton = qs('#touch-select-copy-btn')\n if (copyButton) {\n copyButton.addEventListener('click', () => {\n this.copySelectionToClipboard()\n })\n }\n })\n\n this.canvas.addEventListener('mousemove', e => {\n if (!selecting) {\n this.input.onMouseMove(...this.screenToGrid(e.offsetX, e.offsetY))\n }\n })\n\n this.canvas.addEventListener('mouseup', e => {\n if (!selecting) {\n this.input.onMouseUp(...this.screenToGrid(e.offsetX, e.offsetY),\n e.button + 1)\n }\n })\n\n this.canvas.addEventListener('wheel', e => {\n if (this.mouseMode.clicks) {\n this.input.onMouseWheel(...this.screenToGrid(e.offsetX, e.offsetY),\n e.deltaY > 0 ? 1 : -1)\n\n // prevent page scrolling\n e.preventDefault()\n }\n })\n\n this.canvas.addEventListener('contextmenu', e => {\n if (this.mouseMode.clicks) {\n // prevent mouse keys getting stuck\n e.preventDefault()\n }\n selectEnd(e.offsetX, e.offsetY)\n })\n\n // bind ctrl+shift+c to copy\n key('⌃+⇧+c', e => {\n e.preventDefault()\n this.copySelectionToClipboard()\n })\n }\n\n /**\n * Bind an event listener to an event\n * @param {string} event - the event name\n * @param {Function} listener - the event listener\n */\n on (event, listener) {\n if (!this._listeners[event]) this._listeners[event] = []\n this._listeners[event].push({ listener })\n }\n\n /**\n * Bind an event listener to be run only once the next time the event fires\n * @param {string} event - the event name\n * @param {Function} listener - the event listener\n */\n once (event, listener) {\n if (!this._listeners[event]) this._listeners[event] = []\n this._listeners[event].push({ listener, once: true })\n }\n\n /**\n * Remove an event listener\n * @param {string} event - the event name\n * @param {Function} listener - the event listener\n */\n off (event, listener) {\n let listeners = this._listeners[event]\n if (listeners) {\n for (let i in listeners) {\n if (listeners[i].listener === listener) {\n listeners.splice(i, 1)\n break\n }\n }\n }\n }\n\n /**\n * Emits an event\n * @param {string} event - the event name\n * @param {...any} args - arguments passed to all listeners\n */\n emit (event, ...args) {\n let listeners = this._listeners[event]\n if (listeners) {\n let remove = []\n for (let listener of listeners) {\n try {\n listener.listener(...args)\n if (listener.once) remove.push(listener)\n } catch (err) {\n console.error(err)\n }\n }\n\n // this needs to be done in this roundabout way because for loops\n // do not like arrays with changing lengths\n for (let listener of remove) {\n listeners.splice(listeners.indexOf(listener), 1)\n }\n }\n }\n\n /**\n * The color palette. Should define 16 colors in an array.\n * @type {number[]}\n */\n get palette () {\n return this._palette || themes[0]\n }\n /** @type {number[]} */\n set palette (palette) {\n if (this._palette !== palette) {\n this._palette = palette\n this.scheduleDraw('palette')\n }\n }\n\n /**\n * Returns the specified color. If `i` is in the palette, it will return the\n * palette color. If `i` is between 16 and 255, it will return the 256color\n * value. If `i` is larger than 255, it will return an RGB color value. If `i`\n * is -1 (foreground) or -2 (background), it will return the selection colors.\n * @param {number} i - the color\n * @returns {string} the CSS color\n */\n getColor (i) {\n // return palette color if it exists\n if (this.palette[i]) return this.palette[i]\n\n // -1 for selection foreground, -2 for selection background\n if (i === -1) return SELECTION_FG\n if (i === -2) return SELECTION_BG\n\n // 256 color\n if (i > 15 && i < 256) return colorTable256[i]\n\n // true color, encoded as (hex) + 256 (such that #000 == 256)\n if (i > 255) {\n i -= 256\n let red = (i >> 16) & 0xFF\n let green = (i >> 8) & 0xFF\n let blue = i & 0xFF\n return `rgb(${red}, ${green}, ${blue})`\n }\n\n // default to transparent\n return 'rgba(0, 0, 0, 0)'\n }\n\n /**\n * Schedule a size update in the next millisecond\n */\n scheduleSizeUpdate () {\n clearTimeout(this._scheduledSizeUpdate)\n this._scheduledSizeUpdate = setTimeout(() => this.updateSize(), 1)\n }\n\n /**\n * Schedule a draw in the next millisecond\n * @param {string} why - the reason why the draw occured (for debugging)\n * @param {number} [aggregateTime] - time to wait for more scheduleDraw calls\n * to occur. 1 ms by default.\n */\n scheduleDraw (why, aggregateTime = 1) {\n clearTimeout(this._scheduledDraw)\n this._scheduledDraw = setTimeout(() => this.draw(why), aggregateTime)\n }\n\n /**\n * Returns a CSS font string with this TermScreen's font settings and the\n * font modifiers.\n * @param {Object} modifiers\n * @param {string} [modifiers.style] - the font style\n * @param {string} [modifiers.weight] - the font weight\n * @returns {string} a CSS font string\n */\n getFont (modifiers = {}) {\n let fontStyle = modifiers.style || 'normal'\n let fontWeight = modifiers.weight || 'normal'\n return `${fontStyle} normal ${fontWeight} ${this.window.fontSize}px ${this.window.fontFamily}`\n }\n\n /**\n * The character size, used for calculating the cell size. The space character\n * is used for measuring.\n * @returns {Object} the character size with `width` and `height` in pixels\n */\n getCharSize () {\n this.ctx.font = this.getFont()\n\n return {\n width: Math.floor(this.ctx.measureText(' ').width),\n height: this.window.fontSize\n }\n }\n\n /**\n * The cell size, which is the character size multiplied by the grid scale.\n * @returns {Object} the cell size with `width` and `height` in pixels\n */\n getCellSize () {\n let charSize = this.getCharSize()\n\n return {\n width: Math.ceil(charSize.width * this.window.gridScaleX),\n height: Math.ceil(charSize.height * this.window.gridScaleY)\n }\n }\n\n /**\n * Updates the canvas size if it changed\n */\n updateSize () {\n // see below (this is just updating it)\n this._window.devicePixelRatio = Math.round(this._windowScale * (window.devicePixelRatio || 1) * 2) / 2\n\n let didChange = false\n for (let key in this.windowState) {\n if (this.windowState.hasOwnProperty(key) && this.windowState[key] !== this.window[key]) {\n didChange = true\n this.windowState[key] = this.window[key]\n }\n }\n\n if (didChange) {\n const {\n width,\n height,\n gridScaleX,\n gridScaleY,\n fitIntoWidth,\n fitIntoHeight\n } = this.window\n const cellSize = this.getCellSize()\n\n // real height of the canvas element in pixels\n let realWidth = width * cellSize.width\n let realHeight = height * cellSize.height\n\n if (fitIntoWidth && fitIntoHeight) {\n let terminalAspect = realWidth / realHeight\n let fitAspect = fitIntoWidth / fitIntoHeight\n\n if (terminalAspect < fitAspect) {\n // align heights\n realHeight = fitIntoHeight\n realWidth = realHeight * terminalAspect\n } else {\n // align widths\n realWidth = fitIntoWidth\n realHeight = realWidth / terminalAspect\n }\n } else if (fitIntoWidth) {\n realHeight = fitIntoWidth / (realWidth / realHeight)\n realWidth = fitIntoWidth\n } else if (fitIntoHeight) {\n realWidth = fitIntoHeight * (realWidth / realHeight)\n realHeight = fitIntoHeight\n }\n\n // store new window scale\n this._windowScale = realWidth / (width * cellSize.width)\n\n // the DPR must be rounded to a very nice value to prevent gaps between cells\n let devicePixelRatio = this._window.devicePixelRatio = Math.round(this._windowScale * (window.devicePixelRatio || 1) * 2) / 2\n\n this.canvas.width = width * devicePixelRatio * cellSize.width\n this.canvas.style.width = `${realWidth}px`\n this.canvas.height = height * devicePixelRatio * cellSize.height\n this.canvas.style.height = `${realHeight}px`\n\n // the screen has been cleared (by changing canvas width)\n this.drawnScreen = []\n this.drawnScreenFG = []\n this.drawnScreenBG = []\n this.drawnScreenAttrs = []\n\n // draw immediately; the canvas shouldn't flash\n this.draw('init')\n }\n }\n\n /**\n * Resets the cursor blink to on and restarts the timer\n */\n resetCursorBlink () {\n this.cursor.blinkOn = true\n clearInterval(this.cursor.blinkInterval)\n this.cursor.blinkInterval = setInterval(() => {\n this.cursor.blinkOn = this.cursor.blinking\n ? !this.cursor.blinkOn\n : true\n if (this.cursor.blinking) this.scheduleDraw('cursor-blink')\n }, 500)\n }\n\n /**\n * Resets the blink style to on and restarts the timer\n */\n resetBlink () {\n this.window.blinkStyleOn = true\n clearInterval(this.window.blinkInterval)\n let intervals = 0\n this.window.blinkInterval = setInterval(() => {\n if (this.blinkingCellCount <= 0) return\n\n intervals++\n if (intervals >= 4 && this.window.blinkStyleOn) {\n this.window.blinkStyleOn = false\n intervals = 0\n } else if (intervals >= 1 && !this.window.blinkStyleOn) {\n this.window.blinkStyleOn = true\n intervals = 0\n }\n }, 200)\n }\n\n /**\n * Returns a normalized version of the current selection, such that `start`\n * is always before `end`.\n * @returns {Object} the normalized selection, with `start` and `end`\n */\n getNormalizedSelection () {\n let { start, end } = this.selection\n // if the start line is after the end line, or if they're both on the same\n // line but the start column comes after the end column, swap\n if (start[1] > end[1] || (start[1] === end[1] && start[0] > end[0])) {\n [start, end] = [end, start]\n }\n return { start, end }\n }\n\n /**\n * Returns whether or not a given cell is in the current selection.\n * @param {number} col - the column (x)\n * @param {number} line - the line (y)\n * @returns {boolean}\n */\n isInSelection (col, line) {\n let { start, end } = this.getNormalizedSelection()\n let colAfterStart = start[0] <= col\n let colBeforeEnd = col < end[0]\n let onStartLine = line === start[1]\n let onEndLine = line === end[1]\n\n if (onStartLine && onEndLine) return colAfterStart && colBeforeEnd\n else if (onStartLine) return colAfterStart\n else if (onEndLine) return colBeforeEnd\n else return start[1] < line && line < end[1]\n }\n\n /**\n * Sweeps for selected cells and joins them in a multiline string.\n * @returns {string} the selection\n */\n getSelectedText () {\n const screenLength = this.window.width * this.window.height\n let lines = []\n let previousLineIndex = -1\n\n for (let cell = 0; cell < screenLength; cell++) {\n let x = cell % this.window.width\n let y = Math.floor(cell / this.window.width)\n\n if (this.isInSelection(x, y)) {\n if (previousLineIndex !== y) {\n previousLineIndex = y\n lines.push('')\n }\n lines[lines.length - 1] += this.screen[cell]\n }\n }\n\n return lines.join('\\n')\n }\n\n /**\n * Copies the selection to clipboard and creates a notification balloon.\n */\n copySelectionToClipboard () {\n let selectedText = this.getSelectedText()\n // don't copy anything if nothing is selected\n if (!selectedText) return\n let textarea = mk('textarea')\n document.body.appendChild(textarea)\n textarea.value = selectedText\n textarea.select()\n if (document.execCommand('copy')) {\n Notify.show('Copied to clipboard')\n } else {\n Notify.show('Failed to copy')\n }\n document.body.removeChild(textarea)\n }\n\n /**\n * Converts screen coordinates to grid coordinates.\n * @param {number} x - x in pixels\n * @param {number} y - y in pixels\n * @param {boolean} rounded - whether to round the coord, used for select highlighting\n * @returns {number[]} a tuple of (x, y) in cells\n */\n screenToGrid (x, y, rounded = false) {\n let cellSize = this.getCellSize()\n\n return [\n Math.floor((x + (rounded ? cellSize.width / 2 : 0)) / cellSize.width),\n Math.floor(y / cellSize.height)\n ]\n }\n\n /**\n * Converts grid coordinates to screen coordinates.\n * @param {number} x - x in cells\n * @param {number} y - y in cells\n * @param {boolean} [withScale] - when true, will apply window scale\n * @returns {number[]} a tuple of (x, y) in pixels\n */\n gridToScreen (x, y, withScale = false) {\n let cellSize = this.getCellSize()\n\n return [x * cellSize.width, y * cellSize.height].map(v => withScale ? v * this._windowScale : v)\n }\n\n /**\n * Draws a cell's background with the given parameters.\n * @param {Object} options\n * @param {number} options.x - x in cells\n * @param {number} options.y - y in cells\n * @param {number} options.cellWidth - cell width in pixels\n * @param {number} options.cellHeight - cell height in pixels\n * @param {number} options.bg - the background color\n */\n drawCellBackground ({ x, y, cellWidth, cellHeight, bg }) {\n const ctx = this.ctx\n ctx.fillStyle = this.getColor(bg)\n ctx.clearRect(x * cellWidth, y * cellHeight, cellWidth, cellHeight)\n ctx.fillRect(x * cellWidth, y * cellHeight, cellWidth, cellHeight)\n }\n\n /**\n * Draws a cell's character with the given parameters. Won't do anything if\n * text is an empty string.\n * @param {Object} options\n * @param {number} options.x - x in cells\n * @param {number} options.y - y in cells\n * @param {Object} options.charSize - the character size, an object with\n * `width` and `height` in pixels\n * @param {number} options.cellWidth - cell width in pixels\n * @param {number} options.cellHeight - cell height in pixels\n * @param {string} options.text - the cell content\n * @param {number} options.fg - the foreground color\n * @param {number} options.attrs - the cell's attributes\n */\n drawCell ({ x, y, charSize, cellWidth, cellHeight, text, fg, attrs }) {\n if (!text) return\n\n const ctx = this.ctx\n\n let underline = false\n let strike = false\n let overline = false\n if (attrs & (1 << 1)) ctx.globalAlpha = 0.5\n if (attrs & (1 << 3)) underline = true\n if (attrs & (1 << 5)) text = TermScreen.alphaToFraktur(text)\n if (attrs & (1 << 6)) strike = true\n if (attrs & (1 << 7)) overline = true\n\n ctx.fillStyle = this.getColor(fg)\n ctx.fillText(text, (x + 0.5) * cellWidth, (y + 0.5) * cellHeight)\n\n if (underline || strike || overline) {\n ctx.strokeStyle = this.getColor(fg)\n ctx.lineWidth = 1\n ctx.lineCap = 'round'\n ctx.beginPath()\n\n if (underline) {\n let lineY = Math.round(y * cellHeight + charSize.height) + 0.5\n ctx.moveTo(x * cellWidth, lineY)\n ctx.lineTo((x + 1) * cellWidth, lineY)\n }\n\n if (strike) {\n let lineY = Math.round((y + 0.5) * cellHeight) + 0.5\n ctx.moveTo(x * cellWidth, lineY)\n ctx.lineTo((x + 1) * cellWidth, lineY)\n }\n\n if (overline) {\n let lineY = Math.round(y * cellHeight) + 0.5\n ctx.moveTo(x * cellWidth, lineY)\n ctx.lineTo((x + 1) * cellWidth, lineY)\n }\n\n ctx.stroke()\n }\n\n ctx.globalAlpha = 1\n }\n\n /**\n * Returns all adjacent cell indices given a radius.\n * @param {number} cell - the center cell index\n * @param {number} [radius] - the radius. 1 by default\n * @returns {number[]} an array of cell indices\n */\n getAdjacentCells (cell, radius = 1) {\n const { width, height } = this.window\n const screenLength = width * height\n\n let cells = []\n\n for (let x = -radius; x <= radius; x++) {\n for (let y = -radius; y <= radius; y++) {\n if (x === 0 && y === 0) continue\n cells.push(cell + x + y * width)\n }\n }\n\n return cells.filter(cell => cell >= 0 && cell < screenLength)\n }\n\n /**\n * Updates the screen.\n * @param {string} why - the draw reason (for debugging)\n */\n draw (why) {\n const ctx = this.ctx\n const {\n width,\n height,\n devicePixelRatio,\n gridScaleX,\n gridScaleY\n } = this.window\n\n const charSize = this.getCharSize()\n const { width: cellWidth, height: cellHeight } = this.getCellSize()\n const screenWidth = width * cellWidth\n const screenHeight = height * cellHeight\n const screenLength = width * height\n\n ctx.setTransform(devicePixelRatio, 0, 0, devicePixelRatio, 0, 0)\n\n if (this.window.debug && this._debug) this._debug.drawStart(why)\n\n ctx.font = this.getFont()\n ctx.textAlign = 'center'\n ctx.textBaseline = 'middle'\n\n // bits in the attr value that affect the font\n const FONT_MASK = 0b101\n\n // Map of (attrs & FONT_MASK) -> Array of cell indices\n let fontGroups = new Map()\n\n // Map of (cell index) -> boolean, whether or not a cell has updated\n let updateMap = new Map()\n\n for (let cell = 0; cell < screenLength; cell++) {\n let x = cell % width\n let y = Math.floor(cell / width)\n let isCursor = !this.cursor.hanging &&\n this.cursor.x === x &&\n this.cursor.y === y &&\n this.cursor.blinkOn &&\n this.cursor.visible\n\n let wasCursor = x === this.drawnCursor[0] && y === this.drawnCursor[1]\n\n let inSelection = this.isInSelection(x, y)\n\n let text = this.screen[cell]\n let fg = this.screenFG[cell]\n let bg = this.screenBG[cell]\n let attrs = this.screenAttrs[cell]\n\n if (attrs & (1 << 4) && !this.window.blinkStyleOn) {\n // blinking is enabled and blink style is off\n // set text to nothing so drawCell doesn't draw anything\n text = ''\n }\n\n if (inSelection) {\n fg = -1\n bg = -2\n }\n\n let didUpdate = text !== this.drawnScreen[cell] ||\n fg !== this.drawnScreenFG[cell] ||\n bg !== this.drawnScreenBG[cell] ||\n attrs !== this.drawnScreenAttrs[cell] ||\n isCursor !== wasCursor ||\n (isCursor && this.cursor.style !== this.drawnCursor[2])\n\n let font = attrs & FONT_MASK\n if (!fontGroups.has(font)) fontGroups.set(font, [])\n\n fontGroups.get(font).push([cell, x, y, text, fg, bg, attrs, isCursor, inSelection])\n updateMap.set(cell, didUpdate)\n }\n\n // Map of (cell index) -> boolean, whether or not a cell should be redrawn\n const redrawMap = new Map()\n\n let isTextWide = text =>\n text !== ' ' && ctx.measureText(text).width >= (cellWidth + 0.05)\n\n // decide for each cell if it should be redrawn\n let updateRedrawMapAt = cell => {\n let shouldUpdate = updateMap.get(cell) || redrawMap.get(cell)\n\n // TODO: fonts (necessary?)\n let text = this.screen[cell]\n let isWideCell = isTextWide(text)\n let checkRadius = isWideCell ? 2 : 1\n\n if (!shouldUpdate) {\n // check adjacent cells\n let adjacentDidUpdate = false\n\n for (let adjacentCell of this.getAdjacentCells(cell, checkRadius)) {\n if (updateMap.get(adjacentCell)) {\n adjacentDidUpdate = true\n break\n }\n }\n\n if (adjacentDidUpdate) shouldUpdate = true\n }\n\n redrawMap.set(cell, shouldUpdate)\n }\n\n for (let cell of updateMap.keys()) updateRedrawMapAt(cell)\n\n // mask to redrawing regions only\n if (this.window.graphics >= 1) {\n ctx.save()\n ctx.beginPath()\n for (let y = 0; y < height; y++) {\n let regionStart = null\n for (let x = 0; x < width; x++) {\n let cell = y * width + x\n let redrawing = redrawMap.get(cell)\n if (redrawing && regionStart === null) regionStart = x\n if (!redrawing && regionStart !== null) {\n ctx.rect(regionStart * cellWidth, y * cellHeight, (x - regionStart) * cellWidth, cellHeight)\n regionStart = null\n }\n }\n if (regionStart !== null) {\n ctx.rect(regionStart * cellWidth, y * cellHeight, (width - regionStart) * cellWidth, cellHeight)\n }\n }\n ctx.clip()\n }\n\n // pass 1: backgrounds\n for (let font of fontGroups.keys()) {\n for (let data of fontGroups.get(font)) {\n let [cell, x, y, text, fg, bg, attrs, isCursor] = data\n\n if (redrawMap.get(cell)) {\n this.drawCellBackground({ x, y, cellWidth, cellHeight, bg })\n }\n }\n }\n\n // pass 2: characters\n for (let font of fontGroups.keys()) {\n // set font once because in Firefox, this is a really slow action for some\n // reason\n let modifiers = {}\n if (font & 1) modifiers.weight = 'bold'\n if (font & 1 << 2) modifiers.style = 'italic'\n ctx.font = this.getFont(modifiers)\n\n for (let data of fontGroups.get(font)) {\n let [cell, x, y, text, fg, bg, attrs, isCursor, inSelection] = data\n\n if (redrawMap.get(cell)) {\n this.drawCell({\n x, y, charSize, cellWidth, cellHeight, text, fg, attrs\n })\n\n this.drawnScreen[cell] = text\n this.drawnScreenFG[cell] = fg\n this.drawnScreenBG[cell] = bg\n this.drawnScreenAttrs[cell] = attrs\n\n if (isCursor) this.drawnCursor = [x, y, this.cursor.style]\n\n if (this.window.debug && this._debug) {\n // set cell flags\n let flags = 1 // always redrawn\n flags |= (+updateMap.get(cell)) << 1\n flags |= (+isTextWide(text)) << 2\n this._debug.setCell(cell, flags)\n }\n }\n\n if (isCursor && !inSelection) {\n ctx.save()\n ctx.beginPath()\n if (this.cursor.style === 'block') {\n // block\n ctx.rect(x * cellWidth, y * cellHeight, cellWidth, cellHeight)\n } else if (this.cursor.style === 'bar') {\n // vertical bar\n let barWidth = 2\n ctx.rect(x * cellWidth, y * cellHeight, barWidth, cellHeight)\n } else if (this.cursor.style === 'line') {\n // underline\n let lineHeight = 2\n ctx.rect(x * cellWidth, y * cellHeight + charSize.height, cellWidth, lineHeight)\n }\n ctx.clip()\n\n // swap foreground/background\n ;[fg, bg] = [bg, fg]\n\n // HACK: ensure cursor is visible\n if (fg === bg) bg = fg === 0 ? 7 : 0\n\n this.drawCellBackground({ x, y, cellWidth, cellHeight, bg })\n this.drawCell({\n x, y, charSize, cellWidth, cellHeight, text, fg, attrs\n })\n ctx.restore()\n }\n }\n }\n\n if (this.window.graphics >= 1) ctx.restore()\n\n if (this.window.debug && this._debug) this._debug.drawEnd()\n }\n\n /**\n * Parses the content of an `S` message and schedules a draw\n * @param {string} str - the message content\n */\n loadContent (str) {\n // current index\n let i = 0\n // Uncomment to capture screen content for the demo page\n // console.log(JSON.stringify(`S${str}`))\n\n // window size\n const newHeight = parse2B(str, i)\n const newWidth = parse2B(str, i + 2)\n const resized = (this.window.height !== newHeight) || (this.window.width !== newWidth)\n this.window.height = newHeight\n this.window.width = newWidth\n i += 4\n\n // cursor position\n let [cursorY, cursorX] = [parse2B(str, i), parse2B(str, i + 2)]\n i += 4\n let cursorMoved = (cursorX !== this.cursor.x || cursorY !== this.cursor.y)\n this.cursor.x = cursorX\n this.cursor.y = cursorY\n\n if (cursorMoved) {\n this.resetCursorBlink()\n this.emit('cursor-moved')\n }\n\n // attributes\n let attributes = parse3B(str, i)\n i += 3\n\n this.cursor.visible = !!(attributes & 1)\n this.cursor.hanging = !!(attributes & (1 << 1))\n\n this.input.setAlts(\n !!(attributes & (1 << 2)), // cursors alt\n !!(attributes & (1 << 3)), // numpad alt\n !!(attributes & (1 << 4)), // fn keys alt\n !!(attributes & (1 << 12)) // crlf mode\n )\n\n let trackMouseClicks = !!(attributes & (1 << 5))\n let trackMouseMovement = !!(attributes & (1 << 6))\n\n // 0 - Block blink 2 - Block steady (1 is unused)\n // 3 - Underline blink 4 - Underline steady\n // 5 - I-bar blink 6 - I-bar steady\n let cursorShape = (attributes >> 9) & 0x07\n\n // if it's not zero, decrement such that the two most significant bits\n // are the type and the least significant bit is the blink state\n if (cursorShape > 0) cursorShape--\n\n let cursorStyle = cursorShape >> 1\n let cursorBlinking = !(cursorShape & 1)\n\n if (cursorStyle === 0) this.cursor.style = 'block'\n else if (cursorStyle === 1) this.cursor.style = 'line'\n else if (cursorStyle === 2) this.cursor.style = 'bar'\n\n if (this.cursor.blinking !== cursorBlinking) {\n this.cursor.blinking = cursorBlinking\n this.resetCursorBlink()\n }\n\n this.input.setMouseMode(trackMouseClicks, trackMouseMovement)\n this.selection.selectable = !trackMouseClicks && !trackMouseMovement\n $(this.canvas).toggleClass('selectable', this.selection.selectable)\n this.mouseMode = {\n clicks: trackMouseClicks,\n movement: trackMouseMovement\n }\n\n let showButtons = !!(attributes & (1 << 7))\n let showConfigLinks = !!(attributes & (1 << 8))\n\n $('.x-term-conf-btn').toggleClass('hidden', !showConfigLinks)\n $('#action-buttons').toggleClass('hidden', !showButtons)\n\n this.bracketedPaste = !!(attributes & (1 << 13))\n\n // content\n let fg = 7\n let bg = 0\n let attrs = 0\n let cell = 0 // cell index\n let lastChar = ' '\n let screenLength = this.window.width * this.window.height\n\n if (resized) {\n this.updateSize()\n this.blinkingCellCount = 0\n this.screen = new Array(screenLength).fill(' ')\n this.screenFG = new Array(screenLength).fill(' ')\n this.screenBG = new Array(screenLength).fill(' ')\n this.screenAttrs = new Array(screenLength).fill(' ')\n }\n\n let strArray = !undef(Array.from) ? Array.from(str) : str.split('')\n\n const MASK_LINE_ATTR = 0xC8\n const MASK_BLINK = 1 << 4\n\n let setCellContent = () => {\n // Remove blink attribute if it wouldn't have any effect\n let myAttrs = attrs\n if ((myAttrs & MASK_BLINK) !== 0 &&\n ((lastChar === ' ' && ((myAttrs & MASK_LINE_ATTR) === 0)) || // no line styles\n fg === bg // invisible text\n )\n ) {\n myAttrs ^= MASK_BLINK\n }\n // update blinking cells counter if blink state changed\n if ((this.screenAttrs[cell] & MASK_BLINK) !== (myAttrs & MASK_BLINK)) {\n if (myAttrs & MASK_BLINK) this.blinkingCellCount++\n else this.blinkingCellCount--\n }\n\n this.screen[cell] = lastChar\n this.screenFG[cell] = fg\n this.screenBG[cell] = bg\n this.screenAttrs[cell] = myAttrs\n }\n\n while (i < strArray.length && cell < screenLength) {\n let character = strArray[i++]\n let charCode = character.codePointAt(0)\n\n let data\n switch (charCode) {\n case SEQ_REPEAT:\n let count = parse2B(strArray[i] + strArray[i + 1])\n i += 2\n for (let j = 0; j < count; j++) {\n setCellContent(cell)\n if (++cell > screenLength) break\n }\n break\n\n case SEQ_SET_COLORS:\n data = parse3B(strArray[i] + strArray[i + 1] + strArray[i + 2])\n i += 3\n fg = data & 0xFF\n bg = (data >> 8) & 0xFF\n break\n\n case SEQ_SET_ATTRS:\n data = parse2B(strArray[i] + strArray[i + 1])\n i += 2\n attrs = data & 0xFF\n break\n\n case SEQ_SET_FG:\n data = parse2B(strArray[i] + strArray[i + 1])\n i += 2\n fg = data & 0xFF\n break\n\n case SEQ_SET_BG:\n data = parse2B(strArray[i] + strArray[i + 1])\n i += 2\n bg = data & 0xFF\n break\n\n default:\n if (charCode < 32) character = '\\ufffd'\n lastChar = character\n setCellContent(cell)\n cell++\n }\n }\n\n if (this.window.debug) console.log(`Blinky cells = ${this.blinkingCellCount}`)\n\n this.scheduleDraw('load', 16)\n this.emit('load')\n }\n\n /**\n * Parses the content of a `T` message and updates the screen title and button\n * labels.\n * @param {string} str - the message content\n */\n loadLabels (str) {\n let pieces = str.split('\\x01')\n qs('#screen-title').textContent = pieces[0]\n $('#action-buttons button').forEach((button, i) => {\n let label = pieces[i + 1].trim()\n // if empty string, use the \"dim\" effect and put nbsp instead to\n // stretch the button vertically\n button.innerHTML = label ? esc(label) : ' '\n button.style.opacity = label ? 1 : 0.2\n })\n }\n\n /**\n * Shows an actual notification (if possible) or a notification balloon.\n * @param {string} text - the notification content\n */\n showNotification (text) {\n console.info(`Notification: ${text}`)\n if (Notification && Notification.permission === 'granted') {\n let notification = new Notification('ESPTerm', {\n body: text\n })\n notification.addEventListener('click', () => window.focus())\n } else {\n if (Notification && Notification.permission !== 'denied') {\n Notification.requestPermission()\n } else {\n // Fallback using the built-in notification balloon\n Notify.show(text)\n }\n }\n }\n\n /**\n * Loads a message from the server, and optionally a theme.\n * @param {string} str - the message\n * @param {number} [theme] - the new theme index\n */\n load (str, theme = -1) {\n const content = str.substr(1)\n if (theme >= 0 && theme < themes.length) {\n this.palette = themes[theme]\n }\n\n switch (str[0]) {\n case 'S':\n this.loadContent(content)\n break\n\n case 'T':\n this.loadLabels(content)\n break\n\n case 'B':\n this.beep()\n break\n\n case 'G':\n this.showNotification(content)\n break\n\n default:\n console.warn(`Bad data message type; ignoring.\\n${JSON.stringify(str)}`)\n }\n }\n\n /**\n * Creates a beep sound.\n */\n beep () {\n const audioCtx = this.audioCtx\n if (!audioCtx) return\n\n // prevent screeching\n if (this._lastBeep && this._lastBeep > Date.now() - 50) return\n this._lastBeep = Date.now()\n\n let osc, gain\n\n // main beep\n osc = audioCtx.createOscillator()\n gain = audioCtx.createGain()\n osc.connect(gain)\n gain.connect(audioCtx.destination)\n gain.gain.value = 0.5\n osc.frequency.value = 750\n osc.type = 'sine'\n osc.start()\n osc.stop(audioCtx.currentTime + 0.05)\n\n // surrogate beep (making it sound like 'oops')\n osc = audioCtx.createOscillator()\n gain = audioCtx.createGain()\n osc.connect(gain)\n gain.connect(audioCtx.destination)\n gain.gain.value = 0.2\n osc.frequency.value = 400\n osc.type = 'sine'\n osc.start(audioCtx.currentTime + 0.05)\n osc.stop(audioCtx.currentTime + 0.08)\n }\n\n /**\n * Converts an alphabetic character to its fraktur variant.\n * @param {string} character - the character\n * @returns {string} the converted character\n */\n static alphaToFraktur (character) {\n if (character >= 'a' && character <= 'z') {\n character = String.fromCodePoint(0x1d51e - 0x61 + character.charCodeAt(0))\n } else if (character >= 'A' && character <= 'Z') {\n character = frakturExceptions[character] || String.fromCodePoint(\n 0x1d504 - 0x41 + character.charCodeAt(0))\n }\n return character\n }\n}\n","/** File upload utility */\nwindow.TermUpl = function (conn, input, screen) {\n let lines, // array of lines without newlines\n line_i, // current line index\n fuTout, // timeout handle for line sending\n send_delay_ms, // delay between lines (ms)\n nl_str, // newline string to use\n curLine, // current line (when using fuOil)\n inline_pos // Offset in line (for long lines)\n\n // lines longer than this are split to chunks\n // sending a super-ling string through the socket is not a good idea\n const MAX_LINE_LEN = 128\n\n function openUploadDialog () {\n updateStatus('Ready...')\n Modal.show('#fu_modal', onDialogClose)\n $('#fu_form').toggleClass('busy', false)\n input.blockKeys(true)\n }\n\n function onDialogClose () {\n console.log('Upload modal closed.')\n clearTimeout(fuTout)\n line_i = 0\n input.blockKeys(false)\n }\n\n function updateStatus (msg) {\n qs('#fu_prog').textContent = msg\n }\n\n function startUpload () {\n let v = qs('#fu_text').value\n if (!v.length) {\n fuClose()\n return\n }\n\n lines = v.split('\\n')\n line_i = 0\n inline_pos = 0 // offset in line\n send_delay_ms = qs('#fu_delay').value\n\n // sanitize - 0 causes overflows\n if (send_delay_ms < 0) {\n send_delay_ms = 0\n qs('#fu_delay').value = send_delay_ms\n }\n\n nl_str = {\n 'CR': '\\r',\n 'LF': '\\n',\n 'CRLF': '\\r\\n'\n }[qs('#fu_crlf').value]\n\n $('#fu_form').toggleClass('busy', true)\n updateStatus('Starting...')\n uploadLine()\n }\n\n function uploadLine () {\n if (!$('#fu_modal').hasClass('visible')) {\n // Modal is closed, cancel\n return\n }\n\n if (!conn.canSend()) {\n // postpone\n fuTout = setTimeout(uploadLine, 1)\n return\n }\n\n if (inline_pos === 0) {\n curLine = ''\n if (line_i === 0) {\n if (screen.bracketedPaste) {\n curLine = '\\x1b[200~'\n }\n }\n\n curLine += lines[line_i++] + nl_str\n\n if (line_i === lines.length) {\n if (screen.bracketedPaste) {\n curLine += '\\x1b[201~'\n }\n }\n }\n\n let chunk\n if ((curLine.length - inline_pos) <= MAX_LINE_LEN) {\n chunk = curLine.substr(inline_pos, MAX_LINE_LEN)\n inline_pos = 0\n } else {\n chunk = curLine.substr(inline_pos, MAX_LINE_LEN)\n inline_pos += MAX_LINE_LEN\n }\n\n if (!input.sendString(chunk)) {\n updateStatus('FAILED!')\n return\n }\n\n let pt = Math.round((line_i / lines.length) * 1000) / 10\n updateStatus(`${line_i} / ${lines.length} (${pt}%)`)\n\n if (lines.length > line_i || inline_pos > 0) {\n fuTout = setTimeout(uploadLine, send_delay_ms)\n } else {\n closeWhenReady()\n }\n }\n\n function closeWhenReady () {\n if (!conn.canSend()) {\n // stuck in XOFF still, wait to process...\n updateStatus('Waiting for Tx buffer...')\n setTimeout(closeWhenReady, 100)\n } else {\n updateStatus('Done.')\n // delay to show it\n fuClose()\n }\n }\n\n function fuClose () {\n Modal.hide('#fu_modal')\n }\n\n return {\n init: function () {\n qs('#fu_file').addEventListener('change', function (evt) {\n let reader = new FileReader()\n let file = evt.target.files[0]\n let ftype = file.type || 'application/octet-stream'\n console.log('Selected file type: ' + ftype)\n if (!ftype.match(/text\\/.*|application\\/(json|csv|.*xml.*|.*script.*|x-php)/)) {\n // Deny load of blobs like img - can crash browser and will get corrupted anyway\n if (!confirm(`This does not look like a text file: ${ftype}\\nReally load?`)) {\n qs('#fu_file').value = ''\n return\n }\n }\n reader.onload = function (e) {\n const txt = e.target.result.replace(/[\\r\\n]+/, '\\n')\n qs('#fu_text').value = txt\n }\n console.log('Loading file...')\n reader.readAsText(file)\n }, false)\n\n qs('#term-fu-open').addEventListener('click', function () {\n openUploadDialog()\n return false\n })\n\n qs('#term-fu-start').addEventListener('click', function () {\n startUpload()\n return false\n })\n\n qs('#term-fu-close').addEventListener('click', function () {\n fuClose()\n return false\n })\n }\n }\n}\n","window.attachDebugScreen = function (screen) {\n const debugCanvas = mk('canvas')\n const ctx = debugCanvas.getContext('2d')\n\n debugCanvas.style.position = 'absolute'\n // hackity hack should probably set this in CSS\n debugCanvas.style.top = '6px'\n debugCanvas.style.left = '6px'\n debugCanvas.style.pointerEvents = 'none'\n\n let addCanvas = function () {\n if (!debugCanvas.parentNode) screen.canvas.parentNode.appendChild(debugCanvas)\n }\n let removeCanvas = function () {\n if (debugCanvas.parentNode) debugCanvas.parentNode.removeChild(debugCanvas)\n }\n let updateCanvasSize = function () {\n let { width, height, devicePixelRatio } = screen.window\n let cellSize = screen.getCellSize()\n debugCanvas.width = width * cellSize.width * devicePixelRatio\n debugCanvas.height = height * cellSize.height * devicePixelRatio\n debugCanvas.style.width = `${width * cellSize.width}px`\n debugCanvas.style.height = `${height * cellSize.height}px`\n }\n\n let startTime, endTime, lastReason\n let cells = new Map()\n\n let startDrawing\n\n screen._debug = {\n drawStart (reason) {\n lastReason = reason\n startTime = Date.now()\n },\n drawEnd () {\n endTime = Date.now()\n console.log(`Draw: ${lastReason} (${(endTime - startTime)} ms) with fancy graphics: ${screen.window.graphics}`)\n startDrawing()\n },\n setCell (cell, flags) {\n cells.set(cell, [flags, Date.now()])\n }\n }\n\n let isDrawing = false\n\n let drawLoop = function () {\n if (isDrawing) requestAnimationFrame(drawLoop)\n\n let { devicePixelRatio, width, height } = screen.window\n let { width: cellWidth, height: cellHeight } = screen.getCellSize()\n let screenLength = width * height\n let now = Date.now()\n\n ctx.setTransform(devicePixelRatio, 0, 0, devicePixelRatio, 0, 0)\n ctx.clearRect(0, 0, width * cellWidth, height * cellHeight)\n\n let activeCells = 0\n for (let cell = 0; cell < screenLength; cell++) {\n if (!cells.has(cell) || cells.get(cell)[0] === 0) continue\n\n let [flags, timestamp] = cells.get(cell)\n let elapsedTime = (now - timestamp) / 1000\n\n if (elapsedTime > 1) continue\n\n activeCells++\n ctx.globalAlpha = 0.5 * Math.max(0, 1 - elapsedTime)\n\n let x = cell % width\n let y = Math.floor(cell / width)\n\n if (flags & 1) {\n // redrawn\n ctx.fillStyle = '#f0f'\n }\n if (flags & 2) {\n // updated\n ctx.fillStyle = '#0f0'\n }\n\n ctx.fillRect(x * cellWidth, y * cellHeight, cellWidth, cellHeight)\n\n if (flags & 4) {\n // wide cell\n ctx.lineWidth = 2\n ctx.strokeStyle = '#f00'\n ctx.strokeRect(x * cellWidth, y * cellHeight, cellWidth, cellHeight)\n }\n }\n\n if (activeCells === 0) {\n isDrawing = false\n removeCanvas()\n }\n }\n\n startDrawing = function () {\n if (isDrawing) return\n addCanvas()\n updateCanvasSize()\n isDrawing = true\n drawLoop()\n }\n}\n","window.initSoftKeyboard = function (screen, input) {\n const keyInput = qs('#softkb-input')\n if (!keyInput) return // abort, we're not on the terminal page\n\n let keyboardOpen = false\n\n // moves the input to where the cursor is on the canvas.\n // this is because most browsers will always scroll to wherever the focused\n // input is\n let updateInputPosition = function () {\n if (!keyboardOpen) return\n\n let [x, y] = screen.gridToScreen(screen.cursor.x, screen.cursor.y, true)\n keyInput.style.transform = `translate(${x}px, ${y}px)`\n }\n\n keyInput.addEventListener('focus', () => {\n keyboardOpen = true\n updateInputPosition()\n })\n\n keyInput.addEventListener('blur', () => (keyboardOpen = false))\n\n screen.on('cursor-moved', updateInputPosition)\n\n qs('#term-kb-open').addEventListener('click', e => {\n e.preventDefault()\n keyInput.focus()\n })\n\n // Chrome for Android doesn't send proper keydown/keypress events with\n // real key values instead of 229 “Unidentified,” so here's a workaround\n // that deals with the input composition events.\n\n let lastCompositionString = ''\n let compositing = false\n\n // sends the difference between the last and the new composition string\n let sendInputDelta = function (newValue) {\n let resend = false\n if (newValue.length > lastCompositionString.length) {\n if (newValue.startsWith(lastCompositionString)) {\n // characters have been added at the end\n input.sendString(newValue.substr(lastCompositionString.length))\n } else resend = true\n } else if (newValue.length < lastCompositionString.length) {\n if (lastCompositionString.startsWith(newValue)) {\n // characters have been removed at the end\n input.sendString('\\b'.repeat(lastCompositionString.length -\n newValue.length))\n } else resend = true\n } else if (newValue !== lastCompositionString) resend = true\n\n if (resend) {\n // the entire string changed; resend everything\n input.sendString('\\b'.repeat(lastCompositionString.length) +\n newValue)\n }\n lastCompositionString = newValue\n }\n\n keyInput.addEventListener('keydown', e => {\n if (e.key === 'Unidentified') return\n\n keyInput.value = ''\n\n if (e.key === 'Backspace') {\n e.preventDefault()\n input.sendString('\\b')\n } else if (e.key === 'Enter') {\n e.preventDefault()\n input.sendString('\\x0d')\n }\n })\n\n keyInput.addEventListener('keypress', e => {\n // prevent key duplication on iOS (because Safari *does* send proper events)\n e.stopPropagation()\n })\n\n keyInput.addEventListener('input', e => {\n e.stopPropagation()\n\n if (e.isComposing) {\n sendInputDelta(e.data)\n } else {\n if (e.inputType === 'insertCompositionText') input.sendString(e.data)\n else if (e.inputType === 'deleteContentBackward') {\n lastCompositionString = ''\n sendInputDelta('')\n } else if (e.inputType === 'insertText') {\n input.sendString(e.data)\n }\n }\n })\n\n keyInput.addEventListener('compositionstart', e => {\n lastCompositionString = ''\n compositing = true\n })\n\n keyInput.addEventListener('compositionend', e => {\n lastCompositionString = ''\n compositing = false\n keyInput.value = ''\n })\n\n screen.on('open-soft-keyboard', () => keyInput.focus())\n}\n","/** Init the terminal sub-module - called from HTML */\nwindow.termInit = function ({ labels, theme, allFn }) {\n const screen = new TermScreen()\n const conn = Conn(screen)\n const input = Input(conn)\n const termUpload = TermUpl(conn, input, screen)\n screen.input = input\n\n conn.init()\n input.init({ allFn })\n termUpload.init()\n Notify.init()\n\n window.onerror = function (errorMsg, file, line, col) {\n Notify.show(`<b>JS ERROR!</b><br>${errorMsg}<br>at ${file}:${line}:${col}`, 10000, true)\n return false\n }\n\n qs('#screen').appendChild(screen.canvas)\n screen.load(labels, theme) // load labels and theme\n\n window.initSoftKeyboard(screen, input)\n if (window.attachDebugScreen) window.attachDebugScreen(screen)\n\n let isFullscreen = false\n let fitScreen = false\n let fitScreenIfNeeded = function fitScreenIfNeeded () {\n if (isFullscreen) {\n screen.window.fitIntoWidth = window.screen.width\n screen.window.fitIntoHeight = window.screen.height\n } else {\n screen.window.fitIntoWidth = fitScreen ? window.innerWidth - 20 : 0\n screen.window.fitIntoHeight = fitScreen ? window.innerHeight : 0\n }\n }\n fitScreenIfNeeded()\n window.addEventListener('resize', fitScreenIfNeeded)\n\n let toggleFitScreen = function () {\n fitScreen = !fitScreen\n const resizeButtonIcon = qs('#resize-button-icon')\n if (fitScreen) {\n resizeButtonIcon.classList.remove('icn-resize-small')\n resizeButtonIcon.classList.add('icn-resize-full')\n } else {\n resizeButtonIcon.classList.remove('icn-resize-full')\n resizeButtonIcon.classList.add('icn-resize-small')\n }\n fitScreenIfNeeded()\n }\n\n qs('#term-fit-screen').addEventListener('click', function () {\n toggleFitScreen()\n return false\n })\n\n // add fullscreen mode & button\n if (Element.prototype.requestFullscreen || Element.prototype.webkitRequestFullscreen) {\n let checkForFullscreen = function () {\n // document.fullscreenElement is not really supported yet, so here's a hack\n if (isFullscreen && (innerWidth !== window.screen.width || innerHeight !== window.screen.height)) {\n isFullscreen = false\n fitScreenIfNeeded()\n }\n }\n setInterval(checkForFullscreen, 500)\n\n // (why are the buttons anchors?)\n let button = mk('a')\n button.href = '#'\n button.addEventListener('click', e => {\n e.preventDefault()\n\n isFullscreen = true\n fitScreenIfNeeded()\n screen.updateSize()\n\n if (screen.canvas.requestFullscreen) screen.canvas.requestFullscreen()\n else screen.canvas.webkitRequestFullscreen()\n })\n let icon = mk('i')\n icon.classList.add('icn-resize-full') // TODO: less confusing icons\n button.appendChild(icon)\n let span = mk('span')\n span.textContent = 'Fullscreen'\n button.appendChild(span)\n qs('#term-nav').insertBefore(button, qs('#term-nav').firstChild)\n }\n\n // for debugging\n window.termScreen = screen\n window.conn = conn\n window.input = input\n window.termUpl = termUpload\n}\n"]} |