X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/b7d40f4f02e71505150c8b33ad3ad7d7acde0ae2..ab1a529433f11e19769abf9bb1aa2c8c3194abeb:/modules/sourceEditor/sourceEditor.js diff --git a/modules/sourceEditor/sourceEditor.js b/modules/sourceEditor/sourceEditor.js index bd56c43..2fca370 100644 --- a/modules/sourceEditor/sourceEditor.js +++ b/modules/sourceEditor/sourceEditor.js @@ -1,35 +1,37 @@ -define(function() { - -return function(sandbox) { - - var view = $(sandbox.getTemplate('main')()); - - var editor = ace.edit(view.find('#rng-sourceEditor-editor')[0]); - editor.setTheme("ace/theme/chrome"); - editor.getSession().setMode("ace/mode/xml"); - $('textarea', view).on('keyup', function() { - sandbox.publish('xmlChanged'); - }); - - editor.getSession().on('change', function() { - sandbox.publish('xmlChanged'); - }) - return { - start: function() { - sandbox.publish('ready'); - }, - getView: function() { - return view; - }, - setDocument: function(document) { - editor.setValue(document); - editor.gotoLine(0) - sandbox.publish('documentSet'); - }, - getDocument: function() { - return editor.getValue(); - } - } -}; - +define(function() { + +'use strict'; + +return function(sandbox) { + + var view = $(sandbox.getTemplate('main')()); + + var editor = ace.edit(view.find('#rng-sourceEditor-editor')[0]); + editor.setTheme("ace/theme/chrome"); + editor.getSession().setMode("ace/mode/xml"); + $('textarea', view).on('keyup', function() { + sandbox.publish('xmlChanged'); + }); + + editor.getSession().on('change', function() { + sandbox.publish('xmlChanged'); + }); + return { + start: function() { + sandbox.publish('ready'); + }, + getView: function() { + return view; + }, + setDocument: function(document) { + editor.setValue(document); + editor.gotoLine(0); + sandbox.publish('documentSet'); + }, + getDocument: function() { + return editor.getValue(); + } + }; +}; + }); \ No newline at end of file