Show More
@@ -33,7 +33,7 b'' | |||||
33 | } else if (value === 'dialog'){ |
|
33 | } else if (value === 'dialog'){ | |
34 | var dialog = $('<div/>').append( |
|
34 | var dialog = $('<div/>').append( | |
35 | $("<p/>") |
|
35 | $("<p/>") | |
36 |
. |
|
36 | .text("Set the MIME type of the raw cell:") | |
37 | ).append( |
|
37 | ).append( | |
38 | $("<br/>") |
|
38 | $("<br/>") | |
39 | ).append( |
|
39 | ).append( |
@@ -38,40 +38,40 b' IPython.mathjaxutils = (function (IPython) {' | |||||
38 | // Don't have MathJax, but should. Show dialog. |
|
38 | // Don't have MathJax, but should. Show dialog. | |
39 | var message = $('<div/>') |
|
39 | var message = $('<div/>') | |
40 | .append( |
|
40 | .append( | |
41 |
$("<p/></p>").addClass('dialog'). |
|
41 | $("<p/></p>").addClass('dialog').text( | |
42 | "Math/LaTeX rendering will be disabled." |
|
42 | "Math/LaTeX rendering will be disabled." | |
43 | ) |
|
43 | ) | |
44 | ).append( |
|
44 | ).append( | |
45 |
$("<p></p>").addClass('dialog'). |
|
45 | $("<p></p>").addClass('dialog').text( | |
46 | "If you have administrative access to the notebook server and" + |
|
46 | "If you have administrative access to the notebook server and" + | |
47 | " a working internet connection, you can install a local copy" + |
|
47 | " a working internet connection, you can install a local copy" + | |
48 | " of MathJax for offline use with the following command on the server" + |
|
48 | " of MathJax for offline use with the following command on the server" + | |
49 | " at a Python or IPython prompt:" |
|
49 | " at a Python or IPython prompt:" | |
50 | ) |
|
50 | ) | |
51 | ).append( |
|
51 | ).append( | |
52 |
$("<pre></pre>").addClass('dialog'). |
|
52 | $("<pre></pre>").addClass('dialog').text( | |
53 | ">>> from IPython.external import mathjax; mathjax.install_mathjax()" |
|
53 | ">>> from IPython.external import mathjax; mathjax.install_mathjax()" | |
54 | ) |
|
54 | ) | |
55 | ).append( |
|
55 | ).append( | |
56 |
$("<p></p>").addClass('dialog'). |
|
56 | $("<p></p>").addClass('dialog').text( | |
57 | "This will try to install MathJax into the IPython source directory." |
|
57 | "This will try to install MathJax into the IPython source directory." | |
58 | ) |
|
58 | ) | |
59 | ).append( |
|
59 | ).append( | |
60 |
$("<p></p>").addClass('dialog'). |
|
60 | $("<p></p>").addClass('dialog').text( | |
61 | "If IPython is installed to a location that requires" + |
|
61 | "If IPython is installed to a location that requires" + | |
62 | " administrative privileges to write, you will need to make this call as" + |
|
62 | " administrative privileges to write, you will need to make this call as" + | |
63 | " an administrator, via 'sudo'." |
|
63 | " an administrator, via 'sudo'." | |
64 | ) |
|
64 | ) | |
65 | ).append( |
|
65 | ).append( | |
66 |
$("<p></p>").addClass('dialog'). |
|
66 | $("<p></p>").addClass('dialog').text( | |
67 | "When you start the notebook server, you can instruct it to disable MathJax support altogether:" |
|
67 | "When you start the notebook server, you can instruct it to disable MathJax support altogether:" | |
68 | ) |
|
68 | ) | |
69 | ).append( |
|
69 | ).append( | |
70 |
$("<pre></pre>").addClass('dialog'). |
|
70 | $("<pre></pre>").addClass('dialog').text( | |
71 | "$ ipython notebook --no-mathjax" |
|
71 | "$ ipython notebook --no-mathjax" | |
72 | ) |
|
72 | ) | |
73 | ).append( |
|
73 | ).append( | |
74 |
$("<p></p>").addClass('dialog'). |
|
74 | $("<p></p>").addClass('dialog').text( | |
75 | "which will prevent this dialog from appearing." |
|
75 | "which will prevent this dialog from appearing." | |
76 | ) |
|
76 | ) | |
77 | ); |
|
77 | ); |
@@ -1318,7 +1318,7 b' var IPython = (function (IPython) {' | |||||
1318 | var that = this; |
|
1318 | var that = this; | |
1319 | IPython.dialog.modal({ |
|
1319 | IPython.dialog.modal({ | |
1320 | title : "Restart kernel or continue running?", |
|
1320 | title : "Restart kernel or continue running?", | |
1321 |
body : $("<p/>"). |
|
1321 | body : $("<p/>").text( | |
1322 | 'Do you want to restart the current kernel? You will lose all variables defined in it.' |
|
1322 | 'Do you want to restart the current kernel? You will lose all variables defined in it.' | |
1323 | ), |
|
1323 | ), | |
1324 | buttons : { |
|
1324 | buttons : { | |
@@ -1781,7 +1781,7 b' var IPython = (function (IPython) {' | |||||
1781 | var that = this; |
|
1781 | var that = this; | |
1782 | var dialog = $('<div/>').append( |
|
1782 | var dialog = $('<div/>').append( | |
1783 | $("<p/>").addClass("rename-message") |
|
1783 | $("<p/>").addClass("rename-message") | |
1784 |
. |
|
1784 | .text('This notebook name already exists.') | |
1785 | ) |
|
1785 | ) | |
1786 | $([IPython.events]).trigger('notebook_rename_failed.Notebook', [xhr, status, error]); |
|
1786 | $([IPython.events]).trigger('notebook_rename_failed.Notebook', [xhr, status, error]); | |
1787 | IPython.dialog.modal({ |
|
1787 | IPython.dialog.modal({ |
@@ -43,7 +43,7 b' var IPython = (function (IPython) {' | |||||
43 | NotificationWidget.prototype.set_message = function (msg, timeout, click_callback) { |
|
43 | NotificationWidget.prototype.set_message = function (msg, timeout, click_callback) { | |
44 | var callback = click_callback || function() {return false;}; |
|
44 | var callback = click_callback || function() {return false;}; | |
45 | var that = this; |
|
45 | var that = this; | |
46 |
this.element. |
|
46 | this.element.text(msg); | |
47 | this.element.fadeIn(100); |
|
47 | this.element.fadeIn(100); | |
48 | if (this.timeout !== null) { |
|
48 | if (this.timeout !== null) { | |
49 | clearTimeout(this.timeout); |
|
49 | clearTimeout(this.timeout); | |
@@ -51,13 +51,13 b' var IPython = (function (IPython) {' | |||||
51 | } |
|
51 | } | |
52 | if (timeout !== undefined && timeout >=0) { |
|
52 | if (timeout !== undefined && timeout >=0) { | |
53 | this.timeout = setTimeout(function () { |
|
53 | this.timeout = setTimeout(function () { | |
54 |
that.element.fadeOut(100, function () {that.element. |
|
54 | that.element.fadeOut(100, function () {that.element.text('');}); | |
55 | that.timeout = null; |
|
55 | that.timeout = null; | |
56 | }, timeout); |
|
56 | }, timeout); | |
57 | } else { |
|
57 | } else { | |
58 | this.element.click(function() { |
|
58 | this.element.click(function() { | |
59 | if( callback() != false ) { |
|
59 | if( callback() != false ) { | |
60 |
that.element.fadeOut(100, function () {that.element. |
|
60 | that.element.fadeOut(100, function () {that.element.text('');}); | |
61 | that.element.unbind('click'); |
|
61 | that.element.unbind('click'); | |
62 | } |
|
62 | } | |
63 | if (that.timeout !== undefined) { |
|
63 | if (that.timeout !== undefined) { |
@@ -61,7 +61,7 b' var IPython = (function (IPython) {' | |||||
61 |
|
61 | |||
62 | this.collapse_button.addClass("btn output_collapsed"); |
|
62 | this.collapse_button.addClass("btn output_collapsed"); | |
63 | this.collapse_button.attr('title', 'click to expand output'); |
|
63 | this.collapse_button.attr('title', 'click to expand output'); | |
64 |
this.collapse_button. |
|
64 | this.collapse_button.text('. . .'); | |
65 |
|
65 | |||
66 | this.prompt_overlay.addClass('out_prompt_overlay prompt'); |
|
66 | this.prompt_overlay.addClass('out_prompt_overlay prompt'); | |
67 | this.prompt_overlay.attr('title', 'click to expand output; double click to hide output'); |
|
67 | this.prompt_overlay.attr('title', 'click to expand output; double click to hide output'); | |
@@ -442,7 +442,7 b' var IPython = (function (IPython) {' | |||||
442 | var n = json.prompt_number || ' '; |
|
442 | var n = json.prompt_number || ' '; | |
443 | var toinsert = this.create_output_area(); |
|
443 | var toinsert = this.create_output_area(); | |
444 | if (this.prompt_area) { |
|
444 | if (this.prompt_area) { | |
445 |
toinsert.find('div.prompt').addClass('output_prompt'). |
|
445 | toinsert.find('div.prompt').addClass('output_prompt').text('Out[' + n + ']:'); | |
446 | } |
|
446 | } | |
447 | this.append_mime_type(json, toinsert); |
|
447 | this.append_mime_type(json, toinsert); | |
448 | this._safe_append(toinsert); |
|
448 | this._safe_append(toinsert); |
@@ -32,7 +32,7 b' var IPython = (function (IPython) {' | |||||
32 | // The documentation |
|
32 | // The documentation | |
33 | var doc = $('<div/>').addClass('alert'); |
|
33 | var doc = $('<div/>').addClass('alert'); | |
34 | doc.append( |
|
34 | doc.append( | |
35 | $('<button/>').addClass('close').attr('data-dismiss','alert').html('×') |
|
35 | $('<button/>').addClass('close').attr('data-dismiss','alert').html('×') | |
36 | ).append( |
|
36 | ).append( | |
37 | 'The IPython Notebook has two different keyboard input modes. <b>Edit mode</b> '+ |
|
37 | 'The IPython Notebook has two different keyboard input modes. <b>Edit mode</b> '+ | |
38 | 'allow you the type code/text into a cell and is indicated by a green cell '+ |
|
38 | 'allow you the type code/text into a cell and is indicated by a green cell '+ | |
@@ -75,16 +75,16 b' var IPython = (function (IPython) {' | |||||
75 | help = command_shortcuts[i]['help']; |
|
75 | help = command_shortcuts[i]['help']; | |
76 | shortcut = command_shortcuts[i]['shortcut']; |
|
76 | shortcut = command_shortcuts[i]['shortcut']; | |
77 | cmd_col1.append($('<div>').addClass('quickhelp'). |
|
77 | cmd_col1.append($('<div>').addClass('quickhelp'). | |
78 |
append($('<span/>').addClass('shortcut_key'). |
|
78 | append($('<span/>').addClass('shortcut_key').text(shortcut)). | |
79 |
append($('<span/>').addClass('shortcut_descr'). |
|
79 | append($('<span/>').addClass('shortcut_descr').text(' : ' + help)) | |
80 | ); |
|
80 | ); | |
81 | }; |
|
81 | }; | |
82 | for (i=half; i<n; i++) { |
|
82 | for (i=half; i<n; i++) { | |
83 | help = command_shortcuts[i]['help']; |
|
83 | help = command_shortcuts[i]['help']; | |
84 | shortcut = command_shortcuts[i]['shortcut']; |
|
84 | shortcut = command_shortcuts[i]['shortcut']; | |
85 | cmd_col2.append($('<div>').addClass('quickhelp'). |
|
85 | cmd_col2.append($('<div>').addClass('quickhelp'). | |
86 |
append($('<span/>').addClass('shortcut_key'). |
|
86 | append($('<span/>').addClass('shortcut_key').text(shortcut)). | |
87 |
append($('<span/>').addClass('shortcut_descr'). |
|
87 | append($('<span/>').addClass('shortcut_descr').text(' : ' + help)) | |
88 | ); |
|
88 | ); | |
89 | }; |
|
89 | }; | |
90 | cmd_sub_div.append(cmd_col1).append(cmd_col2); |
|
90 | cmd_sub_div.append(cmd_col1).append(cmd_col2); | |
@@ -108,16 +108,16 b' var IPython = (function (IPython) {' | |||||
108 | help = edit_shortcuts[i]['help']; |
|
108 | help = edit_shortcuts[i]['help']; | |
109 | shortcut = edit_shortcuts[i]['shortcut']; |
|
109 | shortcut = edit_shortcuts[i]['shortcut']; | |
110 | edit_col1.append($('<div>').addClass('quickhelp'). |
|
110 | edit_col1.append($('<div>').addClass('quickhelp'). | |
111 |
append($('<span/>').addClass('shortcut_key'). |
|
111 | append($('<span/>').addClass('shortcut_key').text(shortcut)). | |
112 |
append($('<span/>').addClass('shortcut_descr'). |
|
112 | append($('<span/>').addClass('shortcut_descr').text(' : ' + help)) | |
113 | ); |
|
113 | ); | |
114 | }; |
|
114 | }; | |
115 | for (i=half; i<n; i++) { |
|
115 | for (i=half; i<n; i++) { | |
116 | help = edit_shortcuts[i]['help']; |
|
116 | help = edit_shortcuts[i]['help']; | |
117 | shortcut = edit_shortcuts[i]['shortcut']; |
|
117 | shortcut = edit_shortcuts[i]['shortcut']; | |
118 | edit_col2.append($('<div>').addClass('quickhelp'). |
|
118 | edit_col2.append($('<div>').addClass('quickhelp'). | |
119 |
append($('<span/>').addClass('shortcut_key'). |
|
119 | append($('<span/>').addClass('shortcut_key').text(shortcut)). | |
120 |
append($('<span/>').addClass('shortcut_descr'). |
|
120 | append($('<span/>').addClass('shortcut_descr').text(' : ' + help)) | |
121 | ); |
|
121 | ); | |
122 | }; |
|
122 | }; | |
123 | edit_sub_div.append(edit_col1).append(edit_col2); |
|
123 | edit_sub_div.append(edit_col1).append(edit_col2); |
@@ -71,7 +71,7 b' var IPython = (function (IPython) {' | |||||
71 | var that = this; |
|
71 | var that = this; | |
72 | var dialog = $('<div/>').append( |
|
72 | var dialog = $('<div/>').append( | |
73 | $("<p/>").addClass("rename-message") |
|
73 | $("<p/>").addClass("rename-message") | |
74 |
. |
|
74 | .text('Enter a new notebook name:') | |
75 | ).append( |
|
75 | ).append( | |
76 | $("<br/>") |
|
76 | $("<br/>") | |
77 | ).append( |
|
77 | ).append( | |
@@ -88,7 +88,7 b' var IPython = (function (IPython) {' | |||||
88 | click: function () { |
|
88 | click: function () { | |
89 | var new_name = $(this).find('input').val(); |
|
89 | var new_name = $(this).find('input').val(); | |
90 | if (!IPython.notebook.test_notebook_name(new_name)) { |
|
90 | if (!IPython.notebook.test_notebook_name(new_name)) { | |
91 |
$(this).find('.rename-message'). |
|
91 | $(this).find('.rename-message').text( | |
92 | "Invalid notebook name. Notebook names must "+ |
|
92 | "Invalid notebook name. Notebook names must "+ | |
93 | "have 1 or more characters and can contain any characters " + |
|
93 | "have 1 or more characters and can contain any characters " + | |
94 | "except :/\\. Please enter a new notebook name:" |
|
94 | "except :/\\. Please enter a new notebook name:" | |
@@ -116,7 +116,7 b' var IPython = (function (IPython) {' | |||||
116 |
|
116 | |||
117 | SaveWidget.prototype.update_notebook_name = function () { |
|
117 | SaveWidget.prototype.update_notebook_name = function () { | |
118 | var nbname = IPython.notebook.get_notebook_name(); |
|
118 | var nbname = IPython.notebook.get_notebook_name(); | |
119 |
this.element.find('span#notebook_name'). |
|
119 | this.element.find('span#notebook_name').text(nbname); | |
120 | }; |
|
120 | }; | |
121 |
|
121 | |||
122 |
|
122 | |||
@@ -138,11 +138,11 b' var IPython = (function (IPython) {' | |||||
138 |
|
138 | |||
139 |
|
139 | |||
140 | SaveWidget.prototype.set_save_status = function (msg) { |
|
140 | SaveWidget.prototype.set_save_status = function (msg) { | |
141 |
this.element.find('span#autosave_status'). |
|
141 | this.element.find('span#autosave_status').text(msg); | |
142 | } |
|
142 | } | |
143 |
|
143 | |||
144 | SaveWidget.prototype.set_checkpoint_status = function (msg) { |
|
144 | SaveWidget.prototype.set_checkpoint_status = function (msg) { | |
145 |
this.element.find('span#checkpoint_status'). |
|
145 | this.element.find('span#checkpoint_status').text(msg); | |
146 | } |
|
146 | } | |
147 |
|
147 | |||
148 | SaveWidget.prototype.set_last_checkpoint = function (checkpoint) { |
|
148 | SaveWidget.prototype.set_last_checkpoint = function (checkpoint) { |
@@ -101,7 +101,7 b' var IPython = (function (IPython) {' | |||||
101 | ClusterItem.prototype.state_stopped = function () { |
|
101 | ClusterItem.prototype.state_stopped = function () { | |
102 | var that = this; |
|
102 | var that = this; | |
103 | var profile_col = $('<span/>').addClass('profile_col span4').text(this.data.profile); |
|
103 | var profile_col = $('<span/>').addClass('profile_col span4').text(this.data.profile); | |
104 |
var status_col = $('<span/>').addClass('status_col span3'). |
|
104 | var status_col = $('<span/>').addClass('status_col span3').text('stopped'); | |
105 | var engines_col = $('<span/>').addClass('engine_col span3'); |
|
105 | var engines_col = $('<span/>').addClass('engine_col span3'); | |
106 | var input = $('<input/>').attr('type','number') |
|
106 | var input = $('<input/>').attr('type','number') | |
107 | .attr('min',1) |
|
107 | .attr('min',1) | |
@@ -122,7 +122,7 b' var IPython = (function (IPython) {' | |||||
122 | start_button.click(function (e) { |
|
122 | start_button.click(function (e) { | |
123 | var n = that.element.find('.engine_num_input').val(); |
|
123 | var n = that.element.find('.engine_num_input').val(); | |
124 | if (!/^\d+$/.test(n) && n.length>0) { |
|
124 | if (!/^\d+$/.test(n) && n.length>0) { | |
125 |
status_col. |
|
125 | status_col.text('invalid engine #'); | |
126 | } else { |
|
126 | } else { | |
127 | var settings = { |
|
127 | var settings = { | |
128 | cache : false, |
|
128 | cache : false, | |
@@ -133,10 +133,10 b' var IPython = (function (IPython) {' | |||||
133 | that.update_state(data); |
|
133 | that.update_state(data); | |
134 | }, |
|
134 | }, | |
135 | error : function (data, status, xhr) { |
|
135 | error : function (data, status, xhr) { | |
136 |
status_col. |
|
136 | status_col.text("error starting cluster"); | |
137 | } |
|
137 | } | |
138 | }; |
|
138 | }; | |
139 |
status_col. |
|
139 | status_col.text('starting'); | |
140 | var url = utils.url_join_encode( |
|
140 | var url = utils.url_join_encode( | |
141 | that.baseProjectUrl(), |
|
141 | that.baseProjectUrl(), | |
142 | 'clusters', |
|
142 | 'clusters', | |
@@ -152,8 +152,8 b' var IPython = (function (IPython) {' | |||||
152 | ClusterItem.prototype.state_running = function () { |
|
152 | ClusterItem.prototype.state_running = function () { | |
153 | var that = this; |
|
153 | var that = this; | |
154 | var profile_col = $('<span/>').addClass('profile_col span4').text(this.data.profile); |
|
154 | var profile_col = $('<span/>').addClass('profile_col span4').text(this.data.profile); | |
155 |
var status_col = $('<span/>').addClass('status_col span3'). |
|
155 | var status_col = $('<span/>').addClass('status_col span3').text('running'); | |
156 |
var engines_col = $('<span/>').addClass('engines_col span3'). |
|
156 | var engines_col = $('<span/>').addClass('engines_col span3').text(this.data.n); | |
157 | var stop_button = $('<button/>').addClass("btn btn-mini").text("Stop"); |
|
157 | var stop_button = $('<button/>').addClass("btn btn-mini").text("Stop"); | |
158 | var action_col = $('<span/>').addClass('action_col span2').append( |
|
158 | var action_col = $('<span/>').addClass('action_col span2').append( | |
159 | $("<span/>").addClass("item_buttons btn-group").append( |
|
159 | $("<span/>").addClass("item_buttons btn-group").append( | |
@@ -175,10 +175,10 b' var IPython = (function (IPython) {' | |||||
175 | }, |
|
175 | }, | |
176 | error : function (data, status, xhr) { |
|
176 | error : function (data, status, xhr) { | |
177 | console.log('error',data); |
|
177 | console.log('error',data); | |
178 |
status_col. |
|
178 | status_col.text("error stopping cluster"); | |
179 | } |
|
179 | } | |
180 | }; |
|
180 | }; | |
181 |
status_col. |
|
181 | status_col.text('stopping'); | |
182 | var url = utils.url_join_encode( |
|
182 | var url = utils.url_join_encode( | |
183 | that.baseProjectUrl(), |
|
183 | that.baseProjectUrl(), | |
184 | 'clusters', |
|
184 | 'clusters', |
@@ -263,7 +263,7 b' var IPython = (function (IPython) {' | |||||
263 | return false; |
|
263 | return false; | |
264 | }); |
|
264 | }); | |
265 | // var new_buttons = item.find('a'); // shutdown_button; |
|
265 | // var new_buttons = item.find('a'); // shutdown_button; | |
266 |
item.find(".item_buttons"). |
|
266 | item.find(".item_buttons").text("").append(shutdown_button); | |
267 | }; |
|
267 | }; | |
268 |
|
268 | |||
269 | NotebookList.prototype.add_delete_button = function (item) { |
|
269 | NotebookList.prototype.add_delete_button = function (item) { | |
@@ -308,7 +308,7 b' var IPython = (function (IPython) {' | |||||
308 | }); |
|
308 | }); | |
309 | return false; |
|
309 | return false; | |
310 | }); |
|
310 | }); | |
311 |
item.find(".item_buttons"). |
|
311 | item.find(".item_buttons").text("").append(delete_button); | |
312 | }; |
|
312 | }; | |
313 |
|
313 | |||
314 |
|
314 |
General Comments 0
You need to be logged in to leave comments.
Login now