openvibers/openvibe.tools Commits

Guide the live DNS tool run control (#304)

OP OpenVibers committed 2 days ago · 071a71ce09 · 2 files, +7 −1

Changes

ddiff --git a/apps/gateway/server/seo/frame.js b/apps/gateway/server/seo/frame.js
iindex 3204170..56d0fd6 100644
---- a/apps/gateway/server/seo/frame.js
++++ b/apps/gateway/server/seo/frame.js
@@@ -197,7 +197,11 @@ function inputFor(rec, value = '') {
inputmode: URL_TOOLS.has(rec.sub) ? 'url' : 'text',
tries: tryItems(rec).length ? { items: tryItems(rec) } : null,
});
-- return `${input}<div id="options-area" class="ovk-tool-options"></div>`;
++ // Framed tool pages use the kit's submit button, not net.html's legacy hub button.
++ const guided = rec.sub === 'dns'
++ ? input.replace('class="ovk-btn ovk-btn--primary ovk-tool-go"', 'class="ovk-btn ovk-btn--primary ovk-tool-go" data-ov-guide="tools.job"')
++ : input;
++ return `${guided}<div id="options-area" class="ovk-tool-options"></div>`;
}
const ex = rec.examples || [];
ddiff --git a/apps/gateway/test/tool-frame.test.js b/apps/gateway/test/tool-frame.test.js
iindex f37eeb3..fc61f82 100644
---- a/apps/gateway/test/tool-frame.test.js
++++ b/apps/gateway/test/tool-frame.test.js
@@@ -13,6 +13,8 @@ const { frameFor } = require('../server/seo/frame');
const PUB = path.join(__dirname, '..', 'public');
const net = (sub, q) => renderTool(path.join(PUB, 'net.html'), sub, null, q ? { q } : {});
const dev = (sub, q) => renderTool(path.join(PUB, 'dev.html'), sub, null, q ? { q } : {});
++assert.match(frameFor(CATALOG.get('dns')), /<button type="submit" class="ovk-btn ovk-btn--primary ovk-tool-go" data-ov-guide="tools.job"/,
++ 'the live framed DNS page exposes the real run control to Quest');
/** The frame's order: each marker appears once, and in this order. */
function inOrder(html, parts) {