##// END OF EJS Templates
Adding refresh/focus/refresh back to edit to fix bug in FF.
Adding refresh/focus/refresh back to edit to fix bug in FF.

File last commit:

r5904:df394a61
r5951:96172955
Show More
quickhelp.js
69 lines | 2.8 KiB | application/javascript | JavascriptLexer
Fernando Perez
Add quick help button: broken ATM, style and binding aren't working....
r5023 //----------------------------------------------------------------------------
// 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.
//----------------------------------------------------------------------------
//============================================================================
MinRK
fix quickhelp widget...
r5066 // QuickHelp button
Fernando Perez
Add quick help button: broken ATM, style and binding aren't working....
r5023 //============================================================================
var IPython = (function (IPython) {
MinRK
fix quickhelp widget...
r5066 var QuickHelp = function (selector) {
Fernando Perez
Add quick help button: broken ATM, style and binding aren't working....
r5023 };
Brian Granger
Cleaning up menu code....
r5858 QuickHelp.prototype.show_keyboard_shortcuts = function () {
// toggles display of keyboard shortcut dialog
Fernando Perez
Add quick help button: broken ATM, style and binding aren't working....
r5023 var that = this;
Brian Granger
Cleaning up menu code....
r5858 if ( this.shortcut_dialog ){
// if dialog is already shown, close it
this.shortcut_dialog.dialog("close");
this.shortcut_dialog = null;
return;
}
var dialog = $('<div/>');
this.shortcut_dialog = dialog;
var shortcuts = [
{key: 'Shift-Enter', help: 'run cell'},
{key: 'Ctrl-Enter', help: 'run cell in-place'},
Brian Granger
Adding keyboard sortcuts for cut/copy/paste.
r5880 {key: 'Ctrl-m x', help: 'cut cell'},
{key: 'Ctrl-m c', help: 'copy cell'},
{key: 'Ctrl-m v', help: 'paste cell'},
Brian Granger
Cleaning up menu code....
r5858 {key: 'Ctrl-m d', help: 'delete cell'},
Brian Granger
Add Ace editing mode for code cells.
r5904 {key: 'Ctrl-m e', help: 'toggle edit cell in Ace'},
Brian Granger
Cleaning up menu code....
r5858 {key: 'Ctrl-m a', help: 'insert cell above'},
{key: 'Ctrl-m b', help: 'insert cell below'},
{key: 'Ctrl-m t', help: 'toggle output'},
{key: 'Ctrl-m l', help: 'toggle line numbers'},
{key: 'Ctrl-m s', help: 'save notebook'},
{key: 'Ctrl-m j', help: 'move cell down'},
{key: 'Ctrl-m k', help: 'move cell up'},
Brian Granger
Adding keyboard sortcuts for cut/copy/paste.
r5880 {key: 'Ctrl-m y', help: 'code cell'},
Brian Granger
Cleaning up menu code....
r5858 {key: 'Ctrl-m m', help: 'markdown cell'},
{key: 'Ctrl-m p', help: 'select previous'},
{key: 'Ctrl-m n', help: 'select next'},
{key: 'Ctrl-m i', help: 'interrupt kernel'},
{key: 'Ctrl-m .', help: 'restart kernel'},
{key: 'Ctrl-m h', help: 'show keyboard shortcuts'}
];
for (var i=0; i<shortcuts.length; i++) {
dialog.append($('<div>').
append($('<span/>').addClass('shortcut_key').html(shortcuts[i].key)).
append($('<span/>').addClass('shortcut_descr').html(' : ' + shortcuts[i].help))
);
};
dialog.bind('dialogclose', function(event) {
// dialog has been closed, allow it to be drawn again.
that.shortcut_dialog = null;
Fernando Perez
Add quick help button: broken ATM, style and binding aren't working....
r5023 });
Brian Granger
Cleaning up menu code....
r5858 dialog.dialog({title: 'Keyboard shortcuts', closeText: ''});
Fernando Perez
Add quick help button: broken ATM, style and binding aren't working....
r5023 };
// Set module variables
MinRK
fix quickhelp widget...
r5066 IPython.QuickHelp = QuickHelp;
Fernando Perez
Add quick help button: broken ATM, style and binding aren't working....
r5023
return IPython;
}(IPython));