__dirname + '/model_memberlist.js',\r
__dirname + '/model_panel.js',\r
__dirname + '/model_panellist.js',\r
+ __dirname + '/model_networkpanellist.js',\r
__dirname + '/model_query.js',\r
__dirname + '/model_channel.js',\r
__dirname + '/model_server.js',\r
</ul>\r
</div>\r
\r
- <div id="tabs">\r
- <ul class="panellist channels"></ul>\r
- <ul class="panellist applets"></ul>\r
- </div>\r
+ <div id="tabs"></div>\r
\r
<div id="topic">\r
<div contenteditable="true"></div>\r
],\r
[\r
'dev/model_panellist.js',\r
+ 'dev/model_networkpanellist.js',\r
'dev/model_panel.js',\r
'dev/model_member.js',\r
'dev/model_memberlist.js'\r
--- /dev/null
+_kiwi.model.NetworkPanelList = Backbone.Collection.extend({
+ model: _kiwi.model.Network,
+
+ initialize: function() {
+ this.view = new _kiwi.view.NetworkTabs({model: this});
+
+ this.on('add', this.onNetworkAdd, this);
+ this.on('remove', this.onNetworkRemove, this);
+
+ // Current active connection / panel
+ this.active_connection = undefined;
+ this.active_panel = undefined;
+
+ // TODO: Remove this - legacy
+ this.active = undefined;
+ },
+
+ getByConnectionId: function(id) {
+ return this.find(function(connection){
+ return connection.get('connection_id') == id;
+ });
+ },
+
+ panels: function() {
+ var panels = [];
+
+ this.each(function(network) {
+ panels = panels.concat(network.panels.models);
+ });
+
+ return panels;
+ },
+
+
+ onNetworkAdd: function(network) {
+ network.panels.on('active', this.onPanelActive, this);
+
+ // if it's our first connection, set it active
+ if (this.models.length === 1) {
+ this.active_connection = network;
+ this.active_panel = network.panels.server;
+
+ // TODO: Remove this - legacy
+ this.active = this.active_panel;
+ }
+ },
+
+ onNetworkRemove: function(network) {
+ network.panels.off('active', this.onPanelActive, this);
+ },
+
+ onPanelActive: function(panel) {
+ var connection = this.getByConnectionId(panel.tab.data('connection_id'));
+ this.trigger('active', panel, connection);
+
+ this.active_connection = connection;
+ this.active_panel = panel;
+
+ // TODO: Remove this - legacy
+ this.active = panel;
+ }
+});
\ No newline at end of file
});\r
}\r
});\r
-\r
-\r
-\r
-_kiwi.model.NetworkPanelList = Backbone.Collection.extend({\r
- model: _kiwi.model.Network,\r
-\r
- initialize: function() {\r
- this.view = new _kiwi.view.NetworkTabs({model: this});\r
- \r
- this.on('add', this.onNetworkAdd, this);\r
- this.on('remove', this.onNetworkRemove, this);\r
-\r
- // Current active connection / panel\r
- this.active_connection = undefined;\r
- this.active_panel = undefined;\r
-\r
- // TODO: Remove this - legacy\r
- this.active = undefined;\r
- },\r
-\r
- getByConnectionId: function(id) {\r
- return this.find(function(connection){\r
- return connection.get('connection_id') == id;\r
- });\r
- },\r
-\r
- panels: function() {\r
- var panels = [];\r
-\r
- this.each(function(network) {\r
- panels = panels.concat(network.panels.models);\r
- });\r
-\r
- return panels;\r
- },\r
-\r
-\r
- onNetworkAdd: function(network) {\r
- network.panels.on('active', this.onPanelActive, this);\r
-\r
- // if it's our first connection, set it active\r
- if (this.models.length === 1) {\r
- this.active_connection = network;\r
- this.active_panel = network.panels.server;\r
-\r
- // TODO: Remove this - legacy\r
- this.active = this.active_panel;\r
- }\r
- },\r
-\r
- onNetworkRemove: function(network) {\r
- network.panels.off('active', this.onPanelActive, this);\r
- },\r
-\r
- onPanelActive: function(panel) {\r
- var connection = this.getByConnectionId(panel.tab.data('connection_id'));\r
- this.trigger('active', panel, connection);\r
-\r
- this.active_connection = connection;\r
- this.active_panel = panel;\r
-\r
- // TODO: Remove this - legacy\r
- this.active = panel;\r
- }\r
-});
\ No newline at end of file