@@ -11,73 +11,84 @@ class ButtonBuilder
11
11
@ button ({
12
12
value : " #{ num} "
13
13
class : " jc--button jc--button-number"
14
+ ariaLabel : " #{ num} "
14
15
}, opts)
15
16
16
17
decimal : (opts )->
17
18
@ button ({
18
19
value : " ."
19
- class : " jc--button jc--button-decimal decimalButton"
20
+ class : " jc--button jc--button-decimal"
21
+ ariaLabel : " Decimal Separator"
20
22
}, opts)
21
23
22
24
negative : (opts )->
23
25
@ button ({
24
26
value : " negative"
25
27
label : " (–)"
26
28
class : " jc--button jc--button-negative"
29
+ ariaLabel : " Negative"
27
30
}, opts)
28
31
29
32
# Operations
30
33
addition : (opts )->
31
34
@ button ({
32
35
value : " +"
33
- class : " jc--button jc--button-operation jc--button-add addButton"
36
+ class : " jc--button jc--button-operation jc--button-add"
37
+ ariaLabel : " Plus"
34
38
}, opts)
35
39
36
40
subtraction : (opts )->
37
41
@ button ({
38
42
value : " -"
39
43
label : " −"
40
44
class : " jc--button jc--button-operation jc--button-subtract"
45
+ ariaLabel : " Minus"
41
46
}, opts)
42
47
43
48
multiplication : (opts )->
44
49
@ button ({
45
50
value : " *"
46
51
label : " ×"
47
52
class : " jc--button jc--button-operation jc--button-multiply"
53
+ ariaLabel : " Multiply by"
48
54
}, opts)
49
55
50
56
division : (opts )->
51
57
@ button ({
52
58
value : " /"
53
59
label : " ÷"
54
60
class : " jc--button jc--button-operation jc--button-divide"
61
+ ariaLabel : " Divide by"
55
62
}, opts)
56
63
57
64
equals : (opts )->
58
65
@ button ({
59
66
value : " ="
60
- class : " jc--button jc--button-operation jc--button-equal equalButton"
67
+ class : " jc--button jc--button-operation jc--button-equal"
68
+ ariaLabel : " Equals"
61
69
}, opts)
62
70
63
71
# Other functions
64
72
lparen : (opts )->
65
73
@ button ({
66
74
value : " ("
67
75
class : " jc--button jc--button-other jc--button-rParen"
76
+ ariaLabel : " Left parenthesis"
68
77
}, opts)
69
78
70
79
rparen : (opts )->
71
80
@ button ({
72
81
value : " )"
73
82
class : " jc--button jc--button-other jc--button-lParen"
83
+ ariaLabel : " Right parenthesis"
74
84
}, opts)
75
85
76
86
pi : (opts )->
77
87
@ button ({
78
88
value : " pi"
79
89
label : " π"
80
90
class : " jc--button jc--button-other jc--button-pi"
91
+ ariaLabel : " Pi"
81
92
}, opts)
82
93
83
94
fraction : (opts )->
@@ -91,6 +102,7 @@ class ButtonBuilder
91
102
@ button ({
92
103
value : " ^"
93
104
class : " jc--button jc--button-other jc--button-caret"
105
+ ariaLabel : " Caret"
94
106
}, opts)
95
107
96
108
exponent : (opts )->
@@ -100,6 +112,7 @@ class ButtonBuilder
100
112
value : " exponent"
101
113
label : " #{ base} <sup>#{ power} </sup>"
102
114
class : " jc--button jc--button-other jc--button-exponent jc--button-exponent-#{ base} to#{ power} "
115
+ ariaLabel : " Square"
103
116
}, opts)
104
117
105
118
root : (opts )->
@@ -109,6 +122,7 @@ class ButtonBuilder
109
122
value : " root"
110
123
label : if degree then " <sup>#{ degree} </sup>√#{ radicand} " else " √#{ radicand} "
111
124
class : " jc--button jc--button-other jc--button-root jc--button-root-#{ degree} of#{ radicand} "
125
+ ariaLabel : " Square root"
112
126
}, opts)
113
127
114
128
# EQ builder vars
@@ -136,6 +150,7 @@ class ButtonBuilder
136
150
value : " clear"
137
151
label : " Clear"
138
152
class : " jc--button jc--button-clear"
153
+ ariaLabel : " Clear"
139
154
}, opts)
140
155
141
156
button : (type_opts , opts )->
0 commit comments