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

Unified Diff: netlog_viewer/alt_svc_view.js

Issue 2178423002: Bring the gh-pages branch up to date with the master branch (Closed) Base URL: https://github.com/catapult-project/catapult.git@gh-pages
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « netlog_viewer/alt_svc_view.html ('k') | netlog_viewer/bandwidth_view.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: netlog_viewer/alt_svc_view.js
diff --git a/netlog_viewer/alt_svc_view.js b/netlog_viewer/alt_svc_view.js
index a452b212947d1694d91e6e30286eaf2467fedd73..2df33c57238080d9908efada9156f242e3f796a6 100644
--- a/netlog_viewer/alt_svc_view.js
+++ b/netlog_viewer/alt_svc_view.js
@@ -31,6 +31,11 @@ var AltSvcView = (function() {
AltSvcView.MAIN_BOX_ID = 'alt-svc-view-tab-content';
AltSvcView.ALTERNATE_PROTOCOL_MAPPINGS_ID =
'alt-svc-view-alternate-protocol-mappings';
+ AltSvcView.MAPPINGS_CONTENT_ID =
+ 'alt-svc-view-mappings-content';
+ AltSvcView.MAPPINGS_NO_CONTENT_ID =
+ 'alt-svc-view-mappings-no-content';
+ AltSvcView.MAPPINGS_TBODY_ID = 'alt-svc-view-mappings-tbody';
cr.addSingletonGetter(AltSvcView);
@@ -51,9 +56,24 @@ var AltSvcView = (function() {
onAltSvcMappingsChanged: function(altSvcMappings) {
if (!altSvcMappings)
return false;
- // TODO(rayraymond): Update DOM without use of jstemplate.
- // var input = new JsEvalContext({altSvcMappings: altSvcMappings});
- // jstProcess(input, $(AltSvcView.ALTERNATE_PROTOCOL_MAPPINGS_ID));
+
+ var hasMappings = altSvcMappings && altSvcMappings.length > 0;
+
+ setNodeDisplay($(AltSvcView.MAPPINGS_CONTENT_ID), hasMappings);
+ setNodeDisplay($(AltSvcView.MAPPINGS_NO_CONTENT_ID), !hasMappings);
+
+ var tbody = $(AltSvcView.MAPPINGS_TBODY_ID);
+ tbody.innerHTML = '';
+
+ // Fill in the alternate service mappings table.
+ for (var i = 0; i < altSvcMappings.length; ++i) {
+ var a = altSvcMappings[i];
+ var tr = addNode(tbody, 'tr');
+
+ addNodeWithText(tr, 'td', a.server);
+ addNodeWithText(tr, 'td', a.alternative_service);
+ }
+
return true;
}
};
« no previous file with comments | « netlog_viewer/alt_svc_view.html ('k') | netlog_viewer/bandwidth_view.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698