From: Darren Date: Sun, 24 Mar 2013 19:53:49 +0000 (+0000) Subject: /set command converting values to ints/bools X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9383cc0779824b16591438d594904d49c8be4639;p=KiwiIRC.git /set command converting values to ints/bools --- diff --git a/client/assets/dev/model_application.js b/client/assets/dev/model_application.js index bf48b7c..ba9313c 100644 --- a/client/assets/dev/model_application.js +++ b/client/assets/dev/model_application.js @@ -886,11 +886,24 @@ _kiwi.model.Application = function () { ev.params.shift(); value = ev.params.join(' '); + + // If we're setting a true boolean value.. + if (value === 'true') + value = true; + + // If we're setting a false boolean value.. + if (value === 'false') + value = false; + + // If we're setting a number.. + if (parseInt(value, 10).toString() === value) + value = parseInt(value, 10); + _kiwi.global.settings.set(setting, value); } // Read the value to the user - _kiwi.app.panels.active.addMsg('', setting + ' = ' + _kiwi.global.settings.get(setting)); + _kiwi.app.panels.active.addMsg('', setting + ' = ' + _kiwi.global.settings.get(setting).toString()); });