From 7c3eafcbc8a0c037e736b033a982f64061e9ca2d Mon Sep 17 00:00:00 2001 From: cat Date: Tue, 18 Dec 2012 13:55:10 +0100 Subject: [PATCH] LSP protocol tab: fixed a few minor bugs --- lsp/main.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lsp/main.js b/lsp/main.js index 2c56d083..7360859f 100644 --- a/lsp/main.js +++ b/lsp/main.js @@ -278,7 +278,8 @@ s = ""; for (option in protocol) { if ((option != 'connector') && (option != 'online')) { - s += option+': '+protocol[option]+', '; + u = + s += option+': '+((protocol[option] == '') ? 'default' : protocol[option] )+', '; } } s = s.slice(0,-2); @@ -478,6 +479,9 @@ 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 if ($(this).val() < 0) { $(this).focus(); @@ -499,7 +503,12 @@ $('input').each(function(){ 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() {