Truely load jquery, jqueryui, and bootstrap as globals.

Jonathan Frederic 11 years ago
parent a9610dc413
commit 69bb4b1a0a

@ -1,3 +1,6 @@
{
"node": true
"browserify": true,
"node": true,
"jquery": true,
"predef": [ "requirejs", "define", "Promise"]
}

@ -4,7 +4,6 @@
"use strict";
var utils = require('base/js/utils');
var $ = require('jquery');
var LoginWidget = function (selector, options) {
options = options || {};

@ -2,9 +2,7 @@
// Distributed under the terms of the Modified BSD License.
"use strict";
var $ = require('jquery');
/**
* A wrapper around bootstrap modal for easier use
* Pass it an option dictionary with the following properties:
@ -35,7 +33,6 @@
*
**/
var modal = function (options) {
var modal = $("<div/>")
.addClass("modal")
.addClass("fade")

@ -11,7 +11,6 @@
"use strict";
if (!window.jupyterEvents) {
var $ = require('jquery');
var Events = function () {};
window.jupyterEvents = $([new Events()]);
}

@ -0,0 +1,37 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
"use strict";
/**
* jquery, jquery-ui, and bootstrap all really on weird window level logic.
* This module handles the global loading of those tools.
*/
module.exports = new Promise(function(resolve, reject) {
requirejs(['jquery'], function($) {
window.$ = window.jQuery = $;
console.log('jQuery loaded and available in global namespace');
requirejs(['jqueryui', 'bootstrap'], function() {
if ($.prototype.modal) {
console.log('bootstrap loaded and injected into jQuery\'s namespace');
} else {
reject(new Error('bootstrap not injected into jQuery prototype'));
}
if ($.prototype.draggable) {
console.log('jQueryUI loaded and injected into jQuery\'s namespace');
} else {
reject(new Error('jQueryUI not injected into jQuery prototype'));
}
resolve();
}, function(err) {
console.error('could not load jqueryui and/or bootstrap');
reject(err);
});
}, function(err) {
console.error('could not load jquery');
reject(err);
});
});

@ -12,7 +12,6 @@
var utils = require('base/js/utils');
var _ = require('underscore');
var $ = require('jquery');
/**

@ -4,7 +4,6 @@
"use strict";
var notificationwidget = require('base/js/notificationwidget');
var $ = require('jquery');
// store reference to the NotificationWidget class
var NotificationWidget = notificationwidget.NotificationWidget;

@ -2,7 +2,6 @@
// Distributed under the terms of the Modified BSD License.
"use strict";
var $ = require('jquery');
/**
* Construct a NotificationWidget object.

@ -4,7 +4,6 @@
"use strict";
var events = require('base/js/events');
var $ = require('jquery');
var Page = function () {
this.bind_events();

@ -3,7 +3,6 @@
"use strict";
var $ = require('jquery');
var caja = require('caja');
var noop = function (x) { return x; };

@ -3,7 +3,6 @@
"use strict";
var $ = require('jquery');
var moment = require('moment');
/**

@ -3,7 +3,6 @@
"use strict";
var $ = require('jquery');
var CodeMirror = require('codemirror/lib/codemirror');
var utils = require('base/js/utils');
require('codemirror/mode/meta');

@ -2,7 +2,8 @@
// Distributed under the terms of the Modified BSD License.
"use strict";
var $ = require('jquery');
require('base/js/globals').then(function() {
var IPython = require('base/js/namespace');
var utils = require('base/js/utils');
var page = require('base/js/page');
@ -14,9 +15,7 @@
var notificationarea = require('edit/js/notificationarea');
// Contents must be loaded at runtime.
// jQuery must also be loaded at runtime and available globally
// in order for bootstrap to work...
requirejs(['contents', 'bootstrap', 'custom/custom'], function(contents_service) {
requirejs(['contents', 'custom/custom'], function(contents_service) {
page = new page.Page();
@ -85,3 +84,8 @@ requirejs(['contents', 'bootstrap', 'custom/custom'], function(contents_service)
// On document ready, resize codemirror.
$(document).ready(_handle_resize);
});
}).catch(function(err) {
console.error('Could not load globals', err);
});

@ -2,7 +2,6 @@
// Distributed under the terms of the Modified BSD License.
"use strict";
var $ = require('jquery');
var IPython = require('base/js/namespace');
var utils = require('base/js/utils');
var dialog = require('base/js/dialog');

@ -2,7 +2,6 @@
// Distributed under the terms of the Modified BSD License.
"use strict";
var $ = require('jquery');
var utils = require('base/js/utils');
var dialog = require('base/js/dialog');
var keyboard = require('base/js/keyboard');

@ -2,7 +2,6 @@
// Distributed under the terms of the Modified BSD License.
'use strict';
var $ = require('jquery');
var dialog = require('base/js/dialog');
var _ = require('underscore');
var IPython = require('base/js/namespace');

@ -10,7 +10,6 @@
*/
"use strict";
var $ = require('jquery');
var utils = require('base/js/utils');
var CodeMirror = require('codemirror/lib/codemirror');
var cm_match = require('codemirror/addon/edit/matchbrackets');

@ -3,7 +3,6 @@
"use strict";
var IPython = require('base/js/namespace');
var $ = require('jquery');
var events = require('base/js/events');
var CellToolbar = function (options) {

@ -2,7 +2,6 @@
// Distributed under the terms of the Modified BSD License.
"use strict";
var $ = require('jquery');
var celltoolbar = require('notebook/js/celltoolbar');
var dialog = require('base/js/dialog');

@ -9,7 +9,6 @@
// $.getScript('/static/js/celltoolbarpresets/example.js');
// ```
"use strict";
var $ = require('jquery');
var celltoolbar = require('notebook/js/celltoolbar');
var CellToolbar = celltoolbar.CellToolbar;

@ -2,7 +2,6 @@
// Distributed under the terms of the Modified BSD License.
"use strict";
var $ = require('jquery');
var celltoolbar = require('notebook/js/celltoolbar');
var dialog = require('base/js/dialog');
var keyboard = require('base/js/keyboard');

@ -2,7 +2,6 @@
// Distributed under the terms of the Modified BSD License.
"use strict";
var $ = require('jquery');
var celltoolbar = require('notebook/js/celltoolbar');
var CellToolbar = celltoolbar.CellToolbar;

@ -10,7 +10,6 @@
"use strict";
var IPython = require('base/js/namespace');
var $ = require('jquery');
var utils = require('base/js/utils');
var keyboard = require('base/js/keyboard');
var configmod = require('services/config');

@ -2,7 +2,6 @@
// Distributed under the terms of the Modified BSD License.
"use strict";
var $ = require('jquery');
var utils = require('base/js/utils');
var keyboard = require('base/js/keyboard');
var CodeMirror = require('codemirror/lib/codemirror');

@ -1,7 +1,6 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
"use strict";
var $ = require('jquery');
var IPython = require('base/js/namespace');
var dialog = require('base/js/dialog');
var utils = require('base/js/utils');

@ -8,7 +8,6 @@
* @class KeyboardManager
*/
"use strict";
var $ = require('jquery');
var utils = require('base/js/utils');
var keyboard = require('base/js/keyboard');

@ -3,11 +3,9 @@
"use strict";
// Contents must be loaded at runtime.
// jQuery must also be loaded at runtime and available globally
// in order for bootstrap to work...
requirejs(['contents', 'jquery'], function(contents_service) {
requirejs(['contents'], function(contents_service) {
require('base/js/globals').then(function() {
var IPython = require('base/js/namespace');
var $ = require('jquery');
var notebook = require('notebook/js/notebook');
var configmod = require('services/config');
var utils = require('base/js/utils');
@ -143,4 +141,7 @@ requirejs(['contents', 'jquery'], function(contents_service) {
utils.load_extensions_from_config(config_section);
utils.load_extensions_from_config(common_config);
notebook.load_notebook(common_options.notebook_path);
}).catch(function(err) {
console.error('Could not load globals', err);
});
});

@ -2,7 +2,6 @@
// Distributed under the terms of the Modified BSD License.
"use strict";
var $ = require('jquery');
var toolbar = require('./toolbar');
var celltoolbar = require('./celltoolbar');
var MainToolBar = function (selector, options) {

@ -2,7 +2,6 @@
// Distributed under the terms of the Modified BSD License.
"use strict";
var $ = require('jquery');
var utils = require('base/js/utils');
var dialog = require('base/js/dialog');

@ -2,7 +2,6 @@
// Distributed under the terms of the Modified BSD License.
"use strict";
var $ = require('jquery');
var IPython = require('base/js/namespace');
var dialog = require('base/js/dialog');
var utils = require('base/js/utils');

@ -7,7 +7,6 @@
"use strict";
var IPython = require('base/js/namespace');
var $ = require('jquery');
var utils = require('base/js/utils');
var dialog = require('base/js/dialog');
var cellmod = require('notebook/js/cell');

@ -2,7 +2,6 @@
// Distributed under the terms of the Modified BSD License.
"use strict";
var $ = require('jquery');
var utils = require('base/js/utils');
var dialog = require('base/js/dialog');
var notificationarea = require('base/js/notificationarea');

@ -2,8 +2,6 @@
// Distributed under the terms of the Modified BSD License.
"use strict";
var $ = require('jquery');
require('jqueryui');
var utils = require('base/js/utils');
var security = require('base/js/security');
var keyboard = require('base/js/keyboard');

@ -2,8 +2,6 @@
// Distributed under the terms of the Modified BSD License.
"use strict";
var $ = require('jquery');
require('jqueryui');
var utils = require('base/js/utils');
var Pager = function (pager_selector, options) {

@ -2,7 +2,6 @@
// Distributed under the terms of the Modified BSD License.
"use strict";
var $ = require('jquery');
var utils = require('base/js/utils');
var dialog = require('base/js/dialog');

@ -2,7 +2,6 @@
// Distributed under the terms of the Modified BSD License.
"use strict";
var $ = require('jquery');
var utils = require('base/js/utils');
var dialog = require('base/js/dialog');
var keyboard = require('base/js/keyboard');

@ -2,7 +2,6 @@
// Distributed under the terms of the Modified BSD License.
"use strict";
var $ = require('jquery');
var ScrollManager = function(notebook, options) {
/**
* Public constructor.

@ -3,7 +3,6 @@
"use strict";
var utils = require('base/js/utils');
var $ = require('jquery');
var cell = require('notebook/js/cell');
var security = require('base/js/security');
var configmod = require('services/config');

@ -2,7 +2,6 @@
// Distributed under the terms of the Modified BSD License.
"use strict";
var $ = require('jquery');
/**
* A generic toolbar on which one can add button

@ -2,7 +2,6 @@
// Distributed under the terms of the Modified BSD License.
"use strict";
var $ = require('jquery');
var utils = require('base/js/utils');
// tooltip constructor

@ -2,9 +2,6 @@
// Distributed under the terms of the Modified BSD License.
"use strict";
var $ = require('jquery');
var tour_style = "<div class='popover tour'>\n" +
"<div class='arrow'></div>\n" +
"<div style='position:absolute; top:7px; right:7px'>\n" +

@ -2,7 +2,6 @@
// Distributed under the terms of the Modified BSD License.
"use strict";
var $ = require('jquery');
var utils = require('base/js/utils');
var ConfigSection = function(section_name, options) {

@ -2,7 +2,6 @@
// Distributed under the terms of the Modified BSD License.
"use strict";
var $ = require('jquery');
var utils = require('base/js/utils');
var Contents = function(options) {

@ -3,7 +3,6 @@
"use strict";
var $ = require('jquery');
var utils = require('base/js/utils');
//-----------------------------------------------------------------------

@ -2,7 +2,6 @@
// Distributed under the terms of the Modified BSD License.
"use strict";
var $ = require('jquery');
var utils = require('base/js/utils');
var comm = require('./comm');
var serialize = require('./serialize');

@ -2,7 +2,6 @@
// Distributed under the terms of the Modified BSD License.
"use strict";
var $ = require('jquery');
var utils = require('base/js/utils');
var kernel = require('services/kernels/kernel');

@ -1,9 +1,8 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
"use strict";
"use strict";
requirejs(['jquery'], function() {
var $ = require('jquery');
require('base/js/globals').then(function() {
var utils = require('base/js/utils');
var page = require('base/js/page');
var configmod = require('services/config');
@ -54,4 +53,6 @@ requirejs(['jquery'], function() {
// Expose terminal for fiddling with in the browser
window.terminal = terminal;
}).catch(function(err) {
console.error('Could not load globals', err);
});

@ -3,7 +3,6 @@
"use strict";
var IPython = require('base/js/namespace');
var $ = require('jquery');
var notebooklist = require('tree/js/notebooklist');
var KernelList = function (selector, options) {

@ -3,11 +3,8 @@
"use strict";
// Contents must be loaded at runtime.
// jQuery must also be loaded at runtime and available globally
// in order for bootstrap to work...
requirejs(['contents', 'jquery', 'bootstrap'], function(contents_service) {
var $ = require('jquery');
requirejs(['contents'], function(contents_service) {
require('base/js/globals').then(function() {
var IPython = require('base/js/namespace');
var dialog = require('base/js/dialog');
var events = require('base/js/events');
@ -20,8 +17,6 @@ requirejs(['contents', 'jquery', 'bootstrap'], function(contents_service) {
var terminallist = require('tree/js/terminallist');
var newnotebook = require('tree/js/newnotebook');
var loginwidget = require('auth/js/loginwidget');
require('jqueryui');
requirejs(['custom/custom'], function() {});
IPython.NotebookList = notebooklist.NotebookList;
@ -161,4 +156,7 @@ requirejs(['contents', 'jquery', 'bootstrap'], function(contents_service) {
if (window.location.hash) {
$("#tabs").find("a[href=" + window.location.hash + "]").click();
}
}).catch(function(err) {
console.error('Could not load globals', err);
});
});

@ -2,7 +2,6 @@
// Distributed under the terms of the Modified BSD License.
"use strict";
var $ = require('jquery');
var IPython = require('base/js/namespace');
var utils = require('base/js/utils');
var dialog = require('base/js/dialog');

@ -3,7 +3,6 @@
"use strict";
var IPython = require('base/js/namespace');
var $ = require('jquery');
var utils = require('base/js/utils');
var dialog = require('base/js/dialog');
var events = require('base/js/events');

@ -2,7 +2,6 @@
// Distributed under the terms of the Modified BSD License.
"use strict";
var $ = require('jquery');
var utils = require('base/js/utils');
var SesssionList = function (options) {

@ -4,7 +4,6 @@
var IPython = require('base/js/namespace');
var utils = require('base/js/utils');
var $ = require('jquery');
var notebooklist = require('tree/js/notebooklist');
var TerminalList = function (selector, options) {

@ -31,6 +31,7 @@
"aliasify": "^1.7.2",
"amd-wrap-legacy": "^0.2.0",
"backbone": "~1.2",
"bootstrap": "^3.3.5",
"bower": "*",
"browserify": "^11.0.1",
"codemirror": "~5.5",

Loading…
Cancel
Save