Commit ffd71248 authored by pfeldman's avatar pfeldman Committed by Commit bot

DevTools: update remote discovery page, render both title and url for items.

NOTRY=true
BUG=425600

Review URL: https://codereview.chromium.org/637863006

Cr-Commit-Position: refs/heads/master@{#300649}
parent e9f2732b
...@@ -3,82 +3,81 @@ ...@@ -3,82 +3,81 @@
<title>Inspectable pages</title> <title>Inspectable pages</title>
<style> <style>
body { body {
background-color: rgb(245, 245, 245); color: #222;
font-family: Helvetica, Arial, sans-serif; font-family: Helvetica, Arial, sans-serif;
margin: 0;
text-shadow: rgba(255, 255, 255, 0.496094) 0px 1px 0px; text-shadow: rgba(255, 255, 255, 0.496094) 0px 1px 0px;
} }
#caption { #caption {
color: black;
font-size: 16px; font-size: 16px;
margin-top: 30px; margin-top: 15px;
margin-bottom: 0px; margin-bottom: 10px;
margin-left: 70px; margin-left: 20px;
height: 20px; height: 20px;
text-align: left; text-align: left;
} }
#items { #items {
display: -webkit-box; display: flex;
margin-left: 60px; flex-direction: column;
margin-right: 60px; margin: 10px;
-webkit-box-orient: horizontal;
-webkit-box-lines: multiple;
} }
.frontend_ref { .item {
color: black; color: #222;
text-decoration: initial; display: flex;
flex-direction: row;
text-decoration: none;
padding: 10px;
-webkit-transition-property: background-color, border-color;
-webkit-transition: background-color 0.15s, 0.15s;
-webkit-transition-delay: 0, 0;
} }
.thumbnail { .thumbnail {
background-attachment: scroll; background-attachment: scroll;
background-origin: padding-box; background-origin: padding-box;
background-repeat: no-repeat; background-repeat: no-repeat;
border: 4px solid rgba(184, 184, 184, 1); border: 1px solid rgba(184, 184, 184, 1);
border-radius: 5px; flex: none;
height: 132px; height: 132px;
width: 212px; width: 212px;
-webkit-transition-property: background-color, border-color;
-webkit-transition: background-color 0.15s, 0.15s;
-webkit-transition-delay: 0, 0;
} }
.thumbnail:hover { .item:not(.connected):hover {
background-color: rgba(242, 242, 242, 1); background-color: rgba(242, 242, 242, 1);
border-color: rgba(110, 116, 128, 1); border-color: rgba(110, 116, 128, 1);
color: black; color: black;
} }
.thumbnail.connected { .item.connected .thumbnail {
opacity: 0.5; opacity: 0.5;
} }
.thumbnail.connected:hover { .item.connected:hover {
border-color: rgba(184, 184, 184, 1); border-color: rgba(184, 184, 184, 1);
color: rgb(110, 116, 128); color: rgb(110, 116, 128);
} }
.item { .description {
display: inline-block; display: flex;
margin: 5px; flex-direction: column;
margin-top: 15px;
height: 162px;
vertical-align: top;
width: 222px;
} }
.text { .title, .subtitle {
background: no-repeat 0; font-size: 13px;
background-size: 16px; margin: 4px 0px 0px 6px;
font-size: 12px;
margin: 4px 0px 0px 4px;
overflow: hidden; overflow: hidden;
padding: 2px 0px 0px 20px; padding-left: 20px;
text-align: left;
text-overflow: ellipsis;
white-space: nowrap;
} }
.title {
background-repeat: no-repeat;
background-size: 16px;
font-size: 15px;
}
</style> </style>
<script> <script>
...@@ -112,44 +111,49 @@ function overrideFrontendUrl(item) { ...@@ -112,44 +111,49 @@ function overrideFrontendUrl(item) {
} }
function appendItem(item_object) { function appendItem(item_object) {
var frontend_ref; var item_element;
if (item_object.devtoolsFrontendUrl) { if (item_object.devtoolsFrontendUrl) {
frontend_ref = document.createElement('a'); item_element = document.createElement('a');
frontend_ref.href = overrideFrontendUrl(item_object); item_element.href = overrideFrontendUrl(item_object);
frontend_ref.title = item_object.title; item_element.title = item_object.title;
} else { } else {
frontend_ref = document.createElement('div'); item_element = document.createElement('div');
frontend_ref.title = 'The tab already has an active debug session'; item_element.className = 'connected';
item_element.title = 'The tab already has an active debug session';
} }
frontend_ref.className = 'frontend_ref'; item_element.classList.add('item');
var thumbnail = document.createElement('div'); var thumbnail = document.createElement('div');
thumbnail.className = item_object.devtoolsFrontendUrl ? thumbnail.className = 'thumbnail';
'thumbnail' : 'thumbnail connected';
thumbnail.style.cssText = 'background-image:url(' + thumbnail.style.cssText = 'background-image:url(' +
item_object.thumbnailUrl + item_object.thumbnailUrl + ')';
')'; item_element.appendChild(thumbnail);
frontend_ref.appendChild(thumbnail);
var description = document.createElement('div');
var text = document.createElement('div'); description.className = 'description';
text.className = 'text';
text.innerText = item_object.description || item_object.title; var title = document.createElement('div');
text.style.cssText = 'background-image:url(' + title.className = 'title';
item_object.faviconUrl + ')'; title.textContent = item_object.description || item_object.title;
frontend_ref.appendChild(text); title.style.cssText = 'background-image:url(' +
item_object.faviconUrl + ')';
var item = document.createElement('p'); description.appendChild(title);
item.className = 'item';
item.appendChild(frontend_ref); var subtitle = document.createElement('div');
subtitle.className = 'subtitle';
document.getElementById('items').appendChild(item); subtitle.textContent = (item_object.url || '').substring(0, 300);
description.appendChild(subtitle);
item_element.appendChild(description);
document.getElementById('items').appendChild(item_element);
} }
</script> </script>
</head> </head>
<body onload='onLoad()'> <body onload='onLoad()'>
<div id='caption'>Inspectable pages</div> <div id='caption'>Inspectable pages</div>
<hr>
<div id='items'> <div id='items'>
</div> </div>
<hr>
</body> </body>
</html> </html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment