1
0
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:
Nicholas O'Leary 2013-10-30 21:45:45 +00:00
parent bc878b40d6
commit 8befd44195
3 changed files with 16 additions and 8 deletions

View File

@ -227,7 +227,8 @@ RED.nodes = function() {
}
for (var i in newNodes) {
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)
RED.notify("<strong>Failed to import nodes</strong>: unrecognised type '"+n.type+"'","error");
return null;
@ -235,7 +236,11 @@ RED.nodes = function() {
}
for (var i in newNodes) {
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) {
defaultWorkspace = n;
}
@ -244,7 +249,7 @@ RED.nodes = function() {
}
}
if (defaultWorkspace == null) {
defaultWorkspace = { type:"workspace", id:getID(), label:"Sheet 1" };
defaultWorkspace = { type:"tab", id:getID(), label:"Sheet 1" };
addWorkspace(defaultWorkspace);
RED.view.addWorkspace(defaultWorkspace);
}
@ -255,7 +260,8 @@ RED.nodes = function() {
for (var i in newNodes) {
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);
if (def && def.category == "config") {
if (!RED.nodes.node(n.id)) {

View File

@ -109,7 +109,7 @@ RED.view = function() {
workspaceIndex += 1;
} 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);
workspace_tabs.addTab(ws);
workspace_tabs.activateTab(tabId);
@ -1081,7 +1081,7 @@ RED.view = function() {
modal: true,
autoOpen: false,
width: 500,
title: "Rename workspace",
title: "Rename sheet",
buttons: [
{
class: 'leftButton',

View File

@ -292,7 +292,8 @@ var parseConfig = function() {
missingTypes = [];
for (var i in activeConfig) {
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);
if (!nt && missingTypes.indexOf(type) == -1) {
missingTypes.push(type);
@ -311,7 +312,8 @@ var parseConfig = function() {
events.emit("nodes-starting");
for (var i in activeConfig) {
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);
if (nt) {
try {