/set command converting values to ints/bools
authorDarren <darren@Darrens-MacBook-Pro.local>
Sun, 24 Mar 2013 19:53:49 +0000 (19:53 +0000)
committerDarren <darren@Darrens-MacBook-Pro.local>
Sun, 24 Mar 2013 19:53:49 +0000 (19:53 +0000)
client/assets/dev/model_application.js

index bf48b7c4ba77e15f4024964b5e15e0458e29a814..ba9313c41fbe237fe9f1e4b09258726ccaa48559 100644 (file)
@@ -886,11 +886,24 @@ _kiwi.model.Application = function () {
                     ev.params.shift();\r
 \r
                     value = ev.params.join(' ');\r
+\r
+                    // If we're setting a true boolean value..\r
+                    if (value === 'true')\r
+                        value = true;\r
+\r
+                    // If we're setting a false boolean value..\r
+                    if (value === 'false')\r
+                        value = false;\r
+\r
+                    // If we're setting a number..\r
+                    if (parseInt(value, 10).toString() === value)\r
+                        value = parseInt(value, 10);\r
+\r
                     _kiwi.global.settings.set(setting, value);\r
                 }\r
 \r
                 // Read the value to the user\r
-                _kiwi.app.panels.active.addMsg('', setting + ' = ' + _kiwi.global.settings.get(setting));\r
+                _kiwi.app.panels.active.addMsg('', setting + ' = ' + _kiwi.global.settings.get(setting).toString());\r
             });\r
 \r
 \r