Updated the PC Magazine Disks page with a new improved way of quickly loading disks into a demo machine

This commit is contained in:
Jeff Parsons 2017-07-12 10:14:01 -07:00 • committed by Jeff Parsons
commit 9cb68b77fd
10 changed files with 1286 additions and 902 deletions

View file

@ -59262,6 +59262,10 @@ class FDC extends Component {
* settings that determine the number of drives and their characteristics (eg, 40-track vs. 80-track),
* which it can then pass on to initDrive().
*/
this['exports'] = {
'loadDisk': this.loadSelectedDisk
};
}
/**
@ -59378,12 +59382,7 @@ class FDC extends Component {
case "loadDisk":
this.bindings[sBinding] = control;
control.onclick = function onClickLoadDisk(event) {
var controlDisks = fdc.bindings["listDisks"];
if (controlDisks) {
var sDisketteName = controlDisks.options[controlDisks.selectedIndex].text;
var sDiskettePath = controlDisks.value;
fdc.loadSelectedDrive(sDisketteName, sDiskettePath);
}
fdc.loadSelectedDisk();
};
return true;
@ -60174,6 +60173,23 @@ class FDC extends Component {
return !!this.cAutoMount;
}
/**
* loadSelectedDisk()
*
* @this {FDC}
* @return {boolean}
*/
loadSelectedDisk()
{
var controlDisks = this.bindings["listDisks"];
if (controlDisks) {
var sDisketteName = controlDisks.options[controlDisks.selectedIndex].text;
var sDiskettePath = controlDisks.value;
return this.loadSelectedDrive(sDisketteName, sDiskettePath);
}
return false;
}
/**
* loadSelectedDrive(sDisketteName, sDiskettePath, file)
*
@ -60181,6 +60197,7 @@ class FDC extends Component {
* @param {string} sDisketteName
* @param {string} sDiskettePath
* @param {File} [file] is set if there's an associated File object
* @return {boolean}
*/
loadSelectedDrive(sDisketteName, sDiskettePath, file)
{
@ -60190,12 +60207,12 @@ class FDC extends Component {
if (!sDiskettePath) {
this.unloadDrive(iDrive);
return;
return true;
}
if (sDiskettePath == "?") {
this.notice('Use "Choose File" and "Mount" to select and load a local disk.');
return;
return false;
}
/*
@ -60209,7 +60226,7 @@ class FDC extends Component {
*/
if (sDiskettePath == "??") {
sDiskettePath = window.prompt("Enter the URL of a remote disk image.", "") || "";
if (!sDiskettePath) return;
if (!sDiskettePath) return false;
sDisketteName = Str.getBaseName(sDiskettePath);
if (DEBUG) this.println("Attempting to load " + sDiskettePath + " as \"" + sDisketteName + "\"");
}
@ -60217,7 +60234,7 @@ class FDC extends Component {
while (this.loadDrive(iDrive, sDisketteName, sDiskettePath, false, file) < 0) {
if (!window.confirm("Click OK to reload the original disk and discard any changes.")) {
if (DEBUG) this.println("load cancelled");
return;
return false;
}
/*
* So here's the story: loadDrive() returned true, which it does ONLY if the specified disk is already
@ -60230,9 +60247,10 @@ class FDC extends Component {
this.removeDiskHistory(sDisketteName, sDiskettePath);
this.unloadDrive(iDrive, false, true);
}
return;
return true;
}
this.notice("Unable to load the selected drive");
return false;
}
/**