5 return function(sandbox) {
7 var view = $(sandbox.getTemplate('main')());
9 var editor = ace.edit(view.find('#rng-sourceEditor-editor')[0]);
10 editor.setTheme("ace/theme/chrome");
11 editor.getSession().setMode("ace/mode/xml");
12 $('textarea', view).on('keyup', function() {
13 sandbox.publish('xmlChanged');
16 editor.getSession().on('change', function() {
17 sandbox.publish('xmlChanged');
21 sandbox.publish('ready');
26 setDocument: function(document) {
27 editor.setValue(document);
29 sandbox.publish('documentSet');
31 getDocument: function() {
32 return editor.getValue();