openvibers/openvibe.codes Commits
Pair-it-first lands on the pairing act (#395)
Changes
@@@ -531,7 +531,7 @@ function createChatRoutes(ctx) {function whereAgents(list) {const tail = '<span class="ch-where-tail">in a fresh copy of the code, with a pull request at the end</span>';if (list == null) return `${ico('machines')}<span>Runs on your computer ${tail}</span>`;-- if (!list.length) return `${ico('machines')}<span>Runs on your computer. <a href="https://openvibe.my/#machines">Pair it first</a>: it takes a minute, and the task waits for it.</span>`;++ if (!list.length) return `${ico('machines')}<span>Runs on your computer. <a href="https://openvibe.link/machines#pair">Pair it first</a>: it takes a minute, and the task waits for it.</span>`;const on = list.find((m) => m.state === 'online');const m = on || list[0];const name = esc(m.name || m.node_id || 'your computer');nnew file mode 100644@@@ -0,0 +1,13 @@++'use strict';++// Codes points a person with no machines at the Link hub's pairing act, not the old hub anchor.++const assert = require('assert');++const fs = require('fs');++const path = require('path');++++const CHAT = fs.readFileSync(path.join(__dirname, '..', 'server/http/chat.js'), 'utf8');++const m = CHAT.match(/<a href="([^"]+)">Pair it first<\/a>/);++assert.ok(m, 'the Pair-it-first link exists');++assert.strictEqual(m[1], 'https://openvibe.link/machines#pair', 'it lands on the pairing act');++assert.ok(!CHAT.includes('openvibe.my/#machines'), 'no stale hub anchor remains in chat.js');++++console.log('chat-pair-link.test.js: all assertions passed');
@@ -531,7 +531,7 @@ function createChatRoutes(ctx) {
@@ -531,7 +531,7 @@ function createChatRoutes(ctx) {
function whereAgents(list) {
function whereAgents(list) {
const tail = '<span class="ch-where-tail">in a fresh copy of the code, with a pull request at the end</span>';
const tail = '<span class="ch-where-tail">in a fresh copy of the code, with a pull request at the end</span>';
if (list == null) return `${ico('machines')}<span>Runs on your computer ${tail}</span>`;
if (list == null) return `${ico('machines')}<span>Runs on your computer ${tail}</span>`;
- if (!list.length) return `${ico('machines')}<span>Runs on your computer. <a href="https://openvibe.my/#machines">Pair it first</a>: it takes a minute, and the task waits for it.</span>`;
+ if (!list.length) return `${ico('machines')}<span>Runs on your computer. <a href="https://openvibe.link/machines#pair">Pair it first</a>: it takes a minute, and the task waits for it.</span>`;
const on = list.find((m) => m.state === 'online');
const on = list.find((m) => m.state === 'online');
const m = on || list[0];
const m = on || list[0];
const name = esc(m.name || m.node_id || 'your computer');
const name = esc(m.name || m.node_id || 'your computer');
new file mode 100644
new file mode 100644
@@ -0,0 +1,13 @@
@@ -0,0 +1,13 @@
+'use strict';
+// Codes points a person with no machines at the Link hub's pairing act, not the old hub anchor.
+const assert = require('assert');
+const fs = require('fs');
+const path = require('path');
+
+const CHAT = fs.readFileSync(path.join(__dirname, '..', 'server/http/chat.js'), 'utf8');
+const m = CHAT.match(/<a href="([^"]+)">Pair it first<\/a>/);
+assert.ok(m, 'the Pair-it-first link exists');
+assert.strictEqual(m[1], 'https://openvibe.link/machines#pair', 'it lands on the pairing act');
+assert.ok(!CHAT.includes('openvibe.my/#machines'), 'no stale hub anchor remains in chat.js');
+
+console.log('chat-pair-link.test.js: all assertions passed');