mirror of
https://github.com/whscullin/apple2js.git
synced 2024-01-12 14:14:38 +00:00
207bed3d27
This is mostly a mechanical change; there are still lots of things about `ui/apple2` that could be improved. The change also converts a few dependencies of `ui/apple2`, like `applesoft/compiler`. Besides the straight conversions, some other packages have changes to make all of the typing work out. Lastly, `@types/micromodal` has been added as a development dependency.
25 lines
811 B
TypeScript
25 lines
811 B
TypeScript
import { Callbacks, DriveNumber } from '../cards/disk2';
|
|
|
|
export default class DriveLights implements Callbacks {
|
|
public driveLight(drive: DriveNumber, on: boolean) {
|
|
const disk =
|
|
document.querySelector('#disk' + drive)! as HTMLElement;
|
|
disk.style.backgroundImage =
|
|
on ? 'url(css/red-on-16.png)' :
|
|
'url(css/red-off-16.png)';
|
|
}
|
|
|
|
public dirty(_drive: DriveNumber, _dirty: boolean) {
|
|
// document.querySelector('#disksave' + drive).disabled = !dirty;
|
|
}
|
|
|
|
public label(drive: DriveNumber, label?: string) {
|
|
const labelElement =
|
|
document.querySelector('#disk-label' + drive)! as HTMLElement;
|
|
if (label) {
|
|
labelElement.innerText = label;
|
|
}
|
|
return labelElement.innerText;
|
|
}
|
|
}
|