Matthias BUSSONNIER 14 years ago
parent 2b26c6a7d4
commit c2cf3a07dd

@ -41,7 +41,7 @@ var IPython = (function (IPython) {
.append($('<option/>').attr('value','heading7').text('Heading 7'))
.append($('<option/>').attr('value','heading8').text('Heading 8'))
);
}
};
MainToolBar.prototype.construct = function() {
this.add_buttons_group([
@ -51,8 +51,8 @@ var IPython = (function (IPython) {
icon:'ui-icon-disk',
callback:function(){
IPython.notebook.save_notebook();
},
},
}
}
]);
this.add_buttons_group([
{
@ -61,7 +61,7 @@ var IPython = (function (IPython) {
icon:'ui-icon-scissors',
callback:function(){
IPython.notebook.cut_cell();
},
}
},
{
id:'copy_b',
@ -69,7 +69,7 @@ var IPython = (function (IPython) {
icon:'ui-icon-copy',
callback:function(){
IPython.notebook.copy_cell();
},
}
},
{
id:'paste_b',
@ -77,8 +77,8 @@ var IPython = (function (IPython) {
icon:'ui-icon-clipboard',
callback:function(){
IPython.notebook.paste_cell();
},
},
}
}
],'cut_copy_paste');
this.add_buttons_group([
@ -88,7 +88,7 @@ var IPython = (function (IPython) {
icon:'ui-icon-arrowthick-1-n',
callback:function(){
IPython.notebook.move_cell_up();
},
}
},
{
id:'move_down_b',
@ -96,8 +96,8 @@ var IPython = (function (IPython) {
icon:'ui-icon-arrowthick-1-s',
callback:function(){
IPython.notebook.move_cell_down();
},
},
}
}
],'move_up_down');
this.add_buttons_group([
@ -107,7 +107,7 @@ var IPython = (function (IPython) {
icon:'ui-icon-arrowthickstop-1-n',
callback:function(){
IPython.notebook.insert_cell_above('code');
},
}
},
{
id:'insert_below_b',
@ -115,8 +115,8 @@ var IPython = (function (IPython) {
icon:'ui-icon-arrowthickstop-1-s',
callback:function(){
IPython.notebook.insert_cell_below('code');
},
},
}
}
],'insert_above_below');
this.add_buttons_group([
@ -126,7 +126,7 @@ var IPython = (function (IPython) {
icon:'ui-icon-play',
callback:function(){
IPython.notebook.execute_selected_cell();
},
}
},
{
id:'interrupt_b',
@ -134,12 +134,12 @@ var IPython = (function (IPython) {
icon:'ui-icon-stop',
callback:function(){
IPython.notebook.kernel.interrupt();
},
},
}
}
],'run_int');
}
};
MainToolBar.prototype.bind_events = function () {
var that = this;
@ -164,7 +164,7 @@ var IPython = (function (IPython) {
IPython.notebook.to_heading(undefined, 5);
} else if (cell_type === 'heading6') {
IPython.notebook.to_heading(undefined, 6);
};
}
});
$([IPython.events]).on('selected_cell_type_changed.Notebook', function (event, data) {
if (data.cell_type === 'heading') {

@ -52,14 +52,14 @@ var IPython = (function (IPython) {
//
ToolBar.prototype.add_button_group = function(list, group_id){
var span_group = $('<span/>');
if( group_id != undefined )
span_group.attr('id',group_id)
for(var el in list)
{
if( group_id != undefined ) {
span_group.attr('id',group_id);
}
for(var el in list) {
var button = $('<button/>').button({
icons : {primary: list[el].icon},
text : false,
label: list[el].label,
label: list[el].label
});
var id = list[el].id;
if( id != undefined )
@ -69,8 +69,8 @@ var IPython = (function (IPython) {
span_group.append(button);
}
span_group.buttonset();
$(this.selector).append(span_group)
}
$(this.selector).append(span_group);
};
ToolBar.prototype.style = function () {
this.element.addClass('border-box-sizing').

Loading…
Cancel
Save