PageSourceSearch

https://skulpt.org/docs/scripts/linenumber.js

js skulpt.org collected 2026-10-02 07:22:46 UTC 674 bytes, 25 lines download raw bytes

vendor: 674 bytes, lines 1-25
1/*global document */
2(function() {
3    var source = document.getElementsByClassName('prettyprint source linenums');
4    var i = 0;
5    var lineNumber = 0;
6    var lineId;
7    var lines;
8    var totalLines;
9    var anchorHash;
10
11    if (source && source[0]) {
12        anchorHash = document.location.hash.substring(1);
13        lines = source[0].getElementsByTagName('li');
14        totalLines = lines.length;
15
16        for (; i < totalLines; i++) {
17            lineNumber++;
18            lineId = 'line' + lineNumber;
19            lines[i].id = lineId;
20            if (lineId === anchorHash) {
21                lines[i].className += ' selected';
22            }
23        }
24    }
25})();

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.