mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
fixed comments from @knolleary
This commit is contained in:
@@ -902,7 +902,7 @@
|
||||
"properties": "Properties",
|
||||
"description": "Description",
|
||||
"appearance": "Appearance",
|
||||
"env": "Env Var",
|
||||
"env": "Environment Variables",
|
||||
"name": "name"
|
||||
}
|
||||
}
|
||||
|
@@ -611,40 +611,7 @@ RED.editor = (function() {
|
||||
}
|
||||
|
||||
function isSameEnv(env0, env1) {
|
||||
function isSameInfo(info0, info1) {
|
||||
if (info0 && info1 &&
|
||||
(info0.name === info1.name) &&
|
||||
(info0.label === info1.label) &&
|
||||
(info0.value === info1.value) &&
|
||||
(info0.type === info1.type) &&
|
||||
(info0.target_type === info1.target_type) &&
|
||||
(info0.target === info1.target)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function inEnv(env, item) {
|
||||
for(var i = 0; i < env.length; i++) {
|
||||
var item1 = env[i];
|
||||
if ((item1.name !== item.name) ||
|
||||
(item1.type !== item.type) ||
|
||||
(item1.value !== item.value) ||
|
||||
!isSameInfo(item1.info, item.info)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (env0 && env1 && (env0.length === env1.length)) {
|
||||
for (var i = 0; i < env0.length; i++) {
|
||||
var item0 = env0[i];
|
||||
if (!inEnv(env1, item0)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return (JSON.stringify(env0) === JSON.stringify(env1));
|
||||
}
|
||||
|
||||
function buildEditForm(container,formId,type,ns,node) {
|
||||
|
@@ -19,13 +19,13 @@ RED.subflow = (function() {
|
||||
|
||||
var _subflowEditTemplate = '<script type="text/x-red" data-template-name="subflow">'+
|
||||
'<div class="form-row"><label for="node-input-name" data-i18n="[append]editor:common.label.name"><i class="fa fa-tag"></i> </label><input type="text" id="node-input-name"></div>'+
|
||||
'<div class="form-row"><label data-i18n="[append]editor:editor-tab.env"><i class="fa fa-th-list"></i> </label></div>'+
|
||||
'<div class="form-row" style="margin-bottom: 0px;"><label style="width: auto;" data-i18n="[append]editor:editor-tab.env"><i class="fa fa-th-list"></i> </label></div>'+
|
||||
'<div class="form-row node-input-env-container-row"><ol id="node-input-env-container"></ol></div>'+
|
||||
'</script>';
|
||||
var _subflowTemplateEditTemplate = '<script type="text/x-red" data-template-name="subflow-template">'+
|
||||
'<div class="form-row"><i class="fa fa-tag"></i> <label for="subflow-input-name" data-i18n="common.label.name"></label><input type="text" id="subflow-input-name"></div>'+
|
||||
'<div class="form-row"><i class="fa fa-folder-o"></i> <label for="subflow-input-category" data-i18n="editor:subflow.category"></label><select style="width: 250px;" id="subflow-input-category"></select><input style="display:none; margin-left: 10px; width:calc(100% - 250px)" type="text" id="subflow-input-custom-category"></div>'+
|
||||
'<div class="form-row"><label data-i18n="[append]editor:editor-tab.env"><i class="fa fa-th-list"></i> </label></div>'+
|
||||
'<div class="form-row" style="margin-bottom: 0px;"><label style="width: auto;" data-i18n="[append]editor:editor-tab.env"><i class="fa fa-th-list"></i> </label></div>'+
|
||||
'<div class="form-row node-input-env-container-row"><ol id="node-input-env-container"></ol></div>'+
|
||||
'<div class="form-row form-tips" id="subflow-dialog-user-count"></div>'+
|
||||
'</script>';
|
||||
|
Reference in New Issue
Block a user