1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-06-09 15:29:29 +00:00
8bitworkshop/src/platform/markdown.ts

50 lines
1.1 KiB
TypeScript
Raw Normal View History

import { PLATFORMS } from "../common/emu";
import { Platform } from "../common/baseplatform";
class MarkdownPlatform implements Platform {
2020-07-10 20:19:01 +00:00
mainElement : HTMLElement;
iframe : HTMLIFrameElement;
constructor(mainElement:HTMLElement) {
this.mainElement = mainElement;
this.iframe = $('<iframe sandbox="allow-same-origin" width="100%" height="100%"/>').appendTo(mainElement)[0] as HTMLIFrameElement;
2020-07-10 20:19:01 +00:00
this.iframe.style.backgroundColor = 'white';
mainElement.classList.add("vertical-scroll"); //100% height
mainElement.style.overflowY = 'auto';
}
start() {
}
reset() {
}
pause() {
}
resume() {
}
2020-07-10 20:19:01 +00:00
loadROM(title, data:string) {
$(this.iframe).contents().find('body').html(data);
}
isRunning() {
return false;
}
isDebugging() : boolean {
return false;
}
getToolForFilename(fn : string) : string {
return "markdown";
}
getDefaultExtension() : string {
return ".md";
}
getPresets() {
return [
{id:'hello.md', name:'Hello'},
];
}
2018-11-22 16:22:54 +00:00
showHelp() {
return "https://github.com/showdownjs/showdown/wiki/Showdown's-Markdown-syntax";
2018-11-22 16:22:54 +00:00
}
}
PLATFORMS['markdown'] = MarkdownPlatform;