summaryrefslogtreecommitdiffstats
path: root/dgbuilder/nodes/dge/dgemain/comment.html
diff options
context:
space:
mode:
Diffstat (limited to 'dgbuilder/nodes/dge/dgemain/comment.html')
-rw-r--r--dgbuilder/nodes/dge/dgemain/comment.html64
1 files changed, 63 insertions, 1 deletions
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;
}
});