Show More
@@ -17,14 +17,14 b' var IPython = (function (IPython) {' | |||||
17 | IPython.ToolBar.apply(this, arguments); |
|
17 | IPython.ToolBar.apply(this, arguments); | |
18 | // move the rest ouside |
|
18 | // move the rest ouside | |
19 | this.construct(); |
|
19 | this.construct(); | |
20 |
this.add |
|
20 | this.add_drop_down_list(); | |
21 | this.bind_events(); |
|
21 | this.bind_events(); | |
22 | } |
|
22 | } | |
23 | }; |
|
23 | }; | |
24 |
|
24 | |||
25 | MainToolBar.prototype = new IPython.ToolBar(); |
|
25 | MainToolBar.prototype = new IPython.ToolBar(); | |
26 |
|
26 | |||
27 |
MainToolBar.prototype.add |
|
27 | MainToolBar.prototype.add_drop_down_list = function() { | |
28 | var select = $(this.selector) |
|
28 | var select = $(this.selector) | |
29 | .append($('<select/>') |
|
29 | .append($('<select/>') | |
30 | .attr('id','cell_type') |
|
30 | .attr('id','cell_type') | |
@@ -44,7 +44,7 b' var IPython = (function (IPython) {' | |||||
44 | } |
|
44 | } | |
45 |
|
45 | |||
46 | MainToolBar.prototype.construct = function() { |
|
46 | MainToolBar.prototype.construct = function() { | |
47 |
this.add |
|
47 | this.add_buttons_group([ | |
48 | { |
|
48 | { | |
49 | id:'save_b', |
|
49 | id:'save_b', | |
50 | label:'Save', |
|
50 | label:'Save', | |
@@ -54,7 +54,7 b' var IPython = (function (IPython) {' | |||||
54 | }, |
|
54 | }, | |
55 | }, |
|
55 | }, | |
56 | ]); |
|
56 | ]); | |
57 |
this.add |
|
57 | this.add_buttons_group([ | |
58 | { |
|
58 | { | |
59 | id:'cut_b', |
|
59 | id:'cut_b', | |
60 | label:'Cut Cell', |
|
60 | label:'Cut Cell', | |
@@ -81,7 +81,7 b' var IPython = (function (IPython) {' | |||||
81 | }, |
|
81 | }, | |
82 | ],'cut_copy_paste'); |
|
82 | ],'cut_copy_paste'); | |
83 |
|
83 | |||
84 |
this.add |
|
84 | this.add_buttons_group([ | |
85 | { |
|
85 | { | |
86 | id:'move_up_b', |
|
86 | id:'move_up_b', | |
87 | label:'Move Cell Up', |
|
87 | label:'Move Cell Up', | |
@@ -100,7 +100,7 b' var IPython = (function (IPython) {' | |||||
100 | }, |
|
100 | }, | |
101 | ],'move_up_down'); |
|
101 | ],'move_up_down'); | |
102 |
|
102 | |||
103 |
this.add |
|
103 | this.add_buttons_group([ | |
104 | { |
|
104 | { | |
105 | id:'insert_above_b', |
|
105 | id:'insert_above_b', | |
106 | label:'Insert Cell Above', |
|
106 | label:'Insert Cell Above', | |
@@ -119,7 +119,7 b' var IPython = (function (IPython) {' | |||||
119 | }, |
|
119 | }, | |
120 | ],'insert_above_below'); |
|
120 | ],'insert_above_below'); | |
121 |
|
121 | |||
122 |
this.add |
|
122 | this.add_buttons_group([ | |
123 | { |
|
123 | { | |
124 | id:'run_b', |
|
124 | id:'run_b', | |
125 | label:'Run Cell', |
|
125 | label:'Run Cell', |
@@ -35,7 +35,7 b' var IPython = (function (IPython) {' | |||||
35 | // |
|
35 | // | |
36 | // Example |
|
36 | // Example | |
37 | // |
|
37 | // | |
38 |
// IPython.toolbar.add |
|
38 | // IPython.toolbar.add_button_group([ | |
39 | // {label:'my button', |
|
39 | // {label:'my button', | |
40 | // icon:'ui-icon-disk', |
|
40 | // icon:'ui-icon-disk', | |
41 | // callback:function(){alert('hoho'), |
|
41 | // callback:function(){alert('hoho'), | |
@@ -50,7 +50,7 b' var IPython = (function (IPython) {' | |||||
50 | // "my_button_group_id" |
|
50 | // "my_button_group_id" | |
51 | // ) |
|
51 | // ) | |
52 | // |
|
52 | // | |
53 |
ToolBar.prototype.add |
|
53 | ToolBar.prototype.add_button_group = function(list, group_id){ | |
54 | var span_group = $('<span/>'); |
|
54 | var span_group = $('<span/>'); | |
55 | if( group_id != undefined ) |
|
55 | if( group_id != undefined ) | |
56 | span_group.attr('id',group_id) |
|
56 | span_group.attr('id',group_id) |
General Comments 0
You need to be logged in to leave comments.
Login now