1 <!-- 2 -- Copyright 2013 The Chromium Authors. All rights reserved. 3 -- Use of this source code is governed by a BSD-style license that can be 4 -- found in the LICENSE file. 5 --> 6 7 <polymer-element name="kb-key" extends="kb-key-base" attributes="weight"> 8 <template> 9 <style> 10 @host { 11 * { 12 -webkit-box-flex: {{weight}}; 13 } 14 } 15 </style> 16 <div id="key" pseudo="x-key" inverted?={{invert}}> 17 <content></content> 18 </div> 19 <div pseudo="x-superscript" inverted?={{invert}}>{{superscript}}</div> 20 </template> 21 <script> 22 Polymer('kb-key', { 23 weight: 1 24 }); 25 </script> 26 </polymer-element> 27 28 <!-- Special keys --> 29 30 <polymer-element name="kb-shift-key" class="shift dark" char="Shift" 31 extends="kb-key"> 32 <script> 33 Polymer('kb-shift-key', { 34 down: function(event) { 35 this.super(); 36 var detail = {}; 37 if (this.keysetRules && this.keysetRules.dbl != undefined) { 38 detail.char = this.char || this.textContent; 39 detail.toKeyset = this.keysetRules.dbl[TO_KEYSET - OFFSET]; 40 detail.nextKeyset = this.keysetRules.dbl[NEXT_KEYSET - OFFSET]; 41 } 42 this.fire('enable-dbl', detail); 43 this.fire('enable-sel'); 44 } 45 }); 46 </script> 47 </polymer-element> 48 49 <!-- 50 -- TODO(kevers): Display popup menu for selecting layout on keypress. Display 51 -- code for keyboard layout in place of image. 52 --> 53 <polymer-element name="kb-layout-selector" class="layout-selector dark" char="Invalid" 54 extends="kb-key"> 55 <script> 56 Polymer('kb-layout-selector', { 57 toLayout: 'qwerty' 58 }); 59 </script> 60 </polymer-element> 61