| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview Locally managed user creation flow screen. | 6 * @fileoverview Locally managed user creation flow screen. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 login.createScreen('LocallyManagedUserCreationScreen', | 9 login.createScreen('LocallyManagedUserCreationScreen', |
| 10 'managed-user-creation', function() { | 10 'managed-user-creation', function() { |
| (...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 getScreenElement: function(elementId) { | 734 getScreenElement: function(elementId) { |
| 735 var fullId = this.name() + '-' + elementId; | 735 var fullId = this.name() + '-' + elementId; |
| 736 return $(fullId); | 736 return $(fullId); |
| 737 }, | 737 }, |
| 738 | 738 |
| 739 /** | 739 /** |
| 740 * Screen controls. | 740 * Screen controls. |
| 741 * @type {!Array} Array of Buttons. | 741 * @type {!Array} Array of Buttons. |
| 742 */ | 742 */ |
| 743 get buttons() { | 743 get buttons() { |
| 744 var buttons = []; | 744 var links = this.ownerDocument.createElement('div'); |
| 745 | 745 var buttons = this.ownerDocument.createElement('div'); |
| 746 var status = this.makeFromTemplate('status-container', 'status'); | 746 links.classList.add('controls-links'); |
| 747 buttons.push(status); | 747 buttons.classList.add('controls-buttons'); |
| 748 | 748 |
| 749 var importLink = this.makeFromTemplate('import-supervised-user-link', | 749 var importLink = this.makeFromTemplate('import-supervised-user-link', |
| 750 'import-link'); | 750 'import-link'); |
| 751 importLink.hidden = true; | 751 importLink.hidden = true; |
| 752 buttons.push(importLink); | 752 links.appendChild(importLink); |
| 753 |
| 753 var linkElement = importLink.querySelector('.signin-link'); | 754 var linkElement = importLink.querySelector('.signin-link'); |
| 754 linkElement.addEventListener('click', | 755 linkElement.addEventListener('click', |
| 755 this.importLinkPressed_.bind(this)); | 756 this.importLinkPressed_.bind(this)); |
| 756 | 757 |
| 757 var createLink = this.makeFromTemplate('create-supervised-user-link', | 758 var createLink = this.makeFromTemplate('create-supervised-user-link', |
| 758 'create-link'); | 759 'create-link'); |
| 759 createLink.hidden = true; | 760 createLink.hidden = true; |
| 760 buttons.push(createLink); | 761 links.appendChild(createLink); |
| 762 |
| 763 var status = this.makeFromTemplate('status-container', 'status'); |
| 764 buttons.appendChild(status); |
| 761 | 765 |
| 762 linkElement = createLink.querySelector('.signin-link'); | 766 linkElement = createLink.querySelector('.signin-link'); |
| 763 linkElement.addEventListener('click', | 767 linkElement.addEventListener('click', |
| 764 this.createLinkPressed_.bind(this)); | 768 this.createLinkPressed_.bind(this)); |
| 765 | 769 |
| 766 buttons.push(this.makeButton( | 770 buttons.appendChild(this.makeButton( |
| 767 'start', | 771 'start', |
| 768 'managedUserCreationFlow', | 772 'managedUserCreationFlow', |
| 769 this.startButtonPressed_.bind(this), | 773 this.startButtonPressed_.bind(this), |
| 770 ['intro'], | 774 ['intro'], |
| 771 ['custom-appearance', 'button-fancy', 'button-blue'])); | 775 ['custom-appearance', 'button-fancy', 'button-blue'])); |
| 772 | 776 |
| 773 buttons.push(this.makeButton( | 777 buttons.appendChild(this.makeButton( |
| 774 'prev', | 778 'prev', |
| 775 'managedUserCreationFlow', | 779 'managedUserCreationFlow', |
| 776 this.prevButtonPressed_.bind(this), | 780 this.prevButtonPressed_.bind(this), |
| 777 ['manager'], | 781 ['manager'], |
| 778 [])); | 782 [])); |
| 779 | 783 |
| 780 buttons.push(this.makeButton( | 784 buttons.appendChild(this.makeButton( |
| 781 'next', | 785 'next', |
| 782 'managedUserCreationFlow', | 786 'managedUserCreationFlow', |
| 783 this.nextButtonPressed_.bind(this), | 787 this.nextButtonPressed_.bind(this), |
| 784 ['manager', 'username'], | 788 ['manager', 'username'], |
| 785 [])); | 789 [])); |
| 786 | 790 |
| 787 buttons.push(this.makeButton( | 791 buttons.appendChild(this.makeButton( |
| 788 'import', | 792 'import', |
| 789 'managedUserCreationFlow', | 793 'managedUserCreationFlow', |
| 790 this.importButtonPressed_.bind(this), | 794 this.importButtonPressed_.bind(this), |
| 791 ['import', 'import-password'], | 795 ['import', 'import-password'], |
| 792 [])); | 796 [])); |
| 793 | 797 |
| 794 buttons.push(this.makeButton( | 798 buttons.appendChild(this.makeButton( |
| 795 'gotit', | 799 'gotit', |
| 796 'managedUserCreationFlow', | 800 'managedUserCreationFlow', |
| 797 this.gotItButtonPressed_.bind(this), | 801 this.gotItButtonPressed_.bind(this), |
| 798 ['created'], | 802 ['created'], |
| 799 ['custom-appearance', 'button-fancy', 'button-blue'])); | 803 ['custom-appearance', 'button-fancy', 'button-blue'])); |
| 800 return buttons; | 804 return [links, buttons]; |
| 801 }, | 805 }, |
| 802 | 806 |
| 803 /** | 807 /** |
| 804 * Does sanity check and calls backend with current user name/password pair | 808 * Does sanity check and calls backend with current user name/password pair |
| 805 * to authenticate manager. May result in showManagerPasswordError. | 809 * to authenticate manager. May result in showManagerPasswordError. |
| 806 * @private | 810 * @private |
| 807 */ | 811 */ |
| 808 validateAndLogInAsManager_: function() { | 812 validateAndLogInAsManager_: function() { |
| 809 var selectedPod = this.managerList_.selectedPod_; | 813 var selectedPod = this.managerList_.selectedPod_; |
| 810 if (null == selectedPod) | 814 if (null == selectedPod) |
| (...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1579 | 1583 |
| 1580 if (selectedIndex >= 0) | 1584 if (selectedIndex >= 0) |
| 1581 this.importList_.selectPod(this.importList_.pods[selectedIndex]); | 1585 this.importList_.selectPod(this.importList_.pods[selectedIndex]); |
| 1582 | 1586 |
| 1583 if (this.currentPage_ == 'username') | 1587 if (this.currentPage_ == 'username') |
| 1584 this.getScreenElement('import-link').hidden = (userList.length == 0); | 1588 this.getScreenElement('import-link').hidden = (userList.length == 0); |
| 1585 }, | 1589 }, |
| 1586 }; | 1590 }; |
| 1587 }); | 1591 }); |
| 1588 | 1592 |
| OLD | NEW |