mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Rework bidi file structure
Closes #1026,#983,#982,#978 PR #1026 contains the full history of the changes made herein. Due to the volume of commits with no meaningful comment, they have been squashed down to this one. Adding bidi Files Tuning code style Adding rest of bidi files and its dependencies Tuning code style editing numeric shaping value Tuning Code style adding bidi support Adding Bidi Support for the rest of files Adding Bidi support Editing Bidi menu adding mirroring enablement handeling code style Addinng Bidi Support Adding Bidi Support Adding locale settings to national calendar support Adding Numeric Shaping Support scss files after adding rtl direction part 1 adding rtl direction at scss files part2 adding right directionality at comman typeInput correcting some comments editing spaces applying code style editing code style editing code style editing code style editing code style adding right directionality adding right directionality adding style in case of right directionality adding style in case of right directionality adding style in case of right directionality create a global variable for ui direction to call it once need Update main.js Update typedInput.js Update 10-switch.html manage palette mirroring adding RTL directionality to Tabs and Manage palette Style Editing Adding mirroring to subflow workspace handle mirroring defects at manage palette Handle Mirroring defects at sidebar seperator Numeric Shaping Updates Editing code style Handling mirroring defects Handling mirroring defects Fixing mirroring defects editing code style fixing mirroring defects at deploy dialog editing code style Updating Bidi Support handling some reviewing comments handling chicks Update base-text-dir.js Update bidi-util.js Update bidi-util.js Handling reviewing comment Fixing Popover mirroring defect Handling namespace structure for bidi features reflecting new namespace structure for bidi features at editorfiles Handling comments that related to css moving bidi.js under js/bidi folder
This commit is contained in:
committed by
Nick O'Leary
parent
b67df2c0ab
commit
e5511ea86d
@@ -75,7 +75,7 @@ RED.menu = (function() {
|
||||
linkContent += '<span class="menu-label-container"><span class="menu-label">'+opt.label+'</span>'+
|
||||
'<span class="menu-sublabel">'+opt.sublabel+'</span></span>'
|
||||
} else {
|
||||
linkContent += '<span class="menu-label">'+opt.label+'</span>'
|
||||
linkContent += '<span class="menu-label">'+RED.bidi.applyBidiSupport(opt.label, RED.bidi.flags.NS)+'</span>'
|
||||
}
|
||||
|
||||
linkContent += '</a>';
|
||||
|
||||
@@ -34,8 +34,8 @@ RED.popover = (function() {
|
||||
var targetHeight = target.height();
|
||||
|
||||
var divHeight = div.height();
|
||||
div.css({top: targetPos.top+targetHeight/2-divHeight/2-10,left:targetPos.left+targetWidth+17});
|
||||
|
||||
var popoverPos = ((RED.bidi.isMirroringEnabled()) ? targetPos.left-targetWidth-210 : targetPos.left+targetWidth+17);
|
||||
div.css({top: targetPos.top+targetHeight/2-divHeight/2-10,left:popoverPos});
|
||||
div.fadeIn("fast");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,6 +89,7 @@
|
||||
if (val === undefined || val === null || val === "") {
|
||||
this.resultCount.text("").hide();
|
||||
} else {
|
||||
val = RED.bidi.applyBidiSupport(val,RED.bidi.flags.NS);
|
||||
this.resultCount.text(val).show();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,9 +202,8 @@ RED.tabs = (function() {
|
||||
if (tab.icon) {
|
||||
$('<img src="'+tab.icon+'" class="red-ui-tab-icon"/>').appendTo(link);
|
||||
}
|
||||
var span = $('<span/>',{class:"bidiAware"}).text(tab.label).appendTo(link);
|
||||
span.attr('dir', RED.text.bidi.resolveBaseTextDir(tab.label));
|
||||
|
||||
var span = $('<span/>',{class:"bidiAware"});
|
||||
span.attr('dir', RED.bidi.resolveBaseTextDir(tab.label)).text(RED.bidi.applyBidiSupport(tab.label,RED.bidi.flags.NS)).appendTo(link);
|
||||
link.on("click",onTabClick);
|
||||
link.on("dblclick",onTabDblClick);
|
||||
if (tab.closeable) {
|
||||
@@ -314,7 +313,7 @@ RED.tabs = (function() {
|
||||
tabs[id].label = label;
|
||||
var tab = ul.find("a[href='#"+id+"']");
|
||||
tab.attr("title",label);
|
||||
tab.find("span").text(label).attr('dir', RED.text.bidi.resolveBaseTextDir(label));
|
||||
tab.find("span").attr('dir', RED.bidi.resolveBaseTextDir(label)).text(RED.bidi.applyBidiSupport(label,RED.bidi.flags.NS));
|
||||
updateTabWidths();
|
||||
},
|
||||
order: function(order) {
|
||||
|
||||
@@ -198,12 +198,12 @@
|
||||
if (opt.label) {
|
||||
op.text(opt.label);
|
||||
}
|
||||
// reverse property direction in case of right directionality
|
||||
if (opt.icon) {
|
||||
$('<img>',{src:opt.icon,style:"margin-right: 4px; height: 18px;"}).prependTo(op);
|
||||
$('<img>',{src:opt.icon,style:"margin-"+RED.bidi.componentPos.right+": 4px; height: 18px;"}).prependTo(op);
|
||||
} else {
|
||||
op.css({paddingLeft: "18px"});
|
||||
op.css("padding-"+RED.bidi.componentPos.left, "18px");
|
||||
}
|
||||
|
||||
op.click(function(event) {
|
||||
event.preventDefault();
|
||||
callback(opt.value);
|
||||
@@ -225,15 +225,19 @@
|
||||
var that = this;
|
||||
var pos = relativeTo.offset();
|
||||
var height = relativeTo.height();
|
||||
var width = relativeTo.outerWidth();
|
||||
var menuHeight = menu.height();
|
||||
var top = (height+pos.top-3);
|
||||
if (top+menuHeight > $(window).height()) {
|
||||
top -= (top+menuHeight)-$(window).height()+5;
|
||||
}
|
||||
|
||||
var menuPos = ((RED.bidi.isMirroringEnabled()) ? ((pos.left + width) - (menu.offset().left + menu.outerWidth())) : (2+pos.left));
|
||||
menu.css({
|
||||
top: top+"px",
|
||||
left: (2+pos.left)+"px",
|
||||
left: menuPos+"px",
|
||||
});
|
||||
|
||||
menu.slideDown(100);
|
||||
this._delay(function() {
|
||||
that.uiSelect.addClass('red-ui-typedInput-focus');
|
||||
@@ -271,9 +275,10 @@
|
||||
} else {
|
||||
this.selectTrigger.width('auto');
|
||||
var labelWidth = this._getLabelWidth(this.selectTrigger);
|
||||
this.elementDiv.css('left',labelWidth+"px");
|
||||
// reverse property direction in case of right directionality
|
||||
this.elementDiv.css(RED.bidi.componentPos.left,labelWidth+"px");
|
||||
if (this.optionSelectTrigger) {
|
||||
this.optionSelectTrigger.css('left',(labelWidth+5)+"px");
|
||||
this.optionSelectTrigger.css(RED.bidi.componentPos.left,(labelWidth+5)+"px");
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -336,7 +341,7 @@
|
||||
image = new Image();
|
||||
image.name = opt.icon;
|
||||
image.src = opt.icon;
|
||||
$('<img>',{src:opt.icon,style:"margin-right: 4px;height: 18px;"}).prependTo(this.selectLabel);
|
||||
$('<img>',{src:opt.icon,style:"margin-"+RED.bidi.componentPos.right+": 4px;height: 18px;"}).prependTo(this.selectLabel);
|
||||
} else {
|
||||
this.selectLabel.text(opt.label);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ 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;">'+
|
||||
.prepend('<div style="height:0; vertical-align: middle; display:inline-block; margin-top: 13px; float:'+RED.bidi.componentPos.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 type="hidden" id="node-dialog-confirm-deploy-type">'+
|
||||
@@ -570,7 +570,7 @@ RED.deploy = (function() {
|
||||
$( "#node-dialog-confirm-deploy-config" ).show();
|
||||
invalidNodes.sort(sortNodeInfo);
|
||||
$( "#node-dialog-confirm-deploy-invalid-list" )
|
||||
.html("<li>"+invalidNodes.map(function(A) { return (A.tab?"["+A.tab+"] ":"")+A.label+" ("+A.type+")"}).join("</li><li>")+"</li>");
|
||||
.html("<li>"+invalidNodes.map(function(A) { return (A.tab?"["+RED.bidi.applyBidiSupport(A.tab, RED.bidi.flags.NS)+"] ":"")+RED.bidi.applyBidiSupport(A.label, RED.bidi.flags.NS)+" ("+A.type+")"}).join("</li><li>")+"</li>");
|
||||
|
||||
} else if (hasUnusedConfig && !ignoreDeployWarnings.unusedConfig) {
|
||||
// showWarning = true;
|
||||
|
||||
@@ -315,12 +315,12 @@ RED.editor = (function() {
|
||||
val = "";
|
||||
}
|
||||
if (definition !== undefined && definition[property].hasOwnProperty("format") && definition[property].format !== "" && input[0].nodeName === "DIV") {
|
||||
input.html(RED.text.format.getHtml(val, definition[property].format, {}, false, "en"));
|
||||
RED.text.format.attach(input[0], definition[property].format, {}, false, "en");
|
||||
input.html(RED.bidi.applyBidiSupport(val, RED.bidi.flags.STT_GETHTML, definition[property].format, {}));
|
||||
RED.bidi.applyBidiSupport(input[0],RED.bidi.flags.STT_ATTACH, definition[property].format, {});
|
||||
} else {
|
||||
input.val(val);
|
||||
if (input[0].nodeName === 'INPUT' || input[0].nodeName === 'TEXTAREA') {
|
||||
RED.text.bidi.prepareInput(input);
|
||||
RED.bidi.prepareInput(input);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1186,7 +1186,7 @@ RED.editor = (function() {
|
||||
}
|
||||
|
||||
configNodes.forEach(function(cn) {
|
||||
select.append('<option value="'+cn.id+'"'+(value==cn.id?" selected":"")+'>'+RED.text.bidi.enforceTextDirectionWithUCC(cn.__label__)+'</option>');
|
||||
select.append('<option value="'+cn.id+'"'+(value==cn.id?" selected":"")+'>'+RED.bidi.applyBidiSupport(cn.__label__,RED.bidi.flags.BTD & RED.bidi.flags.NS)+'</option>');
|
||||
delete cn.__label__;
|
||||
});
|
||||
|
||||
@@ -1320,7 +1320,7 @@ RED.editor = (function() {
|
||||
});
|
||||
|
||||
$("#subflow-input-name").val(subflow.name);
|
||||
RED.text.bidi.prepareInput($("#subflow-input-name"));
|
||||
RED.bidi.prepareInput($("#subflow-input-name"));
|
||||
subflowEditor.getSession().setValue(subflow.info||"",-1);
|
||||
var userCount = 0;
|
||||
var subflowType = "subflow:"+editing_node.id;
|
||||
|
||||
@@ -105,7 +105,7 @@ RED.keyboard = (function() {
|
||||
}
|
||||
if (!dialog) {
|
||||
dialog = $('<div id="keyboard-help-dialog" class="hide">'+
|
||||
'<div style="vertical-align: top;display:inline-block; box-sizing: border-box; width:50%; padding: 10px;">'+
|
||||
'<div id="keyboard-help-dialog-div1">'+
|
||||
'<table class="keyboard-shortcuts">'+
|
||||
'<tr><td><span class="help-key">Ctrl/⌘</span> + <span class="help-key">a</span></td><td>'+RED._("keyboard.selectAll")+'</td></tr>'+
|
||||
'<tr><td><span class="help-key">Shift</span> + <span class="help-key">Click</span></td><td>'+RED._("keyboard.selectAllConnected")+'</td></tr>'+
|
||||
@@ -121,7 +121,7 @@ RED.keyboard = (function() {
|
||||
'<tr><td><span class="help-key">Shift</span> + <span class="help-key"> ↓ </span></td></tr>'+
|
||||
'</table>'+
|
||||
'</div>'+
|
||||
'<div style="vertical-align: top;display:inline-block; box-sizing: border-box; width:50%; padding: 10px;">'+
|
||||
'<div id="keyboard-help-dialog-div2">'+
|
||||
'<table class="keyboard-shortcuts">'+
|
||||
'<tr><td><span class="help-key">Ctrl/⌘</span> + <span class="help-key">Space</span></td><td>'+RED._("keyboard.toggleSidebar")+'</td></tr>'+
|
||||
'<tr><td><span class="help-key">Ctrl/⌘</span> + <span class="help-key">.</span></td><td>'+RED._("keyboard.searchBox")+'</td></tr>'+
|
||||
|
||||
@@ -17,6 +17,7 @@ RED.notify = (function() {
|
||||
var currentNotifications = [];
|
||||
var c = 0;
|
||||
return function(msg,type,fixed,timeout) {
|
||||
msg = RED.bidi.applyBidiSupport(msg ,RED.bidi.flags.NS);
|
||||
if (currentNotifications.length > 4) {
|
||||
var ll = currentNotifications.length;
|
||||
for (var i = 0;ll > 4 && i<currentNotifications.length;i+=1) {
|
||||
|
||||
@@ -235,6 +235,7 @@ RED.palette.editor = (function() {
|
||||
}
|
||||
}
|
||||
var nodeCount = (activeTypeCount === typeCount)?typeCount:activeTypeCount+" / "+typeCount;
|
||||
nodeCount = RED.bidi.applyBidiSupport(nodeCount,RED.bidi.flags.NS);
|
||||
nodeEntry.setCount.html(RED._('palette.editor.nodeCount',{count:typeCount,label:nodeCount}));
|
||||
|
||||
if (nodeEntries[module].totalUseCount > 0) {
|
||||
@@ -454,7 +455,7 @@ RED.palette.editor = (function() {
|
||||
var titleRow = $('<div class="palette-module-meta palette-module-name"><i class="fa fa-cube"></i></div>').appendTo(headerRow);
|
||||
$('<span>').html(entry.name).appendTo(titleRow);
|
||||
var metaRow = $('<div class="palette-module-meta palette-module-version"><i class="fa fa-tag"></i></div>').appendTo(headerRow);
|
||||
$('<span>').html(entry.version).appendTo(metaRow);
|
||||
$('<span>').html(RED.bidi.applyBidiSupport(entry.version,RED.bidi.flags.NS)).appendTo(metaRow);
|
||||
var buttonRow = $('<div>',{class:"palette-module-meta"}).appendTo(headerRow);
|
||||
var setButton = $('<a href="#" class="editor-button editor-button-small palette-module-set-button"><i class="fa fa-angle-right palette-module-node-chevron"></i> </a>').appendTo(buttonRow);
|
||||
var setCount = $('<span>').appendTo(setButton);
|
||||
|
||||
@@ -86,20 +86,22 @@ RED.palette = (function() {
|
||||
}
|
||||
displayLines.push(currentLine);
|
||||
|
||||
var lines = displayLines.join("<br/>");
|
||||
var tempLines = displayLines.join("^&%");
|
||||
tempLines =RED.bidi.applyBidiSupport(tempLines, RED.bidi.flags.NS);
|
||||
var lines = tempLines.replace("^&%", "<br/>");
|
||||
var multiLineNodeHeight = 8+(lineHeight*displayLines.length);
|
||||
el.css({height:multiLineNodeHeight+"px"});
|
||||
|
||||
var labelElement = el.find(".palette_label");
|
||||
labelElement.html(lines).attr('dir', RED.text.bidi.resolveBaseTextDir(lines));
|
||||
labelElement.html(lines).attr('dir', RED.bidi.resolveBaseTextDir(lines));
|
||||
|
||||
el.find(".palette_port").css({top:(multiLineNodeHeight/2-5)+"px"});
|
||||
|
||||
var popOverContent;
|
||||
try {
|
||||
var l = "<p><b>"+RED.text.bidi.enforceTextDirectionWithUCC(label)+"</b></p>";
|
||||
var l = "<p><b>"+RED.bidi.applyBidiSupport(label,RED.bidi.flags.BTD & RED.bidi.flags.NS)+"</b></p>";
|
||||
if (label != type) {
|
||||
l = "<p><b>"+RED.text.bidi.enforceTextDirectionWithUCC(label)+"</b><br/><i>"+type+"</i></p>";
|
||||
l = "<p><b>"+RED.bidi.applyBidiSupport(label,RED.bidi.flags.BTD & RED.bidi.flags.NS)+"</b><br/><i>"+type+"</i></p>";
|
||||
}
|
||||
popOverContent = $(l+(info?info:$("script[data-help-name$='"+type+"']").html()||"<p>"+RED._("palette.noInfo")+"</p>").trim())
|
||||
.filter(function(n) {
|
||||
|
||||
@@ -113,7 +113,7 @@ RED.sidebar = (function() {
|
||||
sidebarSeparator.opening = true;
|
||||
var newChartRight = 7;
|
||||
$("#sidebar").addClass("closing");
|
||||
$("#workspace").css("right",newChartRight);
|
||||
$("#workspace").css(RED.bidi.componentPos.right,newChartRight);
|
||||
$("#editor-stack").css("right",newChartRight+1);
|
||||
$("#sidebar").width(0);
|
||||
RED.menu.setSelected("menu-item-sidebar",true);
|
||||
@@ -123,16 +123,21 @@ RED.sidebar = (function() {
|
||||
},
|
||||
drag: function(event,ui) {
|
||||
var d = ui.position.left-sidebarSeparator.start;
|
||||
var newSidebarWidth = sidebarSeparator.width-d;
|
||||
// using to handle sidebar width at both RTL and LTR UIs
|
||||
var newSidebarWidth = (RED.bidi.isMirroringEnabled() ? sidebarSeparator.width + d : sidebarSeparator.width - d);
|
||||
if (sidebarSeparator.opening) {
|
||||
newSidebarWidth -= 3;
|
||||
}
|
||||
|
||||
if (newSidebarWidth > 150) {
|
||||
if (sidebarSeparator.chartWidth+d < 200) {
|
||||
// to handle sidebar width at both RTL and LTR UIs
|
||||
var tempValue = (RED.bidi.isMirroringEnabled() ? sidebarSeparator.chartWidth - d : sidebarSeparator.chartWidth + d);
|
||||
if (tempValue < 200) {
|
||||
|
||||
ui.position.left = 200+sidebarSeparator.start-sidebarSeparator.chartWidth;
|
||||
d = ui.position.left-sidebarSeparator.start;
|
||||
newSidebarWidth = sidebarSeparator.width-d;
|
||||
// to handle sidebar width at both RTL and LTR UIs
|
||||
newSidebarWidth = (RED.bidi.isMirroringEnabled() ? sidebarSeparator.width + d : sidebarSeparator.width - d);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,8 +156,9 @@ RED.sidebar = (function() {
|
||||
$("#sidebar").removeClass("closing");
|
||||
}
|
||||
|
||||
var newChartRight = sidebarSeparator.chartRight-d;
|
||||
$("#workspace").css("right",newChartRight);
|
||||
//to handle workspace css right property at both RTL and LTR UIs
|
||||
var newChartRight = (RED.bidi.isMirroringEnabled() ? $("#editor-stack").css("right") : sidebarSeparator.chartRight-d);
|
||||
$("#workspace").css(RED.bidi.componentPos.right,(RED.bidi.isMirroringEnabled() ? newSidebarWidth+2 : newChartRight));
|
||||
$("#editor-stack").css("right",newChartRight+1);
|
||||
$("#sidebar").width(newSidebarWidth);
|
||||
|
||||
@@ -165,12 +171,12 @@ RED.sidebar = (function() {
|
||||
RED.menu.setSelected("menu-item-sidebar",false);
|
||||
if ($("#sidebar").width() < 180) {
|
||||
$("#sidebar").width(180);
|
||||
$("#workspace").css("right",187);
|
||||
$("#workspace").css(RED.bidi.componentPos.right,187);
|
||||
$("#editor-stack").css("right",188);
|
||||
}
|
||||
}
|
||||
$("#sidebar-separator").css("left","auto");
|
||||
$("#sidebar-separator").css("right",($("#sidebar").width()+2)+"px");
|
||||
$("#sidebar-separator").css(RED.bidi.componentPos.left,"auto");
|
||||
$("#sidebar-separator").css(RED.bidi.componentPos.right,($("#sidebar").width()+2)+"px");
|
||||
RED.events.emit("sidebar:resize");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -139,7 +139,7 @@ RED.subflow = (function() {
|
||||
RED.view.select();
|
||||
RED.nodes.dirty(true);
|
||||
RED.view.redraw();
|
||||
$("#workspace-subflow-output .spinner-value").html(subflow.out.length);
|
||||
$("#workspace-subflow-output .spinner-value").html(RED.bidi.applyBidiSupport(subflow.out.length,RED.bidi.flags.NS));
|
||||
}
|
||||
|
||||
function removeSubflowOutput(removedSubflowOutputs) {
|
||||
@@ -216,7 +216,7 @@ RED.subflow = (function() {
|
||||
$("#workspace-subflow-input-add").toggleClass("active", activeSubflow.in.length !== 0);
|
||||
$("#workspace-subflow-input-remove").toggleClass("active",activeSubflow.in.length === 0);
|
||||
|
||||
$("#workspace-subflow-output .spinner-value").html(activeSubflow.out.length);
|
||||
$("#workspace-subflow-output .spinner-value").html(RED.bidi.applyBidiSupport(activeSubflow.out.length,RED.bidi.flags.NS));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,15 +224,15 @@ RED.subflow = (function() {
|
||||
var toolbar = $("#workspace-toolbar");
|
||||
toolbar.empty();
|
||||
|
||||
$('<a class="button" id="workspace-subflow-edit" href="#" data-i18n="[append]subflow.editSubflowProperties"><i class="fa fa-pencil"></i> </a>').appendTo(toolbar);
|
||||
$('<span style="margin-left: 5px;" data-i18n="subflow.input"></span> '+
|
||||
'<div style="display: inline-block;" class="button-group">'+
|
||||
'<a id="workspace-subflow-input-remove" class="button active" href="#">0</a>'+
|
||||
$('<a class="button subflow-toolbar" id="workspace-subflow-edit" href="#" data-i18n="[append]subflow.editSubflowProperties"><i class="fa fa-pencil"></i> </a>').appendTo(toolbar);
|
||||
$('<span class="workspace-subflow-label" data-i18n="subflow.input"></span> '+
|
||||
'<div style="display: inline-block;" class="button-group subflow-toolbar">'+
|
||||
'<a id="workspace-subflow-input-remove" class="button active subflow-toolbar" href="#">0</a>'+
|
||||
'<a id="workspace-subflow-input-add" class="button" href="#">1</a>'+
|
||||
'</div>').appendTo(toolbar);
|
||||
|
||||
$('<span style="margin-left: 5px;" data-i18n="subflow.output"></span> <div id="workspace-subflow-output" style="display: inline-block;" class="button-group spinner-group">'+
|
||||
'<a id="workspace-subflow-output-remove" class="button" href="#"><i class="fa fa-minus"></i></a>'+
|
||||
$('<span class="workspace-subflow-label" data-i18n="subflow.output"></span> <div id="workspace-subflow-output" style="display: inline-block;" class="button-group spinner-group">'+
|
||||
'<a id="workspace-subflow-output-remove" class="button subflow-toolbar" href="#"><i class="fa fa-minus"></i></a>'+
|
||||
'<div class="spinner-value">3</div>'+
|
||||
'<a id="workspace-subflow-output-add" class="button" href="#"><i class="fa fa-plus"></i></a>'+
|
||||
'</div>').appendTo(toolbar);
|
||||
@@ -243,6 +243,11 @@ RED.subflow = (function() {
|
||||
toolbar.i18n();
|
||||
|
||||
|
||||
var subflow_add = RED.bidi.applyBidiSupport($("#workspace-subflow-input-add").text(),RED.bidi.flags.NS);
|
||||
var subflow_remove = RED.bidi.applyBidiSupport($("#workspace-subflow-input-remove").text(),RED.bidi.flags.NS);
|
||||
$("#workspace-subflow-input-add").html(subflow_add);
|
||||
$("#workspace-subflow-input-remove").html(subflow_remove);
|
||||
|
||||
$("#workspace-subflow-output-remove").click(function(event) {
|
||||
event.preventDefault();
|
||||
var wasDirty = RED.nodes.dirty();
|
||||
|
||||
@@ -70,10 +70,10 @@ RED.sidebar.info = (function() {
|
||||
var table = '<table class="node-info"><tbody>';
|
||||
table += '<tr class="blank"><td colspan="2">'+RED._("sidebar.info.node")+'</td></tr>';
|
||||
if (node.type != "subflow" && node.name) {
|
||||
table += '<tr><td>'+RED._("common.label.name")+'</td><td> <span class="bidiAware" dir="'+RED.text.bidi.resolveBaseTextDir(node.name)+'">'+node.name+'</span></td></tr>';
|
||||
table += '<tr><td>'+RED._("common.label.name")+'</td><td> <span class="bidiAware" dir="'+RED.bidi.resolveBaseTextDir(node.name)+'">'+RED.bidi.applyBidiSupport(node.name,RED.bidi.flags.NS)+'</span></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>";
|
||||
table += "<tr><td>"+RED._("sidebar.info.id")+"</td><td> "+RED.bidi.applyBidiSupport(node.id,RED.bidi.flags.NS)+"</td></tr>";
|
||||
|
||||
var m = /^subflow(:(.+))?$/.exec(node.type);
|
||||
var subflowNode;
|
||||
@@ -93,8 +93,8 @@ RED.sidebar.info = (function() {
|
||||
userCount++;
|
||||
}
|
||||
});
|
||||
table += '<tr><td>'+RED._("common.label.name")+'</td><td><span class="bidiAware" dir=\"'+RED.text.bidi.resolveBaseTextDir(subflowNode.name)+'">'+subflowNode.name+'</span></td></tr>';
|
||||
table += "<tr><td>"+RED._("sidebar.info.instances")+"</td><td>"+userCount+"</td></tr>";
|
||||
table += '<tr><td>'+RED._("common.label.name")+'</td><td><span class="bidiAware" dir=\"'+RED.bidi.resolveBaseTextDir(subflowNode.name)+'">'+RED.bidi.applyBidiSupport(subflowNode.name,RED.bidi.flags.NS)+'</span></td></tr>';
|
||||
table += "<tr><td>"+RED._("sidebar.info.instances")+"</td><td>"+RED.bidi.applyBidiSupport(userCount,RED.bidi.flags.NS)+"</td></tr>";
|
||||
}
|
||||
|
||||
if (!m && node.type != "subflow" && node.type != "comment") {
|
||||
@@ -132,7 +132,7 @@ RED.sidebar.info = (function() {
|
||||
val = val.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");
|
||||
}
|
||||
|
||||
table += '<tr class="node-info-property-row'+(propertiesExpanded?"":" hide")+'"><td>'+n+"</td><td>"+val+"</td></tr>";
|
||||
table += '<tr class="node-info-property-row'+(propertiesExpanded?"":" hide")+'"><td>'+n+"</td><td>"+RED.bidi.applyBidiSupport(val,RED.bidi.flags.NS)+"</td></tr>";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -140,14 +140,14 @@ RED.sidebar.info = (function() {
|
||||
table += "</tbody></table><hr/>";
|
||||
if (!subflowNode && node.type != "comment") {
|
||||
var helpText = $("script[data-help-name$='"+node.type+"']").html()||"";
|
||||
table += '<div class="node-help"><span class="bidiAware" dir=\"'+RED.text.bidi.resolveBaseTextDir(helpText)+'">'+helpText+'</span></div>';
|
||||
table += '<div class="node-help"><span class="bidiAware" dir=\"'+RED.bidi.resolveBaseTextDir(helpText)+'">'+RED.bidi.applyBidiSupport(helpText,RED.bidi.flags.NS)+'</span></div>';
|
||||
}
|
||||
if (subflowNode) {
|
||||
table += '<div class="node-help"><span class="bidiAware" dir=\"'+RED.text.bidi.resolveBaseTextDir(subflowNode.info||"")+'">'+marked(subflowNode.info||"")+'</span></div>';
|
||||
table += '<div class="node-help"><span class="bidiAware" dir=\"'+RED.bidi.resolveBaseTextDir(subflowNode.info||"")+'">'+marked(subflowNode.info||"")+'</span></div>';
|
||||
} else if (node._def && node._def.info) {
|
||||
var info = node._def.info;
|
||||
var textInfo = (typeof info === "function" ? info.call(node) : info);
|
||||
table += '<div class="node-help"><span class="bidiAware" dir=\"'+RED.text.bidi.resolveBaseTextDir(textInfo)+'">'+marked(textInfo)+'</span></div>';
|
||||
table += '<div class="node-help"><span class="bidiAware" dir=\"'+RED.bidi.resolveBaseTextDir(textInfo)+'">'+marked(textInfo)+'</span></div>';
|
||||
//table += '<div class="node-help">'+(typeof info === "function" ? info.call(node) : info)+'</div>';
|
||||
}
|
||||
|
||||
|
||||
@@ -1454,7 +1454,7 @@ RED.view = (function() {
|
||||
.on("mouseout",function(d,i) { var port = d3.select(this); port.classed("port_hovered",false);});
|
||||
|
||||
outGroup.append("svg:text").attr("class","port_label").attr("x",20).attr("y",8).style("font-size","10px").text("output");
|
||||
outGroup.append("svg:text").attr("class","port_label port_index").attr("x",20).attr("y",24).text(function(d,i){ return i+1});
|
||||
outGroup.append("svg:text").attr("class","port_label port_index").attr("x",20).attr("y",24).text(function(d,i){ return RED.bidi.applyBidiSupport(i+1,RED.bidi.flags.NS)});
|
||||
|
||||
var subflowInputs = vis.selectAll(".subflowinput").data(activeSubflow.in,function(d,i){ return d.id;});
|
||||
subflowInputs.exit().remove();
|
||||
@@ -1503,7 +1503,7 @@ RED.view = (function() {
|
||||
if (d.dirty) {
|
||||
var output = d3.select(this);
|
||||
output.selectAll(".subflowport").classed("node_selected",function(d) { return d.selected; })
|
||||
output.selectAll(".port_index").text(function(d){ return d.i+1});
|
||||
output.selectAll(".port_index").text(function(d){ return RED.bidi.applyBidiSupport(d.i+1, RED.bidi.flags.NS)});
|
||||
output.attr("transform", function(d) { return "translate(" + (d.x-d.w/2) + "," + (d.y-d.h/2) + ")"; });
|
||||
dirtyNodes[d.id] = d;
|
||||
d.dirty = false;
|
||||
@@ -1809,7 +1809,7 @@ RED.view = (function() {
|
||||
l = d._def.label;
|
||||
try {
|
||||
l = (typeof l === "function" ? l.call(d) : l)||"";
|
||||
l = RED.text.bidi.enforceTextDirectionWithUCC(l);
|
||||
l = RED.bidi.applyBidiSupport(l,RED.bidi.flags.BTD & RED.bidi.flags.NS);
|
||||
} catch(err) {
|
||||
console.log("Definition error: "+d.type+".label",err);
|
||||
l = d.type;
|
||||
|
||||
@@ -113,7 +113,7 @@ RED.workspaces = (function() {
|
||||
$('<input type="text" style="display: none;" />').prependTo(dialogForm);
|
||||
dialogForm.submit(function(e) { e.preventDefault();});
|
||||
$("#node-input-name").val(workspace.label);
|
||||
RED.text.bidi.prepareInput($("#node-input-name"))
|
||||
RED.bidi.prepareInput($("#node-input-name"))
|
||||
dialogForm.i18n();
|
||||
},
|
||||
close: function() {
|
||||
|
||||
Reference in New Issue
Block a user