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

Function insertFloatSliderAtSelection

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

Source from the content-addressed store, hash-verified

577};
578
579var insertFloatSliderAtSelection = function () {
580 var selection_start = cm.getCursor("from");
581 var selection_end = cm.getCursor("to");
582 var r = cm.getDoc().getRange(selection_start, selection_end);
583 if (r == "") {
584 return insertFloatSliderHere();
585 }
586 else if (!isNaN(parseFloat(r))) {
587
588 var start = cm.setBookmark(selection_start);
589 var end = cm.setBookmark(selection_end);
590
591 if (r[0] != " ") r = " " + r;
592 if (r[r.length - 1] != " ") r = r + " ";
593 cm.getDoc().replaceRange(r, selection_start, selection_end);
594
595 insertFloatSlider(start.find(), end.find());
596 }
597 else {
598
599 }
600};
601
602globalCommands.push({
603 "name": "Insert float slider",

Callers 1

drags.jsFile · 0.85

Calls 6

insertFloatSliderHereFunction · 0.85
isNaNFunction · 0.85
insertFloatSliderFunction · 0.85
replaceRangeMethod · 0.80
getRangeMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected