notebookmain.js
59 lines
| 2.4 KiB
| application/javascript
|
JavascriptLexer
|
r4609 | //---------------------------------------------------------------------------- | ||
// Copyright (C) 2008-2011 The IPython Development Team | ||||
// | ||||
// Distributed under the terms of the BSD License. The full license is in | ||||
// the file COPYING, distributed as part of this software. | ||||
//---------------------------------------------------------------------------- | ||||
|
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}} | ||||
} | ||||
}); | ||||
|
r4507 | IPython.markdown_converter = new Markdown.Converter(); | ||
|
r4349 | |||
|
r4372 | $('div#header').addClass('border-box-sizing'); | ||
|
r4488 | $('div#main_app').addClass('border-box-sizing ui-widget ui-widget-content'); | ||
|
r4363 | $('div#notebook_panel').addClass('border-box-sizing ui-widget'); | ||
|
r4349 | |||
|
r4363 | IPython.layout_manager = new IPython.LayoutManager(); | ||
|
r4357 | IPython.pager = new IPython.Pager('div#pager', 'div#pager_splitter'); | ||
|
r4363 | IPython.left_panel = new IPython.LeftPanel('div#left_panel', 'div#left_panel_splitter'); | ||
|
r4372 | IPython.save_widget = new IPython.SaveWidget('span#save_widget'); | ||
|
r5066 | IPython.quick_help = new IPython.QuickHelp('span#quick_help_area'); | ||
|
r4615 | IPython.print_widget = new IPython.PrintWidget('span#print_widget'); | ||
|
r4363 | IPython.notebook = new IPython.Notebook('div#notebook'); | ||
|
r4372 | IPython.kernel_status_widget = new IPython.KernelStatusWidget('#kernel_status'); | ||
IPython.kernel_status_widget.status_idle(); | ||||
|
r4357 | |||
|
r4379 | IPython.layout_manager.do_resize(); | ||
|
r4395 | |||
// These have display: none in the css file and are made visible here to prevent FLOUC. | ||||
$('div#header').css('display','block'); | ||||
|
r4488 | $('div#main_app').css('display','block'); | ||
|
r4484 | |||
// Perform these actions after the notebook has been loaded. | ||||
|
r4488 | // We wait 100 milliseconds because the notebook scrolls to the top after a load | ||
// is completed and we need to wait for that to mostly finish. | ||||
IPython.notebook.load_notebook(function () { | ||||
setTimeout(function () { | ||||
IPython.save_widget.update_url(); | ||||
IPython.layout_manager.do_resize(); | ||||
IPython.pager.collapse(); | ||||
},100); | ||||
}); | ||||
|
r4349 | }); | ||