Home | History | Annotate | Download | only in js

Lines Matching refs:this

2 // Use of this source code is governed by a BSD-style license that can be
23 cr.ui.GridItem.prototype.decorate.call(this, arguments);
24 this.textContent = '';
25 this.className = 'preview-item';
27 var div = this.ownerDocument.createElement('div');
28 this.appendChild(div);
30 var img = this.ownerDocument.createElement('img');
31 this.dataItem.showInImage(img);
43 this.files_ = new cr.ui.ArrayDataModel([]);
44 this.files_.addEventListener('splice', this.handleOnFilesChanged_.bind(this));
46 this.title_ = document.querySelector('.header-title');
48 this.loginDiv_ = document.querySelector('.login-div');
49 this.loginInput_ = document.getElementById('login-input');
50 this.passwordInput_ = document.getElementById('password-input');
51 this.captchaRow_ = document.querySelector('.captcha-row');
52 this.captchaImage_ = document.querySelector('.captcha-row img');
53 this.captchaInput_ = document.getElementById('captcha-input');
54 this.loginFailure_ = document.querySelector('.login-failure');
55 this.loginButton_ = document.querySelector('.login-button');
56 this.loginButton_.addEventListener('click',
57 this.handleOnLoginClicked_.bind(this));
61 buttons[i].addEventListener('click', this.close_.bind(this));
64 this.albumDiv_ = document.querySelector('.album-div');
65 this.filesCountSpan_ = document.getElementById('files-count-span');
67 this.albumSelect_ = document.getElementById('album-select');
68 this.albumSelect_.addEventListener('change',
69 this.handleOnAlbumSelected_.bind(this));
70 this.albumTitleInput_ = document.getElementById('album-title-input');
71 this.albumTitleInput_.addEventListener('change',
72 this.handleOnAlbumTitleChanged_.bind(this));
73 this.albumLocationInput_ = document.getElementById('album-location-input');
74 this.albumLocationInput_.addEventListener('change',
75 this.handleOnAlbumLocationChanged_.bind(this));
76 this.albumDescriptionTextarea_ =
78 this.albumDescriptionTextarea_.addEventListener('change',
79 this.handleOnAlbumDescriptionChanged_.bind(this));
81 this.previewGrid_ = document.querySelector('.preview-grid');
82 cr.ui.Grid.decorate(this.previewGrid_);
83 this.previewGrid_.itemConstructor = PreviewItem;
84 this.previewGrid_.dataModel = this.files_;
85 this.previewGrid_.selectionModel = new cr.ui.ListSingleSelectionModel();
87 this.uploadButton_ = document.querySelector('.upload-button');
88 this.uploadButton_.addEventListener('click',
89 this.handleOnUploadClicked_.bind(this));
91 this.handleOnLogoutClicked_.bind(this));
94 this.showLogin_();
95 this.client_ = chrome.extension.getBackgroundPage().bg.client;
97 if (this.client_.authorized) {
98 this.loginCallback_('success');
109 this.files_.push(files[i]);
118 this.addFiles(newFiles);
125 return (this.albumTitleInput_.value != '') &&
126 (this.files_.length > 0) && this.client_.authorized;
146 this.setEnabled_(this.uploadButton_, this.canUpload_());
153 this.title_.textContent = 'Sign in to Picasa';
154 this.loginDiv_.classList.remove('invisible');
155 this.albumDiv_.classList.add('invisible');
156 this.captchaRow_.classList.add('invisible');
163 this.filesCountSpan_.textContent = '' + this.files_.length;
170 this.title_.textContent = 'Choose an Album';
171 this.checkUploadButtonEnabled_();
172 this.loginDiv_.classList.add('invisible');
173 this.albumDiv_.classList.remove('invisible');
174 this.showFilesCount_();
182 this.showFilesCount_();
183 this.checkUploadButtonEnabled_();
191 this.setEnabled_(this.loginButton_, true);
193 this.loginFailure_.classList.add('invisible');
194 this.showChooseAlbum_();
195 this.loadFilesFromBackgroundPage_();
196 this.client_.getAlbums(this.getAlbumsCallback_.bind(this));
198 this.captchaRow_.classList.remove('invisible');
199 this.captchaImage_.setAttribute('src', this.client_.captchaUrl);
201 this.loginFailure_.classList.remove('invisible');
210 this.setEnabled_(this.loginButton_, false);
211 var password = this.passwordInput_.value;
212 this.passwordInput_.value = '';
213 var captcha = this.client_.captchaUrl ? this.captchaInput_.value : null;
214 this.client_.login(this.loginInput_.value, password,
215 this.loginCallback_.bind(this), captcha);
224 this.client_.albums.push(
226 albums = this.client_.albums;
227 this.albumSelect_.options.length = 0;
229 this.albumSelect_.options[i] = new Option(album.title, i);
231 this.albumSelect_.selectedIndex = albums.length - 1;
233 this.handleOnAlbumSelected_(null);
241 this.client_.logout();
242 this.showLogin_();
250 var album = this.client_.albums[this.albumSelect_.selectedIndex];
252 this.setEnabled_(this.albumTitleInput_, enabled);
253 this.setEnabled_(this.albumLocationInput_, enabled);
254 this.setEnabled_(this.albumDescriptionTextarea_, enabled);
255 this.albumTitleInput_.value = album.title;
256 this.albumLocationInput_.value = album.location;
257 this.albumDescriptionTextarea_.value = album.description;
258 this.checkUploadButtonEnabled_();
266 this.setEnabled_(this.uploadButton_, false);
267 var album = this.client_.albums[this.albumSelect_.selectedIndex];
269 this.client_.createAlbum(album, this.createAlbumCallback_.bind(this));
271 this.createAlbumCallback_(album);
281 this.setEnabled_(this.uploadButton_, true);
287 for (var i = 0; i < this.files_.length; i++) {
288 files.push(this.files_.item(i));
292 this.close_();
300 var album = this.client_.albums[this.albumSelect_.selectedIndex];
301 album.title = this.albumTitleInput_.value;
302 this.checkUploadButtonEnabled_();
310 var album = this.client_.albums[this.albumSelect_.selectedIndex];
311 album.location = this.albumLocationInput_.value;
319 var album = this.client_.albums[this.albumSelect_.selectedIndex];
320 album.description = this.albumDescriptionTextarea_.value;