-webkit-border-radius:5px;
-khtml-border-radius:5px;
}
-#controlbox .input .nick { text-align: right; width:11em; left:0px; position:absolute; padding:2px; }
+#controlbox .input .nick { text-align: right; width:11em; left:0px; position:absolute; padding:2px; cursor: pointer; }
#controlbox .input .nick a { text-decoration:none; color:black; }
#controlbox .input .input_wrap {
position:absolute;
#controlbox .nickchange {
position: absolute;
left: 0px;
+ background: #1B1B1B; color:#eeeeee;
+ padding:10px;
}
+#controlbox .nickchange input { padding:0.3em 0.5em; }
+#controlbox .nickchange button { padding:0.5em; }
\r
kiwi.view.NickChangeBox = Backbone.View.extend({\r
events: {\r
- 'click .btn_nickchange': 'changeNick'\r
+ 'submit': 'changeNick',\r
+ 'click .cancel': 'close'\r
},\r
\r
initialize: function () {\r
},\r
\r
render: function () {\r
- $('#controlbox').prepend(this.$el);\r
- this.$el.css('bottom', $('#controlbox').height());\r
+ // Add the UI component and give it focus\r
+ kiwi.app.controlbox.$el.prepend(this.$el);\r
+ this.$el.find('input').focus();\r
+\r
+ this.$el.css('bottom', kiwi.app.controlbox.$el.outerHeight(true));\r
},\r
\r
- changeNick: function (event) {;\r
- var el = this.$el;\r
- kiwi.gateway.changeNick($('#nickchange', this.$el).val(), function (err, val) {\r
- el.remove();\r
+ close: function () {\r
+ this.$el.remove();\r
+\r
+ },\r
+\r
+ changeNick: function (event) {\r
+ var that = this;\r
+ kiwi.gateway.changeNick(this.$el.find('input').val(), function (err, val) {\r
+ that.close();\r
});\r
+ return false;\r
}\r
});\r
\r
}\r
\r
// Only 'upgrade' the alert. Never down (unless clearing)\r
- console.log(type_idx, this.alert_level);\r
if (type_idx !== 0 && type_idx <= this.alert_level) {\r
return;\r
}\r
preprocessor: null,\r
\r
events: {\r
- 'keydown input': 'process',\r
+ 'keydown input.inp': 'process',\r
'click .nick': 'showNickChange'\r
},\r
\r
</script>
<script type="text/x-jquery-tmpl" id="tmpl_nickchange">
- <div class="nickchange">
- <label for="nickchange">New nick:</label> <input id="nickchange" type="text" mozactionhint="done" autocomplete="off" spellcheck="false"/> <input type="button" class="btn_nickchange" value="Change Nick" />
- </div>
+ <form class="nickchange">
+ <label for="nickchange">New nick:</label> <input type="text" mozactionhint="done" autocomplete="off" spellcheck="false"/> <button>Change</button> <a class="cancel">Cancel</a>
+ </form>
</script>
<script type="text/x-jquery-tmpl" id="tmpl_server_select">