@kolbo/mcp 1.31.3 → 1.31.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -263,16 +263,43 @@ function renderScenes(sc) {
|
|
|
263
263
|
var media = (scene.video_urls || []).map(function (u) {
|
|
264
264
|
return '<div class="k-media"><video src="' + esc(u) + '" controls playsinline></video>' + dlBtnHTML(u) + '</div>';
|
|
265
265
|
}).join('') + (scene.image_urls || []).map(function (u) {
|
|
266
|
-
return '<div class="k-media"><img src="' + esc(u) + '" alt="">' + dlBtnHTML(u) + '</div>';
|
|
266
|
+
return '<div class="k-media" data-focus="' + esc(u) + '"><img src="' + esc(u) + '" alt="">' + dlBtnHTML(u) + '</div>';
|
|
267
267
|
}).join('');
|
|
268
268
|
return '<div style="margin-bottom:14px"><div style="font-size:12px;font-weight:600;color:var(--text-muted);margin-bottom:8px">Scene ' +
|
|
269
269
|
esc(scene.scene_number) + (scene.title ? ' — ' + esc(scene.title) : '') + '</div>' +
|
|
270
270
|
'<div class="k-gen-grid n2">' + media + '</div></div>';
|
|
271
271
|
}).join('');
|
|
272
272
|
wireDlButtons(el('stage'));
|
|
273
|
+
// Click a scene image → fullscreen focus on THAT image (videos keep their
|
|
274
|
+
// native controls; clicking them shouldn't hijack playback).
|
|
275
|
+
Array.prototype.forEach.call(el('stage').querySelectorAll('.k-media[data-focus]'), function (m) {
|
|
276
|
+
m.style.cursor = 'zoom-in';
|
|
277
|
+
m.onclick = function () { focusMedia(m.getAttribute('data-focus')); };
|
|
278
|
+
});
|
|
273
279
|
renderActions(sc);
|
|
274
280
|
}
|
|
275
281
|
|
|
282
|
+
// Fullscreen a single item out of a multi-item grid (Creative Director
|
|
283
|
+
// scenes). Exit restores the grid.
|
|
284
|
+
function focusMedia(url) {
|
|
285
|
+
window.kolbo.requestDisplayMode('fullscreen').then(function (res) {
|
|
286
|
+
if (!(res && res.mode === 'fullscreen')) return window.kolbo.openLink(url);
|
|
287
|
+
isFullscreen = true;
|
|
288
|
+
el('stage').innerHTML = '<div class="k-viewer"><img id="focus-img" src="' + esc(url) + '" alt="" style="cursor:zoom-out">' + dlBtnHTML(url) + '</div>';
|
|
289
|
+
wireDlButtons(el('stage'));
|
|
290
|
+
el('focus-img').onclick = exitFocus;
|
|
291
|
+
applyFullscreen(true, exitFocus);
|
|
292
|
+
window.kolbo.notifySize();
|
|
293
|
+
}).catch(function () { window.kolbo.openLink(url); });
|
|
294
|
+
}
|
|
295
|
+
function exitFocus() {
|
|
296
|
+
window.kolbo.requestDisplayMode('inline').catch(function () {});
|
|
297
|
+
isFullscreen = false;
|
|
298
|
+
applyFullscreen(false);
|
|
299
|
+
renderScenes(state); // restore the grid
|
|
300
|
+
window.kolbo.notifySize();
|
|
301
|
+
}
|
|
302
|
+
|
|
276
303
|
function renderError(msg) {
|
|
277
304
|
clearTimeout(pollTimer);
|
|
278
305
|
|
|
@@ -302,14 +329,14 @@ function toggleFullscreen() {
|
|
|
302
329
|
if (!isFullscreen) window.kolbo.openLink(state.urls && state.urls[selected]);
|
|
303
330
|
});
|
|
304
331
|
}
|
|
305
|
-
function applyFullscreen(on) {
|
|
332
|
+
function applyFullscreen(on, exitHandler) {
|
|
306
333
|
document.documentElement.classList.toggle('k-fullscreen', on);
|
|
307
334
|
var c = el('phase-chip');
|
|
308
335
|
if (on) {
|
|
309
336
|
c.style.display = '';
|
|
310
337
|
c.innerHTML = '✕ ' + esc('Exit');
|
|
311
338
|
c.style.cursor = 'pointer';
|
|
312
|
-
c.onclick = toggleFullscreen;
|
|
339
|
+
c.onclick = exitHandler || toggleFullscreen;
|
|
313
340
|
} else {
|
|
314
341
|
c.style.display = 'none';
|
|
315
342
|
c.onclick = null;
|