main.js
47 lines
| 1.0 KiB
| application/javascript
|
JavascriptLexer
Thomas Kluyver
|
r19010 | // Copyright (c) IPython Development Team. | ||
// Distributed under the terms of the Modified BSD License. | ||||
require([ | ||||
'jquery', | ||||
Thomas Kluyver
|
r19013 | 'base/js/namespace', | ||
Thomas Kluyver
|
r19010 | 'base/js/utils', | ||
'base/js/page', | ||||
Thomas Kluyver
|
r19012 | 'base/js/events', | ||
Thomas Kluyver
|
r19011 | 'contents', | ||
Thomas Kluyver
|
r19013 | 'texteditor/js/editor', | ||
Thomas Kluyver
|
r19012 | 'texteditor/js/menubar', | ||
Thomas Kluyver
|
r19010 | 'custom/custom', | ||
], function( | ||||
Thomas Kluyver
|
r19012 | $, | ||
Thomas Kluyver
|
r19013 | IPython, | ||
Thomas Kluyver
|
r19010 | utils, | ||
page, | ||||
Thomas Kluyver
|
r19012 | events, | ||
Thomas Kluyver
|
r19011 | contents, | ||
Thomas Kluyver
|
r19013 | editor, | ||
Thomas Kluyver
|
r19012 | menubar | ||
Thomas Kluyver
|
r19010 | ){ | ||
page = new page.Page(); | ||||
var base_url = utils.get_body_data('baseUrl'); | ||||
Thomas Kluyver
|
r19011 | var file_path = utils.get_body_data('filePath'); | ||
Thomas Kluyver
|
r19013 | contents = new contents.Contents({base_url: base_url}); | ||
var editor = new editor.Editor('#texteditor-container', { | ||||
base_url: base_url, | ||||
events: events, | ||||
contents: contents, | ||||
file_path: file_path, | ||||
Thomas Kluyver
|
r19011 | }); | ||
Thomas Kluyver
|
r19013 | |||
// Make it available for debugging | ||||
IPython.editor = editor; | ||||
var menus = new menubar.MenuBar('#menubar', { | ||||
base_url: base_url, | ||||
editor: editor, | ||||
}); | ||||
editor.load(); | ||||
page.show(); | ||||
Thomas Kluyver
|
r19010 | }); | ||