PageSourceSearch

https://support.elektrobit.com/includes/jquery/plugins/setselectionrange/setSelectionRange.js

js elektrobit.com collected 2026-09-24 15:25:58 UTC 1,224 bytes, 34 lines download raw bytes

1/**
2 * Used on text type input fields will select a range of characters in the field
3 * If the values are equal will put the typeing caret before that number of characters
4 *
5 * @example
6 * jQuery('#textfield').setSelectionRange(3,5)
7 *
8 * @function external:"jQuery.fn".setSelectionRange
9 * @param selectionStart - the starting character to select
10 * @param selectionEnd - the final character to select
11 */
12jQuery.fn.setSelectionRange = function (selectionStart, selectionEnd) {
13  if (this.length == 0) return;
14  if (this[0].setSelectionRange) {
15    this[0].focus();
16    this[0].setSelectionRange(selectionStart, selectionEnd);
17  } else if (this[0].createTextRange) {
18    var range = this[0].createTextRange();
19    range.collapse(true);
20    range.moveEnd('character', selectionEnd);
21    range.moveStart('character', selectionStart);
22    range.select();
23  }
24},
25/**
26 * Used on text type input fields will place the typing caret x number of characters into the textfield
27 *
28 * usage jQuery('#textfield').setCaretToPosition(10)
29 *
30 * @param position - the number of characters into the text field to try to move the caret
31 */
32jQuery.fn.setCaretToPosition = function (position) {
33  this.setSelectionRange(position, position);
34};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.