Files
shaka-player/docs/jsdoc-template/static/scripts/linenumber.js
T
Joey Parrish ad7602f3b7 Add copyright headers to jsdoc template code
This is required by Google policy, to document where these forks came
from and what their licensing terms are.  I overlooked this detail
when I started customizing the JSDoc template.

Change-Id: Ifd18bb3143ca841e2bd934fe571f3a896ba53975
2018-03-29 11:04:35 -07:00

45 lines
1.2 KiB
JavaScript

/**
* @license
* JSDoc 3 is free software, licensed under the Apache License, Version 2.0 (the
* "License"). Commercial and non-commercial use are permitted in compliance
* with the License.
*
* Copyright (c) 2011-present Michael Mathews <micmath@gmail.com> and the
* [contributors to JSDoc](https://github.com/jsdoc3/jsdoc/graphs/contributors).
* All rights reserved.
*
* You may obtain a copy of the License at:
* http://www.apache.org/licenses/LICENSE-2.0
*/
/**
* @fileoverview Adds line numbers to source code in the docs.
*
* Part of the default template in JSDoc.
*/
(function() {
var source = document.getElementsByClassName('prettyprint source linenums');
var i = 0;
var lineNumber = 0;
var lineId;
var lines;
var totalLines;
var anchorHash;
if (source && source[0]) {
anchorHash = document.location.hash.substring(1);
lines = source[0].getElementsByTagName('li');
totalLines = lines.length;
for (; i < totalLines; i++) {
lineNumber++;
lineId = 'line' + lineNumber;
lines[i].id = lineId;
if (lineId === anchorHash) {
lines[i].className += ' selected';
}
}
}
})();