Permalink
Browse files

Improve connection page

  • Loading branch information...
thedjpetersen committed Aug 24, 2012
1 parent 0eb6c4a commit 509ff4ff9ef2b6e02aaec9873a7050408a51aa65
Showing with 48 additions and 42 deletions.
  1. +5 −4 assets/css/subway.css
  2. +3 −3 assets/js/views/message.js
  3. +17 −14 assets/js/views/overview.js
  4. +23 −21 views/templates.jade
View
@@ -134,10 +134,6 @@ html { overflow: hidden; }
border-left: 5px solid #FA6900;
}
-#user-box div i{
- margin-right: 5px;
-}
-
#channels {
overflow: auto;
width: 100%;
@@ -294,6 +290,10 @@ html { overflow: hidden; }
font-size: 1.3em;
}
+.spacing-right {
+ margin-right: 5px;
+}
+
.message-box {
border-bottom: 1px solid #DDDDDD;
display: table;
@@ -447,3 +447,4 @@ html { overflow: hidden; }
margin-left: 5px;
color: #666666;
}
+
@@ -12,7 +12,7 @@ var MessageView = Backbone.View.extend({
if (_.include(['join', 'part', 'nick', 'topic', 'quit'], this.model.get('type')))
html = this.setText(this.model.get('type'));
// This handles whether to output a message or an action
- else if (this.model.get('text').substr(1, 6) === 'ACTION') {
+ else if (this.model.get('text') && this.model.get('text').substr(1, 6) === 'ACTION') {
html = ich.action({
user: nick,
content: this.model.get('text').substr(8),
@@ -54,7 +54,7 @@ var MessageView = Backbone.View.extend({
//Message resolving to undefined will include again later
//message: '(' + this.model.get('message') + ')'
});
- break
+ break;
case 'nick':
html = ich.nick({
oldNick: this.model.get('oldNick'),
@@ -66,6 +66,6 @@ var MessageView = Backbone.View.extend({
break;
}
return html;
- },
+ }
});
@@ -5,6 +5,7 @@ var OverviewView = Backbone.View.extend({
events: {
'click #connect-button': 'connect',
+ 'click #connect-more-options-button': 'more_options',
'click #login-button': 'login_register',
'click #register-button': 'login_register',
'keypress': 'connectOnEnter',
@@ -47,15 +48,15 @@ var OverviewView = Backbone.View.extend({
event.preventDefault();
$('.error').removeClass('error');
- var server = $('#connect-server').val();
- var nick = $('#connect-nick').val();
- var port = $('#connect-port').val();
- var away = $('#connect-away').val();
- var realName = $('#connect-realName').val();
- var secure = $('#connect-secure').is(':checked');
- var selfSigned = $('#connect-selfSigned').is(':checked');
- var rejoin = $('#connect-rejoin').is(':checked');
- var password = $('#connect-password').val();
+ var server = $('#connect-server').val(),
+ nick = $('#connect-nick').val(),
+ port = $('#connect-port').val(),
+ away = $('#connect-away').val(),
+ realName = $('#connect-realName').val() || nick,
+ secure = $('#connect-secure').is(':checked'),
+ selfSigned = $('#connect-selfSigned').is(':checked'),
+ rejoin = $('#connect-rejoin').is(':checked'),
+ password = $('#connect-password').val();
if (!server) {
$('#connect-server').closest('.clearfix').addClass('error');
@@ -74,7 +75,7 @@ var OverviewView = Backbone.View.extend({
var connectInfo = {
nick: nick,
server: server,
- port: port,
+ port: port,
secure: secure,
selfSigned: selfSigned,
rejoin: rejoin,
@@ -89,6 +90,10 @@ var OverviewView = Backbone.View.extend({
}
},
+ more_options: function() {
+ this.$el.find('.connect-more-options').toggleClass('hide');
+ },
+
login_register: function(event) {
var action = event.target.innerHTML.toLowerCase() || event.action.toLowerCase();
event.preventDefault();
@@ -119,10 +124,8 @@ var OverviewView = Backbone.View.extend({
},
toggle_ssl_options: function(event) {
- var port = $('#connect-secure').is(':checked') ? 6697 : 6667
- $('#connect-port').attr('placeholder', port)
+ var port = $('#connect-secure').is(':checked') ? 6697 : 6667 ;
+ $('#connect-port').attr('placeholder', port);
$('#ssl-self-signed').toggle();
}
-
-
});
View
@@ -34,34 +34,36 @@ script(id="overview_connection", type="text/html")
#home_parent
a.overview_button#home Home
form.form-inline
- .control-group
- label(for="connect-server") Server
- input#connect-server(type="text")
- .control-group
- label(for="connect-port") Port
- input#connect-port.input-small(type="text", placeholder="6667")
- .control-group
- label(for="connect-secure") SSL
- input#connect-secure(type="checkbox")
- .control-group#ssl-self-signed
- label(for="connect-selfSigned") Self-signed SSL Cert
- input#connect-selfSigned(type="checkbox")
.control-group
label(for="connect-nick") Nick
input#connect-nick(type="text")
+ .control-group
+ label(for="connect-server") Server
+ input#connect-server(type="text")
.control-group
label(for="connect-password") Password (optional)
input#connect-password(type="password")
.control-group
label(for="connect-realName") Real Name
input#connect-realName(type="text")
- .control-group
- label(for="connect-away") Away Message
- input#connect-away(type="text", placeholder="AFK")
- .control-group
- label(for="connect-rejoin") Bouncer Mode
- input#connect-rejoin(type="checkbox")
- a(id="connect-button", class="btn btn-primary", type="button") Connect
+ .connect-more-options.hide
+ .control-group
+ label(for="connect-port") Port
+ input#connect-port.input-small(type="text", placeholder="6667")
+ .control-group
+ label(for="connect-secure") SSL
+ input#connect-secure(type="checkbox")
+ .control-group#ssl-self-signed
+ label(for="connect-selfSigned") Self-signed SSL Cert
+ input#connect-selfSigned(type="checkbox")
+ .control-group
+ label(for="connect-away") Away Message
+ input#connect-away(type="text", placeholder="AFK")
+ .control-group
+ label(for="connect-rejoin") Bouncer Mode
+ input#connect-rejoin(type="checkbox")
+ a(id="connect-button", class="btn btn-primary spacing-right", type="button") Connect
+ a(id="connect-more-options-button", class="btn", type="button") More Options
script(id="overview_settings", type="text/html")
#home_parent
@@ -122,10 +124,10 @@ script(id="channel", type="text/html")
script(id="user_box", type="text/html")
div
- i(class="icon-user icon-white")
+ i(class="icon-user icon-white spacing-right")
{{nick}}
div
- i(class="icon-asterisk icon-white")
+ i(class="icon-asterisk icon-white spacing-right")
{{server}}
script(id="userlist_user", type="text/html")

0 comments on commit 509ff4f

Please sign in to comment.