##// END OF EJS Templates
de-require-config
Matthias BUSSONNIER -
Show More
@@ -8,16 +8,15 b''
8 //============================================================================
8 //============================================================================
9 // Notebook
9 // Notebook
10 //============================================================================
10 //============================================================================
11 "use strict";
12
11
13 /**
12 /**
14 * @module IPython
13 * @module IPython
15 * @namespace IPython
14 * @namespace IPython
16 **/
15 **/
17
16
18 define(function () {
17 var IPython = (function (IPython) {
19 /**
18 /**
20 * A place where some stuff can be configured.
19 * A place where some stuff can be confugured.
21 *
20 *
22 * @class config
21 * @class config
23 * @static
22 * @static
@@ -70,9 +69,10 b' define(function () {'
70 };
69 };
71
70
72 // use the same method to merge user configuration
71 // use the same method to merge user configuration
73 var config = {};
72 IPython.config = {};
74 $.extend(config, default_config);
73 $.extend(IPython.config, default_config);
75
74
76 return config;
75 return IPython;
77 });
76
77 }(IPython));
78
78
@@ -14,15 +14,12 b''
14 // as injecting require.js make marked not to put itself in the globals,
14 // as injecting require.js make marked not to put itself in the globals,
15 // which make both this file fail at setting marked configuration, and textcell.js
15 // which make both this file fail at setting marked configuration, and textcell.js
16 // which search marked into global.
16 // which search marked into global.
17 require(['static/components/marked/lib/marked.js',
17 require(['static/components/marked/lib/marked.js'],
18 'static/notebook/js/config.js'],
19
18
20 function (marked, config) {
19 function (marked) {
21
22 IPython.config = config;
23 console.log('config is',config);
24
20
25 window.marked = marked
21 window.marked = marked
22
26 // monkey patch CM to be able to syntax highlight cell magics
23 // monkey patch CM to be able to syntax highlight cell magics
27 // bug reported upstream,
24 // bug reported upstream,
28 // see https://github.com/marijnh/CodeMirror2/issues/670
25 // see https://github.com/marijnh/CodeMirror2/issues/670
@@ -107,7 +104,6 b' function (marked, config) {'
107 $([IPython.events]).on('notebook_loaded.Notebook', first_load);
104 $([IPython.events]).on('notebook_loaded.Notebook', first_load);
108 IPython.notebook.load_notebook($('body').data('notebookId'));
105 IPython.notebook.load_notebook($('body').data('notebookId'));
109
106
110 var marked;
111 if (marked) {
107 if (marked) {
112 marked.setOptions({
108 marked.setOptions({
113 gfm : true,
109 gfm : true,
@@ -230,6 +230,7 b' class="notebook_app"'
230 <script src="{{ static_url("notebook/js/notificationwidget.js") }}" type="text/javascript" charset="utf-8"></script>
230 <script src="{{ static_url("notebook/js/notificationwidget.js") }}" type="text/javascript" charset="utf-8"></script>
231 <script src="{{ static_url("notebook/js/notificationarea.js") }}" type="text/javascript" charset="utf-8"></script>
231 <script src="{{ static_url("notebook/js/notificationarea.js") }}" type="text/javascript" charset="utf-8"></script>
232 <script src="{{ static_url("notebook/js/tooltip.js") }}" type="text/javascript" charset="utf-8"></script>
232 <script src="{{ static_url("notebook/js/tooltip.js") }}" type="text/javascript" charset="utf-8"></script>
233 <script src="{{ static_url("notebook/js/config.js") }}" type="text/javascript" charset="utf-8"></script>
233 <script src="{{ static_url("notebook/js/main.js") }}" type="text/javascript" charset="utf-8"></script>
234 <script src="{{ static_url("notebook/js/main.js") }}" type="text/javascript" charset="utf-8"></script>
234
235
235 <script src="{{ static_url("notebook/js/contexthint.js") }}" charset="utf-8"></script>
236 <script src="{{ static_url("notebook/js/contexthint.js") }}" charset="utf-8"></script>
General Comments 0
You need to be logged in to leave comments. Login now