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

Function insert4GraphSliderAtSelection

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

Source from the content-addressed store, hash-verified

905};
906
907var insert4GraphSliderAtSelection = function () {
908 var selection_start = cm.getCursor("from");
909 var selection_end = cm.getCursor("to");
910 var r = cm.getDoc().getRange(selection_start, selection_end);
911 if (r == "") {
912 return insert4GraphSliderHere();
913 }
914 else //if (!isNaN(parseFloat(r)))
915 {
916 var start = cm.setBookmark(selection_start);
917 var end = cm.setBookmark(selection_end);
918 r = r.trim();
919 if (r[0] != " ") r = " " + r;
920 if (r[r.length - 1] != " ") r = r + " ";
921 cm.getDoc().replaceRange(r, selection_start, selection_end);
922
923 insert4GraphSlider(start.find(), end.find());
924 }
925};
926
927globalCommands.push({
928 "name": "Insert 2d, 4-point graph",

Callers 1

drags.jsFile · 0.85

Calls 5

insert4GraphSliderHereFunction · 0.85
insert4GraphSliderFunction · 0.85
replaceRangeMethod · 0.80
getRangeMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected