widgetmanager: fix camelcase
This commit is contained in:
parent
3c07ab2c70
commit
137658f3e9
12 changed files with 35 additions and 35 deletions
|
|
@ -1,4 +1,4 @@
|
|||
var {WidgetManager} = require('./managers'),
|
||||
var {widgetManager} = require('./managers'),
|
||||
ipc = require('./ipc')
|
||||
|
||||
module.exports = {
|
||||
|
|
@ -27,8 +27,8 @@ module.exports = {
|
|||
|
||||
stateGet: function (){
|
||||
var data = []
|
||||
for (i in WidgetManager.widgets) {
|
||||
var widget = WidgetManager.widgets[i]
|
||||
for (i in widgetManager.widgets) {
|
||||
var widget = widgetManager.widgets[i]
|
||||
if (widget.setValue && widget.getValue) {
|
||||
var v = widget.getValue()
|
||||
if (v!=undefined) {
|
||||
|
|
@ -64,7 +64,7 @@ module.exports = {
|
|||
|
||||
for (i in preset) {
|
||||
var data = preset[i],
|
||||
widgets = WidgetManager.getWidgetById(data[0])
|
||||
widgets = widgetManager.getWidgetById(data[0])
|
||||
if (widgets.length) {
|
||||
for (var i=widgets.length-1;i>=0;i--) {
|
||||
if (widgets[i].setValue) {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ var init = require('./init'),
|
|||
utils = require('./utils'),
|
||||
icon = utils.icon,
|
||||
remoteExec = require('./remote-exec'),
|
||||
{WidgetManager} = require('./managers'),
|
||||
{widgetManager} = require('./managers'),
|
||||
ipc = require('./ipc'),
|
||||
osc = require('./osc')
|
||||
|
||||
|
|
@ -23,7 +23,7 @@ var callbacks = module.exports = {
|
|||
if (typeof data.args == 'object') {
|
||||
for (var i=data.args.length-1;i>=0;i--) {
|
||||
var ref = address+'||||'+data.args.slice(0,i).join('||||')
|
||||
if (WidgetManager.getWidgetByAddress(ref).length) {
|
||||
if (widgetManager.getWidgetByAddress(ref).length) {
|
||||
addressref = ref
|
||||
args = data.args.slice(i,data.args.length)
|
||||
continue
|
||||
|
|
@ -38,7 +38,7 @@ var callbacks = module.exports = {
|
|||
else if (args.length==1) args = args[0]
|
||||
|
||||
|
||||
let widget = WidgetManager.getWidgetByAddress(addressref)
|
||||
let widget = widgetManager.getWidgetByAddress(addressref)
|
||||
|
||||
for (i in widget) {
|
||||
// if the message target is provided (when message comes from another client connected to the same server)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ var widgets = require('../widgets'),
|
|||
editSession = function(a,b){require('./edit-objects').editSession(a,b,true)},
|
||||
purgeStores = require('./purge'),
|
||||
{iconify} = require('../utils'),
|
||||
{WidgetManager} = require('../managers')
|
||||
{widgetManager} = require('../managers')
|
||||
|
||||
|
||||
var getObjectData = function(obj){
|
||||
|
|
@ -130,7 +130,7 @@ var incrementWidget = function(data){
|
|||
|
||||
} else if (address){
|
||||
var addressref
|
||||
while (WidgetManager.getWidgetByAddress(addressref)) {
|
||||
while (widgetManager.getWidgetByAddress(addressref)) {
|
||||
address = address.replace(/([0-9]*)$/,function(m){
|
||||
var n = parseInt(m)+1
|
||||
n = isNaN(n)?1:n
|
||||
|
|
@ -138,13 +138,13 @@ var incrementWidget = function(data){
|
|||
})
|
||||
addressref = data.preArgs&&data.preArgs.length?address+'||||'+data.preArgs.join('||||'):address
|
||||
}
|
||||
|
||||
|
||||
data.address = address
|
||||
|
||||
}
|
||||
|
||||
if (id) {
|
||||
while (WidgetManager.getWidgetById(id)) {
|
||||
while (widgetManager.getWidgetById(id)) {
|
||||
id = id.replace(/([0-9]*)$/,function(m){
|
||||
var n = parseInt(m)+1
|
||||
n = isNaN(n)?1:n
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var {WidgetManager} = require('../managers')
|
||||
var {widgetManager} = require('../managers')
|
||||
|
||||
module.exports = function(purgetabs) {
|
||||
|
||||
|
|
@ -39,9 +39,9 @@ module.exports = function(purgetabs) {
|
|||
// prune widget stores
|
||||
// if widgets cannot be found in buffered tabs, it must be unreferenced
|
||||
var $b = $(bufferedTabs)
|
||||
for (hash in WidgetManager.widgets) {
|
||||
if (!$b.find(WidgetManager.widgets[hash].widget).length) {
|
||||
WidgetManager.removeWidget(hash)
|
||||
for (hash in widgetManager.widgets) {
|
||||
if (!$b.find(widgetManager.widgets[hash].widget).length) {
|
||||
widgetManager.removeWidget(hash)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,6 +130,6 @@ WidgetManager.prototype.getWidgetByAddress = function(address) {
|
|||
}
|
||||
|
||||
|
||||
var m = new WidgetManager()
|
||||
var widgetManager = new WidgetManager()
|
||||
|
||||
module.exports.WidgetManager = m
|
||||
module.exports.widgetManager = widgetManager
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
var remoteExec = require('./remote-exec'),
|
||||
{WidgetManager} = require('./managers'),
|
||||
{widgetManager} = require('./managers'),
|
||||
ipc = require('./ipc')
|
||||
|
||||
var Osc = function(){
|
||||
|
|
@ -35,7 +35,7 @@ Osc.prototype.receive = function(data){
|
|||
if (typeof data.args == 'object') {
|
||||
for (var i=data.args.length-1;i>=0;i--) {
|
||||
var ref = address+'||||'+data.args.slice(0,i).join('||||')
|
||||
if (WidgetManager.getWidgetByAddress(ref).length) {
|
||||
if (widgetManager.getWidgetByAddress(ref).length) {
|
||||
addressref = ref
|
||||
args = data.args.slice(i,data.args.length)
|
||||
continue
|
||||
|
|
@ -50,7 +50,7 @@ Osc.prototype.receive = function(data){
|
|||
else if (args.length==1) args = args[0]
|
||||
|
||||
|
||||
let widget = WidgetManager.getWidgetByAddress(addressref)
|
||||
let widget = widgetManager.getWidgetByAddress(addressref)
|
||||
|
||||
for (i in widget) {
|
||||
// if the message target is provided (when message comes from another client connected to the same server)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
Session File Parser
|
||||
*/
|
||||
|
||||
var {WidgetManager} = require('./managers')
|
||||
var {widgetManager} = require('./managers')
|
||||
|
||||
var widgets = require('./widgets'),
|
||||
widgetOptions = widgets.widgetOptions,
|
||||
|
|
@ -103,7 +103,7 @@ module.exports.widgets = function(data,parent) {
|
|||
// Genrate widget's id, based on its type
|
||||
if (widgetData.id=='auto') {
|
||||
var id
|
||||
while (!id || WidgetManager.getWidgetById(id).length) {
|
||||
while (!id || widgetManager.getWidgetById(id).length) {
|
||||
id=widgetData.type+'_'+getIterator(widgetData.type,'widget')
|
||||
}
|
||||
widgetData.id = id
|
||||
|
|
@ -180,7 +180,7 @@ module.exports.widgets = function(data,parent) {
|
|||
|
||||
widgetContainer[0].appendChild(widgetInner.widget[0])
|
||||
|
||||
WidgetManager.addWidget(widgetInner)
|
||||
widgetManager.addWidget(widgetInner)
|
||||
|
||||
// set widget's initial state
|
||||
if (widgetData.value !== '' && widgetInner.setValue) {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
var {getObjectData, updateDom} = require('./editor/data-workers'),
|
||||
{WidgetManager} = require('./managers')
|
||||
{widgetManager} = require('./managers')
|
||||
|
||||
var callbacks = {
|
||||
edit: function(args) {
|
||||
var [id, json] = args,
|
||||
newdata = JSON.parse(json),
|
||||
containers = WidgetManager.getWidgetById(id)
|
||||
containers = widgetManager.getWidgetById(id)
|
||||
|
||||
if (!containers.length) return
|
||||
for (var i=containers.length-1;i>=0;i--) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
var {mapToScale} = require('../utils'),
|
||||
_canvas_base = require('../common/_canvas_base'),
|
||||
{WidgetManager} = require('../../managers')
|
||||
{widgetManager} = require('../../managers')
|
||||
|
||||
var _plots_base = module.exports = function(){
|
||||
|
||||
|
|
@ -41,7 +41,7 @@ _plots_base.prototype.syncHandleProxy = function() {
|
|||
}
|
||||
|
||||
_plots_base.prototype.syncHandle = function(e) {
|
||||
if (this.linkedWidgets.indexOf(e.id)==-1 || !WidgetManager.getWidgetById(e.id).length) return
|
||||
if (this.linkedWidgets.indexOf(e.id)==-1 || !widgetManager.getWidgetById(e.id).length) return
|
||||
this.updateData()
|
||||
requestAnimationFrame(this.draw.bind(this))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
var {mapToScale, clip} = require('../utils'),
|
||||
_biquad_response = require('./_biquad_response'),
|
||||
_plots_base = require('./_plots_base'),
|
||||
{WidgetManager} = require('../../managers')
|
||||
{widgetManager} = require('../../managers')
|
||||
|
||||
module.exports.options = {
|
||||
type:'eq',
|
||||
|
|
@ -70,7 +70,7 @@ Eq.prototype.updateData = function(){
|
|||
filters[i] = {}
|
||||
|
||||
for (j in filter) {
|
||||
let widget = WidgetManager.getWidgetById(filter[j])
|
||||
let widget = widgetManager.getWidgetById(filter[j])
|
||||
|
||||
if (typeof filter[j]=='string' && widget.length) {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
var {mapToScale} = require('../utils'),
|
||||
_plots_base = require('./_plots_base'),
|
||||
{WidgetManager} = require('../../managers')
|
||||
{widgetManager} = require('../../managers')
|
||||
|
||||
module.exports.options = {
|
||||
type:'plot',
|
||||
|
|
@ -54,7 +54,7 @@ var Plot = module.exports.Plot = function(widgetData) {
|
|||
this.updateData = function(){
|
||||
var data = [],
|
||||
points = widgetData.points,
|
||||
widget = WidgetManager.getWidgetById(points)
|
||||
widget = widgetManager.getWidgetById(points)
|
||||
|
||||
if (typeof points=='string' && widget.length) {
|
||||
|
||||
|
|
@ -67,7 +67,7 @@ var Plot = module.exports.Plot = function(widgetData) {
|
|||
data[i] = []
|
||||
|
||||
for (k in [0,1]) {
|
||||
let widget = WidgetManager.getWidgetById(points[i][k])
|
||||
let widget = widgetManager.getWidgetById(points[i][k])
|
||||
if (typeof points[i][k] == 'string' && widget.length) {
|
||||
data[i][k] = widget[widget.length-1].getValue()
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
var {mapToScale, clip} = require('../utils'),
|
||||
_plots_base = require('./_plots_base'),
|
||||
{WidgetManager} = require('../../managers')
|
||||
{widgetManager} = require('../../managers')
|
||||
|
||||
|
||||
module.exports.options = {
|
||||
|
|
@ -52,7 +52,7 @@ Visualizer.prototype = Object.create(_plots_base.prototype)
|
|||
Visualizer.prototype.constructor = Visualizer
|
||||
|
||||
Visualizer.prototype.syncHandle = function(e) {
|
||||
if (this.widgetData.widgetId!=e.id || !WidgetManager.getWidgetById(e.id).length) return
|
||||
if (this.widgetData.widgetId!=e.id || !widgetManager.getWidgetById(e.id).length) return
|
||||
this.startLoop()
|
||||
}
|
||||
|
||||
|
|
@ -104,7 +104,7 @@ Visualizer.prototype.draw_data = function(){
|
|||
|
||||
Visualizer.prototype.updateData = function(){
|
||||
var id = this.widgetData.widgetId,
|
||||
widget = WidgetManager.getWidgetById(id)
|
||||
widget = widgetManager.getWidgetById(id)
|
||||
|
||||
if (typeof id == 'string' && widget.length) {
|
||||
var v = widget[widget.length-1].getValue()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue