2014-10-23 10:53:16 -04:00
|
|
|
/*global document */
|
2014-10-20 16:56:45 -04:00
|
|
|
(function() {
|
2014-10-23 10:53:16 -04:00
|
|
|
var source = document.getElementsByClassName('prettyprint source linenums');
|
|
|
|
var i = 0;
|
|
|
|
var lineNumber = 0;
|
|
|
|
var lineId;
|
|
|
|
var lines;
|
|
|
|
var totalLines;
|
|
|
|
var anchorHash;
|
2014-10-20 16:56:45 -04:00
|
|
|
|
|
|
|
if (source && source[0]) {
|
2014-10-23 10:53:16 -04:00
|
|
|
anchorHash = document.location.hash.substring(1);
|
|
|
|
lines = source[0].getElementsByTagName('li');
|
|
|
|
totalLines = lines.length;
|
2014-10-20 16:56:45 -04:00
|
|
|
|
2014-10-23 10:53:16 -04:00
|
|
|
for (; i < totalLines; i++) {
|
|
|
|
lineNumber++;
|
|
|
|
lineId = 'line' + lineNumber;
|
|
|
|
lines[i].id = lineId;
|
|
|
|
if (lineId === anchorHash) {
|
|
|
|
lines[i].className += ' selected';
|
|
|
|
}
|
|
|
|
}
|
2014-10-20 16:56:45 -04:00
|
|
|
}
|
|
|
|
})();
|