Created
February 23, 2011 17:52
-
-
Save tim-evans/840811 to your computer and use it in GitHub Desktop.
Login pane
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ========================================================================== | |
// Project: MO - loginPage | |
// Copyright: ©2010 Junction Networks | |
// ========================================================================== | |
/*globals MO */ | |
// This page describes the main user interface for your application. | |
MO.loginPane = SC.Pane.create({ | |
layout: { top: 0, bottom: 0, left: 0, right: 0 }, | |
childViews: 'contentView'.w(), | |
defaultResponder: 'MO.loginController', | |
contentView: SC.View.extend({ | |
layout: { width: 400, height: 150, centerX: 0, centerY: 0 }, | |
childViews: 'sipAddress password statusLabel loginButton'.w(), | |
sipAddress: SC.View.design({ | |
layout: { top: 30, height: 24 }, | |
childViews: 'label field'.w(), | |
label: SC.LabelView.design({ | |
layout: { top: 0, width: 100 }, | |
textAlign: SC.ALIGN_RIGHT, | |
value: '_sip_address_label'.loc() | |
}), | |
field: SC.TextFieldView.design({ | |
layout: { top: 0, left: 125, width: 250, height: 24 }, | |
spellCheckEnabled: NO, | |
valueBinding: 'MO.loginController.username' | |
}) | |
}), | |
password: SC.View.design({ | |
layout: { top: 60, height: 24 }, | |
childViews: 'label field'.w(), | |
label: SC.LabelView.design({ | |
layout: { top: 0, width: 100 }, | |
textAlign: SC.ALIGN_RIGHT, | |
value: '_password_label'.loc() | |
}), | |
field: SC.TextFieldView.design({ | |
layout: { top: 0, left: 125, width: 250, height: 24 }, | |
isPassword: YES, | |
spellCheckEnabled: NO, | |
valueBinding: 'MO.loginController.password' | |
}) | |
}), | |
statusLabel: SC.LabelView.design({ | |
layout: { bottom: 20, left: 25, width: 24, height: 24 }, | |
textAlign: SC.ALIGN_LEFT, | |
valueBinding: SC.Binding.oneWay('MO.loginController.content.connectionStatus') | |
}), | |
loginButton: SC.ButtonView.design({ | |
layout: { bottom: 20, right: 25, width: 80, height: 24 }, | |
title: "_login".loc(), | |
titleMinWidth: 0, | |
buttonBehavior: SC.PUSH_BEHAVIOR, | |
isDefault: YES, | |
isEnabled: SC.Binding.not('MO.loginController.disabled'), | |
action: 'login' | |
}) | |
}), | |
focus: function () { | |
this.contentView.sipAddress.field.becomeFirstResponder(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment