|
@ -90,6 +90,7 @@ Ext.ux.MumbleChannelViewer = function( config ){ |
|
|
title: gettext("Channel Viewer"), |
|
|
title: gettext("Channel Viewer"), |
|
|
refreshInterval: 30000, |
|
|
refreshInterval: 30000, |
|
|
idleInterval: 2, |
|
|
idleInterval: 2, |
|
|
|
|
|
usersAboveChannels: false, |
|
|
autoScroll: true, |
|
|
autoScroll: true, |
|
|
enableDD: false, // Users need to enable this explicitly
|
|
|
enableDD: false, // Users need to enable this explicitly
|
|
|
root: { |
|
|
root: { |
|
@ -200,6 +201,7 @@ Ext.extend( Ext.ux.MumbleChannelViewer, Ext.tree.TreePanel, { |
|
|
tree = this; |
|
|
tree = this; |
|
|
function populateNode( node, json ){ |
|
|
function populateNode( node, json ){ |
|
|
var subchan_users = 0; |
|
|
var subchan_users = 0; |
|
|
|
|
|
var popChannels = function(){ |
|
|
json.channels.sort(cmp_channels); |
|
|
json.channels.sort(cmp_channels); |
|
|
for( var i = 0; i < json.channels.length; i++ ){ |
|
|
for( var i = 0; i < json.channels.length; i++ ){ |
|
|
var child = { |
|
|
var child = { |
|
@ -218,6 +220,8 @@ Ext.extend( Ext.ux.MumbleChannelViewer, Ext.tree.TreePanel, { |
|
|
node.children.push( child ); |
|
|
node.children.push( child ); |
|
|
subchan_users += populateNode( child, json.channels[i] ); |
|
|
subchan_users += populateNode( child, json.channels[i] ); |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
var popUsers = function(){ |
|
|
json.users.sort(cmp_names); |
|
|
json.users.sort(cmp_names); |
|
|
for( var i = 0; i < json.users.length; i++ ){ |
|
|
for( var i = 0; i < json.users.length; i++ ){ |
|
|
var child = { |
|
|
var child = { |
|
@ -238,6 +242,15 @@ Ext.extend( Ext.ux.MumbleChannelViewer, Ext.tree.TreePanel, { |
|
|
node.leaf = false; |
|
|
node.leaf = false; |
|
|
node.children.push( child ); |
|
|
node.children.push( child ); |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if( tree.usersAboveChannels ){ |
|
|
|
|
|
popUsers(); |
|
|
|
|
|
popChannels(); |
|
|
|
|
|
} |
|
|
|
|
|
else{ |
|
|
|
|
|
popChannels(); |
|
|
|
|
|
popUsers(); |
|
|
|
|
|
} |
|
|
if( json.id == 0 || json.users.length > 0 || subchan_users ) |
|
|
if( json.id == 0 || json.users.length > 0 || subchan_users ) |
|
|
node.expanded = true; |
|
|
node.expanded = true; |
|
|
return subchan_users + json.users.length; |
|
|
return subchan_users + json.users.length; |
|
|