Show More
@@ -14,8 +14,11 var IPython = (function (IPython) { | |||||
14 | var utils = IPython.utils; |
|
14 | var utils = IPython.utils; | |
15 | var key = IPython.utils.keycodes; |
|
15 | var key = IPython.utils.keycodes; | |
16 |
|
16 | |||
17 | var Notebook = function (selector) { |
|
17 | var Notebook = function (selector, options) { | |
18 | this.read_only = IPython.read_only; |
|
18 | var options = options || {}; | |
|
19 | this._baseProjectUrl = options.baseProjectUrl; | |||
|
20 | this.read_only = options.read_only || IPython.read_only; | |||
|
21 | ||||
19 | this.element = $(selector); |
|
22 | this.element = $(selector); | |
20 | this.element.scroll(); |
|
23 | this.element.scroll(); | |
21 | this.element.data("notebook", this); |
|
24 | this.element.data("notebook", this); |
@@ -39,15 +39,17 $(document).ready(function () { | |||||
39 | // The header's bottom border is provided by the menu bar so we remove it. |
|
39 | // The header's bottom border is provided by the menu bar so we remove it. | |
40 | $('div#header').css('border-bottom-style','none'); |
|
40 | $('div#header').css('border-bottom-style','none'); | |
41 |
|
41 | |||
|
42 | var baseProjectUrl = $('body').data('baseProjectUrl') | |||
|
43 | ||||
42 | IPython.page = new IPython.Page(); |
|
44 | IPython.page = new IPython.Page(); | |
43 | IPython.markdown_converter = new Markdown.Converter(); |
|
45 | IPython.markdown_converter = new Markdown.Converter(); | |
44 | IPython.layout_manager = new IPython.LayoutManager(); |
|
46 | IPython.layout_manager = new IPython.LayoutManager(); | |
45 | IPython.pager = new IPython.Pager('div#pager', 'div#pager_splitter'); |
|
47 | IPython.pager = new IPython.Pager('div#pager', 'div#pager_splitter'); | |
46 | IPython.quick_help = new IPython.QuickHelp('span#quick_help_area'); |
|
48 | IPython.quick_help = new IPython.QuickHelp('span#quick_help_area'); | |
47 | IPython.login_widget = new IPython.LoginWidget('span#login_widget'); |
|
49 | IPython.login_widget = new IPython.LoginWidget('span#login_widget',{baseProjectUrl:baseProjectUrl}); | |
48 | IPython.notebook = new IPython.Notebook('div#notebook'); |
|
50 | IPython.notebook = new IPython.Notebook('div#notebook',{baseProjectUrl:baseProjectUrl, read_only:IPython.read_only}); | |
49 | IPython.save_widget = new IPython.SaveWidget('span#save_widget'); |
|
51 | IPython.save_widget = new IPython.SaveWidget('span#save_widget'); | |
50 | IPython.menubar = new IPython.MenuBar('#menubar') |
|
52 | IPython.menubar = new IPython.MenuBar('#menubar',{baseProjectUrl:baseProjectUrl}) | |
51 | IPython.toolbar = new IPython.MainToolBar('#maintoolbar') |
|
53 | IPython.toolbar = new IPython.MainToolBar('#maintoolbar') | |
52 | IPython.tooltip = new IPython.Tooltip() |
|
54 | IPython.tooltip = new IPython.Tooltip() | |
53 | IPython.notification_area = new IPython.NotificationArea('#notification_area') |
|
55 | IPython.notification_area = new IPython.NotificationArea('#notification_area') |
General Comments 0
You need to be logged in to leave comments.
Login now