From d469d404abf244536e58bf031f16ea0a78f7c2e1 Mon Sep 17 00:00:00 2001 From: keegan-lillo Date: Tue, 8 Mar 2016 10:47:55 +1100 Subject: [PATCH] Moved the conversion information from `Clay.getSettings` to `ClayConfig.getSettings` --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f531156..a33856b 100755 --- a/README.md +++ b/README.md @@ -624,7 +624,7 @@ Pebble.addEventListener('webviewclosed', function(e) { | `Clay( [array] config, [function] customFn=null, [object] options={autoHandleEvents: true})`
`config` - an Array representing your config
`customFn` - function to be run in the context of the generated page
`options.autoHandleEvents` - set to `false` to prevent Clay from automatically handling the "showConfiguration" and "webviewclosed" events | `Clay` - a new instance of Clay. | | `.registerComponent( [ClayComponent] component )`
Registers a custom component. | `void`. | | `.generateUrl()` | `string` - The URL to open with `Pebble.openURL()` to use the Clay-generated config page. | -| `.getSettings(response)`
`response` - the response object provided to the "webviewclosed" event | `Object` - object of keys and values for each config page item with an `appKey`, where the key is the `appKey` and the value is the chosen value of that item. This method may do some conversions depending on the type of the setting. Arrays containing strings will have zeros inserted before each item. eg `['one', 'two']` becomes `['one', 0, 'two', 0]`. Booleans will be converted to numbers. eg `true` becomes `1` and `false` becomes `0` | +| `.getSettings(response)`
`response` - the response object provided to the "webviewclosed" event | `Object` - object of keys and values for each config page item with an `appKey`, where the key is the `appKey` and the value is the chosen value of that item. | --- @@ -708,7 +708,7 @@ This is the main way of talking to your generated config page. An instance of th | `.getItemByAppKey( [string] appKey )` | `ConfigItem\|undefined` - a single `ConfigItem` that has the provided `appKey`, otherwise `undefined`. | | `.getItemById( [string] id )` | `ConfigItem\|undefined` - a single `ConfigItem` that has the provided `id`, otherwise `undefined`. | | `.getItemsByType( [string] type )` | `Array.` - an array of config items that match the provided `type`. | -| `.getSettings()` | `Object` - an object representing all items with an `appKey` where the key is the `appKey` and the value is the result of running `.get()` on the Clay item. | +| `.getSettings()` | `Object` - an object representing all items with an `appKey` where the key is the `appKey` and the value is the result of running `.get()` on the Clay item. This method may do some conversions depending on the type of the setting. Arrays containing strings will have zeros inserted before each item. eg `['one', 'two']` becomes `['one', 0, 'two', 0]`. Booleans will be converted to numbers. eg `true` becomes `1` and `false` becomes `0` | | `.build()`
Builds the config page. Will dispatch the `BEFORE_BUILD` event prior to building the page, then the `AFTER_BUILD` event once it is complete. | `ClayConfig` | | `.on( [string] events, [function] handler )`
Register an event to the provided handler. The handler will be called with this instance of `ClayConfig` as the context. If you wish to register multiple events to the same handler, then separate the events with a space | `ClayConfig` | | `.off( [function] handler )`
Remove the given event handler. **NOTE:** This will remove the handler from all registered events. | `ClayConfig` |