##// END OF EJS Templates
Backport PR #6556: Use some more informative asserts in inprocess kernel tests...
Backport PR #6556: Use some more informative asserts in inprocess kernel tests Prompted by gh-6552 (but doesn't fix it)

File last commit:

r16750:0dee0152
r18057:425d822a
Show More
main.js
127 lines | 4.9 KiB | application/javascript | JavascriptLexer
Brian E. Granger
More review changes....
r4609 //----------------------------------------------------------------------------
Matthias BUSSONNIER
autochange highlight with cell magics...
r8202 // Copyright (C) 2011 The IPython Development Team
Brian E. Granger
More review changes....
r4609 //
// Distributed under the terms of the BSD License. The full license is in
// the file COPYING, distributed as part of this software.
//----------------------------------------------------------------------------
Brian E. Granger
Splitting notebook.js into muliple files for development ease.
r4349
//============================================================================
// On document ready
//============================================================================
Matthias BUSSONNIER
Inject requirejs in notebook and start using it.
r10758 // for the time beeing, we have to pass marked as a parameter here,
// as injecting require.js make marked not to put itself in the globals,
// which make both this file fail at setting marked configuration, and textcell.js
// which search marked into global.
Jonathan Frederic
Remove init_widget_js, use require.js for everything...
r14342 require(['components/marked/lib/marked',
Paul Ivanov
starting the tour from the menu works now...
r15568 'widgets/js/init',
Paul Ivanov
use minified tour
r15571 'components/bootstrap-tour/build/js/bootstrap-tour.min'],
Brian E. Granger
Splitting notebook.js into muliple files for development ease.
r4349
Matthias BUSSONNIER
de-require-config
r10856 function (marked) {
MinRK
various unicode fixes...
r15234 "use strict";
Matthias BUSSONNIER
Inject requirejs in notebook and start using it.
r10758
MinRK
various unicode fixes...
r15234 window.marked = marked;
Matthias BUSSONNIER
de-require-config
r10856
Matthias BUSSONNIER
autochange highlight with cell magics...
r8202 // monkey patch CM to be able to syntax highlight cell magics
// bug reported upstream,
// see https://github.com/marijnh/CodeMirror2/issues/670
MinRK
various unicode fixes...
r15234 if(CodeMirror.getMode(1,'text/plain').indent === undefined ){
Matthias BUSSONNIER
autochange highlight with cell magics...
r8202 console.log('patching CM for undefined indent');
Matthias BUSSONNIER
Inject requirejs in notebook and start using it.
r10758 CodeMirror.modes.null = function() {
MinRK
various unicode fixes...
r15234 return {token: function(stream) {stream.skipToEnd();},indent : function(){return 0;}};
};
Matthias BUSSONNIER
Inject requirejs in notebook and start using it.
r10758 }
Matthias BUSSONNIER
autochange highlight with cell magics...
r8202
CodeMirror.patchedGetMode = function(config, mode){
var cmmode = CodeMirror.getMode(config, mode);
MinRK
various unicode fixes...
r15234 if(cmmode.indent === null) {
Matthias BUSSONNIER
autochange highlight with cell magics...
r8202 console.log('patch mode "' , mode, '" on the fly');
MinRK
various unicode fixes...
r15234 cmmode.indent = function(){return 0;};
Matthias BUSSONNIER
autochange highlight with cell magics...
r8202 }
return cmmode;
MinRK
various unicode fixes...
r15234 };
Matthias BUSSONNIER
autochange highlight with cell magics...
r8202 // end monkey patching CodeMirror
Aron Ahmadia
partial refactor, can't quite get environments working
r8565 IPython.mathjaxutils.init();
Brian E. Granger
Splitting notebook.js into muliple files for development ease.
r4349
Bussonnier Matthias
clean css....
r9277 $('#ipython-main-app').addClass('border-box-sizing');
$('div#notebook_panel').addClass('border-box-sizing');
Brian E. Granger
Splitting notebook.js into muliple files for development ease.
r4349
MinRK
various unicode fixes...
r15234 var opts = {
MinRK
s/get_data/get_body_data/
r15240 base_url : IPython.utils.get_body_data("baseUrl"),
notebook_path : IPython.utils.get_body_data("notebookPath"),
notebook_name : IPython.utils.get_body_data('notebookName')
MinRK
various unicode fixes...
r15234 };
Matthias BUSSONNIER
pass baseUrl as option
r9505
Brian Granger
Major refactoring of notebook....
r6193 IPython.page = new IPython.Page();
Brian E. Granger
Left panel is now working.
r4363 IPython.layout_manager = new IPython.LayoutManager();
Brian E. Granger
Refactoring pager into its own class.
r4357 IPython.pager = new IPython.Pager('div#pager', 'div#pager_splitter');
Brian E. Granger
Splitting notebook.less into separate files.
r10730 IPython.quick_help = new IPython.QuickHelp();
MinRK
Backport PR #5826: allow notebook tour instantiation to fail...
r16750 try {
IPython.tour = new IPython.NotebookTour();
} catch (e) {
console.log("Failed to instantiate Notebook Tour", e);
}
MinRK
various unicode fixes...
r15234 IPython.login_widget = new IPython.LoginWidget('span#login_widget', opts);
IPython.notebook = new IPython.Notebook('div#notebook', opts);
Brian E. Granger
Adding keyboard manager logic....
r14020 IPython.keyboard_manager = new IPython.KeyboardManager();
Brian Granger
Major refactoring of saving, notification....
r6047 IPython.save_widget = new IPython.SaveWidget('span#save_widget');
MinRK
various unicode fixes...
r15234 IPython.menubar = new IPython.MenuBar('#menubar', opts);
IPython.toolbar = new IPython.MainToolBar('#maintoolbar-container');
IPython.tooltip = new IPython.Tooltip();
IPython.notification_area = new IPython.NotificationArea('#notification_area');
Matthias BUSSONNIER
tweek notebook notification behavior
r8074 IPython.notification_area.init_notification_widgets();
Brian E. Granger
Refactoring pager into its own class.
r4357
Brian E. Granger
Updating font-sizing to use the YUI protocol.
r4379 IPython.layout_manager.do_resize();
Brian E. Granger
Hacks to prevent FLOUC (flash of unformatted content).
r4395
mcelrath
Add bad font detection, and a dialog informing the user.
r7394 $('body').append('<div id="fonttest"><pre><span id="test1">x</span>'+
'<span id="test2" style="font-weight: bold;">x</span>'+
MinRK
various unicode fixes...
r15234 '<span id="test3" style="font-style: italic;">x</span></pre></div>');
mcelrath
Add bad font detection, and a dialog informing the user.
r7394 var nh = $('#test1').innerHeight();
var bh = $('#test2').innerHeight();
var ih = $('#test3').innerHeight();
if(nh != bh || nh != ih) {
mcelrath
Alternative solution: silently apply some CSS instead of a dialog box.
r7446 $('head').append('<style>.CodeMirror span { vertical-align: bottom; }</style>');
mcelrath
Add bad font detection, and a dialog informing the user.
r7394 }
mcelrath
Fix spurious appearance of #fontarea at end of document.
r7666 $('#fonttest').remove();
mcelrath
Add bad font detection, and a dialog informing the user.
r7394
Brian Granger
Major refactoring of notebook....
r6193 IPython.page.show();
Brian E. Granger
Massive work on the notebook document format....
r4484
Brian Granger
Optimizing notebook loading.
r5949 IPython.layout_manager.do_resize();
MinRK
add autosave timer...
r10505 var first_load = function () {
Brian Granger
Major refactoring of saving, notification....
r6047 IPython.layout_manager.do_resize();
MinRK
trigger hash on notebook load...
r10006 var hash = document.location.hash;
if (hash) {
document.location.hash = '';
document.location.hash = hash;
}
MinRK
s/autosave_notebook/set_autosave_interval/
r10508 IPython.notebook.set_autosave_interval(IPython.notebook.minimum_autosave_interval);
MinRK
add autosave timer...
r10505 // only do this once
$([IPython.events]).off('notebook_loaded.Notebook', first_load);
};
MinRK
add javascript-side widgets
r13189
MinRK
add autosave timer...
r10505 $([IPython.events]).on('notebook_loaded.Notebook', first_load);
Matthias BUSSONNIER
Trigger a single event on js app initilized...
r11227 $([IPython.events]).trigger('app_initialized.NotebookApp');
MinRK
various unicode fixes...
r15234 IPython.notebook.load_notebook(opts.notebook_name, opts.notebook_path);
Matthias BUSSONNIER
Inject requirejs in notebook and start using it.
r10758
MinRK
use highlight.js to highlight markdown code blocks
r10539 if (marked) {
marked.setOptions({
gfm : true,
tables: true,
langPrefix: "language-",
highlight: function(code, lang) {
MinRK
no highlight if no language specified
r12594 if (!lang) {
// no language, no highlight
return code;
}
MinRK
use highlight.js to highlight markdown code blocks
r10539 var highlighted;
MinRK
protect highlight.js against unknown languages...
r10549 try {
MinRK
use highlight.js to highlight markdown code blocks
r10539 highlighted = hljs.highlight(lang, code, false);
MinRK
protect highlight.js against unknown languages...
r10549 } catch(err) {
MinRK
use highlight.js to highlight markdown code blocks
r10539 highlighted = hljs.highlightAuto(code);
}
return highlighted.value;
}
MinRK
various unicode fixes...
r15234 });
MinRK
use highlight.js to highlight markdown code blocks
r10539 }
MinRK
various unicode fixes...
r15234 });