MCPcopy
hub / github.com/helloxz/onenav / splitAccesskey

Function splitAccesskey

static/jQuery-contextMenu/jquery.contextMenu.js:1600–1612  ·  view source on GitHub ↗
(val)

Source from the content-addressed store, hash-verified

1598
1599 // split accesskey according to http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html#assigned-access-key
1600 function splitAccesskey(val) {
1601 var t = val.split(/\s+/);
1602 var keys = [];
1603
1604 for (var i = 0, k; k = t[i]; i++) {
1605 k = k.charAt(0).toUpperCase(); // first character only
1606 // theoretically non-accessible characters should be ignored, but different systems, different keyboard layouts, ... screw it.
1607 // a map to look up already used access keys would be nice
1608 keys.push(k);
1609 }
1610
1611 return keys;
1612 }
1613
1614// handle contextMenu triggers
1615 $.fn.contextMenu = function (operation) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected