summaryrefslogtreecommitdiffstats
path: root/dgbuilder/nodes/dge/dgeoutcome
diff options
context:
space:
mode:
authorChinthakayala,Sheshashailavas(sc2914) <sc2914@att.com>2018-06-27 16:11:44 +0000
committerChinthakayala,Sheshashailavas(sc2914) <sc2914@att.com>2018-06-27 16:25:31 +0000
commit8f6a6c445eaeb7356e1db9d10d10b7d3fa42f27e (patch)
treebf1e5c83c357fbd4a0158cac6d41bd936e949a80 /dgbuilder/nodes/dge/dgeoutcome
parente14a02086c9119532f9153c78346d5c1d6789ca9 (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/dgeoutcome')
-rw-r--r--dgbuilder/nodes/dge/dgeoutcome/already-active.html78
-rw-r--r--dgbuilder/nodes/dge/dgeoutcome/failure.html78
-rw-r--r--dgbuilder/nodes/dge/dgeoutcome/not-found.html78
-rw-r--r--dgbuilder/nodes/dge/dgeoutcome/other.html78
-rw-r--r--dgbuilder/nodes/dge/dgeoutcome/outcome.html78
-rw-r--r--dgbuilder/nodes/dge/dgeoutcome/outcomeFalse.html78
-rw-r--r--dgbuilder/nodes/dge/dgeoutcome/outcomeTrue.html78
-rw-r--r--dgbuilder/nodes/dge/dgeoutcome/success.html79
8 files changed, 329 insertions, 296 deletions
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>