Show More
@@ -1,97 +1,100 b'' | |||||
1 |
|
1 | |||
2 | //============================================================================ |
|
2 | //============================================================================ | |
3 | // LeftPanel |
|
3 | // LeftPanel | |
4 | //============================================================================ |
|
4 | //============================================================================ | |
5 |
|
5 | |||
6 |
|
6 | |||
7 | var IPython = (function (IPython) { |
|
7 | var IPython = (function (IPython) { | |
8 |
|
8 | |||
9 | var utils = IPython.utils; |
|
9 | var utils = IPython.utils; | |
10 |
|
10 | |||
11 | var LeftPanel = function (left_panel_selector, left_panel_splitter_selector) { |
|
11 | var LeftPanel = function (left_panel_selector, left_panel_splitter_selector) { | |
12 | this.left_panel_element = $(left_panel_selector); |
|
12 | this.left_panel_element = $(left_panel_selector); | |
13 | this.left_panel_splitter_element = $(left_panel_splitter_selector); |
|
13 | this.left_panel_splitter_element = $(left_panel_splitter_selector); | |
14 | this.expanded = true; |
|
14 | this.expanded = true; | |
15 | this.width = 250; |
|
15 | this.width = 250; | |
16 | this.style(); |
|
16 | this.style(); | |
17 | this.bind_events(); |
|
17 | this.bind_events(); | |
18 | this.create_children(); |
|
18 | this.create_children(); | |
19 | }; |
|
19 | }; | |
20 |
|
20 | |||
21 |
|
21 | |||
22 | LeftPanel.prototype.style = function () { |
|
22 | LeftPanel.prototype.style = function () { | |
23 | this.left_panel_splitter_element.addClass('border-box-sizing ui-widget ui-state-default'); |
|
23 | this.left_panel_splitter_element.addClass('border-box-sizing ui-widget ui-state-default'); | |
24 | this.left_panel_element.addClass('border-box-sizing ui-widget'); |
|
24 | this.left_panel_element.addClass('border-box-sizing ui-widget'); | |
25 | this.left_panel_element.width(this.width); |
|
25 | this.left_panel_element.width(this.width); | |
26 | this.left_panel_splitter_element.css({left : this.width}); |
|
26 | this.left_panel_splitter_element.css({left : this.width}); | |
27 | }; |
|
27 | }; | |
28 |
|
28 | |||
29 |
|
29 | |||
30 | LeftPanel.prototype.bind_events = function () { |
|
30 | LeftPanel.prototype.bind_events = function () { | |
31 | var that = this; |
|
31 | var that = this; | |
32 |
|
32 | |||
33 | this.left_panel_element.bind('collapse_left_panel', function () { |
|
33 | this.left_panel_element.bind('collapse_left_panel', function () { | |
34 | that.left_panel_element.hide('fast'); |
|
34 | that.left_panel_element.hide('fast'); | |
35 | that.left_panel_splitter_element.animate({left : 0}, 'fast'); |
|
35 | that.left_panel_splitter_element.animate({left : 0}, 'fast'); | |
36 | }); |
|
36 | }); | |
37 |
|
37 | |||
38 | this.left_panel_element.bind('expand_left_panel', function () { |
|
38 | this.left_panel_element.bind('expand_left_panel', function () { | |
39 | that.left_panel_element.show('fast'); |
|
39 | that.left_panel_element.show('fast'); | |
40 | that.left_panel_splitter_element.animate({left : that.width}, 'fast'); |
|
40 | that.left_panel_splitter_element.animate({left : that.width}, 'fast'); | |
41 | }); |
|
41 | }); | |
42 |
|
42 | |||
43 | this.left_panel_splitter_element.hover( |
|
43 | this.left_panel_splitter_element.hover( | |
44 | function () { |
|
44 | function () { | |
45 | that.left_panel_splitter_element.addClass('ui-state-hover'); |
|
45 | that.left_panel_splitter_element.addClass('ui-state-hover'); | |
46 | }, |
|
46 | }, | |
47 | function () { |
|
47 | function () { | |
48 | that.left_panel_splitter_element.removeClass('ui-state-hover'); |
|
48 | that.left_panel_splitter_element.removeClass('ui-state-hover'); | |
49 | } |
|
49 | } | |
50 | ); |
|
50 | ); | |
51 |
|
51 | |||
52 | this.left_panel_splitter_element.click(function () { |
|
52 | this.left_panel_splitter_element.click(function () { | |
53 | that.toggle(); |
|
53 | that.toggle(); | |
54 | }); |
|
54 | }); | |
55 |
|
55 | |||
56 | }; |
|
56 | }; | |
57 |
|
57 | |||
58 |
|
58 | |||
59 | LeftPanel.prototype.create_children = function () { |
|
59 | LeftPanel.prototype.create_children = function () { | |
60 | this.notebook_section = new IPython.NotebookSection(); |
|
60 | this.notebook_section = new IPython.NotebookSection(); | |
61 | this.left_panel_element.append(this.notebook_section.element); |
|
61 | this.left_panel_element.append(this.notebook_section.element); | |
62 | this.cell_section = new IPython.CellSection(); |
|
62 | this.cell_section = new IPython.CellSection(); | |
63 | this.left_panel_element.append(this.cell_section.element); |
|
63 | this.left_panel_element.append(this.cell_section.element); | |
64 | this.kernel_section = new IPython.KernelSection(); |
|
64 | this.kernel_section = new IPython.KernelSection(); | |
65 | this.left_panel_element.append(this.kernel_section.element); |
|
65 | this.left_panel_element.append(this.kernel_section.element); | |
|
66 | this.help_section = new IPython.HelpSection(); | |||
|
67 | this.left_panel_element.append(this.help_section.element); | |||
|
68 | this.help_section.collapse(); | |||
66 | } |
|
69 | } | |
67 |
|
70 | |||
68 | LeftPanel.prototype.collapse = function () { |
|
71 | LeftPanel.prototype.collapse = function () { | |
69 | if (this.expanded === true) { |
|
72 | if (this.expanded === true) { | |
70 | this.left_panel_element.add($('div#notebook')).trigger('collapse_left_panel'); |
|
73 | this.left_panel_element.add($('div#notebook')).trigger('collapse_left_panel'); | |
71 | this.expanded = false; |
|
74 | this.expanded = false; | |
72 | }; |
|
75 | }; | |
73 | }; |
|
76 | }; | |
74 |
|
77 | |||
75 |
|
78 | |||
76 | LeftPanel.prototype.expand = function () { |
|
79 | LeftPanel.prototype.expand = function () { | |
77 | if (this.expanded !== true) { |
|
80 | if (this.expanded !== true) { | |
78 | this.left_panel_element.add($('div#notebook')).trigger('expand_left_panel'); |
|
81 | this.left_panel_element.add($('div#notebook')).trigger('expand_left_panel'); | |
79 | this.expanded = true; |
|
82 | this.expanded = true; | |
80 | }; |
|
83 | }; | |
81 | }; |
|
84 | }; | |
82 |
|
85 | |||
83 |
|
86 | |||
84 | LeftPanel.prototype.toggle = function () { |
|
87 | LeftPanel.prototype.toggle = function () { | |
85 | if (this.expanded === true) { |
|
88 | if (this.expanded === true) { | |
86 | this.collapse(); |
|
89 | this.collapse(); | |
87 | } else { |
|
90 | } else { | |
88 | this.expand(); |
|
91 | this.expand(); | |
89 | }; |
|
92 | }; | |
90 | }; |
|
93 | }; | |
91 |
|
94 | |||
92 | IPython.LeftPanel = LeftPanel; |
|
95 | IPython.LeftPanel = LeftPanel; | |
93 |
|
96 | |||
94 | return IPython; |
|
97 | return IPython; | |
95 |
|
98 | |||
96 | }(IPython)); |
|
99 | }(IPython)); | |
97 |
|
100 |
@@ -1,58 +1,32 b'' | |||||
1 |
|
1 | |||
2 | //============================================================================ |
|
2 | //============================================================================ | |
3 | // On document ready |
|
3 | // On document ready | |
4 | //============================================================================ |
|
4 | //============================================================================ | |
5 |
|
5 | |||
6 |
|
6 | |||
7 | $(document).ready(function () { |
|
7 | $(document).ready(function () { | |
8 |
|
8 | |||
9 | MathJax.Hub.Config({ |
|
9 | MathJax.Hub.Config({ | |
10 | tex2jax: { |
|
10 | tex2jax: { | |
11 | inlineMath: [ ['$','$'], ["\\(","\\)"] ], |
|
11 | inlineMath: [ ['$','$'], ["\\(","\\)"] ], | |
12 | displayMath: [ ['$$','$$'], ["\\[","\\]"] ], |
|
12 | displayMath: [ ['$$','$$'], ["\\[","\\]"] ], | |
13 | }, |
|
13 | }, | |
14 | displayAlign: 'left', // Change this to 'center' to center equations. |
|
14 | displayAlign: 'left', // Change this to 'center' to center equations. | |
15 | "HTML-CSS": { |
|
15 | "HTML-CSS": { | |
16 | styles: {'.MathJax_Display': {"margin": 0}} |
|
16 | styles: {'.MathJax_Display': {"margin": 0}} | |
17 | } |
|
17 | } | |
18 | }); |
|
18 | }); | |
19 |
|
19 | |||
20 | $('div#notebook_app').addClass('border-box-sizing ui-widget ui-widget-content'); |
|
20 | $('div#notebook_app').addClass('border-box-sizing ui-widget ui-widget-content'); | |
21 | $('div#notebook_panel').addClass('border-box-sizing ui-widget'); |
|
21 | $('div#notebook_panel').addClass('border-box-sizing ui-widget'); | |
22 |
|
22 | |||
23 | IPython.layout_manager = new IPython.LayoutManager(); |
|
23 | IPython.layout_manager = new IPython.LayoutManager(); | |
24 | IPython.pager = new IPython.Pager('div#pager', 'div#pager_splitter'); |
|
24 | IPython.pager = new IPython.Pager('div#pager', 'div#pager_splitter'); | |
25 | IPython.left_panel = new IPython.LeftPanel('div#left_panel', 'div#left_panel_splitter'); |
|
25 | IPython.left_panel = new IPython.LeftPanel('div#left_panel', 'div#left_panel_splitter'); | |
26 | IPython.notebook = new IPython.Notebook('div#notebook'); |
|
26 | IPython.notebook = new IPython.Notebook('div#notebook'); | |
27 |
|
27 | |||
28 | IPython.notebook.insert_code_cell_after(); |
|
28 | IPython.notebook.insert_code_cell_after(); | |
29 | IPython.layout_manager.do_resize(); |
|
29 | IPython.layout_manager.do_resize(); | |
30 | IPython.pager.collapse(); |
|
30 | IPython.pager.collapse(); | |
31 |
|
||||
32 | // $("#menu_tabs").tabs(); |
|
|||
33 |
|
||||
34 | // $("#help_toolbar").buttonset(); |
|
|||
35 |
|
||||
36 | // $("#kernel_toolbar").buttonset(); |
|
|||
37 | // $("#interrupt_kernel").click(function () {IPython.notebook.kernel.interrupt();}); |
|
|||
38 | // $("#restart_kernel").click(function () {IPython.notebook.kernel.restart();}); |
|
|||
39 | // $("#kernel_status").addClass("status_idle"); |
|
|||
40 |
|
||||
41 | // $("#move_cell").buttonset(); |
|
|||
42 | // $("#move_up").button("option", "icons", {primary:"ui-icon-arrowthick-1-n"}); |
|
|||
43 | // $("#move_up").button("option", "text", false); |
|
|||
44 | // $("#move_up").click(function () {IPython.notebook.move_cell_up();}); |
|
|||
45 | // $("#move_down").button("option", "icons", {primary:"ui-icon-arrowthick-1-s"}); |
|
|||
46 | // $("#move_down").button("option", "text", false); |
|
|||
47 | // $("#move_down").click(function () {IPython.notebook.move_cell_down();}); |
|
|||
48 |
|
||||
49 | // $("#insert_delete").buttonset(); |
|
|||
50 | // $("#insert_cell_before").click(function () {IPython.notebook.insert_code_cell_before();}); |
|
|||
51 | // $("#insert_cell_after").click(function () {IPython.notebook.insert_code_cell_after();}); |
|
|||
52 | // $("#delete_cell").button("option", "icons", {primary:"ui-icon-closethick"}); |
|
|||
53 | // $("#delete_cell").button("option", "text", false); |
|
|||
54 | // $("#delete_cell").click(function () {IPython.notebook.delete_cell();}); |
|
|||
55 |
|
||||
56 |
|
||||
57 | }); |
|
31 | }); | |
58 |
|
32 |
@@ -1,215 +1,285 b'' | |||||
1 |
|
1 | |||
2 | //============================================================================ |
|
2 | //============================================================================ | |
3 | // Cell |
|
3 | // Cell | |
4 | //============================================================================ |
|
4 | //============================================================================ | |
5 |
|
5 | |||
6 | var IPython = (function (IPython) { |
|
6 | var IPython = (function (IPython) { | |
7 |
|
7 | |||
8 | var utils = IPython.utils; |
|
8 | var utils = IPython.utils; | |
9 |
|
9 | |||
10 | // Base PanelSection class |
|
10 | // Base PanelSection class | |
11 |
|
11 | |||
12 | var PanelSection = function () { |
|
12 | var PanelSection = function () { | |
13 | if (this.section_name === undefined) { |
|
13 | if (this.section_name === undefined) { | |
14 | this.section_name = 'section'; |
|
14 | this.section_name = 'section'; | |
15 | }; |
|
15 | }; | |
16 | this.create_element(); |
|
16 | this.create_element(); | |
17 | if (this.element !== undefined) { |
|
17 | if (this.element !== undefined) { | |
18 | this.bind_events(); |
|
18 | this.bind_events(); | |
19 | } |
|
19 | } | |
20 | this.expanded = true; |
|
20 | this.expanded = true; | |
21 | }; |
|
21 | }; | |
22 |
|
22 | |||
23 |
|
23 | |||
24 | PanelSection.prototype.bind_events = function () { |
|
24 | PanelSection.prototype.bind_events = function () { | |
25 | var that = this; |
|
25 | var that = this; | |
26 | this.header.click(function () { |
|
26 | this.header.click(function () { | |
27 | that.toggle(); |
|
27 | that.toggle(); | |
28 | }); |
|
28 | }); | |
29 | this.header.hover(function () { |
|
29 | this.header.hover(function () { | |
30 | that.header.toggleClass('ui-state-hover'); |
|
30 | that.header.toggleClass('ui-state-hover'); | |
31 | }); |
|
31 | }); | |
32 | }; |
|
32 | }; | |
33 |
|
33 | |||
34 |
|
34 | |||
35 | PanelSection.prototype.create_element = function () { |
|
35 | PanelSection.prototype.create_element = function () { | |
36 | this.element = $('<div/>').attr('id',this.id()); |
|
36 | this.element = $('<div/>').attr('id',this.id()); | |
37 | this.header = $('<h3>'+this.section_name+'</h3>'). |
|
37 | this.header = $('<h3>'+this.section_name+'</h3>'). | |
38 | addClass('ui-widget ui-state-default section_header'); |
|
38 | addClass('ui-widget ui-state-default section_header'); | |
39 | this.content = $('<div/>'). |
|
39 | this.content = $('<div/>'). | |
40 | addClass('ui-widget section_content'); |
|
40 | addClass('ui-widget section_content'); | |
41 | this.element.append(this.header).append(this.content); |
|
41 | this.element.append(this.header).append(this.content); | |
42 | this.create_children(); |
|
42 | this.create_children(); | |
43 | }; |
|
43 | }; | |
44 |
|
44 | |||
45 |
|
45 | |||
46 | PanelSection.prototype.id = function () { |
|
46 | PanelSection.prototype.id = function () { | |
47 | return this.section_name.toLowerCase() + "_section"; |
|
47 | return this.section_name.toLowerCase() + "_section"; | |
48 | }; |
|
48 | }; | |
49 |
|
49 | |||
50 |
|
50 | |||
51 | PanelSection.prototype.expand = function () { |
|
51 | PanelSection.prototype.expand = function () { | |
52 | if (!this.expanded) { |
|
52 | if (!this.expanded) { | |
53 | this.content.slideDown('fast'); |
|
53 | this.content.slideDown('fast'); | |
54 | // this.header.addClass('ui-state-active'); |
|
54 | // this.header.addClass('ui-state-active'); | |
55 | // this.header.removeClass('ui-state-default'); |
|
55 | // this.header.removeClass('ui-state-default'); | |
56 | this.expanded = true; |
|
56 | this.expanded = true; | |
57 | }; |
|
57 | }; | |
58 | }; |
|
58 | }; | |
59 |
|
59 | |||
60 |
|
60 | |||
61 | PanelSection.prototype.collapse = function () { |
|
61 | PanelSection.prototype.collapse = function () { | |
62 | if (this.expanded) { |
|
62 | if (this.expanded) { | |
63 | this.content.slideUp('fast'); |
|
63 | this.content.slideUp('fast'); | |
64 | // this.header.removeClass('ui-state-active'); |
|
64 | // this.header.removeClass('ui-state-active'); | |
65 | // this.header.addClass('ui-state-default'); |
|
65 | // this.header.addClass('ui-state-default'); | |
66 | this.expanded = false; |
|
66 | this.expanded = false; | |
67 | }; |
|
67 | }; | |
68 | }; |
|
68 | }; | |
69 |
|
69 | |||
70 |
|
70 | |||
71 | PanelSection.prototype.toggle = function () { |
|
71 | PanelSection.prototype.toggle = function () { | |
72 | if (this.expanded === true) { |
|
72 | if (this.expanded === true) { | |
73 | this.collapse(); |
|
73 | this.collapse(); | |
74 | } else { |
|
74 | } else { | |
75 | this.expand(); |
|
75 | this.expand(); | |
76 | }; |
|
76 | }; | |
77 | }; |
|
77 | }; | |
78 |
|
78 | |||
79 |
|
79 | |||
80 | PanelSection.prototype.create_children = function () {}; |
|
80 | PanelSection.prototype.create_children = function () {}; | |
81 |
|
81 | |||
82 |
|
82 | |||
83 | // NotebookSection |
|
83 | // NotebookSection | |
84 |
|
84 | |||
85 | var NotebookSection = function () { |
|
85 | var NotebookSection = function () { | |
86 | this.section_name = "Notebook"; |
|
86 | this.section_name = "Notebook"; | |
87 | PanelSection.apply(this, arguments); |
|
87 | PanelSection.apply(this, arguments); | |
88 | }; |
|
88 | }; | |
89 |
|
89 | |||
90 |
|
90 | |||
91 | NotebookSection.prototype = new PanelSection(); |
|
91 | NotebookSection.prototype = new PanelSection(); | |
92 |
|
92 | |||
93 |
|
93 | |||
94 | // CellSection |
|
94 | // CellSection | |
95 |
|
95 | |||
96 | var CellSection = function () { |
|
96 | var CellSection = function () { | |
97 | this.section_name = "Cell"; |
|
97 | this.section_name = "Cell"; | |
98 | PanelSection.apply(this, arguments); |
|
98 | PanelSection.apply(this, arguments); | |
99 | }; |
|
99 | }; | |
100 |
|
100 | |||
101 |
|
101 | |||
102 | CellSection.prototype = new PanelSection(); |
|
102 | CellSection.prototype = new PanelSection(); | |
103 |
|
103 | |||
104 |
|
104 | |||
105 | CellSection.prototype.bind_events = function () { |
|
105 | CellSection.prototype.bind_events = function () { | |
106 | PanelSection.prototype.bind_events.apply(this); |
|
106 | PanelSection.prototype.bind_events.apply(this); | |
107 | this.content.find('#collapse_cell').click(function () { |
|
107 | this.content.find('#collapse_cell').click(function () { | |
108 | IPython.notebook.collapse(); |
|
108 | IPython.notebook.collapse(); | |
109 | }); |
|
109 | }); | |
110 | this.content.find('#expand_cell').click(function () { |
|
110 | this.content.find('#expand_cell').click(function () { | |
111 | IPython.notebook.expand(); |
|
111 | IPython.notebook.expand(); | |
112 | }); |
|
112 | }); | |
113 | this.content.find('#delete_cell').click(function () { |
|
113 | this.content.find('#delete_cell').click(function () { | |
114 | IPython.notebook.delete_cell(); |
|
114 | IPython.notebook.delete_cell(); | |
115 | }); |
|
115 | }); | |
116 | this.content.find('#insert_cell_above').click(function () { |
|
116 | this.content.find('#insert_cell_above').click(function () { | |
117 | IPython.notebook.insert_code_cell_before(); |
|
117 | IPython.notebook.insert_code_cell_before(); | |
118 | }); |
|
118 | }); | |
119 | this.content.find('#insert_cell_below').click(function () { |
|
119 | this.content.find('#insert_cell_below').click(function () { | |
120 | IPython.notebook.insert_code_cell_after(); |
|
120 | IPython.notebook.insert_code_cell_after(); | |
121 | }); |
|
121 | }); | |
122 | this.content.find('#move_cell_up').click(function () { |
|
122 | this.content.find('#move_cell_up').click(function () { | |
123 | IPython.notebook.move_cell_up(); |
|
123 | IPython.notebook.move_cell_up(); | |
124 | }); |
|
124 | }); | |
125 | this.content.find('#move_cell_down').click(function () { |
|
125 | this.content.find('#move_cell_down').click(function () { | |
126 | IPython.notebook.move_cell_down(); |
|
126 | IPython.notebook.move_cell_down(); | |
127 | }); |
|
127 | }); | |
128 | this.content.find('#to_code').click(function () { |
|
128 | this.content.find('#to_code').click(function () { | |
129 | IPython.notebook.text_to_code(); |
|
129 | IPython.notebook.text_to_code(); | |
130 | }); |
|
130 | }); | |
131 | this.content.find('#to_text').click(function () { |
|
131 | this.content.find('#to_text').click(function () { | |
132 | IPython.notebook.code_to_text(); |
|
132 | IPython.notebook.code_to_text(); | |
133 | }); |
|
133 | }); | |
134 | this.content.find('#run_selected_cell').click(function () { |
|
134 | this.content.find('#run_selected_cell').click(function () { | |
135 | alert("Not Implemented"); |
|
135 | alert("Not Implemented"); | |
136 | }); |
|
136 | }); | |
137 | this.content.find('#run_all_cells').click(function () { |
|
137 | this.content.find('#run_all_cells').click(function () { | |
138 | alert("Not Implemented"); |
|
138 | alert("Not Implemented"); | |
139 | }); |
|
139 | }); | |
140 | }; |
|
140 | }; | |
141 |
|
141 | |||
142 |
|
142 | |||
143 | CellSection.prototype.create_children = function () { |
|
143 | CellSection.prototype.create_children = function () { | |
144 |
|
144 | |||
145 | this.content.addClass('ui-helper-clearfix'); |
|
145 | this.content.addClass('ui-helper-clearfix'); | |
146 |
|
146 | |||
147 |
var row |
|
147 | var row0 = $('<div>').addClass('cell_section_row ui-helper-clearfix'). | |
148 | append($('<span/>').addClass('cell_section_row_buttons'). |
|
148 | append($('<span/>').addClass('cell_section_row_buttons'). | |
149 | append($('<button>X</button>').attr('id','delete_cell'))). |
|
149 | append($('<button>X</button>').attr('id','delete_cell'))). | |
150 | append($('<span/>').html('Actions').addClass('cell_section_row_header')); |
|
150 | append($('<span/>').html('Actions').addClass('cell_section_row_header')); | |
151 |
row |
|
151 | row0.find('#delete_cell').button(); | |
152 |
this.content.append(row |
|
152 | this.content.append(row0); | |
153 |
|
153 | |||
154 | var row1 = $('<div>').addClass('cell_section_row ui-helper-clearfix'). |
|
154 | var row1 = $('<div>').addClass('cell_section_row ui-helper-clearfix'). | |
155 | append($('<span/>').attr('id','insert').addClass('cell_section_row_buttons'). |
|
155 | append($('<span/>').attr('id','insert').addClass('cell_section_row_buttons'). | |
156 | append( $('<button>Above</button>').attr('id','insert_cell_above') ). |
|
156 | append( $('<button>Above</button>').attr('id','insert_cell_above') ). | |
157 | append( $('<button>Below</button>').attr('id','insert_cell_below') )). |
|
157 | append( $('<button>Below</button>').attr('id','insert_cell_below') )). | |
158 | append($('<span/>').html('Insert').addClass('button_label')); |
|
158 | append($('<span/>').html('Insert').addClass('button_label')); | |
159 | row1.find('#insert').buttonset(); |
|
159 | row1.find('#insert').buttonset(); | |
160 | this.content.append(row1); |
|
160 | this.content.append(row1); | |
161 |
|
161 | |||
162 | var row2 = $('<div>').addClass('cell_section_row ui-helper-clearfix'). |
|
162 | var row2 = $('<div>').addClass('cell_section_row ui-helper-clearfix'). | |
163 | append($('<span/>').attr('id','move').addClass('cell_section_row_buttons'). |
|
163 | append($('<span/>').attr('id','move').addClass('cell_section_row_buttons'). | |
164 | append( $('<button>Up</button>').attr('id','move_cell_up') ). |
|
164 | append( $('<button>Up</button>').attr('id','move_cell_up') ). | |
165 | append( $('<button>Down</button>').attr('id','move_cell_down') ) ). |
|
165 | append( $('<button>Down</button>').attr('id','move_cell_down') ) ). | |
166 | append($('<span/>').html('Move').addClass('button_label')); |
|
166 | append($('<span/>').html('Move').addClass('button_label')); | |
167 | row2.find('#move').buttonset(); |
|
167 | row2.find('#move').buttonset(); | |
168 | this.content.append(row2); |
|
168 | this.content.append(row2); | |
169 |
|
169 | |||
170 | var row3 = $('<div>').addClass('cell_section_row ui-helper-clearfix'). |
|
170 | var row3 = $('<div>').addClass('cell_section_row ui-helper-clearfix'). | |
171 | append($('<span/>').attr('id','cell_type').addClass('cell_section_row_buttons'). |
|
171 | append($('<span/>').attr('id','cell_type').addClass('cell_section_row_buttons'). | |
172 | append( $('<button>Code</button>').attr('id','to_code') ). |
|
172 | append( $('<button>Code</button>').attr('id','to_code') ). | |
173 | append( $('<button>Text</button>').attr('id','to_text') ) ). |
|
173 | append( $('<button>Text</button>').attr('id','to_text') ) ). | |
174 | append($('<span/>').html('Cell Type').addClass('button_label')); |
|
174 | append($('<span/>').html('Cell Type').addClass('button_label')); | |
175 | row3.find('#cell_type').buttonset(); |
|
175 | row3.find('#cell_type').buttonset(); | |
176 | this.content.append(row3); |
|
176 | this.content.append(row3); | |
177 |
|
177 | |||
178 |
var row |
|
178 | var row1 = $('<div>').addClass('cell_section_row ui-helper-clearfix'). | |
179 | append($('<span/>').attr('id','toggle_output').addClass('cell_section_row_buttons'). |
|
179 | append($('<span/>').attr('id','toggle_output').addClass('cell_section_row_buttons'). | |
180 | append( $('<button>Collapse</button>').attr('id','collapse_cell') ). |
|
180 | append( $('<button>Collapse</button>').attr('id','collapse_cell') ). | |
181 | append( $('<button>Expand</button>').attr('id','expand_cell') ) ). |
|
181 | append( $('<button>Expand</button>').attr('id','expand_cell') ) ). | |
182 | append($('<span/>').html('Output').addClass('button_label')); |
|
182 | append($('<span/>').html('Output').addClass('button_label')); | |
183 |
row |
|
183 | row1.find('#toggle_output').buttonset(); | |
184 |
this.content.append(row |
|
184 | this.content.append(row1); | |
185 |
|
185 | |||
186 | var row0 = $('<div>').addClass('cell_section_row'). |
|
186 | var row0 = $('<div>').addClass('cell_section_row'). | |
187 | append($('<span/>').attr('id','run_cells').addClass('cell_section_row_buttons'). |
|
187 | append($('<span/>').attr('id','run_cells').addClass('cell_section_row_buttons'). | |
188 | append( $('<button>Selected</button>').attr('id','run_selected_cell') ). |
|
188 | append( $('<button>Selected</button>').attr('id','run_selected_cell') ). | |
189 | append( $('<button>All</button>').attr('id','run_all_cells') ) ). |
|
189 | append( $('<button>All</button>').attr('id','run_all_cells') ) ). | |
190 | append($('<span/>').html('Run').addClass('button_label')); |
|
190 | append($('<span/>').html('Run').addClass('button_label')); | |
191 | row0.find('#run_cells').buttonset(); |
|
191 | row0.find('#run_cells').buttonset(); | |
192 | this.content.append(row0); |
|
192 | this.content.append(row0); | |
193 | }; |
|
193 | }; | |
194 |
|
194 | |||
195 |
|
195 | |||
196 | // KernelSection |
|
196 | // KernelSection | |
197 |
|
197 | |||
198 | var KernelSection = function () { |
|
198 | var KernelSection = function () { | |
199 | this.section_name = "Kernel"; |
|
199 | this.section_name = "Kernel"; | |
200 | PanelSection.apply(this, arguments); |
|
200 | PanelSection.apply(this, arguments); | |
201 | }; |
|
201 | }; | |
202 |
|
202 | |||
203 |
|
203 | |||
204 | KernelSection.prototype = new PanelSection(); |
|
204 | KernelSection.prototype = new PanelSection(); | |
205 |
|
205 | |||
206 |
|
206 | |||
|
207 | KernelSection.prototype.bind_events = function () { | |||
|
208 | PanelSection.prototype.bind_events.apply(this); | |||
|
209 | this.content.find('#restart_kernel').click(function () { | |||
|
210 | IPython.notebook.kernel.restart(); | |||
|
211 | }); | |||
|
212 | this.content.find('#int_kernel').click(function () { | |||
|
213 | IPython.notebook.kernel.interrupt(); | |||
|
214 | }); | |||
|
215 | }; | |||
|
216 | ||||
|
217 | ||||
|
218 | KernelSection.prototype.create_children = function () { | |||
|
219 | ||||
|
220 | this.content.addClass('ui-helper-clearfix'); | |||
|
221 | ||||
|
222 | var row0 = $('<div>').addClass('cell_section_row ui-helper-clearfix'). | |||
|
223 | append($('<span/>').attr('id','int_restart').addClass('cell_section_row_buttons'). | |||
|
224 | append( $('<button>Interrupt</button>').attr('id','int_kernel') ). | |||
|
225 | append( $('<button>Restart</button>').attr('id','restart_kernel') )). | |||
|
226 | append($('<span/>').html('Actions').addClass('cell_section_row_header')); | |||
|
227 | row0.find('#int_restart').buttonset(); | |||
|
228 | this.content.append(row0); | |||
|
229 | }; | |||
|
230 | ||||
|
231 | ||||
|
232 | // HelpSection | |||
|
233 | ||||
|
234 | var HelpSection = function () { | |||
|
235 | this.section_name = "Help"; | |||
|
236 | PanelSection.apply(this, arguments); | |||
|
237 | }; | |||
|
238 | ||||
|
239 | ||||
|
240 | HelpSection.prototype = new PanelSection(); | |||
|
241 | ||||
|
242 | ||||
|
243 | HelpSection.prototype.bind_events = function () { | |||
|
244 | PanelSection.prototype.bind_events.apply(this); | |||
|
245 | }; | |||
|
246 | ||||
|
247 | ||||
|
248 | HelpSection.prototype.create_children = function () { | |||
|
249 | ||||
|
250 | this.content.addClass('ui-helper-clearfix'); | |||
|
251 | ||||
|
252 | var row0 = $('<div>').addClass('cell_section_row ui-helper-clearfix'). | |||
|
253 | append($('<span/>').attr('id','help_buttons0').addClass('cell_section_row_buttons'). | |||
|
254 | append( $('<button/>').attr('id','python_help'). | |||
|
255 | append( $('<a>Python</a>').attr('href','http://docs.python.org').attr('target','_blank') )). | |||
|
256 | append( $('<button/>').attr('id','ipython_help'). | |||
|
257 | append( $('<a>IPython</a>').attr('href','http://ipython.org/documentation.html').attr('target','_blank') )). | |||
|
258 | append( $('<button/>').attr('id','numpy_help'). | |||
|
259 | append( $('<a>NumPy</a>').attr('href','http://docs.scipy.org/doc/numpy/reference/').attr('target','_blank') ))). | |||
|
260 | append($('<span/>').html('Links').addClass('cell_section_row_header')); | |||
|
261 | row0.find('#help_buttons0').buttonset(); | |||
|
262 | this.content.append(row0); | |||
|
263 | ||||
|
264 | var row1 = $('<div>').addClass('cell_section_row ui-helper-clearfix'). | |||
|
265 | append($('<span/>').attr('id','help_buttons1').addClass('cell_section_row_buttons'). | |||
|
266 | append( $('<button/>').attr('id','matplotlib_help'). | |||
|
267 | append( $('<a>Matplotlib</a>').attr('href','http://matplotlib.sourceforge.net/').attr('target','_blank') )). | |||
|
268 | append( $('<button/>').attr('id','scipy_help'). | |||
|
269 | append( $('<a>SciPy</a>').attr('href','http://docs.scipy.org/doc/scipy/reference/').attr('target','_blank') )). | |||
|
270 | append( $('<button/>').attr('id','sympy_help'). | |||
|
271 | append( $('<a>SymPy</a>').attr('href','http://docs.sympy.org/dev/index.html').attr('target','_blank') ))); | |||
|
272 | row1.find('#help_buttons1').buttonset(); | |||
|
273 | this.content.append(row1); | |||
|
274 | }; | |||
|
275 | ||||
207 | IPython.PanelSection = PanelSection; |
|
276 | IPython.PanelSection = PanelSection; | |
208 | IPython.NotebookSection = NotebookSection; |
|
277 | IPython.NotebookSection = NotebookSection; | |
209 | IPython.CellSection = CellSection; |
|
278 | IPython.CellSection = CellSection; | |
210 | IPython.KernelSection = KernelSection; |
|
279 | IPython.KernelSection = KernelSection; | |
|
280 | IPython.HelpSection = HelpSection; | |||
211 |
|
281 | |||
212 | return IPython; |
|
282 | return IPython; | |
213 |
|
283 | |||
214 | }(IPython)); |
|
284 | }(IPython)); | |
215 |
|
285 |
@@ -1,123 +1,70 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 | if (typeof MathJax == 'undefined') { |
|
16 | if (typeof MathJax == 'undefined') { | |
17 | console.log("Trying to load local copy of MathJax"); |
|
17 | console.log("Trying to load local copy of MathJax"); | |
18 | document.write(unescape("%3Cscript type='text/javascript' src='static/mathjax/MathJax.js%3Fconfig=TeX-AMS_HTML' charset='utf-8'%3E%3C/script%3E")); |
|
18 | document.write(unescape("%3Cscript type='text/javascript' src='static/mathjax/MathJax.js%3Fconfig=TeX-AMS_HTML' charset='utf-8'%3E%3C/script%3E")); | |
19 | } |
|
19 | } | |
20 | </script> |
|
20 | </script> | |
21 |
|
21 | |||
22 | <link rel="stylesheet" href="static/codemirror2/lib/codemirror.css"> |
|
22 | <link rel="stylesheet" href="static/codemirror2/lib/codemirror.css"> | |
23 | <link rel="stylesheet" href="static/codemirror2/mode/python/python.css"> |
|
23 | <link rel="stylesheet" href="static/codemirror2/mode/python/python.css"> | |
24 |
|
24 | |||
25 | <link rel="stylesheet" href="static/css/layout.css" type="text/css" /> |
|
25 | <link rel="stylesheet" href="static/css/layout.css" type="text/css" /> | |
26 | <link rel="stylesheet" href="static/css/notebook.css" type="text/css" /> |
|
26 | <link rel="stylesheet" href="static/css/notebook.css" type="text/css" /> | |
27 |
|
27 | |||
28 | </head> |
|
28 | </head> | |
29 |
|
29 | |||
30 | <body> |
|
30 | <body> | |
31 |
|
31 | |||
32 | <div id="header"> |
|
32 | <div id="header"> | |
33 | <span id="ipython_notebook"><h1>IPython Notebook</h1></span> |
|
33 | <span id="ipython_notebook"><h1>IPython Notebook</h1></span> | |
34 | </div> |
|
34 | </div> | |
35 |
|
35 | |||
36 | <div id="notebook_app"> |
|
36 | <div id="notebook_app"> | |
37 |
|
37 | |||
38 | <div id="left_panel"></div> |
|
38 | <div id="left_panel"></div> | |
39 | <div id="left_panel_splitter"></div> |
|
39 | <div id="left_panel_splitter"></div> | |
40 | <div id="notebook_panel"> |
|
40 | <div id="notebook_panel"> | |
41 | <div id="notebook"></div> |
|
41 | <div id="notebook"></div> | |
42 | <div id="pager_splitter"></div> |
|
42 | <div id="pager_splitter"></div> | |
43 | <div id="pager"></div> |
|
43 | <div id="pager"></div> | |
44 | </div> |
|
44 | </div> | |
45 |
|
45 | |||
46 | </div> |
|
46 | </div> | |
47 |
|
47 | |||
48 | <script src="static/jquery/js/jquery-1.6.2.min.js" type="text/javascript" charset="utf-8"></script> |
|
48 | <script src="static/jquery/js/jquery-1.6.2.min.js" type="text/javascript" charset="utf-8"></script> | |
49 | <script src="static/jquery/js/jquery-ui-1.8.14.custom.min.js" type="text/javascript" charset="utf-8"></script> |
|
49 | <script src="static/jquery/js/jquery-ui-1.8.14.custom.min.js" type="text/javascript" charset="utf-8"></script> | |
50 | <script src="static/jquery/js/jquery.autogrow.js" type="text/javascript" charset="utf-8"></script> |
|
50 | <script src="static/jquery/js/jquery.autogrow.js" type="text/javascript" charset="utf-8"></script> | |
51 | <script src="static/js/namespace.js" type="text/javascript" charset="utf-8"></script> |
|
51 | <script src="static/js/namespace.js" type="text/javascript" charset="utf-8"></script> | |
52 | <script src="static/js/utils.js" type="text/javascript" charset="utf-8"></script> |
|
52 | <script src="static/js/utils.js" type="text/javascript" charset="utf-8"></script> | |
53 | <script src="static/js/cell.js" type="text/javascript" charset="utf-8"></script> |
|
53 | <script src="static/js/cell.js" type="text/javascript" charset="utf-8"></script> | |
54 | <script src="static/js/codecell.js" type="text/javascript" charset="utf-8"></script> |
|
54 | <script src="static/js/codecell.js" type="text/javascript" charset="utf-8"></script> | |
55 | <script src="static/js/textcell.js" type="text/javascript" charset="utf-8"></script> |
|
55 | <script src="static/js/textcell.js" type="text/javascript" charset="utf-8"></script> | |
56 | <script src="static/js/kernel.js" type="text/javascript" charset="utf-8"></script> |
|
56 | <script src="static/js/kernel.js" type="text/javascript" charset="utf-8"></script> | |
57 | <script src="static/js/layout.js" type="text/javascript" charset="utf-8"></script> |
|
57 | <script src="static/js/layout.js" type="text/javascript" charset="utf-8"></script> | |
58 | <script src="static/js/pager.js" type="text/javascript" charset="utf-8"></script> |
|
58 | <script src="static/js/pager.js" type="text/javascript" charset="utf-8"></script> | |
59 | <script src="static/js/panelsection.js" type="text/javascript" charset="utf-8"></script> |
|
59 | <script src="static/js/panelsection.js" type="text/javascript" charset="utf-8"></script> | |
60 | <script src="static/js/leftpanel.js" type="text/javascript" charset="utf-8"></script> |
|
60 | <script src="static/js/leftpanel.js" type="text/javascript" charset="utf-8"></script> | |
61 | <script src="static/js/notebook.js" type="text/javascript" charset="utf-8"></script> |
|
61 | <script src="static/js/notebook.js" type="text/javascript" charset="utf-8"></script> | |
62 | <script src="static/js/notebook_main.js" type="text/javascript" charset="utf-8"></script> |
|
62 | <script src="static/js/notebook_main.js" type="text/javascript" charset="utf-8"></script> | |
63 | <script src="static/codemirror2/lib/codemirror.js"></script> |
|
63 | <script src="static/codemirror2/lib/codemirror.js"></script> | |
64 | <script src="static/codemirror2/mode/python/python.js"></script> |
|
64 | <script src="static/codemirror2/mode/python/python.js"></script> | |
65 |
|
65 | |||
66 | </body> |
|
66 | </body> | |
67 |
|
67 | |||
68 | </html> |
|
68 | </html> | |
69 |
|
69 | |||
70 |
|
70 | |||
71 | <!--<div id="tools">--> |
|
|||
72 |
|
||||
73 | <!--<div id="menu_tabs">--> |
|
|||
74 | <!-- <span id="kernel_status">Idle</span>--> |
|
|||
75 | <!-- <ul>--> |
|
|||
76 | <!-- <li><a href="#cell_tab">Cell</a></li>--> |
|
|||
77 | <!-- <li><a href="#kernel_tab">Kernel</a></li>--> |
|
|||
78 | <!-- <li><a href="#help_tab">Help</a></li>--> |
|
|||
79 | <!-- </ul>--> |
|
|||
80 | <!-- <div id="cell_tab">--> |
|
|||
81 | <!-- <span id="cell_toolbar">--> |
|
|||
82 | <!-- <span id="move_cell">--> |
|
|||
83 | <!-- <button id="move_up">Move up</button>--> |
|
|||
84 | <!-- <button id="move_down">Move down</button>--> |
|
|||
85 | <!-- </span>--> |
|
|||
86 | <!-- <span id="insert_delete">--> |
|
|||
87 | <!-- <button id="insert_cell_before">Before</button>--> |
|
|||
88 | <!-- <button id="insert_cell_after">After</button>--> |
|
|||
89 | <!-- <button id="delete_cell">Delete</button>--> |
|
|||
90 | <!-- </span>--> |
|
|||
91 | <!-- <span id="cell_type">--> |
|
|||
92 | <!-- <button id="to_code">Code</button>--> |
|
|||
93 | <!-- <button id="to_text">Text</button>--> |
|
|||
94 | <!-- </span>--> |
|
|||
95 | <!-- <span id="sort">--> |
|
|||
96 | <!-- <button id="sort_cells">Sort</button>--> |
|
|||
97 | <!-- </span>--> |
|
|||
98 | <!-- <span id="toggle">--> |
|
|||
99 | <!-- <button id="collapse">Collapse</button>--> |
|
|||
100 | <!-- <button id="expand">Expand</button>--> |
|
|||
101 | <!-- </span>--> |
|
|||
102 | <!-- </span>--> |
|
|||
103 | <!-- </div>--> |
|
|||
104 | <!-- <div id="kernel_tab">--> |
|
|||
105 | <!-- <span id="kernel_toolbar">--> |
|
|||
106 | <!-- <button id="interrupt_kernel">Interrupt</button>--> |
|
|||
107 | <!-- <button id="restart_kernel">Restart</button>--> |
|
|||
108 | <!-- </span>--> |
|
|||
109 | <!-- </div>--> |
|
|||
110 | <!-- <div id="help_tab">--> |
|
|||
111 | <!-- <span id="help_toolbar">--> |
|
|||
112 | <!-- <button><a href="http://docs.python.org" target="_blank">Python</a></button>--> |
|
|||
113 | <!-- <button><a href="http://ipython.github.com/ipython-doc/dev/index.html" target="_blank">IPython</a></button>--> |
|
|||
114 | <!-- <button><a href="http://matplotlib.sourceforge.net/" target="_blank">Matplotlib</a></button>--> |
|
|||
115 | <!-- <button><a href="http://docs.scipy.org/doc/numpy/reference/" target="_blank">NumPy</a></button>--> |
|
|||
116 | <!-- <button><a href="http://docs.scipy.org/doc/scipy/reference/" target="_blank">SciPy</a></button>--> |
|
|||
117 | <!-- <button><a href="http://docs.sympy.org/dev/index.html" target="_blank">SymPy</a></button>--> |
|
|||
118 | <!-- </span>--> |
|
|||
119 | <!-- </div>--> |
|
|||
120 | <!--</div>--> |
|
|||
121 |
|
||||
122 | <!--</div>--> |
|
|||
123 |
|
General Comments 0
You need to be logged in to leave comments.
Login now