1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-12-25 15:30:03 +00:00

misc fixes

This commit is contained in:
Steven Hugg 2019-08-20 19:13:41 -04:00
parent 8e679011d1
commit 480cdf77ab
4 changed files with 14 additions and 10 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "8bitworkshop", "name": "8bitworkshop",
"version": "3.4.0", "version": "3.4.1",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "8bitworkshop", "name": "8bitworkshop",
"version": "3.4.0", "version": "3.4.1",
"author": "Steven Hugg", "author": "Steven Hugg",
"description": "8bitworkshop.com", "description": "8bitworkshop.com",
"repository": { "repository": {

View File

@ -206,6 +206,7 @@ export class GithubService {
sess.platform_id = m[1]; sess.platform_id = m[1];
} }
// bind to repository // bind to repository
// TODO: don't bind until successful first import
this.bind(sess, true); this.bind(sess, true);
// get head commit // get head commit
return sess; return sess;

View File

@ -45,7 +45,7 @@ var stateRecorder : StateRecorderImpl;
var userPaused : boolean; // did user explicitly pause? var userPaused : boolean; // did user explicitly pause?
var current_output : WorkerOutput; // current ROM var current_output : WorkerOutput; // current ROM
var current_preset_entry : Preset; // current preset object (if selected) var current_preset : Preset; // current preset object (if selected)
var store; // persistent store var store; // persistent store
export var compparams; // received build params from worker export var compparams; // received build params from worker
@ -105,10 +105,10 @@ var hasLocalStorage : boolean = function() {
}(); }();
function getCurrentPresetTitle() : string { function getCurrentPresetTitle() : string {
if (!current_preset_entry) if (!current_preset)
return current_project.mainPath || "ROM"; return current_project.mainPath || "ROM";
else else
return current_preset_entry.title || current_preset_entry.name || current_project.mainPath || "ROM"; return current_preset.title || current_preset.name || current_project.mainPath || "ROM";
} }
function setLastPreset(id:string) { function setLastPreset(id:string) {
@ -864,7 +864,9 @@ function populateExamples(sel) {
for (var i=0; i<PRESETS.length; i++) { for (var i=0; i<PRESETS.length; i++) {
var preset = PRESETS[i]; var preset = PRESETS[i];
var name = preset.chapter ? (preset.chapter + ". " + preset.name) : preset.name; var name = preset.chapter ? (preset.chapter + ". " + preset.name) : preset.name;
sel.append($("<option />").val(preset.id).text(name).attr('selected',(preset.id==current_project.mainPath)?'selected':null)); var isCurrentPreset = preset.id==current_project.mainPath;
sel.append($("<option />").val(preset.id).text(name).attr('selected',isCurrentPreset?'selected':null));
if (isCurrentPreset) current_preset = preset;
files[preset.id] = name; files[preset.id] = name;
} }
return files; return files;
@ -952,8 +954,8 @@ var measureTimeLoad : Date;
function measureBuildTime() { function measureBuildTime() {
if (ga && measureTimeLoad) { if (ga && measureTimeLoad) {
var measureTimeBuild = new Date(); var measureTimeBuild = new Date();
ga('send', 'timing', 'ui', 'load', (measureTimeLoad.getDate() - measureTimeStart.getDate())); ga('send', 'timing', 'ui', 'load', (measureTimeLoad.getTime() - measureTimeStart.getTime()));
ga('send', 'timing', 'worker', 'build', (measureTimeBuild.getDate() - measureTimeLoad.getDate())); ga('send', 'timing', 'worker', 'build', (measureTimeBuild.getTime() - measureTimeLoad.getTime()));
measureTimeLoad = null; // only measure once measureTimeLoad = null; // only measure once
} }
} }
@ -1700,6 +1702,7 @@ function gotoNewLocation(replaceHistory? : boolean) {
function replaceURLState() { function replaceURLState() {
if (platform_id) qs['platform'] = platform_id; if (platform_id) qs['platform'] = platform_id;
delete qs['']; // remove null parameter
history.replaceState({}, "", "?" + $.param(qs)); history.replaceState({}, "", "?" + $.param(qs));
} }
@ -1748,6 +1751,7 @@ function installGAHooks() {
gaEvent('menu', e.target.id); gaEvent('menu', e.target.id);
} }
}); });
ga('send', 'pageview', location.pathname + '?platform=' + platform_id + '&file=' + qs['file'] + (repo_id?('&repo='+repo_id):''));
} }
} }
@ -1777,15 +1781,14 @@ function startPlatform() {
// start platform and load file // start platform and load file
replaceURLState(); replaceURLState();
platform.start(); platform.start();
if (ga) ga('send', 'pageview', location.pathname + '?platform=' + platform_id);
// TODO: ordering of loads? // TODO: ordering of loads?
installGAHooks();
loadBIOSFromProject(); loadBIOSFromProject();
initProject(); initProject();
loadProject(qs['file']); loadProject(qs['file']);
setupDebugControls(); setupDebugControls();
updateSelector(); updateSelector();
addPageFocusHandlers(); addPageFocusHandlers();
installGAHooks();
showInstructions(); showInstructions();
revealTopBar(); revealTopBar();
return true; return true;