ui: rename the SCP81 script templates to Explore ISD / Delete AID (v3.1.3)
'Explore' and 'Delete' were ambiguous next to the other SCP81 actions. - template selector: Explore -> Explore ISD, Delete -> Delete AID (EN/RU); - a new Explore script is named 'Explore ISD'; the Delete template keeps its count-based name (e.g. 'Delete 2 AIDs'); - new scriptKindLabel() maps the stored kinds (unchanged: explore/delete/install/empty, so existing localStorage scripts keep working) to those labels and is now used for the scripts table kind column, which used to print the raw lowercase kind untranslated; - docs: help EN/RU, README/RUS, docs/api.md examples, AGENTS; - sw.js simple-v238.
This commit is contained in:
@@ -31,11 +31,20 @@ eval(extractFunc(html, 'scp81LogLine'));
|
||||
eval(extractFunc(html, 'scp81LogEntryHtml'));
|
||||
eval(extractFunc(html, 'scp81GroupResults'));
|
||||
eval(extractFunc(html, 'scp81ScriptStateText'));
|
||||
eval(extractFunc(html, 'scriptKindLabel'));
|
||||
global.esc = (s) => String(s == null ? '' : s)
|
||||
.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
||||
|
||||
test('explore template is the reference administration sequence', () => {
|
||||
const m = /const SCP81_EXPLORE_APDUS = \[(.*?)\];/s.exec(html);
|
||||
test('scriptKindLabel maps the stored kinds to the template labels', () => {
|
||||
assert.strictEqual(scriptKindLabel('explore'), 'Explore ISD');
|
||||
assert.strictEqual(scriptKindLabel('Explore'), 'Explore ISD');
|
||||
assert.strictEqual(scriptKindLabel('delete'), 'Delete AID');
|
||||
assert.strictEqual(scriptKindLabel('install'), 'Install from .cap');
|
||||
assert.strictEqual(scriptKindLabel('empty'), 'Empty');
|
||||
assert.strictEqual(scriptKindLabel(undefined), 'Empty');
|
||||
});
|
||||
|
||||
test('explore template is the reference administration sequence', () => { const m = /const SCP81_EXPLORE_APDUS = \[(.*?)\];/s.exec(html);
|
||||
assert.ok(m, 'SCP81_EXPLORE_APDUS not found');
|
||||
const apdus = [...m[1].matchAll(/'([0-9A-F]+)'/g)].map(x => x[1]);
|
||||
assert.deepStrictEqual(apdus, ['80CAFF2100', '80F28002024F0000', '80CA008500',
|
||||
|
||||
Reference in New Issue
Block a user