diff options
author | Chinthakayala,Sheshashailavas(sc2914) <sc2914@att.com> | 2018-06-27 16:11:44 +0000 |
---|---|---|
committer | Chinthakayala,Sheshashailavas(sc2914) <sc2914@att.com> | 2018-06-27 16:25:31 +0000 |
commit | 8f6a6c445eaeb7356e1db9d10d10b7d3fa42f27e (patch) | |
tree | bf1e5c83c357fbd4a0158cac6d41bd936e949a80 /dgbuilder/public/red/ui | |
parent | e14a02086c9119532f9153c78346d5c1d6789ca9 (diff) |
removed dependency on built-editor.min.js
and added ability to test DG from dgbuilder
and fixed the break node on XML generation
and added ability to download
formatted DG XML and DG JSON
Issue-ID: SDNC-353
Change-Id: I799de5de2c4f61e9b56dbe996d8ac3e3b28061f7
Signed-off-by: Chinthakayala,Sheshashailavas(sc2914) <sc2914@att.com>
Diffstat (limited to 'dgbuilder/public/red/ui')
-rw-r--r-- | dgbuilder/public/red/ui/editor.js | 29 | ||||
-rw-r--r-- | dgbuilder/public/red/ui/library.js | 14 |
2 files changed, 41 insertions, 2 deletions
diff --git a/dgbuilder/public/red/ui/editor.js b/dgbuilder/public/red/ui/editor.js index c5f7986e..174af961 100644 --- a/dgbuilder/public/red/ui/editor.js +++ b/dgbuilder/public/red/ui/editor.js @@ -660,6 +660,33 @@ RED.editor = (function() { edit: showEditDialog, editConfig: showEditConfigNodeDialog, validateNode: validateNode, - updateNodeProperties: updateNodeProperties // TODO: only exposed for edit-undo + updateNodeProperties: updateNodeProperties, // TODO: only exposed for edit-undo + createEditor: function(options) { + var editor = ace.edit(options.id); + //editor.setTheme("ace/theme/tomorrow"); + editor.setTheme("ace/theme/eclipse"); + if (options.mode) { + editor.getSession().setMode(options.mode); + } + if (options.foldStyle) { + editor.getSession().setFoldStyle(options.foldStyle); + } else { + editor.getSession().setFoldStyle('markbeginend'); + } + + + if (options.options) { + editor.setOptions(options.options); + } else { + editor.setOptions({ + enableBasicAutocompletion:false , + enableSnippets:false , + fontSize: "14pt" , + showGutter: false + }); + } + editor.$blockScrolling = Infinity; + return editor; + } } })(); diff --git a/dgbuilder/public/red/ui/library.js b/dgbuilder/public/red/ui/library.js index 0c803bf0..10c99261 100644 --- a/dgbuilder/public/red/ui/library.js +++ b/dgbuilder/public/red/ui/library.js @@ -74,7 +74,19 @@ RED.library = (function() { var libraryData = {}; var selectedLibraryItem = null; var libraryEditor = null; - + // Orion editor has set/getText + // ACE editor has set/getValue + // normalise to set/getValue + if (options.editor.setText) { + // Orion doesn't like having pos passed in, so proxy the call to drop it + options.editor.setValue = function(text,pos) { + options.editor.setText.call(options.editor,text); + } + } + if (options.editor.getText) { + options.editor.getValue = options.editor.getText; + } + function buildFileListItem(item) { var li = document.createElement("li"); li.onmouseover = function(e) { $(this).addClass("list-hover"); }; |