CC-2791: limiting length and numeric with javascript
- done
This commit is contained in:
parent
3f13810c0e
commit
750482474f
|
@ -50,6 +50,16 @@ function hideForShoutcast(ele){
|
||||||
restrictOggBitrate(ele, false)
|
restrictOggBitrate(ele, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function validate(ele,evt) {
|
||||||
|
var theEvent = evt || window.event;
|
||||||
|
var key = theEvent.keyCode || theEvent.which;
|
||||||
|
if ((ele.val().length >= 5 || (key < 48 || key > 57)) && !(key == 8 || key == 9 || key == 13 || key == 37 || key == 39 || key == 46)) {
|
||||||
|
theEvent.returnValue = false;
|
||||||
|
if(theEvent.preventDefault) theEvent.preventDefault();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function showForIcecast(ele){
|
function showForIcecast(ele){
|
||||||
var div = ele.closest("div")
|
var div = ele.closest("div")
|
||||||
div.find("#outputMountpoint-label").show()
|
div.find("#outputMountpoint-label").show()
|
||||||
|
@ -69,6 +79,10 @@ $(document).ready(function() {
|
||||||
rebuildStreamURL($(this))
|
rebuildStreamURL($(this))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$("input:[id$=-port]").keypress(function(e){
|
||||||
|
validate($(this),e)
|
||||||
|
})
|
||||||
|
|
||||||
$("select:[id$=-output]").change(function(){
|
$("select:[id$=-output]").change(function(){
|
||||||
rebuildStreamURL($(this))
|
rebuildStreamURL($(this))
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue