Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <link rel="import" href="chrome://resources/html/cr.html"> | 1 <link rel="import" href="chrome://resources/html/cr.html"> |
| 2 <link rel="import" href="chrome://resources/html/i18n_behavior.html"> | |
| 3 <link rel="import" href="chrome://resources/html/md_select_css.html"> | |
| 2 <link rel="import" href="chrome://resources/html/polymer.html"> | 4 <link rel="import" href="chrome://resources/html/polymer.html"> |
| 3 <link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-ani matable-behavior.html"> | 5 <link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-ani matable-behavior.html"> |
| 4 <link rel="import" href="chrome://resources/polymer/v1_0/paper-dropdown-menu/pap er-dropdown-menu.html"> | |
| 5 <link rel="import" href="chrome://resources/polymer/v1_0/paper-item/paper-item.h tml"> | 6 <link rel="import" href="chrome://resources/polymer/v1_0/paper-item/paper-item.h tml"> |
|
dpapad
2017/06/15 01:35:36
Is this still used?
scottchen
2017/06/15 23:50:51
Nope, removing.
| |
| 6 <link rel="import" href="chrome://resources/polymer/v1_0/paper-listbox/paper-lis tbox.html"> | 7 <link rel="import" href="chrome://resources/polymer/v1_0/paper-listbox/paper-lis tbox.html"> |
| 7 <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/color.html "> | 8 <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/color.html "> |
| 8 <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/shadow.htm l"> | 9 <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/shadow.htm l"> |
| 9 <link rel="import" href="chrome://extensions/animation_helper.html"> | 10 <link rel="import" href="chrome://extensions/animation_helper.html"> |
| 10 <link rel="import" href="chrome://extensions/shortcut_input.html"> | 11 <link rel="import" href="chrome://extensions/shortcut_input.html"> |
| 11 | 12 |
| 12 <dom-module id="extensions-keyboard-shortcuts"> | 13 <dom-module id="extensions-keyboard-shortcuts"> |
| 13 <template> | 14 <template> |
| 14 <style> | 15 <style include="md-select"> |
| 15 [hidden] { | 16 [hidden] { |
| 16 display: none !important; | 17 display: none !important; |
| 17 } | 18 } |
| 18 | 19 |
| 19 .shortcut-card { | 20 .shortcut-card { |
| 20 @apply(--shadow-elevation-2dp); | 21 @apply(--shadow-elevation-2dp); |
| 21 background-color: white; | 22 background-color: white; |
| 22 color: var(--paper-grey-600); | 23 color: var(--paper-grey-600); |
| 23 margin: 0 auto 16px auto; | 24 margin: 0 auto 16px auto; |
| 24 max-width: 928px; | 25 max-width: 928px; |
| 25 min-width: 600px; | 26 min-width: 600px; |
| 26 padding-bottom: 8px; | 27 padding-bottom: 8px; |
| 27 width: 90%; | 28 width: 90%; |
| 28 } | 29 } |
| 29 | 30 |
| 30 .command-entry { | 31 .command-entry { |
| 31 align-items: center; | 32 align-items: center; |
| 32 display: flex; | 33 display: flex; |
| 33 font-size: 13px; | 34 font-size: 13px; |
| 34 height: 48px; | 35 height: 48px; |
| 35 } | 36 } |
| 36 | 37 |
| 37 .command-name { | 38 .command-name { |
| 38 color: var(--paper-grey-900); | 39 color: var(--paper-grey-900); |
| 39 flex: 1; | 40 flex: 1; |
| 40 } | 41 } |
| 41 | 42 |
| 42 .command-entry paper-dropdown-menu { | 43 .command-entry .md-select-wrapper { |
| 43 -webkit-margin-start: 40px; | 44 -webkit-margin-start: 40px; |
| 44 } | 45 } |
| 45 | 46 |
| 46 .card-title { | 47 .card-title { |
| 47 align-items: center; | 48 align-items: center; |
| 48 border-bottom: 1px solid var(--paper-grey-400); | 49 border-bottom: 1px solid var(--paper-grey-400); |
| 49 display: flex; | 50 display: flex; |
| 50 font-size: 14px; | 51 font-size: 14px; |
| 51 font-weight: 500; | 52 font-weight: 500; |
| 52 margin-bottom: 9px; | 53 margin-bottom: 9px; |
| 53 padding: 16px 20px; | 54 padding: 16px 20px; |
| 54 } | 55 } |
| 55 | 56 |
| 56 .icon { | 57 .icon { |
| 57 -webkit-margin-end: 20px; | 58 -webkit-margin-end: 20px; |
| 58 height: 16px; | 59 height: 16px; |
| 59 width: 16px; | 60 width: 16px; |
| 60 } | 61 } |
| 61 | 62 |
| 62 .card-controls { | 63 .card-controls { |
| 63 /* We line up the controls with the name, which is after the | 64 /* We line up the controls with the name, which is after the |
| 64 20px left padding + 16px icon + 20px margin on the icon. */ | 65 20px left padding + 16px icon + 20px margin on the icon. */ |
| 65 -webkit-margin-end: 20px; | 66 -webkit-margin-end: 20px; |
| 66 -webkit-margin-start: 56px; | 67 -webkit-margin-start: 56px; |
| 67 } | 68 } |
| 68 | 69 |
| 69 #main { | 70 #main { |
| 70 margin-top: 24px; | 71 margin-top: 24px; |
| 71 } | 72 } |
| 72 | |
| 73 #main paper-dropdown-menu { | |
| 74 --paper-input-container: { | |
| 75 margin-bottom: 14px; | |
| 76 padding: 0; | |
| 77 }; | |
| 78 --paper-input-container-color: var(--paper-grey-400); | |
| 79 --paper-input-container-focus-color: var(--google-blue-500); | |
| 80 --paper-input-container-input: { | |
| 81 font-size: 13px; | |
| 82 }; | |
| 83 --paper-input-container-underline-disabled: { | |
| 84 border-bottom: 1px solid; | |
| 85 }; | |
| 86 } | |
| 87 | |
| 88 </style> | 73 </style> |
| 89 <div id="main"> | 74 <div id="main"> |
| 90 <template is="dom-repeat" items="[[calculateShownItems_(items.*)]]"> | 75 <template is="dom-repeat" items="[[calculateShownItems_(items.*)]]"> |
| 91 <div class="shortcut-card"> | 76 <div class="shortcut-card"> |
| 92 <div class="card-title"> | 77 <div class="card-title"> |
| 93 <img class="icon" src="[[item.iconUrl]]"> | 78 <img class="icon" src="[[item.iconUrl]]"> |
| 94 <span>[[item.name]]</span> | 79 <span>[[item.name]]</span> |
| 95 </div> | 80 </div> |
| 96 <div class="card-controls"> | 81 <div class="card-controls"> |
| 97 <template is="dom-repeat" items="[[item.commands]]" as="command"> | 82 <template is="dom-repeat" items="[[item.commands]]" as="command"> |
| 98 <div class="command-entry" command="[[command]]"> | 83 <div class="command-entry" command="[[command]]"> |
| 99 <span class="command-name">[[command.description]]</span> | 84 <span class="command-name">[[command.description]]</span> |
| 100 <extensions-shortcut-input item="[[item.id]]" | 85 <extensions-shortcut-input item="[[item.id]]" |
| 101 shortcut="[[command.keybinding]]" | 86 shortcut="[[command.keybinding]]" |
| 102 command-name="[[command.name]]"> | 87 command-name="[[command.name]]"> |
| 103 </extensions-shortcut-input> | 88 </extensions-shortcut-input> |
| 104 <paper-dropdown-menu | 89 <div class="md-select-wrapper"> |
| 105 disabled$="[[computeScopeDisabled_(command)]]"> | 90 <select class="md-select" on-change="onScopeChanged_" |
| 106 <paper-listbox class="dropdown-content" | 91 disabled$="[[computeScopeDisabled_(command)]]"> |
| 107 selected="[[computeSelectedScope_(command)]]"> | 92 <template is="dom-repeat" items="[[scopes_]]" as="scope"> |
| 108 <paper-item>$i18n{shortcutScopeInChrome}</paper-item> | 93 <option value="[[scope.value]]" selected="[[ |
|
dpapad
2017/06/15 01:35:37
FYI, I recall now that binding the "selected" attr
scottchen
2017/06/15 23:50:51
Discussed with dpapad offline, see new patch for c
| |
| 109 <paper-item>$i18n{shortcutScopeGlobal}</paper-item> | 94 isScopeEqual_(command.scope, scope.value)]]"> |
| 110 </paper-listbox> | 95 [[scope.label]] |
| 111 </paper-dropdown> | 96 </option> |
| 97 </template> | |
| 98 </select> | |
| 99 <span class="md-select-underline"></span> | |
| 100 </div> | |
| 112 </div> | 101 </div> |
| 113 </template> | 102 </template> |
| 114 </div> | 103 </div> |
| 115 </div> | 104 </div> |
| 116 </template> | 105 </template> |
| 117 </div> | 106 </div> |
| 118 </template> | 107 </template> |
| 119 <script src="chrome://extensions/keyboard_shortcuts.js"></script> | 108 <script src="chrome://extensions/keyboard_shortcuts.js"></script> |
| 120 </dom-module> | 109 </dom-module> |
| OLD | NEW |