- removing "stack" widget
- adding "strip" widget, which can be vertical/horizontal and can stretch inner widgets - todo : different modes for for "strip" widget inner layout
This commit is contained in:
parent
4174331a3c
commit
ae94b4bb4e
9 changed files with 1167 additions and 664 deletions
|
|
@ -49,6 +49,8 @@ parsewidgets = function(widgets,parent) {
|
|||
color = '',
|
||||
accentclass = '';
|
||||
|
||||
widgetData.path = path
|
||||
|
||||
if (widgetData.color && widgetData.color=='accent') {
|
||||
accentclass = 'accent'
|
||||
} else if (widgetData.color) {
|
||||
|
|
@ -56,7 +58,7 @@ parsewidgets = function(widgets,parent) {
|
|||
}
|
||||
|
||||
var widget = $('\
|
||||
<div class="widget" widgetType="'+type+'" widgetId="'+id+'" path="'+path+'">\
|
||||
<div class="widget '+type+'-container" widgetType="'+type+'" widgetId="'+id+'" path="'+path+'">\
|
||||
<div class="label '+accentclass+'" '+color+'>'+label+'</div>\
|
||||
</div>\
|
||||
');
|
||||
|
|
|
|||
|
|
@ -20,6 +20,18 @@ createWidget.stack = function(widgetData) {
|
|||
return widget;
|
||||
}
|
||||
|
||||
createWidget.strip = function(widgetData) {
|
||||
var widget = $('\
|
||||
<div class="strip">\
|
||||
</div>\
|
||||
');
|
||||
parsewidgets(widgetData.widgets,widget)
|
||||
widget.getValue = function(){return}
|
||||
widget.setValue = function(){return}
|
||||
return widget;
|
||||
}
|
||||
|
||||
|
||||
|
||||
createWidget.toggle = createWidget.button = function(widgetData) {
|
||||
|
||||
|
|
@ -454,8 +466,6 @@ createWidget.fader = function(widgetData,parent){
|
|||
},{ relative:true });
|
||||
|
||||
widgetData.range = widgetData.range || {'min':0,'max':1}
|
||||
widgetData.range = (widgetData.range=='db')?{'min': -70,'20%': -40,'45%': -20,'60%': -10,'71%':-6,'78%':-3,'85%':0,'92%':3,'max': 6}:widgetData.range;
|
||||
|
||||
|
||||
var range = {}
|
||||
for (k in widgetData.range) {
|
||||
|
|
@ -473,7 +483,8 @@ createWidget.fader = function(widgetData,parent){
|
|||
for (i in scale) {
|
||||
var pip = $('<div class="pip"></div>')
|
||||
if (range[i]!=undefined) {
|
||||
pip.addClass('val').append('<span>'+range[i]+'</span>')
|
||||
var piptext = Math.abs(range[i])>1000?range[i]/1000+'k':range[i]
|
||||
pip.addClass('val').append('<span>'+piptext+'</span>')
|
||||
}
|
||||
pips.append(pip)
|
||||
}
|
||||
|
|
@ -571,8 +582,11 @@ createWidget.knob = function(widgetData,parent) {
|
|||
unit = widgetData.unit?' '+widgetData.unit.trim(): '';
|
||||
|
||||
|
||||
widget.find('.pip.min').text(range.min)
|
||||
widget.find('.pip.max').text(range.max)
|
||||
var pipmin = Math.abs(range.min)>1000?range.min/1000+'k':range.min,
|
||||
pipmax = Math.abs(range.max)>1000?range.max/1000+'k':range.max;
|
||||
|
||||
widget.find('.pip.min').text(pipmin)
|
||||
widget.find('.pip.max').text(pipmax)
|
||||
|
||||
knob.css('transform','rotate(45deg)').drag('init',function(){
|
||||
offR = knob.getRotation()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue