Some minor changes to make it easier to load a machine in the Node environment

This commit is contained in:
Jeff Parsons 2016-12-27 22:05:59 -08:00 committed by Jeff Parsons
commit d930b31c53
38 changed files with 4216 additions and 3743 deletions

View file

@ -342,13 +342,13 @@ Computer8080.prototype.setMachineParms = function(parmsMachine)
Computer8080.prototype.getMachineParm = function(sParm, parmsComponent)
{
/*
* When checking parmsURL, the check is allowed be a bit looser, because URL parameters are
* When using getURLParm(), the check is allowed be a bit looser, because URL parameters are
* user-supplied, whereas most other parameters are developer-supplied. Granted, a developer
* may also be sloppy and neglect to use correct case (eg, 'automount' instead of 'autoMount'),
* but there are limits to my paranoia.
*/
var sParmLC = sParm.toLowerCase();
var value = Component.parmsURL[sParm] || Component.parmsURL[sParmLC];
var value = web.getURLParm(sParm) || web.getURLParm(sParmLC);
if (value === undefined && this.parmsMachine) {
value = this.parmsMachine[sParm];

View file

@ -166,7 +166,7 @@ function Video8080(parmsVideo, canvas, context, textarea, container)
* that's apparently been added to Chrome. Sigh.
*/
var fSmoothing = parmsVideo['smoothing'];
var sSmoothing = Component.parmsURL['smoothing'];
var sSmoothing = web.getURLParm('smoothing');
if (sSmoothing) fSmoothing = (sSmoothing == "true");
if (fSmoothing != null) {
for (i = 0; i < asWebPrefixes.length; i++) {
@ -1410,7 +1410,7 @@ Video8080.init = function()
* until we figure out a better UI. And note that we use our web.onPageEvent() helper function to make
* sure we don't trample any other 'onresize' handler(s) attached to the window object.
*/
var aspect = +(parmsVideo['aspect'] || Component.parmsURL['aspect']);
var aspect = +(parmsVideo['aspect'] || web.getURLParm('aspect'));
/*
* No 'aspect' parameter yields NaN, which is falsey, and anything else must satisfy my arbitrary
* constraints of 0.3 <= aspect <= 3.33, to prevent any useless (or worse, browser-blowing) results.