Skip to content

Commit

Permalink
Not allowing empty, not-a-number, negative and 0 values anymore for a…
Browse files Browse the repository at this point in the history
…sync sending + fix parseInt()->parseFloat() to handle fraction
  • Loading branch information
Gil Brechbuhler committed Aug 16, 2016
1 parent 27258b1 commit 359942a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ebu_tt_live/ui/user_input_producer/user_input_producer.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
</div>
<div id="asynchronous-send-setup-div">
<label for="asynchronous-send-interval-input">Asynchronous send interval (in seconds) : </label>
<input type="text" id="asynchronous-send-interval-input" name="asynchronous-send-interval-input">
<input type="text" id="asynchronous-send-interval-input" name="asynchronous-send-interval-input" value="1">
<button type="button" id="asynchronous-send-start-button" name="asynchronous-send-start-button"> Start </button>
<button type="button" id="asynchronous-send-stop-button" name="asynchronous-send-stop-button"> Stop </button>
<span id="asynchronous-send-status-span"></span>
Expand Down Expand Up @@ -427,7 +427,11 @@

$("#asynchronous-send-start-button").click( function() {
if (!interval_send) {
var interval = parseInt($("#asynchronous-send-interval-input").val());
var interval = parseFloat($("#asynchronous-send-interval-input").val());
if (isNaN(interval) || interval <= 0) {
notifyError($("#asynchronous-send-status-span"), "Empty, non-number, negative and 0 values are not allowed", false);
return;
}
interval_send = setInterval(renderSendDocument, interval*1000);
notifySuccess($("#asynchronous-send-status-span"), "Running...", false);
}
Expand Down

0 comments on commit 359942a

Please sign in to comment.