Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 var ClientRenderer = (function() { | 5 var ClientRenderer = (function() { |
| 6 var ClientRenderer = function() { | 6 var ClientRenderer = function() { |
| 7 this.playerListElement = document.getElementById('player-list'); | 7 this.playerListElement = document.getElementById('player-list'); |
| 8 this.propertiesTable = | 8 this.propertiesTable = |
| 9 document.getElementById('property-table').querySelector('tbody'); | 9 document.getElementById('property-table').querySelector('tbody'); |
| 10 this.logTable = document.getElementById('log').querySelector('tbody'); | 10 this.logTable = document.getElementById('log').querySelector('tbody'); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 115 if (player === this.selectedPlayer) { | 115 if (player === this.selectedPlayer) { |
| 116 this.drawProperties_(player.properties); | 116 this.drawProperties_(player.properties); |
| 117 this.drawLog_(); | 117 this.drawLog_(); |
| 118 this.drawGraphs_(); | 118 this.drawGraphs_(); |
| 119 } | 119 } |
| 120 if (key === 'name' || key === 'url') { | 120 if (key === 'name' || key === 'url') { |
| 121 this.redrawPlayerList_(players); | 121 this.redrawPlayerList_(players); |
| 122 } | 122 } |
| 123 }, | 123 }, |
| 124 | 124 |
| 125 redrawVideoCaptureCapabilities: function( videoCaptureCapabilities, keys ) { | |
|
xhwang
2014/10/16 17:54:17
nit: Remove extra spaces
burnik
2014/10/16 18:29:56
Done. And all double quotes are now single.
| |
| 126 var copyButtonElement = | |
| 127 document.getElementById('video-capture-capabilities-copy-button'); | |
| 128 copyButtonElement.onclick = function() { | |
| 129 window.prompt("Copy to clipboard: Ctrl+C, Enter", | |
| 130 JSON.stringify(videoCaptureCapabilities)) | |
| 131 } | |
| 132 | |
| 133 var videoTableBodyElement = | |
| 134 document.getElementById('video-capture-capabilities-tbody'); | |
| 135 removeChildren(videoTableBodyElement); | |
| 136 | |
| 137 for (var component in videoCaptureCapabilities) { | |
| 138 var tableRow = document.createElement("tr"); | |
| 139 var device = videoCaptureCapabilities[ component ]; | |
| 140 | |
| 141 for (var i in keys) { | |
| 142 var value = device[keys[i]]; | |
| 143 var tableCell = document.createElement("td"); | |
| 144 var cellElement; | |
| 145 if ((typeof value) == (typeof [])) { | |
| 146 cellElement = document.createElement("ul"); | |
| 147 for (var i in value) { | |
| 148 var format = value[i]; | |
| 149 var li = document.createElement("li"); | |
| 150 li.appendChild(document.createTextNode(format)) | |
| 151 cellElement.appendChild(li) | |
| 152 } | |
| 153 } else { | |
| 154 cellElement = document.createTextNode( | |
| 155 ((typeof value) == 'undefined') ? "n/a" : value); | |
| 156 } | |
| 157 tableCell.appendChild(cellElement) | |
| 158 tableRow.appendChild(tableCell); | |
| 159 } | |
| 160 videoTableBodyElement.appendChild(tableRow); | |
| 161 } | |
| 162 }, | |
| 163 | |
| 125 redrawAudioComponentList_: function(componentType, components) { | 164 redrawAudioComponentList_: function(componentType, components) { |
| 126 function redrawList(renderer, baseName, element) { | 165 function redrawList(renderer, baseName, element) { |
| 127 var fragment = document.createDocumentFragment(); | 166 var fragment = document.createDocumentFragment(); |
| 128 for (id in components) { | 167 for (id in components) { |
| 129 var li = document.createElement('li'); | 168 var li = document.createElement('li'); |
| 130 var friendlyName = baseName + ' ' + id; | 169 var friendlyName = baseName + ' ' + id; |
| 131 li.appendChild(createButton( | 170 li.appendChild(createButton( |
| 132 friendlyName, renderer.selectAudioComponent_.bind( | 171 friendlyName, renderer.selectAudioComponent_.bind( |
| 133 renderer, componentType, id, components[id], friendlyName))); | 172 renderer, componentType, id, components[id], friendlyName))); |
| 134 fragment.appendChild(li); | 173 fragment.appendChild(li); |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 357 if (this.selectedPlayer) { | 396 if (this.selectedPlayer) { |
| 358 removeChildren(this.logTable); | 397 removeChildren(this.logTable); |
| 359 this.selectedPlayerLogIndex = 0; | 398 this.selectedPlayerLogIndex = 0; |
| 360 this.drawLog_(); | 399 this.drawLog_(); |
| 361 } | 400 } |
| 362 }, | 401 }, |
| 363 }; | 402 }; |
| 364 | 403 |
| 365 return ClientRenderer; | 404 return ClientRenderer; |
| 366 })(); | 405 })(); |
| OLD | NEW |