Chromium Code Reviews| 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 .pin-keyboard-input-non-pin { | |
|
jdufault
2016/06/29 21:06:29
Drop the 'pin-keyboard-' prefix.
sammiequon
2016/06/29 23:35:48
Done.
| |
| 20 direction: rtl; | |
| 21 } | |
| 22 | |
| 17 .row { | 23 .row { |
| 18 display: flex; | 24 display: flex; |
| 19 } | 25 } |
| 20 | 26 |
| 21 .row.horizontal-center { | 27 .row.horizontal-center { |
| 22 justify-content: center; | 28 justify-content: center; |
| 23 } | 29 } |
| 24 | 30 |
| 25 .digit-button { | 31 .digit-button { |
| 26 align-items: center; | 32 align-items: center; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 96 /* Ensure that all children of paper-button do not consume events. This | 102 /* Ensure that all children of paper-button do not consume events. This |
| 97 * simplifies the event handler code. */ | 103 * simplifies the event handler code. */ |
| 98 paper-button * { | 104 paper-button * { |
| 99 pointer-events: none; | 105 pointer-events: none; |
| 100 } | 106 } |
| 101 </style> | 107 </style> |
| 102 | 108 |
| 103 <div id="root"> | 109 <div id="root"> |
| 104 <div id="container-constrained-width"> | 110 <div id="container-constrained-width"> |
| 105 <div class="row horizontal-center"> | 111 <div class="row horizontal-center"> |
| 106 <input id="pin-input" type="number" placeholder="Enter PIN" | 112 <input id="pin-input" type="[[inputType_]]" |
| 113 class="[[computeRtlClass_(value)]]" | |
|
jdufault
2016/06/29 21:06:29
Maybe computeInputClass_?
sammiequon
2016/06/29 23:35:48
Done.
| |
| 114 placeholder="[[placeholder_]]" | |
| 107 value="{{value::input}}" | 115 value="{{value::input}}" |
| 108 on-keydown="onInputKeyDown_"></input> | 116 on-keydown="onInputKeyDown_"></input> |
| 109 <div class="digit-button first-row"> | 117 <div class="digit-button first-row"> |
| 110 <paper-button class="digit-button submit-button" | 118 <paper-button class="digit-button submit-button" |
| 111 on-tap="firePinSubmitEvent_"> | 119 on-tap="firePinSubmitEvent_"> |
| 112 <div class="icon-container"> | 120 <div class="icon-container"> |
| 113 <iron-icon class="icon" icon="icons:forward"><iron-icon> | 121 <iron-icon class="icon" icon="icons:forward"><iron-icon> |
| 114 </div> | 122 </div> |
| 115 </paper-button> | 123 </paper-button> |
| 116 </div> | 124 </div> |
| 117 </div> | 125 </div> |
| 118 | 126 |
| 119 <div class="row keyboard"> | 127 <div class="row keyboard"> |
| 120 <paper-button class="digit-button" on-tap="onNumberTap_" value="1"> | 128 <paper-button class="digit-button" on-tap="onNumberTap_" value="1"> |
| 121 <inner-text>1</inner-text> | 129 <inner-text>$i18n{pinKeyboard1}</inner-text> |
| 122 </paper-button> | 130 </paper-button> |
| 123 <paper-button class="digit-button" on-tap="onNumberTap_" value="2"> | 131 <paper-button class="digit-button" on-tap="onNumberTap_" value="2"> |
| 124 <inner-text>2</inner-text> | 132 <inner-text>$i18n{pinKeyboard2}</inner-text> |
| 125 </paper-button> | 133 </paper-button> |
| 126 <paper-button class="digit-button" on-tap="onNumberTap_" value="3"> | 134 <paper-button class="digit-button" on-tap="onNumberTap_" value="3"> |
| 127 <inner-text>3</inner-text> | 135 <inner-text>$i18n{pinKeyboard3}</inner-text> |
| 128 </paper-button> | 136 </paper-button> |
| 129 </div> | 137 </div> |
| 130 <div class="row keyboard"> | 138 <div class="row keyboard"> |
| 131 <paper-button class="digit-button" on-tap="onNumberTap_" value="4"> | 139 <paper-button class="digit-button" on-tap="onNumberTap_" value="4"> |
| 132 <inner-text>4</inner-text> | 140 <inner-text>$i18n{pinKeyboard4}</inner-text> |
| 133 </paper-button> | 141 </paper-button> |
| 134 <paper-button class="digit-button" on-tap="onNumberTap_" value="5"> | 142 <paper-button class="digit-button" on-tap="onNumberTap_" value="5"> |
| 135 <inner-text>5</inner-text> | 143 <inner-text>$i18n{pinKeyboard5}</inner-text> |
| 136 </paper-button> | 144 </paper-button> |
| 137 <paper-button class="digit-button" on-tap="onNumberTap_" value="6"> | 145 <paper-button class="digit-button" on-tap="onNumberTap_" value="6"> |
| 138 <inner-text>6</inner-text> | 146 <inner-text>$i18n{pinKeyboard6}</inner-text> |
| 139 </paper-button> | 147 </paper-button> |
| 140 </div> | 148 </div> |
| 141 <div class="row keyboard"> | 149 <div class="row keyboard"> |
| 142 <paper-button class="digit-button" on-tap="onNumberTap_" value="7"> | 150 <paper-button class="digit-button" on-tap="onNumberTap_" value="7"> |
| 143 <inner-text>7</inner-text> | 151 <inner-text>$i18n{pinKeyboard7}</inner-text> |
| 144 </paper-button> | 152 </paper-button> |
| 145 <paper-button class="digit-button" on-tap="onNumberTap_" value="8"> | 153 <paper-button class="digit-button" on-tap="onNumberTap_" value="8"> |
| 146 <inner-text>8</inner-text> | 154 <inner-text>$i18n{pinKeyboard8}</inner-text> |
| 147 </paper-button> | 155 </paper-button> |
| 148 <paper-button class="digit-button" on-tap="onNumberTap_" value="9"> | 156 <paper-button class="digit-button" on-tap="onNumberTap_" value="9"> |
| 149 <inner-text>9</inner-text> | 157 <inner-text>$i18n{pinKeyboard9}</inner-text> |
| 150 </paper-button> | 158 </paper-button> |
| 151 </div> | 159 </div> |
| 152 <div class="row keyboard"> | 160 <div class="row keyboard"> |
| 153 <div class="digit-button"></div> | 161 <div class="digit-button"></div> |
| 154 <paper-button class="digit-button" on-tap="onNumberTap_" value="0"> | 162 <paper-button class="digit-button" on-tap="onNumberTap_" value="0"> |
| 155 <inner-text>0</inner-text> | 163 <inner-text>$i18n{pinKeyboard0}</inner-text> |
| 156 </paper-button> | 164 </paper-button> |
| 157 <paper-button class="digit-button clear-button" on-tap="onPinClear_"> | 165 <paper-button class="digit-button clear-button" on-tap="onPinClear_"> |
| 158 <div class="icon-container"> | 166 <div class="icon-container"> |
| 159 <iron-icon class="icon" icon="icons:clear"><iron-icon> | 167 <iron-icon class="icon" icon="icons:clear"><iron-icon> |
| 160 </div> | 168 </div> |
| 161 <inner-text class="icon-subheading">Clear</inner-text> | 169 <inner-text class="icon-subheading"> |
| 170 $i18n{pinKeyboardClear} | |
| 171 </inner-text> | |
| 162 </paper-button> | 172 </paper-button> |
| 163 </div> | 173 </div> |
| 164 </div> | 174 </div> |
| 165 </div> | 175 </div> |
| 166 </template> | 176 </template> |
| 167 <script src="pin_keyboard.js"></script> | 177 <script src="pin_keyboard.js"></script> |
| 168 </dom-module> | 178 </dom-module> |
| OLD | NEW |