mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2024-06-07 17:29:31 +00:00
embed=1 uses referrer as storage location; use requestAnimationFrame()
This commit is contained in:
parent
a1e2e2aafc
commit
ef01639a06
|
@ -271,8 +271,7 @@ if (window.location.host.endsWith('8bitworkshop.com')) {
|
|||
</ul>
|
||||
</span>
|
||||
<!-- 8bitworkshop logo -->
|
||||
<span class="logo-gradient hidden-xs hidden-sm pull-right" style="margin-left:auto" onclick="window.open('/','_8bitws');">8bitworkshop</span>
|
||||
|
||||
<span class="logo-gradient hidden-xs pull-right" style="margin-left:auto" onclick="window.open('/','_8bitws');">8bitworkshop</span>
|
||||
</div><!-- controls_dynamic -->
|
||||
</div><!-- controls_top -->
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ type MemoryMapType = "main" | "vram";
|
|||
type MemoryMap = { [type:string] : Segment[] };
|
||||
|
||||
export function isDebuggable(arg:any): arg is Debuggable {
|
||||
return typeof arg.getDebugCategories === 'function';
|
||||
return arg && typeof arg.getDebugCategories === 'function';
|
||||
}
|
||||
|
||||
export interface Debuggable {
|
||||
|
|
|
@ -239,7 +239,7 @@ export class AnimationTimer {
|
|||
running : boolean = false;
|
||||
pulsing : boolean = false;
|
||||
lastts = 0;
|
||||
useReqAnimFrame = false; //TODO window.requestAnimationFrame ? (frequencyHz>40) : false;
|
||||
useReqAnimFrame = true; // may be deactivated in browers?
|
||||
nframes;
|
||||
startts; // for FPS calc
|
||||
frameRate;
|
||||
|
|
|
@ -1419,13 +1419,6 @@ function resume() {
|
|||
lastViewClicked = null;
|
||||
}
|
||||
|
||||
function togglePause() {
|
||||
if (platform.isRunning())
|
||||
pause();
|
||||
else
|
||||
resume();
|
||||
}
|
||||
|
||||
function singleStep() {
|
||||
if (!checkRunReady()) return;
|
||||
setupBreakpoint("step");
|
||||
|
@ -2341,8 +2334,11 @@ export async function startUI() {
|
|||
}
|
||||
getPlatformAndRepo();
|
||||
setupSplits();
|
||||
// create store
|
||||
// get store ID, repo id or platform id
|
||||
store_id = repo_id || getBasePlatform(platform_id);
|
||||
// are we embedded?
|
||||
if (qs['embed']) store_id = (document.referrer || document.location.href) + store_id;
|
||||
// create store
|
||||
store = createNewPersistentStore(store_id);
|
||||
// is this an importURL?
|
||||
if (qs['importURL']) {
|
||||
|
|
|
@ -115,7 +115,10 @@ export class SourceEditor implements ProjectView {
|
|||
var lineWrap = !!modedef.lineWrap;
|
||||
var theme = modedef.theme || MODEDEFS.default.theme;
|
||||
var lineNums = !modedef.noLineNumbers && !isMobileDevice;
|
||||
if (qs['embed']) lineNums = false; // no line numbers while embedded
|
||||
if (qs['embed']) {
|
||||
lineNums = false; // no line numbers while embedded
|
||||
isAsm = false; // no opcode bytes either
|
||||
}
|
||||
var gutters = ["CodeMirror-linenumbers", "gutter-offset", "gutter-info"];
|
||||
if (isAsm) gutters = ["CodeMirror-linenumbers", "gutter-offset", "gutter-bytes", "gutter-clock", "gutter-info"];
|
||||
if (modedef.noGutters || isMobileDevice) gutters = ["gutter-info"];
|
||||
|
|
23
test/web/testembed.js
Normal file
23
test/web/testembed.js
Normal file
|
@ -0,0 +1,23 @@
|
|||
|
||||
//var IDEURL = 'https://8bitworkshop.com/dev/';
|
||||
var IDEURL = 'http://localhost:8000/';
|
||||
var QS = '?embed=1&ignore=1&platform=c64&file0_name=test.dasm&file0_data=%0A%20%20%20%20%20 processor 6502%0A%20%20%20%20%20 org %24803%0AFoo%3A%20 lda %231%0A%20%20%20%20%20 rts';
|
||||
var EMBEDURL = 'http://localhost:8000/';
|
||||
|
||||
exports['test iframe'] = function(browser) {
|
||||
|
||||
browser.url(IDEURL + QS)
|
||||
.waitForElementNotVisible('#compile_spinner', time=10000)
|
||||
.waitForElementNotVisible('#error_alert')
|
||||
.waitForElementVisible('#emuscreen')
|
||||
.waitForElementVisible('.emuvideo')
|
||||
|
||||
}
|
||||
|
||||
exports['test embed.html'] = function(browser) {
|
||||
|
||||
browser.url(EMBEDURL)
|
||||
.waitForElementNotVisible('#error_alert')
|
||||
.waitForElementVisible('.emuvideo')
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user