LSP protocol tab: fixed a few minor bugs

This commit is contained in:
cat 2012-12-18 13:55:10 +01:00 committed by Thulinma
parent 4c28d00a91
commit 7c3eafcbc8

View file

@ -278,7 +278,8 @@
s = ""; s = "";
for (option in protocol) { for (option in protocol) {
if ((option != 'connector') && (option != 'online')) { if ((option != 'connector') && (option != 'online')) {
s += option+': '+protocol[option]+', '; u =
s += option+': '+((protocol[option] == '') ? 'default' : protocol[option] )+', ';
} }
} }
s = s.slice(0,-2); s = s.slice(0,-2);
@ -478,6 +479,9 @@
error = true; error = true;
} }
}); });
$('input[type="number"]').each(function(){ //turn all numbers into integers
$(this).val(Math.floor($(this).val()));
});
$('input.uint').each(function(){ //check if all uints are actually uints $('input.uint').each(function(){ //check if all uints are actually uints
if ($(this).val() < 0) { if ($(this).val() < 0) {
$(this).focus(); $(this).focus();
@ -499,7 +503,12 @@
$('input').each(function(){ $('input').each(function(){
newprotocol[$(this).attr('id').split('-')[2]] = $(this).val();; newprotocol[$(this).attr('id').split('-')[2]] = $(this).val();;
}); });
settings.settings.config.protocols.push(newprotocol); if (streamname == 'new') {
settings.settings.config.protocols.push(newprotocol);
}
else {
settings.settings.config.protocols[streamname] = newprotocol;
}
loadSettings(function() loadSettings(function()
{ {