##// END OF EJS Templates
first pass at capitalizing keyboard shortcuts
Paul Ivanov -
Show More
@@ -79,7 +79,7 b' var IPython = (function (IPython) {'
79 79 half = ~~(n/2); // Truncate :)
80 80 for (i=0; i<half; i++) {
81 81 help = command_shortcuts[i]['help'];
82 shortcut = command_shortcuts[i]['shortcut'];
82 shortcut = shortcut_name(command_shortcuts[i]['shortcut']);
83 83 cmd_col1.append($('<div>').addClass('quickhelp').
84 84 append($('<span/>').addClass('shortcut_key').text(shortcut)).
85 85 append($('<span/>').addClass('shortcut_descr').text(' : ' + help))
@@ -87,7 +87,7 b' var IPython = (function (IPython) {'
87 87 };
88 88 for (i=half; i<n; i++) {
89 89 help = command_shortcuts[i]['help'];
90 shortcut = command_shortcuts[i]['shortcut'];
90 shortcut = shortcut_name(command_shortcuts[i]['shortcut']);
91 91 cmd_col2.append($('<div>').addClass('quickhelp').
92 92 append($('<span/>').addClass('shortcut_key').text(shortcut)).
93 93 append($('<span/>').addClass('shortcut_descr').text(' : ' + help))
@@ -98,6 +98,13 b' var IPython = (function (IPython) {'
98 98 return cmd_div;
99 99 }
100 100
101 var special_case = { pageup: "PageUp", pagedown: "Page Down" };
102 var shortcut_name = function (s) {
103 return ( special_case[s] ? special_case[s] : s.charAt(0).toUpperCase() + s.slice(1) );
104
105
106 };
107
101 108 QuickHelp.prototype.build_edit_help = function () {
102 109 var edit_shortcuts = IPython.keyboard_manager.edit_shortcuts.help();
103 110 var help, shortcut;
@@ -112,7 +119,7 b' var IPython = (function (IPython) {'
112 119 half = ~~(n/2); // Truncate :)
113 120 for (i=0; i<half; i++) {
114 121 help = edit_shortcuts[i]['help'];
115 shortcut = edit_shortcuts[i]['shortcut'];
122 shortcut = shortcut_name(edit_shortcuts[i]['shortcut']);
116 123 edit_col1.append($('<div>').addClass('quickhelp').
117 124 append($('<span/>').addClass('shortcut_key').text(shortcut)).
118 125 append($('<span/>').addClass('shortcut_descr').text(' : ' + help))
@@ -120,7 +127,7 b' var IPython = (function (IPython) {'
120 127 };
121 128 for (i=half; i<n; i++) {
122 129 help = edit_shortcuts[i]['help'];
123 shortcut = edit_shortcuts[i]['shortcut'];
130 shortcut = shortcut_name(edit_shortcuts[i]['shortcut']);
124 131 edit_col2.append($('<div>').addClass('quickhelp').
125 132 append($('<span/>').addClass('shortcut_key').text(shortcut)).
126 133 append($('<span/>').addClass('shortcut_descr').text(' : ' + help))
General Comments 0
You need to be logged in to leave comments. Login now