(scheduler2)
| 12860 | }; |
| 12861 | } |
| 12862 | function key_nav(scheduler2) { |
| 12863 | scheduler2.config.key_nav = true; |
| 12864 | scheduler2.config.key_nav_step = 30; |
| 12865 | scheduler2.addShortcut = function(shortcut, handler, scope) { |
| 12866 | var scopeObject = getScope(scope); |
| 12867 | if (scopeObject) { |
| 12868 | scopeObject.prototype.bind(shortcut, handler); |
| 12869 | } |
| 12870 | }; |
| 12871 | scheduler2.getShortcutHandler = function(shortcut, scope) { |
| 12872 | var scopeObject = getScope(scope); |
| 12873 | if (scopeObject) { |
| 12874 | var commands = scheduler2.$keyboardNavigation.shortcuts.parse(shortcut); |
| 12875 | if (commands.length) { |
| 12876 | return scopeObject.prototype.findHandler(commands[0]); |
| 12877 | } |
| 12878 | } |
| 12879 | }; |
| 12880 | scheduler2.removeShortcut = function(shortcut, scope) { |
| 12881 | var scopeObject = getScope(scope); |
| 12882 | if (scopeObject) { |
| 12883 | scopeObject.prototype.unbind(shortcut); |
| 12884 | } |
| 12885 | }; |
| 12886 | scheduler2.focus = function() { |
| 12887 | if (!scheduler2.config.key_nav) { |
| 12888 | return; |
| 12889 | } |
| 12890 | var disp = scheduler2.$keyboardNavigation.dispatcher; |
| 12891 | disp.enable(); |
| 12892 | var activeNode = disp.getActiveNode(); |
| 12893 | if (!activeNode || activeNode instanceof scheduler2.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler2.$keyboardNavigation.MinicalCell) { |
| 12894 | disp.setDefaultNode(); |
| 12895 | } else { |
| 12896 | disp.focusNode(disp.getActiveNode()); |
| 12897 | } |
| 12898 | }; |
| 12899 | function getScope(mode) { |
| 12900 | var scopes = { minicalButton: scheduler2.$keyboardNavigation.MinicalButton, minicalDate: scheduler2.$keyboardNavigation.MinicalCell, scheduler: scheduler2.$keyboardNavigation.SchedulerNode, dataArea: scheduler2.$keyboardNavigation.DataArea, timeSlot: scheduler2.$keyboardNavigation.TimeSlot, event: scheduler2.$keyboardNavigation.Event }; |
| 12901 | var searchMap = {}; |
| 12902 | for (var i in scopes) |
| 12903 | searchMap[i.toLowerCase()] = scopes[i]; |
| 12904 | mode = (mode + "").toLowerCase(); |
| 12905 | return searchMap[mode] || scopes.scheduler; |
| 12906 | } |
| 12907 | scheduler2.$keyboardNavigation = {}; |
| 12908 | scheduler2._compose = function() { |
| 12909 | var parts = Array.prototype.slice.call(arguments, 0); |
| 12910 | var res = {}; |
| 12911 | for (var i = 0; i < parts.length; i++) { |
| 12912 | var obj = parts[i]; |
| 12913 | if (typeof obj == "function") { |
| 12914 | obj = new obj(); |
| 12915 | } |
| 12916 | for (var p in obj) { |
| 12917 | res[p] = obj[p]; |
| 12918 | } |
| 12919 | } |
nothing calls this directly
no test coverage detected