Guest User

Untitled

a guest
Jun 4th, 2018
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. showLoginPane: function(){
  2. var me = this;
  3. this._loginData = SC.ObjectController.create({
  4. username: '',
  5. password: ''
  6. });
  7. var sheet = SC.SheetPane.create({
  8. layout: { width:400, height: 250, centerX: 0 },
  9. contentView: SC.View.extend({
  10. layout: { top: 0, right: 0, bottom: 0, left: 0 },
  11. childViews: "usernameLabel passwordLabel usernameInput passwordInput cancelButton loginButton".w(),
  12.  
  13. usernameLabel: SC.LabelView.design({
  14. layout: { height: 25, width: 150, bottom: 120, centerX: -80 },
  15. textAlign: SC.ALIGN_CENTER,
  16. value: 'User name:'
  17. }),
  18.  
  19. passwordLabel: SC.LabelView.design({
  20. layout: { height: 25, width: 150, bottom: 120, centerX: 80 },
  21. textAlign: SC.ALIGN_CENTER,
  22. value: 'Password:'
  23. }),
  24.  
  25. usernameInput: SC.TextFieldView.design({
  26. layout: { height: 25, width: 150, bottom: 80, centerX: -80 },
  27. hint: 'Username...',
  28. isPassword: NO,
  29. isTextArea: NO,
  30. valueBinding: me._loginData.username
  31. }),
  32.  
  33. passwordInput: SC.TextFieldView.design({
  34. layout: { height: 25, width: 150, bottom: 80, centerX: 80 },
  35. hint: 'Password...',
  36. isPassword: YES,
  37. isTextArea: NO,
  38. valueBinding: me._loginData.password
  39. }),
  40.  
  41. cancelButton: SC.ButtonView.design({
  42. layout: { height: 25, width: 100, bottom: 20, centerX: 80 },
  43. title: 'Annuleren',
  44. action: 'closeLoginPane',
  45. target: me
  46. }),
  47.  
  48. loginButton: SC.ButtonView.design({
  49. layout: { height: 25, width: 100, bottom: 20, centerX: -80 },
  50. title: 'Login',
  51. action: 'attemptLogin',
  52. target: me
  53. })
  54. })
  55. });
  56.  
  57. this._pane = sheet;
  58. sheet.append();
  59. },
Add Comment
Please, Sign In to add comment