MCPcopy
hub / github.com/django-wiki/django-wiki / get

Function get

src/wiki/static/wiki/markitup/jquery.markitup.js:471–494  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

469
470 // get the selection
471 function get() {
472 textarea.focus();
473
474 scrollPosition = textarea.scrollTop;
475 if (document.selection) {
476 selection = document.selection.createRange().text;
477 if (browser.msie) { // ie
478 var range = document.selection.createRange(), rangeCopy = range.duplicate();
479 rangeCopy.moveToElementText(textarea);
480 caretPosition = -1;
481 while(rangeCopy.inRange(range)) {
482 rangeCopy.moveStart('character');
483 caretPosition ++;
484 }
485 } else { // opera
486 caretPosition = textarea.selectionStart;
487 }
488 } else { // gecko & webkit
489 caretPosition = textarea.selectionStart;
490
491 selection = textarea.value.substring(caretPosition, textarea.selectionEnd);
492 }
493 return selection;
494 }
495
496 // open preview window
497 function preview() {

Callers 3

initFunction · 0.85
markupFunction · 0.85
keyPressedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected