|
|
@ -29,17 +29,61 @@ export function toTimecodeString(time: number): string { |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
export function ReactiveTimecodesEditor(id: string) { |
|
|
|
const {div, input, label} = van.tags |
|
|
|
const editor = div( |
|
|
|
{id: id, class: 'timecodeEntry'}, |
|
|
|
input({type: 'number', class: 'timecodeInput hours'}), |
|
|
|
let counter = 0 |
|
|
|
export function ReactiveTimecodesEditor(id: string, labelText: string) { |
|
|
|
const {form, input, label, span} = van.tags |
|
|
|
const timecodeID = `TimecodeInput${counter++}` |
|
|
|
const editor = form( |
|
|
|
{id: id, class: 'timecodeEntry', 'aria-labeledby': timecodeID}, |
|
|
|
label({id: timecodeID}, labelText), |
|
|
|
input({ |
|
|
|
type: 'number', |
|
|
|
id: `${timecodeID}-hours`, |
|
|
|
'aria-labeledby': `${timecodeID}-hours-label`, |
|
|
|
ariaLabel: 'hours', |
|
|
|
class: 'timecodeInput hours', |
|
|
|
}), |
|
|
|
label({id: `${timecodeID}-hours-label`, for: `${timecodeID}-hours`, hidden: true}, 'hours'), |
|
|
|
':', |
|
|
|
input({type: 'number', class: 'timecodeInput minutes'}), |
|
|
|
input({ |
|
|
|
type: 'number', |
|
|
|
id: `${timecodeID}-minutes`, |
|
|
|
class: 'timecodeInput minutes', |
|
|
|
'aria-labeledby': `${timecodeID}-minutes-label`, |
|
|
|
ariaLabel: 'minutes', |
|
|
|
}), |
|
|
|
label( |
|
|
|
{id: `${timecodeID}-minutes-label`, for: `${timecodeID}-minutes`, hidden: true}, |
|
|
|
'minutes' |
|
|
|
), |
|
|
|
':', |
|
|
|
input({type: 'number', class: 'timecodeInput seconds'}), |
|
|
|
input({ |
|
|
|
type: 'number', |
|
|
|
id: `${timecodeID}-seconds`, |
|
|
|
class: 'timecodeInput seconds', |
|
|
|
'aria-labeledby': `${timecodeID}-seconds-label`, |
|
|
|
ariaLabel: 'seconds', |
|
|
|
}), |
|
|
|
label( |
|
|
|
{id: `${timecodeID}-seconds-label`, for: `${timecodeID}-seconds`, hidden: true}, |
|
|
|
'seconds' |
|
|
|
), |
|
|
|
'.', |
|
|
|
input({type: 'number', class: 'timecodeInput milliseconds'}) |
|
|
|
input({ |
|
|
|
type: 'number', |
|
|
|
id: `${timecodeID}-milliseconds`, |
|
|
|
class: 'timecodeInput milliseconds', |
|
|
|
'aria-labeledby': `${timecodeID}-milliseconds-label`, |
|
|
|
ariaLabel: 'milliseconds', |
|
|
|
}), |
|
|
|
label( |
|
|
|
{ |
|
|
|
id: `${timecodeID}-milliseconds-label`, |
|
|
|
for: `${timecodeID}-milliseconds`, |
|
|
|
hidden: true, |
|
|
|
}, |
|
|
|
'milliseconds' |
|
|
|
) |
|
|
|
) |
|
|
|
return editor |
|
|
|
} |
|
|
|