#kiwi .server_select .basic { border-bottom: 1px solid gray; margin-bottom:1em; }
#kiwi .server_select .basic .show_more { }
#kiwi .server_select .basic tr.pass { display:none; }
+#kiwi .server_select .basic tr.key { display:none; }
#kiwi .server_select.single_server .basic { border:none; }
#kiwi .server_select .status { }
#kiwi.theme_relaxed .server_select .basic input { width:170px; }
#kiwi.theme_relaxed .server_select .basic label { font-size:1.3em; margin-top:4px; }
#kiwi.theme_relaxed .server_select .basic tr.have_pass { font-size:0.8em; }
+#kiwi.theme_relaxed .server_select .basic tr.have_key { font-size:0.8em; }
#kiwi.theme_relaxed .server_select .basic tr.channel td { padding-top:1em; }
#kiwi.theme_relaxed .server_select .basic { border-bottom: 1px dashed gray; margin-bottom:1em; }
#kiwi.theme_relaxed .server_select .basic .show_more { display: block; width:110px; margin:10px 0 0 0; font-size:0.8em; background: url(../img/more.png) no-repeat right 7px; }
#kiwi.theme_mini .server_select .basic table tr.channel,
#kiwi.theme_mini .server_select .basic table tr.pass,
#kiwi.theme_mini .server_select .basic table tr.have_pass { display:none; }
+#kiwi.theme_mini .server_select .basic table tr.key,
+#kiwi.theme_mini .server_select .basic table tr.have_key { display:none; }
#kiwi.theme_mini .server_select .basic .show_more { display:none !important; }
#kiwi.theme_mini .server_select.single_server .basic { border:none; }
#kiwi.theme_mini .server_select .status { text-align: center; font-weight: bold; padding:1em; }
\r
<tr class="channel">\r
<td><label for="server_select_channel">Channel</label></td>\r
- <td><input type="text" class="channel" id="server_select_channel"><input type="hidden" class="channel_key"></td>\r
+ <td><input type="text" class="channel" id="server_select_channel"></td>\r
+ </tr>\r
+\r
+ <tr class="have_key">\r
+ <td colspan="2">\r
+ <label for="server_select_show_channel_key">Channel requires a key</label> <input type="checkbox" id="server_select_show_channel_key" style="width:auto;" />\r
+ </td>\r
+ </tr>\r
+\r
+ <tr class="key">\r
+ <td><label for="server_select_channel_key">Key</label></td>\r
+ <td><input type="text" class="channel_key" id="server_select_channel_key"></td>\r
</tr>\r
\r
<tr class="start">\r
events: {\r
'submit form': 'submitForm',\r
'click .show_more': 'showMore',\r
- 'change .have_pass input': 'showPass'\r
+ 'change .have_pass input': 'showPass',\r
+ 'change .have_key input': 'showKey'\r
},\r
\r
initialize: function () {\r
}\r
},\r
\r
+ showKey: function (event) {\r
+ if (this.$el.find('tr.have_key input').is(':checked')) {\r
+ this.$el.find('tr.key').show().find('input').focus();\r
+ } else {\r
+ this.$el.find('tr.key').hide().find('input').val('');\r
+ }\r
+ },\r
+\r
showMore: function (event) {\r
$('.more', this.$el).slideDown('fast');\r
$('input.server', this.$el).select();\r
$('input.server', this.$el).val(server);\r
$('input.port', this.$el).val(port);\r
$('input.ssl', this.$el).prop('checked', ssl);\r
+ $('input#server_select_show_pass', this.$el).prop('checked', !(!password));\r
$('input.password', this.$el).val(password);\r
+ if (!(!password)) {\r
+ $('tr.pass', this.$el).show();\r
+ }\r
$('input.channel', this.$el).val(channel);\r
+ $('input#server_select_show_channel_key', this.$el).prop('checked', !(!channel_key));\r
$('input.channel_key', this.$el).val(channel_key);\r
+ if (!(!channel_key)) {\r
+ $('tr.key', this.$el).show();\r
+ }\r
},\r
\r
hide: function () {\r