notebook_main.js
47 lines
| 1.7 KiB
| application/javascript
|
JavascriptLexer
Brian E. Granger
|
r4349 | |||
//============================================================================ | ||||
// On document ready | ||||
//============================================================================ | ||||
$(document).ready(function () { | ||||
MathJax.Hub.Config({ | ||||
tex2jax: { | ||||
inlineMath: [ ['$','$'], ["\\(","\\)"] ], | ||||
displayMath: [ ['$$','$$'], ["\\[","\\]"] ], | ||||
}, | ||||
displayAlign: 'left', // Change this to 'center' to center equations. | ||||
"HTML-CSS": { | ||||
styles: {'.MathJax_Display': {"margin": 0}} | ||||
} | ||||
}); | ||||
Brian E. Granger
|
r4372 | $('div#header').addClass('border-box-sizing'); | ||
Brian E. Granger
|
r4363 | $('div#notebook_app').addClass('border-box-sizing ui-widget ui-widget-content'); | ||
$('div#notebook_panel').addClass('border-box-sizing ui-widget'); | ||||
Brian E. Granger
|
r4349 | |||
Brian E. Granger
|
r4363 | IPython.layout_manager = new IPython.LayoutManager(); | ||
Brian E. Granger
|
r4357 | IPython.pager = new IPython.Pager('div#pager', 'div#pager_splitter'); | ||
Brian E. Granger
|
r4363 | IPython.left_panel = new IPython.LeftPanel('div#left_panel', 'div#left_panel_splitter'); | ||
Brian E. Granger
|
r4372 | IPython.save_widget = new IPython.SaveWidget('span#save_widget'); | ||
Brian E. Granger
|
r4363 | IPython.notebook = new IPython.Notebook('div#notebook'); | ||
Brian E. Granger
|
r4372 | IPython.kernel_status_widget = new IPython.KernelStatusWidget('#kernel_status'); | ||
IPython.kernel_status_widget.status_idle(); | ||||
Brian E. Granger
|
r4357 | |||
Brian E. Granger
|
r4379 | IPython.layout_manager.do_resize(); | ||
Brian E. Granger
|
r4395 | |||
// These have display: none in the css file and are made visible here to prevent FLOUC. | ||||
$('div#header').css('display','block'); | ||||
$('div#notebook_app').css('display','block'); | ||||
Brian E. Granger
|
r4484 | |||
IPython.notebook.load_notebook(); | ||||
// Perform these actions after the notebook has been loaded. | ||||
setTimeout(function () { | ||||
IPython.save_widget.update_url(); | ||||
IPython.layout_manager.do_resize(); | ||||
IPython.pager.collapse(); | ||||
}, 100); | ||||
Brian E. Granger
|
r4349 | }); | ||