##// END OF EJS Templates
Backport PR #8405: FIX : flip atexit registration...
Backport PR #8405: FIX : flip atexit registration Register the sphinx spcefic atexit function before InteractiveShell can register it's clean up function. The functions are executed last-in, first-out which means in this case the temporary profile directory is deleted before the final history writing can be done which results in exceptions/warnings coming out of sphinx.

File last commit:

r20425:c45162aa
r21459:46d3d76e
Show More
main.js
180 lines | 5.2 KiB | application/javascript | JavascriptLexer
Jonathan Frederic
Started work to make tree requirejs friendly.
r17189 // Copyright (c) IPython Development Team.
// Distributed under the terms of the Modified BSD License.
Jonathan Frederic
Use ipython namepsace for instances.
r17193 require([
Jonathan Frederic
MWE,...
r17200 'jquery',
Min RK
update frontend with path/name changes...
r18752 'base/js/namespace',
'base/js/dialog',
Jonathan Frederic
Fixed events
r17195 'base/js/events',
Jonathan Frederic
Started work to make tree requirejs friendly.
r17189 'base/js/page',
'base/js/utils',
Min RK
store current kernel selection in frontend config...
r19264 'services/config',
Jeff Hemmelgarn
Move contentmanager to contents
r18643 'contents',
Jonathan Frederic
Started work to make tree requirejs friendly.
r17189 'tree/js/notebooklist',
'tree/js/clusterlist',
'tree/js/sessionlist',
'tree/js/kernellist',
Thomas Kluyver
Add list of available terminals in the dashboard
r18555 'tree/js/terminallist',
Min RK
Add kernel-select dropdown to new notebook button...
r19260 'tree/js/newnotebook',
Jonathan Frederic
Started work to make tree requirejs friendly.
r17189 'auth/js/loginwidget',
MinRK
note loaded, unused dependencies in require
r17323 // only loaded, not used:
MinRK
add bootstrap shim for require...
r17312 'jqueryui',
'bootstrap',
Jason Grout
Trigger app_initialized event *after* the 'global' IPython object is initialized
r17319 'custom/custom',
Jonathan Frederic
Started work to make tree requirejs friendly.
r17189 ], function(
Min RK
update frontend with path/name changes...
r18752 $,
IPython,
dialog,
Jonathan Frederic
Fix imports of "modules",...
r17202 events,
Min RK
update frontend with path/name changes...
r18752 page,
utils,
Min RK
store current kernel selection in frontend config...
r19264 config,
Min RK
update frontend with path/name changes...
r18752 contents_service,
Min RK
Add kernel-select dropdown to new notebook button...
r19260 notebooklist,
clusterlist,
sesssionlist,
Thomas Kluyver
Add list of available terminals in the dashboard
r18555 kernellist,
terminallist,
Min RK
Add kernel-select dropdown to new notebook button...
r19260 newnotebook,
Jonathan Frederic
Fix imports of "modules",...
r17202 loginwidget){
Min RK
update frontend with path/name changes...
r18752 "use strict";
Brian E. Granger
Implemented basic notebook browser and fixed numerous bugs.
r4488
Jonathan Frederic
Fix imports of "modules",...
r17202 page = new page.Page();
jon
In person review with @ellisonbg
r17210 var common_options = {
Jonathan Frederic
Almost done!...
r17198 base_url: utils.get_body_data("baseUrl"),
notebook_path: utils.get_body_data("notebookPath"),
Jonathan Frederic
Started work to make tree requirejs friendly.
r17189 };
Min RK
store current kernel selection in frontend config...
r19264 var cfg = new config.ConfigSection('tree', common_options);
cfg.load();
common_options.config = cfg;
Thomas Kluyver
Fix module name
r19634 var common_config = new config.ConfigSection('common', common_options);
Thomas Kluyver
Load common_config, and load extensions specified therein
r19633 common_config.load();
Matthias Bussonnier
Pass common_config to content manager.
r20425
Min RK
update frontend with path/name changes...
r18752 var session_list = new sesssionlist.SesssionList($.extend({
KesterTong
Replace other methods with ContentManager.new_notebook...
r18624 events: events},
common_options));
Matthias Bussonnier
Pass common_config to content manager.
r20425 var contents = new contents_service.Contents({
base_url: common_options.base_url,
common_config: common_config
});
Min RK
update frontend with path/name changes...
r18752 var notebook_list = new notebooklist.NotebookList('#notebook_list', $.extend({
Jeff Hemmelgarn
Move contentmanager to contents
r18643 contents: contents,
jon
In person review with @ellisonbg
r17210 session_list: session_list},
common_options));
Min RK
update frontend with path/name changes...
r18752 var cluster_list = new clusterlist.ClusterList('#cluster_list', common_options);
var kernel_list = new kernellist.KernelList('#running_list', $.extend({
jon
In person review with @ellisonbg
r17210 session_list: session_list},
common_options));
Thomas Kluyver
Only display terminals in dashboard if terminals are available
r18557
Min RK
update frontend with path/name changes...
r18752 var terminal_list;
Thomas Kluyver
Only display terminals in dashboard if terminals are available
r18557 if (utils.get_body_data("terminalsAvailable") === "True") {
terminal_list = new terminallist.TerminalList('#terminal_list', common_options);
}
Min RK
update frontend with path/name changes...
r18752 var login_widget = new loginwidget.LoginWidget('#login_widget', common_options);
Zachary Sailer
removed '/new' URL and added POST notebook request
r13016
Jonathan Frederic
New new button
r19694 var new_buttons = new newnotebook.NewNotebookWidget("#new-buttons",
Min RK
Add kernel-select dropdown to new notebook button...
r19260 $.extend(
{contents: contents},
common_options
)
);
Jonathan Frederic
Fix imports of "modules",...
r17202
Matthias BUSSONNIER
dashboard autorefresh...
r6844 var interval_id=0;
// auto refresh every xx secondes, no need to be fast,
Matthias Bussonnier
Make time to refresh "configurable", and limit refresh on focus...
r20249 // update is done most of the time when page get focus
IPython.tree_time_refresh = 60; // in sec
Matthias BUSSONNIER
dashboard autorefresh...
r6844
Matthias Bussonnier
Make time to refresh "configurable", and limit refresh on focus...
r20249 // limit refresh on focus at 1/10sec, otherwise this
// can cause too frequent refresh on switching through windows or tabs.
IPython.min_delta_refresh = 10; // in sec
var _last_refresh = null;
var _refresh_list = function(){
_last_refresh = new Date();
Jeffrey Bush
File list refreshes no longer move the upload filename boxes....
r17651 session_list.load_sessions();
cluster_list.load_list();
Min RK
remove some weird tabs...
r19266 if (terminal_list) {
terminal_list.load_terminals();
}
Matthias Bussonnier
Pass common_config to content manager.
r20425 };
Matthias Bussonnier
Make time to refresh "configurable", and limit refresh on focus...
r20249
var enable_autorefresh = function(){
/**
*refresh immediately , then start interval
*/
Matthias Bussonnier
Pass common_config to content manager.
r20425 var now = new Date();
Matthias Bussonnier
Make time to refresh "configurable", and limit refresh on focus...
r20249
if (now - _last_refresh < IPython.min_delta_refresh*1000){
Matthias Bussonnier
Pass common_config to content manager.
r20425 console.log("Reenabling autorefresh too close to last tree refresh, not refreshing immediately again.");
Matthias Bussonnier
Make time to refresh "configurable", and limit refresh on focus...
r20249 } else {
_refresh_list();
}
Matthias BUSSONNIER
dashboard autorefresh...
r6844 if (!interval_id){
Matthias Bussonnier
Make time to refresh "configurable", and limit refresh on focus...
r20249 interval_id = setInterval(_refresh_list,
IPython.tree_time_refresh*1000
);
Min RK
remove some weird tabs...
r19266 }
Jonathan Frederic
Started work to make tree requirejs friendly.
r17189 };
Matthias BUSSONNIER
dashboard autorefresh...
r6844
var disable_autorefresh = function(){
clearInterval(interval_id);
interval_id = 0;
Jonathan Frederic
Started work to make tree requirejs friendly.
r17189 };
Matthias BUSSONNIER
dashboard autorefresh...
r6844
// stop autorefresh when page lose focus
$(window).blur(function() {
disable_autorefresh();
Jonathan Frederic
Started work to make tree requirejs friendly.
r17189 });
Matthias BUSSONNIER
dashboard autorefresh...
r6844
//re-enable when page get focus back
$(window).focus(function() {
enable_autorefresh();
});
// finally start it, it will refresh immediately
enable_autorefresh();
Jonathan Frederic
Started work to make tree requirejs friendly.
r17189 page.show();
Jason Grout
Trigger app_initialized event *after* the 'global' IPython object is initialized
r17319
// For backwards compatability.
IPython.page = page;
IPython.notebook_list = notebook_list;
IPython.cluster_list = cluster_list;
IPython.session_list = session_list;
IPython.kernel_list = kernel_list;
IPython.login_widget = login_widget;
Jonathan Frederic
New new button
r19694 IPython.new_notebook_widget = new_buttons;
Jason Grout
Trigger app_initialized event *after* the 'global' IPython object is initialized
r17319
Jonathan Frederic
Started work to make tree requirejs friendly.
r17189 events.trigger('app_initialized.DashboardApp');
Thomas Kluyver
Load common_config, and load extensions specified therein
r19633 utils.load_extensions_from_config(cfg);
utils.load_extensions_from_config(common_config);
Jonathan Frederic
Started work to make tree requirejs friendly.
r17189
Matthias BUSSONNIER
alternate notebook upload methods...
r6838 // bound the upload method to the on change of the file select list
$("#alternate_upload").change(function (event){
Jonathan Frederic
Started work to make tree requirejs friendly.
r17189 notebook_list.handleFilesUpload(event,'form');
Matthias BUSSONNIER
alternate notebook upload methods...
r6838 });
MinRK
fix tab hash / url behavior...
r10927
// set hash on tab click
Jonathan Frederic
Prevent the page from jumping on tree tab change
r19575 $("#tabs").find("a").click(function(e) {
// Prevent the document from jumping when the active tab is changed to a
// tab that has a lot of content.
e.preventDefault();
// Set the hash without causing the page to jump.
// http://stackoverflow.com/a/14690177/2824256
var hash = $(this).attr("href");
if(window.history.pushState) {
window.history.pushState(null, null, hash);
} else {
window.location.hash = hash;
}
Jonathan Frederic
Started work to make tree requirejs friendly.
r17189 });
MinRK
fix tab hash / url behavior...
r10927
// load tab if url hash
if (window.location.hash) {
$("#tabs").find("a[href=" + window.location.hash + "]").click();
}
Brian E. Granger
Implemented basic notebook browser and fixed numerous bugs.
r4488 });