2021-03-26 14:45:51 +00:00
|
|
|
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)';
|
|
|
|
}
|
|
|
|
|
2021-03-31 00:27:44 +00:00
|
|
|
public dirty(_drive: DriveNumber, _dirty: boolean) {
|
2021-03-26 14:45:51 +00:00
|
|
|
// document.querySelector('#disksave' + drive).disabled = !dirty;
|
|
|
|
}
|
|
|
|
|
2021-03-31 00:27:44 +00:00
|
|
|
public label(drive: DriveNumber, label?: string) {
|
2021-03-26 14:45:51 +00:00
|
|
|
const labelElement =
|
|
|
|
document.querySelector('#disk-label' + drive)! as HTMLElement;
|
|
|
|
if (label) {
|
|
|
|
labelElement.innerText = label;
|
|
|
|
}
|
|
|
|
return labelElement.innerText;
|
|
|
|
}
|
|
|
|
}
|