OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 Supervised user creation flow screen. | 6 * @fileoverview Legacy supervised user creation flow screen. |
7 */ | 7 */ |
8 | 8 |
9 login.createScreen('SupervisedUserCreationScreen', | 9 login.createScreen('SupervisedUserCreationScreen', |
10 'supervised-user-creation', function() { | 10 'supervised-user-creation', function() { |
11 var MAX_NAME_LENGTH = 50; | 11 var MAX_NAME_LENGTH = 50; |
12 var UserImagesGrid = options.UserImagesGrid; | 12 var UserImagesGrid = options.UserImagesGrid; |
13 var ButtonImages = UserImagesGrid.ButtonImages; | 13 var ButtonImages = UserImagesGrid.ButtonImages; |
14 | 14 |
15 var ManagerPod = cr.ui.define(function() { | 15 var ManagerPod = cr.ui.define(function() { |
16 var node = $('supervised-user-creation-manager-template').cloneNode(true); | 16 var node = $('supervised-user-creation-manager-template').cloneNode(true); |
(...skipping 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1443 /** | 1443 /** |
1444 * Currently selected user image index (take photo button is with zero | 1444 * Currently selected user image index (take photo button is with zero |
1445 * index). | 1445 * index). |
1446 * @type {number} | 1446 * @type {number} |
1447 */ | 1447 */ |
1448 selectedUserImage_: -1, | 1448 selectedUserImage_: -1, |
1449 imagesData: [], | 1449 imagesData: [], |
1450 | 1450 |
1451 setDefaultImages: function(imagesData) { | 1451 setDefaultImages: function(imagesData) { |
1452 var imageGrid = this.getScreenElement('image-grid'); | 1452 var imageGrid = this.getScreenElement('image-grid'); |
1453 for (var i = 0, data; data = imagesData[i]; i++) { | 1453 imageGrid.setDefaultImages(imagesData); |
1454 var item = imageGrid.addItem(data.url, data.title); | |
1455 item.type = 'default'; | |
1456 item.author = data.author || ''; | |
1457 item.website = data.website || ''; | |
1458 } | |
1459 this.imagesData_ = imagesData; | 1454 this.imagesData_ = imagesData; |
1460 }, | 1455 }, |
1461 | 1456 |
1462 | 1457 |
1463 handleActivate_: function() { | 1458 handleActivate_: function() { |
1464 var imageGrid = this.getScreenElement('image-grid'); | 1459 var imageGrid = this.getScreenElement('image-grid'); |
1465 if (imageGrid.selectedItemUrl == ButtonImages.TAKE_PHOTO) { | 1460 if (imageGrid.selectedItemUrl == ButtonImages.TAKE_PHOTO) { |
1466 this.handleTakePhoto_(); | 1461 this.handleTakePhoto_(); |
1467 return; | 1462 return; |
1468 } | 1463 } |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1588 | 1583 |
1589 if (selectedIndex >= 0) | 1584 if (selectedIndex >= 0) |
1590 this.importList_.selectPod(this.importList_.pods[selectedIndex]); | 1585 this.importList_.selectPod(this.importList_.pods[selectedIndex]); |
1591 | 1586 |
1592 if (this.currentPage_ == 'username') | 1587 if (this.currentPage_ == 'username') |
1593 this.getScreenElement('import-link').hidden = (userList.length == 0); | 1588 this.getScreenElement('import-link').hidden = (userList.length == 0); |
1594 }, | 1589 }, |
1595 }; | 1590 }; |
1596 }); | 1591 }); |
1597 | 1592 |
OLD | NEW |