@kolbo/mcp 1.31.1 → 1.31.2
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
package/src/apps/html.js
CHANGED
|
@@ -33,6 +33,12 @@ function esc(s) {
|
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
function el(id) { return document.getElementById(id); }
|
|
36
|
+
// Force-download via the api.kolbo.ai proxy (CDN files open inline otherwise —
|
|
37
|
+
// browsers display images/videos instead of saving them).
|
|
38
|
+
function downloadUrl(u) {
|
|
39
|
+
if (!u) return u;
|
|
40
|
+
return 'https://api.kolbo.ai/mcp/download?url=' + encodeURIComponent(u);
|
|
41
|
+
}
|
|
36
42
|
function fmtCredits(n) { return (n == null) ? '' : (Math.round(n * 100) / 100) + ' cr'; }
|
|
37
43
|
function fmtDur(s) { if (s == null) return ''; s = Math.round(s); return s >= 60 ? Math.floor(s/60) + 'm ' + (s%60) + 's' : s + 's'; }
|
|
38
44
|
function applyTheme(ctx) {
|
|
@@ -224,7 +224,7 @@ function render3d(sc, urls) {
|
|
|
224
224
|
'<button class="k-btn" data-url="' + esc(u) + '">Download</button></div>';
|
|
225
225
|
}).join('');
|
|
226
226
|
Array.prototype.forEach.call(el('stage').querySelectorAll('.k-btn[data-url]'), function (b) {
|
|
227
|
-
b.onclick = function () { window.kolbo.openLink(b.getAttribute('data-url')); };
|
|
227
|
+
b.onclick = function () { window.kolbo.openLink(downloadUrl(b.getAttribute('data-url'))); };
|
|
228
228
|
});
|
|
229
229
|
}
|
|
230
230
|
|
|
@@ -325,7 +325,7 @@ function renderActions(sc) {
|
|
|
325
325
|
a.push('<button class="k-btn ghost" id="btn-open">Open in Kolbo ↗</button>');
|
|
326
326
|
el('actions').innerHTML = a.join('');
|
|
327
327
|
|
|
328
|
-
bind('btn-download', function () { window.kolbo.openLink(currentUrl()); });
|
|
328
|
+
bind('btn-download', function () { window.kolbo.openLink(downloadUrl(currentUrl())); });
|
|
329
329
|
bind('btn-open', function () { window.kolbo.openLink(state.open_url || 'https://app.kolbo.ai'); });
|
|
330
330
|
bind('btn-recreate', function () {
|
|
331
331
|
window.kolbo.sendMessage('Recreate this with the same settings' +
|
|
@@ -72,7 +72,7 @@ function boot(sc) {
|
|
|
72
72
|
a.push('<button class="k-btn ghost" id="btn-copy">Copy text</button>');
|
|
73
73
|
el('actions').innerHTML = a.join('');
|
|
74
74
|
Array.prototype.forEach.call(el('actions').querySelectorAll('[data-url]'), function (b) {
|
|
75
|
-
b.onclick = function () { window.kolbo.openLink(b.getAttribute('data-url')); };
|
|
75
|
+
b.onclick = function () { window.kolbo.openLink(downloadUrl(b.getAttribute('data-url'))); };
|
|
76
76
|
});
|
|
77
77
|
var copyBtn = el('btn-copy');
|
|
78
78
|
if (copyBtn) copyBtn.onclick = function () {
|