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

Function executeBracket

lib/web/brackets.js:26–61  ·  view source on GitHub ↗
(bra, disablePrint)

Source from the content-addressed store, hash-verified

24// return cm.getLineHandle(n);
25}
26function executeBracket(bra, disablePrint) {
27 bra.attr({
28 fill: "#afc"
29 }).animate({
30 fill: "#405560"
31 }, 500);
32
33 anchorLine = Math.max(cmGetLineNumber(bra.h1), cmGetLineNumber(bra.h2));
34
35 c = cm.getCursor();
36
37 fragment = cm.getDoc().getRange({
38 line: cmGetLineNumber(bra.h1),
39 ch: 0
40 }, {
41 line: cmGetLineNumber(bra.h2) + 1,
42 ch: 0
43 });
44
45 addr = "execution.fragment";
46 if (disablePrint)
47 addr = "execution.fragment.noprint";
48
49 _field.sendWithReturn(addr, {
50 box: cm.currentbox,
51 property: cm.currentproperty,
52 text: fragment,
53 lineoffset: cmGetLineNumber(bra.h1),
54 disabledRanges: "[" + allDisabledBracketRanges() + "]"
55 }, function (d, e) {
56 if (d.type == 'error')
57 appendRemoteOutputToLine(anchorLine, d.line + " : " + d.message, "Field-remoteOutput", "Field-remoteOutput-error", 1);
58 else
59 appendRemoteOutputToLine(anchorLine, d.message, "Field-remoteOutput-error", "Field-remoteOutput", 1)
60 });
61}
62function executeBracketLimited(bra, lineLimit) {
63 bra.attr({
64 fill: "#afc"

Callers 7

executeCurrentBracketFunction · 0.85
setFunction · 0.85
insertFloatSliderFunction · 0.85
insertXYSliderFunction · 0.85
insert4GraphSliderFunction · 0.85
insert14GraphSliderFunction · 0.85
insertBoolFunction · 0.85

Calls 7

cmGetLineNumberFunction · 0.85
allDisabledBracketRangesFunction · 0.85
appendRemoteOutputToLineFunction · 0.85
animateMethod · 0.80
attrMethod · 0.45
maxMethod · 0.45
getRangeMethod · 0.45

Tested by

no test coverage detected