Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Side by Side Diff: tracing/tracing/ui/extras/drive/index.html

Issue 1923953003: [polymer] Switches .appendChild() to Polymer.dom()...appendChild() (Closed) Base URL: git@github.com:catapult-project/catapult.git@polymer10-migration
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <!-- 2 <!--
3 Copyright 2015 The Chromium Authors. All rights reserved. 3 Copyright 2015 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be 4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file. 5 found in the LICENSE file.
6 --> 6 -->
7 <head> 7 <head>
8 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 8 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
9 9
10 <script type="text/javascript" src="https://apis.google.com/js/api.js"></scrip t> 10 <script type="text/javascript" src="https://apis.google.com/js/api.js"></scrip t>
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 gapi.load('drive-share', initShareButton); 280 gapi.load('drive-share', initShareButton);
281 }); 281 });
282 } 282 }
283 283
284 function downloadFile(file) { 284 function downloadFile(file) {
285 if (file.downloadUrl) { 285 if (file.downloadUrl) {
286 var downloadingOverlay = tr.ui.b.Overlay(); 286 var downloadingOverlay = tr.ui.b.Overlay();
287 downloadingOverlay.title = 'Downloading...'; 287 downloadingOverlay.title = 'Downloading...';
288 downloadingOverlay.userCanClose = false; 288 downloadingOverlay.userCanClose = false;
289 downloadingOverlay.msgEl = document.createElement('div'); 289 downloadingOverlay.msgEl = document.createElement('div');
290 downloadingOverlay.appendChild(downloadingOverlay.msgEl); 290 Polymer.dom(downloadingOverlay).appendChild(downloadingOverlay.msgEl);
291 downloadingOverlay.msgEl.style.margin = '20px'; 291 downloadingOverlay.msgEl.style.margin = '20px';
292 downloadingOverlay.update = function(msg) { 292 downloadingOverlay.update = function(msg) {
293 this.msgEl.textContent = msg; 293 this.msgEl.textContent = msg;
294 } 294 }
295 downloadingOverlay.visible = true; 295 downloadingOverlay.visible = true;
296 296
297 var accessToken = gapi.auth.getToken().access_token; 297 var accessToken = gapi.auth.getToken().access_token;
298 var xhr = new XMLHttpRequest(); 298 var xhr = new XMLHttpRequest();
299 xhr.open('GET', file.downloadUrl); 299 xhr.open('GET', file.downloadUrl);
300 xhr.setRequestHeader('Authorization', 'Bearer ' + accessToken); 300 xhr.setRequestHeader('Authorization', 'Bearer ' + accessToken);
(...skipping 20 matching lines...) Expand all
321 var imageList = []; 321 var imageList = [];
322 for (var i = 0; i < collaboratorCount; i++) { 322 for (var i = 0; i < collaboratorCount; i++) {
323 var user = allCollaborators[i]; 323 var user = allCollaborators[i];
324 324
325 var img = document.createElement('img'); 325 var img = document.createElement('img');
326 img.src = user.photoUrl; 326 img.src = user.photoUrl;
327 img.alt = user.displayName; 327 img.alt = user.displayName;
328 img.height = 30; 328 img.height = 30;
329 img.width = 30; 329 img.width = 30;
330 img.className = 'collaborator-img'; 330 img.className = 'collaborator-img';
331 collabspan.appendChild(img); 331 Polymer.dom(collabspan).appendChild(img);
332 imageList.push({'image': img, 'name': user.displayName}); 332 imageList.push({'image': img, 'name': user.displayName});
333 } 333 }
334 for (i = 0; i < imageList.length; i++) { 334 for (i = 0; i < imageList.length; i++) {
335 var collabTooltip = tr.ui.b.createDiv({ 335 var collabTooltip = tr.ui.b.createDiv({
336 className: 'collaborator-tooltip' 336 className: 'collaborator-tooltip'
337 }); 337 });
338 var collabTooltipContent = tr.ui.b.createDiv({ 338 var collabTooltipContent = tr.ui.b.createDiv({
339 className: 'collaborator-tooltip-content' 339 className: 'collaborator-tooltip-content'
340 }); 340 });
341 collabTooltipContent.textContent = imageList[i].name; 341 collabTooltipContent.textContent = imageList[i].name;
342 collabTooltip.appendChild(collabTooltipContent); 342 Polymer.dom(collabTooltip).appendChild(collabTooltipContent);
343 collabspan.appendChild(collabTooltip); 343 Polymer.dom(collabspan).appendChild(collabTooltip);
344 var collabTooltipArrow = tr.ui.b.createDiv({ 344 var collabTooltipArrow = tr.ui.b.createDiv({
345 className: 'collaborator-tooltip-arrow'}); 345 className: 'collaborator-tooltip-arrow'});
346 collabTooltip.appendChild(collabTooltipArrow); 346 Polymer.dom(collabTooltip).appendChild(collabTooltipArrow);
347 var collabTooltipArrowBefore = tr.ui.b.createDiv({ 347 var collabTooltipArrowBefore = tr.ui.b.createDiv({
348 className: 'collaborator-tooltip-arrow-before'}); 348 className: 'collaborator-tooltip-arrow-before'});
349 collabTooltipArrow.appendChild(collabTooltipArrowBefore); 349 Polymer.dom(collabTooltipArrow).appendChild(collabTooltipArrowBefore);
350 var collabTooltipArrowAfter = tr.ui.b.createDiv({ 350 var collabTooltipArrowAfter = tr.ui.b.createDiv({
351 className: 'collaborator-tooltip-arrow-after'}); 351 className: 'collaborator-tooltip-arrow-after'});
352 collabTooltipArrow.appendChild(collabTooltipArrowAfter); 352 Polymer.dom(collabTooltipArrow).appendChild(collabTooltipArrowAfter);
353 353
354 var rect = imageList[i].image.getBoundingClientRect(); 354 var rect = imageList[i].image.getBoundingClientRect();
355 collabTooltip.style.top = (rect.bottom - 6) + 'px'; 355 collabTooltip.style.top = (rect.bottom - 6) + 'px';
356 collabTooltip.style.left = 356 collabTooltip.style.left =
357 (rect.left + 16 - (collabTooltip.offsetWidth / 2)) + 'px'; 357 (rect.left + 16 - (collabTooltip.offsetWidth / 2)) + 'px';
358 collabTooltipArrow.style.left = (collabTooltip.offsetWidth / 2) + 'px'; 358 collabTooltipArrow.style.left = (collabTooltip.offsetWidth / 2) + 'px';
359 collabTooltip.style.visibility = 'hidden'; 359 collabTooltip.style.visibility = 'hidden';
360 function visibilityDelegate(element, visibility) { 360 function visibilityDelegate(element, visibility) {
361 return function() { 361 return function() {
362 element.style.visibility = visibility; 362 element.style.visibility = visibility;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 shareClient_.showSettingsDialog(); 453 shareClient_.showSettingsDialog();
454 }; 454 };
455 455
456 }()); 456 }());
457 457
458 </script> 458 </script>
459 <script type="text/javascript" 459 <script type="text/javascript"
460 src="https://apis.google.com/js/client.js?onload=onAPIClientLoaded_"> 460 src="https://apis.google.com/js/client.js?onload=onAPIClientLoaded_">
461 </script> 461 </script>
462 </body> 462 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698