Show More
@@ -350,66 +350,6 b' IPython.utils = (function (IPython) {' | |||||
350 | "$1<a target=\"_blank\" href=\"$2$3\">$2$3</a>"); |
|
350 | "$1<a target=\"_blank\" href=\"$2$3\">$2$3</a>"); | |
351 | } |
|
351 | } | |
352 |
|
352 | |||
353 | // some keycodes that seem to be platform/browser independent |
|
|||
354 | var keycodes = { |
|
|||
355 | BACKSPACE: 8, |
|
|||
356 | TAB : 9, |
|
|||
357 | ENTER : 13, |
|
|||
358 | SHIFT : 16, |
|
|||
359 | CTRL : 17, |
|
|||
360 | CONTROL : 17, |
|
|||
361 | ALT : 18, |
|
|||
362 | CAPS_LOCK: 20, |
|
|||
363 | ESC : 27, |
|
|||
364 | SPACE : 32, |
|
|||
365 | PGUP : 33, |
|
|||
366 | PGDOWN : 34, |
|
|||
367 | END : 35, |
|
|||
368 | HOME : 36, |
|
|||
369 | LEFT_ARROW: 37, |
|
|||
370 | LEFTARROW: 37, |
|
|||
371 | LEFT : 37, |
|
|||
372 | UP_ARROW : 38, |
|
|||
373 | UPARROW : 38, |
|
|||
374 | UP : 38, |
|
|||
375 | RIGHT_ARROW:39, |
|
|||
376 | RIGHTARROW:39, |
|
|||
377 | RIGHT : 39, |
|
|||
378 | DOWN_ARROW: 40, |
|
|||
379 | DOWNARROW: 40, |
|
|||
380 | DOWN : 40, |
|
|||
381 | I : 73, |
|
|||
382 | M : 77, |
|
|||
383 | // all three of these keys may be COMMAND on OS X: |
|
|||
384 | LEFT_SUPER : 91, |
|
|||
385 | RIGHT_SUPER : 92, |
|
|||
386 | COMMAND : 93, |
|
|||
387 | }; |
|
|||
388 |
|
||||
389 | // trigger a key press event |
|
|||
390 | var press = function (key) { |
|
|||
391 | var key_press = $.Event('keydown', {which: key}); |
|
|||
392 | $(document).trigger(key_press); |
|
|||
393 | } |
|
|||
394 |
|
||||
395 | var press_up = function() { press(keycodes.UP); }; |
|
|||
396 | var press_down = function() { press(keycodes.DOWN); }; |
|
|||
397 |
|
||||
398 | var press_ctrl_enter = function() { |
|
|||
399 | $(document).trigger($.Event('keydown', {which: keycodes.ENTER, ctrlKey: true})); |
|
|||
400 | }; |
|
|||
401 |
|
||||
402 | var press_shift_enter = function() { |
|
|||
403 | $(document).trigger($.Event('keydown', {which: keycodes.ENTER, shiftKey: true})); |
|
|||
404 | }; |
|
|||
405 |
|
||||
406 | // trigger the ctrl-m shortcut followed by one of our keys |
|
|||
407 | var press_ghetto = function(key) { |
|
|||
408 | $(document).trigger($.Event('keydown', {which: keycodes.M, ctrlKey: true})); |
|
|||
409 | press(key); |
|
|||
410 | }; |
|
|||
411 |
|
||||
412 |
|
||||
413 | var points_to_pixels = function (points) { |
|
353 | var points_to_pixels = function (points) { | |
414 | // A reasonably good way of converting between points and pixels. |
|
354 | // A reasonably good way of converting between points and pixels. | |
415 | var test = $('<div style="display: none; width: 10000pt; padding:0; border:0;"></div>'); |
|
355 | var test = $('<div style="display: none; width: 10000pt; padding:0; border:0;"></div>'); | |
@@ -431,7 +371,6 b' IPython.utils = (function (IPython) {' | |||||
431 | }; |
|
371 | }; | |
432 | }; |
|
372 | }; | |
433 |
|
373 | |||
434 |
|
||||
435 | var url_path_join = function () { |
|
374 | var url_path_join = function () { | |
436 | // join a sequence of url components with '/' |
|
375 | // join a sequence of url components with '/' | |
437 | var url = ''; |
|
376 | var url = ''; | |
@@ -554,13 +493,6 b' IPython.utils = (function (IPython) {' | |||||
554 | regex_split : regex_split, |
|
493 | regex_split : regex_split, | |
555 | uuid : uuid, |
|
494 | uuid : uuid, | |
556 | fixConsole : fixConsole, |
|
495 | fixConsole : fixConsole, | |
557 | keycodes : keycodes, |
|
|||
558 | press : press, |
|
|||
559 | press_up : press_up, |
|
|||
560 | press_down : press_down, |
|
|||
561 | press_ctrl_enter : press_ctrl_enter, |
|
|||
562 | press_shift_enter : press_shift_enter, |
|
|||
563 | press_ghetto : press_ghetto, |
|
|||
564 | fixCarriageReturn : fixCarriageReturn, |
|
496 | fixCarriageReturn : fixCarriageReturn, | |
565 | autoLinkUrls : autoLinkUrls, |
|
497 | autoLinkUrls : autoLinkUrls, | |
566 | points_to_pixels : points_to_pixels, |
|
498 | points_to_pixels : points_to_pixels, |
@@ -14,7 +14,6 b'' | |||||
14 |
|
14 | |||
15 | var CellToolbar = IPython.CellToolbar; |
|
15 | var CellToolbar = IPython.CellToolbar; | |
16 | var raw_cell_preset = []; |
|
16 | var raw_cell_preset = []; | |
17 | var utils = IPython.utils; |
|
|||
18 |
|
17 | |||
19 | var select_type = CellToolbar.utils.select_ui_generator([ |
|
18 | var select_type = CellToolbar.utils.select_ui_generator([ | |
20 | ["None", "-"], |
|
19 | ["None", "-"], | |
@@ -58,7 +57,7 b'' | |||||
58 | var that = $(this); |
|
57 | var that = $(this); | |
59 | // Upon ENTER, click the OK button. |
|
58 | // Upon ENTER, click the OK button. | |
60 | that.find('input[type="text"]').keydown(function (event, ui) { |
|
59 | that.find('input[type="text"]').keydown(function (event, ui) { | |
61 |
if (event.which === |
|
60 | if (event.which === IPython.keyboard.keycodes.enter) { | |
62 | that.find('.btn-primary').first().click(); |
|
61 | that.find('.btn-primary').first().click(); | |
63 | return false; |
|
62 | return false; | |
64 | } |
|
63 | } |
@@ -45,7 +45,7 b' var IPython = (function (IPython) {' | |||||
45 | "use strict"; |
|
45 | "use strict"; | |
46 |
|
46 | |||
47 | var utils = IPython.utils; |
|
47 | var utils = IPython.utils; | |
48 |
var key |
|
48 | var keycodes = IPython.keyboard.keycodes; | |
49 |
|
49 | |||
50 | /** |
|
50 | /** | |
51 | * A Cell conceived to write code. |
|
51 | * A Cell conceived to write code. | |
@@ -195,16 +195,16 b' var IPython = (function (IPython) {' | |||||
195 | // whatever key is pressed, first, cancel the tooltip request before |
|
195 | // whatever key is pressed, first, cancel the tooltip request before | |
196 | // they are sent, and remove tooltip if any, except for tab again |
|
196 | // they are sent, and remove tooltip if any, except for tab again | |
197 | var tooltip_closed = null; |
|
197 | var tooltip_closed = null; | |
198 |
if (event.type === 'keydown' && event.which != key. |
|
198 | if (event.type === 'keydown' && event.which != keycodes.tab ) { | |
199 | tooltip_closed = IPython.tooltip.remove_and_cancel_tooltip(); |
|
199 | tooltip_closed = IPython.tooltip.remove_and_cancel_tooltip(); | |
200 | } |
|
200 | } | |
201 |
|
201 | |||
202 | var cur = editor.getCursor(); |
|
202 | var cur = editor.getCursor(); | |
203 |
if (event.keyCode === key. |
|
203 | if (event.keyCode === keycodes.enter){ | |
204 | this.auto_highlight(); |
|
204 | this.auto_highlight(); | |
205 | } |
|
205 | } | |
206 |
|
206 | |||
207 |
if (event.keyCode === key. |
|
207 | if (event.keyCode === keycodes.enter && (event.shiftKey || event.ctrlKey || event.altKey)) { | |
208 | // Always ignore shift-enter in CodeMirror as we handle it. |
|
208 | // Always ignore shift-enter in CodeMirror as we handle it. | |
209 | return true; |
|
209 | return true; | |
210 | } else if (event.which === 40 && event.type === 'keypress' && IPython.tooltip.time_before_tooltip >= 0) { |
|
210 | } else if (event.which === 40 && event.type === 'keypress' && IPython.tooltip.time_before_tooltip >= 0) { | |
@@ -214,7 +214,7 b' var IPython = (function (IPython) {' | |||||
214 | // The second argument says to hide the tooltip if the docstring |
|
214 | // The second argument says to hide the tooltip if the docstring | |
215 | // is actually empty |
|
215 | // is actually empty | |
216 | IPython.tooltip.pending(that, true); |
|
216 | IPython.tooltip.pending(that, true); | |
217 |
} else if (event.which === key. |
|
217 | } else if (event.which === keycodes.up && event.type === 'keydown') { | |
218 | // If we are not at the top, let CM handle the up arrow and |
|
218 | // If we are not at the top, let CM handle the up arrow and | |
219 | // prevent the global keydown handler from handling it. |
|
219 | // prevent the global keydown handler from handling it. | |
220 | if (!that.at_top()) { |
|
220 | if (!that.at_top()) { | |
@@ -223,7 +223,7 b' var IPython = (function (IPython) {' | |||||
223 | } else { |
|
223 | } else { | |
224 | return true; |
|
224 | return true; | |
225 | } |
|
225 | } | |
226 |
} else if (event.which === key. |
|
226 | } else if (event.which === keycodes.esc && event.type === 'keydown') { | |
227 | // First see if the tooltip is active and if so cancel it. |
|
227 | // First see if the tooltip is active and if so cancel it. | |
228 | if (tooltip_closed) { |
|
228 | if (tooltip_closed) { | |
229 | // The call to remove_and_cancel_tooltip above in L177 doesn't pass |
|
229 | // The call to remove_and_cancel_tooltip above in L177 doesn't pass | |
@@ -249,7 +249,7 b' var IPython = (function (IPython) {' | |||||
249 | // Don't let CM handle the event, defer to global handling. |
|
249 | // Don't let CM handle the event, defer to global handling. | |
250 | return true; |
|
250 | return true; | |
251 | } |
|
251 | } | |
252 |
} else if (event.which === key. |
|
252 | } else if (event.which === keycodes.down && event.type === 'keydown') { | |
253 | // If we are not at the bottom, let CM handle the down arrow and |
|
253 | // If we are not at the bottom, let CM handle the down arrow and | |
254 | // prevent the global keydown handler from handling it. |
|
254 | // prevent the global keydown handler from handling it. | |
255 | if (!that.at_bottom()) { |
|
255 | if (!that.at_bottom()) { | |
@@ -258,7 +258,7 b' var IPython = (function (IPython) {' | |||||
258 | } else { |
|
258 | } else { | |
259 | return true; |
|
259 | return true; | |
260 | } |
|
260 | } | |
261 |
} else if (event.keyCode === key. |
|
261 | } else if (event.keyCode === keycodes.tab && event.type === 'keydown' && event.shiftKey) { | |
262 | if (editor.somethingSelected()){ |
|
262 | if (editor.somethingSelected()){ | |
263 | var anchor = editor.getCursor("anchor"); |
|
263 | var anchor = editor.getCursor("anchor"); | |
264 | var head = editor.getCursor("head"); |
|
264 | var head = editor.getCursor("head"); | |
@@ -269,7 +269,7 b' var IPython = (function (IPython) {' | |||||
269 | IPython.tooltip.request(that); |
|
269 | IPython.tooltip.request(that); | |
270 | event.stop(); |
|
270 | event.stop(); | |
271 | return true; |
|
271 | return true; | |
272 |
} else if (event.keyCode === key. |
|
272 | } else if (event.keyCode === keycodes.tab && event.type == 'keydown') { | |
273 | // Tab completion. |
|
273 | // Tab completion. | |
274 | IPython.tooltip.remove_and_cancel_tooltip(); |
|
274 | IPython.tooltip.remove_and_cancel_tooltip(); | |
275 | if (editor.somethingSelected()) { |
|
275 | if (editor.somethingSelected()) { |
@@ -6,7 +6,7 b' var IPython = (function (IPython) {' | |||||
6 | "use strict"; |
|
6 | "use strict"; | |
7 |
|
7 | |||
8 | // easier key mapping |
|
8 | // easier key mapping | |
9 |
var key = IPython. |
|
9 | var keycodes = IPython.keyboard.keycodes; | |
10 |
|
10 | |||
11 | function prepend_n_prc(str, n) { |
|
11 | function prepend_n_prc(str, n) { | |
12 | for( var i =0 ; i< n ; i++){ |
|
12 | for( var i =0 ; i< n ; i++){ | |
@@ -317,19 +317,20 b' var IPython = (function (IPython) {' | |||||
317 | } |
|
317 | } | |
318 |
|
318 | |||
319 | // Enter |
|
319 | // Enter | |
320 |
if (code == key. |
|
320 | if (code == keycodes.enter) { | |
321 | CodeMirror.e_stop(event); |
|
321 | CodeMirror.e_stop(event); | |
322 | this.pick(); |
|
322 | this.pick(); | |
323 | } |
|
323 | } | |
324 | // Escape or backspace |
|
324 | // Escape or backspace | |
325 |
else if (code == key. |
|
325 | else if (code == keycodes.esc) { | |
326 | CodeMirror.e_stop(event); |
|
326 | CodeMirror.e_stop(event); | |
327 | this.close(); |
|
327 | this.close(); | |
328 | this.editor.focus(); |
|
328 | this.editor.focus(); | |
329 | } else if (code == key.BACKSPACE) { |
|
329 | ||
|
330 | } else if (code == keycodes.backspace) { | |||
330 | this.close(); |
|
331 | this.close(); | |
331 | this.editor.focus(); |
|
332 | this.editor.focus(); | |
332 |
} else if (code == key. |
|
333 | } else if (code == keycodes.tab) { | |
333 | //all the fastforwarding operation, |
|
334 | //all the fastforwarding operation, | |
334 | //Check that shared start is not null which can append with prefixed completion |
|
335 | //Check that shared start is not null which can append with prefixed completion | |
335 | // like %pylab , pylab have no shred start, and ff will result in py<tab><tab> |
|
336 | // like %pylab , pylab have no shred start, and ff will result in py<tab><tab> | |
@@ -345,7 +346,7 b' var IPython = (function (IPython) {' | |||||
345 | setTimeout(function () { |
|
346 | setTimeout(function () { | |
346 | that.carry_on_completion(); |
|
347 | that.carry_on_completion(); | |
347 | }, 50); |
|
348 | }, 50); | |
348 |
} else if (code == key. |
|
349 | } else if (code == keycodes.up || code == keycodes.down) { | |
349 | // need to do that to be able to move the arrow |
|
350 | // need to do that to be able to move the arrow | |
350 | // when on the first or last line ofo a code cell |
|
351 | // when on the first or last line ofo a code cell | |
351 | event.stopPropagation(); |
|
352 | event.stopPropagation(); |
@@ -1917,7 +1917,7 b' var IPython = (function (IPython) {' | |||||
1917 | var that = $(this); |
|
1917 | var that = $(this); | |
1918 | // Upon ENTER, click the OK button. |
|
1918 | // Upon ENTER, click the OK button. | |
1919 | that.find('input[type="text"]').keydown(function (event, ui) { |
|
1919 | that.find('input[type="text"]').keydown(function (event, ui) { | |
1920 |
if (event.which === |
|
1920 | if (event.which === IPython.keyboard.keycodes.enter) { | |
1921 | that.find('.btn-primary').first().click(); |
|
1921 | that.find('.btn-primary').first().click(); | |
1922 | } |
|
1922 | } | |
1923 | }); |
|
1923 | }); |
@@ -669,7 +669,7 b' var IPython = (function (IPython) {' | |||||
669 | .keydown(function (event, ui) { |
|
669 | .keydown(function (event, ui) { | |
670 | // make sure we submit on enter, |
|
670 | // make sure we submit on enter, | |
671 | // and don't re-execute the *cell* on shift-enter |
|
671 | // and don't re-execute the *cell* on shift-enter | |
672 |
if (event.which === |
|
672 | if (event.which === IPython.keyboard.keycodes.enter) { | |
673 | that._submit_raw_input(); |
|
673 | that._submit_raw_input(); | |
674 | return false; |
|
674 | return false; | |
675 | } |
|
675 | } |
@@ -103,7 +103,7 b' var IPython = (function (IPython) {' | |||||
103 | var that = $(this); |
|
103 | var that = $(this); | |
104 | // Upon ENTER, click the OK button. |
|
104 | // Upon ENTER, click the OK button. | |
105 | that.find('input[type="text"]').keydown(function (event, ui) { |
|
105 | that.find('input[type="text"]').keydown(function (event, ui) { | |
106 |
if (event.which === |
|
106 | if (event.which === IPython.keyboard.keycodes.enter) { | |
107 | that.find('.btn-primary').first().click(); |
|
107 | that.find('.btn-primary').first().click(); | |
108 | return false; |
|
108 | return false; | |
109 | } |
|
109 | } |
@@ -20,7 +20,7 b' var IPython = (function (IPython) {' | |||||
20 | "use strict"; |
|
20 | "use strict"; | |
21 |
|
21 | |||
22 | // TextCell base class |
|
22 | // TextCell base class | |
23 |
var key = IPython. |
|
23 | var keycodes = IPython.keyboard.keycodes; | |
24 |
|
24 | |||
25 | /** |
|
25 | /** | |
26 | * Construct a new TextCell, codemirror mode is by default 'htmlmixed', and cell type is 'text' |
|
26 | * Construct a new TextCell, codemirror mode is by default 'htmlmixed', and cell type is 'text' | |
@@ -140,7 +140,7 b' var IPython = (function (IPython) {' | |||||
140 | if (event.keyCode === 13 && (event.shiftKey || event.ctrlKey || event.altKey)) { |
|
140 | if (event.keyCode === 13 && (event.shiftKey || event.ctrlKey || event.altKey)) { | |
141 | // Always ignore shift-enter in CodeMirror as we handle it. |
|
141 | // Always ignore shift-enter in CodeMirror as we handle it. | |
142 | return true; |
|
142 | return true; | |
143 |
} else if (event.which === key. |
|
143 | } else if (event.which === keycodes.up && event.type === 'keydown') { | |
144 | // If we are not at the top, let CM handle the up arrow and |
|
144 | // If we are not at the top, let CM handle the up arrow and | |
145 | // prevent the global keydown handler from handling it. |
|
145 | // prevent the global keydown handler from handling it. | |
146 | if (!that.at_top()) { |
|
146 | if (!that.at_top()) { | |
@@ -148,8 +148,8 b' var IPython = (function (IPython) {' | |||||
148 | return false; |
|
148 | return false; | |
149 | } else { |
|
149 | } else { | |
150 | return true; |
|
150 | return true; | |
151 | } |
|
151 | }; | |
152 |
} else if (event.which === key. |
|
152 | } else if (event.which === keycodes.down && event.type === 'keydown') { | |
153 | // If we are not at the bottom, let CM handle the down arrow and |
|
153 | // If we are not at the bottom, let CM handle the down arrow and | |
154 | // prevent the global keydown handler from handling it. |
|
154 | // prevent the global keydown handler from handling it. | |
155 | if (!that.at_bottom()) { |
|
155 | if (!that.at_bottom()) { | |
@@ -157,8 +157,8 b' var IPython = (function (IPython) {' | |||||
157 | return false; |
|
157 | return false; | |
158 | } else { |
|
158 | } else { | |
159 | return true; |
|
159 | return true; | |
160 | } |
|
160 | }; | |
161 |
} else if (event.which === key. |
|
161 | } else if (event.which === keycodes.esc && event.type === 'keydown') { | |
162 | if (that.code_mirror.options.keyMap === "vim-insert") { |
|
162 | if (that.code_mirror.options.keyMap === "vim-insert") { | |
163 | // vim keyMap is active and in insert mode. In this case we leave vim |
|
163 | // vim keyMap is active and in insert mode. In this case we leave vim | |
164 | // insert mode, but remain in notebook edit mode. |
|
164 | // insert mode, but remain in notebook edit mode. |
@@ -5,14 +5,14 b' casper.notebook_test(function () {' | |||||
5 | var result = this.evaluate(function() { |
|
5 | var result = this.evaluate(function() { | |
6 | IPython.notebook.command_mode(); |
|
6 | IPython.notebook.command_mode(); | |
7 | pos0 = IPython.notebook.get_selected_index(); |
|
7 | pos0 = IPython.notebook.get_selected_index(); | |
8 |
|
|
8 | IPython.keyboard.trigger_keydown('b'); | |
9 | pos1 = IPython.notebook.get_selected_index(); |
|
9 | pos1 = IPython.notebook.get_selected_index(); | |
10 |
|
|
10 | IPython.keyboard.trigger_keydown('b'); | |
11 | pos2 = IPython.notebook.get_selected_index(); |
|
11 | pos2 = IPython.notebook.get_selected_index(); | |
12 | // Simulate the "up arrow" and "down arrow" keys. |
|
12 | // Simulate the "up arrow" and "down arrow" keys. | |
13 |
IPython. |
|
13 | IPython.keyboard.trigger_keydown('up'); | |
14 | pos3 = IPython.notebook.get_selected_index(); |
|
14 | pos3 = IPython.notebook.get_selected_index(); | |
15 |
IPython. |
|
15 | IPython.keyboard.trigger_keydown('down'); | |
16 | pos4 = IPython.notebook.get_selected_index(); |
|
16 | pos4 = IPython.notebook.get_selected_index(); | |
17 | return pos0 == 0 && |
|
17 | return pos0 == 0 && | |
18 | pos1 == 1 && |
|
18 | pos1 == 1 && |
@@ -13,8 +13,8 b' casper.notebook_test(function () {' | |||||
13 |
|
13 | |||
14 | // Simulate the "up arrow" and "down arrow" keys. |
|
14 | // Simulate the "up arrow" and "down arrow" keys. | |
15 | // |
|
15 | // | |
16 |
IPython. |
|
16 | IPython.keyboard.trigger_keydown('up'); | |
17 |
IPython. |
|
17 | IPython.keyboard.trigger_keydown('down'); | |
18 | return true; |
|
18 | return true; | |
19 | }); |
|
19 | }); | |
20 | this.test.assertTrue(result, 'Up/down arrow okay in empty notebook.'); |
|
20 | this.test.assertTrue(result, 'Up/down arrow okay in empty notebook.'); |
@@ -22,7 +22,7 b' casper.notebook_test(function () {' | |||||
22 | var cell = IPython.notebook.get_cell(0); |
|
22 | var cell = IPython.notebook.get_cell(0); | |
23 | cell.set_text('a=11; print(a)'); |
|
23 | cell.set_text('a=11; print(a)'); | |
24 | cell.clear_output(); |
|
24 | cell.clear_output(); | |
25 |
IPython. |
|
25 | IPython.keyboard.trigger_keydown('shift+enter'); | |
26 | }); |
|
26 | }); | |
27 |
|
27 | |||
28 | this.wait_for_output(0); |
|
28 | this.wait_for_output(0); | |
@@ -41,7 +41,7 b' casper.notebook_test(function () {' | |||||
41 | var cell = IPython.notebook.get_cell(0); |
|
41 | var cell = IPython.notebook.get_cell(0); | |
42 | cell.set_text('a=12; print(a)'); |
|
42 | cell.set_text('a=12; print(a)'); | |
43 | cell.clear_output(); |
|
43 | cell.clear_output(); | |
44 |
IPython. |
|
44 | IPython.keyboard.trigger_keydown('ctrl+enter'); | |
45 | }); |
|
45 | }); | |
46 |
|
46 | |||
47 | this.wait_for_output(0); |
|
47 | this.wait_for_output(0); |
@@ -32,7 +32,7 b' casper.notebook_test(function () {' | |||||
32 |
|
32 | |||
33 | // interrupt using Ctrl-M I keyboard shortcut |
|
33 | // interrupt using Ctrl-M I keyboard shortcut | |
34 | this.thenEvaluate( function() { |
|
34 | this.thenEvaluate( function() { | |
35 | IPython.utils.press_ghetto(IPython.utils.keycodes.I) |
|
35 | IPython.keyboard.trigger_keydown('i'); | |
36 | }); |
|
36 | }); | |
37 |
|
37 | |||
38 | this.wait_for_output(0); |
|
38 | this.wait_for_output(0); |
@@ -9,7 +9,7 b' casper.notebook_test(function() {' | |||||
9 | var cell_one = IPython.notebook.get_selected_cell(); |
|
9 | var cell_one = IPython.notebook.get_selected_cell(); | |
10 | cell_one.set_text('a = 5'); |
|
10 | cell_one.set_text('a = 5'); | |
11 |
|
11 | |||
12 |
|
|
12 | IPython.keyboard.trigger_keydown('b'); | |
13 | var cell_two = IPython.notebook.get_selected_cell(); |
|
13 | var cell_two = IPython.notebook.get_selected_cell(); | |
14 | cell_two.set_text('print(a)'); |
|
14 | cell_two.set_text('print(a)'); | |
15 | }; |
|
15 | }; |
General Comments 0
You need to be logged in to leave comments.
Login now