mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Tidy up of editor i18n messages
This commit is contained in:
@@ -33,10 +33,10 @@ RED.sidebar.info = (function() {
|
||||
content.style.paddingRight = "4px";
|
||||
|
||||
var propertiesExpanded = false;
|
||||
|
||||
|
||||
function show() {
|
||||
if (!RED.sidebar.containsTab("info")) {
|
||||
RED.sidebar.addTab(RED._("sidebar.info"),content,false);
|
||||
RED.sidebar.addTab(RED._("sidebar.info.title"),content,false);
|
||||
}
|
||||
RED.sidebar.show("info");
|
||||
}
|
||||
@@ -60,13 +60,13 @@ RED.sidebar.info = (function() {
|
||||
|
||||
function refresh(node) {
|
||||
var table = '<table class="node-info"><tbody>';
|
||||
table += '<tr class="blank"><td colspan="2">'+RED._("tabInfo.node")+'</td></tr>';
|
||||
table += '<tr class="blank"><td colspan="2">'+RED._("sidebar.info.node")+'</td></tr>';
|
||||
if (node.type != "subflow" && node.name) {
|
||||
table += "<tr><td>Name</td><td> "+node.name+"</td></tr>";
|
||||
table += "<tr><td>"+RED._("common.label.name")+"</td><td> "+node.name+"</td></tr>";
|
||||
}
|
||||
table += "<tr><td>"+RED._("tabInfo.type")+"</td><td> "+node.type+"</td></tr>";
|
||||
table += "<tr><td>"+RED._("tabInfo.id")+"</td><td> "+node.id+"</td></tr>";
|
||||
|
||||
table += "<tr><td>"+RED._("sidebar.info.type")+"</td><td> "+node.type+"</td></tr>";
|
||||
table += "<tr><td>"+RED._("sidebar.info.id")+"</td><td> "+node.id+"</td></tr>";
|
||||
|
||||
var m = /^subflow(:(.+))?$/.exec(node.type);
|
||||
if (m) {
|
||||
var subflowNode;
|
||||
@@ -75,9 +75,9 @@ RED.sidebar.info = (function() {
|
||||
} else {
|
||||
subflowNode = node;
|
||||
}
|
||||
|
||||
table += '<tr class="blank"><td colspan="2">'+RED._("tabInfo.subflow")+'</td></tr>';
|
||||
|
||||
|
||||
table += '<tr class="blank"><td colspan="2">'+RED._("sidebar.info.subflow")+'</td></tr>';
|
||||
|
||||
var userCount = 0;
|
||||
var subflowType = "subflow:"+subflowNode.id;
|
||||
RED.nodes.eachNode(function(n) {
|
||||
@@ -85,12 +85,12 @@ RED.sidebar.info = (function() {
|
||||
userCount++;
|
||||
}
|
||||
});
|
||||
table += "<tr><td>"+RED._("tabInfo.name")+"</td><td>"+subflowNode.name+"</td></tr>";
|
||||
table += "<tr><td>"+RED._("tabInfo.instances")+"</td><td>"+userCount+"</td></tr>";
|
||||
table += "<tr><td>"+RED._("common.label.name")+"</td><td>"+subflowNode.name+"</td></tr>";
|
||||
table += "<tr><td>"+RED._("sidebar.info.instances")+"</td><td>"+userCount+"</td></tr>";
|
||||
}
|
||||
|
||||
|
||||
if (!m && node.type != "subflow" && node.type != "comment") {
|
||||
table += '<tr class="blank"><td colspan="2"><a href="#" class="node-info-property-header"><i style="width: 10px; text-align: center;" class="fa fa-caret-'+(propertiesExpanded?"down":"right")+'"></i> '+RED._("tabInfo.properties")+'</a></td></tr>';
|
||||
table += '<tr class="blank"><td colspan="2"><a href="#" class="node-info-property-header"><i style="width: 10px; text-align: center;" class="fa fa-caret-'+(propertiesExpanded?"down":"right")+'"></i> '+RED._("sidebar.info.properties")+'</a></td></tr>';
|
||||
if (node._def) {
|
||||
for (var n in node._def.defaults) {
|
||||
if (n != "name" && node._def.defaults.hasOwnProperty(n)) {
|
||||
@@ -98,7 +98,7 @@ RED.sidebar.info = (function() {
|
||||
var type = typeof val;
|
||||
if (type === "string") {
|
||||
if (val.length === 0) {
|
||||
val += '<span style="font-style: italic; color: #ccc;">'+RED._("tabInfo.blank")+'</span>';
|
||||
val += '<span style="font-style: italic; color: #ccc;">'+RED._("sidebar.info.blank")+'</span>';
|
||||
} else {
|
||||
if (val.length > 30) {
|
||||
val = val.substring(0,30)+" ...";
|
||||
@@ -114,14 +114,14 @@ RED.sidebar.info = (function() {
|
||||
val += " "+i+": "+vv+"<br/>";
|
||||
}
|
||||
if (node[n].length > 10) {
|
||||
val += " ... "+node[n].length+" items<br/>";
|
||||
val += " ... "+RED._("sidebar.info.arrayItems",{count:node[n].length})+"<br/>";
|
||||
}
|
||||
val += "]";
|
||||
} else {
|
||||
val = JSON.stringify(val,jsonFilter," ");
|
||||
val = val.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");
|
||||
}
|
||||
|
||||
|
||||
table += '<tr class="node-info-property-row'+(propertiesExpanded?"":" hide")+'"><td>'+n+"</td><td>"+val+"</td></tr>";
|
||||
}
|
||||
}
|
||||
@@ -140,7 +140,7 @@ RED.sidebar.info = (function() {
|
||||
}
|
||||
|
||||
$("#tab-info").html(table);
|
||||
|
||||
|
||||
$(".node-info-property-header").click(function(e) {
|
||||
var icon = $(this).find("i");
|
||||
if (icon.hasClass("fa-caret-right")) {
|
||||
@@ -154,15 +154,15 @@ RED.sidebar.info = (function() {
|
||||
$(".node-info-property-row").hide();
|
||||
propertiesExpanded = false;
|
||||
}
|
||||
|
||||
|
||||
e.preventDefault();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function clear() {
|
||||
$("#tab-info").html("");
|
||||
}
|
||||
|
||||
|
||||
RED.view.on("selection-changed",function(selection) {
|
||||
if (selection.nodes) {
|
||||
if (selection.nodes.length == 1) {
|
||||
|
Reference in New Issue
Block a user