/*! Menu Hotkeys - v0.1.0 - 2016-04-08 * https://github.com/jonmbake/menu-hotkeys * Copyright (c) 2016 Jon Bake; Licensed MIT */ !function(a,b){"function"==typeof define&&define.amd?define(["jquery"],b):b(a.jQuery)}(this,function(a){function b(a){if("string"==typeof a.data&&(a.data={keys:a.data}),a.data&&a.data.keys&&"string"==typeof a.data.keys){var b=a.handler,d=a.data.keys.toLowerCase().split(" ");a.handler=function(a){if(this===a.target||!(c.hotkeys.options.filterInputAcceptingElements&&c.hotkeys.textInputTypes.test(a.target.nodeName)||c.hotkeys.options.filterContentEditable&&c(a.target).attr("contenteditable")||c.hotkeys.options.filterTextInputs&&c.inArray(a.target.type,c.hotkeys.textAcceptingInputTypes)>-1)){var e="keypress"!==a.type&&c.hotkeys.specialKeys[a.which],f=String.fromCharCode(a.which).toLowerCase(),g="",h={};c.each(["alt","ctrl","shift"],function(b,c){a[c+"Key"]&&e!==c&&(g+=c+"+")}),a.metaKey&&!a.ctrlKey&&"meta"!==e&&(g+="meta+"),a.metaKey&&"meta"!==e&&g.indexOf("alt+ctrl+shift+")>-1&&(g=g.replace("alt+ctrl+shift+","hyper+")),e?h[g+e]=!0:(h[g+f]=!0,h[g+c.hotkeys.shiftNums[f]]=!0,"shift+"===g&&(h[c.hotkeys.shiftNums[f]]=!0));for(var i=0,j=d.length;j>i;i++)if(h[d[i]])return b.apply(this,arguments)}}}}var c=a,d={hotkeyPrefix:"alt"},e=function(){this.reset()};a.extend(e.prototype,{reset:function(){this.registered={}},register:function(a,b,c){b=Array.isArray(b)?b:[b],b.forEach(function(b){this.registered.hasOwnProperty(b)?this.registered[b].push({element:a,callback:c}):this.registered[b]=[{element:a,callback:c}]},this)},unregister:function(a,b){b=b?Array.isArray(b)?b:[b]:Object.keys(this.registered),b.forEach(function(b){var c=this.registered[b];if(c){for(var d=-1,e=0;e