Skip to content

Commit

Permalink
voicetrack/interrupt modes view for alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
hinanaya committed Jun 4, 2024
1 parent 1c1cc99 commit c4cfe82
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
28 changes: 28 additions & 0 deletions html/alert/addedit.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,34 @@
<ob-datetime-input id="alert_stop_datetime"></ob-datetime-input>
</div>

<div class="fieldrow">
<label class="required" data-t>Mode</label>
<ob-field-select data-edit id="alert_mode" onchange="OB.Alert.changeMode()">
<ob-option selected value="interrupt">Interrupt</ob-option>
<ob-option value="voicetrack">Voicetrack</ob-option>
</ob-field-select>
</div>

<div class="fieldrow alert_mode_voicetrack" style="display: none;">
<label data-t>Background Audio Track Volume</label>
<ob-field-range id="alert_voicetrack_volume" data-edit data-step="0.05" data-min="0.00" data-max="1.00" value="0.1"></ob-field-range>
</div>

<div class="fieldrow alert_mode_voicetrack" style="display: none;">
<label data-t>Offset Time</label>
<ob-field-range id="alert_voicetrack_offset" data-edit data-suffix="s" data-step="0.1" data-min="0" data-max="10"></ob-field-range>
</div>

<div class="fieldrow alert_mode_voicetrack" style="display: none;">
<label data-t>Track Fade-Out Before</label>
<ob-field-range id="alert_voicetrack_fadeout_before" data-edit data-suffix="s" data-step="0.1" data-min="0" data-max="10"></ob-field-range>
</div>

<div class="fieldrow alert_mode_voicetrack" style="display: none;">
<label data-t>Track Fade-In After</label>
<ob-field-range id="alert_voicetrack_fadein_after" data-edit data-suffix="s" data-step="0.1" data-min="0" data-max="10"></ob-field-range>
</div>

</fieldset>

<fieldset>
Expand Down
9 changes: 9 additions & 0 deletions js/alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,3 +306,12 @@ OB.Alert.deleteAlert = function(confirm)
}

}

OB.Alert.changeMode = function ()
{
if (document.querySelector("#alert_mode").value === 'voicetrack') {
document.querySelectorAll('.alert_mode_voicetrack').forEach((node) => node.style.display = "inline-block");
} else {
document.querySelectorAll('.alert_mode_voicetrack').forEach((node) => node.style.display = "none");
}
}

0 comments on commit c4cfe82

Please sign in to comment.