summaryrefslogtreecommitdiffstats
path: root/dgbuilder/nodes/dge/dgelogic/forNode.html
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/dgelogic/forNode.html
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/dgelogic/forNode.html')
-rw-r--r--dgbuilder/nodes/dge/dgelogic/forNode.html78
1 files changed, 41 insertions, 37 deletions
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>