Skip to content

Commit

Permalink
fix #429, wholenumber is now editable, plus some minor docs fixes and…
Browse files Browse the repository at this point in the history
… additions
  • Loading branch information
shamansir committed Feb 12, 2017
1 parent a19b6af commit 582efce
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<a href="http://shamansir.github.io/rpd" title="Reactive Patch Development">
<img src="https://rawgit.com/shamansir/rpd/v2.0.0/docs/rpd.svg" width="140px" height="140px" />
</a>
</a>

**[Closed Milestones](https://github.com/shamansir/rpd/milestones?state=closed)**

Expand Down Expand Up @@ -66,7 +66,7 @@ Constructing a network of nodes:
var patch = Rpd.addPatch('Example');

var firstNode = patch.addNode('core/basic', 'Test');
var boolOutlet = firstNode.addOutlet('core/boolean', 'bool', {
var boolOutlet = firstNode.addOutlet('util/boolean', 'bool', {
default: true;
});
firstNode.addOutlet('util/number', { default: 1 });
Expand Down
11 changes: 9 additions & 2 deletions src/toolkit/util/toolkit.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ function howMuch(single, plural) {
};
}

Rpd.channeltype('util/boolean', {
default: false,
adapt: function(val) { return val ? 'true' : 'false' }
});

Rpd.channeltype('util/number', {
default: 0,
readonly: false,
Expand All @@ -32,7 +37,6 @@ Rpd.channeltype('util/number', {

Rpd.channeltype('util/wholenumber', {
default: 0,
readonly: true,
allow: [ 'util/number' ],
accept: function(val) {
if (val === Infinity) return true;
Expand Down Expand Up @@ -269,7 +273,10 @@ Rpd.nodetype('util/log', {
inlets: {
'what': { type: 'core/any' }
},
process: function(inlets) { }
process: function(inlets) {
// logging is done in the node renderer,
// since it depends on the way of output (i.e. browser vs console)
}
});

Rpd.nodetype('util/letter', {
Expand Down
13 changes: 11 additions & 2 deletions src/toolkit/util/toolkit.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* _renderers_: HTML, SVG
* _inlets_:
* `what`: `core/any`
* _outlets_: _node_
* _outlets_: _none_

##### `util/number`

Expand Down Expand Up @@ -58,7 +58,7 @@
* _outlets_:
* `number`: `util/number`

##### `util/comment`
##### `util/comment`

* _renderers_: HTML, SVG
* _inlets_:
Expand Down Expand Up @@ -102,6 +102,15 @@
* _outlets_:
* `number`: `util/number`

##### `util/dial`

* _renderers_: SVG
* _inlets_:
* `min`: `util/number` (`0`)
* `max`: `util/number` (`100`)
* _outlets_:
* `number`: `util/wholenumber`

##### `util/knobs`

* _renderers_: SVG
Expand Down

0 comments on commit 582efce

Please sign in to comment.