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

Unified Diff: remoting/webapp/me2mom/client_screen.js

Issue 8511077: Fixed css to make host list prettier. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed accidental script tag. Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/webapp/me2mom/choice.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/me2mom/client_screen.js
diff --git a/remoting/webapp/me2mom/client_screen.js b/remoting/webapp/me2mom/client_screen.js
index b9fc8397cbfe40a43a80cff072f9c345a64069ad..333b866be62a56972ffe6a853b4bd66fa94551f1 100644
--- a/remoting/webapp/me2mom/client_screen.js
+++ b/remoting/webapp/me2mom/client_screen.js
@@ -464,11 +464,8 @@ function parseHostListResponse_(xhr) {
showConnectError_(remoting.Error.GENERIC);
}
}
- } catch(er) {
- // Error parsing response...
- remoting.debug.log('Error: Error processing response: "' +
- xhr.status + ' ' + xhr.statusText);
- remoting.debug.log(xhr.responseText);
+ } catch (er) {
+ console.error('Error processing response: ', xhr);
}
}
@@ -498,15 +495,20 @@ function replaceHostList_(hostList) {
// Clear the table before adding the host info.
hostListTable.innerHTML = '';
- // Show/hide the div depending on whether there are hosts to list.
- hostListDiv.hidden = (hostList.length == 0);
-
for (var i = 0; i < hostList.length; ++i) {
var host = hostList[i];
if (!host.hostName || !host.hostId || !host.status || !host.jabberId ||
!host.publicKey)
continue;
var hostEntry = document.createElement('tr');
+ addClass(hostEntry, 'host-list-row');
+
+ var hostIcon = document.createElement('td');
+ var hostIconImage = document.createElement('img');
+ hostIconImage.src = 'icon_host.png';
+ hostIcon.className = 'host-list-row-start';
+ hostIcon.appendChild(hostIconImage);
+ hostEntry.appendChild(hostIcon);
var hostName = document.createElement('td');
hostName.setAttribute('class', 'mode-select-label');
@@ -524,12 +526,24 @@ function replaceHostList_(hostList) {
chrome.i18n.getMessage(/*i18n-content*/'CONNECT_BUTTON');
hostStatus.appendChild(connectButton);
} else {
+ addClass(hostEntry, 'host-offline');
hostStatus.innerHTML = chrome.i18n.getMessage(/*i18n-content*/'OFFLINE');
}
+ hostStatus.className = 'host-list-row-end';
hostEntry.appendChild(hostStatus);
hostListTable.appendChild(hostEntry);
}
+
+ // Show/hide the div depending on whether there are hosts to list.
+ hostListDiv.hidden = (hostList.length == 0);
+ if (hostList.length == 0) {
+ addClass(hostListDiv, 'collapsed');
+ } else {
+ hostListDiv.style.height = hostListDiv.scrollHeight + 'px';
+ removeClass(hostListDiv, 'collapsed');
+ }
+
}
/**
@@ -590,5 +604,4 @@ remoting.connectHostWithWcs = function() {
remoting.oauth2.callWithToken(createPluginAndConnect);
}
-// Don't delete this!
}());
« no previous file with comments | « remoting/webapp/me2mom/choice.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698