From 7e198ba7caecfd98cb25118b403f23545716e21b Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 23 Nov 2019 04:18:03 -0500 Subject: add basic template rendering ability --- teleterm/static/index.html | 13 -- teleterm/static/index.html.tmpl | 14 ++ teleterm/static/teleterm_web.js | 324 +++++++++++++++++------------------ teleterm/static/teleterm_web_bg.wasm | Bin 700342 -> 697715 bytes 4 files changed, 176 insertions(+), 175 deletions(-) delete mode 100644 teleterm/static/index.html create mode 100644 teleterm/static/index.html.tmpl (limited to 'teleterm/static') diff --git a/teleterm/static/index.html b/teleterm/static/index.html deleted file mode 100644 index 4a43e2b..0000000 --- a/teleterm/static/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - -
- - - diff --git a/teleterm/static/index.html.tmpl b/teleterm/static/index.html.tmpl new file mode 100644 index 0000000..c489d87 --- /dev/null +++ b/teleterm/static/index.html.tmpl @@ -0,0 +1,14 @@ + + + + + + +

{{title}}

+
+ + + diff --git a/teleterm/static/teleterm_web.js b/teleterm/static/teleterm_web.js index a2f704d..82cd6a4 100644 --- a/teleterm/static/teleterm_web.js +++ b/teleterm/static/teleterm_web.js @@ -18,31 +18,31 @@ function addHeapObject(obj) { return idx; } function __wbg_elem_binding0(arg0, arg1, arg2) { - wasm.__wbg_function_table.get(61)(arg0, arg1, addHeapObject(arg2)); + wasm.__wbg_function_table.get(2)(arg0, arg1, addHeapObject(arg2)); } function __wbg_elem_binding1(arg0, arg1, arg2) { - wasm.__wbg_function_table.get(61)(arg0, arg1, addHeapObject(arg2)); + wasm.__wbg_function_table.get(6)(arg0, arg1, arg2); } -function __wbg_elem_binding2(arg0, arg1, arg2) { - wasm.__wbg_function_table.get(61)(arg0, arg1, addHeapObject(arg2)); +function __wbg_elem_binding2(arg0, arg1) { + wasm.__wbg_function_table.get(38)(arg0, arg1); } function __wbg_elem_binding3(arg0, arg1, arg2) { - wasm.__wbg_function_table.get(62)(arg0, arg1, arg2); + wasm.__wbg_function_table.get(2)(arg0, arg1, addHeapObject(arg2)); } function __wbg_elem_binding4(arg0, arg1, arg2) { - wasm.__wbg_function_table.get(61)(arg0, arg1, addHeapObject(arg2)); + wasm.__wbg_function_table.get(2)(arg0, arg1, addHeapObject(arg2)); } function __wbg_elem_binding5(arg0, arg1, arg2) { - wasm.__wbg_function_table.get(61)(arg0, arg1, addHeapObject(arg2)); + wasm.__wbg_function_table.get(2)(arg0, arg1, addHeapObject(arg2)); } -function __wbg_elem_binding6(arg0, arg1) { - wasm.__wbg_function_table.get(34)(arg0, arg1); +function __wbg_elem_binding6(arg0, arg1, arg2) { + wasm.__wbg_function_table.get(2)(arg0, arg1, addHeapObject(arg2)); } function __wbg_elem_binding7(arg0, arg1, arg2, arg3, arg4) { - wasm.__wbg_function_table.get(18)(arg0, arg1, addHeapObject(arg2), arg3, addHeapObject(arg4)); + wasm.__wbg_function_table.get(22)(arg0, arg1, addHeapObject(arg2), arg3, addHeapObject(arg4)); } function __wbg_elem_binding8(arg0, arg1, arg2, arg3) { - wasm.__wbg_function_table.get(22)(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); + wasm.__wbg_function_table.get(26)(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); } /** */ @@ -64,7 +64,29 @@ function takeObject(idx) { return ret; } -function notDefined(what) { return () => { throw new Error(`${what} is not defined`); }; } +function isLikeNone(x) { + return x === undefined || x === null; +} + +function handleError(e) { + wasm.__wbindgen_exn_store(addHeapObject(e)); +} + +let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + +cachedTextDecoder.decode(); + +let cachegetUint8Memory = null; +function getUint8Memory() { + if (cachegetUint8Memory === null || cachegetUint8Memory.buffer !== wasm.memory.buffer) { + cachegetUint8Memory = new Uint8Array(wasm.memory.buffer); + } + return cachegetUint8Memory; +} + +function getStringFromWasm(ptr, len) { + return cachedTextDecoder.decode(getUint8Memory().subarray(ptr, ptr + len)); +} let WASM_VECTOR_LEN = 0; @@ -83,14 +105,6 @@ const encodeString = (typeof cachedTextEncoder.encodeInto === 'function' }; }); -let cachegetUint8Memory = null; -function getUint8Memory() { - if (cachegetUint8Memory === null || cachegetUint8Memory.buffer !== wasm.memory.buffer) { - cachegetUint8Memory = new Uint8Array(wasm.memory.buffer); - } - return cachegetUint8Memory; -} - function passStringToWasm(arg) { let len = arg.length; @@ -129,16 +143,12 @@ function getInt32Memory() { return cachegetInt32Memory; } -let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); - -cachedTextDecoder.decode(); - -function getStringFromWasm(ptr, len) { - return cachedTextDecoder.decode(getUint8Memory().subarray(ptr, ptr + len)); -} - -function handleError(e) { - wasm.__wbindgen_exn_store(addHeapObject(e)); +let cachegetUint32Memory = null; +function getUint32Memory() { + if (cachegetUint32Memory === null || cachegetUint32Memory.buffer !== wasm.memory.buffer) { + cachegetUint32Memory = new Uint32Array(wasm.memory.buffer); + } + return cachegetUint32Memory; } function debugString(val) { @@ -206,17 +216,7 @@ function debugString(val) { return className; } -function isLikeNone(x) { - return x === undefined || x === null; -} - -let cachegetUint32Memory = null; -function getUint32Memory() { - if (cachegetUint32Memory === null || cachegetUint32Memory.buffer !== wasm.memory.buffer) { - cachegetUint32Memory = new Uint32Array(wasm.memory.buffer); - } - return cachegetUint32Memory; -} +function notDefined(what) { return () => { throw new Error(`${what} is not defined`); }; } function init(module) { if (typeof module === 'undefined') { @@ -225,10 +225,6 @@ function init(module) { let result; const imports = {}; imports.wbg = {}; - imports.wbg.__wbindgen_object_drop_ref = function(arg0) { - takeObject(arg0); - }; - imports.wbg.__wbg_clearTimeout_42a8676f07d366c5 = typeof clearTimeout == 'function' ? clearTimeout : notDefined('clearTimeout'); imports.wbg.__wbindgen_cb_drop = function(arg0) { const obj = takeObject(arg0).original; if (obj.cnt-- == 1) { @@ -238,6 +234,105 @@ function init(module) { const ret = false; return ret; }; + imports.wbg.__widl_f_target_Event = function(arg0) { + const ret = getObject(arg0).target; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + imports.wbg.__widl_instanceof_Element = function(arg0) { + const ret = getObject(arg0) instanceof Element; + return ret; + }; + imports.wbg.__wbindgen_object_drop_ref = function(arg0) { + takeObject(arg0); + }; + imports.wbg.__widl_f_closest_Element = function(arg0, arg1, arg2) { + try { + const ret = getObject(arg0).closest(getStringFromWasm(arg1, arg2)); + return isLikeNone(ret) ? 0 : addHeapObject(ret); + } catch (e) { + handleError(e) + } + }; + imports.wbg.__widl_f_tag_name_Element = function(arg0, arg1) { + const ret = getObject(arg1).tagName; + const ret0 = passStringToWasm(ret); + const ret1 = WASM_VECTOR_LEN; + getInt32Memory()[arg0 / 4 + 0] = ret0; + getInt32Memory()[arg0 / 4 + 1] = ret1; + }; + imports.wbg.__widl_f_get_attribute_Element = function(arg0, arg1, arg2, arg3) { + const ret = getObject(arg1).getAttribute(getStringFromWasm(arg2, arg3)); + const ptr0 = isLikeNone(ret) ? 0 : passStringToWasm(ret); + const len0 = WASM_VECTOR_LEN; + const ret0 = ptr0; + const ret1 = len0; + getInt32Memory()[arg0 / 4 + 0] = ret0; + getInt32Memory()[arg0 / 4 + 1] = ret1; + }; + imports.wbg.__widl_f_prevent_default_Event = function(arg0) { + getObject(arg0).preventDefault(); + }; + imports.wbg.__wbindgen_json_parse = function(arg0, arg1) { + const ret = JSON.parse(getStringFromWasm(arg0, arg1)); + return addHeapObject(ret); + }; + imports.wbg.__widl_f_history_Window = function(arg0) { + try { + const ret = getObject(arg0).history; + return addHeapObject(ret); + } catch (e) { + handleError(e) + } + }; + imports.wbg.__widl_f_push_state_with_url_History = function(arg0, arg1, arg2, arg3, arg4, arg5) { + try { + getObject(arg0).pushState(getObject(arg1), getStringFromWasm(arg2, arg3), arg4 === 0 ? undefined : getStringFromWasm(arg4, arg5)); + } catch (e) { + handleError(e) + } + }; + imports.wbg.__widl_instanceof_PopStateEvent = function(arg0) { + const ret = getObject(arg0) instanceof PopStateEvent; + return ret; + }; + imports.wbg.__widl_f_state_PopStateEvent = function(arg0) { + const ret = getObject(arg0).state; + return addHeapObject(ret); + }; + imports.wbg.__wbindgen_string_get = function(arg0, arg1) { + const obj = getObject(arg0); + if (typeof(obj) !== 'string') return 0; + const ptr = passStringToWasm(obj); + getUint32Memory()[arg1 / 4] = WASM_VECTOR_LEN; + const ret = ptr; + return ret; + }; + imports.wbg.__widl_instanceof_HashChangeEvent = function(arg0) { + const ret = getObject(arg0) instanceof HashChangeEvent; + return ret; + }; + imports.wbg.__widl_f_new_url_HashChangeEvent = function(arg0, arg1) { + const ret = getObject(arg1).newURL; + const ret0 = passStringToWasm(ret); + const ret1 = WASM_VECTOR_LEN; + getInt32Memory()[arg0 / 4 + 0] = ret0; + getInt32Memory()[arg0 / 4 + 1] = ret1; + }; + imports.wbg.__widl_f_status_text_Response = function(arg0, arg1) { + const ret = getObject(arg1).statusText; + const ret0 = passStringToWasm(ret); + const ret1 = WASM_VECTOR_LEN; + getInt32Memory()[arg0 / 4 + 0] = ret0; + getInt32Memory()[arg0 / 4 + 1] = ret1; + }; + imports.wbg.__widl_f_status_Response = function(arg0) { + const ret = getObject(arg0).status; + return ret; + }; + imports.wbg.__wbindgen_object_clone_ref = function(arg0) { + const ret = getObject(arg0); + return addHeapObject(ret); + }; imports.wbg.__wbg_new_59cb74e423758ede = function() { const ret = new Error(); return addHeapObject(ret); @@ -302,10 +397,6 @@ function init(module) { getInt32Memory()[arg0 / 4 + 0] = ret0; getInt32Memory()[arg0 / 4 + 1] = ret1; }; - imports.wbg.__widl_instanceof_Element = function(arg0) { - const ret = getObject(arg0) instanceof Element; - return ret; - }; imports.wbg.__widl_f_set_attribute_Element = function(arg0, arg1, arg2, arg3, arg4) { try { getObject(arg0).setAttribute(getStringFromWasm(arg1, arg2), getStringFromWasm(arg3, arg4)); @@ -445,6 +536,7 @@ function init(module) { imports.wbg.__widl_f_set_checked_HTMLMenuItemElement = function(arg0, arg1) { getObject(arg0).checked = arg1 !== 0; }; + imports.wbg.__wbg_clearTimeout_42a8676f07d366c5 = typeof clearTimeout == 'function' ? clearTimeout : notDefined('clearTimeout'); imports.wbg.__widl_f_abort_AbortController = function(arg0) { getObject(arg0).abort(); }; @@ -483,14 +575,6 @@ function init(module) { const ret = getObject(arg0).data; return addHeapObject(ret); }; - imports.wbg.__wbindgen_string_get = function(arg0, arg1) { - const obj = getObject(arg0); - if (typeof(obj) !== 'string') return 0; - const ptr = passStringToWasm(obj); - getUint32Memory()[arg1 / 4] = WASM_VECTOR_LEN; - const ret = ptr; - return ret; - }; imports.wbg.__widl_f_close_WebSocket = function(arg0) { try { getObject(arg0).close(); @@ -560,10 +644,6 @@ function init(module) { imports.wbg.__widl_f_set_text_content_Node = function(arg0, arg1, arg2) { getObject(arg0).textContent = arg1 === 0 ? undefined : getStringFromWasm(arg1, arg2); }; - imports.wbg.__wbindgen_object_clone_ref = function(arg0) { - const ret = getObject(arg0); - return addHeapObject(ret); - }; imports.wbg.__wbg_resolve_04ca3cb0d333a4f0 = function(arg0) { const ret = Promise.resolve(getObject(arg0)); return addHeapObject(ret); @@ -583,86 +663,6 @@ function init(module) { handleError(e) } }; - imports.wbg.__widl_f_status_text_Response = function(arg0, arg1) { - const ret = getObject(arg1).statusText; - const ret0 = passStringToWasm(ret); - const ret1 = WASM_VECTOR_LEN; - getInt32Memory()[arg0 / 4 + 0] = ret0; - getInt32Memory()[arg0 / 4 + 1] = ret1; - }; - imports.wbg.__widl_f_status_Response = function(arg0) { - const ret = getObject(arg0).status; - return ret; - }; - imports.wbg.__widl_instanceof_HashChangeEvent = function(arg0) { - const ret = getObject(arg0) instanceof HashChangeEvent; - return ret; - }; - imports.wbg.__widl_f_new_url_HashChangeEvent = function(arg0, arg1) { - const ret = getObject(arg1).newURL; - const ret0 = passStringToWasm(ret); - const ret1 = WASM_VECTOR_LEN; - getInt32Memory()[arg0 / 4 + 0] = ret0; - getInt32Memory()[arg0 / 4 + 1] = ret1; - }; - imports.wbg.__widl_instanceof_PopStateEvent = function(arg0) { - const ret = getObject(arg0) instanceof PopStateEvent; - return ret; - }; - imports.wbg.__widl_f_state_PopStateEvent = function(arg0) { - const ret = getObject(arg0).state; - return addHeapObject(ret); - }; - imports.wbg.__widl_f_target_Event = function(arg0) { - const ret = getObject(arg0).target; - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }; - imports.wbg.__widl_f_closest_Element = function(arg0, arg1, arg2) { - try { - const ret = getObject(arg0).closest(getStringFromWasm(arg1, arg2)); - return isLikeNone(ret) ? 0 : addHeapObject(ret); - } catch (e) { - handleError(e) - } - }; - imports.wbg.__widl_f_tag_name_Element = function(arg0, arg1) { - const ret = getObject(arg1).tagName; - const ret0 = passStringToWasm(ret); - const ret1 = WASM_VECTOR_LEN; - getInt32Memory()[arg0 / 4 + 0] = ret0; - getInt32Memory()[arg0 / 4 + 1] = ret1; - }; - imports.wbg.__widl_f_get_attribute_Element = function(arg0, arg1, arg2, arg3) { - const ret = getObject(arg1).getAttribute(getStringFromWasm(arg2, arg3)); - const ptr0 = isLikeNone(ret) ? 0 : passStringToWasm(ret); - const len0 = WASM_VECTOR_LEN; - const ret0 = ptr0; - const ret1 = len0; - getInt32Memory()[arg0 / 4 + 0] = ret0; - getInt32Memory()[arg0 / 4 + 1] = ret1; - }; - imports.wbg.__widl_f_prevent_default_Event = function(arg0) { - getObject(arg0).preventDefault(); - }; - imports.wbg.__wbindgen_json_parse = function(arg0, arg1) { - const ret = JSON.parse(getStringFromWasm(arg0, arg1)); - return addHeapObject(ret); - }; - imports.wbg.__widl_f_history_Window = function(arg0) { - try { - const ret = getObject(arg0).history; - return addHeapObject(ret); - } catch (e) { - handleError(e) - } - }; - imports.wbg.__widl_f_push_state_with_url_History = function(arg0, arg1, arg2, arg3, arg4, arg5) { - try { - getObject(arg0).pushState(getObject(arg1), getStringFromWasm(arg2, arg3), arg4 === 0 ? undefined : getStringFromWasm(arg4, arg5)); - } catch (e) { - handleError(e) - } - }; imports.wbg.__widl_f_get_attribute_names_Element = function(arg0) { const ret = getObject(arg0).getAttributeNames(); return addHeapObject(ret); @@ -884,16 +884,16 @@ function init(module) { imports.wbg.__widl_f_warn_1_ = function(arg0) { console.warn(getObject(arg0)); }; - imports.wbg.__wbindgen_closure_wrapper594 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper126 = function(arg0, arg1, arg2) { const state = { a: arg0, b: arg1, cnt: 1 }; const real = (arg0) => { state.cnt++; const a = state.a; state.a = 0; try { - return __wbg_elem_binding5(a, state.b, arg0); + return __wbg_elem_binding3(a, state.b, arg0); } finally { - if (--state.cnt === 0) wasm.__wbg_function_table.get(35)(a, state.b); + if (--state.cnt === 0) wasm.__wbg_function_table.get(3)(a, state.b); else state.a = a; } } @@ -902,16 +902,16 @@ function init(module) { const ret = real; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper593 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper133 = function(arg0, arg1, arg2) { const state = { a: arg0, b: arg1, cnt: 1 }; const real = (arg0) => { state.cnt++; const a = state.a; state.a = 0; try { - return __wbg_elem_binding0(a, state.b, arg0); + return __wbg_elem_binding5(a, state.b, arg0); } finally { - if (--state.cnt === 0) wasm.__wbg_function_table.get(35)(a, state.b); + if (--state.cnt === 0) wasm.__wbg_function_table.get(3)(a, state.b); else state.a = a; } } @@ -920,16 +920,16 @@ function init(module) { const ret = real; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper487 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper525 = function(arg0, arg1, arg2) { const state = { a: arg0, b: arg1, cnt: 1 }; const real = () => { state.cnt++; const a = state.a; state.a = 0; try { - return __wbg_elem_binding6(a, state.b, ); + return __wbg_elem_binding2(a, state.b, ); } finally { - if (--state.cnt === 0) wasm.__wbg_function_table.get(35)(a, state.b); + if (--state.cnt === 0) wasm.__wbg_function_table.get(3)(a, state.b); else state.a = a; } } @@ -938,16 +938,16 @@ function init(module) { const ret = real; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper655 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper789 = function(arg0, arg1, arg2) { const state = { a: arg0, b: arg1, cnt: 1 }; const real = (arg0) => { state.cnt++; const a = state.a; state.a = 0; try { - return __wbg_elem_binding3(a, state.b, arg0); + return __wbg_elem_binding4(a, state.b, arg0); } finally { - if (--state.cnt === 0) wasm.__wbg_function_table.get(35)(a, state.b); + if (--state.cnt === 0) wasm.__wbg_function_table.get(3)(a, state.b); else state.a = a; } } @@ -956,16 +956,16 @@ function init(module) { const ret = real; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper792 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper128 = function(arg0, arg1, arg2) { const state = { a: arg0, b: arg1, cnt: 1 }; const real = (arg0) => { state.cnt++; const a = state.a; state.a = 0; try { - return __wbg_elem_binding4(a, state.b, arg0); + return __wbg_elem_binding6(a, state.b, arg0); } finally { - if (--state.cnt === 0) wasm.__wbg_function_table.get(35)(a, state.b); + if (--state.cnt === 0) wasm.__wbg_function_table.get(3)(a, state.b); else state.a = a; } } @@ -974,16 +974,16 @@ function init(module) { const ret = real; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper653 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper130 = function(arg0, arg1, arg2) { const state = { a: arg0, b: arg1, cnt: 1 }; const real = (arg0) => { state.cnt++; const a = state.a; state.a = 0; try { - return __wbg_elem_binding1(a, state.b, arg0); + return __wbg_elem_binding0(a, state.b, arg0); } finally { - if (--state.cnt === 0) wasm.__wbg_function_table.get(35)(a, state.b); + if (--state.cnt === 0) wasm.__wbg_function_table.get(3)(a, state.b); else state.a = a; } } @@ -992,16 +992,16 @@ function init(module) { const ret = real; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper595 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper131 = function(arg0, arg1, arg2) { const state = { a: arg0, b: arg1, cnt: 1 }; const real = (arg0) => { state.cnt++; const a = state.a; state.a = 0; try { - return __wbg_elem_binding2(a, state.b, arg0); + return __wbg_elem_binding1(a, state.b, arg0); } finally { - if (--state.cnt === 0) wasm.__wbg_function_table.get(35)(a, state.b); + if (--state.cnt === 0) wasm.__wbg_function_table.get(3)(a, state.b); else state.a = a; } } diff --git a/teleterm/static/teleterm_web_bg.wasm b/teleterm/static/teleterm_web_bg.wasm index 2b2e8f8..f034ebe 100644 Binary files a/teleterm/static/teleterm_web_bg.wasm and b/teleterm/static/teleterm_web_bg.wasm differ -- cgit v1.2.3-54-g00ecf