Create custom ace javascript mode to handle Function sig

Fixes #1911
This commit is contained in:
Nick O'Leary
2018-10-02 23:01:34 +01:00
parent 2a50c66df8
commit b2f50da322
9 changed files with 317 additions and 3 deletions

View File

@@ -96,7 +96,7 @@
this.editor = RED.editor.createEditor({
id: 'node-input-func-editor',
mode: 'ace/mode/javascript',
mode: 'ace/mode/nrjavascript',
value: $("#node-input-func").val(),
globals: {
msg:true,
@@ -118,7 +118,7 @@
url:"functions", // where to get the data from
type:"function", // the type of object the library is for
editor:this.editor, // the field name the main text body goes to
mode:"ace/mode/javascript",
mode:"ace/mode/nrjavascript",
fields:['name','outputs']
});
this.editor.focus();
@@ -130,6 +130,7 @@
value: value,
width: "Infinity",
cursor: that.editor.getCursorPosition(),
mode: "ace/mode/nrjavascript",
complete: function(v,cursor) {
that.editor.setValue(v, -1);
that.editor.gotoLine(cursor.row+1,cursor.column,false);