2021-07-07 00:04:02 +00:00
|
|
|
import { Callbacks } from '../cards/disk2';
|
|
|
|
import type { DriveNumber } from '../formats/types';
|
2021-03-26 14:45:51 +00:00
|
|
|
|
|
|
|
export default class DriveLights implements Callbacks {
|
|
|
|
public driveLight(drive: DriveNumber, on: boolean) {
|
2022-05-31 15:38:40 +00:00
|
|
|
const disk = document.querySelector<HTMLElement>(`#disk${drive}`);
|
|
|
|
if (disk) {
|
|
|
|
disk.style.backgroundImage =
|
|
|
|
on ? 'url(css/red-on-16.png)' :
|
|
|
|
'url(css/red-off-16.png)';
|
|
|
|
}
|
2021-03-26 14:45:51 +00:00
|
|
|
}
|
|
|
|
|
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-10-02 18:45:09 +00:00
|
|
|
public label(drive: DriveNumber, label?: string, side?: string) {
|
2022-05-31 15:38:40 +00:00
|
|
|
const labelElement = document.querySelector<HTMLElement>(`#disk-label${drive}`);
|
|
|
|
const labelText = `${label || ''} ${(side ? `- ${side}` : '')}`;
|
|
|
|
if (label && labelElement) {
|
|
|
|
labelElement.innerText = labelText;
|
2021-03-26 14:45:51 +00:00
|
|
|
}
|
2022-05-31 15:38:40 +00:00
|
|
|
return labelText;
|
2021-03-26 14:45:51 +00:00
|
|
|
}
|
|
|
|
}
|