diff --git a/Design:-Node-settings.md b/Design:-Node-settings.md index f6a6104..d27f122 100644 --- a/Design:-Node-settings.md +++ b/Design:-Node-settings.md @@ -1,6 +1,6 @@ /settings API returns only the following built-in fields by default. -http://nodered.jp/docs/api/admin/methods/get/settings/ +http://nodered.org/docs/api/admin/methods/get/settings/ A node can add their own settings to be output with the above settings API. @@ -47,3 +47,43 @@ The node settings in settings.js are not shown in the following cases. * The setting is not defined in any node. * A node setting sets false to exportable. * A node is disabled. + +## Use Cases +### Change node color +Currently, node color is fixed in each node. Using node settings, user can change a node color as they like. + +1. Add settings object to registerType definition in nodes/core/io/21-httprequest.js as follows. +``` + RED.nodes.registerType("http request",HTTPRequest,{ + credentials: { + user: {type:"text"}, + password: {type: "password"} + }, + settings: { + httpRequestColor: { + value: "rgb(231, 231, 174)", + exportable: true + } + } + }); +``` + +2. Change registerType definition in nodes/core/io/21-httprequest.html as follows. +``` +