##// END OF EJS Templates
Add tooltips to the notebook via 'title' attr....
MinRK -
Show More
@@ -1,60 +1,63 b''
1 //----------------------------------------------------------------------------
1 //----------------------------------------------------------------------------
2 // Copyright (C) 2008-2011 The IPython Development Team
2 // Copyright (C) 2008-2011 The IPython Development Team
3 //
3 //
4 // Distributed under the terms of the BSD License. The full license is in
4 // Distributed under the terms of the BSD License. The full license is in
5 // the file COPYING, distributed as part of this software.
5 // the file COPYING, distributed as part of this software.
6 //----------------------------------------------------------------------------
6 //----------------------------------------------------------------------------
7
7
8 //============================================================================
8 //============================================================================
9 // Kernel Status widget
9 // Kernel Status widget
10 //============================================================================
10 //============================================================================
11
11
12 var IPython = (function (IPython) {
12 var IPython = (function (IPython) {
13
13
14 var utils = IPython.utils;
14 var utils = IPython.utils;
15
15
16 var KernelStatusWidget = function (selector) {
16 var KernelStatusWidget = function (selector) {
17 this.selector = selector;
17 this.selector = selector;
18 if (this.selector !== undefined) {
18 if (this.selector !== undefined) {
19 this.element = $(selector);
19 this.element = $(selector);
20 this.style();
20 this.style();
21 }
21 }
22 };
22 };
23
23
24
24
25 KernelStatusWidget.prototype.style = function () {
25 KernelStatusWidget.prototype.style = function () {
26 this.element.addClass('ui-widget');
26 this.element.addClass('ui-widget');
27 this.element.attr('title', "The kernel execution status." +
28 " If 'Busy', the kernel is currently running code." +
29 " If 'Idle', it is available for execution.")
27 };
30 };
28
31
29
32
30 KernelStatusWidget.prototype.status_busy = function () {
33 KernelStatusWidget.prototype.status_busy = function () {
31 this.element.removeClass("status_idle");
34 this.element.removeClass("status_idle");
32 this.element.removeClass("status_restarting");
35 this.element.removeClass("status_restarting");
33 this.element.addClass("status_busy");
36 this.element.addClass("status_busy");
34 this.element.text("Busy");
37 this.element.text("Busy");
35 };
38 };
36
39
37
40
38 KernelStatusWidget.prototype.status_idle = function () {
41 KernelStatusWidget.prototype.status_idle = function () {
39 this.element.removeClass("status_busy");
42 this.element.removeClass("status_busy");
40 this.element.removeClass("status_restarting");
43 this.element.removeClass("status_restarting");
41 this.element.addClass("status_idle");
44 this.element.addClass("status_idle");
42 this.element.text("Idle");
45 this.element.text("Idle");
43 };
46 };
44
47
45 KernelStatusWidget.prototype.status_restarting = function () {
48 KernelStatusWidget.prototype.status_restarting = function () {
46 this.element.removeClass("status_busy");
49 this.element.removeClass("status_busy");
47 this.element.removeClass("status_idle");
50 this.element.removeClass("status_idle");
48 this.element.addClass("status_restarting");
51 this.element.addClass("status_restarting");
49 this.element.text("Restarting");
52 this.element.text("Restarting");
50 };
53 };
51
54
52
55
53
56
54
57
55 IPython.KernelStatusWidget = KernelStatusWidget;
58 IPython.KernelStatusWidget = KernelStatusWidget;
56
59
57 return IPython;
60 return IPython;
58
61
59 }(IPython));
62 }(IPython));
60
63
@@ -1,101 +1,102 b''
1 //----------------------------------------------------------------------------
1 //----------------------------------------------------------------------------
2 // Copyright (C) 2008-2011 The IPython Development Team
2 // Copyright (C) 2008-2011 The IPython Development Team
3 //
3 //
4 // Distributed under the terms of the BSD License. The full license is in
4 // Distributed under the terms of the BSD License. The full license is in
5 // the file COPYING, distributed as part of this software.
5 // the file COPYING, distributed as part of this software.
6 //----------------------------------------------------------------------------
6 //----------------------------------------------------------------------------
7
7
8 //============================================================================
8 //============================================================================
9 // LeftPanel
9 // LeftPanel
10 //============================================================================
10 //============================================================================
11
11
12
12
13 var IPython = (function (IPython) {
13 var IPython = (function (IPython) {
14
14
15 var utils = IPython.utils;
15 var utils = IPython.utils;
16
16
17 var LeftPanel = function (left_panel_selector, left_panel_splitter_selector) {
17 var LeftPanel = function (left_panel_selector, left_panel_splitter_selector) {
18 this.left_panel_element = $(left_panel_selector);
18 this.left_panel_element = $(left_panel_selector);
19 this.left_panel_splitter_element = $(left_panel_splitter_selector);
19 this.left_panel_splitter_element = $(left_panel_splitter_selector);
20 this.expanded = true;
20 this.expanded = true;
21 this.width = 300;
21 this.width = 300;
22 this.style();
22 this.style();
23 this.bind_events();
23 this.bind_events();
24 this.create_children();
24 this.create_children();
25 };
25 };
26
26
27
27
28 LeftPanel.prototype.style = function () {
28 LeftPanel.prototype.style = function () {
29 this.left_panel_splitter_element.addClass('border-box-sizing ui-widget ui-state-default');
29 this.left_panel_splitter_element.addClass('border-box-sizing ui-widget ui-state-default');
30 this.left_panel_element.addClass('border-box-sizing ui-widget');
30 this.left_panel_element.addClass('border-box-sizing ui-widget');
31 this.left_panel_element.width(this.width);
31 this.left_panel_element.width(this.width);
32 this.left_panel_splitter_element.css({left : this.width});
32 this.left_panel_splitter_element.css({left : this.width});
33 this.left_panel_splitter_element.attr('title', 'Click to Show/Hide left panel');
33 };
34 };
34
35
35
36
36 LeftPanel.prototype.bind_events = function () {
37 LeftPanel.prototype.bind_events = function () {
37 var that = this;
38 var that = this;
38
39
39 this.left_panel_element.bind('collapse_left_panel', function () {
40 this.left_panel_element.bind('collapse_left_panel', function () {
40 that.left_panel_element.hide('fast');
41 that.left_panel_element.hide('fast');
41 that.left_panel_splitter_element.animate({left : 0}, 'fast');
42 that.left_panel_splitter_element.animate({left : 0}, 'fast');
42 });
43 });
43
44
44 this.left_panel_element.bind('expand_left_panel', function () {
45 this.left_panel_element.bind('expand_left_panel', function () {
45 that.left_panel_element.show('fast');
46 that.left_panel_element.show('fast');
46 that.left_panel_splitter_element.animate({left : that.width}, 'fast');
47 that.left_panel_splitter_element.animate({left : that.width}, 'fast');
47 });
48 });
48
49
49 this.left_panel_splitter_element.hover(
50 this.left_panel_splitter_element.hover(
50 function () {
51 function () {
51 that.left_panel_splitter_element.addClass('ui-state-hover');
52 that.left_panel_splitter_element.addClass('ui-state-hover');
52 },
53 },
53 function () {
54 function () {
54 that.left_panel_splitter_element.removeClass('ui-state-hover');
55 that.left_panel_splitter_element.removeClass('ui-state-hover');
55 }
56 }
56 );
57 );
57
58
58 this.left_panel_splitter_element.click(function () {
59 this.left_panel_splitter_element.click(function () {
59 that.toggle();
60 that.toggle();
60 });
61 });
61
62
62 };
63 };
63
64
64
65
65 LeftPanel.prototype.create_children = function () {
66 LeftPanel.prototype.create_children = function () {
66 this.notebook_section = new IPython.NotebookSection('div#notebook_section');
67 this.notebook_section = new IPython.NotebookSection('div#notebook_section');
67 this.cell_section = new IPython.CellSection('div#cell_section');
68 this.cell_section = new IPython.CellSection('div#cell_section');
68 this.kernel_section = new IPython.KernelSection('div#kernel_section');
69 this.kernel_section = new IPython.KernelSection('div#kernel_section');
69 this.help_section = new IPython.HelpSection('div#help_section');
70 this.help_section = new IPython.HelpSection('div#help_section');
70 }
71 }
71
72
72 LeftPanel.prototype.collapse = function () {
73 LeftPanel.prototype.collapse = function () {
73 if (this.expanded === true) {
74 if (this.expanded === true) {
74 this.left_panel_element.add($('div#notebook')).trigger('collapse_left_panel');
75 this.left_panel_element.add($('div#notebook')).trigger('collapse_left_panel');
75 this.expanded = false;
76 this.expanded = false;
76 };
77 };
77 };
78 };
78
79
79
80
80 LeftPanel.prototype.expand = function () {
81 LeftPanel.prototype.expand = function () {
81 if (this.expanded !== true) {
82 if (this.expanded !== true) {
82 this.left_panel_element.add($('div#notebook')).trigger('expand_left_panel');
83 this.left_panel_element.add($('div#notebook')).trigger('expand_left_panel');
83 this.expanded = true;
84 this.expanded = true;
84 };
85 };
85 };
86 };
86
87
87
88
88 LeftPanel.prototype.toggle = function () {
89 LeftPanel.prototype.toggle = function () {
89 if (this.expanded === true) {
90 if (this.expanded === true) {
90 this.collapse();
91 this.collapse();
91 } else {
92 } else {
92 this.expand();
93 this.expand();
93 };
94 };
94 };
95 };
95
96
96 IPython.LeftPanel = LeftPanel;
97 IPython.LeftPanel = LeftPanel;
97
98
98 return IPython;
99 return IPython;
99
100
100 }(IPython));
101 }(IPython));
101
102
@@ -1,101 +1,102 b''
1 //----------------------------------------------------------------------------
1 //----------------------------------------------------------------------------
2 // Copyright (C) 2008-2011 The IPython Development Team
2 // Copyright (C) 2008-2011 The IPython Development Team
3 //
3 //
4 // Distributed under the terms of the BSD License. The full license is in
4 // Distributed under the terms of the BSD License. The full license is in
5 // the file COPYING, distributed as part of this software.
5 // the file COPYING, distributed as part of this software.
6 //----------------------------------------------------------------------------
6 //----------------------------------------------------------------------------
7
7
8 //============================================================================
8 //============================================================================
9 // Pager
9 // Pager
10 //============================================================================
10 //============================================================================
11
11
12 var IPython = (function (IPython) {
12 var IPython = (function (IPython) {
13
13
14 var utils = IPython.utils;
14 var utils = IPython.utils;
15
15
16 var Pager = function (pager_selector, pager_splitter_selector) {
16 var Pager = function (pager_selector, pager_splitter_selector) {
17 this.pager_element = $(pager_selector);
17 this.pager_element = $(pager_selector);
18 this.pager_splitter_element = $(pager_splitter_selector);
18 this.pager_splitter_element = $(pager_splitter_selector);
19 this.expanded = true;
19 this.expanded = true;
20 this.percentage_height = 0.40;
20 this.percentage_height = 0.40;
21 this.style();
21 this.style();
22 this.bind_events();
22 this.bind_events();
23 };
23 };
24
24
25
25
26 Pager.prototype.style = function () {
26 Pager.prototype.style = function () {
27 this.pager_splitter_element.addClass('border-box-sizing ui-widget ui-state-default');
27 this.pager_splitter_element.addClass('border-box-sizing ui-widget ui-state-default');
28 this.pager_element.addClass('border-box-sizing ui-widget');
28 this.pager_element.addClass('border-box-sizing ui-widget');
29 this.pager_splitter_element.attr('title', 'Click to Show/Hide pager area');
29 };
30 };
30
31
31
32
32 Pager.prototype.bind_events = function () {
33 Pager.prototype.bind_events = function () {
33 var that = this;
34 var that = this;
34
35
35 this.pager_element.bind('collapse_pager', function () {
36 this.pager_element.bind('collapse_pager', function () {
36 that.pager_element.hide('fast');
37 that.pager_element.hide('fast');
37 });
38 });
38
39
39 this.pager_element.bind('expand_pager', function () {
40 this.pager_element.bind('expand_pager', function () {
40 that.pager_element.show('fast');
41 that.pager_element.show('fast');
41 });
42 });
42
43
43 this.pager_splitter_element.hover(
44 this.pager_splitter_element.hover(
44 function () {
45 function () {
45 that.pager_splitter_element.addClass('ui-state-hover');
46 that.pager_splitter_element.addClass('ui-state-hover');
46 },
47 },
47 function () {
48 function () {
48 that.pager_splitter_element.removeClass('ui-state-hover');
49 that.pager_splitter_element.removeClass('ui-state-hover');
49 }
50 }
50 );
51 );
51
52
52 this.pager_splitter_element.click(function () {
53 this.pager_splitter_element.click(function () {
53 that.toggle();
54 that.toggle();
54 });
55 });
55
56
56 };
57 };
57
58
58
59
59 Pager.prototype.collapse = function () {
60 Pager.prototype.collapse = function () {
60 if (this.expanded === true) {
61 if (this.expanded === true) {
61 this.pager_element.add($('div#notebook')).trigger('collapse_pager');
62 this.pager_element.add($('div#notebook')).trigger('collapse_pager');
62 this.expanded = false;
63 this.expanded = false;
63 };
64 };
64 };
65 };
65
66
66
67
67 Pager.prototype.expand = function () {
68 Pager.prototype.expand = function () {
68 if (this.expanded !== true) {
69 if (this.expanded !== true) {
69 this.pager_element.add($('div#notebook')).trigger('expand_pager');
70 this.pager_element.add($('div#notebook')).trigger('expand_pager');
70 this.expanded = true;
71 this.expanded = true;
71 };
72 };
72 };
73 };
73
74
74
75
75 Pager.prototype.toggle = function () {
76 Pager.prototype.toggle = function () {
76 if (this.expanded === true) {
77 if (this.expanded === true) {
77 this.collapse();
78 this.collapse();
78 } else {
79 } else {
79 this.expand();
80 this.expand();
80 };
81 };
81 };
82 };
82
83
83
84
84 Pager.prototype.clear = function (text) {
85 Pager.prototype.clear = function (text) {
85 this.pager_element.empty();
86 this.pager_element.empty();
86 };
87 };
87
88
88
89
89 Pager.prototype.append_text = function (text) {
90 Pager.prototype.append_text = function (text) {
90 var toinsert = $("<div/>").addClass("output_area output_stream");
91 var toinsert = $("<div/>").addClass("output_area output_stream");
91 toinsert.append($('<pre/>').html(utils.fixConsole(text)));
92 toinsert.append($('<pre/>').html(utils.fixConsole(text)));
92 this.pager_element.append(toinsert);
93 this.pager_element.append(toinsert);
93 };
94 };
94
95
95
96
96 IPython.Pager = Pager;
97 IPython.Pager = Pager;
97
98
98 return IPython;
99 return IPython;
99
100
100 }(IPython));
101 }(IPython));
101
102
@@ -1,246 +1,287 b''
1 //----------------------------------------------------------------------------
1 //----------------------------------------------------------------------------
2 // Copyright (C) 2008-2011 The IPython Development Team
2 // Copyright (C) 2008-2011 The IPython Development Team
3 //
3 //
4 // Distributed under the terms of the BSD License. The full license is in
4 // Distributed under the terms of the BSD License. The full license is in
5 // the file COPYING, distributed as part of this software.
5 // the file COPYING, distributed as part of this software.
6 //----------------------------------------------------------------------------
6 //----------------------------------------------------------------------------
7
7
8 //============================================================================
8 //============================================================================
9 // PanelSection
9 // PanelSection
10 //============================================================================
10 //============================================================================
11
11
12 var IPython = (function (IPython) {
12 var IPython = (function (IPython) {
13
13
14 var utils = IPython.utils;
14 var utils = IPython.utils;
15
15
16 // Base PanelSection class
16 // Base PanelSection class
17
17
18 var PanelSection = function (selector) {
18 var PanelSection = function (selector) {
19 this.selector = selector;
19 this.selector = selector;
20 if (this.selector !== undefined) {
20 if (this.selector !== undefined) {
21 this.element = $(selector);
21 this.element = $(selector);
22 this.header = this.element.find('h3.section_header');
22 this.header = this.element.find('h3.section_header');
23 this.content = this.element.find('div.section_content');
23 this.content = this.element.find('div.section_content');
24 this.style();
24 this.style();
25 this.bind_events();
25 this.bind_events();
26 }
26 }
27 this.expanded = true;
27 this.expanded = true;
28 };
28 };
29
29
30
30
31 PanelSection.prototype.style = function () {
31 PanelSection.prototype.style = function () {
32 this.header.addClass('ui-widget ui-state-default');
32 this.header.addClass('ui-widget ui-state-default');
33 this.header.attr('title', "Click to Show/Hide Section");
33 this.content.addClass('ui-widget section_content');
34 this.content.addClass('ui-widget section_content');
34 };
35 };
35
36
36
37
37 PanelSection.prototype.bind_events = function () {
38 PanelSection.prototype.bind_events = function () {
38 var that = this;
39 var that = this;
39 this.header.click(function () {
40 this.header.click(function () {
40 that.toggle();
41 that.toggle();
41 });
42 });
42 this.header.hover(function () {
43 this.header.hover(function () {
43 that.header.toggleClass('ui-state-hover');
44 that.header.toggleClass('ui-state-hover');
44 });
45 });
45 };
46 };
46
47
47
48
48 PanelSection.prototype.expand = function () {
49 PanelSection.prototype.expand = function () {
49 if (!this.expanded) {
50 if (!this.expanded) {
50 this.content.slideDown('fast');
51 this.content.slideDown('fast');
51 this.expanded = true;
52 this.expanded = true;
52 };
53 };
53 };
54 };
54
55
55
56
56 PanelSection.prototype.collapse = function () {
57 PanelSection.prototype.collapse = function () {
57 if (this.expanded) {
58 if (this.expanded) {
58 this.content.slideUp('fast');
59 this.content.slideUp('fast');
59 this.expanded = false;
60 this.expanded = false;
60 };
61 };
61 };
62 };
62
63
63
64
64 PanelSection.prototype.toggle = function () {
65 PanelSection.prototype.toggle = function () {
65 if (this.expanded === true) {
66 if (this.expanded === true) {
66 this.collapse();
67 this.collapse();
67 } else {
68 } else {
68 this.expand();
69 this.expand();
69 };
70 };
70 };
71 };
71
72
72
73
73 PanelSection.prototype.create_children = function () {};
74 PanelSection.prototype.create_children = function () {};
74
75
75
76
76 // NotebookSection
77 // NotebookSection
77
78
78 var NotebookSection = function () {
79 var NotebookSection = function () {
79 PanelSection.apply(this, arguments);
80 PanelSection.apply(this, arguments);
80 };
81 };
81
82
82
83
83 NotebookSection.prototype = new PanelSection();
84 NotebookSection.prototype = new PanelSection();
84
85
85
86
86 NotebookSection.prototype.style = function () {
87 NotebookSection.prototype.style = function () {
87 PanelSection.prototype.style.apply(this);
88 PanelSection.prototype.style.apply(this);
88 this.content.addClass('ui-helper-clearfix');
89 this.content.addClass('ui-helper-clearfix');
89 this.content.find('div.section_row').addClass('ui-helper-clearfix');
90 this.content.find('div.section_row').addClass('ui-helper-clearfix');
90 this.content.find('#new_open').buttonset();
91 this.content.find('#new_open').buttonset();
92 this.content.find('#new_notebook').attr('title', "Create a new notebook");
93 this.content.find('#open_notebook').attr('title', "Open an existing notebook");
91 this.content.find('#download_notebook').button();
94 this.content.find('#download_notebook').button();
95 this.content.find('#download_notebook').attr('title',
96 "Download the notebook in the specified format," +
97 " either full ipynb notebook or as a Python script.");
98 // upload notebook doesn't exist:
92 this.content.find('#upload_notebook').button();
99 this.content.find('#upload_notebook').button();
93 this.content.find('#download_format').addClass('ui-widget ui-widget-content');
100 this.content.find('#download_format').addClass('ui-widget ui-widget-content');
94 this.content.find('#download_format option').addClass('ui-widget ui-widget-content');
101 this.content.find('#download_format option').addClass('ui-widget ui-widget-content');
95 };
102 };
96
103
97
104
98 NotebookSection.prototype.bind_events = function () {
105 NotebookSection.prototype.bind_events = function () {
99 PanelSection.prototype.bind_events.apply(this);
106 PanelSection.prototype.bind_events.apply(this);
100 var that = this;
107 var that = this;
101 this.content.find('#new_notebook').click(function () {
108 this.content.find('#new_notebook').click(function () {
102 window.open('/new');
109 window.open('/new');
103 });
110 });
104 this.content.find('#open_notebook').click(function () {
111 this.content.find('#open_notebook').click(function () {
105 window.open('/');
112 window.open('/');
106 });
113 });
107 this.content.find('#download_notebook').click(function () {
114 this.content.find('#download_notebook').click(function () {
108 var format = that.content.find('#download_format').val();
115 var format = that.content.find('#download_format').val();
109 var notebook_id = IPython.save_widget.get_notebook_id();
116 var notebook_id = IPython.save_widget.get_notebook_id();
110 var url = '/notebooks/' + notebook_id + '?format=' + format;
117 var url = '/notebooks/' + notebook_id + '?format=' + format;
111 window.open(url,'_newtab');
118 window.open(url,'_newtab');
112 });
119 });
113 };
120 };
114
121
115 // CellSection
122 // CellSection
116
123
117 var CellSection = function () {
124 var CellSection = function () {
118 PanelSection.apply(this, arguments);
125 PanelSection.apply(this, arguments);
119 };
126 };
120
127
121
128
122 CellSection.prototype = new PanelSection();
129 CellSection.prototype = new PanelSection();
123
130
124
131
125 CellSection.prototype.style = function () {
132 CellSection.prototype.style = function () {
126 PanelSection.prototype.style.apply(this);
133 PanelSection.prototype.style.apply(this);
127 this.content.addClass('ui-helper-clearfix');
134 this.content.addClass('ui-helper-clearfix');
128 this.content.find('div.section_row').addClass('ui-helper-clearfix');
135 this.content.find('div.section_row').addClass('ui-helper-clearfix');
129 this.content.find('#delete_cell').button();
136 this.content.find('#delete_cell').button();
137 this.content.find('#delete_cell').attr('title', "Delete the selected cell");
138
130 this.content.find('#insert').buttonset();
139 this.content.find('#insert').buttonset();
140 this.content.find('#insert_cell_above').attr('title', "Insert new cell above selected");
141 this.content.find('#insert_cell_below').attr('title', "Insert new cell below selected");
142
131 this.content.find('#move').buttonset();
143 this.content.find('#move').buttonset();
144 this.content.find('#move_cell_up').attr('title', "Move selected cell up one in the Notebook");
145 this.content.find('#move_cell_down').attr('title', "Move selected cell down one in the Notebook");
146
132 this.content.find('#cell_type').buttonset();
147 this.content.find('#cell_type').buttonset();
148 this.content.find('#to_markdown').attr('title', 'Change selected cell to markdown (for text)')
149 this.content.find('#to_code').attr('title', 'Change selected cell to code (for execution)')
150
133 this.content.find('#cell_output').buttonset();
151 this.content.find('#cell_output').buttonset();
152 this.content.find('#toggle_output').attr('title', 'Toggle visibility of the output of code cells')
153 this.content.find('#clear_all_output').attr('title', 'Clear output of all code cells (actually removes the data, unlike toggle)')
154
134 this.content.find('#run_cells').buttonset();
155 this.content.find('#run_cells').buttonset();
156 this.content.find('#run_selected_cell').attr('title', 'Submit the selected cell for execution')
157 this.content.find('#run_all_cells').attr('title', 'Run *all* code cells in the notebook in order')
158 this.content.find('#autoindent').attr('title', 'Autoindent code as-you-type')
159 this.content.find('#autoindent_label').attr('title', 'Autoindent code as-you-type')
135 };
160 };
136
161
137
162
138 CellSection.prototype.bind_events = function () {
163 CellSection.prototype.bind_events = function () {
139 PanelSection.prototype.bind_events.apply(this);
164 PanelSection.prototype.bind_events.apply(this);
140 this.content.find('#toggle_output').click(function () {
165 this.content.find('#toggle_output').click(function () {
141 IPython.notebook.toggle_output();
166 IPython.notebook.toggle_output();
142 });
167 });
143 this.content.find('#clear_all_output').click(function () {
168 this.content.find('#clear_all_output').click(function () {
144 IPython.notebook.clear_all_output();
169 IPython.notebook.clear_all_output();
145 });
170 });
146 this.content.find('#delete_cell').click(function () {
171 this.content.find('#delete_cell').click(function () {
147 IPython.notebook.delete_cell();
172 IPython.notebook.delete_cell();
148 });
173 });
149 this.content.find('#insert_cell_above').click(function () {
174 this.content.find('#insert_cell_above').click(function () {
150 IPython.notebook.insert_code_cell_above();
175 IPython.notebook.insert_code_cell_above();
151 });
176 });
152 this.content.find('#insert_cell_below').click(function () {
177 this.content.find('#insert_cell_below').click(function () {
153 IPython.notebook.insert_code_cell_below();
178 IPython.notebook.insert_code_cell_below();
154 });
179 });
155 this.content.find('#move_cell_up').click(function () {
180 this.content.find('#move_cell_up').click(function () {
156 IPython.notebook.move_cell_up();
181 IPython.notebook.move_cell_up();
157 });
182 });
158 this.content.find('#move_cell_down').click(function () {
183 this.content.find('#move_cell_down').click(function () {
159 IPython.notebook.move_cell_down();
184 IPython.notebook.move_cell_down();
160 });
185 });
161 this.content.find('#to_code').click(function () {
186 this.content.find('#to_code').click(function () {
162 IPython.notebook.to_code();
187 IPython.notebook.to_code();
163 });
188 });
164 this.content.find('#to_markdown').click(function () {
189 this.content.find('#to_markdown').click(function () {
165 IPython.notebook.to_markdown();
190 IPython.notebook.to_markdown();
166 });
191 });
167 this.content.find('#run_selected_cell').click(function () {
192 this.content.find('#run_selected_cell').click(function () {
168 IPython.notebook.execute_selected_cell();
193 IPython.notebook.execute_selected_cell();
169 });
194 });
170 this.content.find('#run_all_cells').click(function () {
195 this.content.find('#run_all_cells').click(function () {
171 IPython.notebook.execute_all_cells();
196 IPython.notebook.execute_all_cells();
172 });
197 });
173 this.content.find('#autoindent').change(function () {
198 this.content.find('#autoindent').change(function () {
174 var state = $('#autoindent').prop('checked');
199 var state = $('#autoindent').prop('checked');
175 IPython.notebook.set_autoindent(state);
200 IPython.notebook.set_autoindent(state);
176 });
201 });
177 };
202 };
178
203
179
204
180 // KernelSection
205 // KernelSection
181
206
182 var KernelSection = function () {
207 var KernelSection = function () {
183 PanelSection.apply(this, arguments);
208 PanelSection.apply(this, arguments);
184 };
209 };
185
210
186
211
187 KernelSection.prototype = new PanelSection();
212 KernelSection.prototype = new PanelSection();
188
213
189
214
190 KernelSection.prototype.style = function () {
215 KernelSection.prototype.style = function () {
191 PanelSection.prototype.style.apply(this);
216 PanelSection.prototype.style.apply(this);
192 this.content.addClass('ui-helper-clearfix');
217 this.content.addClass('ui-helper-clearfix');
193 this.content.find('div.section_row').addClass('ui-helper-clearfix');
218 this.content.find('div.section_row').addClass('ui-helper-clearfix');
194 this.content.find('#int_restart').buttonset();
219 this.content.find('#int_restart').buttonset();
220 this.content.find("#int_kernel").attr('title', "Interrupt the kernel with SIGINT/Ctrl-C");
221 this.content.find("#restart_kernel").attr('title',
222 "Restart the kernel. This will shutdown the current kernel," +
223 " and start a new, clean kernel in its place, connected to this Notebook." +
224 " This may break the connection of other clients connected to this kernel." );
225 var kill_tip = "Kill the kernel on exit. If unchecked, the kernel will remain" +
226 " active after closing the session, allowing you to reconnect and resume later.";
227 this.content.find('#kill_kernel').attr('title', kill_tip);
228 this.content.find('#kill_kernel_label').attr('title', kill_tip);
229
195 };
230 };
196
231
197
232
198 KernelSection.prototype.bind_events = function () {
233 KernelSection.prototype.bind_events = function () {
199 PanelSection.prototype.bind_events.apply(this);
234 PanelSection.prototype.bind_events.apply(this);
200 this.content.find('#restart_kernel').click(function () {
235 this.content.find('#restart_kernel').click(function () {
201 IPython.notebook.restart_kernel();
236 IPython.notebook.restart_kernel();
202 });
237 });
203 this.content.find('#int_kernel').click(function () {
238 this.content.find('#int_kernel').click(function () {
204 IPython.notebook.kernel.interrupt();
239 IPython.notebook.kernel.interrupt();
205 });
240 });
206 };
241 };
207
242
208
243
209 // HelpSection
244 // HelpSection
210
245
211 var HelpSection = function () {
246 var HelpSection = function () {
212 PanelSection.apply(this, arguments);
247 PanelSection.apply(this, arguments);
213 };
248 };
214
249
215
250
216 HelpSection.prototype = new PanelSection();
251 HelpSection.prototype = new PanelSection();
217
252
218
253
219 HelpSection.prototype.style = function () {
254 HelpSection.prototype.style = function () {
220 PanelSection.prototype.style.apply(this);
255 PanelSection.prototype.style.apply(this);
221 PanelSection.prototype.style.apply(this);
256 PanelSection.prototype.style.apply(this);
222 this.content.addClass('ui-helper-clearfix');
257 this.content.addClass('ui-helper-clearfix');
223 this.content.find('div.section_row').addClass('ui-helper-clearfix');
258 this.content.find('div.section_row').addClass('ui-helper-clearfix');
224 this.content.find('#help_buttons0').buttonset();
259 this.content.find('#help_buttons0').buttonset();
225 this.content.find('#help_buttons1').buttonset();
260 this.content.find('#help_buttons1').buttonset();
226 this.content.find('#help_buttons2').buttonset();
261 this.content.find('#help_buttons2').buttonset();
262 this.content.find('#python_help').attr('title', "Open the online Python documentation in a new tab")
263 this.content.find('#ipython_help').attr('title', "Open the online IPython documentation in a new tab")
264 this.content.find('#numpy_help').attr('title', "Open the online NumPy documentation in a new tab")
265 this.content.find('#scipy_help').attr('title', "Open the online SciPy documentation in a new tab")
266 this.content.find('#matplotlib_help').attr('title', "Open the online Matplotlib documentation in a new tab")
267 this.content.find('#sympy_help').attr('title', "Open the online SymPy documentation in a new tab")
227 };
268 };
228
269
229
270
230 HelpSection.prototype.bind_events = function () {
271 HelpSection.prototype.bind_events = function () {
231 PanelSection.prototype.bind_events.apply(this);
272 PanelSection.prototype.bind_events.apply(this);
232 };
273 };
233
274
234
275
235 // Set module variables
276 // Set module variables
236
277
237 IPython.PanelSection = PanelSection;
278 IPython.PanelSection = PanelSection;
238 IPython.NotebookSection = NotebookSection;
279 IPython.NotebookSection = NotebookSection;
239 IPython.CellSection = CellSection;
280 IPython.CellSection = CellSection;
240 IPython.KernelSection = KernelSection;
281 IPython.KernelSection = KernelSection;
241 IPython.HelpSection = HelpSection;
282 IPython.HelpSection = HelpSection;
242
283
243 return IPython;
284 return IPython;
244
285
245 }(IPython));
286 }(IPython));
246
287
@@ -1,54 +1,58 b''
1 var IPython = (function (IPython) {
1 var IPython = (function (IPython) {
2
2
3 var PrintWidget = function (selector) {
3 var PrintWidget = function (selector) {
4 this.selector = selector;
4 this.selector = selector;
5 if (this.selector !== undefined) {
5 if (this.selector !== undefined) {
6 this.element = $(selector);
6 this.element = $(selector);
7 this.style();
7 this.style();
8 this.bind_events();
8 this.bind_events();
9 }
9 }
10 };
10 };
11
11
12 PrintWidget.prototype.style = function () {
12 PrintWidget.prototype.style = function () {
13 this.element.find('button#print_notebook').button();
13 this.element.find('button#print_notebook').button();
14 this.element.find('button#print_notebook').attr('title',
15 "Open a new window with printer-friendly HTML of the Notebook." +
16 " Note that this is incomplete, and may not produce perfect" +
17 " printed output.");
14 };
18 };
15
19
16 PrintWidget.prototype.bind_events = function () {
20 PrintWidget.prototype.bind_events = function () {
17 var that = this;
21 var that = this;
18 this.element.find('button#print_notebook').click(function () {
22 this.element.find('button#print_notebook').click(function () {
19 that.print_notebook();
23 that.print_notebook();
20 });
24 });
21 };
25 };
22
26
23 PrintWidget.prototype.enable = function () {
27 PrintWidget.prototype.enable = function () {
24 this.element.find('button#print_notebook').button('enable');
28 this.element.find('button#print_notebook').button('enable');
25 };
29 };
26
30
27 PrintWidget.prototype.disable = function () {
31 PrintWidget.prototype.disable = function () {
28 this.element.find('button#print_notebook').button('disable');
32 this.element.find('button#print_notebook').button('disable');
29 };
33 };
30
34
31 PrintWidget.prototype.print_notebook = function () {
35 PrintWidget.prototype.print_notebook = function () {
32 var w = window.open('', '_blank', 'scrollbars=1,menubar=1');
36 var w = window.open('', '_blank', 'scrollbars=1,menubar=1');
33 var html = '<html><head>' +
37 var html = '<html><head>' +
34 $('head').clone().html() +
38 $('head').clone().html() +
35 '<style type="text/css">' +
39 '<style type="text/css">' +
36 '@media print { body { overflow: visible !important; } }' +
40 '@media print { body { overflow: visible !important; } }' +
37 '.ui-widget-content { border: 0px; }' +
41 '.ui-widget-content { border: 0px; }' +
38 '</style>' +
42 '</style>' +
39 '</head><body style="overflow: auto;">' +
43 '</head><body style="overflow: auto;">' +
40 $('#notebook').clone().html() +
44 $('#notebook').clone().html() +
41 '</body></html>';
45 '</body></html>';
42
46
43 w.document.open();
47 w.document.open();
44 w.document.write(html);
48 w.document.write(html);
45 w.document.close();
49 w.document.close();
46
50
47 return false;
51 return false;
48 };
52 };
49
53
50 IPython.PrintWidget = PrintWidget;
54 IPython.PrintWidget = PrintWidget;
51
55
52 return IPython;
56 return IPython;
53
57
54 }(IPython));
58 }(IPython));
@@ -1,39 +1,40 b''
1 //----------------------------------------------------------------------------
1 //----------------------------------------------------------------------------
2 // Copyright (C) 2008-2011 The IPython Development Team
2 // Copyright (C) 2008-2011 The IPython Development Team
3 //
3 //
4 // Distributed under the terms of the BSD License. The full license is in
4 // Distributed under the terms of the BSD License. The full license is in
5 // the file COPYING, distributed as part of this software.
5 // the file COPYING, distributed as part of this software.
6 //----------------------------------------------------------------------------
6 //----------------------------------------------------------------------------
7
7
8 //============================================================================
8 //============================================================================
9 // QuickHelp button
9 // QuickHelp button
10 //============================================================================
10 //============================================================================
11
11
12 var IPython = (function (IPython) {
12 var IPython = (function (IPython) {
13
13
14 var QuickHelp = function (selector) {
14 var QuickHelp = function (selector) {
15 this.selector = selector;
15 this.selector = selector;
16 if (this.selector !== undefined) {
16 if (this.selector !== undefined) {
17 this.element = $(selector);
17 this.element = $(selector);
18 this.style();
18 this.style();
19 this.bind_events();
19 this.bind_events();
20 }
20 }
21 };
21 };
22
22
23 QuickHelp.prototype.style = function () {
23 QuickHelp.prototype.style = function () {
24 this.element.find('button#quick_help').button();
24 this.element.find('button#quick_help').button();
25 this.element.find('button#quick_help').attr('title', "Show/Hide the keyboard shortcuts for the IPython Notebook");
25 };
26 };
26
27
27 QuickHelp.prototype.bind_events = function () {
28 QuickHelp.prototype.bind_events = function () {
28 var that = this;
29 var that = this;
29 this.element.find("button#quick_help").click(function () {
30 this.element.find("button#quick_help").click(function () {
30 IPython.notebook.toggle_keyboard_shortcuts();
31 IPython.notebook.toggle_keyboard_shortcuts();
31 });
32 });
32 };
33 };
33
34
34 // Set module variables
35 // Set module variables
35 IPython.QuickHelp = QuickHelp;
36 IPython.QuickHelp = QuickHelp;
36
37
37 return IPython;
38 return IPython;
38
39
39 }(IPython));
40 }(IPython));
@@ -1,156 +1,157 b''
1 //----------------------------------------------------------------------------
1 //----------------------------------------------------------------------------
2 // Copyright (C) 2008-2011 The IPython Development Team
2 // Copyright (C) 2008-2011 The IPython Development Team
3 //
3 //
4 // Distributed under the terms of the BSD License. The full license is in
4 // Distributed under the terms of the BSD License. The full license is in
5 // the file COPYING, distributed as part of this software.
5 // the file COPYING, distributed as part of this software.
6 //----------------------------------------------------------------------------
6 //----------------------------------------------------------------------------
7
7
8 //============================================================================
8 //============================================================================
9 // SaveWidget
9 // SaveWidget
10 //============================================================================
10 //============================================================================
11
11
12 var IPython = (function (IPython) {
12 var IPython = (function (IPython) {
13
13
14 var utils = IPython.utils;
14 var utils = IPython.utils;
15
15
16 var SaveWidget = function (selector) {
16 var SaveWidget = function (selector) {
17 this.selector = selector;
17 this.selector = selector;
18 this.notebook_name_blacklist_re = /[\/\\]/
18 this.notebook_name_blacklist_re = /[\/\\]/
19 this.last_saved_name = '';
19 this.last_saved_name = '';
20 if (this.selector !== undefined) {
20 if (this.selector !== undefined) {
21 this.element = $(selector);
21 this.element = $(selector);
22 this.style();
22 this.style();
23 this.bind_events();
23 this.bind_events();
24 }
24 }
25 };
25 };
26
26
27
27
28 SaveWidget.prototype.style = function () {
28 SaveWidget.prototype.style = function () {
29 this.element.find('input#notebook_name').addClass('ui-widget ui-widget-content');
29 this.element.find('input#notebook_name').addClass('ui-widget ui-widget-content');
30 this.element.find('input#notebook_name').attr('tabindex','1');
30 this.element.find('input#notebook_name').attr('tabindex','1');
31 this.element.find('button#save_notebook').button();
31 this.element.find('button#save_notebook').button();
32 this.element.find('button#save_notebook').attr('title', 'Save the Notebook');
32 var left_panel_width = $('div#left_panel').outerWidth();
33 var left_panel_width = $('div#left_panel').outerWidth();
33 var left_panel_splitter_width = $('div#left_panel_splitter').outerWidth();
34 var left_panel_splitter_width = $('div#left_panel_splitter').outerWidth();
34 $('span#save_widget').css({marginLeft:left_panel_width+left_panel_splitter_width});
35 $('span#save_widget').css({marginLeft:left_panel_width+left_panel_splitter_width});
35
36
36 };
37 };
37
38
38
39
39 SaveWidget.prototype.bind_events = function () {
40 SaveWidget.prototype.bind_events = function () {
40 var that = this;
41 var that = this;
41 this.element.find('button#save_notebook').click(function () {
42 this.element.find('button#save_notebook').click(function () {
42 that.save_notebook();
43 that.save_notebook();
43 });
44 });
44 this.element.find('input#notebook_name').keyup(function () {
45 this.element.find('input#notebook_name').keyup(function () {
45 that.is_renaming();
46 that.is_renaming();
46 });
47 });
47 };
48 };
48
49
49
50
50 SaveWidget.prototype.save_notebook = function () {
51 SaveWidget.prototype.save_notebook = function () {
51 IPython.notebook.save_notebook();
52 IPython.notebook.save_notebook();
52 };
53 };
53
54
54
55
55 SaveWidget.prototype.notebook_saved = function () {
56 SaveWidget.prototype.notebook_saved = function () {
56 this.set_document_title();
57 this.set_document_title();
57 this.last_saved_name = this.get_notebook_name();
58 this.last_saved_name = this.get_notebook_name();
58 };
59 };
59
60
60
61
61 SaveWidget.prototype.is_renaming = function () {
62 SaveWidget.prototype.is_renaming = function () {
62 if (this.get_notebook_name() !== this.last_saved_name) {
63 if (this.get_notebook_name() !== this.last_saved_name) {
63 this.status_rename();
64 this.status_rename();
64 } else {
65 } else {
65 this.status_save();
66 this.status_save();
66 };
67 };
67 };
68 };
68
69
69
70
70 SaveWidget.prototype.get_notebook_name = function () {
71 SaveWidget.prototype.get_notebook_name = function () {
71 return this.element.find('input#notebook_name').attr('value');
72 return this.element.find('input#notebook_name').attr('value');
72 }
73 }
73
74
74
75
75 SaveWidget.prototype.set_notebook_name = function (nbname) {
76 SaveWidget.prototype.set_notebook_name = function (nbname) {
76 this.element.find('input#notebook_name').attr('value',nbname);
77 this.element.find('input#notebook_name').attr('value',nbname);
77 this.set_document_title();
78 this.set_document_title();
78 this.last_saved_name = nbname;
79 this.last_saved_name = nbname;
79 }
80 }
80
81
81
82
82 SaveWidget.prototype.set_document_title = function () {
83 SaveWidget.prototype.set_document_title = function () {
83 nbname = this.get_notebook_name();
84 nbname = this.get_notebook_name();
84 document.title = 'IPy: ' + nbname;
85 document.title = 'IPy: ' + nbname;
85 };
86 };
86
87
87
88
88 SaveWidget.prototype.get_notebook_id = function () {
89 SaveWidget.prototype.get_notebook_id = function () {
89 return this.element.find('span#notebook_id').text()
90 return this.element.find('span#notebook_id').text()
90 };
91 };
91
92
92
93
93 SaveWidget.prototype.update_url = function () {
94 SaveWidget.prototype.update_url = function () {
94 var notebook_id = this.get_notebook_id();
95 var notebook_id = this.get_notebook_id();
95 if (notebook_id !== '') {
96 if (notebook_id !== '') {
96 window.history.replaceState({}, '', notebook_id);
97 window.history.replaceState({}, '', notebook_id);
97 };
98 };
98 };
99 };
99
100
100
101
101 SaveWidget.prototype.test_notebook_name = function () {
102 SaveWidget.prototype.test_notebook_name = function () {
102 var nbname = this.get_notebook_name();
103 var nbname = this.get_notebook_name();
103 if (this.notebook_name_blacklist_re.test(nbname) == false) {
104 if (this.notebook_name_blacklist_re.test(nbname) == false) {
104 return true;
105 return true;
105 } else {
106 } else {
106 var bad_name = $('<div/>');
107 var bad_name = $('<div/>');
107 bad_name.html(
108 bad_name.html(
108 "The notebook name you entered (" +
109 "The notebook name you entered (" +
109 nbname +
110 nbname +
110 ") is not valid. Notebook names can contain any characters except / and \\."
111 ") is not valid. Notebook names can contain any characters except / and \\."
111 );
112 );
112 bad_name.dialog({title: 'Invalid name', modal: true});
113 bad_name.dialog({title: 'Invalid name', modal: true});
113 return false;
114 return false;
114 };
115 };
115 };
116 };
116
117
117
118
118 SaveWidget.prototype.reset_status = function () {
119 SaveWidget.prototype.reset_status = function () {
119 this.is_renaming();
120 this.is_renaming();
120 };
121 };
121
122
122
123
123 SaveWidget.prototype.status_save = function () {
124 SaveWidget.prototype.status_save = function () {
124 this.element.find('button#save_notebook').button('option', 'label', '<u>S</u>ave');
125 this.element.find('button#save_notebook').button('option', 'label', '<u>S</u>ave');
125 this.element.find('button#save_notebook').button('enable');
126 this.element.find('button#save_notebook').button('enable');
126 IPython.print_widget.enable();
127 IPython.print_widget.enable();
127 };
128 };
128
129
129
130
130 SaveWidget.prototype.status_saving = function () {
131 SaveWidget.prototype.status_saving = function () {
131 this.element.find('button#save_notebook').button('option', 'label', 'Saving');
132 this.element.find('button#save_notebook').button('option', 'label', 'Saving');
132 this.element.find('button#save_notebook').button('disable');
133 this.element.find('button#save_notebook').button('disable');
133 IPython.print_widget.disable();
134 IPython.print_widget.disable();
134 };
135 };
135
136
136
137
137 SaveWidget.prototype.status_loading = function () {
138 SaveWidget.prototype.status_loading = function () {
138 this.element.find('button#save_notebook').button('option', 'label', 'Loading');
139 this.element.find('button#save_notebook').button('option', 'label', 'Loading');
139 this.element.find('button#save_notebook').button('disable');
140 this.element.find('button#save_notebook').button('disable');
140 IPython.print_widget.disable();
141 IPython.print_widget.disable();
141 };
142 };
142
143
143
144
144 SaveWidget.prototype.status_rename = function () {
145 SaveWidget.prototype.status_rename = function () {
145 this.element.find('button#save_notebook').button('option', 'label', 'Rename');
146 this.element.find('button#save_notebook').button('option', 'label', 'Rename');
146 this.element.find('button#save_notebook').button('enable');
147 this.element.find('button#save_notebook').button('enable');
147 IPython.print_widget.enable();
148 IPython.print_widget.enable();
148 };
149 };
149
150
150
151
151 IPython.SaveWidget = SaveWidget;
152 IPython.SaveWidget = SaveWidget;
152
153
153 return IPython;
154 return IPython;
154
155
155 }(IPython));
156 }(IPython));
156
157
@@ -1,280 +1,280 b''
1 <!DOCTYPE HTML>
1 <!DOCTYPE HTML>
2 <html>
2 <html>
3
3
4 <head>
4 <head>
5 <meta charset="utf-8">
5 <meta charset="utf-8">
6
6
7 <title>IPython Notebook</title>
7 <title>IPython Notebook</title>
8
8
9 <link rel="stylesheet" href="static/jquery/css/themes/aristo/jquery-wijmo.css" type="text/css" />
9 <link rel="stylesheet" href="static/jquery/css/themes/aristo/jquery-wijmo.css" type="text/css" />
10 <!-- <link rel="stylesheet" href="static/jquery/css/themes/rocket/jquery-wijmo.css" type="text/css" /> -->
10 <!-- <link rel="stylesheet" href="static/jquery/css/themes/rocket/jquery-wijmo.css" type="text/css" /> -->
11 <!-- <link rel="stylesheet" href="static/jquery/css/themes/smoothness/jquery-ui-1.8.14.custom.css" type="text/css" />-->
11 <!-- <link rel="stylesheet" href="static/jquery/css/themes/smoothness/jquery-ui-1.8.14.custom.css" type="text/css" />-->
12
12
13 <!-- <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML" charset="utf-8"></script> -->
13 <!-- <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML" charset="utf-8"></script> -->
14 <script type='text/javascript' src='static/mathjax/MathJax.js?config=TeX-AMS_HTML' charset='utf-8'></script>
14 <script type='text/javascript' src='static/mathjax/MathJax.js?config=TeX-AMS_HTML' charset='utf-8'></script>
15 <script type="text/javascript">
15 <script type="text/javascript">
16 function CheckMathJax(){
16 function CheckMathJax(){
17 var div=document.getElementById("MathJaxFetchingWarning")
17 var div=document.getElementById("MathJaxFetchingWarning")
18 if(window.MathJax){
18 if(window.MathJax){
19 document.body.removeChild(div)
19 document.body.removeChild(div)
20 }
20 }
21 else{
21 else{
22 div.style.display = "block";
22 div.style.display = "block";
23 }
23 }
24 }
24 }
25 if (typeof MathJax == 'undefined') {
25 if (typeof MathJax == 'undefined') {
26 console.log("No local MathJax, loading from CDN");
26 console.log("No local MathJax, loading from CDN");
27 document.write(unescape("%3Cscript type='text/javascript' src='http://cdn.mathjax.org/mathjax/latest/MathJax.js%3Fconfig=TeX-AMS_HTML' charset='utf-8'%3E%3C/script%3E"));
27 document.write(unescape("%3Cscript type='text/javascript' src='http://cdn.mathjax.org/mathjax/latest/MathJax.js%3Fconfig=TeX-AMS_HTML' charset='utf-8'%3E%3C/script%3E"));
28 }else{
28 }else{
29 console.log("Using local MathJax");
29 console.log("Using local MathJax");
30 }
30 }
31 </script>
31 </script>
32
32
33 <link rel="stylesheet" href="static/codemirror/lib/codemirror.css">
33 <link rel="stylesheet" href="static/codemirror/lib/codemirror.css">
34 <link rel="stylesheet" href="static/codemirror/mode/markdown/markdown.css">
34 <link rel="stylesheet" href="static/codemirror/mode/markdown/markdown.css">
35 <link rel="stylesheet" href="static/codemirror/mode/rst/rst.css">
35 <link rel="stylesheet" href="static/codemirror/mode/rst/rst.css">
36 <link rel="stylesheet" href="static/codemirror/theme/ipython.css">
36 <link rel="stylesheet" href="static/codemirror/theme/ipython.css">
37 <link rel="stylesheet" href="static/codemirror/theme/default.css">
37 <link rel="stylesheet" href="static/codemirror/theme/default.css">
38
38
39 <link rel="stylesheet" href="static/prettify/prettify.css"/>
39 <link rel="stylesheet" href="static/prettify/prettify.css"/>
40
40
41 <link rel="stylesheet" href="static/css/boilerplate.css" type="text/css" />
41 <link rel="stylesheet" href="static/css/boilerplate.css" type="text/css" />
42 <link rel="stylesheet" href="static/css/layout.css" type="text/css" />
42 <link rel="stylesheet" href="static/css/layout.css" type="text/css" />
43 <link rel="stylesheet" href="static/css/base.css" type="text/css" />
43 <link rel="stylesheet" href="static/css/base.css" type="text/css" />
44 <link rel="stylesheet" href="static/css/notebook.css" type="text/css" />
44 <link rel="stylesheet" href="static/css/notebook.css" type="text/css" />
45 <link rel="stylesheet" href="static/css/renderedhtml.css" type="text/css" />
45 <link rel="stylesheet" href="static/css/renderedhtml.css" type="text/css" />
46
46
47
47
48 </head>
48 </head>
49
49
50 <body onload='CheckMathJax();'>
50 <body onload='CheckMathJax();'>
51
51
52 <div id="header">
52 <div id="header">
53 <span id="ipython_notebook"><h1>IPython Notebook</h1></span>
53 <span id="ipython_notebook"><h1>IPython Notebook</h1></span>
54 <span id="save_widget">
54 <span id="save_widget">
55 <input type="text" id="notebook_name" size="20"></textarea>
55 <input type="text" id="notebook_name" size="20"></textarea>
56 <span id="notebook_id" style="display:none">{{notebook_id}}</span>
56 <span id="notebook_id" style="display:none">{{notebook_id}}</span>
57 <button id="save_notebook"><u>S</u>ave</button>
57 <button id="save_notebook"><u>S</u>ave</button>
58 </span>
58 </span>
59 <span id="quick_help_area">
59 <span id="quick_help_area">
60 <button id="quick_help">Quick<u>H</u>elp</button>
60 <button id="quick_help">Quick<u>H</u>elp</button>
61 </span>
61 </span>
62 <span id="kernel_status">Idle</span>
62 <span id="kernel_status">Idle</span>
63 </div>
63 </div>
64
64
65 <div id="MathJaxFetchingWarning"
65 <div id="MathJaxFetchingWarning"
66 style="width:80%; margin:auto;padding-top:20%;text-align: justify; display:none">
66 style="width:80%; margin:auto;padding-top:20%;text-align: justify; display:none">
67 <p style="font-size:26px;">There was an issue trying to fetch MathJax.js
67 <p style="font-size:26px;">There was an issue trying to fetch MathJax.js
68 from the internet.</p>
68 from the internet.</p>
69
69
70 <p style="padding:0.2em"> With a working internet connection, you can run
70 <p style="padding:0.2em"> With a working internet connection, you can run
71 the following at a Python or IPython prompt, which will install a local
71 the following at a Python or IPython prompt, which will install a local
72 copy of MathJax:</p>
72 copy of MathJax:</p>
73
73
74 <pre style="background-color:lightblue;border:thin silver solid;padding:0.4em">
74 <pre style="background-color:lightblue;border:thin silver solid;padding:0.4em">
75 from IPython.external import mathjax; mathjax.install_mathjax()
75 from IPython.external import mathjax; mathjax.install_mathjax()
76 </pre>
76 </pre>
77 This will try to install MathJax into the directory where you installed
77 This will try to install MathJax into the directory where you installed
78 IPython. If you installed IPython to a location that requires
78 IPython. If you installed IPython to a location that requires
79 administrative privileges to write, you will need to make this call as
79 administrative privileges to write, you will need to make this call as
80 an administrator. On OSX/Linux/Unix, this can be done at the
80 an administrator. On OSX/Linux/Unix, this can be done at the
81 command-line via:
81 command-line via:
82 <pre style="background-color:lightblue;border:thin silver solid;padding:0.4em">
82 <pre style="background-color:lightblue;border:thin silver solid;padding:0.4em">
83 sudo python -c "from IPython.external import mathjax; mathjax.install_mathjax()"
83 sudo python -c "from IPython.external import mathjax; mathjax.install_mathjax()"
84 </pre>
84 </pre>
85 </p>
85 </p>
86 </div>
86 </div>
87
87
88 <div id="main_app">
88 <div id="main_app">
89
89
90 <div id="left_panel">
90 <div id="left_panel">
91
91
92 <div id="notebook_section">
92 <div id="notebook_section">
93 <h3 class="section_header">Notebook</h3>
93 <h3 class="section_header">Notebook</h3>
94 <div class="section_content">
94 <div class="section_content">
95 <div class="section_row">
95 <div class="section_row">
96 <span id="new_open" class="section_row_buttons">
96 <span id="new_open" class="section_row_buttons">
97 <button id="new_notebook">New</button>
97 <button id="new_notebook">New</button>
98 <button id="open_notebook">Open</button>
98 <button id="open_notebook">Open</button>
99 </span>
99 </span>
100 <span class="section_row_header">Actions</span>
100 <span class="section_row_header">Actions</span>
101 </div>
101 </div>
102 <div class="section_row">
102 <div class="section_row">
103 <span>
103 <span>
104 <select id="download_format">
104 <select id="download_format">
105 <option value="json">ipynb</option>
105 <option value="json">ipynb</option>
106 <option value="py">py</option>
106 <option value="py">py</option>
107 </select>
107 </select>
108 </span>
108 </span>
109 <span class="section_row_buttons">
109 <span class="section_row_buttons">
110 <button id="download_notebook">Download</button>
110 <button id="download_notebook">Download</button>
111 </span>
111 </span>
112 </div>
112 </div>
113 <div class="section_row">
113 <div class="section_row">
114 <span class="section_row_buttons">
114 <span class="section_row_buttons">
115 <span id="print_widget">
115 <span id="print_widget">
116 <button id="print_notebook">Print</button>
116 <button id="print_notebook">Print</button>
117 </span>
117 </span>
118 </span>
118 </span>
119 </div>
119 </div>
120 </div>
120 </div>
121 </div>
121 </div>
122
122
123 <div id="cell_section">
123 <div id="cell_section">
124 <h3 class="section_header">Cell</h3>
124 <h3 class="section_header">Cell</h3>
125 <div class="section_content">
125 <div class="section_content">
126 <div class="section_row">
126 <div class="section_row">
127 <span class="section_row_buttons">
127 <span class="section_row_buttons">
128 <button id="delete_cell"><u>D</u>elete</button>
128 <button id="delete_cell"><u>D</u>elete</button>
129 </span>
129 </span>
130 <span class="section_row_header">Actions</span>
130 <span class="section_row_header">Actions</span>
131 </div>
131 </div>
132 <div class="section_row">
132 <div class="section_row">
133 <span id="cell_type" class="section_row_buttons">
133 <span id="cell_type" class="section_row_buttons">
134 <button id="to_code"><u>C</u>ode</button>
134 <button id="to_code"><u>C</u>ode</button>
135 <!-- <button id="to_html">HTML</button>-->
135 <!-- <button id="to_html">HTML</button>-->
136 <button id="to_markdown"><u>M</u>arkdown</button>
136 <button id="to_markdown"><u>M</u>arkdown</button>
137 </span>
137 </span>
138 <span class="button_label">Format</span>
138 <span class="button_label">Format</span>
139 </div>
139 </div>
140 <div class="section_row">
140 <div class="section_row">
141 <span id="cell_output" class="section_row_buttons">
141 <span id="cell_output" class="section_row_buttons">
142 <button id="toggle_output"><u>T</u>oggle</button>
142 <button id="toggle_output"><u>T</u>oggle</button>
143 <button id="clear_all_output">ClearAll</button>
143 <button id="clear_all_output">ClearAll</button>
144 </span>
144 </span>
145 <span class="button_label">Output</span>
145 <span class="button_label">Output</span>
146 </div>
146 </div>
147 <div class="section_row">
147 <div class="section_row">
148 <span id="insert" class="section_row_buttons">
148 <span id="insert" class="section_row_buttons">
149 <button id="insert_cell_above"><u>A</u>bove</button>
149 <button id="insert_cell_above"><u>A</u>bove</button>
150 <button id="insert_cell_below"><u>B</u>elow</button>
150 <button id="insert_cell_below"><u>B</u>elow</button>
151 </span>
151 </span>
152 <span class="button_label">Insert</span>
152 <span class="button_label">Insert</span>
153 </div>
153 </div>
154 <div class="section_row">
154 <div class="section_row">
155 <span id="move" class="section_row_buttons">
155 <span id="move" class="section_row_buttons">
156 <button id="move_cell_up">Up</button>
156 <button id="move_cell_up">Up</button>
157 <button id="move_cell_down">Down</button>
157 <button id="move_cell_down">Down</button>
158 </span>
158 </span>
159 <span class="button_label">Move</span>
159 <span class="button_label">Move</span>
160 </div>
160 </div>
161 <div class="section_row">
161 <div class="section_row">
162 <span id="run_cells" class="section_row_buttons">
162 <span id="run_cells" class="section_row_buttons">
163 <button id="run_selected_cell">Selected</button>
163 <button id="run_selected_cell">Selected</button>
164 <button id="run_all_cells">All</button>
164 <button id="run_all_cells">All</button>
165 </span>
165 </span>
166 <span class="button_label">Run</span>
166 <span class="button_label">Run</span>
167 </div>
167 </div>
168 <div class="section_row">
168 <div class="section_row">
169 <span id="autoindent_span">
169 <span id="autoindent_span">
170 <input type="checkbox" id="autoindent" checked="true"></input>
170 <input type="checkbox" id="autoindent" checked="true"></input>
171 </span>
171 </span>
172 <span class="checkbox_label">Autoindent:</span>
172 <span class="checkbox_label" id="autoindent_label">Autoindent:</span>
173 </div>
173 </div>
174 </div>
174 </div>
175 </div>
175 </div>
176
176
177 <div id="kernel_section">
177 <div id="kernel_section">
178 <h3 class="section_header">Kernel</h3>
178 <h3 class="section_header">Kernel</h3>
179 <div class="section_content">
179 <div class="section_content">
180 <div class="section_row">
180 <div class="section_row">
181 <span id="int_restart" class="section_row_buttons">
181 <span id="int_restart" class="section_row_buttons">
182 <button id="int_kernel"><u>I</u>nterrupt</button>
182 <button id="int_kernel"><u>I</u>nterrupt</button>
183 <button id="restart_kernel">Restart</button>
183 <button id="restart_kernel">Restart</button>
184 </span>
184 </span>
185 <span class="section_row_header">Actions</span>
185 <span class="section_row_header">Actions</span>
186 </div>
186 </div>
187 <div class="section_row">
187 <div class="section_row">
188 <span id="kernel_persist">
188 <span id="kernel_persist">
189 <input type="checkbox" id="kill_kernel"></input>
189 <input type="checkbox" id="kill_kernel"></input>
190 </span>
190 </span>
191 <span class="checkbox_label">Kill kernel upon exit:</span>
191 <span class="checkbox_label" id="kill_kernel_label">Kill kernel upon exit:</span>
192 </div>
192 </div>
193 </div>
193 </div>
194 </div>
194 </div>
195
195
196 <div id="help_section">
196 <div id="help_section">
197 <h3 class="section_header">Help</h3>
197 <h3 class="section_header">Help</h3>
198 <div class="section_content">
198 <div class="section_content">
199 <div class="section_row">
199 <div class="section_row">
200 <span id="help_buttons0" class="section_row_buttons">
200 <span id="help_buttons0" class="section_row_buttons">
201 <a id="python_help" href="http://docs.python.org" target="_blank">Python</a>
201 <a id="python_help" href="http://docs.python.org" target="_blank">Python</a>
202 <a id="ipython_help" href="http://ipython.org/documentation.html" target="_blank">IPython</a>
202 <a id="ipython_help" href="http://ipython.org/documentation.html" target="_blank">IPython</a>
203 </span>
203 </span>
204 <span class="section_row_header">Links</span>
204 <span class="section_row_header">Links</span>
205 </div>
205 </div>
206 <div class="section_row">
206 <div class="section_row">
207 <span id="help_buttons1" class="section_row_buttons">
207 <span id="help_buttons1" class="section_row_buttons">
208 <a id="numpy_help" href="http://docs.scipy.org/doc/numpy/reference/" target="_blank">NumPy</a>
208 <a id="numpy_help" href="http://docs.scipy.org/doc/numpy/reference/" target="_blank">NumPy</a>
209 <a id="scipy_help" href="http://docs.scipy.org/doc/scipy/reference/" target="_blank">SciPy</a>
209 <a id="scipy_help" href="http://docs.scipy.org/doc/scipy/reference/" target="_blank">SciPy</a>
210 </span>
210 </span>
211 </div>
211 </div>
212 <div class="section_row">
212 <div class="section_row">
213 <span id="help_buttons2" class="section_row_buttons">
213 <span id="help_buttons2" class="section_row_buttons">
214 <a id="matplotlib_help" href="http://matplotlib.sourceforge.net/" target="_blank">MPL</a>
214 <a id="matplotlib_help" href="http://matplotlib.sourceforge.net/" target="_blank">MPL</a>
215 <a id="sympy_help" href="http://docs.sympy.org/dev/index.html" target="_blank">SymPy</a>
215 <a id="sympy_help" href="http://docs.sympy.org/dev/index.html" target="_blank">SymPy</a>
216 </span>
216 </span>
217 </div>
217 </div>
218 <div class="section_row">
218 <div class="section_row">
219 <span class="help_string">run selected cell</span>
219 <span class="help_string">run selected cell</span>
220 <span class="help_string_label">Shift-Enter :</span>
220 <span class="help_string_label">Shift-Enter :</span>
221 </div>
221 </div>
222 <div class="section_row">
222 <div class="section_row">
223 <span class="help_string">run selected cell in-place</span>
223 <span class="help_string">run selected cell in-place</span>
224 <span class="help_string_label">Ctrl-Enter :</span>
224 <span class="help_string_label">Ctrl-Enter :</span>
225 </div>
225 </div>
226 <div class="section_row">
226 <div class="section_row">
227 <span class="help_string">show keyboard shortcuts</span>
227 <span class="help_string">show keyboard shortcuts</span>
228 <span class="help_string_label">Ctrl-m h :</span>
228 <span class="help_string_label">Ctrl-m h :</span>
229 </div>
229 </div>
230 </div>
230 </div>
231 </div>
231 </div>
232
232
233 </div>
233 </div>
234 <div id="left_panel_splitter"></div>
234 <div id="left_panel_splitter"></div>
235 <div id="notebook_panel">
235 <div id="notebook_panel">
236 <div id="notebook"></div>
236 <div id="notebook"></div>
237 <div id="pager_splitter"></div>
237 <div id="pager_splitter"></div>
238 <div id="pager"></div>
238 <div id="pager"></div>
239 </div>
239 </div>
240
240
241 </div>
241 </div>
242
242
243 <script src="static/jquery/js/jquery-1.6.2.min.js" type="text/javascript" charset="utf-8"></script>
243 <script src="static/jquery/js/jquery-1.6.2.min.js" type="text/javascript" charset="utf-8"></script>
244 <script src="static/jquery/js/jquery-ui-1.8.14.custom.min.js" type="text/javascript" charset="utf-8"></script>
244 <script src="static/jquery/js/jquery-ui-1.8.14.custom.min.js" type="text/javascript" charset="utf-8"></script>
245 <script src="static/jquery/js/jquery.autogrow.js" type="text/javascript" charset="utf-8"></script>
245 <script src="static/jquery/js/jquery.autogrow.js" type="text/javascript" charset="utf-8"></script>
246
246
247 <script src="static/codemirror/lib/codemirror.js" charset="utf-8"></script>
247 <script src="static/codemirror/lib/codemirror.js" charset="utf-8"></script>
248 <script src="static/codemirror/mode/python/python.js" charset="utf-8"></script>
248 <script src="static/codemirror/mode/python/python.js" charset="utf-8"></script>
249 <script src="static/codemirror/mode/htmlmixed/htmlmixed.js" charset="utf-8"></script>
249 <script src="static/codemirror/mode/htmlmixed/htmlmixed.js" charset="utf-8"></script>
250 <script src="static/codemirror/mode/xml/xml.js" charset="utf-8"></script>
250 <script src="static/codemirror/mode/xml/xml.js" charset="utf-8"></script>
251 <script src="static/codemirror/mode/javascript/javascript.js" charset="utf-8"></script>
251 <script src="static/codemirror/mode/javascript/javascript.js" charset="utf-8"></script>
252 <script src="static/codemirror/mode/css/css.js" charset="utf-8"></script>
252 <script src="static/codemirror/mode/css/css.js" charset="utf-8"></script>
253 <script src="static/codemirror/mode/rst/rst.js" charset="utf-8"></script>
253 <script src="static/codemirror/mode/rst/rst.js" charset="utf-8"></script>
254 <script src="static/codemirror/mode/markdown/markdown.js" charset="utf-8"></script>
254 <script src="static/codemirror/mode/markdown/markdown.js" charset="utf-8"></script>
255
255
256 <script src="static/pagedown/Markdown.Converter.js" charset="utf-8"></script>
256 <script src="static/pagedown/Markdown.Converter.js" charset="utf-8"></script>
257
257
258 <script src="static/prettify/prettify.js" charset="utf-8"></script>
258 <script src="static/prettify/prettify.js" charset="utf-8"></script>
259
259
260 <script src="static/js/namespace.js" type="text/javascript" charset="utf-8"></script>
260 <script src="static/js/namespace.js" type="text/javascript" charset="utf-8"></script>
261 <script src="static/js/utils.js" type="text/javascript" charset="utf-8"></script>
261 <script src="static/js/utils.js" type="text/javascript" charset="utf-8"></script>
262 <script src="static/js/cell.js" type="text/javascript" charset="utf-8"></script>
262 <script src="static/js/cell.js" type="text/javascript" charset="utf-8"></script>
263 <script src="static/js/codecell.js" type="text/javascript" charset="utf-8"></script>
263 <script src="static/js/codecell.js" type="text/javascript" charset="utf-8"></script>
264 <script src="static/js/textcell.js" type="text/javascript" charset="utf-8"></script>
264 <script src="static/js/textcell.js" type="text/javascript" charset="utf-8"></script>
265 <script src="static/js/kernel.js" type="text/javascript" charset="utf-8"></script>
265 <script src="static/js/kernel.js" type="text/javascript" charset="utf-8"></script>
266 <script src="static/js/kernelstatus.js" type="text/javascript" charset="utf-8"></script>
266 <script src="static/js/kernelstatus.js" type="text/javascript" charset="utf-8"></script>
267 <script src="static/js/layout.js" type="text/javascript" charset="utf-8"></script>
267 <script src="static/js/layout.js" type="text/javascript" charset="utf-8"></script>
268 <script src="static/js/savewidget.js" type="text/javascript" charset="utf-8"></script>
268 <script src="static/js/savewidget.js" type="text/javascript" charset="utf-8"></script>
269 <script src="static/js/quickhelp.js" type="text/javascript" charset="utf-8"></script>
269 <script src="static/js/quickhelp.js" type="text/javascript" charset="utf-8"></script>
270 <script src="static/js/pager.js" type="text/javascript" charset="utf-8"></script>
270 <script src="static/js/pager.js" type="text/javascript" charset="utf-8"></script>
271 <script src="static/js/panelsection.js" type="text/javascript" charset="utf-8"></script>
271 <script src="static/js/panelsection.js" type="text/javascript" charset="utf-8"></script>
272 <script src="static/js/printwidget.js" type="text/javascript" charset="utf-8"></script>
272 <script src="static/js/printwidget.js" type="text/javascript" charset="utf-8"></script>
273 <script src="static/js/leftpanel.js" type="text/javascript" charset="utf-8"></script>
273 <script src="static/js/leftpanel.js" type="text/javascript" charset="utf-8"></script>
274 <script src="static/js/notebook.js" type="text/javascript" charset="utf-8"></script>
274 <script src="static/js/notebook.js" type="text/javascript" charset="utf-8"></script>
275 <script src="static/js/notebook_main.js" type="text/javascript" charset="utf-8"></script>
275 <script src="static/js/notebook_main.js" type="text/javascript" charset="utf-8"></script>
276
276
277
277
278 </body>
278 </body>
279
279
280 </html>
280 </html>
General Comments 0
You need to be logged in to leave comments. Login now