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/nodes/dge | |
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/nodes/dge')
32 files changed, 1340 insertions, 1129 deletions
diff --git a/dgbuilder/nodes/dge/dgelogic/block.html b/dgbuilder/nodes/dge/dgelogic/block.html index fadf8a8c..4e6d2b98 100644 --- a/dgbuilder/nodes/dge/dgelogic/block.html +++ b/dgbuilder/nodes/dge/dgelogic/block.html @@ -107,10 +107,10 @@ return this.name; }, oneditprepare: function() { + var that = this; $( "#node-input-outputs" ).spinner({ min:1 }); - var comments = $( "#node-input-comments").val(); if(comments != null){ comments = comments.trim(); @@ -126,69 +126,72 @@ $('#node-input-atomic-chkBox').prop('checked', false); } - - function functionDialogResize(ev,ui) { - $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); }; - - $( "#dialog" ).dialog( "option", "width", 1200 ); - $( "#dialog" ).dialog( "option", "height", 750 ); $( "#dialog" ).on("dialogresize", functionDialogResize); $( "#dialog" ).one("dialogopen", function(ev) { var size = $( "#dialog" ).dialog('option','sizeCache-function'); if (size) { - functionDialogResize(null,{size:size}); + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); } }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-xml-editor', + mode: 'ace/mode/html' + }); + this.editor.setValue($("#node-input-xml").val(),-1); + blockXmlEditor=that.editor; + /* + RED.library.create({ + 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/html", + fields:['name','outputs'] + }); + */ + this.editor.focus(); /* close dialog when ESC is pressed and released */ - $( "#dialog" ).keyup(function(event){ + $( "#node-input-xml-editor" ).keyup(function(event){ if(event.which == 27 ) { $("#node-dialog-cancel").click(); } }); - - $( "#dialog" ).one("dialogclose", function(ev,ui) { - var height = $( "#dialog" ).dialog('option','height'); - $( "#dialog" ).off("dialogresize",functionDialogResize); - }); - var that = this; - require(["orion/editor/edit"], function(edit) { - that.editor = edit({ - parent:document.getElementById('node-input-xml-editor'), - lang:"html", - contents: $("#node-input-xml").val() - }); - blockXmlEditor=that.editor; - RED.library.create({ - url:"functions", // where to get the data from - type:"function", // the type of object the library is for - editor:that.editor, // the field name the main text body goes to - fields:['name','outputs'] - }); - $("#node-input-name").focus(); $("#node-input-validate").click(function(){ - //console.log("validate clicked."); + console.log("validate clicked."); //console.dir(that.editor); //console.log("getText:" + that.editor.getText()); - var val = that.editor.getText(); + var val = that.editor.getValue(); validateXML(val); }); $("#node-input-show-sli-values").click(function(){ - //console.log("SLIValues clicked."); - showValuesBox(that.editor,sliValuesObj); + //console.log("show Values clicked."); + showValuesBox(that.editor,sliValuesObj); }); - - }); //for click of add comments button $("#node-input-btnComments").click(function(e){ showCommentsBox(); }); - }, + }, oneditsave: function() { - - $("#node-input-xml").val(this.editor.getText()); - var resp=validateXML(this.editor.getText()); + $("#node-input-xml").val(this.editor.getValue()); + var resp=validateXML(this.editor.getValue()); if(resp){ this.status = {fill:"green",shape:"dot",text:"OK"}; }else{ @@ -196,26 +199,26 @@ } delete this.editor; delete blockXmlEditor; - } + } }); function updateXml(){ if($("#node-input-atomic-chkBox").is(':checked')){ $("#node-input-name").val("block : atomic"); $("#node-input-atomic").val("true"); //alert($("#node-input-xml-editor div.textview div.textviewContent").text()); - var xmlStr = blockXmlEditor.getText(); + var xmlStr = blockXmlEditor.getValue(); var re = new RegExp("<block[^<]+"); xmlStr=xmlStr.replace(re,"<block atomic='true'>"); //$("#node-input-xml-editor div.textview div.textviewContent").text(xmlStr); - blockXmlEditor.setText(xmlStr); + blockXmlEditor.setValue(xmlStr); //console.log("block xmlStr:" + xmlStr); }else{ $("#node-input-name").val("block"); $("#node-input-atomic").val("false"); - var xmlStr = blockXmlEditor.getText(); + var xmlStr = blockXmlEditor.getValue(); var re = new RegExp("<block[^<]+"); xmlStr=xmlStr.replace(re,"<block>"); - blockXmlEditor.setText(xmlStr); + blockXmlEditor.setValue(xmlStr); //$("#node-input-xml-editor div.textview div.textviewContent").text(xmlStr); //console.log("block xmlStr:" + xmlStr); } diff --git a/dgbuilder/nodes/dge/dgelogic/breakNode.html b/dgbuilder/nodes/dge/dgelogic/breakNode.html index e3edef9d..8bb20f41 100644 --- a/dgbuilder/nodes/dge/dgelogic/breakNode.html +++ b/dgbuilder/nodes/dge/dgelogic/breakNode.html @@ -77,11 +77,10 @@ return this.name; }, oneditprepare: function() { + var that = this; $( "#node-input-outputs" ).spinner({ min:1 }); - - var comments = $( "#node-input-comments").val(); if(comments != null){ comments = comments.trim(); @@ -90,72 +89,77 @@ } } - function functionDialogResize(ev,ui) { - $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); }; - - $( "#dialog" ).dialog( "option", "width", 1200 ); - $( "#dialog" ).dialog( "option", "height", 750 ); $( "#dialog" ).on("dialogresize", functionDialogResize); $( "#dialog" ).one("dialogopen", function(ev) { var size = $( "#dialog" ).dialog('option','sizeCache-function'); if (size) { - functionDialogResize(null,{size:size}); + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); } }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-xml-editor', + mode: 'ace/mode/html' + }); + this.editor.setValue($("#node-input-xml").val(),-1); + /* + RED.library.create({ + 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/html", + fields:['name','outputs'] + }); + */ + this.editor.focus(); /* close dialog when ESC is pressed and released */ - $( "#dialog" ).keyup(function(event){ + $( "#node-input-xml-editor" ).keyup(function(event){ if(event.which == 27 ) { $("#node-dialog-cancel").click(); } }); - - $( "#dialog" ).one("dialogclose", function(ev,ui) { - var height = $( "#dialog" ).dialog('option','height'); - $( "#dialog" ).off("dialogresize",functionDialogResize); - }); - var that = this; - require(["orion/editor/edit"], function(edit) { - that.editor = edit({ - parent:document.getElementById('node-input-xml-editor'), - lang:"html", - contents: $("#node-input-xml").val() - }); - RED.library.create({ - url:"functions", // where to get the data from - type:"function", // the type of object the library is for - editor:that.editor, // the field name the main text body goes to - fields:['name','outputs'] - }); - $("#node-input-name").focus(); $("#node-input-validate").click(function(){ console.log("validate clicked."); //console.dir(that.editor); //console.log("getText:" + that.editor.getText()); - var val = that.editor.getText(); + var val = that.editor.getValue(); validateXML(val); }); $("#node-input-show-sli-values").click(function(){ - console.log("SLIValues clicked."); - showValuesBox(that.editor,sliValuesObj); + //console.log("show Values clicked."); + showValuesBox(that.editor,sliValuesObj); }); - - }); //for click of add comments button $("#node-input-btnComments").click(function(e){ showCommentsBox(); }); - }, + }, oneditsave: function() { - $("#node-input-xml").val(this.editor.getText()); - var resp=validateXML(this.editor.getText()); + $("#node-input-xml").val(this.editor.getValue()); + var resp=validateXML(this.editor.getValue()); if(resp){ this.status = {fill:"green",shape:"dot",text:"OK"}; }else{ this.status = {fill:"red",shape:"dot",text:"ERROR"}; } delete this.editor; - } + } }); </script> diff --git a/dgbuilder/nodes/dge/dgelogic/call.html b/dgbuilder/nodes/dge/dgelogic/call.html index 0e49e26c..d207ec9f 100644 --- a/dgbuilder/nodes/dge/dgelogic/call.html +++ b/dgbuilder/nodes/dge/dgelogic/call.html @@ -99,11 +99,10 @@ return this.name; }, oneditprepare: function() { + var that = this; $( "#node-input-outputs" ).spinner({ min:1 }); - - var comments = $( "#node-input-comments").val(); if(comments != null){ comments = comments.trim(); @@ -112,72 +111,77 @@ } } - function functionDialogResize(ev,ui) { - $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); }; - - $( "#dialog" ).dialog( "option", "width", 1200 ); - $( "#dialog" ).dialog( "option", "height", 750 ); $( "#dialog" ).on("dialogresize", functionDialogResize); $( "#dialog" ).one("dialogopen", function(ev) { var size = $( "#dialog" ).dialog('option','sizeCache-function'); if (size) { - functionDialogResize(null,{size:size}); + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); } }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-xml-editor', + mode: 'ace/mode/html' + }); + this.editor.setValue($("#node-input-xml").val(),-1); + /* + RED.library.create({ + 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/html", + fields:['name','outputs'] + }); + */ + this.editor.focus(); /* close dialog when ESC is pressed and released */ - $( "#dialog" ).keyup(function(event){ + $( "#node-input-xml-editor" ).keyup(function(event){ if(event.which == 27 ) { $("#node-dialog-cancel").click(); } }); - - $( "#dialog" ).one("dialogclose", function(ev,ui) { - var height = $( "#dialog" ).dialog('option','height'); - $( "#dialog" ).off("dialogresize",functionDialogResize); - }); - var that = this; - require(["orion/editor/edit"], function(edit) { - that.editor = edit({ - parent:document.getElementById('node-input-xml-editor'), - lang:"html", - contents: $("#node-input-xml").val() - }); - RED.library.create({ - url:"functions", // where to get the data from - type:"function", // the type of object the library is for - editor:that.editor, // the field name the main text body goes to - fields:['name','outputs'] - }); - $("#node-input-name").focus(); $("#node-input-validate").click(function(){ console.log("validate clicked."); //console.dir(that.editor); //console.log("getText:" + that.editor.getText()); - var val = that.editor.getText(); + var val = that.editor.getValue(); validateXML(val); }); $("#node-input-show-sli-values").click(function(){ - //console.log("show Values clicked."); - showValuesBox(that.editor,rpcValues); + //console.log("show Values clicked."); + showValuesBox(that.editor,sliValuesObj); }); - - }); //for click of add comments button $("#node-input-btnComments").click(function(e){ showCommentsBox(); }); - }, + }, oneditsave: function() { - $("#node-input-xml").val(this.editor.getText()); - var resp=validateXML(this.editor.getText()); + $("#node-input-xml").val(this.editor.getValue()); + var resp=validateXML(this.editor.getValue()); if(resp){ this.status = {fill:"green",shape:"dot",text:"OK"}; }else{ this.status = {fill:"red",shape:"dot",text:"ERROR"}; } delete this.editor; - } + } }); </script> diff --git a/dgbuilder/nodes/dge/dgelogic/configure.html b/dgbuilder/nodes/dge/dgelogic/configure.html index 7503b1f1..9deda0df 100644 --- a/dgbuilder/nodes/dge/dgelogic/configure.html +++ b/dgbuilder/nodes/dge/dgelogic/configure.html @@ -143,10 +143,10 @@ return this.name; }, oneditprepare: function() { + var that = this; $( "#node-input-outputs" ).spinner({ min:1 }); - var comments = $( "#node-input-comments").val(); if(comments != null){ comments = comments.trim(); @@ -155,73 +155,77 @@ } } - - function functionDialogResize(ev,ui) { - $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); }; - - $( "#dialog" ).dialog( "option", "width", 1200 ); - $( "#dialog" ).dialog( "option", "height", 750 ); $( "#dialog" ).on("dialogresize", functionDialogResize); $( "#dialog" ).one("dialogopen", function(ev) { var size = $( "#dialog" ).dialog('option','sizeCache-function'); if (size) { - functionDialogResize(null,{size:size}); + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); } }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-xml-editor', + mode: 'ace/mode/html' + }); + this.editor.setValue($("#node-input-xml").val(),-1); + /* + RED.library.create({ + 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/html", + fields:['name','outputs'] + }); + */ + this.editor.focus(); /* close dialog when ESC is pressed and released */ - $( "#dialog" ).keyup(function(event){ + $( "#node-input-xml-editor" ).keyup(function(event){ if(event.which == 27 ) { $("#node-dialog-cancel").click(); } }); - - $( "#dialog" ).one("dialogclose", function(ev,ui) { - var height = $( "#dialog" ).dialog('option','height'); - $( "#dialog" ).off("dialogresize",functionDialogResize); - }); - var that = this; - require(["orion/editor/edit"], function(edit) { - that.editor = edit({ - parent:document.getElementById('node-input-xml-editor'), - lang:"html", - contents: $("#node-input-xml").val() - }); - RED.library.create({ - url:"functions", // where to get the data from - type:"function", // the type of object the library is for - editor:that.editor, // the field name the main text body goes to - fields:['name','outputs'] - }); - $("#node-input-name").focus(); $("#node-input-validate").click(function(){ console.log("validate clicked."); //console.dir(that.editor); //console.log("getText:" + that.editor.getText()); - var val = that.editor.getText(); + var val = that.editor.getValue(); validateXML(val); }); $("#node-input-show-sli-values").click(function(){ - console.log("SLIValues clicked."); - showValuesBox(that.editor,sliValuesObj); + //console.log("show Values clicked."); + showValuesBox(that.editor,sliValuesObj); }); - - }); //for click of add comments button $("#node-input-btnComments").click(function(e){ showCommentsBox(); }); - }, + }, oneditsave: function() { - $("#node-input-xml").val(this.editor.getText()); - var resp=validateXML(this.editor.getText()); + $("#node-input-xml").val(this.editor.getValue()); + var resp=validateXML(this.editor.getValue()); if(resp){ this.status = {fill:"green",shape:"dot",text:"OK"}; }else{ this.status = {fill:"red",shape:"dot",text:"ERROR"}; } delete this.editor; - } + } }); </script> diff --git a/dgbuilder/nodes/dge/dgelogic/delete.html b/dgbuilder/nodes/dge/dgelogic/delete.html index b4c7f52f..31008bf7 100644 --- a/dgbuilder/nodes/dge/dgelogic/delete.html +++ b/dgbuilder/nodes/dge/dgelogic/delete.html @@ -103,11 +103,10 @@ return this.name; }, oneditprepare: function() { + var that = this; $( "#node-input-outputs" ).spinner({ min:1 }); - - var comments = $( "#node-input-comments").val(); if(comments != null){ comments = comments.trim(); @@ -116,72 +115,77 @@ } } - function functionDialogResize(ev,ui) { - $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); }; - - $( "#dialog" ).dialog( "option", "width", 1200 ); - $( "#dialog" ).dialog( "option", "height", 750 ); $( "#dialog" ).on("dialogresize", functionDialogResize); $( "#dialog" ).one("dialogopen", function(ev) { var size = $( "#dialog" ).dialog('option','sizeCache-function'); if (size) { - functionDialogResize(null,{size:size}); + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); } }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-xml-editor', + mode: 'ace/mode/html' + }); + this.editor.setValue($("#node-input-xml").val(),-1); + /* + RED.library.create({ + 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/html", + fields:['name','outputs'] + }); + */ + this.editor.focus(); /* close dialog when ESC is pressed and released */ - $( "#dialog" ).keyup(function(event){ + $( "#node-input-xml-editor" ).keyup(function(event){ if(event.which == 27 ) { $("#node-dialog-cancel").click(); } }); - - $( "#dialog" ).one("dialogclose", function(ev,ui) { - var height = $( "#dialog" ).dialog('option','height'); - $( "#dialog" ).off("dialogresize",functionDialogResize); - }); - var that = this; - require(["orion/editor/edit"], function(edit) { - that.editor = edit({ - parent:document.getElementById('node-input-xml-editor'), - lang:"html", - contents: $("#node-input-xml").val() - }); - RED.library.create({ - url:"functions", // where to get the data from - type:"function", // the type of object the library is for - editor:that.editor, // the field name the main text body goes to - fields:['name','outputs'] - }); - $("#node-input-name").focus(); $("#node-input-validate").click(function(){ console.log("validate clicked."); //console.dir(that.editor); //console.log("getText:" + that.editor.getText()); - var val = that.editor.getText(); + var val = that.editor.getValue(); validateXML(val); }); $("#node-input-show-sli-values").click(function(){ - console.log("SLIValues clicked."); - showValuesBox(that.editor,sliValuesObj); + //console.log("show Values clicked."); + showValuesBox(that.editor,sliValuesObj); }); - - }); //for click of add comments button $("#node-input-btnComments").click(function(e){ showCommentsBox(); }); - }, + }, oneditsave: function() { - $("#node-input-xml").val(this.editor.getText()); - var resp=validateXML(this.editor.getText()); + $("#node-input-xml").val(this.editor.getValue()); + var resp=validateXML(this.editor.getValue()); if(resp){ this.status = {fill:"green",shape:"dot",text:"OK"}; }else{ this.status = {fill:"red",shape:"dot",text:"ERROR"}; } delete this.editor; - } + } }); </script> diff --git a/dgbuilder/nodes/dge/dgelogic/execute.html b/dgbuilder/nodes/dge/dgelogic/execute.html index 3d5fc6d7..4832745a 100644 --- a/dgbuilder/nodes/dge/dgelogic/execute.html +++ b/dgbuilder/nodes/dge/dgelogic/execute.html @@ -113,10 +113,10 @@ return this.name; }, oneditprepare: function() { + var that = this; $( "#node-input-outputs" ).spinner({ min:1 }); - var comments = $( "#node-input-comments").val(); if(comments != null){ comments = comments.trim(); @@ -125,73 +125,77 @@ } } - - function functionDialogResize(ev,ui) { - $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); }; - - $( "#dialog" ).dialog( "option", "width", 1200 ); - $( "#dialog" ).dialog( "option", "height", 750 ); $( "#dialog" ).on("dialogresize", functionDialogResize); $( "#dialog" ).one("dialogopen", function(ev) { var size = $( "#dialog" ).dialog('option','sizeCache-function'); if (size) { - functionDialogResize(null,{size:size}); + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); } }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-xml-editor', + mode: 'ace/mode/html' + }); + this.editor.setValue($("#node-input-xml").val(),-1); + /* + RED.library.create({ + 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/html", + fields:['name','outputs'] + }); + */ + this.editor.focus(); /* close dialog when ESC is pressed and released */ - $( "#dialog" ).keyup(function(event){ + $( "#node-input-xml-editor" ).keyup(function(event){ if(event.which == 27 ) { $("#node-dialog-cancel").click(); } }); - - $( "#dialog" ).one("dialogclose", function(ev,ui) { - var height = $( "#dialog" ).dialog('option','height'); - $( "#dialog" ).off("dialogresize",functionDialogResize); - }); - var that = this; - require(["orion/editor/edit"], function(edit) { - that.editor = edit({ - parent:document.getElementById('node-input-xml-editor'), - lang:"html", - contents: $("#node-input-xml").val() - }); - RED.library.create({ - url:"functions", // where to get the data from - type:"function", // the type of object the library is for - editor:that.editor, // the field name the main text body goes to - fields:['name','outputs'] - }); - $("#node-input-name").focus(); $("#node-input-validate").click(function(){ console.log("validate clicked."); //console.dir(that.editor); //console.log("getText:" + that.editor.getText()); - var val = that.editor.getText(); + var val = that.editor.getValue(); validateXML(val); }); $("#node-input-show-sli-values").click(function(){ - console.log("SLIValues clicked."); - showValuesBox(that.editor,sliValuesObj); + //console.log("show Values clicked."); + showValuesBox(that.editor,sliValuesObj); }); - - }); //for click of add comments button $("#node-input-btnComments").click(function(e){ showCommentsBox(); }); - }, + }, oneditsave: function() { - $("#node-input-xml").val(this.editor.getText()); - var resp=validateXML(this.editor.getText()); + $("#node-input-xml").val(this.editor.getValue()); + var resp=validateXML(this.editor.getValue()); if(resp){ this.status = {fill:"green",shape:"dot",text:"OK"}; }else{ this.status = {fill:"red",shape:"dot",text:"ERROR"}; } delete this.editor; - } + } }); </script> diff --git a/dgbuilder/nodes/dge/dgelogic/exists.html b/dgbuilder/nodes/dge/dgelogic/exists.html index 001e8ca1..b499e459 100644 --- a/dgbuilder/nodes/dge/dgelogic/exists.html +++ b/dgbuilder/nodes/dge/dgelogic/exists.html @@ -102,11 +102,10 @@ return this.name; }, oneditprepare: function() { + var that = this; $( "#node-input-outputs" ).spinner({ min:1 }); - - var comments = $( "#node-input-comments").val(); if(comments != null){ comments = comments.trim(); @@ -115,73 +114,77 @@ } } - function functionDialogResize(ev,ui) { - $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); }; - - $( "#dialog" ).dialog( "option", "width", 1200 ); - $( "#dialog" ).dialog( "option", "height", 750 ); - $( "#dialog" ).on("dialogresize", functionDialogResize); $( "#dialog" ).one("dialogopen", function(ev) { var size = $( "#dialog" ).dialog('option','sizeCache-function'); if (size) { - functionDialogResize(null,{size:size}); + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); } }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-xml-editor', + mode: 'ace/mode/html' + }); + this.editor.setValue($("#node-input-xml").val(),-1); + /* + RED.library.create({ + 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/html", + fields:['name','outputs'] + }); + */ + this.editor.focus(); /* close dialog when ESC is pressed and released */ - $( "#dialog" ).keyup(function(event){ + $( "#node-input-xml-editor" ).keyup(function(event){ if(event.which == 27 ) { $("#node-dialog-cancel").click(); } }); - - $( "#dialog" ).one("dialogclose", function(ev,ui) { - var height = $( "#dialog" ).dialog('option','height'); - $( "#dialog" ).off("dialogresize",functionDialogResize); - }); - var that = this; - require(["orion/editor/edit"], function(edit) { - that.editor = edit({ - parent:document.getElementById('node-input-xml-editor'), - lang:"html", - contents: $("#node-input-xml").val() - }); - RED.library.create({ - url:"functions", // where to get the data from - type:"function", // the type of object the library is for - editor:that.editor, // the field name the main text body goes to - fields:['name','outputs'] - }); - $("#node-input-name").focus(); $("#node-input-validate").click(function(){ console.log("validate clicked."); //console.dir(that.editor); //console.log("getText:" + that.editor.getText()); - var val = that.editor.getText(); + var val = that.editor.getValue(); validateXML(val); }); $("#node-input-show-sli-values").click(function(){ - console.log("SLIValues clicked."); - showValuesBox(that.editor,sliValuesObj); + //console.log("show Values clicked."); + showValuesBox(that.editor,sliValuesObj); }); - - }); //for click of add comments button $("#node-input-btnComments").click(function(e){ showCommentsBox(); }); - }, + }, oneditsave: function() { - $("#node-input-xml").val(this.editor.getText()); - var resp=validateXML(this.editor.getText()); + $("#node-input-xml").val(this.editor.getValue()); + var resp=validateXML(this.editor.getValue()); if(resp){ this.status = {fill:"green",shape:"dot",text:"OK"}; }else{ this.status = {fill:"red",shape:"dot",text:"ERROR"}; } delete this.editor; - } + } }); </script> diff --git a/dgbuilder/nodes/dge/dgelogic/forNode.html b/dgbuilder/nodes/dge/dgelogic/forNode.html index c7327db4..8126b11a 100644 --- a/dgbuilder/nodes/dge/dgelogic/forNode.html +++ b/dgbuilder/nodes/dge/dgelogic/forNode.html @@ -88,11 +88,10 @@ return this.name; }, oneditprepare: function() { + var that = this; $( "#node-input-outputs" ).spinner({ min:1 }); - - var comments = $( "#node-input-comments").val(); if(comments != null){ comments = comments.trim(); @@ -101,72 +100,77 @@ } } - function functionDialogResize(ev,ui) { - $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); }; - - $( "#dialog" ).dialog( "option", "width", 1200 ); - $( "#dialog" ).dialog( "option", "height", 750 ); $( "#dialog" ).on("dialogresize", functionDialogResize); $( "#dialog" ).one("dialogopen", function(ev) { var size = $( "#dialog" ).dialog('option','sizeCache-function'); if (size) { - functionDialogResize(null,{size:size}); + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); } }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-xml-editor', + mode: 'ace/mode/html' + }); + this.editor.setValue($("#node-input-xml").val(),-1); + /* + RED.library.create({ + 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/html", + fields:['name','outputs'] + }); + */ + this.editor.focus(); /* close dialog when ESC is pressed and released */ - $( "#dialog" ).keyup(function(event){ + $( "#node-input-xml-editor" ).keyup(function(event){ if(event.which == 27 ) { $("#node-dialog-cancel").click(); } }); - - $( "#dialog" ).one("dialogclose", function(ev,ui) { - var height = $( "#dialog" ).dialog('option','height'); - $( "#dialog" ).off("dialogresize",functionDialogResize); - }); - var that = this; - require(["orion/editor/edit"], function(edit) { - that.editor = edit({ - parent:document.getElementById('node-input-xml-editor'), - lang:"html", - contents: $("#node-input-xml").val() - }); - RED.library.create({ - url:"functions", // where to get the data from - type:"function", // the type of object the library is for - editor:that.editor, // the field name the main text body goes to - fields:['name','outputs'] - }); - $("#node-input-name").focus(); $("#node-input-validate").click(function(){ console.log("validate clicked."); //console.dir(that.editor); //console.log("getText:" + that.editor.getText()); - var val = that.editor.getText(); + var val = that.editor.getValue(); validateXML(val); }); $("#node-input-show-sli-values").click(function(){ - console.log("SLIValues clicked."); - showValuesBox(that.editor,sliValuesObj); + //console.log("show Values clicked."); + showValuesBox(that.editor,sliValuesObj); }); - - }); //for click of add comments button $("#node-input-btnComments").click(function(e){ showCommentsBox(); }); - }, + }, oneditsave: function() { - $("#node-input-xml").val(this.editor.getText()); - var resp=validateXML(this.editor.getText()); + $("#node-input-xml").val(this.editor.getValue()); + var resp=validateXML(this.editor.getValue()); if(resp){ this.status = {fill:"green",shape:"dot",text:"OK"}; }else{ this.status = {fill:"red",shape:"dot",text:"ERROR"}; } delete this.editor; - } + } }); </script> diff --git a/dgbuilder/nodes/dge/dgelogic/get-resource.html b/dgbuilder/nodes/dge/dgelogic/get-resource.html index b3b65581..31478d7b 100644 --- a/dgbuilder/nodes/dge/dgelogic/get-resource.html +++ b/dgbuilder/nodes/dge/dgelogic/get-resource.html @@ -108,11 +108,10 @@ return this.name; }, oneditprepare: function() { + var that = this; $( "#node-input-outputs" ).spinner({ min:1 }); - - var comments = $( "#node-input-comments").val(); if(comments != null){ comments = comments.trim(); @@ -121,72 +120,77 @@ } } - function functionDialogResize(ev,ui) { - $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); }; - - $( "#dialog" ).dialog( "option", "width", 1200 ); - $( "#dialog" ).dialog( "option", "height", 750 ); $( "#dialog" ).on("dialogresize", functionDialogResize); $( "#dialog" ).one("dialogopen", function(ev) { var size = $( "#dialog" ).dialog('option','sizeCache-function'); if (size) { - functionDialogResize(null,{size:size}); + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); } }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-xml-editor', + mode: 'ace/mode/html' + }); + this.editor.setValue($("#node-input-xml").val(),-1); + /* + RED.library.create({ + 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/html", + fields:['name','outputs'] + }); + */ + this.editor.focus(); /* close dialog when ESC is pressed and released */ - $( "#dialog" ).keyup(function(event){ + $( "#node-input-xml-editor" ).keyup(function(event){ if(event.which == 27 ) { $("#node-dialog-cancel").click(); } }); - - $( "#dialog" ).one("dialogclose", function(ev,ui) { - var height = $( "#dialog" ).dialog('option','height'); - $( "#dialog" ).off("dialogresize",functionDialogResize); - }); - var that = this; - require(["orion/editor/edit"], function(edit) { - that.editor = edit({ - parent:document.getElementById('node-input-xml-editor'), - lang:"html", - contents: $("#node-input-xml").val() - }); - RED.library.create({ - url:"functions", // where to get the data from - type:"function", // the type of object the library is for - editor:that.editor, // the field name the main text body goes to - fields:['name','outputs'] - }); - $("#node-input-name").focus(); $("#node-input-validate").click(function(){ console.log("validate clicked."); //console.dir(that.editor); //console.log("getText:" + that.editor.getText()); - var val = that.editor.getText(); + var val = that.editor.getValue(); validateXML(val); }); $("#node-input-show-sli-values").click(function(){ - console.log("SLIValues clicked."); - showValuesBox(that.editor,sliValuesObj); + //console.log("show Values clicked."); + showValuesBox(that.editor,sliValuesObj); }); - - }); //for click of add comments button $("#node-input-btnComments").click(function(e){ showCommentsBox(); }); - }, + }, oneditsave: function() { - $("#node-input-xml").val(this.editor.getText()); - var resp=validateXML(this.editor.getText()); + $("#node-input-xml").val(this.editor.getValue()); + var resp=validateXML(this.editor.getValue()); if(resp){ this.status = {fill:"green",shape:"dot",text:"OK"}; }else{ this.status = {fill:"red",shape:"dot",text:"ERROR"}; } delete this.editor; - } + } }); </script> diff --git a/dgbuilder/nodes/dge/dgelogic/is-available.html b/dgbuilder/nodes/dge/dgelogic/is-available.html index 8bc45ef5..32d76650 100644 --- a/dgbuilder/nodes/dge/dgelogic/is-available.html +++ b/dgbuilder/nodes/dge/dgelogic/is-available.html @@ -102,11 +102,10 @@ return this.name; }, oneditprepare: function() { + var that = this; $( "#node-input-outputs" ).spinner({ min:1 }); - - var comments = $( "#node-input-comments").val(); if(comments != null){ comments = comments.trim(); @@ -115,72 +114,77 @@ } } - function functionDialogResize(ev,ui) { - $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); }; - - $( "#dialog" ).dialog( "option", "width", 1200 ); - $( "#dialog" ).dialog( "option", "height", 750 ); $( "#dialog" ).on("dialogresize", functionDialogResize); $( "#dialog" ).one("dialogopen", function(ev) { var size = $( "#dialog" ).dialog('option','sizeCache-function'); if (size) { - functionDialogResize(null,{size:size}); + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); } }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-xml-editor', + mode: 'ace/mode/html' + }); + this.editor.setValue($("#node-input-xml").val(),-1); + /* + RED.library.create({ + 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/html", + fields:['name','outputs'] + }); + */ + this.editor.focus(); /* close dialog when ESC is pressed and released */ - $( "#dialog" ).keyup(function(event){ + $( "#node-input-xml-editor" ).keyup(function(event){ if(event.which == 27 ) { $("#node-dialog-cancel").click(); } }); - - $( "#dialog" ).one("dialogclose", function(ev,ui) { - var height = $( "#dialog" ).dialog('option','height'); - $( "#dialog" ).off("dialogresize",functionDialogResize); - }); - var that = this; - require(["orion/editor/edit"], function(edit) { - that.editor = edit({ - parent:document.getElementById('node-input-xml-editor'), - lang:"html", - contents: $("#node-input-xml").val() - }); - RED.library.create({ - url:"functions", // where to get the data from - type:"function", // the type of object the library is for - editor:that.editor, // the field name the main text body goes to - fields:['name','outputs'] - }); - $("#node-input-name").focus(); $("#node-input-validate").click(function(){ console.log("validate clicked."); //console.dir(that.editor); //console.log("getText:" + that.editor.getText()); - var val = that.editor.getText(); + var val = that.editor.getValue(); validateXML(val); }); $("#node-input-show-sli-values").click(function(){ - console.log("SLIValues clicked."); - showValuesBox(that.editor,sliValuesObj); + //console.log("show Values clicked."); + showValuesBox(that.editor,sliValuesObj); }); - - }); //for click of add comments button $("#node-input-btnComments").click(function(e){ showCommentsBox(); }); - }, + }, oneditsave: function() { - $("#node-input-xml").val(this.editor.getText()); - var resp=validateXML(this.editor.getText()); + $("#node-input-xml").val(this.editor.getValue()); + var resp=validateXML(this.editor.getValue()); if(resp){ this.status = {fill:"green",shape:"dot",text:"OK"}; }else{ this.status = {fill:"red",shape:"dot",text:"ERROR"}; } delete this.editor; - } + } }); </script> diff --git a/dgbuilder/nodes/dge/dgelogic/notify.html b/dgbuilder/nodes/dge/dgelogic/notify.html index e5bc24bc..ec91980c 100644 --- a/dgbuilder/nodes/dge/dgelogic/notify.html +++ b/dgbuilder/nodes/dge/dgelogic/notify.html @@ -111,10 +111,10 @@ return this.name; }, oneditprepare: function() { + var that = this; $( "#node-input-outputs" ).spinner({ min:1 }); - var comments = $( "#node-input-comments").val(); if(comments != null){ comments = comments.trim(); @@ -123,73 +123,77 @@ } } - - function functionDialogResize(ev,ui) { - $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); }; - - $( "#dialog" ).dialog( "option", "width", 1200 ); - $( "#dialog" ).dialog( "option", "height", 750 ); $( "#dialog" ).on("dialogresize", functionDialogResize); $( "#dialog" ).one("dialogopen", function(ev) { var size = $( "#dialog" ).dialog('option','sizeCache-function'); if (size) { - functionDialogResize(null,{size:size}); + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); } }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-xml-editor', + mode: 'ace/mode/html' + }); + this.editor.setValue($("#node-input-xml").val(),-1); + /* + RED.library.create({ + 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/html", + fields:['name','outputs'] + }); + */ + this.editor.focus(); /* close dialog when ESC is pressed and released */ - $( "#dialog" ).keyup(function(event){ + $( "#node-input-xml-editor" ).keyup(function(event){ if(event.which == 27 ) { $("#node-dialog-cancel").click(); } }); - - $( "#dialog" ).one("dialogclose", function(ev,ui) { - var height = $( "#dialog" ).dialog('option','height'); - $( "#dialog" ).off("dialogresize",functionDialogResize); - }); - var that = this; - require(["orion/editor/edit"], function(edit) { - that.editor = edit({ - parent:document.getElementById('node-input-xml-editor'), - lang:"html", - contents: $("#node-input-xml").val() - }); - RED.library.create({ - url:"functions", // where to get the data from - type:"function", // the type of object the library is for - editor:that.editor, // the field name the main text body goes to - fields:['name','outputs'] - }); - $("#node-input-name").focus(); $("#node-input-validate").click(function(){ - //console.log("validate clicked."); + console.log("validate clicked."); //console.dir(that.editor); //console.log("getText:" + that.editor.getText()); - var val = that.editor.getText(); + var val = that.editor.getValue(); validateXML(val); }); $("#node-input-show-sli-values").click(function(){ - //console.log("SLIValues clicked."); - showValuesBox(that.editor,sliValuesObj); + //console.log("show Values clicked."); + showValuesBox(that.editor,sliValuesObj); }); - - }); //for click of add comments button $("#node-input-btnComments").click(function(e){ showCommentsBox(); }); - }, + }, oneditsave: function() { - $("#node-input-xml").val(this.editor.getText()); - var resp=validateXML(this.editor.getText()); + $("#node-input-xml").val(this.editor.getValue()); + var resp=validateXML(this.editor.getValue()); if(resp){ this.status = {fill:"green",shape:"dot",text:"OK"}; }else{ this.status = {fill:"red",shape:"dot",text:"ERROR"}; } delete this.editor; - } + } }); </script> diff --git a/dgbuilder/nodes/dge/dgelogic/record.html b/dgbuilder/nodes/dge/dgelogic/record.html index 3eb7a2e6..facc79cd 100644 --- a/dgbuilder/nodes/dge/dgelogic/record.html +++ b/dgbuilder/nodes/dge/dgelogic/record.html @@ -90,7 +90,7 @@ category: 'DGElogic', defaults: { name: {value:"record"}, - xml: {value:"<record>\n"}, + xml: {value:"<record plugin=''>\n"}, comments:{value:""}, outputs: {value:1} }, @@ -101,11 +101,10 @@ return this.name; }, oneditprepare: function() { + var that = this; $( "#node-input-outputs" ).spinner({ min:1 }); - - var comments = $( "#node-input-comments").val(); if(comments != null){ comments = comments.trim(); @@ -114,72 +113,77 @@ } } - function functionDialogResize(ev,ui) { - $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); }; - - $( "#dialog" ).dialog( "option", "width", 1200 ); - $( "#dialog" ).dialog( "option", "height", 750 ); $( "#dialog" ).on("dialogresize", functionDialogResize); $( "#dialog" ).one("dialogopen", function(ev) { var size = $( "#dialog" ).dialog('option','sizeCache-function'); if (size) { - functionDialogResize(null,{size:size}); + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); } }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-xml-editor', + mode: 'ace/mode/html' + }); + this.editor.setValue($("#node-input-xml").val(),-1); + /* + RED.library.create({ + 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/html", + fields:['name','outputs'] + }); + */ + this.editor.focus(); /* close dialog when ESC is pressed and released */ - $( "#dialog" ).keyup(function(event){ + $( "#node-input-xml-editor" ).keyup(function(event){ if(event.which == 27 ) { $("#node-dialog-cancel").click(); } }); - - $( "#dialog" ).one("dialogclose", function(ev,ui) { - var height = $( "#dialog" ).dialog('option','height'); - $( "#dialog" ).off("dialogresize",functionDialogResize); - }); - var that = this; - require(["orion/editor/edit"], function(edit) { - that.editor = edit({ - parent:document.getElementById('node-input-xml-editor'), - lang:"html", - contents: $("#node-input-xml").val() - }); - RED.library.create({ - url:"functions", // where to get the data from - type:"function", // the type of object the library is for - editor:that.editor, // the field name the main text body goes to - fields:['name','outputs'] - }); - $("#node-input-name").focus(); $("#node-input-validate").click(function(){ console.log("validate clicked."); //console.dir(that.editor); //console.log("getText:" + that.editor.getText()); - var val = that.editor.getText(); + var val = that.editor.getValue(); validateXML(val); }); $("#node-input-show-sli-values").click(function(){ - console.log("SLIValues clicked."); - showValuesBox(that.editor,sliValuesObj); + //console.log("show Values clicked."); + showValuesBox(that.editor,sliValuesObj); }); - - }); //for click of add comments button $("#node-input-btnComments").click(function(e){ showCommentsBox(); }); - }, + }, oneditsave: function() { - $("#node-input-xml").val(this.editor.getText()); - var resp=validateXML(this.editor.getText()); + $("#node-input-xml").val(this.editor.getValue()); + var resp=validateXML(this.editor.getValue()); if(resp){ this.status = {fill:"green",shape:"dot",text:"OK"}; }else{ this.status = {fill:"red",shape:"dot",text:"ERROR"}; } delete this.editor; - } + } }); </script> diff --git a/dgbuilder/nodes/dge/dgelogic/release.html b/dgbuilder/nodes/dge/dgelogic/release.html index 044616a9..dfaf2e9d 100644 --- a/dgbuilder/nodes/dge/dgelogic/release.html +++ b/dgbuilder/nodes/dge/dgelogic/release.html @@ -108,11 +108,10 @@ return this.name; }, oneditprepare: function() { + var that = this; $( "#node-input-outputs" ).spinner({ min:1 }); - - var comments = $( "#node-input-comments").val(); if(comments != null){ comments = comments.trim(); @@ -121,72 +120,77 @@ } } - function functionDialogResize(ev,ui) { - $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); }; - - $( "#dialog" ).dialog( "option", "width", 1200 ); - $( "#dialog" ).dialog( "option", "height", 750 ); $( "#dialog" ).on("dialogresize", functionDialogResize); $( "#dialog" ).one("dialogopen", function(ev) { var size = $( "#dialog" ).dialog('option','sizeCache-function'); if (size) { - functionDialogResize(null,{size:size}); + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); } }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-xml-editor', + mode: 'ace/mode/html' + }); + this.editor.setValue($("#node-input-xml").val(),-1); + /* + RED.library.create({ + 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/html", + fields:['name','outputs'] + }); + */ + this.editor.focus(); /* close dialog when ESC is pressed and released */ - $( "#dialog" ).keyup(function(event){ + $( "#node-input-xml-editor" ).keyup(function(event){ if(event.which == 27 ) { $("#node-dialog-cancel").click(); } }); - - $( "#dialog" ).one("dialogclose", function(ev,ui) { - var height = $( "#dialog" ).dialog('option','height'); - $( "#dialog" ).off("dialogresize",functionDialogResize); - }); - var that = this; - require(["orion/editor/edit"], function(edit) { - that.editor = edit({ - parent:document.getElementById('node-input-xml-editor'), - lang:"html", - contents: $("#node-input-xml").val() - }); - RED.library.create({ - url:"functions", // where to get the data from - type:"function", // the type of object the library is for - editor:that.editor, // the field name the main text body goes to - fields:['name','outputs'] - }); - $("#node-input-name").focus(); $("#node-input-validate").click(function(){ console.log("validate clicked."); //console.dir(that.editor); //console.log("getText:" + that.editor.getText()); - var val = that.editor.getText(); + var val = that.editor.getValue(); validateXML(val); }); $("#node-input-show-sli-values").click(function(){ - console.log("SLIValues clicked."); - showValuesBox(that.editor,sliValuesObj); + //console.log("show Values clicked."); + showValuesBox(that.editor,sliValuesObj); }); - - }); //for click of add comments button $("#node-input-btnComments").click(function(e){ showCommentsBox(); }); - }, + }, oneditsave: function() { - $("#node-input-xml").val(this.editor.getText()); - var resp=validateXML(this.editor.getText()); + $("#node-input-xml").val(this.editor.getValue()); + var resp=validateXML(this.editor.getValue()); if(resp){ this.status = {fill:"green",shape:"dot",text:"OK"}; }else{ this.status = {fill:"red",shape:"dot",text:"ERROR"}; } delete this.editor; - } + } }); </script> diff --git a/dgbuilder/nodes/dge/dgelogic/reserve.html b/dgbuilder/nodes/dge/dgelogic/reserve.html index bcd3fcb9..d706544a 100644 --- a/dgbuilder/nodes/dge/dgelogic/reserve.html +++ b/dgbuilder/nodes/dge/dgelogic/reserve.html @@ -106,10 +106,10 @@ return this.name; }, oneditprepare: function() { + var that = this; $( "#node-input-outputs" ).spinner({ min:1 }); - var comments = $( "#node-input-comments").val(); if(comments != null){ comments = comments.trim(); @@ -118,72 +118,77 @@ } } - function functionDialogResize(ev,ui) { - $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); }; - - $( "#dialog" ).dialog( "option", "width", 1200 ); - $( "#dialog" ).dialog( "option", "height", 750 ); $( "#dialog" ).on("dialogresize", functionDialogResize); $( "#dialog" ).one("dialogopen", function(ev) { var size = $( "#dialog" ).dialog('option','sizeCache-function'); if (size) { - functionDialogResize(null,{size:size}); + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); } }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-xml-editor', + mode: 'ace/mode/html' + }); + this.editor.setValue($("#node-input-xml").val(),-1); + /* + RED.library.create({ + 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/html", + fields:['name','outputs'] + }); + */ + this.editor.focus(); /* close dialog when ESC is pressed and released */ - $( "#dialog" ).keyup(function(event){ + $( "#node-input-xml-editor" ).keyup(function(event){ if(event.which == 27 ) { $("#node-dialog-cancel").click(); } }); - - $( "#dialog" ).one("dialogclose", function(ev,ui) { - var height = $( "#dialog" ).dialog('option','height'); - $( "#dialog" ).off("dialogresize",functionDialogResize); - }); - var that = this; - require(["orion/editor/edit"], function(edit) { - that.editor = edit({ - parent:document.getElementById('node-input-xml-editor'), - lang:"html", - contents: $("#node-input-xml").val() - }); - RED.library.create({ - url:"functions", // where to get the data from - type:"function", // the type of object the library is for - editor:that.editor, // the field name the main text body goes to - fields:['name','outputs'] - }); - $("#node-input-name").focus(); $("#node-input-validate").click(function(){ console.log("validate clicked."); //console.dir(that.editor); //console.log("getText:" + that.editor.getText()); - var val = that.editor.getText(); + var val = that.editor.getValue(); validateXML(val); }); $("#node-input-show-sli-values").click(function(){ - console.log("SLIValues clicked."); - showValuesBox(that.editor,sliValuesObj); + //console.log("show Values clicked."); + showValuesBox(that.editor,sliValuesObj); }); - - }); //for click of add comments button $("#node-input-btnComments").click(function(e){ showCommentsBox(); }); - }, + }, oneditsave: function() { - $("#node-input-xml").val(this.editor.getText()); - var resp=validateXML(this.editor.getText()); + $("#node-input-xml").val(this.editor.getValue()); + var resp=validateXML(this.editor.getValue()); if(resp){ this.status = {fill:"green",shape:"dot",text:"OK"}; }else{ this.status = {fill:"red",shape:"dot",text:"ERROR"}; } delete this.editor; - } + } }); </script> diff --git a/dgbuilder/nodes/dge/dgelogic/save.html b/dgbuilder/nodes/dge/dgelogic/save.html index 6e022154..a34b534c 100644 --- a/dgbuilder/nodes/dge/dgelogic/save.html +++ b/dgbuilder/nodes/dge/dgelogic/save.html @@ -105,11 +105,10 @@ return this.name; }, oneditprepare: function() { + var that = this; $( "#node-input-outputs" ).spinner({ min:1 }); - - var comments = $( "#node-input-comments").val(); if(comments != null){ comments = comments.trim(); @@ -118,72 +117,77 @@ } } - function functionDialogResize(ev,ui) { - $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); }; - - $( "#dialog" ).dialog( "option", "width", 1200 ); - $( "#dialog" ).dialog( "option", "height", 750 ); $( "#dialog" ).on("dialogresize", functionDialogResize); $( "#dialog" ).one("dialogopen", function(ev) { var size = $( "#dialog" ).dialog('option','sizeCache-function'); if (size) { - functionDialogResize(null,{size:size}); + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); } }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-xml-editor', + mode: 'ace/mode/html' + }); + this.editor.setValue($("#node-input-xml").val(),-1); + /* + RED.library.create({ + 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/html", + fields:['name','outputs'] + }); + */ + this.editor.focus(); /* close dialog when ESC is pressed and released */ - $( "#dialog" ).keyup(function(event){ + $( "#node-input-xml-editor" ).keyup(function(event){ if(event.which == 27 ) { $("#node-dialog-cancel").click(); } }); - - $( "#dialog" ).one("dialogclose", function(ev,ui) { - var height = $( "#dialog" ).dialog('option','height'); - $( "#dialog" ).off("dialogresize",functionDialogResize); - }); - var that = this; - require(["orion/editor/edit"], function(edit) { - that.editor = edit({ - parent:document.getElementById('node-input-xml-editor'), - lang:"html", - contents: $("#node-input-xml").val() - }); - RED.library.create({ - url:"functions", // where to get the data from - type:"function", // the type of object the library is for - editor:that.editor, // the field name the main text body goes to - fields:['name','outputs'] - }); - $("#node-input-name").focus(); $("#node-input-validate").click(function(){ console.log("validate clicked."); //console.dir(that.editor); //console.log("getText:" + that.editor.getText()); - var val = that.editor.getText(); + var val = that.editor.getValue(); validateXML(val); }); $("#node-input-show-sli-values").click(function(){ - console.log("SLIValues clicked."); - showValuesBox(that.editor,sliValuesObj); + //console.log("show Values clicked."); + showValuesBox(that.editor,sliValuesObj); }); - - }); //for click of add comments button $("#node-input-btnComments").click(function(e){ showCommentsBox(); }); - }, + }, oneditsave: function() { - $("#node-input-xml").val(this.editor.getText()); - var resp=validateXML(this.editor.getText()); + $("#node-input-xml").val(this.editor.getValue()); + var resp=validateXML(this.editor.getValue()); if(resp){ this.status = {fill:"green",shape:"dot",text:"OK"}; }else{ this.status = {fill:"red",shape:"dot",text:"ERROR"}; } delete this.editor; - } + } }); </script> diff --git a/dgbuilder/nodes/dge/dgelogic/set.html b/dgbuilder/nodes/dge/dgelogic/set.html index bcbcae30..5410d3fe 100644 --- a/dgbuilder/nodes/dge/dgelogic/set.html +++ b/dgbuilder/nodes/dge/dgelogic/set.html @@ -78,11 +78,10 @@ return this.name; }, oneditprepare: function() { + var that = this; $( "#node-input-outputs" ).spinner({ min:1 }); - - var comments = $( "#node-input-comments").val(); if(comments != null){ comments = comments.trim(); @@ -91,72 +90,77 @@ } } - function functionDialogResize(ev,ui) { - $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); }; - - $( "#dialog" ).dialog( "option", "width", 1200 ); - $( "#dialog" ).dialog( "option", "height", 750 ); $( "#dialog" ).on("dialogresize", functionDialogResize); $( "#dialog" ).one("dialogopen", function(ev) { var size = $( "#dialog" ).dialog('option','sizeCache-function'); if (size) { - functionDialogResize(null,{size:size}); + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); } }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-xml-editor', + mode: 'ace/mode/html' + }); + this.editor.setValue($("#node-input-xml").val(),-1); + /* + RED.library.create({ + 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/html", + fields:['name','outputs'] + }); + */ + this.editor.focus(); /* close dialog when ESC is pressed and released */ - $( "#dialog" ).keyup(function(event){ + $( "#node-input-xml-editor" ).keyup(function(event){ if(event.which == 27 ) { $("#node-dialog-cancel").click(); } }); - - $( "#dialog" ).one("dialogclose", function(ev,ui) { - var height = $( "#dialog" ).dialog('option','height'); - $( "#dialog" ).off("dialogresize",functionDialogResize); - }); - var that = this; - require(["orion/editor/edit"], function(edit) { - that.editor = edit({ - parent:document.getElementById('node-input-xml-editor'), - lang:"html", - contents: $("#node-input-xml").val() - }); - RED.library.create({ - url:"functions", // where to get the data from - type:"function", // the type of object the library is for - editor:that.editor, // the field name the main text body goes to - fields:['name','outputs'] - }); - $("#node-input-name").focus(); $("#node-input-validate").click(function(){ console.log("validate clicked."); //console.dir(that.editor); //console.log("getText:" + that.editor.getText()); - var val = that.editor.getText(); + var val = that.editor.getValue(); validateXML(val); }); $("#node-input-show-sli-values").click(function(){ - console.log("SLIValues clicked."); - showValuesBox(that.editor,sliValuesObj); + //console.log("show Values clicked."); + showValuesBox(that.editor,sliValuesObj); }); - - }); //for click of add comments button $("#node-input-btnComments").click(function(e){ showCommentsBox(); }); - }, + }, oneditsave: function() { - $("#node-input-xml").val(this.editor.getText()); - var resp=validateXML(this.editor.getText()); + $("#node-input-xml").val(this.editor.getValue()); + var resp=validateXML(this.editor.getValue()); if(resp){ this.status = {fill:"green",shape:"dot",text:"OK"}; }else{ this.status = {fill:"red",shape:"dot",text:"ERROR"}; } delete this.editor; - } + } }); </script> diff --git a/dgbuilder/nodes/dge/dgelogic/switchNode.html b/dgbuilder/nodes/dge/dgelogic/switchNode.html index 35c9fe67..3088d395 100644 --- a/dgbuilder/nodes/dge/dgelogic/switchNode.html +++ b/dgbuilder/nodes/dge/dgelogic/switchNode.html @@ -120,11 +120,10 @@ return this.name; }, oneditprepare: function() { + var that = this; $( "#node-input-outputs" ).spinner({ min:1 }); - - var comments = $( "#node-input-comments").val(); if(comments != null){ comments = comments.trim(); @@ -133,75 +132,78 @@ } } - function functionDialogResize(ev,ui) { - $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); }; - - $( "#dialog" ).dialog( "option", "width", 1200 ); - $( "#dialog" ).dialog( "option", "height", 750 ); $( "#dialog" ).on("dialogresize", functionDialogResize); $( "#dialog" ).one("dialogopen", function(ev) { var size = $( "#dialog" ).dialog('option','sizeCache-function'); - //To increase the width of dialogbox - //$(".ui-dialog.ui-widget.ui-widget-content.ui-corner-all.ui-front.ui-dialog-buttons.ui-draggable.ui-resizable").css("width","1400px"); if (size) { - functionDialogResize(null,{size:size}); + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); } }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-xml-editor', + mode: 'ace/mode/html' + }); + this.editor.setValue($("#node-input-xml").val(),-1); + /* + RED.library.create({ + 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/html", + fields:['name','outputs'] + }); + */ + this.editor.focus(); /* close dialog when ESC is pressed and released */ - $( "#dialog" ).keyup(function(event){ + $( "#node-input-xml-editor" ).keyup(function(event){ if(event.which == 27 ) { $("#node-dialog-cancel").click(); } }); - - $( "#dialog" ).one("dialogclose", function(ev,ui) { - var height = $( "#dialog" ).dialog('option','height'); - $( "#dialog" ).off("dialogresize",functionDialogResize); - }); - var that = this; - require(["orion/editor/edit"], function(edit) { - that.editor = edit({ - parent:document.getElementById('node-input-xml-editor'), - lang:"html", - contents: $("#node-input-xml").val() - }); - RED.library.create({ - url:"functions", // where to get the data from - type:"function", // the type of object the library is for - editor:that.editor, // the field name the main text body goes to - fields:['name','outputs'] - }); - $("#node-input-name").focus(); $("#node-input-validate").click(function(){ console.log("validate clicked."); //console.dir(that.editor); //console.log("getText:" + that.editor.getText()); - var val = that.editor.getText(); + var val = that.editor.getValue(); validateXML(val); }); $("#node-input-show-sli-values").click(function(){ - console.log("SLIValues clicked."); - showValuesBox(that.editor,sliValuesObj); + //console.log("show Values clicked."); + showValuesBox(that.editor,sliValuesObj); }); - - }); //for click of add comments button $("#node-input-btnComments").click(function(e){ showCommentsBox(); }); - }, + }, oneditsave: function() { - $("#node-input-xml").val(this.editor.getText()); - var resp=validateXML(this.editor.getText()); + $("#node-input-xml").val(this.editor.getValue()); + var resp=validateXML(this.editor.getValue()); if(resp){ this.status = {fill:"green",shape:"dot",text:"OK"}; }else{ this.status = {fill:"red",shape:"dot",text:"ERROR"}; } delete this.editor; - } + } }); function encodeTestStr(xmlStr){ diff --git a/dgbuilder/nodes/dge/dgelogic/update.html b/dgbuilder/nodes/dge/dgelogic/update.html index a7d28283..f6c3adc3 100644 --- a/dgbuilder/nodes/dge/dgelogic/update.html +++ b/dgbuilder/nodes/dge/dgelogic/update.html @@ -111,10 +111,10 @@ return this.name; }, oneditprepare: function() { + var that = this; $( "#node-input-outputs" ).spinner({ min:1 }); - var comments = $( "#node-input-comments").val(); if(comments != null){ comments = comments.trim(); @@ -123,73 +123,77 @@ } } - - function functionDialogResize(ev,ui) { - $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); }; - - $( "#dialog" ).dialog( "option", "width", 1200 ); - $( "#dialog" ).dialog( "option", "height", 750 ); $( "#dialog" ).on("dialogresize", functionDialogResize); $( "#dialog" ).one("dialogopen", function(ev) { var size = $( "#dialog" ).dialog('option','sizeCache-function'); if (size) { - functionDialogResize(null,{size:size}); + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); } }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-xml-editor', + mode: 'ace/mode/html' + }); + this.editor.setValue($("#node-input-xml").val(),-1); + /* + RED.library.create({ + 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/html", + fields:['name','outputs'] + }); + */ + this.editor.focus(); /* close dialog when ESC is pressed and released */ - $( "#dialog" ).keyup(function(event){ + $( "#node-input-xml-editor" ).keyup(function(event){ if(event.which == 27 ) { $("#node-dialog-cancel").click(); } }); - - $( "#dialog" ).one("dialogclose", function(ev,ui) { - var height = $( "#dialog" ).dialog('option','height'); - $( "#dialog" ).off("dialogresize",functionDialogResize); - }); - var that = this; - require(["orion/editor/edit"], function(edit) { - that.editor = edit({ - parent:document.getElementById('node-input-xml-editor'), - lang:"html", - contents: $("#node-input-xml").val() - }); - RED.library.create({ - url:"functions", // where to get the data from - type:"function", // the type of object the library is for - editor:that.editor, // the field name the main text body goes to - fields:['name','outputs'] - }); - $("#node-input-name").focus(); $("#node-input-validate").click(function(){ - //console.log("validate clicked."); + console.log("validate clicked."); //console.dir(that.editor); //console.log("getText:" + that.editor.getText()); - var val = that.editor.getText(); + var val = that.editor.getValue(); validateXML(val); }); $("#node-input-show-sli-values").click(function(){ - //console.log("SLIValues clicked."); - showValuesBox(that.editor,sliValuesObj); + //console.log("show Values clicked."); + showValuesBox(that.editor,sliValuesObj); }); - - }); //for click of add comments button $("#node-input-btnComments").click(function(e){ showCommentsBox(); }); - }, + }, oneditsave: function() { - $("#node-input-xml").val(this.editor.getText()); - var resp=validateXML(this.editor.getText()); + $("#node-input-xml").val(this.editor.getValue()); + var resp=validateXML(this.editor.getValue()); if(resp){ this.status = {fill:"green",shape:"dot",text:"OK"}; }else{ this.status = {fill:"red",shape:"dot",text:"ERROR"}; } delete this.editor; - } + } }); </script> diff --git a/dgbuilder/nodes/dge/dgemain/GenericXML.html b/dgbuilder/nodes/dge/dgemain/GenericXML.html index 4c9c01a6..123473a0 100644 --- a/dgbuilder/nodes/dge/dgemain/GenericXML.html +++ b/dgbuilder/nodes/dge/dgemain/GenericXML.html @@ -59,10 +59,10 @@ return this.name; }, oneditprepare: function() { + var that = this; $( "#node-input-outputs" ).spinner({ min:1 }); - var comments = $( "#node-input-comments").val(); if(comments != null){ comments = comments.trim(); @@ -71,70 +71,77 @@ } } - function functionDialogResize(ev,ui) { - $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); }; - $( "#dialog" ).on("dialogresize", functionDialogResize); $( "#dialog" ).one("dialogopen", function(ev) { var size = $( "#dialog" ).dialog('option','sizeCache-function'); if (size) { - functionDialogResize(null,{size:size}); + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); } }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-xml-editor', + mode: 'ace/mode/html' + }); + this.editor.setValue($("#node-input-xml").val(),-1); + /* + RED.library.create({ + 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/html", + fields:['name','outputs'] + }); + */ + this.editor.focus(); /* close dialog when ESC is pressed and released */ - $( "#dialog" ).keyup(function(event){ + $( "#node-input-xml-editor" ).keyup(function(event){ if(event.which == 27 ) { $("#node-dialog-cancel").click(); } }); - - $( "#dialog" ).one("dialogclose", function(ev,ui) { - var height = $( "#dialog" ).dialog('option','height'); - $( "#dialog" ).off("dialogresize",functionDialogResize); - }); - var that = this; - require(["orion/editor/edit"], function(edit) { - that.editor = edit({ - parent:document.getElementById('node-input-xml-editor'), - lang:"html", - contents: $("#node-input-xml").val() - }); - RED.library.create({ - url:"functions", // where to get the data from - type:"function", // the type of object the library is for - editor:that.editor, // the field name the main text body goes to - fields:['name','outputs'] - }); - $("#node-input-name").focus(); $("#node-input-validate").click(function(){ console.log("validate clicked."); //console.dir(that.editor); //console.log("getText:" + that.editor.getText()); - var val = that.editor.getText(); + var val = that.editor.getValue(); validateXML(val); }); $("#node-input-show-sli-values").click(function(){ - //console.log("SLIValues clicked."); - showValuesBox(that.editor,sliValuesObj); + //console.log("show Values clicked."); + showValuesBox(that.editor,sliValuesObj); }); - - }); //for click of add comments button $("#node-input-btnComments").click(function(e){ showCommentsBox(); }); - }, + }, oneditsave: function() { - $("#node-input-xml").val(this.editor.getText()); - var resp=validateXML(this.editor.getText()); + $("#node-input-xml").val(this.editor.getValue()); + var resp=validateXML(this.editor.getValue()); if(resp){ this.status = {fill:"green",shape:"dot",text:"OK"}; }else{ this.status = {fill:"red",shape:"dot",text:"ERROR"}; } delete this.editor; - } + } }); </script> diff --git a/dgbuilder/nodes/dge/dgemain/comment.html b/dgbuilder/nodes/dge/dgemain/comment.html index c34d14c9..f6da4616 100644 --- a/dgbuilder/nodes/dge/dgemain/comment.html +++ b/dgbuilder/nodes/dge/dgemain/comment.html @@ -22,6 +22,7 @@ <div class="form-row"> <label for="node-input-info" style="width: 100% !important;"><i class="fa fa-comments"></i> More</label> <input type="hidden" id="node-input-info" autofocus="autofocus"> + <div class="form-row node-text-editor-row"> <div style="height: 250px;" class="node-text-editor" id="node-input-info-editor" ></div> <input type="hidden" id="node-input-comments"> </div> @@ -51,6 +52,52 @@ return this.name?"node_label_italic":""; }, oneditprepare: function() { + var that = this; + $( "#node-input-outputs" ).spinner({ + min:1 + }); + var comments = $( "#node-input-comments").val(); + if(comments != null){ + comments = comments.trim(); + if(comments != ''){ + $("#node-input-btnComments").html("<span style='color:blue;'><b>View Comments</b></span>"); + } + } + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); + }; + $( "#dialog" ).on("dialogresize", functionDialogResize); + $( "#dialog" ).one("dialogopen", function(ev) { + var size = $( "#dialog" ).dialog('option','sizeCache-function'); + if (size) { + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); + } + }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-info-editor', + mode: 'ace/mode/markdown', + fontSize: "15pt" + }); + console.dir(this.editor); + this.editor.setValue($("#node-input-info").val(),-1); + this.editor.focus(); + }, +/* + oneditprepare: function() { $( "#node-input-outputs" ).spinner({ min:1 }); @@ -88,9 +135,24 @@ }); $("#node-input-name").focus(); }); + this.editor = RED.editor.createEditor({ + id: 'node-input-info-editor', + mode: 'ace/mode/markdown', + options: { + showLineNumbers : false, + enableBasicAutocompletion : true, + enableSnippets:true, + fontSize: "14px" + } + }); + console.dir(this.editor); + this.editor.setValue($("#node-input-info").val(),-1); + this.editor.focus(); + }, + */ oneditsave: function() { - $("#node-input-info").val(this.editor.getText()); + $("#node-input-info").val(this.editor.getValue()); delete this.editor; } }); diff --git a/dgbuilder/nodes/dge/dgemain/dgstart.html b/dgbuilder/nodes/dge/dgemain/dgstart.html index a203a444..273d51d4 100644 --- a/dgbuilder/nodes/dge/dgemain/dgstart.html +++ b/dgbuilder/nodes/dge/dgemain/dgstart.html @@ -764,7 +764,7 @@ function showDgStartGenerateXmlStatus(){ } var xmlLines = formatted_xml.split("\n"); console.log("Number of lines " + xmlLines.length); - var numberOfLines = xmlLines.length; + //var numberOfLines = xmlLines.length; //var display_formatted_xml = formatted_xml.replace("<","<"); var currentNodeSet = getCurrentFlowNodeSet(); //get max x and y coordinates @@ -810,8 +810,10 @@ function showDgStartGenerateXmlStatus(){ var unformatted_json_str=JSON.stringify(currentNodeSet); var formatted_json = vkbeautify.json(unformatted_json_str); //var displayHtmlStr="<div><textarea readonly='1' style='width:1100px;height:700px;border:none'>" + formatted_xml + "</textarea></div>"; - var displayHtmlStr="<div style='font-size:20px;'><xmp>" + formatted_xml + "</xmp></div>"; - var xmlInfoStr = "<div id='xml-info-div'><p>" + "XML size:" + sizeStr + " <br>Number of Lines:" + numberOfLines + "</p></div>"; + //var displayHtmlStr="<div style='font-size:20px;'><xmp>" + formatted_xml + "</xmp></div>"; + var displayHtmlStr= ""; + + //var xmlInfoStr = "<div id='xml-info-div'><p>" + "XML size:" + sizeStr + " <br>Number of Lines:" + numberOfLines + "</p></div>"; var htmlCode =""; $( "#xmldialog" ).dialog({ title: "XML Generated", @@ -866,6 +868,7 @@ function showDgStartGenerateXmlStatus(){ }, */ "Validate XML" : function (event) { + $("#ace-editor-div").show(); if(!event) event = window.event; var target = $(event.target); target.text("Validating XML"); @@ -928,7 +931,8 @@ function showDgStartGenerateXmlStatus(){ var reqData = { "flowHtml" : htmlCode, "flowXml" : formatted_xml, - "flowJson" : formatted_json + "flowJson" : formatted_json, + "emailAddress" : RED.settings.emailAddress }; $.post( "/sendEmail",reqData ) @@ -988,8 +992,8 @@ function showDgStartGenerateXmlStatus(){ .done(function( data ) { console.log("calling uploadxml. sending to server"); //var successHtmlStr = "<object width='600' height='450' type='text/html' data='" + data.url + "' />"; - - if( data != undefined && data != null && (data.stdout.indexOf('Saving SvcLogicGraph') != -1 || data.stderr.indexOf('Saving SvcLogicGraph') != -1)){ + //console.dir(data); + if( data != undefined && data != null && ((data.stdout != undefined && data.stdout != null && data.stdout.indexOf('Saving SvcLogicGraph') != -1) || (data.stderr != undefined && data.stderr != null && data.stderr.indexOf('Saving SvcLogicGraph') != -1))){ //RED.notify("<strong>Uploaded Successfully</strong>"); //console.dir(data); var _moduleName = data.module; @@ -1204,8 +1208,12 @@ function showDgStartGenerateXmlStatus(){ form.append('<input type="hidden" name="moduleName" value="' + moduleName + '"/>'); form.append('<input type="hidden" name="methodName" value="' + formattedMethodName + '"/>'); form.appendTo('body'); - //$("#flowXmlId").val(formatted_xml); - $("#flowXmlId").val(unformatted_xml_str); + console.log("format_xml:" + format_xml); + if(format_xml == "Y" || format_xml == undefined){ + $("#flowXmlId").val(formatted_xml); + }else{ + $("#flowXmlId").val(unformatted_xml_str); + } $("#dwnldXmlFormId").submit(); //console.log("Form submitted."); }); @@ -1245,8 +1253,12 @@ function showDgStartGenerateXmlStatus(){ form.append('<input type="hidden" name="moduleName" value="' + moduleName + '"/>'); form.append('<input type="hidden" name="methodName" value="' + formattedMethodName + '"/>'); form.appendTo('body'); - //$("#flowJsonId").val(formatted_json); - $("#flowJsonId").val(unformatted_json_str); + console.log("format_json:" + format_json); + if(format_json == "Y" || format_json == undefined){ + $("#flowJsonId").val(formatted_json); + }else{ + $("#flowJsonId").val(unformatted_json_str); + } $("#dwnldJsonFormId").submit(); //console.log("Form submitted."); }); @@ -1261,6 +1273,7 @@ function showDgStartGenerateXmlStatus(){ unformatted_xml_str=""; unformatted_json_str=""; */ + ace.edit('xmldialog').destroy(); $('.ui-dialog:has(#xmldialog)').empty().remove(); RED.view.redraw(); @@ -1272,6 +1285,17 @@ function showDgStartGenerateXmlStatus(){ }, open:function (){ $(function(){ + try{ + var aceEditor = ace.edit("xmldialog"); + aceEditor.setTheme("ace/theme/eclipse"); + aceEditor.session.setMode("ace/mode/xml"); + aceEditor.setValue(formatted_xml); + document.getElementById('xmldialog').style.fontSize='18px'; + aceEditor.setReadOnly(true); + var numberOfLines = aceEditor.session.getLength(); + var xmlInfoStr = "<div id='xml-info-div'><p>" + "XML size:" + sizeStr + " <br>Number of Lines:" + numberOfLines + "</p></div>"; + }catch(err){ + } $("#xmldialog").dialog("widget").find(".ui-dialog-buttonpane").append(xmlInfoStr); console.log("opened."); }); diff --git a/dgbuilder/nodes/dge/dgemain/method.html b/dgbuilder/nodes/dge/dgemain/method.html index 134896e7..c83c3196 100644 --- a/dgbuilder/nodes/dge/dgemain/method.html +++ b/dgbuilder/nodes/dge/dgemain/method.html @@ -57,10 +57,10 @@ return this.name; }, oneditprepare: function() { + var that = this; $( "#node-input-outputs" ).spinner({ min:1 }); - var comments = $( "#node-input-comments").val(); if(comments != null){ comments = comments.trim(); @@ -69,67 +69,71 @@ } } - function functionDialogResize(ev,ui) { - $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); }; - - $( "#dialog" ).dialog( "option", "width", 1200 ); - $( "#dialog" ).dialog( "option", "height", 750 ); $( "#dialog" ).on("dialogresize", functionDialogResize); $( "#dialog" ).one("dialogopen", function(ev) { var size = $( "#dialog" ).dialog('option','sizeCache-function'); if (size) { - functionDialogResize(null,{size:size}); + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); } }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-xml-editor', + mode: 'ace/mode/html' + }); + this.editor.setValue($("#node-input-xml").val(),-1); + /* + RED.library.create({ + 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/html", + fields:['name','outputs'] + }); + */ + this.editor.focus(); /* close dialog when ESC is pressed and released */ - $( "#dialog" ).keyup(function(event){ + $( "#node-input-xml-editor" ).keyup(function(event){ if(event.which == 27 ) { $("#node-dialog-cancel").click(); } }); - - $( "#dialog" ).one("dialogclose", function(ev,ui) { - var height = $( "#dialog" ).dialog('option','height'); - $( "#dialog" ).off("dialogresize",functionDialogResize); - }); - var that = this; - require(["orion/editor/edit"], function(edit) { - that.editor = edit({ - parent:document.getElementById('node-input-xml-editor'), - lang:"html", - contents: $("#node-input-xml").val() - }); - RED.library.create({ - url:"functions", // where to get the data from - type:"function", // the type of object the library is for - editor:that.editor, // the field name the main text body goes to - fields:['name','outputs'] - }); - $("#node-input-name").focus(); $("#node-input-validate").click(function(){ console.log("validate clicked."); //console.dir(that.editor); //console.log("getText:" + that.editor.getText()); - var val = that.editor.getText(); + var val = that.editor.getValue(); validateXML(val); }); $("#node-input-show-sli-values").click(function(){ //console.log("show Values clicked."); showRpcsValuesBox(that.editor,rpcValues); }); - - }); - //for click of add comments button $("#node-input-btnComments").click(function(e){ showCommentsBox(); }); - }, + }, oneditsave: function() { - $("#node-input-xml").val(this.editor.getText()); - var resp=validateXML(this.editor.getText()); + $("#node-input-xml").val(this.editor.getValue()); + var resp=validateXML(this.editor.getValue()); if(resp){ this.status = {fill:"green",shape:"dot",text:"OK"}; }else{ diff --git a/dgbuilder/nodes/dge/dgeoutcome/already-active.html b/dgbuilder/nodes/dge/dgeoutcome/already-active.html index 914bda10..8391acf9 100644 --- a/dgbuilder/nodes/dge/dgeoutcome/already-active.html +++ b/dgbuilder/nodes/dge/dgeoutcome/already-active.html @@ -60,11 +60,10 @@ return this.name; }, oneditprepare: function() { + var that = this; $( "#node-input-outputs" ).spinner({ min:1 }); - - var comments = $( "#node-input-comments").val(); if(comments != null){ comments = comments.trim(); @@ -73,72 +72,77 @@ } } - function functionDialogResize(ev,ui) { - $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); }; - - $( "#dialog" ).dialog( "option", "width", 1200 ); - $( "#dialog" ).dialog( "option", "height", 750 ); $( "#dialog" ).on("dialogresize", functionDialogResize); $( "#dialog" ).one("dialogopen", function(ev) { var size = $( "#dialog" ).dialog('option','sizeCache-function'); if (size) { - functionDialogResize(null,{size:size}); + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); } }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-xml-editor', + mode: 'ace/mode/html' + }); + this.editor.setValue($("#node-input-xml").val(),-1); + /* + RED.library.create({ + 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/html", + fields:['name','outputs'] + }); + */ + this.editor.focus(); /* close dialog when ESC is pressed and released */ - $( "#dialog" ).keyup(function(event){ + $( "#node-input-xml-editor" ).keyup(function(event){ if(event.which == 27 ) { $("#node-dialog-cancel").click(); } }); - - $( "#dialog" ).one("dialogclose", function(ev,ui) { - var height = $( "#dialog" ).dialog('option','height'); - $( "#dialog" ).off("dialogresize",functionDialogResize); - }); - var that = this; - require(["orion/editor/edit"], function(edit) { - that.editor = edit({ - parent:document.getElementById('node-input-xml-editor'), - lang:"html", - contents: $("#node-input-xml").val() - }); - RED.library.create({ - url:"functions", // where to get the data from - type:"function", // the type of object the library is for - editor:that.editor, // the field name the main text body goes to - fields:['name','outputs'] - }); - $("#node-input-name").focus(); $("#node-input-validate").click(function(){ console.log("validate clicked."); //console.dir(that.editor); //console.log("getText:" + that.editor.getText()); - var val = that.editor.getText(); + var val = that.editor.getValue(); validateXML(val); }); $("#node-input-show-sli-values").click(function(){ - console.log("SLIValues clicked."); - showValuesBox(that.editor,sliValuesObj); + //console.log("show Values clicked."); + showValuesBox(that.editor,sliValuesObj); }); - - }); //for click of add comments button $("#node-input-btnComments").click(function(e){ showCommentsBox(); }); - }, + }, oneditsave: function() { - $("#node-input-xml").val(this.editor.getText()); - var resp=validateXML(this.editor.getText()); + $("#node-input-xml").val(this.editor.getValue()); + var resp=validateXML(this.editor.getValue()); if(resp){ this.status = {fill:"green",shape:"dot",text:"OK"}; }else{ this.status = {fill:"red",shape:"dot",text:"ERROR"}; } delete this.editor; - } + } }); </script> diff --git a/dgbuilder/nodes/dge/dgeoutcome/failure.html b/dgbuilder/nodes/dge/dgeoutcome/failure.html index cabfab4b..c5ac20fe 100644 --- a/dgbuilder/nodes/dge/dgeoutcome/failure.html +++ b/dgbuilder/nodes/dge/dgeoutcome/failure.html @@ -58,10 +58,10 @@ return this.name; }, oneditprepare: function() { + var that = this; $( "#node-input-outputs" ).spinner({ min:1 }); - var comments = $( "#node-input-comments").val(); if(comments != null){ comments = comments.trim(); @@ -70,73 +70,77 @@ } } - - function functionDialogResize(ev,ui) { - $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); }; - - $( "#dialog" ).dialog( "option", "width", 1200 ); - $( "#dialog" ).dialog( "option", "height", 750 ); $( "#dialog" ).on("dialogresize", functionDialogResize); $( "#dialog" ).one("dialogopen", function(ev) { var size = $( "#dialog" ).dialog('option','sizeCache-function'); if (size) { - functionDialogResize(null,{size:size}); + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); } }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-xml-editor', + mode: 'ace/mode/html' + }); + this.editor.setValue($("#node-input-xml").val(),-1); + /* + RED.library.create({ + 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/html", + fields:['name','outputs'] + }); + */ + this.editor.focus(); /* close dialog when ESC is pressed and released */ - $( "#dialog" ).keyup(function(event){ + $( "#node-input-xml-editor" ).keyup(function(event){ if(event.which == 27 ) { $("#node-dialog-cancel").click(); } }); - - $( "#dialog" ).one("dialogclose", function(ev,ui) { - var height = $( "#dialog" ).dialog('option','height'); - $( "#dialog" ).off("dialogresize",functionDialogResize); - }); - var that = this; - require(["orion/editor/edit"], function(edit) { - that.editor = edit({ - parent:document.getElementById('node-input-xml-editor'), - lang:"html", - contents: $("#node-input-xml").val() - }); - RED.library.create({ - url:"functions", // where to get the data from - type:"function", // the type of object the library is for - editor:that.editor, // the field name the main text body goes to - fields:['name','outputs'] - }); - $("#node-input-name").focus(); $("#node-input-validate").click(function(){ console.log("validate clicked."); //console.dir(that.editor); //console.log("getText:" + that.editor.getText()); - var val = that.editor.getText(); + var val = that.editor.getValue(); validateXML(val); }); $("#node-input-show-sli-values").click(function(){ - console.log("SLIValues clicked."); - showValuesBox(that.editor,sliValuesObj); + //console.log("show Values clicked."); + showValuesBox(that.editor,sliValuesObj); }); - - }); //for click of add comments button $("#node-input-btnComments").click(function(e){ showCommentsBox(); }); - }, + }, oneditsave: function() { - $("#node-input-xml").val(this.editor.getText()); - var resp=validateXML(this.editor.getText()); + $("#node-input-xml").val(this.editor.getValue()); + var resp=validateXML(this.editor.getValue()); if(resp){ this.status = {fill:"green",shape:"dot",text:"OK"}; }else{ this.status = {fill:"red",shape:"dot",text:"ERROR"}; } delete this.editor; - } + } }); </script> diff --git a/dgbuilder/nodes/dge/dgeoutcome/not-found.html b/dgbuilder/nodes/dge/dgeoutcome/not-found.html index 0b6bb8f9..67bc276f 100644 --- a/dgbuilder/nodes/dge/dgeoutcome/not-found.html +++ b/dgbuilder/nodes/dge/dgeoutcome/not-found.html @@ -58,11 +58,10 @@ return this.name; }, oneditprepare: function() { + var that = this; $( "#node-input-outputs" ).spinner({ min:1 }); - - var comments = $( "#node-input-comments").val(); if(comments != null){ comments = comments.trim(); @@ -71,72 +70,77 @@ } } - function functionDialogResize(ev,ui) { - $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); }; - - $( "#dialog" ).dialog( "option", "width", 1200 ); - $( "#dialog" ).dialog( "option", "height", 750 ); $( "#dialog" ).on("dialogresize", functionDialogResize); $( "#dialog" ).one("dialogopen", function(ev) { var size = $( "#dialog" ).dialog('option','sizeCache-function'); if (size) { - functionDialogResize(null,{size:size}); + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); } }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-xml-editor', + mode: 'ace/mode/html' + }); + this.editor.setValue($("#node-input-xml").val(),-1); + /* + RED.library.create({ + 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/html", + fields:['name','outputs'] + }); + */ + this.editor.focus(); /* close dialog when ESC is pressed and released */ - $( "#dialog" ).keyup(function(event){ + $( "#node-input-xml-editor" ).keyup(function(event){ if(event.which == 27 ) { $("#node-dialog-cancel").click(); } }); - - $( "#dialog" ).one("dialogclose", function(ev,ui) { - var height = $( "#dialog" ).dialog('option','height'); - $( "#dialog" ).off("dialogresize",functionDialogResize); - }); - var that = this; - require(["orion/editor/edit"], function(edit) { - that.editor = edit({ - parent:document.getElementById('node-input-xml-editor'), - lang:"html", - contents: $("#node-input-xml").val() - }); - RED.library.create({ - url:"functions", // where to get the data from - type:"function", // the type of object the library is for - editor:that.editor, // the field name the main text body goes to - fields:['name','outputs'] - }); - $("#node-input-name").focus(); $("#node-input-validate").click(function(){ console.log("validate clicked."); //console.dir(that.editor); //console.log("getText:" + that.editor.getText()); - var val = that.editor.getText(); + var val = that.editor.getValue(); validateXML(val); }); $("#node-input-show-sli-values").click(function(){ - console.log("SLIValues clicked."); - showValuesBox(that.editor,sliValuesObj); + //console.log("show Values clicked."); + showValuesBox(that.editor,sliValuesObj); }); - - }); //for click of add comments button $("#node-input-btnComments").click(function(e){ showCommentsBox(); }); - }, + }, oneditsave: function() { - $("#node-input-xml").val(this.editor.getText()); - var resp=validateXML(this.editor.getText()); + $("#node-input-xml").val(this.editor.getValue()); + var resp=validateXML(this.editor.getValue()); if(resp){ this.status = {fill:"green",shape:"dot",text:"OK"}; }else{ this.status = {fill:"red",shape:"dot",text:"ERROR"}; } delete this.editor; - } + } }); </script> diff --git a/dgbuilder/nodes/dge/dgeoutcome/other.html b/dgbuilder/nodes/dge/dgeoutcome/other.html index 7ceb2e79..135cfe31 100644 --- a/dgbuilder/nodes/dge/dgeoutcome/other.html +++ b/dgbuilder/nodes/dge/dgeoutcome/other.html @@ -59,10 +59,10 @@ return this.name; }, oneditprepare: function() { + var that = this; $( "#node-input-outputs" ).spinner({ min:1 }); - var comments = $( "#node-input-comments").val(); if(comments != null){ comments = comments.trim(); @@ -71,73 +71,77 @@ } } - - function functionDialogResize(ev,ui) { - $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); }; - - $( "#dialog" ).dialog( "option", "width", 1200 ); - $( "#dialog" ).dialog( "option", "height", 750 ); $( "#dialog" ).on("dialogresize", functionDialogResize); $( "#dialog" ).one("dialogopen", function(ev) { var size = $( "#dialog" ).dialog('option','sizeCache-function'); if (size) { - functionDialogResize(null,{size:size}); + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); } }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-xml-editor', + mode: 'ace/mode/html' + }); + this.editor.setValue($("#node-input-xml").val(),-1); + /* + RED.library.create({ + 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/html", + fields:['name','outputs'] + }); + */ + this.editor.focus(); /* close dialog when ESC is pressed and released */ - $( "#dialog" ).keyup(function(event){ + $( "#node-input-xml-editor" ).keyup(function(event){ if(event.which == 27 ) { $("#node-dialog-cancel").click(); } }); - - $( "#dialog" ).one("dialogclose", function(ev,ui) { - var height = $( "#dialog" ).dialog('option','height'); - $( "#dialog" ).off("dialogresize",functionDialogResize); - }); - var that = this; - require(["orion/editor/edit"], function(edit) { - that.editor = edit({ - parent:document.getElementById('node-input-xml-editor'), - lang:"html", - contents: $("#node-input-xml").val() - }); - RED.library.create({ - url:"functions", // where to get the data from - type:"function", // the type of object the library is for - editor:that.editor, // the field name the main text body goes to - fields:['name','outputs'] - }); - $("#node-input-name").focus(); $("#node-input-validate").click(function(){ console.log("validate clicked."); //console.dir(that.editor); //console.log("getText:" + that.editor.getText()); - var val = that.editor.getText(); + var val = that.editor.getValue(); validateXML(val); }); $("#node-input-show-sli-values").click(function(){ - console.log("SLIValues clicked."); - showValuesBox(that.editor,sliValuesObj); + //console.log("show Values clicked."); + showValuesBox(that.editor,sliValuesObj); }); - - }); //for click of add comments button $("#node-input-btnComments").click(function(e){ showCommentsBox(); }); - }, + }, oneditsave: function() { - $("#node-input-xml").val(this.editor.getText()); - var resp=validateXML(this.editor.getText()); + $("#node-input-xml").val(this.editor.getValue()); + var resp=validateXML(this.editor.getValue()); if(resp){ this.status = {fill:"green",shape:"dot",text:"OK"}; }else{ this.status = {fill:"red",shape:"dot",text:"ERROR"}; } delete this.editor; - } + } }); </script> diff --git a/dgbuilder/nodes/dge/dgeoutcome/outcome.html b/dgbuilder/nodes/dge/dgeoutcome/outcome.html index 122f7d3d..f5c2dd02 100644 --- a/dgbuilder/nodes/dge/dgeoutcome/outcome.html +++ b/dgbuilder/nodes/dge/dgeoutcome/outcome.html @@ -59,11 +59,10 @@ return this.name; }, oneditprepare: function() { + var that = this; $( "#node-input-outputs" ).spinner({ min:1 }); - - var comments = $( "#node-input-comments").val(); if(comments != null){ comments = comments.trim(); @@ -72,72 +71,77 @@ } } - function functionDialogResize(ev,ui) { - $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); }; - - $( "#dialog" ).dialog( "option", "width", 1200 ); - $( "#dialog" ).dialog( "option", "height", 750 ); $( "#dialog" ).on("dialogresize", functionDialogResize); $( "#dialog" ).one("dialogopen", function(ev) { var size = $( "#dialog" ).dialog('option','sizeCache-function'); if (size) { - functionDialogResize(null,{size:size}); + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); } }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-xml-editor', + mode: 'ace/mode/html' + }); + this.editor.setValue($("#node-input-xml").val(),-1); + /* + RED.library.create({ + 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/html", + fields:['name','outputs'] + }); + */ + this.editor.focus(); /* close dialog when ESC is pressed and released */ - $( "#dialog" ).keyup(function(event){ + $( "#node-input-xml-editor" ).keyup(function(event){ if(event.which == 27 ) { $("#node-dialog-cancel").click(); } }); - - $( "#dialog" ).one("dialogclose", function(ev,ui) { - var height = $( "#dialog" ).dialog('option','height'); - $( "#dialog" ).off("dialogresize",functionDialogResize); - }); - var that = this; - require(["orion/editor/edit"], function(edit) { - that.editor = edit({ - parent:document.getElementById('node-input-xml-editor'), - lang:"html", - contents: $("#node-input-xml").val() - }); - RED.library.create({ - url:"functions", // where to get the data from - type:"function", // the type of object the library is for - editor:that.editor, // the field name the main text body goes to - fields:['name','outputs'] - }); - $("#node-input-name").focus(); $("#node-input-validate").click(function(){ console.log("validate clicked."); //console.dir(that.editor); //console.log("getText:" + that.editor.getText()); - var val = that.editor.getText(); + var val = that.editor.getValue(); validateXML(val); }); $("#node-input-show-sli-values").click(function(){ - console.log("SLIValues clicked."); - showValuesBox(that.editor,sliValuesObj); + //console.log("show Values clicked."); + showValuesBox(that.editor,sliValuesObj); }); - - }); //for click of add comments button $("#node-input-btnComments").click(function(e){ showCommentsBox(); }); - }, + }, oneditsave: function() { - $("#node-input-xml").val(this.editor.getText()); - var resp=validateXML(this.editor.getText()); + $("#node-input-xml").val(this.editor.getValue()); + var resp=validateXML(this.editor.getValue()); if(resp){ this.status = {fill:"green",shape:"dot",text:"OK"}; }else{ this.status = {fill:"red",shape:"dot",text:"ERROR"}; } delete this.editor; - } + } }); </script> diff --git a/dgbuilder/nodes/dge/dgeoutcome/outcomeFalse.html b/dgbuilder/nodes/dge/dgeoutcome/outcomeFalse.html index d1044208..79727720 100644 --- a/dgbuilder/nodes/dge/dgeoutcome/outcomeFalse.html +++ b/dgbuilder/nodes/dge/dgeoutcome/outcomeFalse.html @@ -59,11 +59,10 @@ return this.name; }, oneditprepare: function() { + var that = this; $( "#node-input-outputs" ).spinner({ min:1 }); - - var comments = $( "#node-input-comments").val(); if(comments != null){ comments = comments.trim(); @@ -72,72 +71,77 @@ } } - function functionDialogResize(ev,ui) { - $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); }; - - $( "#dialog" ).dialog( "option", "width", 1200 ); - $( "#dialog" ).dialog( "option", "height", 750 ); $( "#dialog" ).on("dialogresize", functionDialogResize); $( "#dialog" ).one("dialogopen", function(ev) { var size = $( "#dialog" ).dialog('option','sizeCache-function'); if (size) { - functionDialogResize(null,{size:size}); + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); } }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-xml-editor', + mode: 'ace/mode/html' + }); + this.editor.setValue($("#node-input-xml").val(),-1); + /* + RED.library.create({ + 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/html", + fields:['name','outputs'] + }); + */ + this.editor.focus(); /* close dialog when ESC is pressed and released */ - $( "#dialog" ).keyup(function(event){ + $( "#node-input-xml-editor" ).keyup(function(event){ if(event.which == 27 ) { $("#node-dialog-cancel").click(); } }); - - $( "#dialog" ).one("dialogclose", function(ev,ui) { - var height = $( "#dialog" ).dialog('option','height'); - $( "#dialog" ).off("dialogresize",functionDialogResize); - }); - var that = this; - require(["orion/editor/edit"], function(edit) { - that.editor = edit({ - parent:document.getElementById('node-input-xml-editor'), - lang:"html", - contents: $("#node-input-xml").val() - }); - RED.library.create({ - url:"functions", // where to get the data from - type:"function", // the type of object the library is for - editor:that.editor, // the field name the main text body goes to - fields:['name','outputs'] - }); - $("#node-input-name").focus(); $("#node-input-validate").click(function(){ console.log("validate clicked."); //console.dir(that.editor); //console.log("getText:" + that.editor.getText()); - var val = that.editor.getText(); + var val = that.editor.getValue(); validateXML(val); }); $("#node-input-show-sli-values").click(function(){ - console.log("SLIValues clicked."); - showValuesBox(that.editor,sliValuesObj); + //console.log("show Values clicked."); + showValuesBox(that.editor,sliValuesObj); }); - - }); //for click of add comments button $("#node-input-btnComments").click(function(e){ showCommentsBox(); }); - }, + }, oneditsave: function() { - $("#node-input-xml").val(this.editor.getText()); - var resp=validateXML(this.editor.getText()); + $("#node-input-xml").val(this.editor.getValue()); + var resp=validateXML(this.editor.getValue()); if(resp){ this.status = {fill:"green",shape:"dot",text:"OK"}; }else{ this.status = {fill:"red",shape:"dot",text:"ERROR"}; } delete this.editor; - } + } }); </script> diff --git a/dgbuilder/nodes/dge/dgeoutcome/outcomeTrue.html b/dgbuilder/nodes/dge/dgeoutcome/outcomeTrue.html index a080bbf6..cdd6e361 100644 --- a/dgbuilder/nodes/dge/dgeoutcome/outcomeTrue.html +++ b/dgbuilder/nodes/dge/dgeoutcome/outcomeTrue.html @@ -58,10 +58,10 @@ return this.name; }, oneditprepare: function() { + var that = this; $( "#node-input-outputs" ).spinner({ min:1 }); - var comments = $( "#node-input-comments").val(); if(comments != null){ comments = comments.trim(); @@ -70,73 +70,77 @@ } } - - function functionDialogResize(ev,ui) { - $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); }; - - $( "#dialog" ).dialog( "option", "width", 1200 ); - $( "#dialog" ).dialog( "option", "height", 750 ); $( "#dialog" ).on("dialogresize", functionDialogResize); $( "#dialog" ).one("dialogopen", function(ev) { var size = $( "#dialog" ).dialog('option','sizeCache-function'); if (size) { - functionDialogResize(null,{size:size}); + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); } }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-xml-editor', + mode: 'ace/mode/html' + }); + this.editor.setValue($("#node-input-xml").val(),-1); + /* + RED.library.create({ + 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/html", + fields:['name','outputs'] + }); + */ + this.editor.focus(); /* close dialog when ESC is pressed and released */ - $( "#dialog" ).keyup(function(event){ + $( "#node-input-xml-editor" ).keyup(function(event){ if(event.which == 27 ) { $("#node-dialog-cancel").click(); } }); - - $( "#dialog" ).one("dialogclose", function(ev,ui) { - var height = $( "#dialog" ).dialog('option','height'); - $( "#dialog" ).off("dialogresize",functionDialogResize); - }); - var that = this; - require(["orion/editor/edit"], function(edit) { - that.editor = edit({ - parent:document.getElementById('node-input-xml-editor'), - lang:"html", - contents: $("#node-input-xml").val() - }); - RED.library.create({ - url:"functions", // where to get the data from - type:"function", // the type of object the library is for - editor:that.editor, // the field name the main text body goes to - fields:['name','outputs'] - }); - $("#node-input-name").focus(); $("#node-input-validate").click(function(){ console.log("validate clicked."); //console.dir(that.editor); //console.log("getText:" + that.editor.getText()); - var val = that.editor.getText(); + var val = that.editor.getValue(); validateXML(val); }); $("#node-input-show-sli-values").click(function(){ - console.log("SLIValues clicked."); - showValuesBox(that.editor,sliValuesObj); + //console.log("show Values clicked."); + showValuesBox(that.editor,sliValuesObj); }); - - }); //for click of add comments button $("#node-input-btnComments").click(function(e){ showCommentsBox(); }); - }, + }, oneditsave: function() { - $("#node-input-xml").val(this.editor.getText()); - var resp=validateXML(this.editor.getText()); + $("#node-input-xml").val(this.editor.getValue()); + var resp=validateXML(this.editor.getValue()); if(resp){ this.status = {fill:"green",shape:"dot",text:"OK"}; }else{ this.status = {fill:"red",shape:"dot",text:"ERROR"}; } delete this.editor; - } + } }); </script> diff --git a/dgbuilder/nodes/dge/dgeoutcome/success.html b/dgbuilder/nodes/dge/dgeoutcome/success.html index 347d7d6a..3a4dee63 100644 --- a/dgbuilder/nodes/dge/dgeoutcome/success.html +++ b/dgbuilder/nodes/dge/dgeoutcome/success.html @@ -58,10 +58,10 @@ return this.name; }, oneditprepare: function() { + var that = this; $( "#node-input-outputs" ).spinner({ min:1 }); - var comments = $( "#node-input-comments").val(); if(comments != null){ comments = comments.trim(); @@ -70,72 +70,77 @@ } } - - function functionDialogResize(ev,ui) { - $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); }; - - $( "#dialog" ).dialog( "option", "width", 1200 ); - $( "#dialog" ).dialog( "option", "height", 750 ); $( "#dialog" ).on("dialogresize", functionDialogResize); $( "#dialog" ).one("dialogopen", function(ev) { var size = $( "#dialog" ).dialog('option','sizeCache-function'); if (size) { - functionDialogResize(null,{size:size}); + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); } }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-xml-editor', + mode: 'ace/mode/html' + }); + this.editor.setValue($("#node-input-xml").val(),-1); + /* + RED.library.create({ + 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/html", + fields:['name','outputs'] + }); + */ + this.editor.focus(); /* close dialog when ESC is pressed and released */ - $( "#dialog" ).keyup(function(event){ + $( "#node-input-xml-editor" ).keyup(function(event){ if(event.which == 27 ) { $("#node-dialog-cancel").click(); } }); - - $( "#dialog" ).one("dialogclose", function(ev,ui) { - var height = $( "#dialog" ).dialog('option','height'); - $( "#dialog" ).off("dialogresize",functionDialogResize); - }); - var that = this; - require(["orion/editor/edit"], function(edit) { - that.editor = edit({ - parent:document.getElementById('node-input-xml-editor'), - lang:"html", - contents: $("#node-input-xml").val() - }); - RED.library.create({ - url:"functions", // where to get the data from - type:"function", // the type of object the library is for - editor:that.editor, // the field name the main text body goes to - fields:['name','outputs'] - }); - $("#node-input-name").focus(); $("#node-input-validate").click(function(){ console.log("validate clicked."); //console.dir(that.editor); //console.log("getText:" + that.editor.getText()); - var val = that.editor.getText(); + var val = that.editor.getValue(); validateXML(val); }); $("#node-input-show-sli-values").click(function(){ - console.log("SLIValues clicked."); - showValuesBox(that.editor,sliValuesObj); + //console.log("show Values clicked."); + showValuesBox(that.editor,sliValuesObj); }); - }); //for click of add comments button $("#node-input-btnComments").click(function(e){ showCommentsBox(); }); - }, + }, oneditsave: function() { - $("#node-input-xml").val(this.editor.getText()); - var resp=validateXML(this.editor.getText()); + $("#node-input-xml").val(this.editor.getValue()); + var resp=validateXML(this.editor.getValue()); if(resp){ this.status = {fill:"green",shape:"dot",text:"OK"}; }else{ this.status = {fill:"red",shape:"dot",text:"ERROR"}; } delete this.editor; - } - }); + } + }); </script> diff --git a/dgbuilder/nodes/dge/dgereturn/returnFailure.html b/dgbuilder/nodes/dge/dgereturn/returnFailure.html index 60ab2299..d88bdc6f 100644 --- a/dgbuilder/nodes/dge/dgereturn/returnFailure.html +++ b/dgbuilder/nodes/dge/dgereturn/returnFailure.html @@ -89,7 +89,10 @@ return this.name; }, oneditprepare: function() { - + var that = this; + $( "#node-input-outputs" ).spinner({ + min:1 + }); var comments = $( "#node-input-comments").val(); if(comments != null){ comments = comments.trim(); @@ -98,73 +101,77 @@ } } - - function functionDialogResize(ev,ui) { - $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); }; - - $( "#dialog" ).dialog( "option", "width", 1200 ); - $( "#dialog" ).dialog( "option", "height", 750 ); $( "#dialog" ).on("dialogresize", functionDialogResize); $( "#dialog" ).one("dialogopen", function(ev) { var size = $( "#dialog" ).dialog('option','sizeCache-function'); if (size) { - functionDialogResize(null,{size:size}); + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); } }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-xml-editor', + mode: 'ace/mode/html' + }); + this.editor.setValue($("#node-input-xml").val(),-1); + /* + RED.library.create({ + 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/html", + fields:['name','outputs'] + }); + */ + this.editor.focus(); /* close dialog when ESC is pressed and released */ - $( "#dialog" ).keyup(function(event){ + $( "#node-input-xml-editor" ).keyup(function(event){ if(event.which == 27 ) { $("#node-dialog-cancel").click(); } }); - - $( "#dialog" ).one("dialogclose", function(ev,ui) { - var height = $( "#dialog" ).dialog('option','height'); - $( "#dialog" ).off("dialogresize",functionDialogResize); - }); - var that = this; - require(["orion/editor/edit"], function(edit) { - that.editor = edit({ - parent:document.getElementById('node-input-xml-editor'), - lang:"html", - contents: $("#node-input-xml").val() - }); - RED.library.create({ - url:"functions", // where to get the data from - type:"function", // the type of object the library is for - editor:that.editor, // the field name the main text body goes to - fields:['name','outputs'] - }); - $("#node-input-name").focus(); $("#node-input-validate").click(function(){ console.log("validate clicked."); //console.dir(that.editor); //console.log("getText:" + that.editor.getText()); - var val = that.editor.getText(); + var val = that.editor.getValue(); validateXML(val); }); $("#node-input-show-sli-values").click(function(){ - console.log("SLIValues clicked."); - showValuesBox(that.editor,sliValuesObj); + //console.log("show Values clicked."); + showValuesBox(that.editor,sliValuesObj); }); - - }); //for click of add comments button $("#node-input-btnComments").click(function(e){ showCommentsBox(); }); - }, + }, oneditsave: function() { - $("#node-input-xml").val(this.editor.getText()); - var resp=validateXML(this.editor.getText()); + $("#node-input-xml").val(this.editor.getValue()); + var resp=validateXML(this.editor.getValue()); if(resp){ this.status = {fill:"green",shape:"dot",text:"OK"}; }else{ this.status = {fill:"red",shape:"dot",text:"ERROR"}; } delete this.editor; - } + } }); </script> diff --git a/dgbuilder/nodes/dge/dgereturn/returnSuccess.html b/dgbuilder/nodes/dge/dgereturn/returnSuccess.html index e2d50f3a..ede22b4f 100644 --- a/dgbuilder/nodes/dge/dgereturn/returnSuccess.html +++ b/dgbuilder/nodes/dge/dgereturn/returnSuccess.html @@ -91,8 +91,10 @@ return this.name; }, oneditprepare: function() { - - + var that = this; + $( "#node-input-outputs" ).spinner({ + min:1 + }); var comments = $( "#node-input-comments").val(); if(comments != null){ comments = comments.trim(); @@ -101,74 +103,77 @@ } } - function functionDialogResize(ev,ui) { - $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + function functionDialogResize() { + var rows = $("#dialog-form>div:not(.node-text-editor-row)"); + var height = $("#dialog-form").height(); + for (var i=0;i<rows.size();i++) { + height -= $(rows[i]).outerHeight(true); + } + var editorRow = $("#dialog-form>div.node-text-editor-row"); + height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom"))); + $(".node-text-editor").css("height",height+"px"); + that.editor.resize(); }; - - $( "#dialog" ).dialog( "option", "width", 1200 ); - $( "#dialog" ).dialog( "option", "height", 750 ); $( "#dialog" ).on("dialogresize", functionDialogResize); $( "#dialog" ).one("dialogopen", function(ev) { var size = $( "#dialog" ).dialog('option','sizeCache-function'); if (size) { - functionDialogResize(null,{size:size}); + $("#dialog").dialog('option','width',size.width); + $("#dialog").dialog('option','height',size.height); + functionDialogResize(); } }); + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + this.editor = RED.editor.createEditor({ + id: 'node-input-xml-editor', + mode: 'ace/mode/html' + }); + this.editor.setValue($("#node-input-xml").val(),-1); + /* + RED.library.create({ + 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/html", + fields:['name','outputs'] + }); + */ + this.editor.focus(); /* close dialog when ESC is pressed and released */ - $( "#dialog" ).keyup(function(event){ + $( "#node-input-xml-editor" ).keyup(function(event){ if(event.which == 27 ) { $("#node-dialog-cancel").click(); } }); - - - $( "#dialog" ).one("dialogclose", function(ev,ui) { - var height = $( "#dialog" ).dialog('option','height'); - $( "#dialog" ).off("dialogresize",functionDialogResize); - }); - - var that = this; - require(["orion/editor/edit"], function(edit) { - that.editor = edit({ - parent:document.getElementById('node-input-xml-editor'), - lang:"html", - contents: $("#node-input-xml").val() - }); - RED.library.create({ - url:"functions", // where to get the data from - type:"function", // the type of object the library is for - editor:that.editor, // the field name the main text body goes to - fields:['name','outputs'] - }); - $("#node-input-name").focus(); $("#node-input-validate").click(function(){ console.log("validate clicked."); //console.dir(that.editor); //console.log("getText:" + that.editor.getText()); - var val = that.editor.getText(); + var val = that.editor.getValue(); validateXML(val); }); $("#node-input-show-sli-values").click(function(){ - console.log("SLIValues clicked."); - showValuesBox(that.editor,sliValuesObj); + //console.log("show Values clicked."); + showValuesBox(that.editor,sliValuesObj); }); - }); //for click of add comments button $("#node-input-btnComments").click(function(e){ showCommentsBox(); }); - - }, + }, oneditsave: function() { - $("#node-input-xml").val(this.editor.getText()); - var resp=validateXML(this.editor.getText()); + $("#node-input-xml").val(this.editor.getValue()); + var resp=validateXML(this.editor.getValue()); if(resp){ this.status = {fill:"green",shape:"dot",text:"OK"}; }else{ this.status = {fill:"red",shape:"dot",text:"ERROR"}; } delete this.editor; - } + } }); </script> |