Show More
@@ -5,13 +5,12 b' define([' | |||||
5 | 'base/js/namespace', |
|
5 | 'base/js/namespace', | |
6 | 'jquery', |
|
6 | 'jquery', | |
7 | 'base/js/utils', |
|
7 | 'base/js/utils', | |
8 | 'notebook/js/tooltip', |
|
|||
9 | 'base/js/keyboard', |
|
8 | 'base/js/keyboard', | |
10 | 'notebook/js/cell', |
|
9 | 'notebook/js/cell', | |
11 | 'notebook/js/outputarea', |
|
10 | 'notebook/js/outputarea', | |
12 | 'notebook/js/completer', |
|
11 | 'notebook/js/completer', | |
13 | 'notebook/js/celltoolbar', |
|
12 | 'notebook/js/celltoolbar', | |
14 |
], function(IPython, $, utils |
|
13 | ], function(IPython, $, utils, keyboard, cell, outputarea, completer, celltoolbar) { | |
15 | "use strict"; |
|
14 | "use strict"; | |
16 | var Cell = cell.Cell; |
|
15 | var Cell = cell.Cell; | |
17 |
|
16 | |||
@@ -56,11 +55,12 b' define([' | |||||
56 | // config: dictionary |
|
55 | // config: dictionary | |
57 | // keyboard_manager: KeyboardManager instance |
|
56 | // keyboard_manager: KeyboardManager instance | |
58 | // notebook: Notebook instance |
|
57 | // notebook: Notebook instance | |
|
58 | // tooltip: Tooltip instance | |||
59 | this.kernel = kernel || null; |
|
59 | this.kernel = kernel || null; | |
60 | this.notebook = options.notebook; |
|
60 | this.notebook = options.notebook; | |
61 | this.collapsed = false; |
|
61 | this.collapsed = false; | |
62 | this.events = options.events; |
|
62 | this.events = options.events; | |
63 |
this.tooltip = |
|
63 | this.tooltip = options.tooltip; | |
64 | this.config = options.config; |
|
64 | this.config = options.config; | |
65 |
|
65 | |||
66 | // create all attributed in constructor function |
|
66 | // create all attributed in constructor function |
@@ -132,4 +132,5 b' require([' | |||||
132 | IPython.keyboard_manager = keyboard_manager; |
|
132 | IPython.keyboard_manager = keyboard_manager; | |
133 | IPython.save_widget = save_widget; |
|
133 | IPython.save_widget = save_widget; | |
134 | IPython.config = user_config; |
|
134 | IPython.config = user_config; | |
|
135 | IPython.tooltip = notebook.tooltip; | |||
135 | }); |
|
136 | }); |
@@ -13,6 +13,7 b' define([' | |||||
13 | 'components/marked/lib/marked', |
|
13 | 'components/marked/lib/marked', | |
14 | 'notebook/js/mathjaxutils', |
|
14 | 'notebook/js/mathjaxutils', | |
15 | 'base/js/keyboard', |
|
15 | 'base/js/keyboard', | |
|
16 | 'notebook/js/tooltip', | |||
16 | ], function ( |
|
17 | ], function ( | |
17 | IPython, |
|
18 | IPython, | |
18 | $, |
|
19 | $, | |
@@ -24,7 +25,8 b' define([' | |||||
24 | celltoolbar, |
|
25 | celltoolbar, | |
25 | marked, |
|
26 | marked, | |
26 | mathjaxutils, |
|
27 | mathjaxutils, | |
27 | keyboard |
|
28 | keyboard, | |
|
29 | tooltip | |||
28 | ) { |
|
30 | ) { | |
29 |
|
31 | |||
30 | var Notebook = function (selector, options) { |
|
32 | var Notebook = function (selector, options) { | |
@@ -50,6 +52,7 b' define([' | |||||
50 | this.events = options.events; |
|
52 | this.events = options.events; | |
51 | this.keyboard_manager = options.keyboard_manager; |
|
53 | this.keyboard_manager = options.keyboard_manager; | |
52 | this.save_widget = options.save_widget; |
|
54 | this.save_widget = options.save_widget; | |
|
55 | this.tooltip = tooltip.Tooltip(this.events); | |||
53 | // TODO: This code smells (and the other `= this` line a couple lines down) |
|
56 | // TODO: This code smells (and the other `= this` line a couple lines down) | |
54 | // We need a better way to deal with circular instance references. |
|
57 | // We need a better way to deal with circular instance references. | |
55 | this.keyboard_manager.notebook = this; |
|
58 | this.keyboard_manager.notebook = this; | |
@@ -815,7 +818,8 b' define([' | |||||
815 | events: this.events, |
|
818 | events: this.events, | |
816 | config: this.config, |
|
819 | config: this.config, | |
817 | keyboard_manager: this.keyboard_manager, |
|
820 | keyboard_manager: this.keyboard_manager, | |
818 | notebook: this |
|
821 | notebook: this, | |
|
822 | tooltip: this.tooltip, | |||
819 | }; |
|
823 | }; | |
820 | if (type === 'code') { |
|
824 | if (type === 'code') { | |
821 | cell = new codecell.CodeCell(this.kernel, cell_options); |
|
825 | cell = new codecell.CodeCell(this.kernel, cell_options); |
@@ -3,7 +3,7 b'' | |||||
3 |
|
3 | |||
4 | define([ |
|
4 | define([ | |
5 | 'base/js/namespace', |
|
5 | 'base/js/namespace', | |
6 | 'jquery', |
|
6 | 'jqueryui', | |
7 | 'base/js/utils', |
|
7 | 'base/js/utils', | |
8 | 'base/js/security', |
|
8 | 'base/js/security', | |
9 | 'base/js/keyboard', |
|
9 | 'base/js/keyboard', |
@@ -3,7 +3,7 b'' | |||||
3 |
|
3 | |||
4 | define([ |
|
4 | define([ | |
5 | 'base/js/namespace', |
|
5 | 'base/js/namespace', | |
6 | 'jquery', |
|
6 | 'jqueryui', | |
7 | 'base/js/utils', |
|
7 | 'base/js/utils', | |
8 | ], function(IPython, $, utils) { |
|
8 | ], function(IPython, $, utils) { | |
9 | "use strict"; |
|
9 | "use strict"; |
@@ -3,7 +3,8 b'' | |||||
3 |
|
3 | |||
4 | define([ |
|
4 | define([ | |
5 | "widgets/js/widget", |
|
5 | "widgets/js/widget", | |
6 | ], function(widget){ |
|
6 | "jqueryui" | |
|
7 | ], function(widget, $){ | |||
7 |
|
8 | |||
8 | var ContainerView = widget.DOMWidgetView.extend({ |
|
9 | var ContainerView = widget.DOMWidgetView.extend({ | |
9 | render: function(){ |
|
10 | render: function(){ |
@@ -25,6 +25,7 b'' | |||||
25 | jquery: 'components/jquery/jquery.min', |
|
25 | jquery: 'components/jquery/jquery.min', | |
26 | bootstraptour: 'components/bootstrap-tour/build/js/bootstrap-tour.min', |
|
26 | bootstraptour: 'components/bootstrap-tour/build/js/bootstrap-tour.min', | |
27 | dateformat: 'dateformat/date.format', |
|
27 | dateformat: 'dateformat/date.format', | |
|
28 | jqueryui: 'components/jquery-ui/ui/minified/jquery-ui.min', | |||
28 | }, |
|
29 | }, | |
29 | shim: { |
|
30 | shim: { | |
30 | underscore: { |
|
31 | underscore: { | |
@@ -39,6 +40,10 b'' | |||||
39 | }, |
|
40 | }, | |
40 | dateformat: { |
|
41 | dateformat: { | |
41 | exports: "dateFormat" |
|
42 | exports: "dateFormat" | |
|
43 | }, | |||
|
44 | jqueryui: { | |||
|
45 | deps: ["jquery"], | |||
|
46 | exports: "$" | |||
42 | } |
|
47 | } | |
43 | } |
|
48 | } | |
44 | }); |
|
49 | }); |
@@ -11,10 +11,10 b' casper.notebook_test(function () {' | |||||
11 | this.evaluate(function (nbname) { |
|
11 | this.evaluate(function (nbname) { | |
12 | IPython.notebook.notebook_name = nbname; |
|
12 | IPython.notebook.notebook_name = nbname; | |
13 | IPython._save_success = IPython._save_failed = false; |
|
13 | IPython._save_success = IPython._save_failed = false; | |
14 |
|
|
14 | IPython.events.on('notebook_saved.Notebook', function () { | |
15 | IPython._save_success = true; |
|
15 | IPython._save_success = true; | |
16 | }); |
|
16 | }); | |
17 |
|
|
17 | IPython.events.on('notebook_save_failed.Notebook', | |
18 | function (event, xhr, status, error) { |
|
18 | function (event, xhr, status, error) { | |
19 | IPython._save_failed = "save failed with " + xhr.status + xhr.responseText; |
|
19 | IPython._save_failed = "save failed with " + xhr.status + xhr.responseText; | |
20 | }); |
|
20 | }); | |
@@ -41,7 +41,7 b' casper.notebook_test(function () {' | |||||
41 | }); |
|
41 | }); | |
42 |
|
42 | |||
43 | this.thenEvaluate(function(){ |
|
43 | this.thenEvaluate(function(){ | |
44 |
|
|
44 | IPython.events.on('checkpoint_created.Notebook', function (evt, data) { | |
45 | IPython._checkpoint_created = true; |
|
45 | IPython._checkpoint_created = true; | |
46 | }); |
|
46 | }); | |
47 | IPython._checkpoint_created = false; |
|
47 | IPython._checkpoint_created = false; |
General Comments 0
You need to be logged in to leave comments.
Login now