mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Merge branch 'pr_1197' into 0.17
This commit is contained in:
commit
83ca8147ca
@ -277,7 +277,8 @@ RED.nodes = (function() {
|
|||||||
ws._def = {
|
ws._def = {
|
||||||
defaults: {
|
defaults: {
|
||||||
label: {value:""},
|
label: {value:""},
|
||||||
disabled: {value: false}
|
disabled: {value: false},
|
||||||
|
info: {value: ""}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -215,10 +215,13 @@ RED.sidebar.info = (function() {
|
|||||||
|
|
||||||
var infoText = "";
|
var infoText = "";
|
||||||
|
|
||||||
if (!subflowNode && node.type != "comment") {
|
if (!subflowNode && node.type !== "comment" && node.type !== "tab") {
|
||||||
var helpText = $("script[data-help-name='"+node.type+"']").html()||"";
|
var helpText = $("script[data-help-name='"+node.type+"']").html()||"";
|
||||||
infoText = helpText;
|
infoText = helpText;
|
||||||
|
} else if (node.type === "tab") {
|
||||||
|
infoText = marked(node.info||"");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subflowNode) {
|
if (subflowNode) {
|
||||||
infoText = infoText + marked(subflowNode.info||"");
|
infoText = infoText + marked(subflowNode.info||"");
|
||||||
} else if (node._def && node._def.info) {
|
} else if (node._def && node._def.info) {
|
||||||
@ -365,7 +368,12 @@ RED.sidebar.info = (function() {
|
|||||||
if (flow) {
|
if (flow) {
|
||||||
refresh(flow);
|
refresh(flow);
|
||||||
} else {
|
} else {
|
||||||
clear();
|
var workspace = RED.nodes.workspace(RED.workspaces.active());
|
||||||
|
if (workspace.info) {
|
||||||
|
refresh(workspace);
|
||||||
|
} else {
|
||||||
|
clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -59,6 +59,7 @@ RED.workspaces = (function() {
|
|||||||
function showRenameWorkspaceDialog(id) {
|
function showRenameWorkspaceDialog(id) {
|
||||||
var workspace = RED.nodes.workspace(id);
|
var workspace = RED.nodes.workspace(id);
|
||||||
RED.view.state(RED.state.EDITING);
|
RED.view.state(RED.state.EDITING);
|
||||||
|
var tabflowEditor;
|
||||||
var trayOptions = {
|
var trayOptions = {
|
||||||
title: RED._("workspace.editFlow",{name:workspace.label}),
|
title: RED._("workspace.editFlow",{name:workspace.label}),
|
||||||
buttons: [
|
buttons: [
|
||||||
@ -98,6 +99,12 @@ RED.workspaces = (function() {
|
|||||||
changed = true;
|
changed = true;
|
||||||
workspace.disabled = disabled;
|
workspace.disabled = disabled;
|
||||||
}
|
}
|
||||||
|
var info = tabflowEditor.getValue();
|
||||||
|
if (workspace.info !== info) {
|
||||||
|
changes.info = workspace.info;
|
||||||
|
changed = true;
|
||||||
|
workspace.info = info;
|
||||||
|
}
|
||||||
$("#red-ui-tab-"+(workspace.id.replace(".","-"))).toggleClass('workspace-disabled',workspace.disabled);
|
$("#red-ui-tab-"+(workspace.id.replace(".","-"))).toggleClass('workspace-disabled',workspace.disabled);
|
||||||
// $("#workspace").toggleClass("workspace-disabled",workspace.disabled);
|
// $("#workspace").toggleClass("workspace-disabled",workspace.disabled);
|
||||||
|
|
||||||
@ -121,6 +128,9 @@ RED.workspaces = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
resize: function(dimensions) {
|
||||||
|
tabflowEditor.resize();
|
||||||
|
},
|
||||||
open: function(tray) {
|
open: function(tray) {
|
||||||
var trayBody = tray.find('.editor-tray-body');
|
var trayBody = tray.find('.editor-tray-body');
|
||||||
var dialogForm = $('<form id="dialog-form" class="form-horizontal"></form>').appendTo(trayBody);
|
var dialogForm = $('<form id="dialog-form" class="form-horizontal"></form>').appendTo(trayBody);
|
||||||
@ -135,6 +145,16 @@ RED.workspaces = (function() {
|
|||||||
'<input type="checkbox" id="node-input-disabled" style="display: none;"/>'+
|
'<input type="checkbox" id="node-input-disabled" style="display: none;"/>'+
|
||||||
'</div>').appendTo(dialogForm);
|
'</div>').appendTo(dialogForm);
|
||||||
|
|
||||||
|
$('<div class="form-row node-text-editor-row">'+
|
||||||
|
'<label for="node-input-info" data-i18n="editor:workspace.info"></label>'+
|
||||||
|
'<div style="height: 250px;" class="node-text-editor" id="node-input-info"></div>'+
|
||||||
|
'</div>').appendTo(dialogForm);
|
||||||
|
tabflowEditor = RED.editor.createEditor({
|
||||||
|
id: 'node-input-info',
|
||||||
|
mode: 'ace/mode/markdown',
|
||||||
|
value: ""
|
||||||
|
});
|
||||||
|
|
||||||
dialogForm.find('#node-input-disabled-btn').on("click",function(e) {
|
dialogForm.find('#node-input-disabled-btn').on("click",function(e) {
|
||||||
var i = $(this).find("i");
|
var i = $(this).find("i");
|
||||||
if (i.hasClass('fa-toggle-off')) {
|
if (i.hasClass('fa-toggle-off')) {
|
||||||
@ -166,13 +186,15 @@ RED.workspaces = (function() {
|
|||||||
$('<input type="text" style="display: none;" />').prependTo(dialogForm);
|
$('<input type="text" style="display: none;" />').prependTo(dialogForm);
|
||||||
dialogForm.submit(function(e) { e.preventDefault();});
|
dialogForm.submit(function(e) { e.preventDefault();});
|
||||||
$("#node-input-name").val(workspace.label);
|
$("#node-input-name").val(workspace.label);
|
||||||
RED.text.bidi.prepareInput($("#node-input-name"))
|
RED.text.bidi.prepareInput($("#node-input-name"));
|
||||||
|
tabflowEditor.getSession().setValue(workspace.info || "", -1);
|
||||||
dialogForm.i18n();
|
dialogForm.i18n();
|
||||||
},
|
},
|
||||||
close: function() {
|
close: function() {
|
||||||
if (RED.view.state() != RED.state.IMPORT_DRAGGING) {
|
if (RED.view.state() != RED.state.IMPORT_DRAGGING) {
|
||||||
RED.view.state(RED.state.DEFAULT);
|
RED.view.state(RED.state.DEFAULT);
|
||||||
}
|
}
|
||||||
|
RED.sidebar.info.refresh(workspace);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RED.tray.show(trayOptions);
|
RED.tray.show(trayOptions);
|
||||||
|
@ -21,7 +21,8 @@
|
|||||||
"dropFlowHere": "Drop the flow here",
|
"dropFlowHere": "Drop the flow here",
|
||||||
"status": "Status",
|
"status": "Status",
|
||||||
"enabled": "Enabled",
|
"enabled": "Enabled",
|
||||||
"disabled":"Disabled"
|
"disabled":"Disabled",
|
||||||
|
"info": "Description"
|
||||||
},
|
},
|
||||||
"menu": {
|
"menu": {
|
||||||
"label": {
|
"label": {
|
||||||
|
@ -18,7 +18,8 @@
|
|||||||
"editFlow": "フローを編集: __name__",
|
"editFlow": "フローを編集: __name__",
|
||||||
"confirmDelete": "削除の確認",
|
"confirmDelete": "削除の確認",
|
||||||
"delete": "本当に '__label__' を削除しますか?",
|
"delete": "本当に '__label__' を削除しますか?",
|
||||||
"dropFlowHere": "ここにフローをドロップしてください"
|
"dropFlowHere": "ここにフローをドロップしてください",
|
||||||
|
"info": "詳細"
|
||||||
},
|
},
|
||||||
"menu": {
|
"menu": {
|
||||||
"label": {
|
"label": {
|
||||||
|
Loading…
Reference in New Issue
Block a user