<!doctype html> <html> <head> <meta charset="utf-8"> <title>Welcome to Orion</title> <style> #editor { height: 20em; width: 90%; border: 1px solid #000; } </style> <script data-main="scripts/main" src="scripts/require.js"></script> </head> <body> <div id="editor"></div> <div id="status"></div> </body> </html>
require(['require', 'orion/editor/editor', 'orion/editor/editorFeatures', 'orion/editor/contentAssist', 'orion/textview/textView'], function (require, mEditor, mEditorFeatures, mContentAssist, mTextView) { var editorEl = document.getElementById('editor'); var textViewFactory = function() { return new mTextView.TextView({ parent: editorEl, stylesheet: [ require.toUrl('orion/textview/textview.css'), require.toUrl('orion/textview/rulers.css'), require.toUrl('orion/textview/annotations.css') ], tabSize: 4 }); }; var statusReporter = function(message, isError) { if (isError) { status = 'ERROR: ' + message; } else { status = message; } document.getElementById('status').innerHTML = status; }; var editor = new mEditor.Editor({ domNode: editorEl, lineNumberRulerFactory: new mEditorFeatures.LineNumberRulerFactory(), undoStackFactory: new mEditorFeatures.UndoFactory(), statusReporter: statusReporter, textViewFactory: textViewFactory }); editor.installTextView(); });