1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-11-29 14:51:17 +00:00

embed splits, ui tweaks

This commit is contained in:
Steven Hugg 2020-10-26 13:36:38 -05:00
parent 0e4ed8ce21
commit 9bc9992aec
4 changed files with 23 additions and 6 deletions

View File

@ -705,6 +705,12 @@ div.asset_toolbar {
z-index: 5;
pointer-events: none;
}
.transcript-header {
color: #ccc;
text-align: right;
padding-right: 0.5em;
padding-top: 0.5em;
}
.tree-header {
border: 2px solid #555;
border-radius:8px;

View File

@ -170,7 +170,6 @@ export class TeleType {
}
}
loadState(state) {
console.log(state);
this.curstyle = state.curstyle;
this.reverse = state.reverse;
this.col = state.col;

View File

@ -2092,8 +2092,12 @@ function revealTopBar() {
export function setupSplits() {
const splitName = 'workspace-split3-' + platform_id;
var sizes = [0, 50, 50];
if (!(platform_id.startsWith('vcs') || qs['embed'] || Views.isMobileDevice))
var sizes;
if (platform_id.startsWith('vcs'))
sizes = [0, 50, 50];
else if (qs['embed'] || Views.isMobileDevice)
sizes = [0, 60, 40];
else
sizes = [12, 44, 44];
var sizesStr = hasLocalStorage && localStorage.getItem(splitName);
if (sizesStr) {
@ -2147,7 +2151,6 @@ function loadImportedURL(url : string) {
async function loadFormDataUpload() {
var ignore = !!qs['ignore'];
var force = !!qs['force'];
setWaitDialog(true);
for (var i=0; i<20; i++) {
let path = qs['file'+i+'_name'];
let dataenc = qs['file'+i+'_data'];
@ -2169,7 +2172,6 @@ async function loadFormDataUpload() {
}
delete qs['ignore'];
delete qs['force'];
setWaitDialog(false);
replaceURLState();
}
@ -2347,3 +2349,12 @@ function writeOutputROMFile() {
putWorkspaceFile(`bin/${prefix}${suffix}`, current_output);
}
}
export function highlightSearch(query: string) { // TODO: filename?
var wnd = projectWindows.getActive();
if (wnd instanceof Views.SourceEditor) {
var sc = wnd.editor.getSearchCursor(query);
if (sc.findNext()) {
wnd.editor.setSelection(sc.pos.to, sc.pos.from);
}
}
}

View File

@ -19,6 +19,7 @@ class SerialInOutViewer {
constructor(div: HTMLElement) {
div.style.overflowY = 'auto';
var gameport = $('<div id="gameport"/>').appendTo(div);
$('<p class="transcript-header">Serial Output</p>').appendTo(gameport);
var windowport = $('<div id="windowport" class="transcript"/>').appendTo(gameport);
this.div = windowport[0];
}
@ -78,7 +79,7 @@ export class SerialTestHarness implements SerialIOInterface {
recvByte(): number {
var index = this.readIndex();
this.inputIndex = index;
var b = this.inputBytes[index] | 0;
var b = (this.inputBytes && this.inputBytes[index]) | 0;
//this.bufin += byteToASCII(b);
this.viewer.tty.addtext(byteToASCII(b), 2|16);
if (b == 10) this.viewer.tty.newline();