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

Function insert14GraphSliderAtSelection

lib/web/drags.js:1142–1162  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1140};
1141
1142var insert14GraphSliderAtSelection = function () {
1143 var selection_start = cm.getCursor("from");
1144 var selection_end = cm.getCursor("to");
1145
1146
1147 var r = cm.getDoc().getRange(selection_start, selection_end);
1148 if (r == "") {
1149 return insert14GraphSliderHere();
1150 }
1151 else //if (!isNaN(parseFloat(r)))
1152 {
1153 var start = cm.setBookmark(selection_start);
1154 var end = cm.setBookmark(selection_end);
1155 r = r.trim();
1156 if (r[0] != " ") r = " " + r;
1157 if (r[r.length - 1] != " ") r = r + " ";
1158 cm.getDoc().replaceRange(r, selection_start, selection_end);
1159
1160 insert14GraphSlider(start.find(), end.find());
1161 }
1162};
1163
1164globalCommands.push({
1165 "name": "Insert 1d, 4-point graph",

Callers 1

drags.jsFile · 0.85

Calls 5

insert14GraphSliderHereFunction · 0.85
insert14GraphSliderFunction · 0.85
replaceRangeMethod · 0.80
getRangeMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected