OLD | NEW |
1 <!-- TODO(crbug.com/603217): Use i18n instead of string literals. Figure out | 1 <!-- TODO(crbug.com/603217): Use i18n instead of string literals. Figure out |
2 what i18n to use for keypad, ie, does 1 ABC make | 2 what i18n to use for keypad, ie, does 1 ABC make |
3 sense in every scenario? --> | 3 sense in every scenario? --> |
4 | 4 |
5 <link rel="import" href="chrome://resources/cr_elements/icons.html"> | 5 <link rel="import" href="chrome://resources/cr_elements/icons.html"> |
6 <link rel="import" href="chrome://resources/html/i18n_behavior.html"> | 6 <link rel="import" href="chrome://resources/html/i18n_behavior.html"> |
7 <link rel="import" href="chrome://resources/html/polymer.html"> | 7 <link rel="import" href="chrome://resources/html/polymer.html"> |
8 <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-butt
on.html"> | 8 <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-butt
on.html"> |
9 <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/color.html
"> | 9 <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/color.html
"> |
10 <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.htm
l"> | 10 <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.htm
l"> |
(...skipping 20 matching lines...) Expand all Loading... |
31 } | 31 } |
32 | 32 |
33 .input-non-pin { | 33 .input-non-pin { |
34 direction: rtl; | 34 direction: rtl; |
35 } | 35 } |
36 | 36 |
37 .row { | 37 .row { |
38 display: flex; | 38 display: flex; |
39 } | 39 } |
40 | 40 |
| 41 .row.first-row { |
| 42 height: 64px; |
| 43 } |
| 44 |
41 .digit-button { | 45 .digit-button { |
42 align-items: center; | 46 align-items: center; |
43 background: none; | 47 background: none; |
44 border-radius: 20px; | 48 border-radius: 20px; |
45 box-sizing: border-box; | 49 box-sizing: border-box; |
46 color: var(--paper-blue-grey-700); | 50 color: var(--paper-blue-grey-700); |
47 display: flex; | 51 display: flex; |
48 flex-direction: column; | 52 flex-direction: column; |
49 font-size: 32px; | 53 font-size: 32px; |
50 height: 70px; | 54 height: 70px; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 width: 100%; | 109 width: 100%; |
106 } | 110 } |
107 | 111 |
108 .digit-button inner-text { | 112 .digit-button inner-text { |
109 color: var(--paper-blue-grey-700); | 113 color: var(--paper-blue-grey-700); |
110 display: flex; | 114 display: flex; |
111 flex-direction: column; | 115 flex-direction: column; |
112 height: 52px; | 116 height: 52px; |
113 } | 117 } |
114 | 118 |
115 .first-row { | |
116 height: 64px; | |
117 min-height: 64px; | |
118 padding: 28px 15px 12px 15px; | |
119 } | |
120 | |
121 #pin-input { | 119 #pin-input { |
122 -webkit-text-security: disc; | 120 -webkit-text-security: disc; |
123 background-color: white; | 121 background-color: white; |
124 border: 0; | 122 border: 0; |
125 box-sizing: border-box; | 123 box-sizing: border-box; |
126 font-size: 18px; | 124 font-size: 18px; |
127 height: 64px; | 125 height: 64px; |
128 left: 20px; | 126 left: 20px; |
129 outline: 0; | 127 outline: 0; |
130 padding: 28px 3px 12px 3px; | 128 padding: 28px 3px 12px 3px; |
(...skipping 14 matching lines...) Expand all Loading... |
145 margin: 0; | 143 margin: 0; |
146 } | 144 } |
147 | 145 |
148 /* Ensure that all children of paper-button do not consume events. This | 146 /* Ensure that all children of paper-button do not consume events. This |
149 * simplifies the event handler code. */ | 147 * simplifies the event handler code. */ |
150 paper-button * { | 148 paper-button * { |
151 pointer-events: none; | 149 pointer-events: none; |
152 } | 150 } |
153 </style> | 151 </style> |
154 | 152 |
155 <div id="root"> | 153 <div id="root" on-keypress="onKeyPress_" on-keydown="onKeyDown_"> |
156 <div id="container-constrained-width"> | 154 <div id="container-constrained-width"> |
157 <div class="row"> | 155 <div class="row first-row"> |
158 <input id="pin-input" type="[[getInputType_(enablePassword)]]" | 156 <input id="pin-input" type="[[getInputType_(enablePassword)]]" |
159 class$="[[getInputClass_(value)]] | 157 class$="[[getInputClass_(value)]] |
160 [[getSubmitHiddenClass_(enableSubmitButton)]]" | 158 [[getSubmitHiddenClass_(enableSubmitButton)]]" |
161 placeholder="[[getInputPlaceholder_(enablePassword)]]" | 159 placeholder="[[getInputPlaceholder_(enablePassword)]]" |
162 value="{{value::input}}" | 160 value="{{value::input}}" |
163 on-keydown="onInputKeyDown_"></input> | 161 on-keydown="onInputKeyDown_" |
164 <paper-button class$="digit-button first-row submit-button | 162 hidden=[[!showInput]]> |
165 [[getSubmitHiddenClass_(enableSubmitButton)]]" | 163 </input> |
166 on-tap="firePinSubmitEvent_"> | |
167 <div class$="icon-container [[getSubmitClass_(value)]]"> | |
168 <iron-icon class="icon" icon="pin-keyboard:forward"><iron-icon> | |
169 </div> | |
170 </paper-button> | |
171 </div> | 164 </div> |
172 | 165 |
173 <div class="row keyboard"> | 166 <div class="row keyboard"> |
174 <paper-button class="digit-button" on-tap="onNumberTap_" value="1"> | 167 <paper-button class="digit-button" on-tap="onNumberTap_" value="1"> |
175 <inner-text>$i18n{pinKeyboard1}</inner-text> | 168 <inner-text>$i18n{pinKeyboard1}</inner-text> |
176 </paper-button> | 169 </paper-button> |
177 <paper-button class="digit-button center-button" on-tap="onNumberTap_" | 170 <paper-button class="digit-button center-button" on-tap="onNumberTap_" |
178 value="2"> | 171 value="2"> |
179 <inner-text>$i18n{pinKeyboard2}</inner-text> | 172 <inner-text>$i18n{pinKeyboard2}</inner-text> |
180 </paper-button> | 173 </paper-button> |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 <inner-text class="icon-subheading"> | 212 <inner-text class="icon-subheading"> |
220 $i18n{pinKeyboardClear} | 213 $i18n{pinKeyboardClear} |
221 </inner-text> | 214 </inner-text> |
222 </paper-button> | 215 </paper-button> |
223 </div> | 216 </div> |
224 </div> | 217 </div> |
225 </div> | 218 </div> |
226 </template> | 219 </template> |
227 <script src="pin_keyboard.js"></script> | 220 <script src="pin_keyboard.js"></script> |
228 </dom-module> | 221 </dom-module> |
OLD | NEW |