From 9f67f0f2148a6c5f8f1ff473dfa94fcf712d5290 Mon Sep 17 00:00:00 2001 From: Jack Allnutt Date: Thu, 9 May 2013 16:00:21 +0100 Subject: [PATCH] Add option to enter channel key on server selection screen --- client/assets/css/style.css | 4 ++++ client/assets/dev/index.html.tmpl | 13 ++++++++++++- client/assets/dev/view.js | 19 ++++++++++++++++++- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/client/assets/css/style.css b/client/assets/css/style.css index e48a7c8..cd56555 100644 --- a/client/assets/css/style.css +++ b/client/assets/css/style.css @@ -170,6 +170,7 @@ html, body { height:100%; } #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 { } @@ -569,6 +570,7 @@ html, body { height:100%; } #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; } @@ -842,6 +844,8 @@ html, body { height:100%; } #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; } diff --git a/client/assets/dev/index.html.tmpl b/client/assets/dev/index.html.tmpl index bff13ff..66eba8e 100644 --- a/client/assets/dev/index.html.tmpl +++ b/client/assets/dev/index.html.tmpl @@ -107,7 +107,18 @@ - + + + + + + + + + + + + diff --git a/client/assets/dev/view.js b/client/assets/dev/view.js index 7f916a8..e6e5c8d 100644 --- a/client/assets/dev/view.js +++ b/client/assets/dev/view.js @@ -169,7 +169,8 @@ _kiwi.view.ServerSelect = function () { events: { 'submit form': 'submitForm', 'click .show_more': 'showMore', - 'change .have_pass input': 'showPass' + 'change .have_pass input': 'showPass', + 'change .have_key input': 'showKey' }, initialize: function () { @@ -255,6 +256,14 @@ _kiwi.view.ServerSelect = function () { } }, + showKey: function (event) { + if (this.$el.find('tr.have_key input').is(':checked')) { + this.$el.find('tr.key').show().find('input').focus(); + } else { + this.$el.find('tr.key').hide().find('input').val(''); + } + }, + showMore: function (event) { $('.more', this.$el).slideDown('fast'); $('input.server', this.$el).select(); @@ -277,9 +286,17 @@ _kiwi.view.ServerSelect = function () { $('input.server', this.$el).val(server); $('input.port', this.$el).val(port); $('input.ssl', this.$el).prop('checked', ssl); + $('input#server_select_show_pass', this.$el).prop('checked', !(!password)); $('input.password', this.$el).val(password); + if (!(!password)) { + $('tr.pass', this.$el).show(); + } $('input.channel', this.$el).val(channel); + $('input#server_select_show_channel_key', this.$el).prop('checked', !(!channel_key)); $('input.channel_key', this.$el).val(channel_key); + if (!(!channel_key)) { + $('tr.key', this.$el).show(); + } }, hide: function () { -- 2.25.1