From 8befd441951b4c59956a83d789dafbd21294145c Mon Sep 17 00:00:00 2001 From: Nicholas O'Leary Date: Wed, 30 Oct 2013 21:45:45 +0000 Subject: [PATCH] Rename workspaces to tabs/sheets --- public/red/nodes.js | 14 ++++++++++---- public/red/ui/view.js | 4 ++-- red/nodes.js | 6 ++++-- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/public/red/nodes.js b/public/red/nodes.js index 13afcf4b2..ea451031d 100644 --- a/public/red/nodes.js +++ b/public/red/nodes.js @@ -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("Failed to import nodes: 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)) { diff --git a/public/red/ui/view.js b/public/red/ui/view.js index 31e194acf..46bcdc5ab 100644 --- a/public/red/ui/view.js +++ b/public/red/ui/view.js @@ -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', diff --git a/red/nodes.js b/red/nodes.js index ac55f0179..ef9367ebe 100644 --- a/red/nodes.js +++ b/red/nodes.js @@ -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 {