Fixing design of quickhelp.

This commit is contained in:
Brian E. Granger 2014-01-10 09:32:16 -08:00
parent 506ffe5adf
commit c0fadb245d
2 changed files with 32 additions and 13 deletions

View File

@ -510,7 +510,6 @@ var IPython = (function (IPython) {
return -1; return -1;
return 0; return 0;
}); });
console.log(help);
return help; return help;
} }

View File

@ -41,6 +41,29 @@ var IPython = (function (IPython) {
) )
element.append(doc); element.append(doc);
// Command mode
var cmd_div = this.build_command_help();
element.append(cmd_div);
// Edit mode
var edit_div = this.build_edit_help();
element.append(edit_div);
this.shortcut_dialog = IPython.dialog.modal({
title : "Keyboard shortcuts",
body : element,
destroy : false,
buttons : {
Close : {}
}
});
};
QuickHelp.prototype.build_command_help = function () {
var command_shortcuts = IPython.keyboard_manager.command_shortcuts.help();
var help, shortcut;
var i, half, n;
// Command mode // Command mode
var cmd_div = $('<div/>').append($('<h4>Command Mode (press ESC to enable)</h4>')); var cmd_div = $('<div/>').append($('<h4>Command Mode (press ESC to enable)</h4>'));
var cmd_sub_div = $('<div/>').addClass('hbox'); var cmd_sub_div = $('<div/>').addClass('hbox');
@ -66,7 +89,13 @@ var IPython = (function (IPython) {
}; };
cmd_sub_div.append(cmd_col1).append(cmd_col2); cmd_sub_div.append(cmd_col1).append(cmd_col2);
cmd_div.append(cmd_sub_div); cmd_div.append(cmd_sub_div);
element.append(cmd_div); return cmd_div;
}
QuickHelp.prototype.build_edit_help = function () {
var edit_shortcuts = IPython.keyboard_manager.edit_shortcuts.help();
var help, shortcut;
var i, half, n;
// Edit mode // Edit mode
var edit_div = $('<div/>').append($('<h4>Edit Mode (press ENTER to enable)</h4>')); var edit_div = $('<div/>').append($('<h4>Edit Mode (press ENTER to enable)</h4>'));
@ -93,17 +122,8 @@ var IPython = (function (IPython) {
}; };
edit_sub_div.append(edit_col1).append(edit_col2); edit_sub_div.append(edit_col1).append(edit_col2);
edit_div.append(edit_sub_div); edit_div.append(edit_sub_div);
element.append(edit_div); return edit_div;
}
this.shortcut_dialog = IPython.dialog.modal({
title : "Keyboard shortcuts",
body : element,
destroy : false,
buttons : {
Close : {}
}
});
};
// Set module variables // Set module variables
IPython.QuickHelp = QuickHelp; IPython.QuickHelp = QuickHelp;