@ -1,9 +1,5 @@
//----------------------------------------------------------------------------
// Copyright (C) 2008-2011 The IPython Development Team
//
// Distributed under the terms of the BSD License. The full license is in
// the file COPYING, distributed as part of this software.
//----------------------------------------------------------------------------
// Copyright (c) IPython Development Team.
// Distributed under the terms of the Modified BSD License.
//============================================================================
// QuickHelp button
@ -15,6 +11,34 @@ var IPython = (function (IPython) {
var QuickHelp = function ( selector ) {
} ;
var cm _shortcuts = [
{ shortcut : "Insert" , help : "toggle overwrite" } ,
{ shortcut : "Tab" , help : "code completion" } ,
{ shortcut : "Shift-Tab" , help : "help introspection" } ,
{ shortcut : "Cmd-]" , help : "indent" } ,
{ shortcut : "Cmd-[" , help : "dedent" } ,
{ shortcut : "Cmd-A" , help : "select all" } ,
{ shortcut : "Cmd-D" , help : "delete line" } ,
{ shortcut : "Cmd-Z" , help : "undo" } ,
{ shortcut : "Cmd-Shift-Z" , help : "redo" } ,
{ shortcut : "Cmd-Y" , help : "redo" } ,
{ shortcut : "Cmd-Up" , help : "go to cell start" } ,
{ shortcut : "Cmd-End" , help : "go to cell start" } ,
{ shortcut : "PageUp" , help : "go to cell start" } ,
{ shortcut : "---" , help : "go to cell end" } ,
{ shortcut : "Cmd-Down" , help : "go to cell end" } ,
{ shortcut : "PageDown" , help : "go to cell end" } ,
{ shortcut : "Alt-Left" , help : "go one word left" } ,
{ shortcut : "Alt-Right" , help : "go one word right" } ,
{ shortcut : "Cmd-Left" , help : "go to line start" } ,
{ shortcut : "Home" , help : "go to line start" } ,
{ shortcut : "Cmd-Right" , help : "go to line end" } ,
{ shortcut : "End" , help : "go to line end" } ,
{ shortcut : "Alt-Backspace" , help : "del word before" } ,
]
QuickHelp . prototype . show _keyboard _shortcuts = function ( ) {
// toggles display of keyboard shortcut dialog
var that = this ;
@ -54,6 +78,10 @@ var IPython = (function (IPython) {
var edit _div = this . build _edit _help ( ) ;
element . append ( edit _div ) ;
// CodeMirror shortcuts
var cm _div = build _div ( '' , cm _shortcuts ) ;
element . append ( cm _div ) ;
this . shortcut _dialog = IPython . dialog . modal ( {
title : "Keyboard shortcuts" ,
body : element ,