mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Rename workspaces to tabs/sheets
This commit is contained in:
parent
bc878b40d6
commit
8befd44195
@ -227,7 +227,8 @@ RED.nodes = function() {
|
|||||||
}
|
}
|
||||||
for (var i in newNodes) {
|
for (var i in newNodes) {
|
||||||
var n = newNodes[i];
|
var n = newNodes[i];
|
||||||
if (n.type != "workspace" && !getType(n.type)) {
|
// TODO: remove workspace in next release+1
|
||||||
|
if (n.type != "workspace" && n.type != "tab" && !getType(n.type)) {
|
||||||
// TODO: get this UI thing out of here! (see below as well)
|
// TODO: get this UI thing out of here! (see below as well)
|
||||||
RED.notify("<strong>Failed to import nodes</strong>: unrecognised type '"+n.type+"'","error");
|
RED.notify("<strong>Failed to import nodes</strong>: unrecognised type '"+n.type+"'","error");
|
||||||
return null;
|
return null;
|
||||||
@ -235,7 +236,11 @@ RED.nodes = function() {
|
|||||||
}
|
}
|
||||||
for (var i in newNodes) {
|
for (var i in newNodes) {
|
||||||
var n = newNodes[i];
|
var n = newNodes[i];
|
||||||
if (n.type === "workspace") {
|
// TODO: remove workspace in next release+1
|
||||||
|
if (n.type === "workspace" || n.type === "tab") {
|
||||||
|
if (n.type === "workspace") {
|
||||||
|
n.type = "tab";
|
||||||
|
}
|
||||||
if (defaultWorkspace == null) {
|
if (defaultWorkspace == null) {
|
||||||
defaultWorkspace = n;
|
defaultWorkspace = n;
|
||||||
}
|
}
|
||||||
@ -244,7 +249,7 @@ RED.nodes = function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (defaultWorkspace == null) {
|
if (defaultWorkspace == null) {
|
||||||
defaultWorkspace = { type:"workspace", id:getID(), label:"Sheet 1" };
|
defaultWorkspace = { type:"tab", id:getID(), label:"Sheet 1" };
|
||||||
addWorkspace(defaultWorkspace);
|
addWorkspace(defaultWorkspace);
|
||||||
RED.view.addWorkspace(defaultWorkspace);
|
RED.view.addWorkspace(defaultWorkspace);
|
||||||
}
|
}
|
||||||
@ -255,7 +260,8 @@ RED.nodes = function() {
|
|||||||
|
|
||||||
for (var i in newNodes) {
|
for (var i in newNodes) {
|
||||||
var n = newNodes[i];
|
var n = newNodes[i];
|
||||||
if (n.type !== "workspace") {
|
// TODO: remove workspace in next release+1
|
||||||
|
if (n.type !== "workspace" && n.type !== "tab") {
|
||||||
var def = getType(n.type);
|
var def = getType(n.type);
|
||||||
if (def && def.category == "config") {
|
if (def && def.category == "config") {
|
||||||
if (!RED.nodes.node(n.id)) {
|
if (!RED.nodes.node(n.id)) {
|
||||||
|
@ -109,7 +109,7 @@ RED.view = function() {
|
|||||||
workspaceIndex += 1;
|
workspaceIndex += 1;
|
||||||
} while($("#workspace-tabs a[title='Sheet "+workspaceIndex+"']").size() != 0);
|
} while($("#workspace-tabs a[title='Sheet "+workspaceIndex+"']").size() != 0);
|
||||||
|
|
||||||
var ws = {type:"workspace",id:tabId,label:"Sheet "+workspaceIndex};
|
var ws = {type:"tab",id:tabId,label:"Sheet "+workspaceIndex};
|
||||||
RED.nodes.addWorkspace(ws);
|
RED.nodes.addWorkspace(ws);
|
||||||
workspace_tabs.addTab(ws);
|
workspace_tabs.addTab(ws);
|
||||||
workspace_tabs.activateTab(tabId);
|
workspace_tabs.activateTab(tabId);
|
||||||
@ -1081,7 +1081,7 @@ RED.view = function() {
|
|||||||
modal: true,
|
modal: true,
|
||||||
autoOpen: false,
|
autoOpen: false,
|
||||||
width: 500,
|
width: 500,
|
||||||
title: "Rename workspace",
|
title: "Rename sheet",
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
class: 'leftButton',
|
class: 'leftButton',
|
||||||
|
@ -292,7 +292,8 @@ var parseConfig = function() {
|
|||||||
missingTypes = [];
|
missingTypes = [];
|
||||||
for (var i in activeConfig) {
|
for (var i in activeConfig) {
|
||||||
var type = activeConfig[i].type;
|
var type = activeConfig[i].type;
|
||||||
if (type != "workspace") {
|
// TODO: remove workspace in next release+1
|
||||||
|
if (type != "workspace" && type != "tab") {
|
||||||
var nt = node_type_registry.get(type);
|
var nt = node_type_registry.get(type);
|
||||||
if (!nt && missingTypes.indexOf(type) == -1) {
|
if (!nt && missingTypes.indexOf(type) == -1) {
|
||||||
missingTypes.push(type);
|
missingTypes.push(type);
|
||||||
@ -311,7 +312,8 @@ var parseConfig = function() {
|
|||||||
events.emit("nodes-starting");
|
events.emit("nodes-starting");
|
||||||
for (var i in activeConfig) {
|
for (var i in activeConfig) {
|
||||||
var nn = null;
|
var nn = null;
|
||||||
if (activeConfig[i].type != "workspace") {
|
// TODO: remove workspace in next release+1
|
||||||
|
if (activeConfig[i].type != "workspace" && activeConfig[i].type != "tab") {
|
||||||
var nt = node_type_registry.get(activeConfig[i].type);
|
var nt = node_type_registry.get(activeConfig[i].type);
|
||||||
if (nt) {
|
if (nt) {
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user