##// END OF EJS Templates
editor progress...
editor progress - load/store codemirror config - fill out menus a bit: - Edit/find,replace - View/toggle line numbers

File last commit:

r19303:c57e5636
r19303:c57e5636
Show More
main.js
66 lines | 1.7 KiB | application/javascript | JavascriptLexer
Thomas Kluyver
Basic infrastructure for new texteditor component
r19010 // Copyright (c) IPython Development Team.
// Distributed under the terms of the Modified BSD License.
require([
Thomas Kluyver
Refactor editor into Editor class
r19013 'base/js/namespace',
Thomas Kluyver
Basic infrastructure for new texteditor component
r19010 'base/js/utils',
'base/js/page',
Thomas Kluyver
Saving files works
r19012 'base/js/events',
Thomas Kluyver
Loading a file works
r19011 'contents',
Thomas Kluyver
Extensions config for text editor
r19082 'services/config',
Thomas Kluyver
Rename texteditor files & folders to edit
r19074 'edit/js/editor',
'edit/js/menubar',
'edit/js/notificationarea',
Thomas Kluyver
Basic infrastructure for new texteditor component
r19010 'custom/custom',
], function(
Thomas Kluyver
Refactor editor into Editor class
r19013 IPython,
Thomas Kluyver
Basic infrastructure for new texteditor component
r19010 utils,
page,
Thomas Kluyver
Saving files works
r19012 events,
Thomas Kluyver
Loading a file works
r19011 contents,
Thomas Kluyver
Extensions config for text editor
r19082 configmod,
Thomas Kluyver
Refactor editor into Editor class
r19013 editor,
Thomas Kluyver
Use NotificationArea in the text editor
r19017 menubar,
notificationarea
Thomas Kluyver
Basic infrastructure for new texteditor component
r19010 ){
page = new page.Page();
var base_url = utils.get_body_data('baseUrl');
Thomas Kluyver
Loading a file works
r19011 var file_path = utils.get_body_data('filePath');
Thomas Kluyver
Refactor editor into Editor class
r19013 contents = new contents.Contents({base_url: base_url});
Thomas Kluyver
Extensions config for text editor
r19082 var config = new configmod.ConfigSection('edit', {base_url: base_url})
config.load();
Thomas Kluyver
Refactor editor into Editor class
r19013
var editor = new editor.Editor('#texteditor-container', {
base_url: base_url,
events: events,
contents: contents,
file_path: file_path,
Min RK
editor progress...
r19303 config: config,
Thomas Kluyver
Loading a file works
r19011 });
Thomas Kluyver
Refactor editor into Editor class
r19013
// Make it available for debugging
IPython.editor = editor;
var menus = new menubar.MenuBar('#menubar', {
base_url: base_url,
editor: editor,
Min RK
editor progress...
r19303 events: events,
Thomas Kluyver
Refactor editor into Editor class
r19013 });
Thomas Kluyver
Use NotificationArea in the text editor
r19017
var notification_area = new notificationarea.EditorNotificationArea(
'#notification_area', {
events: events,
});
notification_area.init_notification_widgets();
Thomas Kluyver
Refactor editor into Editor class
r19013
Thomas Kluyver
Extensions config for text editor
r19082 config.loaded.then(function() {
if (config.data.load_extensions) {
var nbextension_paths = Object.getOwnPropertyNames(
config.data.load_extensions);
IPython.load_extensions.apply(this, nbextension_paths);
}
});
Thomas Kluyver
Refactor editor into Editor class
r19013 editor.load();
page.show();
Thomas Kluyver
Basic infrastructure for new texteditor component
r19010 });