overflow: hidden;
display:block;
}
-#kiwi #toolbar .panellist li {
+#kiwi #toolbar .panellist .connection li {
float: left; list-style: inline;
display:inline; position:relative;
padding:5px; margin:3px;
#kiwi #toolbar .panellist .alert_activity { font-weight: bold; }
#kiwi #toolbar .panellist .alert_action { font-weight: bold; }
-#kiwi #toolbar .panellist li .part { position: absolute; top: 5px; right: 5px; }
-#kiwi #toolbar .panellist li .part:before { content:"[x]"; }
-#kiwi #toolbar .panellist li .part:hover { color: #900; }
-#kiwi #toolbar .panellist li img.icon { left:5px; top:2px; height:auto; width:auto; }
+#kiwi #toolbar .panellist .connection { display: inline; }
+#kiwi #toolbar .panellist .connection li .part { position: absolute; top: 5px; right: 5px; }
+#kiwi #toolbar .panellist .connection li .part:before { content:"[x]"; }
+#kiwi #toolbar .panellist .connection li .part:hover { color: #900; }
+#kiwi #toolbar .panellist .connection li img.icon { left:5px; top:2px; height:auto; width:auto; }
#kiwi #status_message {
background: #FFF;
#kiwi.theme_relaxed #memberlists_resize_handle {
/*background:url('../img/resize_handle.png') no-repeat; background-position:center;*/
}
-#kiwi.theme_relaxed #toolbar .panellist li {
+#kiwi.theme_relaxed #toolbar .panellist .connection li {
line-height: 1.4em;
vertical-align: middle;
- border-radius:5px;
-moz-border-radius:5px;
-webkit-border-radius:5px;
-khtml-border-radius:5px;
+ border-radius:5px;
behavior: url(border-radius.htc);
background-image: -webkit-gradient(
background-color: #eee;
}
-#kiwi.theme_relaxed #toolbar .panellist .alert_highlight { /*background: #990000;*/ }
-#kiwi.theme_relaxed #toolbar .panellist .alert_activity { font-weight:normal; }
-#kiwi.theme_relaxed #toolbar .panellist .alert_action { font-weight:normal; }
+#kiwi.theme_relaxed #toolbar .panellist .connection .alert_highlight { /*background: #990000;*/ }
+#kiwi.theme_relaxed #toolbar .panellist .connection .alert_activity { font-weight:normal; }
+#kiwi.theme_relaxed #toolbar .panellist .connection .alert_action { font-weight:normal; }
-#kiwi.theme_relaxed #toolbar .panellist .active { padding-right:23px; }
-#kiwi.theme_relaxed #toolbar .panellist li .part:before { content:"\f00d"; }
+#kiwi.theme_relaxed #toolbar .panellist .connection .active { padding-right:23px; }
+#kiwi.theme_relaxed #toolbar .panellist .connection li .part:before { content:"\f00d"; }
-#kiwi.theme_relaxed #toolbar .panellist li.server span { padding-left: 5px; }
-#kiwi.theme_relaxed.connected #toolbar .panellist li.server:before { content: "\f0ec"; color:#3F9532; }
+#kiwi.theme_relaxed #toolbar .panellist .connection li.server span { padding-left: 5px; }
+#kiwi.theme_relaxed.connected #toolbar .panellist .connection li.server:before { content: "\f0ec"; color:#3F9532; }
#kiwi.theme_relaxed #toolbar .panellist li.server:before { content: "\f06a"; color:#900; font-size:1.5em; line-height:1em; vertical-align:middle; }
/* Tab texts are within a span */
-#kiwi.theme_relaxed #toolbar .panellist li span { line-height:20px; vertical-align:middle; display:inline-block; }
+#kiwi.theme_relaxed #toolbar .panellist .connection li span { line-height:20px; vertical-align:middle; display:inline-block; }
-#kiwi.theme_relaxed #toolbar .panellist li.active .activity { display:none; }
-#kiwi.theme_relaxed #toolbar .panellist li .activity.zero { visibility:hidden; }
-#kiwi.theme_relaxed #toolbar .panellist li .activity {
+#kiwi.theme_relaxed #toolbar .panellist .connection li.active .activity { display:none; }
+#kiwi.theme_relaxed #toolbar .panellist .connection li .activity.zero { visibility:hidden; }
+#kiwi.theme_relaxed #toolbar .panellist .connection li .activity {
padding: 1px 3px; margin-left:1em;
border-radius: 4px;
background: #3F9532; color:#000; /*color: #ff5300;*/
display:inline-block;
width:2em;
}
-#kiwi.theme_relaxed #toolbar .panellist li.alert_highlight .activity {
+#kiwi.theme_relaxed #toolbar .panellist .connection li.alert_highlight .activity {
color: #fff; background: #a60400;
}
_.each(this.connections.models, function(connection) {\r
_.each(connection.panels.model, fn);\r
});\r
- }\r
+ };\r
\r
};\r
\r
\r
this.socket.emit('kiwi', {command: 'connect', nick: h.nick, hostname: h.host, port: h.port, ssl: h.ssl, password: h.password}, function (err, server_num) {\r
if (!err) {\r
- that.server_num = server_num;\r
-\r
// TODO: Remove this whole premature connection thing when panel code is tidied\r
if (server_num != 0 && !_kiwi.app.connections.getByConnectionId(server_num)){\r
_kiwi.app.connections.add(new _kiwi.model.Network({connection_id: server_num}));\r
}\r
\r
console.log("_kiwi.gateway.socket.on('connect')");\r
+ callback_fn && callback_fn(err);\r
+ \r
} else {\r
console.log("_kiwi.gateway.socket.on('error')", {reason: err});\r
callback_fn && callback_fn(err);\r
this.gateway = _kiwi.global.components.Network(this.get('connection_id'));
this.bindGatewayEvents();
+ // Create our panel list (tabs)
this.panels = new _kiwi.model.PanelList([], this);
- this.panels.network = this;
+ //this.panels.network = this;
// Automatically create a server tab
var server_panel = new _kiwi.model.Server({name: 'Server'});
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
if (typeof topic !== 'string' || !topic) {\r
topic = this.model.get("topic");\r
}\r
- \r
+\r
this.model.addMsg('', '== Topic for ' + this.model.get('name') + ' is: ' + topic, 'topic');\r
\r
// If this is the active channel then update the topic bar\r
}\r
});\r
\r
+\r
+\r
+// Model for this = _kiwi.model.NetworkPanelList\r
+_kiwi.view.NetworkTabs = Backbone.View.extend({\r
+ tagName: 'ul',\r
+ className: 'panellist channels',\r
+\r
+ initialize: function() {\r
+ this.model.on('add', this.networkAdded, this);\r
+ this.model.on('remove', this.networkRemoved, this);\r
+\r
+ this.$el.appendTo($('#kiwi #tabs'));\r
+ },\r
+\r
+ networkAdded: function(network) {\r
+ $('<li class="connection"></li>')\r
+ .append(network.panels.view.$el)\r
+ .appendTo(this.$el);\r
+ },\r
+\r
+ networkRemoved: function(network) {\r
+ network.panels.view.remove();\r
+\r
+ _kiwi.app.view.doLayout();\r
+ }\r
+});\r
+\r
+\r
+\r
// Model for this = _kiwi.model.PanelList\r
_kiwi.view.Tabs = Backbone.View.extend({\r
tagName: 'ul',\r
this.model.network.on('change:name', function (network, new_val) {\r
$('span', this.model.server.tab).text(new_val);\r
}, this);\r
-\r
- this.$tab_container = $('#kiwi .panellist.channels');\r
- this.$tab_container.append(this.$el);\r
},\r
\r
render: function () {\r
panelActive: function (panel, previously_active_panel) {\r
// Remove any existing tabs or part images\r
$('.part', this.$el).remove();\r
- this.$tab_container.find('.active').removeClass('active');\r
+ this.$el.parent().find('.active').removeClass('active');\r
\r
panel.tab.addClass('active');\r
\r
\r
tabClick: function (e) {\r
var tab = $(e.currentTarget);\r
- \r
+\r
var panel = tab.data('panel');\r
if (!panel) {\r
// A panel wasn't found for this tab... wadda fuck\r