From cf8fe16b0975b1619421b8d4fa6ff9511d75da53 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Sun, 15 Mar 2015 23:31:38 +0000 Subject: [PATCH] Remove direct access to RED.nodes.nodes/links - Adds RED.nodes.filterNodes and RED.nodes.filterLinks for doing simply queries to find elements that match a criteria --- public/red/nodes.js | 48 ++++++++++++++++++++++++++++++++++--- public/red/ui/view.js | 14 +++++------ public/red/ui/workspaces.js | 5 +--- 3 files changed, 53 insertions(+), 14 deletions(-) diff --git a/public/red/nodes.js b/public/red/nodes.js index 4759cd30a..158529687 100644 --- a/public/red/nodes.js +++ b/public/red/nodes.js @@ -779,6 +779,45 @@ RED.nodes = (function() { return [new_nodes,new_links,new_workspaces,new_subflows]; } + // TODO: only supports filter.z + function filterNodes(filter) { + var result = []; + + for (var n=0;n