##// END OF EJS Templates
Merge pull request #3393 from minrk/bootstrap...
Brian E. Granger -
r10974:20c70fc4 merge
parent child Browse files
Show More

The requested changes are too big and content was truncated. Show full diff

@@ -0,0 +1,75 b''
1 //----------------------------------------------------------------------------
2 // Copyright (C) 2013 The IPython Development Team
3 //
4 // Distributed under the terms of the BSD License. The full license is in
5 // the file COPYING, distributed as part of this software.
6 //----------------------------------------------------------------------------
7
8 //============================================================================
9 // Utility for modal dialogs with bootstrap
10 //============================================================================
11
12 IPython.namespace('IPython.dialog');
13
14 IPython.dialog = (function (IPython) {
15
16 var modal = function (options) {
17 var dialog = $("<div/>").addClass("modal").attr("role", "dialog");
18 dialog.append(
19 $("<div/>")
20 .addClass("modal-header")
21 .append($("<button>")
22 .addClass("close")
23 .attr("data-dismiss", "modal")
24 .html("&times;")
25 ).append(
26 $("<h3/>").text(options.title || "")
27 )
28 ).append(
29 $("<div/>").addClass("modal-body").append(
30 options.body || $("<p/>")
31 )
32 );
33
34 var footer = $("<div/>").addClass("modal-footer");
35
36 for (var label in options.buttons) {
37 var btn_opts = options.buttons[label];
38 var button = $("<button/>")
39 .addClass("btn")
40 .attr("data-dismiss", "modal")
41 .text(label);
42 if (btn_opts.click) {
43 button.click($.proxy(btn_opts.click, dialog));
44 }
45 if (btn_opts.class) {
46 button.addClass(btn_opts.class);
47 }
48 footer.append(button);
49 }
50 dialog.append(footer);
51 // hook up on-open event
52 dialog.on("shown", function() {
53 setTimeout(function() {
54 footer.find("button").last().focus();
55 if (options.open) {
56 $.proxy(options.open, dialog)();
57 }
58 }, 0);
59 });
60
61 // destroy dialog on hide, unless explicitly asked not to
62 if (options.destroy == undefined || options.destroy) {
63 dialog.on("hidden", function () {
64 dialog.remove();
65 });
66 }
67
68 return dialog.modal(options);
69 }
70
71 return {
72 modal : modal,
73 };
74
75 }(IPython));
@@ -13,8 +13,7 b''
13 $(document).ready(function () {
13 $(document).ready(function () {
14
14
15 IPython.page = new IPython.Page();
15 IPython.page = new IPython.Page();
16 $('input#login_submit').button();
16 $('button#login_submit').addClass("btn");
17 $('#ipython-main-app').addClass('border-box-sizing ui-widget');
18 IPython.page.show();
17 IPython.page.show();
19 $('input#password_input').focus();
18 $('input#password_input').focus();
20
19
@@ -23,8 +23,7 b' var IPython = (function (IPython) {'
23 };
23 };
24
24
25 LoginWidget.prototype.style = function () {
25 LoginWidget.prototype.style = function () {
26 this.element.find('button#logout').button();
26 this.element.find("button").addClass("btn btn-small");
27 this.element.find('button#login').button();
28 };
27 };
29
28
30
29
@@ -13,7 +13,7 b''
13 $(document).ready(function () {
13 $(document).ready(function () {
14
14
15 IPython.page = new IPython.Page();
15 IPython.page = new IPython.Page();
16 $('#ipython-main-app').addClass('border-box-sizing ui-widget');
16 $('#ipython-main-app').addClass('border-box-sizing');
17 IPython.page.show();
17 IPython.page.show();
18
18
19 });
19 });
@@ -1,1 +1,6 b''
1 // Custom styles for login.html No newline at end of file
1 // Custom styles for login.html
2 .center-nav {
3 display: inline-block;
4 // pull the lower margin back
5 margin-bottom: -4px;
6 } No newline at end of file
@@ -17,12 +17,8 b' var IPython = (function (IPython) {'
17 };
17 };
18
18
19 Page.prototype.style = function () {
19 Page.prototype.style = function () {
20 $('div#header').addClass('border-box-sizing').
20 $('div#header').addClass('border-box-sizing');
21 addClass('ui-widget-content').
21 $('div#site').addClass('border-box-sizing');
22 css('border-top-style','none').
23 css('border-left-style','none').
24 css('border-right-style','none');
25 $('div#site').addClass('border-box-sizing')
26 };
22 };
27
23
28
24
@@ -17,27 +17,19 b' body {'
17 overflow: visible;
17 overflow: visible;
18 }
18 }
19
19
20
21 div#header {
20 div#header {
22 /* Initially hidden to prevent FLOUC */
21 /* Initially hidden to prevent FLOUC */
23 display: none;
22 display: none;
24 position: relative;
25 height: 40px;
26 padding: 5px;
27 margin: 0px;
28 width: 100%;
29 }
23 }
30
24
31 span#ipython_notebook {
25 #ipython_notebook {
32 position: absolute;
26 padding-left: 16px;
33 padding: 2px 2px 2px 5px;
34 }
27 }
35
28
36 span#ipython_notebook img {
29 #ipython_notebook img {
37 font-family: Verdana, "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
30 font-family: Verdana, "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
38 height: 24px;
31 height: 24px;
39 text-decoration:none;
32 text-decoration:none;
40 display: inline;
41 color: black;
33 color: black;
42 }
34 }
43
35
@@ -46,15 +38,6 b' span#ipython_notebook img {'
46 display: none;
38 display: none;
47 }
39 }
48
40
49 /* We set the fonts by hand here to override the values in the theme */
50 .ui-widget {
51 font-family: "Lucinda Grande", "Lucinda Sans Unicode", Helvetica, Arial, Verdana, sans-serif;
52 }
53
54 .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button {
55 font-family: "Lucinda Grande", "Lucinda Sans Unicode", Helvetica, Arial, Verdana, sans-serif;
56 }
57
58 /* Smaller buttons */
41 /* Smaller buttons */
59 .ui-button .ui-button-text {
42 .ui-button .ui-button-text {
60 padding: 0.2em 0.8em;
43 padding: 0.2em 0.8em;
@@ -64,7 +47,27 b' span#ipython_notebook img {'
64 input.ui-button {
47 input.ui-button {
65 padding: 0.3em 0.9em;
48 padding: 0.3em 0.9em;
66 }
49 }
50 .navbar span {
51 margin-top: 3px;
52 }
67
53
68 span#login_widget {
54 span#login_widget {
69 float: right;
55 float: right;
70 }
56 }
57
58 .nav-header {
59 text-transform: none;
60 }
61
62 .navbar-nobg {
63 background-color: transparent;
64 background-image: none;
65 }
66
67 #header > span {
68 margin-top: 10px;
69 }
70
71 .modal-body {
72 max-height: 500px;
73 }
@@ -2,3 +2,5 b''
2 @import "../base/less/mixins.less";
2 @import "../base/less/mixins.less";
3 @import "../base/less/flexbox.less";
3 @import "../base/less/flexbox.less";
4 @import "../base/less/page.less";
4 @import "../base/less/page.less";
5 @import "../components/font-awesome/build/assets/font-awesome/less/font-awesome.less";
6 @FontAwesomePath: "../components/font-awesome/build/assets/font-awesome/font";
@@ -2,9 +2,10 b''
2
2
3 @textColor: @black;
3 @textColor: @black;
4 @baseFontSize: 13px;
4 @baseFontSize: 13px;
5 @baseLineHeight: 1.231;
5 @monoFontFamily: monospace; // to allow user to customize their fonts
6 @monoFontFamily: monospace; // to allow user to customize their fonts
6 @navbarHeight: 36px;
7
7
8 // Our own global variables for all pages go here
8 // Our own global variables for all pages go here
9
9
10 @corner_radius: 4px; No newline at end of file
10 @corner_radius: 4px;
11 @code_line_height: 1.231em;
@@ -3,7 +3,6 b' This is only required when different pages style the same element differently. T'
3 a hack to deal with our current css styles and no new styling should be added in this file.*/
3 a hack to deal with our current css styles and no new styling should be added in this file.*/
4
4
5 #ipython-main-app {
5 #ipython-main-app {
6 width: 100%;
7 position: relative;
6 position: relative;
8 font-size: 110%;
7 font-size: 110%;
9 } No newline at end of file
8 }
@@ -47,40 +47,36 b''
47 lineNumbers: true,
47 lineNumbers: true,
48 matchBrackets: true,
48 matchBrackets: true,
49 });
49 });
50 $(dialogform).dialog({
50 IPython.dialog.modal({
51 autoOpen: true,
51 title: "Edit Cell Metadata",
52 height: 300,
52 body: dialogform,
53 width: 650,
54 modal: true,
55 buttons: {
53 buttons: {
56 "Ok": function() {
54 "OK": { class : "btn-primary",
55 click: function() {
57 //validate json and set it
56 //validate json and set it
58 try {
57 try {
59 var json = JSON.parse(editor.getValue());
58 var json = JSON.parse(editor.getValue());
60 cell.metadata = json;
59 cell.metadata = json;
61 $( this ).dialog( "close" );
60 } catch(e) {
62 }
63 catch(e)
64 {
65 error_div.text('Warning, invalid json, not saved');
61 error_div.text('Warning, invalid json, not saved');
62 return false;
66 }
63 }
67 },
64 }},
68 Cancel: function() {
65 Cancel: {}
69 $( this ).dialog( "close" );
70 }
71 },
72 close: function() {
73 //cleanup on close
74 $(this).remove();
75 }
66 }
76 });
67 });
77 editor.refresh();
68 editor.refresh();
78 }
69 }
79
70
80 var add_raw_edit_button = function(div, cell) {
71 var add_raw_edit_button = function(div, cell) {
81 var button_container = div
72 var button_container = div;
82 var button = $('<div/>').button({label:'Raw Edit'})
73 var button = $('<button/>')
83 .click(function(){raw_edit(cell); return false;})
74 .addClass("btn btn-mini")
75 .text("Raw Edit")
76 .click( function () {
77 raw_edit(cell);
78 return false;
79 });
84 button_container.append(button);
80 button_container.append(button);
85 }
81 }
86
82
@@ -67,6 +67,7 b' var IPython = (function (IPython) {'
67 this.input_prompt_number = null;
67 this.input_prompt_number = null;
68 this.collapsed = false;
68 this.collapsed = false;
69 this.default_mode = 'ipython';
69 this.default_mode = 'ipython';
70 this.cell_type = "code";
70
71
71
72
72 var cm_overwrite_options = {
73 var cm_overwrite_options = {
@@ -47,11 +47,11 b' var IPython = (function (IPython) {'
47
47
48 var pager_height = IPython.pager.percentage_height*app_height;
48 var pager_height = IPython.pager.percentage_height*app_height;
49 var pager_splitter_height = $('div#pager_splitter').outerHeight(true);
49 var pager_splitter_height = $('div#pager_splitter').outerHeight(true);
50 $('div#pager').height(pager_height);
50 $('div#pager').outerHeight(pager_height);
51 if (IPython.pager.expanded) {
51 if (IPython.pager.expanded) {
52 $('div#notebook').height(app_height-pager_height-pager_splitter_height);
52 $('div#notebook').outerHeight(app_height-pager_height-pager_splitter_height);
53 } else {
53 } else {
54 $('div#notebook').height(app_height-pager_splitter_height);
54 $('div#notebook').outerHeight(app_height-pager_splitter_height);
55 }
55 }
56 };
56 };
57
57
@@ -46,8 +46,6 b' function (marked) {'
46 IPython.read_only = $('body').data('readOnly') === 'True';
46 IPython.read_only = $('body').data('readOnly') === 'True';
47 $('#ipython-main-app').addClass('border-box-sizing');
47 $('#ipython-main-app').addClass('border-box-sizing');
48 $('div#notebook_panel').addClass('border-box-sizing');
48 $('div#notebook_panel').addClass('border-box-sizing');
49 // The header's bottom border is provided by the menu bar so we remove it.
50 $('div#header').css('border-bottom-style','none');
51
49
52 var baseProjectUrl = $('body').data('baseProjectUrl')
50 var baseProjectUrl = $('body').data('baseProjectUrl')
53
51
@@ -59,7 +57,7 b' function (marked) {'
59 IPython.notebook = new IPython.Notebook('div#notebook',{baseProjectUrl:baseProjectUrl, read_only:IPython.read_only});
57 IPython.notebook = new IPython.Notebook('div#notebook',{baseProjectUrl:baseProjectUrl, read_only:IPython.read_only});
60 IPython.save_widget = new IPython.SaveWidget('span#save_widget');
58 IPython.save_widget = new IPython.SaveWidget('span#save_widget');
61 IPython.menubar = new IPython.MenuBar('#menubar',{baseProjectUrl:baseProjectUrl})
59 IPython.menubar = new IPython.MenuBar('#menubar',{baseProjectUrl:baseProjectUrl})
62 IPython.toolbar = new IPython.MainToolBar('#maintoolbar')
60 IPython.toolbar = new IPython.MainToolBar('#maintoolbar-container')
63 IPython.tooltip = new IPython.Tooltip()
61 IPython.tooltip = new IPython.Tooltip()
64 IPython.notification_area = new IPython.NotificationArea('#notification_area')
62 IPython.notification_area = new IPython.NotificationArea('#notification_area')
65 IPython.notification_area.init_notification_widgets();
63 IPython.notification_area.init_notification_widgets();
@@ -26,7 +26,7 b' var IPython = (function (IPython) {'
26 {
26 {
27 id : 'save_b',
27 id : 'save_b',
28 label : 'Save and Checkpoint',
28 label : 'Save and Checkpoint',
29 icon : 'ui-icon-disk',
29 icon : 'icon-hdd',
30 callback : function () {
30 callback : function () {
31 IPython.notebook.save_checkpoint();
31 IPython.notebook.save_checkpoint();
32 }
32 }
@@ -36,7 +36,7 b' var IPython = (function (IPython) {'
36 {
36 {
37 id : 'cut_b',
37 id : 'cut_b',
38 label : 'Cut Cell',
38 label : 'Cut Cell',
39 icon : 'ui-icon-scissors',
39 icon : 'icon-cut',
40 callback : function () {
40 callback : function () {
41 IPython.notebook.cut_cell();
41 IPython.notebook.cut_cell();
42 }
42 }
@@ -44,7 +44,7 b' var IPython = (function (IPython) {'
44 {
44 {
45 id : 'copy_b',
45 id : 'copy_b',
46 label : 'Copy Cell',
46 label : 'Copy Cell',
47 icon : 'ui-icon-copy',
47 icon : 'icon-copy',
48 callback : function () {
48 callback : function () {
49 IPython.notebook.copy_cell();
49 IPython.notebook.copy_cell();
50 }
50 }
@@ -52,7 +52,7 b' var IPython = (function (IPython) {'
52 {
52 {
53 id : 'paste_b',
53 id : 'paste_b',
54 label : 'Paste Cell Below',
54 label : 'Paste Cell Below',
55 icon : 'ui-icon-clipboard',
55 icon : 'icon-paste',
56 callback : function () {
56 callback : function () {
57 IPython.notebook.paste_cell_below();
57 IPython.notebook.paste_cell_below();
58 }
58 }
@@ -63,7 +63,7 b' var IPython = (function (IPython) {'
63 {
63 {
64 id : 'move_up_b',
64 id : 'move_up_b',
65 label : 'Move Cell Up',
65 label : 'Move Cell Up',
66 icon : 'ui-icon-arrowthick-1-n',
66 icon : 'icon-arrow-up',
67 callback : function () {
67 callback : function () {
68 IPython.notebook.move_cell_up();
68 IPython.notebook.move_cell_up();
69 }
69 }
@@ -71,7 +71,7 b' var IPython = (function (IPython) {'
71 {
71 {
72 id : 'move_down_b',
72 id : 'move_down_b',
73 label : 'Move Cell Down',
73 label : 'Move Cell Down',
74 icon : 'ui-icon-arrowthick-1-s',
74 icon : 'icon-arrow-down',
75 callback : function () {
75 callback : function () {
76 IPython.notebook.move_cell_down();
76 IPython.notebook.move_cell_down();
77 }
77 }
@@ -82,7 +82,7 b' var IPython = (function (IPython) {'
82 {
82 {
83 id : 'insert_above_b',
83 id : 'insert_above_b',
84 label : 'Insert Cell Above',
84 label : 'Insert Cell Above',
85 icon : 'ui-icon-arrowthickstop-1-n',
85 icon : 'icon-circle-arrow-up',
86 callback : function () {
86 callback : function () {
87 IPython.notebook.insert_cell_above('code');
87 IPython.notebook.insert_cell_above('code');
88 }
88 }
@@ -90,7 +90,7 b' var IPython = (function (IPython) {'
90 {
90 {
91 id : 'insert_below_b',
91 id : 'insert_below_b',
92 label : 'Insert Cell Below',
92 label : 'Insert Cell Below',
93 icon : 'ui-icon-arrowthickstop-1-s',
93 icon : 'icon-circle-arrow-down',
94 callback : function () {
94 callback : function () {
95 IPython.notebook.insert_cell_below('code');
95 IPython.notebook.insert_cell_below('code');
96 }
96 }
@@ -101,7 +101,7 b' var IPython = (function (IPython) {'
101 {
101 {
102 id : 'run_b',
102 id : 'run_b',
103 label : 'Run Cell',
103 label : 'Run Cell',
104 icon : 'ui-icon-play',
104 icon : 'icon-play',
105 callback : function () {
105 callback : function () {
106 IPython.notebook.execute_selected_cell();
106 IPython.notebook.execute_selected_cell();
107 }
107 }
@@ -109,7 +109,7 b' var IPython = (function (IPython) {'
109 {
109 {
110 id : 'interrupt_b',
110 id : 'interrupt_b',
111 label : 'Interrupt',
111 label : 'Interrupt',
112 icon : 'ui-icon-stop',
112 icon : 'icon-stop',
113 callback : function () {
113 callback : function () {
114 IPython.notebook.kernel.interrupt();
114 IPython.notebook.kernel.interrupt();
115 }
115 }
@@ -121,7 +121,7 b' var IPython = (function (IPython) {'
121 this.element
121 this.element
122 .append($('<select/>')
122 .append($('<select/>')
123 .attr('id','cell_type')
123 .attr('id','cell_type')
124 .addClass('ui-widget-content')
124 // .addClass('ui-widget-content')
125 .append($('<option/>').attr('value','code').text('Code'))
125 .append($('<option/>').attr('value','code').text('Code'))
126 .append($('<option/>').attr('value','markdown').text('Markdown'))
126 .append($('<option/>').attr('value','markdown').text('Markdown'))
127 .append($('<option/>').attr('value','raw').text('Raw Text'))
127 .append($('<option/>').attr('value','raw').text('Raw Text'))
@@ -136,9 +136,9 b' var IPython = (function (IPython) {'
136
136
137
137
138 MainToolBar.prototype.add_celltoolbar_list = function () {
138 MainToolBar.prototype.add_celltoolbar_list = function () {
139 var label = $('<label/>').text('Cell Toolbar:');
139 var label = $('<span/>').addClass("navbar-text").text('Cell Toolbar:');
140 var select = $('<select/>')
140 var select = $('<select/>')
141 .addClass('ui-widget-content')
141 // .addClass('ui-widget-content')
142 .attr('id', 'ctb_select')
142 .attr('id', 'ctb_select')
143 .append($('<option/>').attr('value', '').text('None'));
143 .append($('<option/>').attr('value', '').text('None'));
144 this.element.append(label).append(select);
144 this.element.append(label).append(select);
@@ -31,9 +31,9 b' IPython.mathjaxutils = (function (IPython) {'
31 MathJax.Hub.Configured();
31 MathJax.Hub.Configured();
32 } else if (window.mathjax_url != "") {
32 } else if (window.mathjax_url != "") {
33 // Don't have MathJax, but should. Show dialog.
33 // Don't have MathJax, but should. Show dialog.
34 var dialog = $('<div></div>')
34 var message = $('<div/>')
35 .append(
35 .append(
36 $("<p></p>").addClass('dialog').html(
36 $("<p/></p>").addClass('dialog').html(
37 "Math/LaTeX rendering will be disabled."
37 "Math/LaTeX rendering will be disabled."
38 )
38 )
39 ).append(
39 ).append(
@@ -69,11 +69,14 b' IPython.mathjaxutils = (function (IPython) {'
69 $("<p></p>").addClass('dialog').html(
69 $("<p></p>").addClass('dialog').html(
70 "which will prevent this dialog from appearing."
70 "which will prevent this dialog from appearing."
71 )
71 )
72 ).dialog({
72 )
73 title: "Failed to retrieve MathJax from '" + window.mathjax_url + "'",
73 IPython.dialog.modal({
74 width: "70%",
74 title : "Failed to retrieve MathJax from '" + window.mathjax_url + "'",
75 modal: true,
75 body : message,
76 })
76 buttons : {
77 OK : {class: "btn-danger"}
78 }
79 });
77 } else {
80 } else {
78 // No MathJax, but none expected. No dialog.
81 // No MathJax, but none expected. No dialog.
79 };
82 };
@@ -52,15 +52,13 b' var IPython = (function (IPython) {'
52
52
53 MenuBar.prototype.style = function () {
53 MenuBar.prototype.style = function () {
54 this.element.addClass('border-box-sizing');
54 this.element.addClass('border-box-sizing');
55 $('ul#menus').menubar({
55 this.element.find("li").click(function (event, ui) {
56 select : function (event, ui) {
57 // The selected cell loses focus when the menu is entered, so we
56 // The selected cell loses focus when the menu is entered, so we
58 // re-select it upon selection.
57 // re-select it upon selection.
59 var i = IPython.notebook.get_selected_index();
58 var i = IPython.notebook.get_selected_index();
60 IPython.notebook.select(i);
59 IPython.notebook.select(i);
61 }
60 }
62 });
61 );
63 this.element.find("#restore_checkpoint").find("ul").find("li").hide();
64 };
62 };
65
63
66
64
@@ -143,7 +141,8 b' var IPython = (function (IPython) {'
143 IPython.layout_manager.do_resize();
141 IPython.layout_manager.do_resize();
144 });
142 });
145 this.element.find('#toggle_toolbar').click(function () {
143 this.element.find('#toggle_toolbar').click(function () {
146 IPython.toolbar.toggle();
144 $('div#maintoolbar').toggle();
145 IPython.layout_manager.do_resize();
147 });
146 });
148 // Insert
147 // Insert
149 this.element.find('#insert_cell_above').click(function () {
148 this.element.find('#insert_cell_above').click(function () {
@@ -88,13 +88,15 b' var IPython = (function (IPython) {'
88 // ii) to prevent the div from scrolling up when the last cell is being
88 // ii) to prevent the div from scrolling up when the last cell is being
89 // edited, but is too low on the page, which browsers will do automatically.
89 // edited, but is too low on the page, which browsers will do automatically.
90 var that = this;
90 var that = this;
91 var end_space = $('<div/>').addClass('end_space').height("30%");
91 this.container = $("<div/>").addClass("container").attr("id", "notebook-container");
92 var end_space = $('<div/>').addClass('end_space');
92 end_space.dblclick(function (e) {
93 end_space.dblclick(function (e) {
93 if (that.read_only) return;
94 if (that.read_only) return;
94 var ncells = that.ncells();
95 var ncells = that.ncells();
95 that.insert_cell_below('code',ncells-1);
96 that.insert_cell_below('code',ncells-1);
96 });
97 });
97 this.element.append(end_space);
98 this.element.append(this.container);
99 this.container.append(end_space);
98 $('div#notebook').addClass('border-box-sizing');
100 $('div#notebook').addClass('border-box-sizing');
99 };
101 };
100
102
@@ -414,7 +416,7 b' var IPython = (function (IPython) {'
414 * @return {jQuery} A selector of all cell elements
416 * @return {jQuery} A selector of all cell elements
415 */
417 */
416 Notebook.prototype.get_cell_elements = function () {
418 Notebook.prototype.get_cell_elements = function () {
417 return this.element.children("div.cell");
419 return this.container.children("div.cell");
418 };
420 };
419
421
420 /**
422 /**
@@ -1341,21 +1343,18 b' var IPython = (function (IPython) {'
1341 */
1343 */
1342 Notebook.prototype.restart_kernel = function () {
1344 Notebook.prototype.restart_kernel = function () {
1343 var that = this;
1345 var that = this;
1344 var dialog = $('<div/>');
1346 IPython.dialog.modal({
1345 dialog.html('Do you want to restart the current kernel? You will lose all variables defined in it.');
1347 title : "Restart kernel or continue running?",
1346 $(document).append(dialog);
1348 body : $("<p/>").html(
1347 dialog.dialog({
1349 'Do you want to restart the current kernel? You will lose all variables defined in it.'
1348 resizable: false,
1350 ),
1349 modal: true,
1350 title: "Restart kernel or continue running?",
1351 closeText: '',
1352 buttons : {
1351 buttons : {
1353 "Restart": function () {
1352 "Continue running" : {},
1354 that.kernel.restart();
1353 "Restart" : {
1355 $(this).dialog('close');
1354 "class" : "btn-danger",
1356 },
1355 "click" : function() {
1357 "Continue running": function () {
1356 that.kernel.restart();
1358 $(this).dialog('close');
1357 }
1359 }
1358 }
1360 }
1359 }
1361 });
1360 });
@@ -1526,24 +1525,16 b' var IPython = (function (IPython) {'
1526 };
1525 };
1527 };
1526 };
1528 if (data.worksheets.length > 1) {
1527 if (data.worksheets.length > 1) {
1529 var dialog = $('<div/>');
1528 IPython.dialog.modal({
1530 dialog.html("This notebook has " + data.worksheets.length + " worksheets, " +
1529 title : "Multiple worksheets",
1531 "but this version of IPython can only handle the first. " +
1530 body : "This notebook has " + data.worksheets.length + " worksheets, " +
1532 "If you save this notebook, worksheets after the first will be lost."
1531 "but this version of IPython can only handle the first. " +
1533 );
1532 "If you save this notebook, worksheets after the first will be lost.",
1534 this.element.append(dialog);
1535 dialog.dialog({
1536 resizable: false,
1537 modal: true,
1538 title: "Multiple worksheets",
1539 closeText: "",
1540 close: function(event, ui) {$(this).dialog('destroy').remove();},
1541 buttons : {
1533 buttons : {
1542 "OK": function () {
1534 OK : {
1543 $(this).dialog('close');
1535 class : "btn-danger"
1544 }
1536 }
1545 },
1537 }
1546 width: 400
1547 });
1538 });
1548 }
1539 }
1549 };
1540 };
@@ -1722,27 +1713,20 b' var IPython = (function (IPython) {'
1722 this.select(0);
1713 this.select(0);
1723 this.scroll_to_top();
1714 this.scroll_to_top();
1724 if (data.orig_nbformat !== undefined && data.nbformat !== data.orig_nbformat) {
1715 if (data.orig_nbformat !== undefined && data.nbformat !== data.orig_nbformat) {
1725 msg = "This notebook has been converted from an older " +
1716 var msg = "This notebook has been converted from an older " +
1726 "notebook format (v"+data.orig_nbformat+") to the current notebook " +
1717 "notebook format (v"+data.orig_nbformat+") to the current notebook " +
1727 "format (v"+data.nbformat+"). The next time you save this notebook, the " +
1718 "format (v"+data.nbformat+"). The next time you save this notebook, the " +
1728 "newer notebook format will be used and older verions of IPython " +
1719 "newer notebook format will be used and older versions of IPython " +
1729 "may not be able to read it. To keep the older version, close the " +
1720 "may not be able to read it. To keep the older version, close the " +
1730 "notebook without saving it.";
1721 "notebook without saving it.";
1731 var dialog = $('<div/>');
1722 IPython.dialog.modal({
1732 dialog.html(msg);
1723 title : "Notebook converted",
1733 this.element.append(dialog);
1724 body : msg,
1734 dialog.dialog({
1735 resizable: false,
1736 modal: true,
1737 title: "Notebook converted",
1738 closeText: "",
1739 close: function(event, ui) {$(this).dialog('destroy').remove();},
1740 buttons : {
1725 buttons : {
1741 "OK": function () {
1726 OK : {
1742 $(this).dialog('close');
1727 class : "btn-primary"
1743 }
1728 }
1744 },
1729 }
1745 width: 400
1746 });
1730 });
1747 } else if (data.orig_nbformat_minor !== undefined && data.nbformat_minor !== data.orig_nbformat_minor) {
1731 } else if (data.orig_nbformat_minor !== undefined && data.nbformat_minor !== data.orig_nbformat_minor) {
1748 var that = this;
1732 var that = this;
@@ -1752,21 +1736,14 b' var IPython = (function (IPython) {'
1752 this_vs + ". You can still work with this notebook, but some features " +
1736 this_vs + ". You can still work with this notebook, but some features " +
1753 "introduced in later notebook versions may not be available."
1737 "introduced in later notebook versions may not be available."
1754
1738
1755 var dialog = $('<div/>');
1739 IPython.dialog.modal({
1756 dialog.html(msg);
1740 title : "Newer Notebook",
1757 this.element.append(dialog);
1741 body : msg,
1758 dialog.dialog({
1759 resizable: false,
1760 modal: true,
1761 title: "Newer Notebook",
1762 closeText: "",
1763 close: function(event, ui) {$(this).dialog('destroy').remove();},
1764 buttons : {
1742 buttons : {
1765 "OK": function () {
1743 OK : {
1766 $(this).dialog('close');
1744 class : "btn-danger"
1767 }
1745 }
1768 },
1746 }
1769 width: 400
1770 });
1747 });
1771
1748
1772 }
1749 }
@@ -1795,21 +1772,13 b' var IPython = (function (IPython) {'
1795 "this notebook is in a newer format than is supported by this " +
1772 "this notebook is in a newer format than is supported by this " +
1796 "version of IPython. This version can load notebook formats " +
1773 "version of IPython. This version can load notebook formats " +
1797 "v"+this.nbformat+" or earlier.";
1774 "v"+this.nbformat+" or earlier.";
1798 var dialog = $('<div/>');
1775
1799 dialog.html(msg);
1776 IPython.dialog.modal({
1800 this.element.append(dialog);
1801 dialog.dialog({
1802 resizable: false,
1803 modal: true,
1804 title: "Error loading notebook",
1777 title: "Error loading notebook",
1805 closeText: "",
1778 body : msg,
1806 close: function(event, ui) {$(this).dialog('destroy').remove();},
1807 buttons : {
1779 buttons : {
1808 "OK": function () {
1780 "OK": {}
1809 $(this).dialog('close');
1781 }
1810 }
1811 },
1812 width: 400
1813 });
1782 });
1814 }
1783 }
1815 }
1784 }
@@ -1917,7 +1886,7 b' var IPython = (function (IPython) {'
1917 console.log("restore dialog, but no checkpoint to restore to!");
1886 console.log("restore dialog, but no checkpoint to restore to!");
1918 return;
1887 return;
1919 }
1888 }
1920 var dialog = $('<div/>').append(
1889 var body = $('<div/>').append(
1921 $('<p/>').addClass("p-space").text(
1890 $('<p/>').addClass("p-space").text(
1922 "Are you sure you want to revert the notebook to " +
1891 "Are you sure you want to revert the notebook to " +
1923 "the latest checkpoint?"
1892 "the latest checkpoint?"
@@ -1934,23 +1903,18 b' var IPython = (function (IPython) {'
1934 ).css("text-align", "center")
1903 ).css("text-align", "center")
1935 );
1904 );
1936
1905
1937 $(document).append(dialog);
1906 IPython.dialog.modal({
1938
1907 title : "Revert notebook to checkpoint",
1939 dialog.dialog({
1908 body : body,
1940 resizable: false,
1941 modal: true,
1942 title: "Revert notebook to checkpoint",
1943 closeText: '',
1944 buttons : {
1909 buttons : {
1945 "Revert": function () {
1910 Revert : {
1946 that.restore_checkpoint(checkpoint.checkpoint_id);
1911 class : "btn-danger",
1947 $(this).dialog('close');
1912 click : function () {
1913 that.restore_checkpoint(checkpoint.checkpoint_id);
1914 }
1948 },
1915 },
1949 "Cancel": function () {
1916 Cancel : {}
1950 $(this).dialog('close');
1951 }
1917 }
1952 },
1953 width: 400
1954 });
1918 });
1955 }
1919 }
1956
1920
@@ -92,28 +92,24 b' var IPython = (function (IPython) {'
92 });
92 });
93
93
94 $([IPython.events]).on('status_dead.Kernel',function () {
94 $([IPython.events]).on('status_dead.Kernel',function () {
95 var dialog = $('<div/>');
95 var msg = 'The kernel has died, and the automatic restart has failed.' +
96 dialog.html('The kernel has died, and the automatic restart has failed.' +
97 ' It is possible the kernel cannot be restarted.' +
96 ' It is possible the kernel cannot be restarted.' +
98 ' If you are not able to restart the kernel, you will still be able to save' +
97 ' If you are not able to restart the kernel, you will still be able to save' +
99 ' the notebook, but running code will no longer work until the notebook' +
98 ' the notebook, but running code will no longer work until the notebook' +
100 ' is reopened.'
99 ' is reopened.';
101 );
100
102 $(document).append(dialog);
101 IPython.dialog.modal({
103 dialog.dialog({
104 resizable: false,
105 modal: true,
106 title: "Dead kernel",
102 title: "Dead kernel",
107 close: function(event, ui) {$(this).dialog('destroy').remove();},
103 body : msg,
108 buttons : {
104 buttons : {
109 "Manual Restart": function () {
105 "Manual Restart": {
110 $([IPython.events]).trigger('status_restarting.Kernel');
106 class: "btn-danger",
111 IPython.notebook.start_kernel();
107 click: function () {
112 $(this).dialog('close');
108 $([IPython.events]).trigger('status_restarting.Kernel');
109 IPython.notebook.start_kernel();
110 }
113 },
111 },
114 "Don't restart": function () {
112 "Don't restart": {}
115 $(this).dialog('close');
116 }
117 }
113 }
118 });
114 });
119 });
115 });
@@ -134,25 +130,18 b' var IPython = (function (IPython) {'
134 msg = "A WebSocket connection to could not be established." +
130 msg = "A WebSocket connection to could not be established." +
135 " You will NOT be able to run code. Check your" +
131 " You will NOT be able to run code. Check your" +
136 " network connection or notebook server configuration.";
132 " network connection or notebook server configuration.";
137 var dialog = $('<div/>');
133 IPython.dialog.modal({
138 dialog.html(msg);
139 $(document).append(dialog);
140 dialog.dialog({
141 resizable: false,
142 modal: true,
143 title: "WebSocket connection failed",
134 title: "WebSocket connection failed",
144 closeText: "",
135 body: msg,
145 close: function(event, ui) {$(this).dialog('destroy').remove();},
146 buttons : {
136 buttons : {
147 "OK": function () {
137 "OK": {},
148 $(this).dialog('close');
138 "Reconnect": {
149 },
139 click: function () {
150 "Reconnect": function () {
140 knw.set_message('Reconnecting WebSockets', 1000);
151 knw.set_message('Reconnecting WebSockets', 1000);
141 setTimeout(function () {
152 setTimeout(function () {
142 kernel.start_channels();
153 kernel.start_channels();
143 }, 5000);
154 }, 5000);
144 }
155 $(this).dialog('close');
156 }
145 }
157 }
146 }
158 });
147 });
@@ -30,7 +30,7 b' var IPython = (function (IPython) {'
30
30
31
31
32 NotificationWidget.prototype.style = function () {
32 NotificationWidget.prototype.style = function () {
33 this.element.addClass('notification_widget ui-widget ui-widget-content ui-corner-all');
33 this.element.addClass('notification_widget pull-right');
34 this.element.addClass('border-box-sizing');
34 this.element.addClass('border-box-sizing');
35 };
35 };
36
36
@@ -59,8 +59,7 b' var IPython = (function (IPython) {'
59 this.wrapper.addClass('output_wrapper');
59 this.wrapper.addClass('output_wrapper');
60 this.element.addClass('output vbox');
60 this.element.addClass('output vbox');
61
61
62 this.collapse_button.button();
62 this.collapse_button.addClass("btn output_collapsed");
63 this.collapse_button.addClass('output_collapsed vbox');
64 this.collapse_button.attr('title', 'click to expand output');
63 this.collapse_button.attr('title', 'click to expand output');
65 this.collapse_button.html('. . .');
64 this.collapse_button.html('. . .');
66
65
@@ -112,11 +111,6 b' var IPython = (function (IPython) {'
112 this.collapse_button.click(function () {
111 this.collapse_button.click(function () {
113 that.expand();
112 that.expand();
114 });
113 });
115 this.collapse_button.hover(function () {
116 $(this).addClass("ui-state-hover");
117 }, function () {
118 $(this).removeClass("ui-state-hover");
119 });
120 };
114 };
121
115
122
116
@@ -552,7 +546,7 b' var IPython = (function (IPython) {'
552 $("<input/>")
546 $("<input/>")
553 .addClass("raw_input")
547 .addClass("raw_input")
554 .attr('type', 'text')
548 .attr('type', 'text')
555 .attr("size", 80)
549 .attr("size", 47)
556 .keydown(function (event, ui) {
550 .keydown(function (event, ui) {
557 // make sure we submit on enter,
551 // make sure we submit on enter,
558 // and don't re-execute the *cell* on shift-enter
552 // and don't re-execute the *cell* on shift-enter
@@ -564,13 +558,15 b' var IPython = (function (IPython) {'
564 )
558 )
565 );
559 );
566 this.element.append(area);
560 this.element.append(area);
567 area.find("input.raw_input").focus();
561 // weirdly need double-focus now,
562 // otherwise only the cell will be focused
563 area.find("input.raw_input").focus().focus();
568 }
564 }
569 OutputArea.prototype._submit_raw_input = function (evt) {
565 OutputArea.prototype._submit_raw_input = function (evt) {
570 var container = this.element.find("div.raw_input");
566 var container = this.element.find("div.raw_input");
571 var theprompt = container.find("span.input_prompt");
567 var theprompt = container.find("span.input_prompt");
572 var theinput = container.find("input.raw_input");
568 var theinput = container.find("input.raw_input");
573 var value = theinput.attr("value");
569 var value = theinput.val();
574 var content = {
570 var content = {
575 output_type : 'stream',
571 output_type : 'stream',
576 name : 'stdout',
572 name : 'stdout',
@@ -25,7 +25,7 b' var IPython = (function (IPython) {'
25 helper: null ,
25 helper: null ,
26 drag: function(event, ui) {
26 drag: function(event, ui) {
27 // recalculate the amount of space the pager should take
27 // recalculate the amount of space the pager should take
28 var pheight = ($(body).height()-event.clientY-4);
28 var pheight = ($(document.body).height()-event.clientY-4);
29 var downprct = pheight/IPython.layout_manager.app_height();
29 var downprct = pheight/IPython.layout_manager.app_height();
30 downprct = Math.min(0.9, downprct);
30 downprct = Math.min(0.9, downprct);
31 if (downprct < 0.1) {
31 if (downprct < 0.1) {
@@ -70,7 +70,8 b' var IPython = (function (IPython) {'
70
70
71 Pager.prototype.style = function () {
71 Pager.prototype.style = function () {
72 this.pager_splitter_element.addClass('border-box-sizing ui-widget ui-state-default');
72 this.pager_splitter_element.addClass('border-box-sizing ui-widget ui-state-default');
73 this.pager_element.addClass('border-box-sizing ui-widget');
73 this.pager_element.addClass('border-box-sizing');
74 this.pager_element.find(".container").addClass('border-box-sizing');
74 this.pager_splitter_element.attr('title', 'Click to Show/Hide pager area, drag to Resize');
75 this.pager_splitter_element.attr('title', 'Click to Show/Hide pager area, drag to Resize');
75 };
76 };
76
77
@@ -137,7 +138,7 b' var IPython = (function (IPython) {'
137
138
138
139
139 Pager.prototype.clear = function (text) {
140 Pager.prototype.clear = function (text) {
140 this.pager_element.empty();
141 this.pager_element.find(".container").empty();
141 };
142 };
142
143
143 Pager.prototype.detach = function(){
144 Pager.prototype.detach = function(){
@@ -162,7 +163,7 b' var IPython = (function (IPython) {'
162 }
163 }
163
164
164 Pager.prototype.append_text = function (text) {
165 Pager.prototype.append_text = function (text) {
165 this.pager_element.append($('<pre/>').html(utils.fixCarriageReturn(utils.fixConsole(text))));
166 this.pager_element.find(".container").append($('<pre/>').html(utils.fixCarriageReturn(utils.fixConsole(text))));
166 };
167 };
167
168
168
169
@@ -19,12 +19,10 b' var IPython = (function (IPython) {'
19 var that = this;
19 var that = this;
20 if ( this.shortcut_dialog ){
20 if ( this.shortcut_dialog ){
21 // if dialog is already shown, close it
21 // if dialog is already shown, close it
22 this.shortcut_dialog.dialog("close");
22 $(this.shortcut_dialog).modal("toggle");
23 this.shortcut_dialog = null;
24 return;
23 return;
25 }
24 }
26 var dialog = $('<div/>');
25 var body = $('<div/>');
27 this.shortcut_dialog = dialog;
28 var shortcuts = [
26 var shortcuts = [
29 {key: 'Shift-Enter', help: 'run cell'},
27 {key: 'Shift-Enter', help: 'run cell'},
30 {key: 'Ctrl-Enter', help: 'run cell in-place'},
28 {key: 'Ctrl-Enter', help: 'run cell in-place'},
@@ -53,16 +51,19 b' var IPython = (function (IPython) {'
53 {key: 'Ctrl-m h', help: 'show keyboard shortcuts'}
51 {key: 'Ctrl-m h', help: 'show keyboard shortcuts'}
54 ];
52 ];
55 for (var i=0; i<shortcuts.length; i++) {
53 for (var i=0; i<shortcuts.length; i++) {
56 dialog.append($('<div>').
54 body.append($('<div>').
57 append($('<span/>').addClass('shortcut_key').html(shortcuts[i].key)).
55 append($('<span/>').addClass('shortcut_key').html(shortcuts[i].key)).
58 append($('<span/>').addClass('shortcut_descr').html(' : ' + shortcuts[i].help))
56 append($('<span/>').addClass('shortcut_descr').html(' : ' + shortcuts[i].help))
59 );
57 );
60 };
58 };
61 dialog.bind('dialogclose', function(event) {
59 this.shortcut_dialog = IPython.dialog.modal({
62 // dialog has been closed, allow it to be drawn again.
60 title : "Keyboard shortcuts",
63 that.shortcut_dialog = null;
61 body : body,
62 destroy : false,
63 buttons : {
64 Close : {}
65 }
64 });
66 });
65 dialog.dialog({title: 'Keyboard shortcuts', closeText: ''});
66 };
67 };
67
68
68 // Set module variables
69 // Set module variables
@@ -24,12 +24,6 b' var IPython = (function (IPython) {'
24
24
25
25
26 SaveWidget.prototype.style = function () {
26 SaveWidget.prototype.style = function () {
27 this.element.find('span#save_widget').addClass('ui-widget');
28 this.element.find('span#notebook_name').addClass('ui-widget');
29 this.element.find('span#autosave_status').addClass('ui-widget')
30 .css({border: 'none'});
31 this.element.find('span#checkpoint_status').addClass('ui-widget')
32 .css({border: 'none', 'margin-left': '20px'});
33 };
27 };
34
28
35
29
@@ -69,28 +63,26 b' var IPython = (function (IPython) {'
69
63
70 SaveWidget.prototype.rename_notebook = function () {
64 SaveWidget.prototype.rename_notebook = function () {
71 var that = this;
65 var that = this;
72 var dialog = $('<div/>');
66 var dialog = $('<div/>').append(
73 dialog.append(
67 $("<p/>").addClass("rename-message")
74 $('<p/>').html('Enter a new notebook name:')
68 .html('Enter a new notebook name:')
75 .css({'margin-bottom': '10px'})
69 ).append(
76 );
70 $("<br/>")
77 dialog.append(
71 ).append(
78 $('<input/>').attr('type','text').attr('size','25')
72 $('<input/>').attr('type','text').attr('size','25')
79 .addClass('ui-widget ui-widget-content')
73 .val(IPython.notebook.get_notebook_name())
80 .attr('value',IPython.notebook.get_notebook_name())
81 );
74 );
82 // $(document).append(dialog);
75 IPython.dialog.modal({
83 dialog.dialog({
84 resizable: false,
85 modal: true,
86 title: "Rename Notebook",
76 title: "Rename Notebook",
87 closeText: "",
77 body: dialog,
88 close: function(event, ui) {$(this).dialog('destroy').remove();},
89 buttons : {
78 buttons : {
90 "OK": function () {
79 "Cancel": {},
91 var new_name = $(this).find('input').attr('value');
80 "OK": {
81 class: "btn-primary",
82 click: function () {
83 var new_name = $(this).find('input').val();
92 if (!IPython.notebook.test_notebook_name(new_name)) {
84 if (!IPython.notebook.test_notebook_name(new_name)) {
93 $(this).find('h3').html(
85 $(this).find('.rename-message').html(
94 "Invalid notebook name. Notebook names must "+
86 "Invalid notebook name. Notebook names must "+
95 "have 1 or more characters and can contain any characters " +
87 "have 1 or more characters and can contain any characters " +
96 "except :/\\. Please enter a new notebook name:"
88 "except :/\\. Please enter a new notebook name:"
@@ -98,21 +90,18 b' var IPython = (function (IPython) {'
98 } else {
90 } else {
99 IPython.notebook.set_notebook_name(new_name);
91 IPython.notebook.set_notebook_name(new_name);
100 IPython.notebook.save_notebook();
92 IPython.notebook.save_notebook();
101 $(this).dialog('close');
102 }
93 }
94 }}
103 },
95 },
104 "Cancel": function () {
105 $(this).dialog('close');
106 }
107 },
108 open : function (event, ui) {
96 open : function (event, ui) {
109 var that = $(this);
97 var that = $(this);
110 // Upon ENTER, click the OK button.
98 // Upon ENTER, click the OK button.
111 that.find('input[type="text"]').keydown(function (event, ui) {
99 that.find('input[type="text"]').keydown(function (event, ui) {
112 if (event.which === utils.keycodes.ENTER) {
100 if (event.which === utils.keycodes.ENTER) {
113 that.parent().find('button').first().click();
101 that.find('.btn-primary').first().click();
114 }
102 }
115 });
103 });
104 that.find('input[type="text"]').focus();
116 }
105 }
117 });
106 });
118 }
107 }
@@ -39,13 +39,13 b' var IPython = (function (IPython) {'
39 * IPython.toolbar.add_buttons_group([
39 * IPython.toolbar.add_buttons_group([
40 * {
40 * {
41 * label:'my button',
41 * label:'my button',
42 * icon:'ui-icon-disk',
42 * icon:'icon-hdd',
43 * callback:function(){alert('hoho')},
43 * callback:function(){alert('hoho')},
44 * id : 'my_button_id', // this is optional
44 * id : 'my_button_id', // this is optional
45 * },
45 * },
46 * {
46 * {
47 * label:'my second button',
47 * label:'my second button',
48 * icon:'ui-icon-scissors',
48 * icon:'icon-play',
49 * callback:function(){alert('be carefull I cut')}
49 * callback:function(){alert('be carefull I cut')}
50 * }
50 * }
51 * ],
51 * ],
@@ -56,40 +56,37 b' var IPython = (function (IPython) {'
56 * @param list {List}
56 * @param list {List}
57 * List of button of the group, with the following paramter for each :
57 * List of button of the group, with the following paramter for each :
58 * @param list.label {string} text to show on button hover
58 * @param list.label {string} text to show on button hover
59 * @param list.icon {string} icon to choose from [jQuery ThemeRoller](http://jqueryui.com/themeroller/)
59 * @param list.icon {string} icon to choose from [Font Awesome](http://fortawesome.github.io/Font-Awesome)
60 * @param list.callback {function} function to be called on button click
60 * @param list.callback {function} function to be called on button click
61 * @param [list.id] {String} id to give to the button
61 * @param [list.id] {String} id to give to the button
62 * @param [group_id] {String} optionnal id to give to the group
62 * @param [group_id] {String} optionnal id to give to the group
63 *
63 *
64 */
64 */
65 ToolBar.prototype.add_buttons_group = function (list, group_id) {
65 ToolBar.prototype.add_buttons_group = function (list, group_id) {
66 var span_group = $('<span/>');
66 var btn_group = $('<div/>').addClass("btn-group");
67 if( group_id != undefined ) {
67 if( group_id != undefined ) {
68 span_group.attr('id',group_id);
68 btn_group.attr('id',group_id);
69 }
69 }
70 for(var el in list) {
70 for(var el in list) {
71 var button = $('<button/>').button({
71 var button = $('<button/>')
72 icons : {primary : list[el].icon},
72 .addClass('btn')
73 text : false,
73 .attr("title", list[el].label)
74 label : list[el].label
74 .append(
75 });
75 $("<i/>").addClass(list[el].icon)
76 );
76 var id = list[el].id;
77 var id = list[el].id;
77 if( id != undefined )
78 if( id != undefined )
78 button.attr('id',id);
79 button.attr('id',id);
79 var fun = list[el].callback;
80 var fun = list[el].callback;
80 button.click(fun);
81 button.click(fun);
81 span_group.append(button);
82 btn_group.append(button);
82 }
83 }
83 span_group.buttonset();
84 $(this.selector).append(btn_group);
84 $(this.selector).append(span_group);
85 };
85 };
86
86
87 ToolBar.prototype.style = function () {
87 ToolBar.prototype.style = function () {
88 this.element.addClass('border-box-sizing').
88 this.element.addClass('border-box-sizing')
89 addClass('toolbar').
89 .addClass('toolbar');
90 css('border-top-style','none').
91 css('border-left-style','none').
92 css('border-right-style','none');
93 };
90 };
94
91
95 /**
92 /**
@@ -12,7 +12,7 b' div.cell {'
12 width: 100%;
12 width: 100%;
13 padding: 5px 5px 5px 0px;
13 padding: 5px 5px 5px 0px;
14 /* This acts as a spacer between cells, that is outside the border */
14 /* This acts as a spacer between cells, that is outside the border */
15 margin: 2px 0px 2px 0px;
15 margin: 2px 0px 2px 7px;
16 outline: none;
16 outline: none;
17 }
17 }
18
18
@@ -25,5 +25,5 b' div.prompt {'
25 font-family: @monoFontFamily;
25 font-family: @monoFontFamily;
26 text-align: right;
26 text-align: right;
27 /* This has to match that of the the CodeMirror class line-height below */
27 /* This has to match that of the the CodeMirror class line-height below */
28 line-height: @baseLineHeight;
28 line-height: @code_line_height;
29 }
29 }
@@ -9,7 +9,7 b''
9 border-top-left-radius: 3px;
9 border-top-left-radius: 3px;
10 width:100%;
10 width:100%;
11 -webkit-box-pack: end;
11 -webkit-box-pack: end;
12 height:20px;
12 height:22px;
13 }
13 }
14
14
15
15
@@ -25,11 +25,9 b' div.input_prompt {'
25 div.output_wrapper {
25 div.output_wrapper {
26 /* This is a spacer between the input and output of each cell */
26 /* This is a spacer between the input and output of each cell */
27 margin-top: 5px;
27 margin-top: 5px;
28 margin-left: 5px;
29 /* FF needs explicit width to stretch */
30 width: 100%;
31 /* this position must be relative to enable descendents to be absolute within it */
28 /* this position must be relative to enable descendents to be absolute within it */
32 position: relative;
29 position: relative;
30 .vbox()
33 }
31 }
34
32
35 /* class for the output area when it should be height-limited */
33 /* class for the output area when it should be height-limited */
@@ -46,12 +44,14 b' div.output_scroll {'
46
44
47 /* output div while it is collapsed */
45 /* output div while it is collapsed */
48 div.output_collapsed {
46 div.output_collapsed {
49 margin-right: 5px;
47 margin: 0px;
48 padding: 0px;
49 .vbox();
50 }
50 }
51
51
52 div.out_prompt_overlay {
52 div.out_prompt_overlay {
53 height: 100%;
53 height: 100%;
54 padding: 0px;
54 padding: 0px 0.4em;
55 position: absolute;
55 position: absolute;
56 .corner-all;
56 .corner-all;
57 }
57 }
@@ -64,6 +64,4 b' div.out_prompt_overlay:hover {'
64
64
65 div.output_prompt {
65 div.output_prompt {
66 color: darkred;
66 color: darkred;
67 /* 5px right shift to account for margin in parent container */
68 margin: 0 5px 0 -5px;
69 }
67 }
@@ -10,7 +10,7 b''
10 */
10 */
11
11
12 .CodeMirror {
12 .CodeMirror {
13 line-height: @baseLineHeight; /* Changed from 1em to our global default */
13 line-height: @code_line_height; /* Changed from 1em to our global default */
14 height: auto; /* Changed to auto to autogrow */
14 height: auto; /* Changed to auto to autogrow */
15 background: none; /* Changed from white to allow our bg to show through */
15 background: none; /* Changed from white to allow our bg to show through */
16 }
16 }
@@ -1,25 +1,20 b''
1 .ui-menubar-item .ui-button .ui-button-text {
1 #menubar {
2 padding: 0.4em 1.0em;
3 font-size: 100%;
4 }
2 }
5
3
6 .ui-menu {
4 #menubar .navbar-inner {
7 .box-shadow(0px 6px 10px -1px #adadad);
5 min-height: 28px;
6 border-top: 1px;
7 border-radius: 0px 0px @baseBorderRadius @baseBorderRadius;
8 }
8 }
9
9
10 .ui-menu .ui-menu-item a {
10 #menubar .navbar {
11 border: 1px solid transparent;
11 margin-bottom: 8px;
12 padding: 2px 1.6em;
13 }
12 }
14
13
15 .ui-menu .ui-menu-item a.ui-state-focus {
14 .nav-wrapper {
16 margin: 0;
15 border-bottom: 1px solid @navbarBorder;
17 }
16 }
18
17
19 .ui-menu hr {
18 #menubar li.dropdown {
20 margin: 0.3em 0;
19 line-height: 12px;
21 }
20 } No newline at end of file
22
23 #menubar_container {
24 position: relative;
25 }
@@ -18,8 +18,8 b' span#notebook_name {'
18 div#notebook_panel {
18 div#notebook_panel {
19 margin: 0px 0px 0px 0px;
19 margin: 0px 0px 0px 0px;
20 padding: 0px;
20 padding: 0px;
21 .box-shadow(0 -1px 10px rgba(0,0,0,.1));
21 }
22 }
22
23 div#notebook {
23 div#notebook {
24 overflow-y: scroll;
24 overflow-y: scroll;
25 overflow-x: auto;
25 overflow-x: auto;
@@ -27,6 +27,7 b' div#notebook {'
27 /* This spaces the cell away from the edge of the notebook area */
27 /* This spaces the cell away from the edge of the notebook area */
28 padding: 5px 5px 15px 5px;
28 padding: 5px 5px 15px 5px;
29 margin: 0px;
29 margin: 0px;
30 border-top: 1px solid @border_color;
30 }
31 }
31
32
32 div.ui-widget-content {
33 div.ui-widget-content {
@@ -59,3 +60,6 b' p {'
59 margin-bottom:0;
60 margin-bottom:0;
60 }
61 }
61
62
63 .end_space {
64 height: 200px;
65 }
@@ -1,9 +1,3 b''
1 #notification_area {
1 #notification_area {
2 position: absolute;
3 right: 0px;
4 top: 0px;
5 height: 25px;
6 padding: 3px 0px;
7 padding-right: 3px;
8 z-index: 10;
2 z-index: 10;
9 }
3 }
@@ -1,8 +1,10 b''
1 .notification_widget{
1 .notification_widget{
2 float : right;
2 color: @navbarLinkColor;
3 right: 0px;
3 padding: 1px 12px;
4 top: 1px;
4 margin: 2px 4px;
5 height: 25px;
6 padding: 3px 6px;
7 z-index: 10;
5 z-index: 10;
6 border: 1px solid #ccc;
7 border-radius: @corner_radius;
8 background: rgba(240, 240, 240, 0.5);
9
8 }
10 }
@@ -25,6 +25,7 b' div.output_area pre {'
25 the prompt div. */
25 the prompt div. */
26 div.output_subarea {
26 div.output_subarea {
27 padding: 0.44em 0.4em 0.4em 1px;
27 padding: 0.44em 0.4em 0.4em 1px;
28 margin-left: 6px;
28 .box-flex1();
29 .box-flex1();
29 }
30 }
30
31
@@ -37,7 +38,7 b' div.output_text {'
37 color: @textColor;
38 color: @textColor;
38 font-family: @monoFontFamily;
39 font-family: @monoFontFamily;
39 /* This has to match that of the the CodeMirror class line-height below */
40 /* This has to match that of the the CodeMirror class line-height below */
40 line-height: @baseLineHeight;
41 line-height: @code_line_height;
41 }
42 }
42
43
43 /* stdout/stderr are 'text' as well as 'stream', but pyout/pyerr are *not* streams */
44 /* stdout/stderr are 'text' as well as 'stream', but pyout/pyerr are *not* streams */
@@ -2,20 +2,20 b' div#pager_splitter {'
2 height: 8px;
2 height: 8px;
3 }
3 }
4
4
5 #pager_container {
5 #pager-container {
6 position : relative;
6 position: relative;
7 padding: 15px 0px;
7 }
8 }
8
9
9 div#pager {
10 div#pager {
10 padding: 15px;
11 overflow: auto;
11 overflow: auto;
12 display: none;
12 display: none;
13
13
14 pre {
14 pre {
15 font-size: @baseFontSize;
15 font-size: @baseFontSize;
16 line-height: @baseLineHeight;
16 line-height: @code_line_height;
17 color: @textColor;
17 color: @textColor;
18 background-color: @cell_background;
18 background-color: @cell_background;
19 padding: 0.4em;
19 padding: 0.4em;
20 }
20 }
21 }
21 }
@@ -1,9 +1,34 b''
1 span#save_widget {
1 span#save_widget {
2 padding: 5px;
2 padding: 0px 5px;
3 margin: 0px 0px 0px 300px;
3 margin-top: 12px;
4 display:inline-block;
5 }
4 }
6
5
7 span#checkpoint_status span#autosave_status {
6 span#checkpoint_status, span#autosave_status {
8 font-size: small;
7 font-size: small;
9 }
8 }
9
10 @media (max-width: 767px) {
11 span#save_widget {
12 font-size: small;
13 }
14 span#checkpoint_status, span#autosave_status {
15 font-size: x-small;
16 }
17 }
18
19 @media (max-width: 767px) {
20 span#checkpoint_status, span#autosave_status {
21 display: none;
22 }
23 }
24
25 @media (min-width: 768px) and (max-width: 979px) {
26 span#checkpoint_status {
27 display: none;
28 }
29 span#autosave_status {
30 font-size: x-small;
31 }
32 }
33
34 No newline at end of file
@@ -1,26 +1,34 b''
1 .toolbar {
1 .toolbar {
2 padding: 3px 15px;
2 padding: 0px 10px;
3 border-bottom: @border_width @border_color solid;
3 margin-top: -5px;
4
5 button {
6 margin-top:2px;
7 margin-bottom:2px;
8 }
9
10
4
11 select, label {
5 select, label {
12 height : 19px;
6 width: auto;
7 height: @baseLineHeight + 6px;
13 vertical-align:middle;
8 vertical-align:middle;
14 margin-right:2px;
9 margin-right:2px;
15 margin-bottom:0;
10 margin-bottom:0px;
16 display: inline;
11 display: inline;
17 font-size: 92%;
12 font-size: 92%;
18 margin-left:0.3em;
13 margin-left:0.3em;
19 margin-right:0.3em;
14 margin-right:0.3em;
20 padding: 0px;
15 padding: 0px;
16 padding-top: 3px;
17 }
18 .btn {
19 padding: 2px 8px;
21 }
20 }
22 }
21 }
23
22
24 .toolbar select{
23 .toolbar .btn-group {
25 width:auto;
24 margin-top: 0px;
26 }
25 }
26
27 .toolbar-inner {
28 border: none !important;
29 .box-shadow(none) !important;
30 }
31
32 #maintoolbar {
33 margin-bottom: 0px;
34 } No newline at end of file
@@ -1,5 +1,6 b''
1 // Bootstrap
1 // Bootstrap
2 @import "../components/bootstrap/less/bootstrap.less";
2 @import "../components/bootstrap/less/bootstrap.less";
3 @import "../components/bootstrap/less/responsive.less";
3
4
4 // base
5 // base
5 @import "../base/less/style.less";
6 @import "../base/less/style.less";
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now