X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/ccd0a4f745a6fab17a228d822e80d8bbb6fa7d5d..efe36f4f1b5df351eeb4d40a54c3900cf9a7079b:/modules/sourceEditor/sourceEditor.js diff --git a/modules/sourceEditor/sourceEditor.js b/modules/sourceEditor/sourceEditor.js deleted file mode 100644 index 248c02d..0000000 --- a/modules/sourceEditor/sourceEditor.js +++ /dev/null @@ -1,43 +0,0 @@ -define(function() { - -return function(sandbox) { - - var view = $(sandbox.getTemplate('main')()); - var isDirty = false; - - 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() { - isDirty = true; - }); - - editor.getSession().on('change', function() { - isDirty = true; - }) - return { - start: function() { - sandbox.publish('ready'); - }, - getView: function() { - return view; - }, - setDocument: function(document) { - editor.setValue(document); - editor.gotoLine(0) - isDirty = false; - }, - getDocument: function() { - return editor.getValue(); - }, - isDirty: function() { - return isDirty; - }, - setDirty: function(dirty) { - isDirty = dirty; - } - - } -}; - -}); \ No newline at end of file