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