Show More
@@ -1,47 +1,49 b'' | |||
|
1 | 1 | // leave at least 2 line with only a star on it below, or doc generation fails |
|
2 | 2 | /** |
|
3 | 3 | * |
|
4 | 4 | * |
|
5 | 5 | * Placeholder for custom user javascript |
|
6 | 6 | * mainly to be overridden in profile/static/custom/custom.js |
|
7 | 7 | * This will always be an empty file in IPython |
|
8 | 8 | * |
|
9 | 9 | * User could add any javascript in the `profile/static/custom/custom.js` file |
|
10 | 10 | * (and should create it if it does not exist). |
|
11 | 11 | * It will be executed by the ipython notebook at load time. |
|
12 | 12 | * |
|
13 | 13 | * Same thing with `profile/static/custom/custom.css` to inject custom css into the notebook. |
|
14 | 14 | * |
|
15 | 15 | * Example : |
|
16 | 16 | * |
|
17 | 17 | * Create a custom button in toolbar that execute `%qtconsole` in kernel |
|
18 | 18 | * and hence open a qtconsole attached to the same kernel as the current notebook |
|
19 | 19 | * |
|
20 |
* $([IPython.events]).on(' |
|
|
20 | * $([IPython.events]).on('app_initialized.NotebookApp', function(){ | |
|
21 | 21 | * IPython.toolbar.add_buttons_group([ |
|
22 | 22 | * { |
|
23 | 23 | * 'label' : 'run qtconsole', |
|
24 |
* 'icon' : ' |
|
|
25 |
* 'callback': function(){ |
|
|
24 | * 'icon' : 'icon-terminal', // select your icon from http://fortawesome.github.io/Font-Awesome/icons | |
|
25 | * 'callback': function () { | |
|
26 | * IPython.notebook.kernel.execute('%qtconsole') | |
|
27 | * } | |
|
26 | 28 | * } |
|
27 | 29 | * // add more button here if needed. |
|
28 | 30 | * ]); |
|
29 | 31 | * }); |
|
30 | 32 | * |
|
31 | 33 | * Example : |
|
32 | 34 | * |
|
33 | 35 | * Use `jQuery.getScript(url [, success(script, textStatus, jqXHR)] );` |
|
34 | 36 | * to load custom script into the notebook. |
|
35 | 37 | * |
|
36 | 38 | * // to load the metadata ui extension example. |
|
37 | 39 | * $.getScript('/static/notebook/js/celltoolbarpresets/example.js'); |
|
38 | 40 | * // or |
|
39 | 41 | * // to load the metadata ui extension to control slideshow mode / reveal js for nbconvert |
|
40 | 42 | * $.getScript('/static/notebook/js/celltoolbarpresets/slideshow.js'); |
|
41 | 43 | * |
|
42 | 44 | * |
|
43 | 45 | * @module IPython |
|
44 | 46 | * @namespace IPython |
|
45 | 47 | * @class customjs |
|
46 | 48 | * @static |
|
47 | 49 | */ |
General Comments 0
You need to be logged in to leave comments.
Login now