| 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/html/i18n_behavior.html"> |
| 5 <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-butt
on.html"> | 6 <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-butt
on.html"> |
| 6 <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper
-icon-button.html"> | 7 <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper
-icon-button.html"> |
| 7 <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/paper-styl
es.html"> | 8 <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/paper-styl
es.html"> |
| 8 <link rel="import" href="chrome://resources/polymer/v1_0/iron-icons/iron-icons.h
tml"> | 9 <link rel="import" href="chrome://resources/polymer/v1_0/iron-icons/iron-icons.h
tml"> |
| 9 | 10 |
| 10 <dom-module id="pin-keyboard"> | 11 <dom-module id="pin-keyboard"> |
| 11 <template> | 12 <template> |
| 12 <style> | 13 <style> |
| 13 #root { | 14 #root { |
| 15 direction: ltr; |
| 14 display: flex; | 16 display: flex; |
| 15 } | 17 } |
| 16 | 18 |
| 19 .input-non-pin { |
| 20 direction: rtl; |
| 21 } |
| 22 |
| 17 .row { | 23 .row { |
| 18 display: flex; | 24 display: flex; |
| 19 } | 25 } |
| 20 | 26 |
| 21 .digit-button { | 27 .digit-button { |
| 22 align-items: center; | 28 align-items: center; |
| 23 background: none; | 29 background: none; |
| 24 border-radius: 20px; | 30 border-radius: 20px; |
| 25 box-sizing: border-box; | 31 box-sizing: border-box; |
| 26 color: var(--paper-blue-grey-700); | 32 color: var(--paper-blue-grey-700); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 120 |
| 115 /* Ensure that all children of paper-button do not consume events. This | 121 /* Ensure that all children of paper-button do not consume events. This |
| 116 * simplifies the event handler code. */ | 122 * simplifies the event handler code. */ |
| 117 paper-button * { | 123 paper-button * { |
| 118 pointer-events: none; | 124 pointer-events: none; |
| 119 } | 125 } |
| 120 </style> | 126 </style> |
| 121 | 127 |
| 122 <div id="root"> | 128 <div id="root"> |
| 123 <div id="container-constrained-width"> | 129 <div id="container-constrained-width"> |
| 124 <div class="row"> | 130 <div class="row horizontal-center"> |
| 125 <input id="pin-input" type="number" placeholder="Enter PIN" | 131 <input id="pin-input" type="[[computeInputType_(enablePassword)]]" |
| 132 class$="[[computeInputClass_(value)]]" |
| 133 placeholder="[[computeInputPlaceholder_(enablePassword)]]" |
| 126 value="{{value::input}}" | 134 value="{{value::input}}" |
| 127 on-keydown="onInputKeyDown_"></input> | 135 on-keydown="onInputKeyDown_"></input> |
| 128 <paper-button class="digit-button first-row submit-button" | 136 <paper-button class="digit-button first-row submit-button" |
| 129 on-tap="firePinSubmitEvent_"> | 137 on-tap="firePinSubmitEvent_"> |
| 130 <div class$="icon-container [[computeSubmitClass_(value)]]"> | 138 <div class$="icon-container [[computeSubmitClass_(value)]]"> |
| 131 <iron-icon class="icon" icon="icons:forward"><iron-icon> | 139 <iron-icon class="icon" icon="icons:forward"><iron-icon> |
| 132 </div> | 140 </div> |
| 133 </paper-button> | 141 </paper-button> |
| 134 </div> | 142 </div> |
| 135 | 143 |
| 136 <div class="row keyboard"> | 144 <div class="row keyboard"> |
| 137 <paper-button class="digit-button" on-tap="onNumberTap_" value="1"> | 145 <paper-button class="digit-button" on-tap="onNumberTap_" value="1"> |
| 138 <inner-text>1</inner-text> | 146 <inner-text>$i18n{pinKeyboard1}</inner-text> |
| 139 </paper-button> | 147 </paper-button> |
| 140 <paper-button class="digit-button center-button" on-tap="onNumberTap_" | 148 <paper-button class="digit-button center-button" on-tap="onNumberTap_" |
| 141 value="2"> | 149 value="2"> |
| 142 <inner-text>2</inner-text> | 150 <inner-text>$i18n{pinKeyboard2}</inner-text> |
| 143 </paper-button> | 151 </paper-button> |
| 144 <paper-button class="digit-button" on-tap="onNumberTap_" value="3"> | 152 <paper-button class="digit-button" on-tap="onNumberTap_" value="3"> |
| 145 <inner-text>3</inner-text> | 153 <inner-text>$i18n{pinKeyboard3}</inner-text> |
| 146 </paper-button> | 154 </paper-button> |
| 147 </div> | 155 </div> |
| 148 <div class="row keyboard"> | 156 <div class="row keyboard"> |
| 149 <paper-button class="digit-button" on-tap="onNumberTap_" value="4"> | 157 <paper-button class="digit-button" on-tap="onNumberTap_" value="4"> |
| 150 <inner-text>4</inner-text> | 158 <inner-text>$i18n{pinKeyboard4}</inner-text> |
| 151 </paper-button> | 159 </paper-button> |
| 152 <paper-button class="digit-button center-button" on-tap="onNumberTap_" | 160 <paper-button class="digit-button center-button" on-tap="onNumberTap_" |
| 153 value="5"> | 161 value="5"> |
| 154 <inner-text>5</inner-text> | 162 <inner-text>$i18n{pinKeyboard5}</inner-text> |
| 155 </paper-button> | 163 </paper-button> |
| 156 <paper-button class="digit-button" on-tap="onNumberTap_" value="6"> | 164 <paper-button class="digit-button" on-tap="onNumberTap_" value="6"> |
| 157 <inner-text>6</inner-text> | 165 <inner-text>$i18n{pinKeyboard6}</inner-text> |
| 158 </paper-button> | 166 </paper-button> |
| 159 </div> | 167 </div> |
| 160 <div class="row keyboard"> | 168 <div class="row keyboard"> |
| 161 <paper-button class="digit-button" on-tap="onNumberTap_" value="7"> | 169 <paper-button class="digit-button" on-tap="onNumberTap_" value="7"> |
| 162 <inner-text>7</inner-text> | 170 <inner-text>$i18n{pinKeyboard7}</inner-text> |
| 163 </paper-button> | 171 </paper-button> |
| 164 <paper-button class="digit-button center-button" on-tap="onNumberTap_" | 172 <paper-button class="digit-button center-button" on-tap="onNumberTap_" |
| 165 value="8"> | 173 <inner-text>$i18n{pinKeyboard8}</inner-text> |
| 166 <inner-text>8</inner-text> | |
| 167 </paper-button> | 174 </paper-button> |
| 168 <paper-button class="digit-button" on-tap="onNumberTap_" value="9"> | 175 <paper-button class="digit-button" on-tap="onNumberTap_" value="9"> |
| 169 <inner-text>9</inner-text> | 176 <inner-text>$i18n{pinKeyboard9}</inner-text> |
| 170 </paper-button> | 177 </paper-button> |
| 171 </div> | 178 </div> |
| 172 <div class="row keyboard"> | 179 <div class="row keyboard"> |
| 173 <div class="digit-button"></div> | 180 <div class="digit-button"></div> |
| 174 <paper-button class="digit-button center-button" on-tap="onNumberTap_" | 181 <paper-button class="digit-button center-button" on-tap="onNumberTap_" |
| 175 value="0"> | 182 value="0"> |
| 176 <inner-text>0</inner-text> | 183 <inner-text>$i18n{pinKeyboard0}</inner-text> |
| 177 </paper-button> | 184 </paper-button> |
| 178 <paper-button class="digit-button clear-button" on-tap="onPinClear_"> | 185 <paper-button class="digit-button clear-button" on-tap="onPinClear_"> |
| 179 <div class="icon-container"> | 186 <div class="icon-container"> |
| 180 <iron-icon class="icon" icon="icons:clear"><iron-icon> | 187 <iron-icon class="icon" icon="icons:clear"><iron-icon> |
| 181 </div> | 188 </div> |
| 182 <inner-text class="icon-subheading">Clear</inner-text> | 189 <inner-text class="icon-subheading"> |
| 190 $i18n{pinKeyboardClear} |
| 191 </inner-text> |
| 183 </paper-button> | 192 </paper-button> |
| 184 </div> | 193 </div> |
| 185 </div> | 194 </div> |
| 186 </div> | 195 </div> |
| 187 </template> | 196 </template> |
| 188 <script src="pin_keyboard.js"></script> | 197 <script src="pin_keyboard.js"></script> |
| 189 </dom-module> | 198 </dom-module> |
| OLD | NEW |