mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Ensure library export dialog is i18n'd
This commit is contained in:
parent
61e0923fc4
commit
6777f24845
@ -22,20 +22,20 @@ RED.nodes = (function() {
|
|||||||
var defaultWorkspace;
|
var defaultWorkspace;
|
||||||
var workspaces = {};
|
var workspaces = {};
|
||||||
var subflows = {};
|
var subflows = {};
|
||||||
|
|
||||||
var dirty = false;
|
var dirty = false;
|
||||||
|
|
||||||
function setDirty(d) {
|
function setDirty(d) {
|
||||||
dirty = d;
|
dirty = d;
|
||||||
eventHandler.emit("change",{dirty:dirty});
|
eventHandler.emit("change",{dirty:dirty});
|
||||||
}
|
}
|
||||||
|
|
||||||
var registry = (function() {
|
var registry = (function() {
|
||||||
var nodeList = [];
|
var nodeList = [];
|
||||||
var nodeSets = {};
|
var nodeSets = {};
|
||||||
var typeToId = {};
|
var typeToId = {};
|
||||||
var nodeDefinitions = {};
|
var nodeDefinitions = {};
|
||||||
|
|
||||||
var exports = {
|
var exports = {
|
||||||
getNodeList: function() {
|
getNodeList: function() {
|
||||||
return nodeList;
|
return nodeList;
|
||||||
@ -109,7 +109,7 @@ RED.nodes = (function() {
|
|||||||
if (def.category != "subflows") {
|
if (def.category != "subflows") {
|
||||||
def.set = nodeSets[typeToId[nt]];
|
def.set = nodeSets[typeToId[nt]];
|
||||||
nodeSets[typeToId[nt]].added = true;
|
nodeSets[typeToId[nt]].added = true;
|
||||||
|
|
||||||
var ns;
|
var ns;
|
||||||
if (def.set.module === "node-red") {
|
if (def.set.module === "node-red") {
|
||||||
ns = "node-red";
|
ns = "node-red";
|
||||||
@ -144,7 +144,7 @@ RED.nodes = (function() {
|
|||||||
};
|
};
|
||||||
return exports;
|
return exports;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
function getID() {
|
function getID() {
|
||||||
return (1+Math.random()*4294967295).toString(16);
|
return (1+Math.random()*4294967295).toString(16);
|
||||||
}
|
}
|
||||||
@ -284,7 +284,7 @@ RED.nodes = (function() {
|
|||||||
var subflowNames = Object.keys(subflows).map(function(sfid) {
|
var subflowNames = Object.keys(subflows).map(function(sfid) {
|
||||||
return subflows[sfid].name;
|
return subflows[sfid].name;
|
||||||
});
|
});
|
||||||
|
|
||||||
subflowNames.sort();
|
subflowNames.sort();
|
||||||
var copyNumber = 1;
|
var copyNumber = 1;
|
||||||
var subflowName = sf.name;
|
var subflowName = sf.name;
|
||||||
@ -296,7 +296,7 @@ RED.nodes = (function() {
|
|||||||
});
|
});
|
||||||
sf.name = subflowName;
|
sf.name = subflowName;
|
||||||
}
|
}
|
||||||
|
|
||||||
subflows[sf.id] = sf;
|
subflows[sf.id] = sf;
|
||||||
RED.nodes.registerType("subflow:"+sf.id, {
|
RED.nodes.registerType("subflow:"+sf.id, {
|
||||||
defaults:{name:{value:""}},
|
defaults:{name:{value:""}},
|
||||||
@ -307,10 +307,13 @@ RED.nodes = (function() {
|
|||||||
color: "#da9",
|
color: "#da9",
|
||||||
label: function() { return this.name||RED.nodes.subflow(sf.id).name },
|
label: function() { return this.name||RED.nodes.subflow(sf.id).name },
|
||||||
labelStyle: function() { return this.name?"node_label_italic":""; },
|
labelStyle: function() { return this.name?"node_label_italic":""; },
|
||||||
paletteLabel: function() { return RED.nodes.subflow(sf.id).name }
|
paletteLabel: function() { return RED.nodes.subflow(sf.id).name },
|
||||||
|
set:{
|
||||||
|
module: "node-red"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
function getSubflow(id) {
|
function getSubflow(id) {
|
||||||
return subflows[id];
|
return subflows[id];
|
||||||
@ -319,7 +322,7 @@ RED.nodes = (function() {
|
|||||||
delete subflows[sf.id];
|
delete subflows[sf.id];
|
||||||
registry.removeNodeType("subflow:"+sf.id);
|
registry.removeNodeType("subflow:"+sf.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
function subflowContains(sfid,nodeid) {
|
function subflowContains(sfid,nodeid) {
|
||||||
for (var i=0;i<nodes.length;i++) {
|
for (var i=0;i<nodes.length;i++) {
|
||||||
var node = nodes[i];
|
var node = nodes[i];
|
||||||
@ -339,7 +342,7 @@ RED.nodes = (function() {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAllFlowNodes(node) {
|
function getAllFlowNodes(node) {
|
||||||
var visited = {};
|
var visited = {};
|
||||||
visited[node.id] = true;
|
visited[node.id] = true;
|
||||||
@ -430,7 +433,7 @@ RED.nodes = (function() {
|
|||||||
node.name = n.name;
|
node.name = n.name;
|
||||||
node.in = [];
|
node.in = [];
|
||||||
node.out = [];
|
node.out = [];
|
||||||
|
|
||||||
n.in.forEach(function(p) {
|
n.in.forEach(function(p) {
|
||||||
var nIn = {x:p.x,y:p.y,wires:[]};
|
var nIn = {x:p.x,y:p.y,wires:[]};
|
||||||
var wires = links.filter(function(d) { return d.source === p });
|
var wires = links.filter(function(d) { return d.source === p });
|
||||||
@ -454,8 +457,8 @@ RED.nodes = (function() {
|
|||||||
}
|
}
|
||||||
node.out.push(nOut);
|
node.out.push(nOut);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -561,13 +564,12 @@ RED.nodes = (function() {
|
|||||||
for (i=0;i<newNodes.length;i++) {
|
for (i=0;i<newNodes.length;i++) {
|
||||||
n = newNodes[i];
|
n = newNodes[i];
|
||||||
// TODO: remove workspace in next release+1
|
// TODO: remove workspace in next release+1
|
||||||
if (n.type != "workspace" &&
|
if (n.type != "workspace" &&
|
||||||
n.type != "tab" &&
|
n.type != "tab" &&
|
||||||
n.type != "subflow" &&
|
n.type != "subflow" &&
|
||||||
!registry.getNodeType(n.type) &&
|
!registry.getNodeType(n.type) &&
|
||||||
n.type.substring(0,8) != "subflow:" &&
|
n.type.substring(0,8) != "subflow:" &&
|
||||||
unknownTypes.indexOf(n.type)==-1) {
|
unknownTypes.indexOf(n.type)==-1) {
|
||||||
|
|
||||||
unknownTypes.push(n.type);
|
unknownTypes.push(n.type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -597,11 +599,11 @@ RED.nodes = (function() {
|
|||||||
err.code = "NODE_RED";
|
err.code = "NODE_RED";
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var new_workspaces = [];
|
var new_workspaces = [];
|
||||||
var workspace_map = {};
|
var workspace_map = {};
|
||||||
var new_subflows = [];
|
var new_subflows = [];
|
||||||
@ -800,14 +802,14 @@ RED.nodes = (function() {
|
|||||||
delete output.wires;
|
delete output.wires;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return [new_nodes,new_links,new_workspaces,new_subflows];
|
return [new_nodes,new_links,new_workspaces,new_subflows];
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: supports filter.z|type
|
// TODO: supports filter.z|type
|
||||||
function filterNodes(filter) {
|
function filterNodes(filter) {
|
||||||
var result = [];
|
var result = [];
|
||||||
|
|
||||||
for (var n=0;n<nodes.length;n++) {
|
for (var n=0;n<nodes.length;n++) {
|
||||||
var node = nodes[n];
|
var node = nodes[n];
|
||||||
if (filter.hasOwnProperty("z") && node.z !== filter.z) {
|
if (filter.hasOwnProperty("z") && node.z !== filter.z) {
|
||||||
@ -822,7 +824,7 @@ RED.nodes = (function() {
|
|||||||
}
|
}
|
||||||
function filterLinks(filter) {
|
function filterLinks(filter) {
|
||||||
var result = [];
|
var result = [];
|
||||||
|
|
||||||
for (var n=0;n<links.length;n++) {
|
for (var n=0;n<links.length;n++) {
|
||||||
var link = links[n];
|
var link = links[n];
|
||||||
if (filter.source) {
|
if (filter.source) {
|
||||||
@ -848,11 +850,11 @@ RED.nodes = (function() {
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: DRY
|
// TODO: DRY
|
||||||
var eventHandler = (function() {
|
var eventHandler = (function() {
|
||||||
var handlers = {};
|
var handlers = {};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
on: function(evt,func) {
|
on: function(evt,func) {
|
||||||
handlers[evt] = handlers[evt]||[];
|
handlers[evt] = handlers[evt]||[];
|
||||||
@ -863,43 +865,43 @@ RED.nodes = (function() {
|
|||||||
for (var i=0;i<handlers[evt].length;i++) {
|
for (var i=0;i<handlers[evt].length;i++) {
|
||||||
handlers[evt][i](arg);
|
handlers[evt][i](arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
on: eventHandler.on,
|
on: eventHandler.on,
|
||||||
|
|
||||||
registry:registry,
|
registry:registry,
|
||||||
setNodeList: registry.setNodeList,
|
setNodeList: registry.setNodeList,
|
||||||
|
|
||||||
getNodeSet: registry.getNodeSet,
|
getNodeSet: registry.getNodeSet,
|
||||||
addNodeSet: registry.addNodeSet,
|
addNodeSet: registry.addNodeSet,
|
||||||
removeNodeSet: registry.removeNodeSet,
|
removeNodeSet: registry.removeNodeSet,
|
||||||
enableNodeSet: registry.enableNodeSet,
|
enableNodeSet: registry.enableNodeSet,
|
||||||
disableNodeSet: registry.disableNodeSet,
|
disableNodeSet: registry.disableNodeSet,
|
||||||
|
|
||||||
registerType: registry.registerNodeType,
|
registerType: registry.registerNodeType,
|
||||||
getType: registry.getNodeType,
|
getType: registry.getNodeType,
|
||||||
convertNode: convertNode,
|
convertNode: convertNode,
|
||||||
|
|
||||||
add: addNode,
|
add: addNode,
|
||||||
remove: removeNode,
|
remove: removeNode,
|
||||||
|
|
||||||
addLink: addLink,
|
addLink: addLink,
|
||||||
removeLink: removeLink,
|
removeLink: removeLink,
|
||||||
|
|
||||||
addWorkspace: addWorkspace,
|
addWorkspace: addWorkspace,
|
||||||
removeWorkspace: removeWorkspace,
|
removeWorkspace: removeWorkspace,
|
||||||
workspace: getWorkspace,
|
workspace: getWorkspace,
|
||||||
|
|
||||||
addSubflow: addSubflow,
|
addSubflow: addSubflow,
|
||||||
removeSubflow: removeSubflow,
|
removeSubflow: removeSubflow,
|
||||||
subflow: getSubflow,
|
subflow: getSubflow,
|
||||||
subflowContains: subflowContains,
|
subflowContains: subflowContains,
|
||||||
|
|
||||||
eachNode: function(cb) {
|
eachNode: function(cb) {
|
||||||
for (var n=0;n<nodes.length;n++) {
|
for (var n=0;n<nodes.length;n++) {
|
||||||
cb(nodes[n]);
|
cb(nodes[n]);
|
||||||
@ -924,14 +926,14 @@ RED.nodes = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
node: getNode,
|
node: getNode,
|
||||||
|
|
||||||
filterNodes: filterNodes,
|
filterNodes: filterNodes,
|
||||||
filterLinks: filterLinks,
|
filterLinks: filterLinks,
|
||||||
|
|
||||||
import: importNodes,
|
import: importNodes,
|
||||||
|
|
||||||
getAllFlowNodes: getAllFlowNodes,
|
getAllFlowNodes: getAllFlowNodes,
|
||||||
createExportableNodeSet: createExportableNodeSet,
|
createExportableNodeSet: createExportableNodeSet,
|
||||||
createCompleteNodeSet: createCompleteNodeSet,
|
createCompleteNodeSet: createCompleteNodeSet,
|
||||||
|
@ -624,7 +624,7 @@ RED.editor = (function() {
|
|||||||
if (node_def.defaults[d].value) {
|
if (node_def.defaults[d].value) {
|
||||||
configNode[d] = node_def.defaults[d].value;
|
configNode[d] = node_def.defaults[d].value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
configNode["_"] = node_def._;
|
configNode["_"] = node_def._;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
**/
|
**/
|
||||||
RED.library = (function() {
|
RED.library = (function() {
|
||||||
|
|
||||||
|
|
||||||
function loadFlowLibrary() {
|
function loadFlowLibrary() {
|
||||||
$.getJSON("library/flows",function(data) {
|
$.getJSON("library/flows",function(data) {
|
||||||
//console.log(data);
|
//console.log(data);
|
||||||
@ -66,12 +66,12 @@ RED.library = (function() {
|
|||||||
$("#menu-item-import-library-submenu").replaceWith(menu);
|
$("#menu-item-import-library-submenu").replaceWith(menu);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function createUI(options) {
|
function createUI(options) {
|
||||||
var libraryData = {};
|
var libraryData = {};
|
||||||
var selectedLibraryItem = null;
|
var selectedLibraryItem = null;
|
||||||
var libraryEditor = null;
|
var libraryEditor = null;
|
||||||
|
|
||||||
// Orion editor has set/getText
|
// Orion editor has set/getText
|
||||||
// ACE editor has set/getValue
|
// ACE editor has set/getValue
|
||||||
// normalise to set/getValue
|
// normalise to set/getValue
|
||||||
@ -84,14 +84,14 @@ RED.library = (function() {
|
|||||||
if (options.editor.getText) {
|
if (options.editor.getText) {
|
||||||
options.editor.getValue = options.editor.getText;
|
options.editor.getValue = options.editor.getText;
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildFileListItem(item) {
|
function buildFileListItem(item) {
|
||||||
var li = document.createElement("li");
|
var li = document.createElement("li");
|
||||||
li.onmouseover = function(e) { $(this).addClass("list-hover"); };
|
li.onmouseover = function(e) { $(this).addClass("list-hover"); };
|
||||||
li.onmouseout = function(e) { $(this).removeClass("list-hover"); };
|
li.onmouseout = function(e) { $(this).removeClass("list-hover"); };
|
||||||
return li;
|
return li;
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildFileList(root,data) {
|
function buildFileList(root,data) {
|
||||||
var ul = document.createElement("ul");
|
var ul = document.createElement("ul");
|
||||||
var li;
|
var li;
|
||||||
@ -104,7 +104,7 @@ RED.library = (function() {
|
|||||||
var dirName = v;
|
var dirName = v;
|
||||||
return function(e) {
|
return function(e) {
|
||||||
var bcli = $('<li class="active"><span class="divider">/</span> <a href="#">'+dirName+'</a></li>');
|
var bcli = $('<li class="active"><span class="divider">/</span> <a href="#">'+dirName+'</a></li>');
|
||||||
$("a",bcli).click(function(e) {
|
$("a",bcli).click(function(e) {
|
||||||
$(this).parent().nextAll().remove();
|
$(this).parent().nextAll().remove();
|
||||||
$.getJSON("library/"+options.url+root+dirName,function(data) {
|
$.getJSON("library/"+options.url+root+dirName,function(data) {
|
||||||
$("#node-select-library").children().first().replaceWith(buildFileList(root+dirName+"/",data));
|
$("#node-select-library").children().first().replaceWith(buildFileList(root+dirName+"/",data));
|
||||||
@ -141,7 +141,7 @@ RED.library = (function() {
|
|||||||
}
|
}
|
||||||
return ul;
|
return ul;
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#node-input-name').addClass('input-append-left').css("width","65%").after(
|
$('#node-input-name').addClass('input-append-left').css("width","65%").after(
|
||||||
'<div class="btn-group" style="margin-left: 0px;">'+
|
'<div class="btn-group" style="margin-left: 0px;">'+
|
||||||
'<button id="node-input-'+options.type+'-lookup" class="btn input-append-right" data-toggle="dropdown"><i class="fa fa-book"></i> <i class="fa fa-caret-down"></i></button>'+
|
'<button id="node-input-'+options.type+'-lookup" class="btn input-append-right" data-toggle="dropdown"><i class="fa fa-book"></i> <i class="fa fa-caret-down"></i></button>'+
|
||||||
@ -150,15 +150,15 @@ RED.library = (function() {
|
|||||||
'<li><a id="node-input-'+options.type+'-menu-save-library" tabindex="-1" href="#">'+RED._("library.saveToLibrary")+'</a></li>'+
|
'<li><a id="node-input-'+options.type+'-menu-save-library" tabindex="-1" href="#">'+RED._("library.saveToLibrary")+'</a></li>'+
|
||||||
'</ul></div>'
|
'</ul></div>'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#node-input-'+options.type+'-menu-open-library').click(function(e) {
|
$('#node-input-'+options.type+'-menu-open-library').click(function(e) {
|
||||||
$("#node-select-library").children().remove();
|
$("#node-select-library").children().remove();
|
||||||
var bc = $("#node-dialog-library-breadcrumbs");
|
var bc = $("#node-dialog-library-breadcrumbs");
|
||||||
bc.children().first().nextAll().remove();
|
bc.children().first().nextAll().remove();
|
||||||
libraryEditor.setValue('',-1);
|
libraryEditor.setValue('',-1);
|
||||||
|
|
||||||
$.getJSON("library/"+options.url,function(data) {
|
$.getJSON("library/"+options.url,function(data) {
|
||||||
$("#node-select-library").append(buildFileList("/",data));
|
$("#node-select-library").append(buildFileList("/",data));
|
||||||
$("#node-dialog-library-breadcrumbs a").click(function(e) {
|
$("#node-dialog-library-breadcrumbs a").click(function(e) {
|
||||||
@ -168,10 +168,10 @@ RED.library = (function() {
|
|||||||
});
|
});
|
||||||
$( "#node-dialog-library-lookup" ).dialog( "open" );
|
$( "#node-dialog-library-lookup" ).dialog( "open" );
|
||||||
});
|
});
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#node-input-'+options.type+'-menu-save-library').click(function(e) {
|
$('#node-input-'+options.type+'-menu-save-library').click(function(e) {
|
||||||
//var found = false;
|
//var found = false;
|
||||||
var name = $("#node-input-name").val().replace(/(^\s*)|(\s*$)/g,"");
|
var name = $("#node-input-name").val().replace(/(^\s*)|(\s*$)/g,"");
|
||||||
@ -217,7 +217,7 @@ RED.library = (function() {
|
|||||||
$( "#node-dialog-library-save" ).dialog( "open" );
|
$( "#node-dialog-library-save" ).dialog( "open" );
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
|
|
||||||
libraryEditor = ace.edit('node-select-library-text');
|
libraryEditor = ace.edit('node-select-library-text');
|
||||||
libraryEditor.setTheme("ace/theme/tomorrow");
|
libraryEditor.setTheme("ace/theme/tomorrow");
|
||||||
if (options.mode) {
|
if (options.mode) {
|
||||||
@ -230,7 +230,7 @@ RED.library = (function() {
|
|||||||
});
|
});
|
||||||
libraryEditor.renderer.$cursorLayer.element.style.opacity=0;
|
libraryEditor.renderer.$cursorLayer.element.style.opacity=0;
|
||||||
libraryEditor.$blockScrolling = Infinity;
|
libraryEditor.$blockScrolling = Infinity;
|
||||||
|
|
||||||
$( "#node-dialog-library-lookup" ).dialog({
|
$( "#node-dialog-library-lookup" ).dialog({
|
||||||
title: RED._("library.typeLibrary", {type:options.type}),
|
title: RED._("library.typeLibrary", {type:options.type}),
|
||||||
modal: true,
|
modal: true,
|
||||||
@ -270,7 +270,7 @@ RED.library = (function() {
|
|||||||
$(".form-row:last-child",form).children().height(form.height()-60);
|
$(".form-row:last-child",form).children().height(form.height()-60);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function saveToLibrary(overwrite) {
|
function saveToLibrary(overwrite) {
|
||||||
var name = $("#node-input-name").val().replace(/(^\s*)|(\s*$)/g,"");
|
var name = $("#node-input-name").val().replace(/(^\s*)|(\s*$)/g,"");
|
||||||
if (name === "") {
|
if (name === "") {
|
||||||
@ -319,7 +319,7 @@ RED.library = (function() {
|
|||||||
data[field] = $("#node-input-"+field).val();
|
data[field] = $("#node-input-"+field).val();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
data.text = options.editor.getValue();
|
data.text = options.editor.getValue();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url:"library/"+options.url+'/'+fullpath,
|
url:"library/"+options.url+'/'+fullpath,
|
||||||
@ -378,15 +378,16 @@ RED.library = (function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function exportFlow() {
|
function exportFlow() {
|
||||||
//TODO: don't rely on the main dialog
|
//TODO: don't rely on the main dialog
|
||||||
var nns = RED.nodes.createExportableNodeSet(RED.view.selection().nodes);
|
var nns = RED.nodes.createExportableNodeSet(RED.view.selection().nodes);
|
||||||
$("#dialog-form").html($("script[data-template-name='export-library-dialog']").html());
|
$("#dialog-form").html($("script[data-template-name='export-library-dialog']").html());
|
||||||
$("#node-input-filename").attr('nodes',JSON.stringify(nns));
|
$("#node-input-filename").attr('nodes',JSON.stringify(nns));
|
||||||
$( "#dialog" ).dialog("option","title",RED._("library.exportToLibrary")).dialog( "open" );
|
$("#dialog").i18n();
|
||||||
|
$("#dialog").dialog("option","title",RED._("library.exportToLibrary")).dialog( "open" );
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
init: function() {
|
init: function() {
|
||||||
RED.view.on("selection-changed",function(selection) {
|
RED.view.on("selection-changed",function(selection) {
|
||||||
@ -400,16 +401,14 @@ RED.library = (function() {
|
|||||||
RED.menu.setDisabled("menu-item-export-library",false);
|
RED.menu.setDisabled("menu-item-export-library",false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (RED.settings.theme("menu.menu-item-import-library") !== false) {
|
if (RED.settings.theme("menu.menu-item-import-library") !== false) {
|
||||||
loadFlowLibrary();
|
loadFlowLibrary();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
create: createUI,
|
create: createUI,
|
||||||
loadFlowLibrary: loadFlowLibrary,
|
loadFlowLibrary: loadFlowLibrary,
|
||||||
|
|
||||||
export: exportFlow
|
export: exportFlow
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
||||||
|
@ -159,15 +159,15 @@
|
|||||||
|
|
||||||
<script type="text/x-red" data-template-name="export-library-dialog">
|
<script type="text/x-red" data-template-name="export-library-dialog">
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="node-input-filename" data-i18n="[append]workspaces.libraryFilenamePlaceholder"><i class="fa fa-file"></i> </label>
|
<label for="node-input-filename" data-i18n="[append]editor:workspaces.libraryFilenameLabel"><i class="fa fa-file"></i> </label>
|
||||||
<input type="text" id="node-input-filename" data-i18n="[placeholder]libraryFilenameLabel">
|
<input type="text" id="node-input-filename" data-i18n="[placeholder]editor:workspaces.libraryFilenamePlaceholder">
|
||||||
</div>
|
</div>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/x-red" data-template-name="subflow">
|
<script type="text/x-red" data-template-name="subflow">
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="node-input-name" data-i18n="[append]workspaces.libraryNameLabel"><i class="fa fa-tag"></i> </label>
|
<label for="node-input-name" data-i18n="[append]editor:workspaces.libraryNameLabel"><i class="fa fa-tag"></i> </label>
|
||||||
<input type="text" id="node-input-name" data-i18n="[placeholder]workspaces.libraryNamePlaceholder">
|
<input type="text" id="node-input-name" data-i18n="[placeholder]editor:workspaces.libraryNamePlaceholder">
|
||||||
</div>
|
</div>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user