- added generic value option for setting a widget's initial value
- **text** widget's `defaultText` replaced with `value`
This commit is contained in:
parent
7c01444e21
commit
4e8ca970a9
18 changed files with 36 additions and 12 deletions
|
|
@ -202,6 +202,11 @@ module.exports.widgets = function(data,parent) {
|
|||
WIDGETS_BY_ADDRESS[addressref].push(widgetInner)
|
||||
}
|
||||
|
||||
// set widget's initial state
|
||||
if (widgetData.value !== '' && widgetInner.setValue) {
|
||||
widgetInner.setValue(widgetData.value)
|
||||
}
|
||||
|
||||
// Append the widget to its parent
|
||||
parent[0].appendChild(widgetContainer[0])
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ module.exports.options = {
|
|||
separator3:'osc',
|
||||
|
||||
range:{min:0,max:1},
|
||||
value:'',
|
||||
origin: 'auto',
|
||||
logScale:false,
|
||||
precision:2,
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ module.exports.options = {
|
|||
|
||||
on:1,
|
||||
off:0,
|
||||
value:'',
|
||||
norelease:false,
|
||||
precision:2,
|
||||
address:'auto',
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ module.exports.options = {
|
|||
|
||||
on:1,
|
||||
off:0,
|
||||
value:'',
|
||||
precision:2,
|
||||
address:'auto',
|
||||
preArgs:[],
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ module.exports.options = {
|
|||
rangeY:{min:0,max:1},
|
||||
logScaleX:false,
|
||||
logScaleY:false,
|
||||
value:'',
|
||||
precision:2,
|
||||
address:'auto',
|
||||
preArgs:[],
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ module.exports.options = {
|
|||
|
||||
separator3:'osc',
|
||||
|
||||
value:'',
|
||||
precision:0,
|
||||
address:'auto',
|
||||
preArgs:[],
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ module.exports.options = {
|
|||
rangeY:{min:0,max:1},
|
||||
logScaleX:false,
|
||||
logScaleY:false,
|
||||
value:'',
|
||||
precision:2,
|
||||
address:'auto',
|
||||
preArgs:[],
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ module.exports.options = {
|
|||
|
||||
range:{min:0,max:1},
|
||||
logScale:false,
|
||||
value:'',
|
||||
preArgs:[],
|
||||
address:'auto'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ module.exports.options = {
|
|||
|
||||
range:{min:0,max:1},
|
||||
logScale:false,
|
||||
value:'',
|
||||
address:'auto',
|
||||
preArgs:[]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,18 +15,16 @@ module.exports.options = {
|
|||
|
||||
separator2:'osc',
|
||||
|
||||
value:'',
|
||||
preArgs:[],
|
||||
address:'auto',
|
||||
defaultText:''
|
||||
}
|
||||
module.exports.create = function(widgetData,container) {
|
||||
var widget = $(`
|
||||
<div class="text">
|
||||
</div>
|
||||
`),
|
||||
label = widgetData.defaultText!==''?
|
||||
widgetData.defaultText:
|
||||
widgetData.label===false?
|
||||
label = widgetData.label===false?
|
||||
widgetData.id:
|
||||
widgetData.label=='auto'?
|
||||
widgetData.id:
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ module.exports.options = {
|
|||
|
||||
separator3:'osc',
|
||||
|
||||
value:'',
|
||||
address:'auto',
|
||||
preArgs:[],
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ module.exports.options = {
|
|||
|
||||
range:{min:0,max:1},
|
||||
origin: 'auto',
|
||||
value:'',
|
||||
logScale:false,
|
||||
precision:2,
|
||||
meter:false,
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ module.exports.options = {
|
|||
|
||||
range:{min:0,max:1},
|
||||
origin: 'auto',
|
||||
value:'',
|
||||
logScale:false,
|
||||
precision:2,
|
||||
address:'auto',
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ module.exports.options = {
|
|||
separator2:'osc',
|
||||
|
||||
values:{"Value 1":1,"Value 2":2},
|
||||
value:'',
|
||||
precision:2,
|
||||
address:'auto',
|
||||
preArgs:[],
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ module.exports.options = {
|
|||
|
||||
on:1,
|
||||
off:0,
|
||||
value:'',
|
||||
precision:2,
|
||||
address:'auto',
|
||||
preArgs:[],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue