Compare commits

..

20 Commits

Author SHA1 Message Date
Moshe Wajnberg
1532d9b6e2 Adding bidi preferences (#1375) 2017-09-17 09:05:26 +01:00
Dave Conway-Jones
a844ca161f Spinner fixes (#1371)
* Fix for function node invalid spinner values

to close #1370

* better validation of spinners for inject and delay

(don’t allow negative numbers)

* remove need for declaring local min variable
2017-08-21 22:00:23 +01:00
btsimonh
e09efba313 mqtt: Add 'name' to mqtt-broker node, and label it by this if it is set. (#1364)
This allows you to easily distinguish between broker nodes which are talking to the same server but with different credentials.
2017-08-09 22:22:40 +01:00
Nick O'Leary
96a0dbea2d Don't include subflow meta-port nodes in exported selection
Fixes #1362
2017-08-08 15:48:54 +01:00
Nick O'Leary
5b3b5271ad Remove test diff code 2017-08-07 16:38:15 +01:00
Kazuhito Yokoi
d7d13c12fe Modify messages to refer to language files (#1361) 2017-08-07 10:00:28 +01:00
Nick O'Leary
54220d0e71 Ensure shade elements have a higher z-index than ui elements 2017-08-04 22:20:58 +01:00
Nick O'Leary
4a2e3586f1 Allow delay node in rate-limit mode to be reset
Fixes #1360
2017-08-04 21:09:00 +01:00
Nick O'Leary
f808e85da9 Diff view: subflows can have port labels as well 2017-08-04 14:26:05 +01:00
Nick O'Leary
1671d1f580 Allow expanding diff elements to stay in-sync deeper 2017-08-04 14:23:28 +01:00
Nick O'Leary
7de1bf9d95 Better node properties layout in diff table 2017-08-03 23:04:39 +01:00
Nick O'Leary
7368b0cefb Make diff tool a maximised tray rather than dialog 2017-08-03 09:58:25 +01:00
Nick O'Leary
4af43d676a Include input/output labels in diff view 2017-08-02 21:57:23 +01:00
Nick O'Leary
67dc848b2d getNodeIcon should handle subflow types properly 2017-08-02 21:55:25 +01:00
Nick O'Leary
7ec8f0d26b Do not include tab types in typeSearch dialog 2017-08-02 21:54:58 +01:00
Nick O'Leary
eaf08a9971 Keep local/remote diff objects in sync as they expand 2017-07-31 23:29:36 +01:00
Nick O'Leary
5bdb9e972e Add httpStatic log statement on start up 2017-07-26 11:45:49 -07:00
Nick O'Leary
d4d87054c4 Ensure tab property changes are listed in diff view 2017-07-26 07:55:53 -07:00
Nick O'Leary
0f93929544 Fix diff view node properties table rendering 2017-07-26 07:47:19 -07:00
Nick O'Leary
1c0e794f87 Ensure tabs get their definition object properly attached 2017-07-26 07:46:22 -07:00
33 changed files with 705 additions and 329 deletions

View File

@@ -219,12 +219,12 @@
menuOptions.push(null);
}
menuOptions.push({id:"menu-item-user-settings",label:RED._("menu.label.userSettings"),onselect:"core:show-user-settings"});
menuOptions.push({id:"menu-item-user-settings",label:RED._("menu.label.settings"),onselect:"core:show-user-settings"});
menuOptions.push(null);
menuOptions.push({id:"menu-item-keyboard-shortcuts",label:RED._("menu.label.keyboardShortcuts"),onselect:"core:show-help"});
menuOptions.push({id:"menu-item-help",
label: RED.settings.theme("menu.menu-item-help.label","Node-RED website"),
label: RED.settings.theme("menu.menu-item-help.label",RED._("menu.label.help")),
href: RED.settings.theme("menu.menu-item-help.url","http://nodered.org/docs")
});
menuOptions.push({id:"menu-item-node-red-version", label:"v"+RED.settings.version, onselect: "core:show-about" });

View File

@@ -41,6 +41,15 @@ RED.nodes = (function() {
var typeToId = {};
var nodeDefinitions = {};
nodeDefinitions['tab'] = {
defaults: {
label: {value:""},
disabled: {value: false},
info: {value: ""}
}
};
var exports = {
setModulePendingUpdated: function(module,version) {
moduleList[module].pending_version = version;
@@ -274,14 +283,7 @@ RED.nodes = (function() {
function addWorkspace(ws) {
workspaces[ws.id] = ws;
ws._def = {
defaults: {
label: {value:""},
disabled: {value: false},
info: {value: ""}
}
};
ws._def = RED.nodes.getType('tab');
workspacesOrder.push(ws.id);
}
function getWorkspace(id) {
@@ -817,7 +819,7 @@ RED.nodes = (function() {
// Add a tab if there isn't one there already
if (defaultWorkspace == null) {
defaultWorkspace = { type:"tab", id:getID(), label:RED._('workspace.defaultName',{number:1})};
defaultWorkspace = { type:"tab", id:getID(), disabled: false, info:"", label:RED._('workspace.defaultName',{number:1})};
addWorkspace(defaultWorkspace);
RED.workspaces.add(defaultWorkspace);
new_workspaces.push(defaultWorkspace);

View File

@@ -15,7 +15,9 @@
**/
RED.text = {};
RED.text.bidi = (function() {
var textDir = "";
var textDir = "";
var textDirPref = "auto";
var bidiEnabled = false;
var LRE = "\u202A",
RLE = "\u202B",
PDF = "\u202C";
@@ -110,8 +112,8 @@ RED.text.bidi = (function() {
}
/**
* Sets the text direction preference
* @param dir - the text direction preference
* Sets the text direction
* @param dir - the actual text direction
*/
function setTextDirection(dir) {
textDir = dir;
@@ -120,9 +122,44 @@ RED.text.bidi = (function() {
RED.palette.refresh();
enforceTextDirectionOnPage();
}
/**
* Gets the bidi enabled preference
*/
function getBidiEnabled() {
return bidiEnabled;
}
/**
* Sets the bidi enabled preference
* @param state - the bidi enabled preference
*/
function setBidiEnabled(state) {
bidiEnabled = state;
setTextDirection((state ? textDirPref : ""));
}
/**
* Gets the text direction preference
*/
function getTextDirPref() {
return textDirPref;
}
/**
* Sets the text direction preference
* @param dirPref - text direction preference
*/
function setTextDirPref(dirPref) {
textDirPref = dirPref;
setTextDirection(textDirPref);
}
return {
setTextDirection: setTextDirection,
setBidiEnabled: setBidiEnabled,
setTextDirPref: setTextDirPref,
getBidiEnabled: getBidiEnabled,
getTextDirPref: getTextDirPref,
enforceTextDirectionWithUCC: enforceTextDirectionWithUCC,
resolveBaseTextDir: resolveBaseTextDir,
prepareInput: prepareInput

View File

@@ -203,7 +203,8 @@ RED.clipboard = (function() {
var nodes = null;
if (type === 'export-range-selected') {
var selection = RED.view.selection();
nodes = RED.nodes.createExportableNodeSet(selection.nodes);
// Don't include the subflow meta-port nodes in the exported selection
nodes = RED.nodes.createExportableNodeSet(selection.nodes.filter(function(n) { return n.type !== 'subflow'}));
} else if (type === 'export-range-flow') {
var activeWorkspace = RED.workspaces.active();
nodes = RED.nodes.filterNodes({z:activeWorkspace});

View File

@@ -85,7 +85,7 @@
if (this.element.css("position") === "absolute") {
["top","left","bottom","right"].forEach(function(s) {
var v = that.element.css(s);
if (s!=="auto" && s!=="") {
if (v!=="auto" && v!=="") {
that.topContainer.css(s,v);
that.uiContainer.css(s,"0");
that.element.css(s,'auto');

View File

@@ -157,8 +157,8 @@ RED.deploy = (function() {
create: function() {
$("#node-dialog-confirm-deploy").parent().find("div.ui-dialog-buttonpane")
.prepend('<div style="height:0; vertical-align: middle; display:inline-block; margin-top: 13px; float:left;">'+
'<input style="vertical-align:top;" type="checkbox" id="node-dialog-confirm-deploy-hide">'+
'<label style="display:inline;" for="node-dialog-confirm-deploy-hide"> do not warn about this again</label>'+
'<input style="vertical-align:top;" type="checkbox" id="node-dialog-confirm-deploy-hide"> '+
'<label style="display:inline;" for="node-dialog-confirm-deploy-hide" data-i18n="deploy.confirm.doNotWarn"></label>'+
'<input type="hidden" id="node-dialog-confirm-deploy-type">'+
'</div>');
},

View File

@@ -1,52 +1,26 @@
RED.diff = (function() {
var currentDiff = {};
var diffVisible = false;
var diffList;
function init() {
// RED.actions.add("core:show-current-diff",showLocalDiff);
RED.actions.add("core:show-remote-diff",showRemoteDiff);
// RED.keyboard.add("*","ctrl-shift-l","core:show-current-diff");
RED.keyboard.add("*","ctrl-shift-r","core:show-remote-diff");
}
var dialog = $('<div id="node-dialog-view-diff" class="hide"><div id="node-dialog-view-diff-headers"></div><ol id="node-dialog-view-diff-diff"></ol></div>').appendTo(document.body);
function buildDiffPanel(container) {
var diffPanel = $('<div id="node-dialog-view-diff"><div id="node-dialog-view-diff-headers"></div><ol id="node-dialog-view-diff-diff"></ol></div>').appendTo(container);
var toolbar = $('<div class="node-diff-toolbar">'+
'<span><span id="node-diff-toolbar-resolved-conflicts"></span></span> '+
'</div>').prependTo(dialog);
'</div>').prependTo(diffPanel);
$("#node-dialog-view-diff").dialog({
title: RED._('deploy.confirm.button.review'),
modal: true,
autoOpen: false,
buttons: [
{
text: RED._("common.label.cancel"),
click: function() {
$( this ).dialog( "close" );
}
},
{
id: "node-diff-view-diff-merge",
text: RED._("deploy.confirm.button.merge"),
class: "primary disabled",
click: function() {
if (!$("#node-diff-view-diff-merge").hasClass('disabled')) {
refreshConflictHeader();
mergeDiff(currentDiff);
$( this ).dialog( "close" );
}
}
}
],
open: function() {
$(this).dialog({width:Math.min($(window).width(),900),height:Math.min($(window).height(),600)});
}
});
var diffList = $("#node-dialog-view-diff-diff").editableList({
diffList = diffPanel.find("#node-dialog-view-diff-diff").editableList({
addButton: false,
scrollOnAdd: false,
addItem: function(container,i,object) {
@@ -77,7 +51,7 @@ RED.diff = (function() {
} else if (tab.type === 'subflow') {
titleSpan.html((tabForLabel.name||tabForLabel.id));
} else {
titleSpan.html("Global nodes");
titleSpan.html(RED._("diff.globalNodes"));
}
var flowStats = {
local: {
@@ -153,7 +127,7 @@ RED.diff = (function() {
}
}
$('<span class="node-diff-chevron"><i class="fa fa-angle-down"></i></span>').appendTo(originalNodeDiv);
$('<span>').html("Flow Properties").appendTo(originalNodeDiv);
$('<span>').html(RED._("diff.flowProperties")).appendTo(originalNodeDiv);
row.click(function(evt) {
evt.preventDefault();
@@ -307,6 +281,7 @@ RED.diff = (function() {
container.i18n();
}
});
return diffPanel;
}
function formatWireProperty(wires,allNodes) {
var result = $("<div>",{class:"node-diff-property-wires"})
@@ -563,6 +538,7 @@ RED.diff = (function() {
return div;
}
function createNodePropertiesTable(def,node,localNodeObj,remoteNodeObj) {
var propertyElements = {};
var localNode = localNodeObj.node;
var remoteNode;
if (remoteNodeObj) {
@@ -571,8 +547,15 @@ RED.diff = (function() {
var nodePropertiesDiv = $("<div>",{class:"node-diff-node-entry-properties"});
var nodePropertiesTable = $("<table>").appendTo(nodePropertiesDiv);
var nodePropertiesTableCols = $('<colgroup><col/><col/></colgroup>').appendTo(nodePropertiesTable);
if (remoteNode !== undefined) {
$("<col/>").appendTo(nodePropertiesTableCols);
}
var nodePropertiesTableBody = $("<tbody>").appendTo(nodePropertiesTable);
var row;
var localCell, remoteCell;
var element;
var currentValue, localValue, remoteValue;
var localChanged = false;
var remoteChanged = false;
@@ -581,13 +564,14 @@ RED.diff = (function() {
var conflict = false;
var status;
row = $("<tr>").appendTo(nodePropertiesTable);
row = $("<tr>").appendTo(nodePropertiesTableBody);
$("<td>",{class:"node-diff-property-cell-label"}).html("id").appendTo(row);
localCell = $("<td>",{class:"node-diff-property-cell node-diff-node-local"}).appendTo(row);
if (localNode) {
localCell.addClass("node-diff-node-unchanged");
$('<span class="node-diff-status"></span>').appendTo(localCell);
RED.utils.createObjectElement(localNode.id).appendTo(localCell);
element = $('<span class="node-diff-element"></span>').appendTo(localCell);
propertyElements['local.id'] = RED.utils.createObjectElement(localNode.id).appendTo(element);
} else {
localCell.addClass("node-diff-empty");
}
@@ -596,7 +580,8 @@ RED.diff = (function() {
remoteCell.addClass("node-diff-node-unchanged");
if (remoteNode) {
$('<span class="node-diff-status"></span>').appendTo(remoteCell);
RED.utils.createObjectElement(remoteNode.id).appendTo(remoteCell);
element = $('<span class="node-diff-element"></span>').appendTo(remoteCell);
propertyElements['remote.id'] = RED.utils.createObjectElement(remoteNode.id).appendTo(element);
} else {
remoteCell.addClass("node-diff-empty");
}
@@ -622,13 +607,24 @@ RED.diff = (function() {
) {
conflict = true;
}
row = $("<tr>").appendTo(nodePropertiesTable);
row = $("<tr>").appendTo(nodePropertiesTableBody);
$("<td>",{class:"node-diff-property-cell-label"}).html("position").appendTo(row);
localCell = $("<td>",{class:"node-diff-property-cell node-diff-node-local"}).appendTo(row);
if (localNode) {
localCell.addClass("node-diff-node-"+(localChanged?"changed":"unchanged"));
$('<span class="node-diff-status">'+(localChanged?'<i class="fa fa-square"></i>':'')+'</span>').appendTo(localCell);
RED.utils.createObjectElement({x:localNode.x,y:localNode.y}).appendTo(localCell);
element = $('<span class="node-diff-element"></span>').appendTo(localCell);
propertyElements['local.position'] = RED.utils.createObjectElement({x:localNode.x,y:localNode.y},
{
path: "position",
exposeApi: true,
ontoggle: function(path,state) {
if (propertyElements['remote.'+path]) {
propertyElements['remote.'+path].prop('expand')(path,state)
}
}
}
).appendTo(element);
} else {
localCell.addClass("node-diff-empty");
}
@@ -638,7 +634,18 @@ RED.diff = (function() {
remoteCell.addClass("node-diff-node-"+(remoteChanged?"changed":"unchanged"));
if (remoteNode) {
$('<span class="node-diff-status">'+(remoteChanged?'<i class="fa fa-square"></i>':'')+'</span>').appendTo(remoteCell);
RED.utils.createObjectElement({x:remoteNode.x,y:remoteNode.y}).appendTo(remoteCell);
element = $('<span class="node-diff-element"></span>').appendTo(remoteCell);
propertyElements['remote.position'] = RED.utils.createObjectElement({x:remoteNode.x,y:remoteNode.y},
{
path: "position",
exposeApi: true,
ontoggle: function(path,state) {
if (propertyElements['local.'+path]) {
propertyElements['local.'+path].prop('expand')(path,state);
}
}
}
).appendTo(element);
} else {
remoteCell.addClass("node-diff-empty");
}
@@ -668,7 +675,7 @@ RED.diff = (function() {
){
conflict = true;
}
row = $("<tr>").appendTo(nodePropertiesTable);
row = $("<tr>").appendTo(nodePropertiesTableBody);
$("<td>",{class:"node-diff-property-cell-label"}).html("wires").appendTo(row);
localCell = $("<td>",{class:"node-diff-property-cell node-diff-node-local"}).appendTo(row);
if (localNode) {
@@ -700,10 +707,14 @@ RED.diff = (function() {
}
}
}
var properties = Object.keys(node).filter(function(p) { return p!='z'&&p!='wires'&&p!=='x'&&p!=='y'&&p!=='id'&&p!=='type'&&(!def.defaults||!def.defaults.hasOwnProperty(p))});
var properties = Object.keys(node).filter(function(p) { return p!='inputLabels'&&p!='outputLabels'&&p!='z'&&p!='wires'&&p!=='x'&&p!=='y'&&p!=='id'&&p!=='type'&&(!def.defaults||!def.defaults.hasOwnProperty(p))});
if (def.defaults) {
properties = properties.concat(Object.keys(def.defaults));
}
if (node.type !== 'tab') {
properties = properties.concat(['inputLabels','outputLabels']);
}
properties.forEach(function(d) {
localChanged = false;
remoteChanged = false;
@@ -731,8 +742,8 @@ RED.diff = (function() {
conflict = true;
}
row = $("<tr>").appendTo(nodePropertiesTable);
$("<td>",{class:"node-diff-property-cell-label"}).html(d).appendTo(row);
row = $("<tr>").appendTo(nodePropertiesTableBody);
var propertyNameCell = $("<td>",{class:"node-diff-property-cell-label"}).html(d).appendTo(row);
localCell = $("<td>",{class:"node-diff-property-cell node-diff-node-local"}).appendTo(row);
if (localNode) {
if (!conflict) {
@@ -742,7 +753,18 @@ RED.diff = (function() {
localCell.addClass("node-diff-node-conflict");
$('<span class="node-diff-status"><i class="fa fa-exclamation"></i></span>').appendTo(localCell);
}
RED.utils.createObjectElement(localNode[d]).appendTo(localCell);
element = $('<span class="node-diff-element"></span>').appendTo(localCell);
propertyElements['local.'+d] = RED.utils.createObjectElement(localNode[d],
{
path: d,
exposeApi: true,
ontoggle: function(path,state) {
if (propertyElements['remote.'+d]) {
propertyElements['remote.'+d].prop('expand')(path,state)
}
}
}
).appendTo(element);
} else {
localCell.addClass("node-diff-empty");
}
@@ -756,7 +778,18 @@ RED.diff = (function() {
remoteCell.addClass("node-diff-node-conflict");
$('<span class="node-diff-status"><i class="fa fa-exclamation"></i></span>').appendTo(remoteCell);
}
RED.utils.createObjectElement(remoteNode[d]).appendTo(remoteCell);
element = $('<span class="node-diff-element"></span>').appendTo(remoteCell);
propertyElements['remote.'+d] = RED.utils.createObjectElement(remoteNode[d],
{
path: d,
exposeApi: true,
ontoggle: function(path,state) {
if (propertyElements['local.'+d]) {
propertyElements['local.'+d].prop('expand')(path,state)
}
}
}
).appendTo(element);
} else {
remoteCell.addClass("node-diff-empty");
}
@@ -1002,186 +1035,225 @@ RED.diff = (function() {
// console.log(conflicted);
return diff;
}
function showDiff(diff) {
if (diffVisible) {
return;
}
var localDiff = diff.localDiff;
var remoteDiff = diff.remoteDiff;
var conflicts = diff.conflicts;
currentDiff = diff;
var list = $("#node-dialog-view-diff-diff");
list.editableList('empty');
if (remoteDiff) {
$("#node-diff-view-diff-merge").show();
if (Object.keys(conflicts).length === 0) {
$("#node-diff-view-diff-merge").removeClass('disabled');
} else {
$("#node-diff-view-diff-merge").addClass('disabled');
}
} else {
$("#node-diff-view-diff-merge").hide();
}
refreshConflictHeader();
$("#node-dialog-view-diff-headers").empty();
// console.log("--------------");
// console.log(localDiff);
// console.log(remoteDiff);
var currentConfig = localDiff.currentConfig;
var newConfig = localDiff.newConfig;
conflicts = conflicts || {};
var el = {
diff: localDiff,
def: {
category: 'config',
color: '#f0f0f0'
var trayOptions = {
title: "Review Changes", //TODO: nls
width: Infinity,
buttons: [
{
text: RED._("common.label.cancel"),
click: function() {
RED.tray.close();
}
},
{
id: "node-diff-view-diff-merge",
text: RED._("deploy.confirm.button.merge"),
class: "primary disabled",
click: function() {
if (!$("#node-diff-view-diff-merge").hasClass('disabled')) {
refreshConflictHeader();
mergeDiff(currentDiff);
RED.tray.close();
}
}
}
],
resize: function(dimensions) {
// trayWidth = dimensions.width;
},
tab: {
n: {},
nodes: currentConfig.globals
},
newTab: {
n: {},
nodes: newConfig.globals
}
};
open: function(tray) {
var trayBody = tray.find('.editor-tray-body');
var diffPanel = buildDiffPanel(trayBody);
if (remoteDiff) {
$("#node-diff-view-diff-merge").show();
if (Object.keys(conflicts).length === 0) {
$("#node-diff-view-diff-merge").removeClass('disabled');
} else {
$("#node-diff-view-diff-merge").addClass('disabled');
}
} else {
$("#node-diff-view-diff-merge").hide();
}
refreshConflictHeader();
if (remoteDiff !== undefined) {
$('#node-dialog-view-diff').addClass('node-diff-three-way');
$("#node-dialog-view-diff-headers").empty();
// console.log("--------------");
// console.log(localDiff);
// console.log(remoteDiff);
var currentConfig = localDiff.currentConfig;
var newConfig = localDiff.newConfig;
conflicts = conflicts || {};
$('<div class="node-diff-node-entry-cell"></div><div class="node-diff-node-entry-cell" data-i18n="diff.local"></div><div class="node-diff-node-entry-cell" data-i18n="diff.remote"></div>').i18n().appendTo("#node-dialog-view-diff-headers");
el.remoteTab = {
n:{},
nodes:remoteDiff.newConfig.globals
};
el.remoteDiff = remoteDiff;
} else {
$('#node-dialog-view-diff').removeClass('node-diff-three-way');
}
list.editableList('addItem',el);
var seenTabs = {};
currentConfig.tabOrder.forEach(function(tabId) {
var tab = currentConfig.tabs[tabId];
var el = {
diff: localDiff,
def: {},
tab:tab
};
if (newConfig.tabs.hasOwnProperty(tabId)) {
el.newTab = newConfig.tabs[tabId];
}
if (remoteDiff !== undefined) {
el.remoteTab = remoteDiff.newConfig.tabs[tabId];
el.remoteDiff = remoteDiff;
}
seenTabs[tabId] = true;
list.editableList('addItem',el)
});
newConfig.tabOrder.forEach(function(tabId) {
if (!seenTabs[tabId]) {
seenTabs[tabId] = true;
var tab = newConfig.tabs[tabId];
var el = {
diff: localDiff,
def: {},
tab:tab,
newTab: tab
def: {
category: 'config',
color: '#f0f0f0'
},
tab: {
n: {},
nodes: currentConfig.globals
},
newTab: {
n: {},
nodes: newConfig.globals
}
};
if (remoteDiff !== undefined) {
diffPanel.addClass('node-diff-three-way');
$('<div data-i18n="diff.local"></div><div data-i18n="diff.remote"></div>').i18n().appendTo("#node-dialog-view-diff-headers");
el.remoteTab = {
n:{},
nodes:remoteDiff.newConfig.globals
};
el.remoteDiff = remoteDiff;
} else {
diffPanel.removeClass('node-diff-three-way');
}
list.editableList('addItem',el)
}
});
if (remoteDiff !== undefined) {
remoteDiff.newConfig.tabOrder.forEach(function(tabId) {
if (!seenTabs[tabId]) {
var tab = remoteDiff.newConfig.tabs[tabId];
// TODO how to recognise this is a remotely added flow
diffList.editableList('addItem',el);
var seenTabs = {};
currentConfig.tabOrder.forEach(function(tabId) {
var tab = currentConfig.tabs[tabId];
var el = {
diff: localDiff,
remoteDiff: remoteDiff,
def: {},
tab:tab,
remoteTab:tab
def: RED.nodes.getType('tab'),
tab:tab
};
list.editableList('addItem',el)
}
});
}
var subflowId;
for (subflowId in currentConfig.subflows) {
if (currentConfig.subflows.hasOwnProperty(subflowId)) {
seenTabs[subflowId] = true;
el = {
diff: localDiff,
def: {
defaults:{},
icon:"subflow.png",
category: "subflows",
color: "#da9"
},
tab:currentConfig.subflows[subflowId]
}
if (newConfig.subflows.hasOwnProperty(subflowId)) {
el.newTab = newConfig.subflows[subflowId];
}
if (remoteDiff !== undefined) {
el.remoteTab = remoteDiff.newConfig.subflows[subflowId];
el.remoteDiff = remoteDiff;
}
list.editableList('addItem',el)
}
}
for (subflowId in newConfig.subflows) {
if (newConfig.subflows.hasOwnProperty(subflowId) && !seenTabs[subflowId]) {
seenTabs[subflowId] = true;
el = {
diff: localDiff,
def: {
defaults:{},
icon:"subflow.png",
category: "subflows",
color: "#da9"
},
tab:newConfig.subflows[subflowId],
newTab:newConfig.subflows[subflowId]
}
if (remoteDiff !== undefined) {
el.remoteDiff = remoteDiff;
}
list.editableList('addItem',el)
}
}
if (remoteDiff !== undefined) {
for (subflowId in remoteDiff.newConfig.subflows) {
if (remoteDiff.newConfig.subflows.hasOwnProperty(subflowId) && !seenTabs[subflowId]) {
el = {
diff: localDiff,
remoteDiff: remoteDiff,
def: {
defaults:{},
icon:"subflow.png",
category: "subflows",
color: "#da9"
},
tab:remoteDiff.newConfig.subflows[subflowId],
remoteTab: remoteDiff.newConfig.subflows[subflowId]
if (newConfig.tabs.hasOwnProperty(tabId)) {
el.newTab = newConfig.tabs[tabId];
}
list.editableList('addItem',el)
if (remoteDiff !== undefined) {
el.remoteTab = remoteDiff.newConfig.tabs[tabId];
el.remoteDiff = remoteDiff;
}
seenTabs[tabId] = true;
diffList.editableList('addItem',el)
});
newConfig.tabOrder.forEach(function(tabId) {
if (!seenTabs[tabId]) {
seenTabs[tabId] = true;
var tab = newConfig.tabs[tabId];
var el = {
diff: localDiff,
def: RED.nodes.getType('tab'),
tab:tab,
newTab: tab
};
if (remoteDiff !== undefined) {
el.remoteDiff = remoteDiff;
}
diffList.editableList('addItem',el)
}
});
if (remoteDiff !== undefined) {
remoteDiff.newConfig.tabOrder.forEach(function(tabId) {
if (!seenTabs[tabId]) {
var tab = remoteDiff.newConfig.tabs[tabId];
// TODO how to recognise this is a remotely added flow
var el = {
diff: localDiff,
remoteDiff: remoteDiff,
def: RED.nodes.getType('tab'),
tab:tab,
remoteTab:tab
};
diffList.editableList('addItem',el)
}
});
}
var subflowId;
for (subflowId in currentConfig.subflows) {
if (currentConfig.subflows.hasOwnProperty(subflowId)) {
seenTabs[subflowId] = true;
el = {
diff: localDiff,
def: {
defaults:{},
icon:"subflow.png",
category: "subflows",
color: "#da9"
},
tab:currentConfig.subflows[subflowId]
}
if (newConfig.subflows.hasOwnProperty(subflowId)) {
el.newTab = newConfig.subflows[subflowId];
}
if (remoteDiff !== undefined) {
el.remoteTab = remoteDiff.newConfig.subflows[subflowId];
el.remoteDiff = remoteDiff;
}
diffList.editableList('addItem',el)
}
}
for (subflowId in newConfig.subflows) {
if (newConfig.subflows.hasOwnProperty(subflowId) && !seenTabs[subflowId]) {
seenTabs[subflowId] = true;
el = {
diff: localDiff,
def: {
defaults:{},
icon:"subflow.png",
category: "subflows",
color: "#da9"
},
tab:newConfig.subflows[subflowId],
newTab:newConfig.subflows[subflowId]
}
if (remoteDiff !== undefined) {
el.remoteDiff = remoteDiff;
}
diffList.editableList('addItem',el)
}
}
if (remoteDiff !== undefined) {
for (subflowId in remoteDiff.newConfig.subflows) {
if (remoteDiff.newConfig.subflows.hasOwnProperty(subflowId) && !seenTabs[subflowId]) {
el = {
diff: localDiff,
remoteDiff: remoteDiff,
def: {
defaults:{},
icon:"subflow.png",
category: "subflows",
color: "#da9"
},
tab:remoteDiff.newConfig.subflows[subflowId],
remoteTab: remoteDiff.newConfig.subflows[subflowId]
}
diffList.editableList('addItem',el)
}
}
}
$("#sidebar-shade").show();
},
close: function() {
diffVisible = false;
$("#sidebar-shade").hide();
},
show: function() {
}
}
$("#node-diff-filter-changed").addClass("selected");
$("#node-diff-filter-all").removeClass("selected");
$("#node-dialog-view-diff").dialog("open");
RED.tray.show(trayOptions);
}
function mergeDiff(diff) {
var currentConfig = diff.localDiff.currentConfig;
var localDiff = diff.localDiff;
@@ -1260,7 +1332,6 @@ RED.diff = (function() {
RED.palette.refresh();
RED.workspaces.refresh();
RED.sidebar.config.refresh();
}
return {
init: init,

View File

@@ -660,7 +660,7 @@ RED.editor = (function() {
function buildLabelRow(type, index, value, placeHolder) {
var result = $('<div>',{class:"node-label-form-row"});
if (type === undefined) {
$('<span>').html("none").appendTo(result);
$('<span>').html(RED._("editor.noDefaultLabel")).appendTo(result);
result.addClass("node-label-form-none");
} else {
result.addClass("");

View File

@@ -89,7 +89,7 @@ RED.keyboard = (function() {
RED.userSettings.add({
id:'keyboard',
title: 'Keyboard',
title: RED._("keyboard.keyboard"),
get: getSettingsPane,
focus: function() {
setTimeout(function() {
@@ -350,7 +350,8 @@ RED.keyboard = (function() {
$(this).toggleClass("input-error",!valid);
})
var scopeSelect = $('<select><option value="*">global</option><option value="workspace">workspace</option></select>').appendTo(scope);
var scopeSelect = $('<select><option value="*" data-i18n="keyboard.global"></option><option value="workspace" data-i18n="keyboard.workspace"></option></select>').appendTo(scope);
scopeSelect.i18n();
scopeSelect.val(object.scope||'*');
var div = $('<div class="keyboard-shortcut-edit button-group-vertical"></div>').appendTo(scope);
@@ -468,9 +469,9 @@ RED.keyboard = (function() {
var pane = $('<div id="user-settings-tab-keyboard"></div>');
$('<div class="keyboard-shortcut-entry keyboard-shortcut-list-header">'+
'<div class="keyboard-shortcut-entry-key keyboard-shortcut-entry-text"><input id="user-settings-tab-keyboard-filter" type="text" placeholder="filter actions"></div>'+
'<div class="keyboard-shortcut-entry-key">shortcut</div>'+
'<div class="keyboard-shortcut-entry-scope">scope</div>'+
'<div class="keyboard-shortcut-entry-key keyboard-shortcut-entry-text"><input id="user-settings-tab-keyboard-filter" type="text" data-i18n="[placeholder]keyboard.filterActions"></div>'+
'<div class="keyboard-shortcut-entry-key" data-i18n="keyboard.shortcut"></div>'+
'<div class="keyboard-shortcut-entry-scope" data-i18n="keyboard.scope"></div>'+
'</div>').appendTo(pane);
pane.find("input").searchBox({

View File

@@ -423,7 +423,7 @@ RED.palette.editor = (function() {
RED.userSettings.add({
id:'palette',
title: 'Palette',
title: RED._("palette.editor.palette"),
get: getSettingsPane,
close: function() {
settingsPane.detach();

View File

@@ -125,7 +125,7 @@ RED.search = (function() {
function createDialog() {
dialog = $("<div>",{id:"red-ui-search",class:"red-ui-search"}).appendTo("#main-container");
var searchDiv = $("<div>",{class:"red-ui-search-container"}).appendTo(dialog);
searchInput = $('<input type="text" placeholder="search your flows">').appendTo(searchDiv).searchBox({
searchInput = $('<input type="text" data-i18n="[placeholder]menu.label.searchInput">').appendTo(searchDiv).searchBox({
delay: 200,
change: function() {
search($(this).val());
@@ -166,6 +166,7 @@ RED.search = (function() {
}
}
});
searchInput.i18n();
var searchResultsDiv = $("<div>",{class:"red-ui-search-results-container"}).appendTo(dialog);
searchResults = $('<ol>',{id:"search-result-list", style:"position: absolute;top: 5px;bottom: 5px;left: 5px;right: 5px;"}).appendTo(searchResultsDiv).editableList({

View File

@@ -50,11 +50,11 @@ RED.sidebar.info = (function() {
}).hide();
nodeSection = sections.add({
title: "Node",
title: RED._("sidebar.info.node"),
collapsible: false
});
infoSection = sections.add({
title: "Information",
title: RED._("sidebar.info.information"),
collapsible: false
});
infoSection.content.css("padding","6px");
@@ -132,15 +132,15 @@ RED.sidebar.info = (function() {
var propRow;
var subflowNode;
if (node.type === "tab") {
nodeSection.title.html("Flow");
propRow = $('<tr class="node-info-node-row"><td>Name</td><td></td></tr>').appendTo(tableBody);
nodeSection.title.html(RED._("sidebar.info.flow"));
propRow = $('<tr class="node-info-node-row"><td>'+RED._("sidebar.info.tabName")+'</td><td></td></tr>').appendTo(tableBody);
$(propRow.children()[1]).html('&nbsp;'+(node.label||""))
propRow = $('<tr class="node-info-node-row"><td>'+RED._("sidebar.info.id")+"</td><td></td></tr>").appendTo(tableBody);
RED.utils.createObjectElement(node.id).appendTo(propRow.children()[1]);
propRow = $('<tr class="node-info-node-row"><td>Status</td><td></td></tr>').appendTo(tableBody);
$(propRow.children()[1]).html((!!!node.disabled)?"Enabled":"Disabled")
propRow = $('<tr class="node-info-node-row"><td>'+RED._("sidebar.info.status")+'</td><td></td></tr>').appendTo(tableBody);
$(propRow.children()[1]).html((!!!node.disabled)?RED._("sidebar.info.enabled"):RED._("sidebar.info.disabled"))
} else {
nodeSection.title.html("Node");
nodeSection.title.html(RED._("sidebar.info.node"));
if (node.type !== "subflow" && node.name) {
$('<tr class="node-info-node-row"><td>'+RED._("common.label.name")+'</td><td>&nbsp;<span class="bidiAware" dir="'+RED.text.bidi.resolveBaseTextDir(node.name)+'">'+node.name+'</span></td></tr>').appendTo(tableBody);
}
@@ -188,7 +188,7 @@ RED.sidebar.info = (function() {
}
}
if (count > 0) {
$('<tr class="node-info-property-expand blank"><td colspan="2"><a href="#" class=" node-info-property-header'+(expandedSections.property?" expanded":"")+'"><span class="node-info-property-show-more">show more</span><span class="node-info-property-show-less">show less</span> <i class="fa fa-caret-down"></i></a></td></tr>').appendTo(tableBody);
$('<tr class="node-info-property-expand blank"><td colspan="2"><a href="#" class=" node-info-property-header'+(expandedSections.property?" expanded":"")+'"><span class="node-info-property-show-more">'+RED._("sidebar.info.showMore")+'</span><span class="node-info-property-show-less">'+RED._("sidebar.info.showLess")+'</span> <i class="fa fa-caret-down"></i></a></td></tr>').appendTo(tableBody);
}
}
}

View File

@@ -34,6 +34,10 @@ RED.tray = (function() {
if (options.title) {
$('<div class="editor-tray-titlebar">'+options.title+'</div>').appendTo(header);
}
if (options.width === Infinity) {
options.maximized = true;
resizer.addClass('editor-tray-resize-maximised');
}
var buttonBar = $('<div class="editor-tray-toolbar"></div>').appendTo(header);
var primaryButton;
if (options.buttons) {
@@ -74,7 +78,8 @@ RED.tray = (function() {
};
stack.push(tray);
el.draggable({
if (!options.maximized) {
el.draggable({
handle: resizer,
axis: "x",
start:function(event,ui) {
@@ -103,6 +108,7 @@ RED.tray = (function() {
tray.width = -ui.position.left;
}
});
}
function finishBuild() {
$("#header-shade").show();
@@ -175,7 +181,7 @@ RED.tray = (function() {
var tray = stack[stack.length-1];
var trayHeight = tray.tray.height()-tray.header.outerHeight()-tray.footer.outerHeight();
tray.body.height(trayHeight);
if (tray.width > $("#editor-stack").position().left-8) {
if (tray.options.maximized || tray.width > $("#editor-stack").position().left-8) {
tray.width = $("#editor-stack").position().left-8;
tray.tray.width(tray.width);
// tray.body.parent().width(tray.width);

View File

@@ -236,7 +236,7 @@ RED.typeSearch = (function() {
var items = [];
RED.nodes.registry.getNodeTypes().forEach(function(t) {
var def = RED.nodes.getType(t);
if (def.category !== 'config' && t !== 'unknown') {
if (def.category !== 'config' && t !== 'unknown' && t !== 'tab') {
items.push({type:t,def: def, label:getTypeLabel(t,def)});
}
});

View File

@@ -33,7 +33,7 @@ RED.userSettings = (function() {
var tabContainer;
var trayOptions = {
title: "User Settings",
title: RED._("menu.label.userSettings"),
buttons: [
{
id: "node-dialog-ok",
@@ -100,7 +100,7 @@ RED.userSettings = (function() {
var viewSettings = [
{
title: "Grid",
title: "menu.label.view.grid",
options: [
{setting:"view-show-grid",oldSetting:"menu-menu-item-view-show-grid",label:"menu.label.view.showGrid",toggle:true,onchange:"core:toggle-show-grid"},
{setting:"view-snap-grid",oldSetting:"menu-menu-item-view-snap-grid",label:"menu.label.view.snapGrid",toggle:true,onchange:"core:toggle-snap-grid"},
@@ -108,13 +108,13 @@ RED.userSettings = (function() {
]
},
{
title: "Nodes",
title: "menu.label.nodes",
options: [
{setting:"view-node-status",oldSetting:"menu-menu-item-status",label:"menu.label.displayStatus",default: true, toggle:true,onchange:"core:toggle-status"}
]
},
{
title: "Other",
title: "menu.label.other",
options: [
{setting:"view-show-tips",oldSettings:"menu-menu-item-show-tips",label:"menu.label.showTips",toggle:true,default:true,onchange:"core:toggle-show-tips"}
]
@@ -128,7 +128,7 @@ RED.userSettings = (function() {
var pane = $('<div id="user-settings-tab-view" class="node-help"></div>');
viewSettings.forEach(function(section) {
$('<h3></h3>').text(section.title).appendTo(pane);
$('<h3></h3>').text(RED._(section.title)).appendTo(pane);
section.options.forEach(function(opt) {
var initialState = RED.settings.get(opt.setting);
var row = $('<div class="user-settings-row"></div>').appendTo(pane);
@@ -142,8 +142,34 @@ RED.userSettings = (function() {
}
});
})
addBidiPreferences(pane);
return pane;
}
function addBidiPreferences(pane) {
$('<h3></h3>').text(RED._("menu.label.bidi")).appendTo(pane);
var row;
// Bidi enabled toggle
row = $('<div class="user-settings-row"></div>').appendTo(pane);
var input = $('<label for="user-settings-view-bidi-enabled"><input id="user-settings-view-bidi-enabled" type="checkbox"> '+RED._("menu.label.bidiSupport") +'</label>').appendTo(row).find("input");
input.prop('checked',RED.text.bidi.getBidiEnabled());
// Text Direction combo
row = $('<div class="user-settings-row"></div>').appendTo(pane);
$('<label for="user-settings-view-text-direction">'+RED._("menu.label.view.textDir")+'</label>').appendTo(row);
var select = $('<select id="user-settings-view-text-direction"><option value="ltr">' + RED._("menu.label.view.ltr") + '</option><option value="rtl">' + RED._("menu.label.view.rtl") + '</option><option value="auto">' + RED._("menu.label.view.auto") + '</option></select>').appendTo(row);
select.val(RED.text.bidi.getTextDirPref());
select.prop('disabled', !RED.text.bidi.getBidiEnabled());
input.change(function() {
RED.text.bidi.setBidiEnabled(input.prop('checked'));
select.prop('disabled', !RED.text.bidi.getBidiEnabled());
});
select.change(function() {
RED.text.bidi.setTextDirPref(select.val());
});
}
function setSelected(id, value) {
var opt = allSettings[id];
@@ -169,7 +195,7 @@ RED.userSettings = (function() {
addPane({
id:'view',
title: 'View',
title: RED._("menu.label.view.view"),
get: createViewPane,
close: function() {
viewSettings.forEach(function(section) {

View File

@@ -50,24 +50,58 @@ RED.utils = (function() {
}
return result;
}
function makeExpandable(el,onexpand,expand) {
function makeExpandable(el,onbuild,ontoggle,expand) {
el.addClass("debug-message-expandable");
el.prop('toggle',function() {
return function(state) {
var parent = el.parent();
if (parent.hasClass('collapsed')) {
if (state) {
if (onbuild && !parent.hasClass('built')) {
onbuild();
parent.addClass('built');
}
parent.removeClass('collapsed');
return true;
}
} else {
if (!state) {
parent.addClass('collapsed');
return true;
}
}
return false;
}
});
el.click(function(e) {
var parent = $(this).parent();
if (parent.hasClass('collapsed')) {
if (onexpand && !parent.hasClass('built')) {
onexpand();
parent.addClass('built');
var currentState = !parent.hasClass('collapsed');
if ($(this).prop('toggle')(!currentState)) {
if (ontoggle) {
ontoggle(!currentState);
}
parent.removeClass('collapsed');
} else {
parent.addClass('collapsed');
}
// if (parent.hasClass('collapsed')) {
// if (onbuild && !parent.hasClass('built')) {
// onbuild();
// parent.addClass('built');
// }
// if (ontoggle) {
// ontoggle(true);
// }
// parent.removeClass('collapsed');
// } else {
// parent.addClass('collapsed');
// if (ontoggle) {
// ontoggle(false);
// }
// }
e.preventDefault();
});
if (expand) {
el.click();
}
}
var pinnedPaths = {};
@@ -189,10 +223,23 @@ RED.utils = (function() {
}
}
function buildMessageElement(obj,key,typeHint,hideKey,path,sourceId,rootPath,expandPaths) {
function buildMessageElement(obj,options) {
options = options || {};
var key = options.key;
var typeHint = options.typeHint;
var hideKey = options.hideKey;
var path = options.path;
var sourceId = options.sourceId;
var rootPath = options.rootPath;
var expandPaths = options.expandPaths;
var ontoggle = options.ontoggle;
var exposeApi = options.exposeApi;
var subElements = {};
var i;
var e;
var entryObj;
var expandableHeader;
var header;
var headerHead;
var value;
@@ -257,7 +304,7 @@ RED.utils = (function() {
$('<span class="debug-message-type-meta debug-message-object-type-header"></span>').html(typeHint||'string').appendTo(header);
var row = $('<div class="debug-message-object-entry collapsed"></div>').appendTo(element);
$('<pre class="debug-message-type-string"></pre>').text(obj).appendTo(row);
},checkExpanded(strippedKey,expandPaths));
},function(state) {if (ontoggle) { ontoggle(path,state);}}, checkExpanded(strippedKey,expandPaths));
}
e = $('<span class="debug-message-type-string debug-message-object-header"></span>').html('"'+formatString(sanitize(obj))+'"').appendTo(entryObj);
if (/^#[0-9a-f]{6}$/i.test(obj)) {
@@ -356,7 +403,20 @@ RED.utils = (function() {
if (fullLength <= 10) {
for (i=0;i<fullLength;i++) {
row = $('<div class="debug-message-object-entry collapsed"></div>').appendTo(arrayRows);
buildMessageElement(data[i],""+i,type==='buffer'?'hex':false,false,path+"["+i+"]",sourceId,rootPath,expandPaths).appendTo(row);
subElements[path+"["+i+"]"] = buildMessageElement(
data[i],
{
key: ""+i,
typeHint: type==='buffer'?'hex':false,
hideKey: false,
path: path+"["+i+"]",
sourceId: sourceId,
rootPath: rootPath,
expandPaths: expandPaths,
ontoggle: ontoggle,
exposeApi: exposeApi
}
).appendTo(row);
}
} else {
for (i=0;i<fullLength;i+=10) {
@@ -371,17 +431,35 @@ RED.utils = (function() {
return function() {
for (var i=min;i<=max;i++) {
var row = $('<div class="debug-message-object-entry collapsed"></div>').appendTo(parent);
buildMessageElement(data[i],""+i,type==='buffer'?'hex':false,false,path+"["+i+"]",sourceId,rootPath,expandPaths).appendTo(row);
subElements[path+"["+i+"]"] = buildMessageElement(
data[i],
{
key: ""+i,
typeHint: type==='buffer'?'hex':false,
hideKey: false,
path: path+"["+i+"]",
sourceId: sourceId,
rootPath: rootPath,
expandPaths: expandPaths,
ontoggle: ontoggle,
exposeApi: exposeApi
}
).appendTo(row);
}
}
})(),checkExpanded(strippedKey,expandPaths,minRange,Math.min(fullLength-1,(minRange+9))));
})(),
(function() { var path = path+"["+i+"]"; return function(state) {if (ontoggle) { ontoggle(path,state);}}})(),
checkExpanded(strippedKey,expandPaths,minRange,Math.min(fullLength-1,(minRange+9))));
$('<span class="debug-message-object-key"></span>').html("["+minRange+" &hellip; "+Math.min(fullLength-1,(minRange+9))+"]").appendTo(header);
}
if (fullLength < originalLength) {
$('<div class="debug-message-object-entry collapsed"><span class="debug-message-object-key">['+fullLength+' &hellip; '+originalLength+']</span></div>').appendTo(arrayRows);
}
}
},checkExpanded(strippedKey,expandPaths));
},
function(state) {if (ontoggle) { ontoggle(path,state);}},
checkExpanded(strippedKey,expandPaths));
}
} else if (typeof obj === 'object') {
element.addClass('collapsed');
@@ -395,17 +473,35 @@ RED.utils = (function() {
for (i=0;i<keys.length;i++) {
var row = $('<div class="debug-message-object-entry collapsed"></div>').appendTo(element);
var newPath = path;
if (/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(keys[i])) {
newPath += (newPath.length > 0?".":"")+keys[i];
} else {
newPath += "[\""+keys[i].replace(/"/,"\\\"")+"\"]"
if (newPath) {
if (/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(keys[i])) {
newPath += (newPath.length > 0?".":"")+keys[i];
} else {
newPath += "[\""+keys[i].replace(/"/,"\\\"")+"\"]"
}
}
buildMessageElement(obj[keys[i]],keys[i],false,false,newPath,sourceId,rootPath,expandPaths).appendTo(row);
subElements[newPath] = buildMessageElement(
obj[keys[i]],
{
key: keys[i],
typeHint: false,
hideKey: false,
path: newPath,
sourceId: sourceId,
rootPath: rootPath,
expandPaths: expandPaths,
ontoggle: ontoggle,
exposeApi: exposeApi
}
).appendTo(row);
}
if (keys.length === 0) {
$('<div class="debug-message-object-entry debug-message-type-meta collapsed"></div>').text("empty").appendTo(element);
}
},checkExpanded(strippedKey,expandPaths));
},
function(state) {if (ontoggle) { ontoggle(path,state);}},
checkExpanded(strippedKey,expandPaths));
}
if (key) {
$('<span class="debug-message-type-meta"></span>').html('object').appendTo(entryObj);
@@ -432,6 +528,28 @@ RED.utils = (function() {
} else {
$('<span class="debug-message-type-other"></span>').text(""+obj).appendTo(entryObj);
}
if (exposeApi) {
element.prop('expand', function() { return function(targetPath, state) {
if (path === targetPath) {
if (header.prop('toggle')) {
header.prop('toggle')(state);
}
} else if (subElements[targetPath] && subElements[targetPath].prop('expand') ) {
subElements[targetPath].prop('expand')(targetPath,state);
} else {
for (var p in subElements) {
if (subElements.hasOwnProperty(p)) {
if (targetPath.indexOf(p) === 0) {
if (subElements[p].prop('expand') ) {
subElements[p].prop('expand')(targetPath,state);
}
break;
}
}
}
}
}});
}
return element;
}
@@ -578,6 +696,8 @@ RED.utils = (function() {
return "icons/node-red/subflow.png"
} else if (node && node.type === 'unknown') {
return "icons/node-red/alert.png"
} else if (node && node.type === 'subflow') {
return "icons/node-red/subflow.png"
}
var icon_url;
if (typeof def.icon === "function") {

View File

@@ -30,7 +30,7 @@ RED.workspaces = (function() {
workspaceIndex += 1;
} while ($("#workspace-tabs a[title='"+RED._('workspace.defaultName',{number:workspaceIndex})+"']").size() !== 0);
ws = {type:"tab",id:tabId,label:RED._('workspace.defaultName',{number:workspaceIndex})};
ws = {type:"tab",id:tabId,disabled: false,info:"",label:RED._('workspace.defaultName',{number:workspaceIndex})};
RED.nodes.addWorkspace(ws);
workspace_tabs.addTab(ws);
workspace_tabs.activateTab(tabId);

View File

@@ -50,7 +50,7 @@ RED.user = (function() {
for (;i<data.prompts.length;i++) {
var field = data.prompts[i];
var row = $("<div/>",{class:"form-row"});
$('<label for="node-dialog-login-'+field.id+'">'+field.label+':</label><br/>').appendTo(row);
$('<label for="node-dialog-login-'+field.id+'">'+RED._(field.label)+':</label><br/>').appendTo(row);
var input = $('<input style="width: 100%" id="node-dialog-login-'+field.id+'" type="'+field.type+'" tabIndex="'+(i+1)+'"/>').appendTo(row);
if (i<data.prompts.length-1) {

View File

@@ -16,8 +16,6 @@
#node-dialog-view-diff {
height: 600px;
.red-ui-editableList-container {
border-radius:1px;
padding:0;
@@ -35,7 +33,6 @@
border: none;
min-height: 0;
}
}
.red-ui-editableList-item-content {
padding: 5px;
@@ -44,19 +41,23 @@
}
#node-dialog-view-diff-headers {
position: absolute;
left:17px;
right:32px;
left:237px;
right:18px;
top: 55px;
height: 25px;
.node-diff-node-entry-cell:not(:first-child) {
div {
height: 25px;
display: inline-block;
box-sizing: border-box;
width: 50%;
background: #f9f9f9;
text-align: center;
border-top: 1px solid $secondary-border-color;
border-color:$secondary-border-color;
border-left: 1px solid $secondary-border-color;
}
.node-diff-node-entry-cell:last-child {
div:last-child {
border-right: 1px solid $secondary-border-color;
}
}
@@ -106,10 +107,10 @@
font-size: 0.9em;
&:first-child {
border-top: 1px solid #eee;
border-top: 1px solid $secondary-border-color;
}
&:not(:last-child) {
border-bottom: 1px solid #eee;
border-bottom: 1px solid $secondary-border-color;
}
&.collapsed {
@@ -132,14 +133,21 @@
table {
border-collapse: collapse;
table-layout:fixed;
// Fix for table-layout: fixed on safari:
max-width: none;
width: auto;
min-width: 100%;
width: calc(100% - 20px);
margin-left: 20px;
}
col:first-child {
width: 180px;
}
col:not(:first-child) {
width: 100%;
}
td, th {
border: 1px solid $secondary-border-color;
border-top: 1px solid #f3f3f3;
border-left: 1px solid $secondary-border-color;
&:first-child {
border-left: none;
}
padding: 0 0 0 3px;
text-align: left;
overflow-x: auto;
@@ -150,13 +158,12 @@
white-space:nowrap;
overflow:hidden;
}
&:hover {
background: #f9f9f9;
}
}
td:first-child {
width: 140px;
}
td:not(:first-child) {
width: calc( 100% - 140px);
}
td {
.node-diff-status {
margin-left: 0;
@@ -179,8 +186,8 @@
width: 220px;
}
}
td:not(:first-child) {
width: calc( (100% - 140px) / 2);
col:not(:first-child) {
width:50%;
}
.node-diff-node-entry {
@@ -210,6 +217,9 @@
cursor: pointer;
padding: 0;
// background: #f6f6f6;
&:hover {
background: #f9f9f9;
}
}
.node-diff-tab-title-meta {
vertical-align: middle;
@@ -218,6 +228,9 @@
}
.node-diff-node-entry-header {
cursor: pointer;
&:hover {
background: #f9f9f9;
}
}
.node-diff-node-entry-node {
vertical-align: middle;
@@ -247,6 +260,9 @@
}
.node-diff-tab-title {
cursor: default;
&:hover {
background: none;
}
}
}
.node-diff-node-deleted {
@@ -301,7 +317,7 @@
}
}
.node-diff-node-entry-properties {
margin: 5px ;
margin: 0;
color: #666;
}
.node-diff-status {
@@ -313,6 +329,10 @@
margin-bottom: 6px;
text-align: center;
}
.node-diff-element {
display: inline-block;
width: calc(100% - 20px);
}
.node-diff-node-description {
color: $form-text-color;
@@ -346,7 +366,7 @@
box-sizing: border-box;
width: calc( (100% - 20px) / 2);
height: 32px;
border-left: 1px solid #eee;
border-left: 1px solid $secondary-border-color;
padding-top: 2px;
white-space: nowrap;
overflow: hidden;

View File

@@ -132,6 +132,11 @@
cursor: col-resize;
border-left: 1px solid $primary-border-color;
box-shadow: -1px 0 6px rgba(0,0,0,0.1);
&.editor-tray-resize-maximised {
background: $background-color;
cursor: default;
}
}
.editor-tray-resize-button {
@include workspace-button;

View File

@@ -224,4 +224,5 @@
bottom: 0;
right: 0;
background: $shade-color;
z-index: 5;
}

View File

@@ -181,7 +181,7 @@ If you want every 20 minutes from now - use the <i>"interval"</i> option.</p>
topic: {value:""},
payload: {value:"", validate: RED.validators.typedInput("payloadType")},
payloadType: {value:"date"},
repeat: {value:""},
repeat: {value:"", validate:function(v) { return ((v === "") || (RED.validators.number(v) && (v >= 0))) }},
crontab: {value:""},
once: {value:false}
},

View File

@@ -73,7 +73,13 @@
oneditprepare: function() {
var that = this;
$( "#node-input-outputs" ).spinner({
min:1
min:1,
change: function(event, ui) {
var value = this.value;
if (!value.match(/^\d+$/)) { value = 1; }
else if (value < this.min) { value = this.min; }
if (value !== this.value) { $(this).spinner("value", value); }
}
});
this.editor = RED.editor.createEditor({

View File

@@ -129,13 +129,13 @@
defaults: {
name: {value:""},
pauseType: {value:"delay", required:true},
timeout: {value:"5", required:true, validate:RED.validators.number()},
timeout: {value:"5", required:true, validate:function(v) { return RED.validators.number(v) && (v >= 0); }},
timeoutUnits: {value:"seconds"},
rate: {value:"1", required:true, validate:RED.validators.number()},
rate: {value:"1", required:true, validate:function(v) { return RED.validators.number(v) && (v >= 0); }},
nbRateUnits: {value:"1", required:false, validate:RED.validators.regex(/\d+|/)},
rateUnits: {value: "second"},
randomFirst: {value:"1", required:true, validate:RED.validators.number()},
randomLast: {value:"5", required:true, validate:RED.validators.number()},
randomFirst: {value:"1", required:true, validate:function(v) { return RED.validators.number(v) && (v >= 0); }},
randomLast: {value:"5", required:true, validate:function(v) { return RED.validators.number(v) && (v >= 0); }},
randomUnits: {value: "seconds"},
drop: {value:false}
},

View File

@@ -171,6 +171,7 @@ module.exports = function(RED) {
}
if (msg.hasOwnProperty("reset")) {
clearInterval(node.intervalID);
node.intervalID = -1;
node.buffer = [];
node.status({text:"reset"});
}

View File

@@ -441,7 +441,14 @@ RED.debug = (function() {
}
var el = $('<span class="debug-message-payload"></span>').appendTo(msg);
var path = o.property||'';
var debugMessage = RED.utils.createObjectElement(payload,/*true*/null,format,false,path,sourceNode&&sourceNode.id,path);
var debugMessage = RED.utils.createObjectElement(payload, {
key: /*true*/null,
typeHint: format,
hideKey: false,
path: path,
sourceId: sourceNode&&sourceNode.id,
rootPath: path
});
// Do this in a separate step so the element functions aren't stripped
debugMessage.appendTo(el);
// NOTE: relying on function error to have a "type" that all other msgs don't

View File

@@ -165,6 +165,10 @@
</script>
<script type="text/x-red" data-template-name="mqtt-broker">
<div class="form-row">
<label for="node-config-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
<input type="text" id="node-config-input-name" data-i18n="[placeholder]common.label.name">
</div>
<div class="form-row">
<ul style="background: #fff; min-width: 600px; margin-bottom: 20px;" id="node-config-mqtt-broker-tabs"></ul>
</div>
@@ -266,6 +270,7 @@
RED.nodes.registerType('mqtt-broker',{
category: 'config',
defaults: {
name: {value:""},
broker: {value:"",required:true},
port: {value:1883,required:true,validate:RED.validators.number()},
tls: {type:"tls-config",required: false},
@@ -296,9 +301,15 @@
password: {type: "password"}
},
label: function() {
var b = this.broker;
if (b === "") { b = "undefined"; }
return (this.clientid?this.clientid+"@":"")+b+":"+this.port;
var lab = this.name;
if ((lab === undefined) || (lab ==="")) {
var b = this.broker;
if (b === "") { b = "undefined"; }
lab = (this.clientid?this.clientid+"@":"")+b+":"+this.port;
}
return lab;
},
oneditprepare: function () {
var tabs = RED.tabs.create({

View File

@@ -392,7 +392,7 @@
"tip": {
"path1": "標準では <code>payload</code> がwebsocketから送信、受信されるデータを持ちます。クライアントはJSON形式の文字列としてメッセージ全体を送信、受信するよう設定できます。",
"path2": "This path will be relative to ",
"url1": "URLには ws:&#47;&#47; or wss:&#47;&#47; スキーマを使用して、存在するwebsocketリスナを設定してください。",
"url1": "URLには ws:&#47;&#47; または wss:&#47;&#47; スキーマを使用して、存在するwebsocketリスナを設定してください。",
"url2": "標準では <code>payload</code> がwebsocketから送信、受信されるデータを持ちます。クライアントはJSON形式の文字列としてメッセージ全体を送信、受信するよう設定できます。"
},
"errors": {

View File

@@ -84,7 +84,7 @@ function login(req,res) {
if (settings.adminAuth.type === "credentials") {
response = {
"type":"credentials",
"prompts":[{id:"username",type:"text",label:"Username"},{id:"password",type:"password",label:"Password"}]
"prompts":[{id:"username",type:"text",label:"user.username"},{id:"password",type:"password",label:"user.password"}]
}
} else if (settings.adminAuth.type === "strategy") {
response = {

View File

@@ -29,6 +29,7 @@
"label": {
"view": {
"view": "View",
"grid": "Grid",
"showGrid": "Show grid",
"snapGrid": "Snap to grid",
"gridSize": "Grid size",
@@ -41,12 +42,15 @@
"sidebar": {
"show": "Show sidebar"
},
"userSettings": "Settings",
"settings": "Settings",
"userSettings": "User Settings",
"nodes": "Nodes",
"displayStatus": "Show node status",
"displayConfig": "Configuration nodes",
"import": "Import",
"export": "Export",
"search": "Search flows",
"searchInput": "search your flows",
"clipboard": "Clipboard",
"library": "Library",
"examples": "Examples",
@@ -61,11 +65,17 @@
"login": "Login",
"logout": "Logout",
"editPalette":"Manage palette",
"showTips": "Show tips"
"other": "Other",
"showTips": "Show tips",
"help": "Node-RED website",
"bidi": "Bidi",
"bidiSupport": "Enable Bidi support"
}
},
"user": {
"loggedInAs": "Logged in as __name__",
"username": "Username",
"password": "Password",
"login": "Login",
"loginFailed": "Login failed",
"notAuthorized": "Not authorized"
@@ -145,6 +155,7 @@
"improperlyConfigured": "The workspace contains some nodes that are not properly configured:",
"unknown": "The workspace contains some unknown node types:",
"confirm": "Are you sure you want to deploy?",
"doNotWarn": "do not warn about this again",
"conflict": "The server is running a more recent set of flows.",
"backgroundUpdate": "The flows on the server have been updated.",
"conflictChecking": "Checking to see if the changes can be merged automatically",
@@ -155,6 +166,8 @@
"diff": {
"unresolvedCount": "__count__ unresolved conflict",
"unresolvedCount_plural": "__count__ unresolved conflicts",
"globalNodes": "Global nodes",
"flowProperties": "Flow Properties",
"type": {
"added": "added",
"changed": "changed",
@@ -167,8 +180,8 @@
},
"nodeCount": "__count__ node",
"nodeCount_plural": "__count__ nodes",
"local":"Local",
"remote":"Remote"
"local":"Local changes",
"remote":"Remote changes"
},
"subflow": {
@@ -210,7 +223,13 @@
},
"keyboard": {
"title": "Keyboard Shortcuts",
"keyboard": "Keyboard",
"filterActions": "filter actions",
"shortcut": "shortcut",
"scope": "scope",
"unassigned": "Unassigned",
"global": "global",
"workspace": "workspace",
"selectAll": "Select all nodes",
"selectAllConnected": "Select all connected nodes",
"addRemoveNode": "Add/remove node from selection",
@@ -275,6 +294,7 @@
},
"editor": {
"title": "Manage palette",
"palette": "Palette",
"times": {
"seconds": "seconds ago",
"minutes": "minutes ago",
@@ -353,16 +373,24 @@
"sidebar": {
"info": {
"name": "Node information",
"tabName": "Name",
"label": "info",
"node": "Node",
"type": "Type",
"id": "ID",
"status": "Status",
"enabled": "Enabled",
"disabled": "Disabled",
"subflow": "Subflow",
"instances": "Instances",
"properties": "Properties",
"info": "Information",
"blank": "blank",
"null": "null",
"showMore": "show more",
"showLess": "show less",
"flow": "Flow",
"information": "Information",
"arrayItems": "__count__ items",
"showTips":"You can open the tips from the settings panel"
},
@@ -389,6 +417,7 @@
"re": "regular expression",
"bool": "boolean",
"json": "JSON",
"bin": "buffer",
"date": "timestamp"
}
},

View File

@@ -29,6 +29,7 @@
"label": {
"view": {
"view": "表示",
"grid": "グリッド",
"showGrid": "グリッドを表示",
"snapGrid": "ノードの配置を補助",
"gridSize": "グリッドの大きさ",
@@ -41,12 +42,15 @@
"sidebar": {
"show": "サイドバーを表示"
},
"userSettings": "設定",
"settings": "設定",
"userSettings": "ユーザ設定",
"nodes": "ノード",
"displayStatus": "ノードの状態を表示",
"displayConfig": "ノードの設定",
"import": "読み込み",
"export": "書き出し",
"search": "ノードを検索",
"searchInput": "ノードを検索",
"clipboard": "クリップボード",
"library": "ライブラリ",
"examples": "サンプル",
@@ -61,11 +65,15 @@
"login": "ログイン",
"logout": "ログアウト",
"editPalette": "パレットの管理",
"showTips": "ヒントを表示"
"other": "その他",
"showTips": "ヒントを表示",
"help": "Node-REDウェブサイト"
}
},
"user": {
"loggedInAs": "__name__ としてログインしました",
"username": "ユーザ名",
"password": "パスワード",
"login": "ログイン",
"loginFailed": "ログインに失敗しました",
"notAuthorized": "権限がありません"
@@ -75,7 +83,7 @@
"warnings": {
"undeployedChanges": "ノードの変更をデプロイしていません",
"nodeActionDisabled": "ノードのアクションは、サブフロー内で無効になっています",
"missing-types": "不明なノードが存在するため、フローを停止しました。詳細はログを確認してください",
"missing-types": "不明なノードが存在するため、フローを停止しました。詳細はログを確認してください",
"restartRequired": "更新されたモジュールを有効化するため、Node-REDを再起動する必要があります"
},
"error": "<strong>エラー</strong>: __message__",
@@ -85,7 +93,7 @@
"lostConnectionTry": "すぐに接続",
"cannotAddSubflowToItself": "サブフロー自身を追加できません",
"cannotAddCircularReference": "循環参照を検出したため、サブフローを追加できません",
"unsupportedVersion": "サポートされていないバージョンのNode.jsを使用しています。<br/>最新のNode.js LTSに更新してください"
"unsupportedVersion": "サポートされていないバージョンのNode.jsを使用しています。<br/>最新のNode.js LTSに更新してください"
}
},
"clipboard": {
@@ -144,6 +152,7 @@
"improperlyConfigured": "以下のノードは、正しくプロパティが設定されていません:",
"unknown": "ワークスペースに未知の型のノードがあります。",
"confirm": "このままデプロイしても良いですか?",
"doNotWarn": "この警告を再度表示しない",
"conflict": "フローを編集している間に、他のブラウザがフローをデプロイしました。デプロイを継続すると、他のブラウザがデプロイしたフローが削除されます。",
"backgroundUpdate": "サーバ上のフローが更新されました",
"conflictChecking": "変更を自動的にマージしてよいか確認してください。",
@@ -154,6 +163,8 @@
"diff": {
"unresolvedCount": "未解決の衝突 __count__",
"unresolvedCount_plural": "未解決の衝突 __count__",
"globalNodes": "グローバルノード",
"flowProperties": "フロープロパティ",
"type": {
"added": "追加",
"changed": "変更",
@@ -166,8 +177,8 @@
},
"nodeCount": "ノード数 __count__",
"nodeCount_plural": "ノード数 __count__",
"local": "ローカル",
"remote": "リモート"
"local": "ローカルの変更",
"remote": "リモートの変更"
},
"subflow": {
"editSubflow": "フローのテンプレートを編集: __name__",
@@ -208,7 +219,13 @@
},
"keyboard": {
"title": "キーボードショートカット",
"keyboard": "キーボード",
"filterActions": "動作を検索",
"shortcut": "ショートカット",
"scope": "範囲",
"unassigned": "未割当",
"global": "グローバル",
"workspace": "ワークスペース",
"selectAll": "全てのノードを選択",
"selectAllConnected": "接続された全てのノードを選択",
"addRemoveNode": "ノードの選択、選択解除",
@@ -234,8 +251,8 @@
"exportToLibrary": "ライブラリへフローを書き出す",
"dialogSaveOverwrite": "__libraryName__ という __libraryType__ は既に存在しています 上書きしますか?",
"invalidFilename": "不正なファイル名",
"savedNodes": "保存されたノード",
"savedType": "保存された __type__",
"savedNodes": "フローを保存しました",
"savedType": "__type__ を保存しました",
"saveFailed": "保存に失敗しました: __message__",
"filename": "ファイル名",
"folder": "フォルダ",
@@ -271,6 +288,7 @@
},
"editor": {
"title": "パレットの管理",
"palette": "パレット",
"times": {
"seconds": "秒前",
"minutes": "分前",
@@ -312,12 +330,12 @@
"sortRecent": "日付順",
"more": "+ さらに __count__ 個",
"errors": {
"catalogLoadFailed": "ノードのカタログの読み込みに失敗しました<br>詳細はブラウザのコンソールを確認してください",
"installFailed": "追加処理が失敗しました: __module__<br>__message__<br>詳細はログを確認してください",
"removeFailed": "削除処理が失敗しました: __module__<br>__message__<br>詳細はログを確認してください",
"updateFailed": "更新処理が失敗しました: __module__<br>__message__<br>詳細はログを確認してください",
"enableFailed": "有効化処理が失敗しました: __module__<br>__message__<br>詳細はログを確認してください",
"disableFailed": "無効化処理が失敗しました: __module__<br>__message__<br>詳細はログを確認してください"
"catalogLoadFailed": "ノードのカタログの読み込みに失敗しました<br>詳細はブラウザのコンソールを確認してください",
"installFailed": "追加処理が失敗しました: __module__<br>__message__<br>詳細はログを確認してください",
"removeFailed": "削除処理が失敗しました: __module__<br>__message__<br>詳細はログを確認してください",
"updateFailed": "更新処理が失敗しました: __module__<br>__message__<br>詳細はログを確認してください",
"enableFailed": "有効化処理が失敗しました: __module__<br>__message__<br>詳細はログを確認してください",
"disableFailed": "無効化処理が失敗しました: __module__<br>__message__<br>詳細はログを確認してください"
},
"confirm": {
"install": {
@@ -347,16 +365,24 @@
"sidebar": {
"info": {
"name": "ノードの情報を表示",
"tabName": "名前",
"label": "情報",
"node": "ノード",
"type": "型",
"id": "ID",
"status": "状態",
"enabled": "有効",
"disabled": "無効",
"subflow": "サブフロー",
"instances": "インスタンス",
"properties": "プロパティ",
"info": "情報",
"blank": "ブランク",
"null": "ヌル",
"showMore": "さらに表示",
"showLess": "表示を省略",
"flow": "フロー",
"information": "情報",
"arrayItems": "__count__ 要素",
"showTips": "設定からヒントを表示できます"
},
@@ -383,6 +409,7 @@
"re": "正規表現",
"bool": "真偽",
"json": "JSON",
"bin": "バッファ",
"date": "日時"
}
},

View File

@@ -155,6 +155,9 @@ function start() {
if (settings.settingsFile) {
log.info(log._("runtime.paths.settings",{path:settings.settingsFile}));
}
if (settings.httpStatic) {
log.info(log._("runtime.paths.httpStatic",{path:path.resolve(settings.httpStatic)}));
}
redNodes.loadFlows().then(redNodes.startFlows);
started = true;
}).otherwise(function(err) {

View File

@@ -4,7 +4,8 @@
"version": "__component__ version: __version__",
"unsupported_version": "Unsupported version of __component__. Requires: __requires__ Found: __version__",
"paths": {
"settings": "Settings file : __path__"
"settings": "Settings file : __path__",
"httpStatic": "HTTP Static : __path__"
}
},