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/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-icon-button/paper -icon-button.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/paper-styles/color.html "> |
| 10 <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.htm l"> | 11 <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.htm l"> |
| 11 <link rel="import" href="chrome://resources/polymer/v1_0/iron-iconset-svg/iron-i conset-svg.html"> | 12 <link rel="import" href="chrome://resources/polymer/v1_0/iron-iconset-svg/iron-i conset-svg.html"> |
| 12 | 13 |
| 13 <iron-iconset-svg name="pin-keyboard" size="24"> | 14 <iron-iconset-svg name="pin-keyboard" size="24"> |
| 14 <svg> | 15 <svg> |
| 15 <defs> | 16 <defs> |
| 16 <!-- | 17 <!-- |
| 17 Inlined from Polymer's iron-icons to avoid importing everything. | 18 Inlined from Polymer's iron-icons to avoid importing everything. |
| 18 See http://goo.gl/Y1OdAq for instructions on adding additional icons. | 19 See http://goo.gl/Y1OdAq for instructions on adding additional icons. |
| 19 --> | 20 --> |
| 20 <g id="forward"><path d="M12 8V4l8 8-8 8v-4H4V8z"></path></g> | 21 <g id="arrow-forward"> |
| 22 <path d="M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"> | |
| 23 </path> | |
| 24 </g> | |
| 25 <g id="backspace"> | |
| 26 <path d="M22 3H7c-.69 0-1.23.35-1.59.88L0 12l5.41 8.11c.36.53.9.89 1.59. 89h15c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-3 12.59L17.59 17 14 13.41 10.41 17 9 15. 59 12.59 12 9 8.41 10.41 7 14 10.59 17.59 7 19 8.41 15.41 12 19 15.59z"> | |
| 27 </g> | |
| 21 </defs> | 28 </defs> |
| 22 </svg> | 29 </svg> |
| 23 </iron-iconset-svg> | 30 </iron-iconset-svg> |
| 24 | 31 |
| 25 <dom-module id="pin-keyboard"> | 32 <dom-module id="pin-keyboard"> |
| 26 <template> | 33 <template> |
| 27 <style> | 34 <style> |
| 28 #root { | 35 #root { |
| 29 direction: ltr; | 36 direction: ltr; |
| 30 display: flex; | 37 display: flex; |
| 31 } | 38 } |
| 32 | 39 |
| 33 .input-non-pin { | 40 .input-non-pin { |
| 34 direction: rtl; | 41 direction: rtl; |
| 35 } | 42 } |
| 36 | 43 |
| 37 .row { | 44 .row { |
| 38 display: flex; | 45 display: flex; |
| 39 } | 46 } |
| 40 | 47 |
| 41 .digit-button { | 48 .digit-button { |
| 42 align-items: center; | 49 align-items: center; |
| 43 background: none; | 50 background: none; |
| 44 border-radius: 20px; | 51 border-radius: 100px; |
| 45 box-sizing: border-box; | 52 box-sizing: border-box; |
| 46 color: var(--paper-blue-grey-700); | 53 color: #000; |
| 47 display: flex; | 54 display: flex; |
| 48 flex-direction: column; | 55 flex-direction: column; |
| 49 font-size: 32px; | 56 font-size: 18px; |
| 50 height: 70px; | 57 height: 48px; |
| 51 justify-content: center; | 58 justify-content: center; |
| 52 margin: 0; | 59 margin: 0 6px; |
| 53 min-height: 70px; | 60 min-height: 48px; |
| 54 min-width: 70px; | 61 min-width: 48px; |
| 55 padding: 15px 20px; | 62 opacity: 0.87; |
| 56 width: 70px; | 63 padding: 15px; |
| 64 width: 48px; | |
| 57 } | 65 } |
| 58 | 66 |
| 59 .digit-button.clear-button { | 67 .bottom-row { |
| 60 display: block; | 68 margin-bottom: 6px; |
| 61 } | 69 } |
| 62 | 70 |
| 63 .digit-button.center-button { | 71 .top-row { |
| 64 margin: 0 30px; | 72 margin-top: 6px; |
| 73 } | |
| 74 | |
| 75 .digit-button.backspace-button { | |
| 76 opacity: var(--dark-primary-opacity); | |
| 77 } | |
| 78 | |
| 79 .digit-button.backspace-button[disabled] { | |
| 80 color: #000; | |
| 81 opacity: 0.26; | |
| 82 padding: 14px; | |
| 65 } | 83 } |
| 66 | 84 |
| 67 .digit-button.submit-button { | 85 .digit-button.submit-button { |
| 68 left: 20px; | 86 color: var(--google-blue-500); |
| 69 position: relative; | 87 height: 43px; |
| 88 left: 137px; | |
| 89 margin: 0; | |
| 90 min-height: 43px; | |
| 91 min-width: 43px; | |
| 92 opacity: var(--light-primary-opacity); | |
| 93 padding: 11.5px 10px; | |
| 94 position: absolute; | |
| 95 width: 43px; | |
| 96 } | |
| 97 | |
| 98 .digit-button.submit-button[disabled] { | |
| 99 color: #000; | |
| 100 opacity: 0.26; | |
| 101 } | |
| 102 | |
| 103 .digit-button.submit-button.error-show, | |
| 104 .digit-button.submit-button.error-show[disabled] { | |
| 105 color: var(--google-red-700); | |
| 106 opacity: 1; | |
| 70 } | 107 } |
| 71 | 108 |
| 72 .digit-button.submit-button.submit-button-hidden { | 109 .digit-button.submit-button.submit-button-hidden { |
| 73 display: none; | 110 display: none; |
| 74 } | 111 } |
| 75 | 112 |
| 76 .digit-button .icon-container { | |
| 77 background: var(--paper-grey-400); | |
| 78 border-radius: 100px; | |
| 79 height: 24px; | |
| 80 margin: auto; | |
| 81 width: 24px; | |
| 82 } | |
| 83 | |
| 84 .digit-button .icon-container.ready-background { | |
| 85 background: var(--paper-blue-800); | |
| 86 } | |
| 87 | |
| 88 .digit-button .icon-container .icon { | |
| 89 color: white; | |
| 90 display: block; | |
| 91 height: 16px; | |
| 92 left: 4px; | |
| 93 top: 4px; | |
| 94 width: 16px; | |
| 95 } | |
| 96 | |
| 97 .digit-button .icon-subheading { | |
| 98 color: var(--paper-grey-400); | |
| 99 font-size: 10px; | |
| 100 left: 0; | |
| 101 position: absolute; | |
| 102 text-align: center; | |
| 103 text-transform: capitalize; | |
| 104 top: 44px; | |
| 105 width: 100%; | |
| 106 } | |
| 107 | |
| 108 .digit-button inner-text { | 113 .digit-button inner-text { |
| 109 color: var(--paper-blue-grey-700); | 114 color: var(--paper-blue-grey-700); |
| 110 display: flex; | 115 display: flex; |
| 111 flex-direction: column; | 116 flex-direction: column; |
| 112 height: 52px; | 117 height: 52px; |
| 113 } | 118 } |
| 114 | 119 |
| 115 .first-row { | |
| 116 height: 64px; | |
| 117 min-height: 64px; | |
| 118 padding: 28px 15px 12px 15px; | |
| 119 } | |
| 120 | |
| 121 #pin-input { | 120 #pin-input { |
| 122 -webkit-text-security: disc; | 121 -webkit-text-security: disc; |
| 123 background-color: white; | 122 background-color: white; |
| 124 border: 0; | 123 border: 0; |
| 125 box-sizing: border-box; | 124 box-sizing: border-box; |
| 126 font-size: 18px; | 125 font-face: Roboto-Regular; |
| 127 height: 64px; | 126 font-size: 13px; |
| 128 left: 20px; | 127 height: 43px; |
| 128 left: 10px; | |
| 129 opacity: var(--dark-secondary-opacity); | |
| 129 outline: 0; | 130 outline: 0; |
| 130 padding: 28px 3px 12px 3px; | |
| 131 position: relative; | 131 position: relative; |
| 132 text-color: #000; | |
| 133 width: 127px; | |
| 134 } | |
| 135 | |
| 136 #pin-input.has-content { | |
| 137 opacity: var(--dark-primary-opacity); | |
| 138 } | |
| 139 | |
| 140 #pin-input.submit-button-hidden { | |
| 141 left: 0; | |
| 142 text-align: center; | |
| 132 width: 180px; | 143 width: 180px; |
| 133 } | 144 } |
| 134 | 145 |
| 135 #pin-input.submit-button-hidden { | 146 hr { |
| 136 border-bottom: 2px; | 147 border: 0; |
| 137 border-bottom-style: solid; | 148 border-bottom: 1px solid #000; |
| 138 text-align: center; | 149 left: 10px; |
| 139 width: 230px; | 150 margin: 0; |
| 151 opacity: 0.14; | |
| 152 position: relative; | |
| 153 width: 160px; | |
| 140 } | 154 } |
| 141 | 155 |
| 142 #pin-input[type=number]::-webkit-inner-spin-button, | 156 #pin-input[type=number]::-webkit-inner-spin-button, |
| 143 #pin-input[type=number]::-webkit-outer-spin-button { | 157 #pin-input[type=number]::-webkit-outer-spin-button { |
| 144 -webkit-appearance: none; | 158 -webkit-appearance: none; |
| 145 margin: 0; | 159 margin: 0; |
| 146 } | 160 } |
| 147 | 161 |
| 148 /* Ensure that all children of paper-button do not consume events. This | 162 /* Ensure that all children of paper-button do not consume events. This |
| 149 * simplifies the event handler code. */ | 163 * simplifies the event handler code. */ |
| 150 paper-button * { | 164 paper-button * { |
| 151 pointer-events: none; | 165 pointer-events: none; |
| 152 } | 166 } |
| 153 </style> | 167 </style> |
| 154 | 168 |
| 155 <div id="root"> | 169 <div id="root"> |
| 156 <div id="container-constrained-width"> | 170 <div id="container-constrained-width"> |
| 157 <div class="row"> | 171 <div class="row"> |
| 158 <input id="pin-input" type="[[getInputType_(enablePassword)]]" | 172 <input id="pin-input" type="[[getInputType_(enablePassword)]]" |
| 159 class$="[[getInputClass_(value)]] | 173 class$="[[getInputClass_(value)]] |
| 160 [[getSubmitHiddenClass_(enableSubmitButton)]]" | 174 [[getSubmitClass_(enableSubmitButton)]] |
| 175 [[getContentClass_(value)]]" | |
| 161 placeholder="[[getInputPlaceholder_(enablePassword)]]" | 176 placeholder="[[getInputPlaceholder_(enablePassword)]]" |
| 162 value="{{value::input}}" | 177 value="{{value::input}}" |
| 163 on-keydown="onInputKeyDown_"></input> | 178 on-keydown="onInputKeyDown_"></input> |
| 164 <paper-button class$="digit-button first-row submit-button | 179 <paper-icon-button icon="pin-keyboard:arrow-forward" |
| 165 [[getSubmitHiddenClass_(enableSubmitButton)]]" | 180 class$="digit-button submit-button |
| 166 on-tap="firePinSubmitEvent_"> | 181 [[getSubmitClass_(enableSubmitButton)]] |
| 167 <div class$="icon-container [[getSubmitClass_(value)]]"> | 182 [[getProblemClass_(problemMessage)]]" |
|
jdufault
2016/08/25 23:57:26
Remove?
sammiequon
2016/08/26 01:20:44
Done.
| |
| 168 <iron-icon class="icon" icon="pin-keyboard:forward"><iron-icon> | 183 disabled="[[!hasInput_(value)]]" |
| 169 </div> | 184 on-tap="firePinSubmitEvent_"> |
| 170 </paper-button> | 185 </paper-icon-button> |
| 171 </div> | 186 </div> |
| 172 | 187 <hr> |
| 173 <div class="row keyboard"> | 188 <div class="row keyboard top-row"> |
| 174 <paper-button class="digit-button" on-tap="onNumberTap_" value="1"> | 189 <paper-button class="digit-button" on-tap="onNumberTap_" value="1"> |
| 175 <inner-text>$i18n{pinKeyboard1}</inner-text> | 190 <inner-text>$i18n{pinKeyboard1}</inner-text> |
| 176 </paper-button> | 191 </paper-button> |
| 177 <paper-button class="digit-button center-button" on-tap="onNumberTap_" | 192 <paper-button class="digit-button" on-tap="onNumberTap_" value="2"> |
| 178 value="2"> | |
| 179 <inner-text>$i18n{pinKeyboard2}</inner-text> | 193 <inner-text>$i18n{pinKeyboard2}</inner-text> |
| 180 </paper-button> | 194 </paper-button> |
| 181 <paper-button class="digit-button" on-tap="onNumberTap_" value="3"> | 195 <paper-button class="digit-button" on-tap="onNumberTap_" value="3"> |
| 182 <inner-text>$i18n{pinKeyboard3}</inner-text> | 196 <inner-text>$i18n{pinKeyboard3}</inner-text> |
| 183 </paper-button> | 197 </paper-button> |
| 184 </div> | 198 </div> |
| 185 <div class="row keyboard"> | 199 <div class="row keyboard"> |
| 186 <paper-button class="digit-button" on-tap="onNumberTap_" value="4"> | 200 <paper-button class="digit-button" on-tap="onNumberTap_" value="4"> |
| 187 <inner-text>$i18n{pinKeyboard4}</inner-text> | 201 <inner-text>$i18n{pinKeyboard4}</inner-text> |
| 188 </paper-button> | 202 </paper-button> |
| 189 <paper-button class="digit-button center-button" on-tap="onNumberTap_" | 203 <paper-button class="digit-button" on-tap="onNumberTap_" value="5"> |
| 190 value="5"> | |
| 191 <inner-text>$i18n{pinKeyboard5}</inner-text> | 204 <inner-text>$i18n{pinKeyboard5}</inner-text> |
| 192 </paper-button> | 205 </paper-button> |
| 193 <paper-button class="digit-button" on-tap="onNumberTap_" value="6"> | 206 <paper-button class="digit-button" on-tap="onNumberTap_" value="6"> |
| 194 <inner-text>$i18n{pinKeyboard6}</inner-text> | 207 <inner-text>$i18n{pinKeyboard6}</inner-text> |
| 195 </paper-button> | 208 </paper-button> |
| 196 </div> | 209 </div> |
| 197 <div class="row keyboard"> | 210 <div class="row keyboard"> |
| 198 <paper-button class="digit-button" on-tap="onNumberTap_" value="7"> | 211 <paper-button class="digit-button" on-tap="onNumberTap_" value="7"> |
| 199 <inner-text>$i18n{pinKeyboard7}</inner-text> | 212 <inner-text>$i18n{pinKeyboard7}</inner-text> |
| 200 </paper-button> | 213 </paper-button> |
| 201 <paper-button class="digit-button center-button" on-tap="onNumberTap_" | 214 <paper-button class="digit-button" on-tap="onNumberTap_" value="8"> |
| 202 value="8"> | |
| 203 <inner-text>$i18n{pinKeyboard8}</inner-text> | 215 <inner-text>$i18n{pinKeyboard8}</inner-text> |
| 204 </paper-button> | 216 </paper-button> |
| 205 <paper-button class="digit-button" on-tap="onNumberTap_" value="9"> | 217 <paper-button class="digit-button" on-tap="onNumberTap_" value="9"> |
| 206 <inner-text>$i18n{pinKeyboard9}</inner-text> | 218 <inner-text>$i18n{pinKeyboard9}</inner-text> |
| 207 </paper-button> | 219 </paper-button> |
| 208 </div> | 220 </div> |
| 209 <div class="row keyboard"> | 221 <div class="row keyboard bottom-row"> |
| 210 <div class="digit-button"></div> | 222 <div class="digit-button"></div> |
| 211 <paper-button class="digit-button center-button" on-tap="onNumberTap_" | 223 <paper-button class="digit-button" on-tap="onNumberTap_" value="0"> |
| 212 value="0"> | |
| 213 <inner-text>$i18n{pinKeyboard0}</inner-text> | 224 <inner-text>$i18n{pinKeyboard0}</inner-text> |
| 214 </paper-button> | 225 </paper-button> |
| 215 <paper-button class="digit-button clear-button" on-tap="onPinClear_"> | 226 <paper-icon-button class="digit-button backspace-button" |
| 216 <div class="icon-container"> | 227 disabled="[[!hasInput_(value)]]" |
| 217 <iron-icon class="icon" icon="cr:clear"><iron-icon> | 228 on-tap="onPinClear_" icon="pin-keyboard:backspace"> |
| 218 </div> | 229 </paper-icon-button> |
| 219 <inner-text class="icon-subheading"> | |
| 220 $i18n{pinKeyboardClear} | |
| 221 </inner-text> | |
| 222 </paper-button> | |
| 223 </div> | 230 </div> |
| 224 </div> | 231 </div> |
| 225 </div> | 232 </div> |
| 226 </template> | 233 </template> |
| 227 <script src="pin_keyboard.js"></script> | 234 <script src="pin_keyboard.js"></script> |
| 228 </dom-module> | 235 </dom-module> |
| OLD | NEW |