MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / disclosure

Function disclosure

lib/web/renderjson.js:93–113  ·  view source on GitHub ↗
(open, placeholder, close, type, builder)

Source from the content-addressed store, hash-verified

91 var my_indent = dont_indent ? "" : indent;
92
93 var disclosure = function(open, placeholder, close, type, builder) {
94 var content;
95 var empty = span(type);
96 var show = function() { if (!content) append(empty.parentNode,
97 content = prepend(builder(),
98 A(renderjson.hide, "disclosure",
99 function() { content.style.display="none";
100 empty.style.display="inline"; } )));
101 content.style.display="inline";
102 empty.style.display="none"; };
103 append(empty,
104 A(renderjson.show, "disclosure", show),
105 themetext(type+ " syntax", open),
106 A(placeholder, null, show),
107 themetext(type+ " syntax", close));
108
109 var el = append(span(), text(my_indent.slice(0,-1)), empty);
110 if (show_level > 0)
111 show();
112 return el;
113 };
114
115 if (json === null) return themetext(null, my_indent, "keyword", "null");
116 if (json === void 0) return themetext(null, my_indent, "keyword", "undefined");

Callers 1

_renderjsonFunction · 0.85

Calls 6

spanFunction · 0.85
themetextFunction · 0.85
showFunction · 0.85
appendFunction · 0.70
AFunction · 0.70
textFunction · 0.70

Tested by

no test coverage detected