I"(function() { if (typeof window.Alchemy === 'undefined') { window.Alchemy = {}; } Alchemy.bindedHotkeys = []; Alchemy.Hotkeys = function(scope) { var $search_fields, $search_fields_clear, hotkey, i, len, ref; if (!scope) { $(document).off('keypress'); ref = Alchemy.bindedHotkeys; for (i = 0, len = ref.length; i < len; i++) { hotkey = ref[i]; key.unbind(hotkey); } } $search_fields = $('.search_input_field', scope); $search_fields_clear = $('.search_field_clear, .js_filter_field_clear', scope); key('alt+f', function() { key.setScope('search'); $search_fields.focus(); return false; }); Alchemy.bindedHotkeys.push('alt+f'); key('esc', 'search', function() { $search_fields_clear.click(); return $search_fields.blur(); }); Alchemy.bindedHotkeys.push('esc'); if (!scope) { $(document).on('keypress', function(e) { if (!$(e.target).is('input, textarea') && String.fromCharCode(e.which) === '?') { Alchemy.openDialog('/admin/help', { title: Alchemy.t('help'), size: '400x492' }); return false; } else { return true; } }); } return $('[data-alchemy-hotkey]', scope).each(function() { var $this; $this = $(this); hotkey = $this.data('alchemy-hotkey'); key(hotkey, function() { return $this.click(); }); return Alchemy.bindedHotkeys.push(hotkey); }); }; }).call(this); :ET