Add option to enter channel key on server selection screen
authorJack Allnutt <m2ys4u@gmail.com>
Thu, 9 May 2013 15:00:21 +0000 (16:00 +0100)
committerJack Allnutt <m2ys4u@gmail.com>
Thu, 9 May 2013 15:00:21 +0000 (16:00 +0100)
client/assets/css/style.css
client/assets/dev/index.html.tmpl
client/assets/dev/view.js

index e48a7c8cfaf46db61e20dbc14db6d1df5ab69242..cd565557665173dcee24ad4fce4b6d2a4c761877 100644 (file)
@@ -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; }
index bff13ff8d2852df246cb5f5f80781ab0c72fa408..66eba8e9f76903c580c5cfcd86a95b6c9ec6919d 100644 (file)
 \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
index 7f916a86f937df2f13c905501daa48e7aa5b649b..e6e5c8d15ab7e991b31e560f5d19dad041e939b7 100644 (file)
@@ -169,7 +169,8 @@ _kiwi.view.ServerSelect = function () {
         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
@@ -255,6 +256,14 @@ _kiwi.view.ServerSelect = function () {
             }\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
@@ -277,9 +286,17 @@ _kiwi.view.ServerSelect = function () {
             $('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