Deploy KLH10 TOPS-20 emulator
Browse files- build/wasm/bld-kl/index.html +19 -0
- build/wasm/bld-kl/main.js +22 -1
build/wasm/bld-kl/index.html
CHANGED
|
@@ -54,6 +54,8 @@
|
|
| 54 |
.status.ready { color: #81c784; }
|
| 55 |
.status.error { color: #e57373; }
|
| 56 |
|
|
|
|
|
|
|
| 57 |
/* ============================================
|
| 58 |
VT100 Terminal Frame — Photo Mode
|
| 59 |
============================================ */
|
|
@@ -160,6 +162,12 @@
|
|
| 160 |
display: none;
|
| 161 |
}
|
| 162 |
.vt100-frame.frameless .vt100-screen-mask { display: none; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
|
| 164 |
/* Black mask to hide original photo text on the CRT */
|
| 165 |
.vt100-screen-mask {
|
|
@@ -239,6 +247,14 @@
|
|
| 239 |
.key-toolbar button { height: 36px; min-width: 36px; font-size: 12px; padding: 0 6px; }
|
| 240 |
.things-to-try { display: none; }
|
| 241 |
.footer { display: none; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 242 |
}
|
| 243 |
|
| 244 |
/* ============================================
|
|
@@ -356,6 +372,9 @@
|
|
| 356 |
<button data-key="ctrl-z">^Z</button>
|
| 357 |
<button data-key="ctrl-d">^D</button>
|
| 358 |
</div>
|
|
|
|
|
|
|
|
|
|
| 359 |
<div class="mode-toggle" style="text-align: center; margin-bottom: 16px;">
|
| 360 |
<a href="#" id="toggleFrame">Hide Terminal Frame</a>
|
| 361 |
·
|
|
|
|
| 54 |
.status.ready { color: #81c784; }
|
| 55 |
.status.error { color: #e57373; }
|
| 56 |
|
| 57 |
+
.mobile-info-toggle { display: none; }
|
| 58 |
+
|
| 59 |
/* ============================================
|
| 60 |
VT100 Terminal Frame — Photo Mode
|
| 61 |
============================================ */
|
|
|
|
| 162 |
display: none;
|
| 163 |
}
|
| 164 |
.vt100-frame.frameless .vt100-screen-mask { display: none; }
|
| 165 |
+
.vt100-frame.frameless #terminal {
|
| 166 |
+
height: auto;
|
| 167 |
+
}
|
| 168 |
+
.vt100-frame.frameless .vt100-screen .xterm {
|
| 169 |
+
height: auto !important;
|
| 170 |
+
}
|
| 171 |
|
| 172 |
/* Black mask to hide original photo text on the CRT */
|
| 173 |
.vt100-screen-mask {
|
|
|
|
| 247 |
.key-toolbar button { height: 36px; min-width: 36px; font-size: 12px; padding: 0 6px; }
|
| 248 |
.things-to-try { display: none; }
|
| 249 |
.footer { display: none; }
|
| 250 |
+
.mobile-info-toggle {
|
| 251 |
+
display: block;
|
| 252 |
+
text-align: center;
|
| 253 |
+
padding: 6px 0;
|
| 254 |
+
font-size: 12px;
|
| 255 |
+
}
|
| 256 |
+
.mobile-info-toggle a { color: #888; text-decoration: none; }
|
| 257 |
+
.mobile-info-toggle a:hover { color: #4fc3f7; }
|
| 258 |
}
|
| 259 |
|
| 260 |
/* ============================================
|
|
|
|
| 372 |
<button data-key="ctrl-z">^Z</button>
|
| 373 |
<button data-key="ctrl-d">^D</button>
|
| 374 |
</div>
|
| 375 |
+
<div class="mobile-info-toggle">
|
| 376 |
+
<a href="#" id="mobileInfoToggle">More info</a>
|
| 377 |
+
</div>
|
| 378 |
<div class="mode-toggle" style="text-align: center; margin-bottom: 16px;">
|
| 379 |
<a href="#" id="toggleFrame">Hide Terminal Frame</a>
|
| 380 |
·
|
build/wasm/bld-kl/main.js
CHANGED
|
@@ -265,7 +265,9 @@ class KLH10WebInterface {
|
|
| 265 |
const frame = document.getElementById('vt100Frame');
|
| 266 |
frame.classList.toggle('frameless');
|
| 267 |
e.target.textContent = frame.classList.contains('frameless') ? 'Show Terminal Frame' : 'Hide Terminal Frame';
|
| 268 |
-
|
|
|
|
|
|
|
| 269 |
});
|
| 270 |
}
|
| 271 |
|
|
@@ -281,6 +283,20 @@ class KLH10WebInterface {
|
|
| 281 |
});
|
| 282 |
}
|
| 283 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 284 |
// Key toolbar buttons
|
| 285 |
this.ctrlActive = false;
|
| 286 |
const keyToolbar = document.getElementById('keyToolbar');
|
|
@@ -753,6 +769,11 @@ class KLH10WebInterface {
|
|
| 753 |
}
|
| 754 |
|
| 755 |
if (output.length > 0) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 756 |
this.terminal.write(output);
|
| 757 |
}
|
| 758 |
|
|
|
|
| 265 |
const frame = document.getElementById('vt100Frame');
|
| 266 |
frame.classList.toggle('frameless');
|
| 267 |
e.target.textContent = frame.classList.contains('frameless') ? 'Show Terminal Frame' : 'Hide Terminal Frame';
|
| 268 |
+
// Force synchronous reflow so measurements reflect the new layout
|
| 269 |
+
void frame.offsetHeight;
|
| 270 |
+
this.adjustTerminalToScreen();
|
| 271 |
});
|
| 272 |
}
|
| 273 |
|
|
|
|
| 283 |
});
|
| 284 |
}
|
| 285 |
|
| 286 |
+
// Mobile "More info" toggle
|
| 287 |
+
const mobileInfoToggle = document.getElementById('mobileInfoToggle');
|
| 288 |
+
if (mobileInfoToggle) {
|
| 289 |
+
mobileInfoToggle.addEventListener('click', (e) => {
|
| 290 |
+
e.preventDefault();
|
| 291 |
+
const footer = document.querySelector('.footer');
|
| 292 |
+
const thingsToTry = document.querySelector('.things-to-try');
|
| 293 |
+
const showing = footer.style.display === 'block';
|
| 294 |
+
footer.style.display = showing ? '' : 'block';
|
| 295 |
+
if (thingsToTry) thingsToTry.style.display = showing ? '' : 'block';
|
| 296 |
+
e.target.textContent = showing ? 'More info' : 'Hide info';
|
| 297 |
+
});
|
| 298 |
+
}
|
| 299 |
+
|
| 300 |
// Key toolbar buttons
|
| 301 |
this.ctrlActive = false;
|
| 302 |
const keyToolbar = document.getElementById('keyToolbar');
|
|
|
|
| 769 |
}
|
| 770 |
|
| 771 |
if (output.length > 0) {
|
| 772 |
+
// KLH10 command mode (C/WASM) sends bare LF; convert to CR+LF for display.
|
| 773 |
+
// TOPS-20 sends CR+LF natively, so no conversion needed in run mode.
|
| 774 |
+
if (this.inRuncmdMode) {
|
| 775 |
+
output = output.replace(/(?<!\r)\n/g, '\r\n');
|
| 776 |
+
}
|
| 777 |
this.terminal.write(output);
|
| 778 |
}
|
| 779 |
|