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>
|
</ul>
|
||||||
</span>
|
</span>
|
||||||
<!-- 8bitworkshop logo -->
|
<!-- 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_dynamic -->
|
||||||
</div><!-- controls_top -->
|
</div><!-- controls_top -->
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ type MemoryMapType = "main" | "vram";
|
||||||
type MemoryMap = { [type:string] : Segment[] };
|
type MemoryMap = { [type:string] : Segment[] };
|
||||||
|
|
||||||
export function isDebuggable(arg:any): arg is Debuggable {
|
export function isDebuggable(arg:any): arg is Debuggable {
|
||||||
return typeof arg.getDebugCategories === 'function';
|
return arg && typeof arg.getDebugCategories === 'function';
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Debuggable {
|
export interface Debuggable {
|
||||||
|
|
|
@ -239,7 +239,7 @@ export class AnimationTimer {
|
||||||
running : boolean = false;
|
running : boolean = false;
|
||||||
pulsing : boolean = false;
|
pulsing : boolean = false;
|
||||||
lastts = 0;
|
lastts = 0;
|
||||||
useReqAnimFrame = false; //TODO window.requestAnimationFrame ? (frequencyHz>40) : false;
|
useReqAnimFrame = true; // may be deactivated in browers?
|
||||||
nframes;
|
nframes;
|
||||||
startts; // for FPS calc
|
startts; // for FPS calc
|
||||||
frameRate;
|
frameRate;
|
||||||
|
|
|
@ -1419,13 +1419,6 @@ function resume() {
|
||||||
lastViewClicked = null;
|
lastViewClicked = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function togglePause() {
|
|
||||||
if (platform.isRunning())
|
|
||||||
pause();
|
|
||||||
else
|
|
||||||
resume();
|
|
||||||
}
|
|
||||||
|
|
||||||
function singleStep() {
|
function singleStep() {
|
||||||
if (!checkRunReady()) return;
|
if (!checkRunReady()) return;
|
||||||
setupBreakpoint("step");
|
setupBreakpoint("step");
|
||||||
|
@ -2341,8 +2334,11 @@ export async function startUI() {
|
||||||
}
|
}
|
||||||
getPlatformAndRepo();
|
getPlatformAndRepo();
|
||||||
setupSplits();
|
setupSplits();
|
||||||
// create store
|
// get store ID, repo id or platform id
|
||||||
store_id = repo_id || getBasePlatform(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);
|
store = createNewPersistentStore(store_id);
|
||||||
// is this an importURL?
|
// is this an importURL?
|
||||||
if (qs['importURL']) {
|
if (qs['importURL']) {
|
||||||
|
|
|
@ -115,7 +115,10 @@ export class SourceEditor implements ProjectView {
|
||||||
var lineWrap = !!modedef.lineWrap;
|
var lineWrap = !!modedef.lineWrap;
|
||||||
var theme = modedef.theme || MODEDEFS.default.theme;
|
var theme = modedef.theme || MODEDEFS.default.theme;
|
||||||
var lineNums = !modedef.noLineNumbers && !isMobileDevice;
|
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"];
|
var gutters = ["CodeMirror-linenumbers", "gutter-offset", "gutter-info"];
|
||||||
if (isAsm) gutters = ["CodeMirror-linenumbers", "gutter-offset", "gutter-bytes", "gutter-clock", "gutter-info"];
|
if (isAsm) gutters = ["CodeMirror-linenumbers", "gutter-offset", "gutter-bytes", "gutter-clock", "gutter-info"];
|
||||||
if (modedef.noGutters || isMobileDevice) gutters = ["gutter-info"];
|
if (modedef.noGutters || isMobileDevice) gutters = ["gutter-info"];
|
||||||
|
|
|
@ -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