-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
104 lines (93 loc) · 2.23 KB
/
main.js
File metadata and controls
104 lines (93 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
var NatoAlphabet = {
"a": "Alpha",
"b": "Bravo",
"c": "Charlie",
"d": "Delta",
"e": "Echo",
"f": "Foxtrot",
"g": "Golf",
"h": "Hotel",
"i": "India",
"j": "Juliett",
"k": "Kilo",
"l": "Lima",
"m": "Mike",
"n": "November",
"o": "Oscar",
"p": "Papa",
"q": "Quebec",
"r": "Romeo",
"s": "Siera",
"t": "Tango",
"u": "Uniform",
"v": "Victor",
"w": "Wiskey",
"x": "X-ray",
"y": "Yankee",
"z": "Zulu",
"1": "One",
"2": "Two",
"3": "Three",
"4": "Four",
"5": "Five",
"6": "Six",
"7": "Seven",
"8": "Eight",
"9": "Nine",
"0": "Zero",
"`": "Accent mark",
"~": "Tidle",
"!": "Bang",
"@": "At Symbol",
"#": "Hashtag or Pound Sign",
"$": "Dollar Sign",
"%": "Percent Sign",
"^": "Carrot Symbol",
"&": "Ampersand",
"*": "Asterisk",
"(": "Left Parentheses",
")": "Right Parentheses",
"-": "Minus",
"_": "Underscore",
"=": "Equals",
"+": "Plus",
"[": "Left bracket",
"]": "Right bracket",
"{": "Left Curly bracket",
"}": "Right Curly bracket",
"\\": "Back Slash",
"|": "Pipe",
";": "Semicolon",
":":"Colon",
"'":"Apostrophe",
"\"":"Quotation",
",":"Comma",
".":"Period",
"/":"Forward Slash",
"<":"Less Than",
">":"Greater Than",
"?":"Question Mark"
}
var textToTranscribe = "";
var transcribedOutput = document.getElementById("transcribedOutput");
var arrayToTranscribe = []
function transcribeOnClick(){
transcribedOutput.innerHTML = ""
textToTranscribe = document.getElementById("textToTranscribe").value;
convertStringToArray();
arrayToTranscribe.forEach(transcribeChar)
}
function convertStringToArray(){
arrayToTranscribe = Array.from(textToTranscribe);
console.log(arrayToTranscribe);
}
function transcribeChar(index){
if(index == " "){
transcribedOutput.innerHTML += '<div class="form-check"><input class="form-check-input" type="checkbox" value="" id="flexCheckChecked"><label class="form-check-label" for="flexCheckChecked"><b>'+
'SPACE' +
'</b></label></div>';
}else{
transcribedOutput.innerHTML +='<div class="form-check"><input class="form-check-input" type="checkbox" value="" id="flexCheckChecked"><label class="form-check-label" for="flexCheckChecked">'+
index.toUpperCase() + " as in " + "<b>" + NatoAlphabet[index.toLowerCase()] + '</b></label></div>';
}
}