OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 * FileManager constructor. | 6 * FileManager constructor. |
7 * | 7 * |
8 * FileManager objects encapsulate the functionality of the file selector | 8 * FileManager objects encapsulate the functionality of the file selector |
9 * dialogs, as well as the full screen file manager application (though the | 9 * dialogs, as well as the full screen file manager application (though the |
10 * latter is not yet implemented). | 10 * latter is not yet implemented). |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
648 | 648 |
649 this.deleteButton_.addEventListener('click', | 649 this.deleteButton_.addEventListener('click', |
650 this.onDeleteButtonClick_.bind(this)); | 650 this.onDeleteButtonClick_.bind(this)); |
651 this.deleteButton_.addEventListener('keypress', | 651 this.deleteButton_.addEventListener('keypress', |
652 this.onDeleteButtonKeyPress_.bind(this)); | 652 this.onDeleteButtonKeyPress_.bind(this)); |
653 | 653 |
654 this.decorateSplitter( | 654 this.decorateSplitter( |
655 this.dialogDom_.querySelector('div.sidebar-splitter')); | 655 this.dialogDom_.querySelector('div.sidebar-splitter')); |
656 | 656 |
657 this.dialogContainer_ = this.dialogDom_.querySelector('.dialog-container'); | 657 this.dialogContainer_ = this.dialogDom_.querySelector('.dialog-container'); |
658 this.dialogDom_.querySelector('#detail-view').addEventListener( | 658 |
659 this.detailViewButton_ = this.dialogDom_.querySelector('#detail-view'); | |
660 this.detailViewButton_.addEventListener( | |
659 'click', this.onDetailViewButtonClick_.bind(this)); | 661 'click', this.onDetailViewButtonClick_.bind(this)); |
660 this.dialogDom_.querySelector('#thumbnail-view').addEventListener( | 662 |
663 this.thumbnailViewButton_ = this.dialogDom_ | |
664 .querySelector('#thumbnail-view'); | |
dgozman
2012/05/23 14:44:41
Binary operators (including dot) should be before
Dmitry Zvorygin
2012/05/23 14:51:58
Done.
| |
665 this.thumbnailViewButton_.addEventListener( | |
661 'click', this.onThumbnailViewButtonClick_.bind(this)); | 666 'click', this.onThumbnailViewButtonClick_.bind(this)); |
662 | 667 |
663 this.syncButton = this.dialogDom_.querySelector('#gdata-sync-settings'); | 668 this.syncButton = this.dialogDom_.querySelector('#gdata-sync-settings'); |
664 this.syncButton.addEventListener('click', this.onGDataPrefClick_.bind( | 669 this.syncButton.addEventListener('click', this.onGDataPrefClick_.bind( |
665 this, 'cellularDisabled', false /* not inverted */)); | 670 this, 'cellularDisabled', false /* not inverted */)); |
666 | 671 |
667 this.hostedButton = this.dialogDom_.querySelector('#gdata-hosted-settings'); | 672 this.hostedButton = this.dialogDom_.querySelector('#gdata-hosted-settings'); |
668 this.hostedButton.addEventListener('click', this.onGDataPrefClick_.bind( | 673 this.hostedButton.addEventListener('click', this.onGDataPrefClick_.bind( |
669 this, 'hostedFilesDisabled', true /* inverted */)); | 674 this, 'hostedFilesDisabled', true /* inverted */)); |
670 | 675 |
(...skipping 3167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3838 function onError(error) { | 3843 function onError(error) { |
3839 self.alert.show(strf('ERROR_CREATING_FOLDER', current(), | 3844 self.alert.show(strf('ERROR_CREATING_FOLDER', current(), |
3840 getFileErrorString(error.code))); | 3845 getFileErrorString(error.code))); |
3841 } | 3846 } |
3842 | 3847 |
3843 tryCreate(); | 3848 tryCreate(); |
3844 }; | 3849 }; |
3845 | 3850 |
3846 FileManager.prototype.onDetailViewButtonClick_ = function(event) { | 3851 FileManager.prototype.onDetailViewButtonClick_ = function(event) { |
3847 this.setListType(FileManager.ListType.DETAIL); | 3852 this.setListType(FileManager.ListType.DETAIL); |
3848 this.currentList_.focus(); | 3853 this.thumbnailViewButton_.focus(); |
dgozman
2012/05/23 14:44:41
Revert this as discussed offline.
Dmitry Zvorygin
2012/05/23 14:51:58
Done.
| |
3849 }; | 3854 }; |
3850 | 3855 |
3851 FileManager.prototype.onThumbnailViewButtonClick_ = function(event) { | 3856 FileManager.prototype.onThumbnailViewButtonClick_ = function(event) { |
3852 this.setListType(FileManager.ListType.THUMBNAIL); | 3857 this.setListType(FileManager.ListType.THUMBNAIL); |
3853 this.currentList_.focus(); | 3858 this.detailViewButton_.focus(); |
3854 }; | 3859 }; |
3855 | 3860 |
3856 /** | 3861 /** |
3857 * KeyDown event handler for the document. | 3862 * KeyDown event handler for the document. |
3858 */ | 3863 */ |
3859 FileManager.prototype.onKeyDown_ = function(event) { | 3864 FileManager.prototype.onKeyDown_ = function(event) { |
3860 if (event.srcElement === this.renameInput_) { | 3865 if (event.srcElement === this.renameInput_) { |
3861 // Ignore keydown handler in the rename input box. | 3866 // Ignore keydown handler in the rename input box. |
3862 return; | 3867 return; |
3863 } | 3868 } |
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4607 function closeBanner() { | 4612 function closeBanner() { |
4608 self.cleanupGDataWelcome_(); | 4613 self.cleanupGDataWelcome_(); |
4609 // Stop showing the welcome banner. | 4614 // Stop showing the welcome banner. |
4610 localStorage[WELCOME_HEADER_COUNTER_KEY] = WELCOME_HEADER_COUNTER_LIMIT; | 4615 localStorage[WELCOME_HEADER_COUNTER_KEY] = WELCOME_HEADER_COUNTER_LIMIT; |
4611 } | 4616 } |
4612 | 4617 |
4613 return maybeShowBanner; | 4618 return maybeShowBanner; |
4614 }; | 4619 }; |
4615 })(); | 4620 })(); |
4616 | 4621 |
OLD | NEW |