##// END OF EJS Templates
Add notion of action that differs from shortcuts....
Add notion of action that differs from shortcuts. This decouple the notion of shortcut from the notion of executed "action" This allow the shortcuts manager to be purely describe as data, and the same action to be later refered to either from the shortcut, from a toolbar button or a menu. This also implement a more complete keyboard shortcut handler which is able ton interpete sequences like `Cmd-X,Meta-v` By storing the shortcuts in a tree.

File last commit:

r17322:27b6119f
r18390:39ea1bc4
Show More
events.js
24 lines | 696 B | application/javascript | JavascriptLexer
// Copyright (c) IPython Development Team.
// Distributed under the terms of the Modified BSD License.
// Give us an object to bind all events to. This object should be created
// before all other objects so it exists when others register event handlers.
// To register an event handler:
//
// require(['base/js/events'], function (events) {
// events.on("event.Namespace", function () { do_stuff(); });
// });
define(['base/js/namespace', 'jquery'], function(IPython, $) {
"use strict";
var Events = function () {};
var events = new Events();
// Backwards compatability.
IPython.Events = Events;
IPython.events = events;
return $([events]);
});