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