Commit 3f3a1757 authored by Daniel Amm's avatar Daniel Amm Committed by Jean-Baptiste Kempf

test.html: check validity of text field values

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent f444762f
......@@ -514,7 +514,11 @@ function doAudioTrack(value)
var vlc = getVLC("vlc");
if( vlc )
{
vlc.audio.track = vlc.audio.track + value;
var newValue = vlc.audio.track + value;
if( newValue >= 0 && newValue < vlc.audio.count )
{
vlc.audio.track = newValue;
}
document.getElementById("trackTextField").innerHTML = vlc.audio.track;
}
}
......@@ -531,7 +535,11 @@ function doSubtitle(value)
var vlc = getVLC("vlc");
if( vlc )
{
vlc.subtitle.track = vlc.subtitle.track + value;
var newValue = vlc.subtitle.track + value;
if( newValue >= 0 && newValue < vlc.subtitle.count )
{
vlc.subtitle.track = vlc.subtitle.track + value;
}
document.getElementById("spuTextField").innerHTML = vlc.subtitle.track;
}
}
......@@ -577,7 +585,14 @@ function doRemoveItem(item)
{
var vlc = getVLC("vlc");
if( vlc )
vlc.playlist.items.remove(item);
{
var count = vlc.playlist.items.count;
if( !isNaN(item) && item !== "" && item >= 0 && item < count )
{
vlc.playlist.items.remove(item);
doItemCount();
}
}
}
function doPlaylistClearAll()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment