Remove old nodes and add new ones

This commit is contained in:
Jordan McClintock 2022-02-23 16:59:16 -06:00 committed by andrew.greene
parent 8cf6160c06
commit 73de270db8
7 changed files with 277 additions and 0 deletions

View File

@ -0,0 +1,67 @@
<!-- 2022 Modification Copyright - Defense Unicorns -->
<script type="text/html" data-template-name="guide">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
</div>
<div class="form-row node-text-editor-row">
<input type="hidden" id="node-input-info" autofocus="autofocus">
<div style="height: 250px; min-height:150px;" class="node-text-editor" id="node-input-info-editor"></div>
</div>
</script>
<script type="text/x-red" data-help-name="guide">
<p>A node that contains a step by step guide on how to do something.</p>
</script>
<script type="text/javascript">
RED.nodes.registerType('guide',{
category: 'common',
color:"#F19941",
defaults: {
name: {value:""},
info: {value:"# Description\n\n# Resources\n\n# Unicorn SME(s)\n"}
},
inputs:1,
outputs:1,
icon: "guide.svg",
label: function() {
return this.name||this._("guide");
},
labelStyle: function() {
return this.name?"node_label_italic":"";
},
info: function() {
return this.name?"# "+this.name+"\n\n---\n\n":"";
},
oneditprepare: function() {
var that = this;
this.editor = RED.editor.createEditor({
id: 'node-input-info-editor',
mode: 'ace/mode/markdown',
value: $("#node-input-info").val()
});
this.editor.focus();
},
oneditsave: function() {
$("#node-input-info").val(this.editor.getValue());
this.editor.destroy();
delete this.editor;
},
oneditcancel: function() {
this.editor.destroy();
delete this.editor;
},
oneditresize: function(size) {
var rows = $("#dialog-form>div:not(.node-text-editor-row)");
var height = $("#dialog-form").height();
for (var i=0; i<rows.length; 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");
this.editor.resize();
}
});
</script>

View File

@ -0,0 +1,25 @@
/**
* Copyright JS Foundation and other contributors, http://js.foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
// 2022 Modification Copyright - Defense Unicorns
module.exports = function(RED) {
"use strict";
function GuideNode(n) {
RED.nodes.createNode(this,n);
}
RED.nodes.registerType("guide",GuideNode);
}

View File

@ -0,0 +1,67 @@
<!-- 2022 Modification Copyright - Defense Unicorns -->
<script type="text/html" data-template-name="resource">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
</div>
<div class="form-row node-text-editor-row">
<input type="hidden" id="node-input-info" autofocus="autofocus">
<div style="height: 250px; min-height:150px;" class="node-text-editor" id="node-input-info-editor"></div>
</div>
</script>
<script type="text/x-red" data-help-name="resource">
<p>A node that contains an external resource or explains something.</p>
</script>
<script type="text/javascript">
RED.nodes.registerType('resource',{
category: 'common',
color:"#7FFFD4",
defaults: {
name: {value:""},
info: {value:"# Description\n\n# Resources\n\n# Unicorn SME(s)\n"}
},
inputs:1,
outputs:1,
icon: "db.svg",
label: function() {
return this.name||this._("resource");
},
labelStyle: function() {
return this.name?"node_label_italic":"";
},
info: function() {
return this.name?"# "+this.name+"\n\n---\n\n":"";
},
oneditprepare: function() {
var that = this;
this.editor = RED.editor.createEditor({
id: 'node-input-info-editor',
mode: 'ace/mode/markdown',
value: $("#node-input-info").val()
});
this.editor.focus();
},
oneditsave: function() {
$("#node-input-info").val(this.editor.getValue());
this.editor.destroy();
delete this.editor;
},
oneditcancel: function() {
this.editor.destroy();
delete this.editor;
},
oneditresize: function(size) {
var rows = $("#dialog-form>div:not(.node-text-editor-row)");
var height = $("#dialog-form").height();
for (var i=0; i<rows.length; 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");
this.editor.resize();
}
});
</script>

View File

@ -0,0 +1,25 @@
/**
* Copyright JS Foundation and other contributors, http://js.foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
// 2022 Modification Copyright - Defense Unicorns
module.exports = function(RED) {
"use strict";
function ResourceNode(n) {
RED.nodes.createNode(this,n);
}
RED.nodes.registerType("resource",ResourceNode);
}

View File

@ -0,0 +1,67 @@
<!-- 2022 Modification Copyright - Defense Unicorns -->
<script type="text/html" data-template-name="task">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
</div>
<div class="form-row node-text-editor-row">
<input type="hidden" id="node-input-info" autofocus="autofocus">
<div style="height: 250px; min-height:150px;" class="node-text-editor" id="node-input-info-editor"></div>
</div>
</script>
<script type="text/x-red" data-help-name="task">
<p>A node that is used when assigning a non-guided task.</p>
</script>
<script type="text/javascript">
RED.nodes.registerType('task',{
category: 'common',
color:"#B8251B",
defaults: {
name: {value:""},
info: {value:"# Description\n\n# Resources\n\n# Unicorn SME(s)\n"}
},
inputs:1,
outputs:1,
icon: "cog.svg",
label: function() {
return this.name||this._("task");
},
labelStyle: function() {
return this.name?"node_label_italic":"";
},
info: function() {
return this.name?"# "+this.name+"\n\n---\n\n":"";
},
oneditprepare: function() {
var that = this;
this.editor = RED.editor.createEditor({
id: 'node-input-info-editor',
mode: 'ace/mode/markdown',
value: $("#node-input-info").val()
});
this.editor.focus();
},
oneditsave: function() {
$("#node-input-info").val(this.editor.getValue());
this.editor.destroy();
delete this.editor;
},
oneditcancel: function() {
this.editor.destroy();
delete this.editor;
},
oneditresize: function(size) {
var rows = $("#dialog-form>div:not(.node-text-editor-row)");
var height = $("#dialog-form").height();
for (var i=0; i<rows.length; 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");
this.editor.resize();
}
});
</script>

View File

@ -0,0 +1,25 @@
/**
* Copyright JS Foundation and other contributors, http://js.foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
// 2022 Modification Copyright - Defense Unicorns
module.exports = function(RED) {
"use strict";
function TaskNode(n) {
RED.nodes.createNode(this,n);
}
RED.nodes.registerType("task",TaskNode);
}

View File

@ -0,0 +1 @@
<svg width="512px" height="512px" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path fill="#FFF" d="M102.5 26.03l90.03 345.75 289.22 23.25-90.063-345.75L102.5 26.03zm-18.906 1.564c-30.466 11.873-55.68 53.098-49.75 75.312l3.25 11.78c.667-1.76 1.36-3.522 2.093-5.28C49.097 85.7 65.748 62.64 89.564 50.5l-5.97-22.906zm10.844 41.593c-16.657 10.012-29.92 28.077-38 47.407-5.247 12.55-8.038 25.63-8.75 36.53L112.5 388.407c.294-.55.572-1.106.875-1.656 10.603-19.252 27.823-37.695 51.125-48.47L94.437 69.19zm74.874 287.594c-17.677 9.078-31.145 23.717-39.562 39-4.464 8.107-7.27 16.364-8.688 23.75l11.688 42.408 1.625.125c-3.84-27.548 11.352-60.504 41.25-81.094l-6.313-24.19zm26.344 34c-32.567 17.27-46.51 52.44-41.844 72.94l289.844 24.5c-5.34-7.79-8.673-17.947-8.594-28.5l-22.406-9L459 443.436l-13.5-12.875c5.604-6.917 13.707-13.05 24.813-17.687L195.656 390.78z"/></svg>

After

Width:  |  Height:  |  Size: 874 B