<script type="text/x-jquery-tmpl" id="tmpl_server_select">
<div class="server_select">
+ <div class="status"></div>
+
<form>
<div class="basic">
<label for="server_select_nick">Nickname</label>
<input type="text" class="nick" id="server_select_nick"> <br />
- <button type="submit">Connect..</button>
+ <button type="submit">Connect..</button> <br />
<a class="show_more">More</a>
</div>
//this.addMsg(' ', '--> Kiwi IRC: Such an awesome IRC client', '', {style: 'color:#009900;'});\r
\r
this.server_login = new kiwi.view.ServerSelect();\r
+ \r
this.view.$el.append(this.server_login.$el);\r
+ this.server_login.show();\r
}\r
});\r
\r
\r
kiwi.gateway.set('nick', event.nick);\r
kiwi.gateway.connect(event.server, 6667, false, false, function () {\r
- console.log('gateway connected');\r
that.view.barsShow();\r
- form.hide();\r
});\r
});\r
\r
// Populate the server select box with defaults\r
this.panels.server.server_login.populateFields({\r
'nick': getQueryVariable('nick') || 'kiwi_' + Math.ceil(Math.random() * 10000).toString(),\r
- 'server': getQueryVariable('server') || 'irc.anonnet.org',\r
+ 'server': getQueryVariable('server') || 'irc.kiwiirc.net',\r
'channel': window.location.hash || '#test'\r
});\r
};\r
this.socket.on('connecting', function (transport_type) {\r
console.log("kiwi.gateway.socket.on('connecting')");\r
this.emit("connecting");\r
+ that.trigger("connecting");\r
});\r
\r
this.socket.on('connect', function () {\r
* Parses the response from the server\r
*/\r
this.parse = function (item) {\r
- console.log('gateway event', item);\r
+ //console.log('gateway event', item);\r
if (item.event !== undefined) {\r
that.trigger('on' + item.event, item);\r
\r
-.server_select { width:300px; margin: 2em auto; }
+.server_select { width:270px; padding:3em 0 2em 0; margin: 0 auto; }
.server_select .more { display: none; }
-.server_select button { padding:3px 7px; margin-left: 178px; }
-.server_select input { margin-bottom:5px; padding:3px 7px; }
-.server_select label { width:5em; float:left; margin-right:1em; }
-.server_select .basic .show_more { display: block; border-bottom: 1px dashed gray; margin:10px 0; }
\ No newline at end of file
+.server_select button { float:right; padding:3px 7px; }
+.server_select input { float:right; margin-bottom:5px; padding:3px 7px; }
+.server_select label { float:left; width:5em; padding-top:3px }
+.server_select br { clear:both; }
+.server_select .basic .show_more { display: block; border-bottom: 1px dashed gray; margin:10px 0; font-size:0.8em; }
+.server_select .status { text-align: center; font-weight: bold; padding:1em; }
+.server_select .status .ok {
+ border:1px solid #A33F3F; background-color:#D28A8A;
+ padding:0.5em; margin-top:1em; margin-bottom:1em; margin-right:2em;
+}
\ No newline at end of file
that = this;\r
\r
this.$el = $($('#tmpl_server_select').html());\r
+\r
+ kiwi.gateway.on('onconnect', this.networkConnected);\r
+ kiwi.gateway.on('connecting', this.networkConnecting);\r
},\r
\r
submitLogin: function (event) {\r
},\r
\r
show: function () {\r
- this.$el.slideDown();\r
+ this.$el.show();\r
+ $('.nick', that.$el).focus();\r
+ },\r
+\r
+ setStatus: function (text, class_name) {\r
+ $('.status', this.$el)\r
+ .text(text)\r
+ .attr('class', 'status')\r
+ .addClass(class_name)\r
+ .show();\r
+ },\r
+ clearStatus: function () {\r
+ $('.status', this.$el).hide();\r
+ },\r
+\r
+ networkConnected: function (event) {\r
+ that.setStatus('Connected :)', 'ok');\r
+ $('form', this.$el).hide();\r
+ },\r
+\r
+ networkConnecting: function (event) {\r
+ that.setStatus('Connecting..', 'ok');\r
}\r
});\r
\r
var members = this.model.get("members");\r
if (members) {\r
members.view.show();\r
+ this.$container.parent().css('right', '200px');\r
} else {\r
// Memberlist not found for this panel, hide any active ones\r
$('#memberlists').children().removeClass('active');\r
+ this.$container.parent().css('right', '0');\r
}\r
\r
// TODO: Why is kiwi.app not defined when this is fist called :/\r
$('#toolbar').slideUp();\r
$('#controlbox').slideUp(function () { that.doLayout(); });\r
} else {\r
- $('#toolbar').hide();\r
- $('#controlbox').hide();\r
+ $('#toolbar').slideUp(0);\r
+ $('#controlbox').slideUp(0);\r
}\r
},\r
\r
$('#toolbar').slideDown();\r
$('#controlbox').slideDown(function () { that.doLayout(); });\r
} else {\r
- $('#toolbar').hide();\r
- $('#controlbox').hide();\r
+ $('#toolbar').slideDown(0);\r
+ $('#controlbox').slideDown(0);\r
this.doLayout();\r
}\r
}\r