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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
ash / webui / diagnostics_ui / resources / keyboard_tester.html [blame]
<style include="diagnostics-shared">
@media (min-width: 600px) {
:host {
--cr-dialog-width: 504px;
}
}
@media (min-width: 768px) {
:host {
--cr-dialog-width: 636px;
}
}
@media (min-width: 960px) {
:host {
--cr-dialog-width: 672px;
}
}
@media (min-width: 1280px) {
:host {
--cr-dialog-width: 960px;
}
}
:host {
--cr-dialog-body-padding-horizontal: 24px;
}
:host-context(body.jelly-enabled) keyboard-diagram {
--diagram-bg-color: var(--cros-sys-base_elevated);
}
:host-context(body.jelly-enabled) #help {
color: var( --cros-text-color-primary);
}
:host-context(body.jelly-enabled) [slot='title'] {
font: var(--cros-title-1-font);
}
:host-context(body.jelly-enabled) #description {
font: var(--cros-body-1-font);
}
:host-context(body.jelly-enabled) #help {
font: var(--cros-body-2-font);
}
:host-context(body.jelly-enabled) #shortcutInstruction {
font: var(--cros-body-1-font);
}
:host-context(body.jelly-enabled) #shortcutKeyAlt,
:host-context(body.jelly-enabled) #shortcutKeyEsc {
font: var(--cros-body-2-font);
}
[slot='title'] {
font-family: var(--diagnostics-google-sans-font-family);
font-size: 16px;
font-weight: var(--diagnostics-medium-font-weight);
line-height: 24px;
padding-bottom: 4px;
padding-inline-end: var(--cr-dialog-body-padding-horizontal);
padding-inline-start: var(--cr-dialog-body-padding-horizontal);
padding-top: var(--cr-dialog-body-padding-horizontal);
}
[slot='button-container'] {
padding-bottom: 20px;
padding-inline-end: var(--cr-dialog-body-padding-horizontal);
padding-inline-start: var(--cr-dialog-body-padding-horizontal);
padding-top: 68px;
}
#description {
font-family: var(--diagnostics-roboto-font-family);
font-size: 14px;
font-weight: var(--diagnostics-regular-font-weight);
line-height: 20px;
margin: 0;
padding-bottom: 8px;
}
#diagram-border {
border: 1px solid var(--cros-text-color-selection);
border-radius: 8px;
padding: 6px;
}
#help {
align-self: center;
flex-grow: 1;
font-family: var(--diagnostics-roboto-font-family);
font-size: 13px;
font-weight: var(--diagnostics-regular-font-weight);
line-height: 20px;
}
a[href] {
color: var(--cros-link-color);
text-decoration: none;
}
#lostFocusToast {
bottom: 0;
left: 0;
}
cr-toast iron-icon {
--iron-icon-fill-color: var(--cros-color-prominent-inverted);
margin-inline-end: 12px;
}
#shortcutInstruction {
font-family: var(--diagnostics-roboto-font-family);
font-size: 14px;
font-weight: var(--diagnostics-regular-font-weight);
line-height: 20px;
margin:0;
padding-bottom: 24px;
}
#shortcutKeyAlt,
#shortcutKeyEsc {
border: 1px solid var(--cros-text-color-selection);
border-radius: 10px;
color: var(--cros-text-color-selection);
font-family: var(--diagnostics-roboto-font-family);
font-size: 13px;
font-weight: var(--diagnostics-medium-font-weight);
line-height: 20px;
margin: 0 2px;
padding: 0 6px;
}
</style>
<cr-dialog id="dialog" on-close="handleClose">
<div slot="title" aria-describedby="description shortcutInstruction">[[i18n('keyboardTesterTitle')]]</div>
<div slot="body">
<p id="description">[[getDescriptionLabel()]]</p>
<p id="shortcutInstruction" inner-h-t-m-l="[[getShortcutInstructionLabel()]]"></p>
<template is="dom-if" if="[[shouldDisplayDiagram]]">
<div id="diagram-border">
<keyboard-diagram
id="diagram"
mechanical-layout="[[diagramMechanicalLayout]]"
physical-layout="[[diagramPhysicalLayout]]"
region-code="[[keyboard.regionCode]]"
show-assistant-key="[[keyboard.hasAssistantKey]]"
show-number-pad="[[showNumberPad]]"
top-row-keys="[[topRowKeys]]"
top-right-key="[[diagramTopRightKey]]">
</keyboard-diagram>
</div>
</template>
<cr-toast id="lostFocusToast" duration="[[lostFocusToastLingerMs]]">
<iron-icon icon="diagnostics:keyboard"></iron-icon>
<!--
Though the message refers to "other windows", it also applies when
the user opens the launcher, but not if they just click another element
of the system UI (e.g. opening the quick settings).
-->
<span>[[i18n('keyboardTesterFocusLossMessage')]]</span>
</cr-toast>
</div>
<div slot="button-container">
<div id="help" inner-h-t-m-l="[[i18nAdvanced('keyboardTesterHelpLink')]]"
hidden$="[[!isLoggedIn]]">
</div>
<cr-button class="action-button" on-click="close">
[[i18n('inputTesterDone')]]
</cr-button>
</div>
</cr-dialog>