/** * Copyright 2013, 2015 IBM Corp. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. **/ RED.sidebar.info = (function() { marked.setOptions({ renderer: new marked.Renderer(), gfm: true, tables: true, breaks: false, pedantic: false, sanitize: true, smartLists: true, smartypants: false }); var content = document.createElement("div"); content.id = "tab-info"; content.style.paddingTop = "4px"; content.style.paddingLeft = "4px"; content.style.paddingRight = "4px"; function show() { if (!RED.sidebar.containsTab("info")) { RED.sidebar.addTab("info",content,false); } RED.sidebar.show("info"); } function jsonFilter(key,value) { if (key === "") { return value; } var t = typeof value; if ($.isArray(value)) { return "[array:"+value.length+"]"; } else if (t === "object") { return "[object]" } else if (t === "string") { if (value.length > 30) { return value.substring(0,30)+" ..."; } } return value; } function refresh(node) { var table = '
Node | |
Type | "+node.type+" |
ID | "+node.id+" |
Subflow | |
name | "+subflowNode.name+" |
instances | "+userCount+" |
Properties | |
"+n+" | "+val+" |