From 874f52629b1c8e435d3a64f231a8903f166ad0b6 Mon Sep 17 00:00:00 2001 From: Fabien Benetou Date: Fri, 3 Feb 2023 09:35:33 +0100 Subject: [PATCH] extended keyboard --- index.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 194ebbe..012674f 100644 --- a/index.html +++ b/index.html @@ -107,7 +107,12 @@ const startingText = "[]" var drawingMode = false var added = [] const maxItemsFromSources = 20 -let alphabet = ['abcdefghijklmnopqrstuvwxyz', '0123456789', '<>']; +let alphabet = [ // arguably not clearer than 'abcde...' but more flexible so can consider other chracters + Array.from({ length: 26 }, (e, i) => String.fromCharCode(i + 65)).join(''), + Array.from({ length: 26 }, (e, i) => String.fromCharCode(i + 97)).join(''), + Array.from({ length: 10 }, (e, i) => String.fromCharCode(i + 48)).join(''), + Array.from({ length: 95 }, (e, i) => String.fromCharCode(i + 32)).filter( c => !c.match(/[a-zA-Z0-9]/) ).join(''), + '<>'] var commandhistory = [] const savedProperties = [ "src", "position", "rotation", "scale", "value", ] // add newer properties e.g visibility and generator as class var groupSelection = []