openvibers/openvibe.actor Commits
What the agent last saw is a glance (at most 720 px wide on a wide screen, so How it went stays in view) and opens full size (#140)
Changes
@@@ -128,6 +128,7 @@ button.sc-btn.sc-primary { border: 0; }.desk-card[hidden] { display: none; }.last-look { margin: 0 0 18px; }.last-look[hidden] { display: none; }++.last-look a { display: block; width: fit-content; max-width: min(100%, 720px); }.last-look img { display: block; max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line, rgba(127, 127, 127, 0.3)); }.last-look figcaption { margin-top: 6px; }.desk-card p { margin: 0; flex: 1 1 260px; }@@@ -80,7 +80,9 @@var img = document.getElementById('last-look-img');img.removeAttribute('width');img.removeAttribute('height');-- img.setAttribute('src', '/tasks/' + encodeURIComponent(id) + '/look?at=' + Date.now());++ var src = '/tasks/' + encodeURIComponent(id) + '/look?at=' + Date.now();++ img.setAttribute('src', src);++ document.getElementById('last-look-link').setAttribute('href', src);lastLook.hidden = false;}function onOutput(e) {@@@ -345,7 +345,7 @@ ${open ? html`<section class="desk-card" id="desk-card" aria-live="polite"${desk<a class="sc-btn sc-primary" id="desk-link" href="${desk ? desk.url : botPages}" rel="noopener" target="_blank">Watch and take over</a></section>` : ''}${open || look ? html`<figure class="last-look" id="last-look"${look ? '' : raw(' hidden')}>--<img id="last-look-img" src="${look ? `/tasks/${row.id}/look?at=${look.at}` : ''}" alt="The screen your agent last looked at"${look && look.width ? raw(` width="${Number(look.width)}" height="${Number(look.height)}"`) : ''} loading="lazy">++<a id="last-look-link" href="${look ? `/tasks/${row.id}/look?at=${look.at}` : '#'}" target="_blank" rel="noopener" title="Open it full size"><img id="last-look-img" src="${look ? `/tasks/${row.id}/look?at=${look.at}` : ''}" alt="The screen your agent last looked at"${look && look.width ? raw(` width="${Number(look.width)}" height="${Number(look.height)}"`) : ''} loading="lazy"></a><figcaption class="muted small">What your agent last saw on the screen${look ? html` · ${time(new Date(look.at).toISOString())}` : ''}</figcaption></figure>` : ''}<section class="how" aria-labelledby="h-how"><h2 id="h-how">How it went</h2>
@@ -128,6 +128,7 @@ button.sc-btn.sc-primary { border: 0; }
@@ -128,6 +128,7 @@ button.sc-btn.sc-primary { border: 0; }
.desk-card[hidden] { display: none; }
.desk-card[hidden] { display: none; }
.last-look { margin: 0 0 18px; }
.last-look { margin: 0 0 18px; }
.last-look[hidden] { display: none; }
.last-look[hidden] { display: none; }
+.last-look a { display: block; width: fit-content; max-width: min(100%, 720px); }
.last-look img { display: block; max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line, rgba(127, 127, 127, 0.3)); }
.last-look img { display: block; max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line, rgba(127, 127, 127, 0.3)); }
.last-look figcaption { margin-top: 6px; }
.last-look figcaption { margin-top: 6px; }
.desk-card p { margin: 0; flex: 1 1 260px; }
.desk-card p { margin: 0; flex: 1 1 260px; }
@@ -80,7 +80,9 @@
@@ -80,7 +80,9 @@
var img = document.getElementById('last-look-img');
var img = document.getElementById('last-look-img');
img.removeAttribute('width');
img.removeAttribute('width');
img.removeAttribute('height');
img.removeAttribute('height');
- img.setAttribute('src', '/tasks/' + encodeURIComponent(id) + '/look?at=' + Date.now());
+ var src = '/tasks/' + encodeURIComponent(id) + '/look?at=' + Date.now();
+ img.setAttribute('src', src);
+ document.getElementById('last-look-link').setAttribute('href', src);
lastLook.hidden = false;
lastLook.hidden = false;
}
}
function onOutput(e) {
function onOutput(e) {
@@ -345,7 +345,7 @@ ${open ? html`<section class="desk-card" id="desk-card" aria-live="polite"${desk
@@ -345,7 +345,7 @@ ${open ? html`<section class="desk-card" id="desk-card" aria-live="polite"${desk
<a class="sc-btn sc-primary" id="desk-link" href="${desk ? desk.url : botPages}" rel="noopener" target="_blank">Watch and take over</a>
<a class="sc-btn sc-primary" id="desk-link" href="${desk ? desk.url : botPages}" rel="noopener" target="_blank">Watch and take over</a>
</section>` : ''}
</section>` : ''}
${open || look ? html`<figure class="last-look" id="last-look"${look ? '' : raw(' hidden')}>
${open || look ? html`<figure class="last-look" id="last-look"${look ? '' : raw(' hidden')}>
-<img id="last-look-img" src="${look ? `/tasks/${row.id}/look?at=${look.at}` : ''}" alt="The screen your agent last looked at"${look && look.width ? raw(` width="${Number(look.width)}" height="${Number(look.height)}"`) : ''} loading="lazy">
+<a id="last-look-link" href="${look ? `/tasks/${row.id}/look?at=${look.at}` : '#'}" target="_blank" rel="noopener" title="Open it full size"><img id="last-look-img" src="${look ? `/tasks/${row.id}/look?at=${look.at}` : ''}" alt="The screen your agent last looked at"${look && look.width ? raw(` width="${Number(look.width)}" height="${Number(look.height)}"`) : ''} loading="lazy"></a>
<figcaption class="muted small">What your agent last saw on the screen${look ? html` · ${time(new Date(look.at).toISOString())}` : ''}</figcaption>
<figcaption class="muted small">What your agent last saw on the screen${look ? html` · ${time(new Date(look.at).toISOString())}` : ''}</figcaption>
</figure>` : ''}
</figure>` : ''}
<section class="how" aria-labelledby="h-how"><h2 id="h-how">How it went</h2>
<section class="how" aria-labelledby="h-how"><h2 id="h-how">How it went</h2>