File: doc-templates/default/static/scripts/linenumber.js

Recommend this page to a friend!
  Classes of Sebastian Schlapkohl   jQuery Annex   doc-templates/default/static/scripts/linenumber.js   Download  
File: doc-templates/default/static/scripts/linenumber.js
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: jQuery Annex
General purpose functions missing in jQuery
Author: By
Last change: added cssTransition() for programmatic application and callbacks for
css transitions // build test case for cssTransition() // reworked /doc
to have more readable function nav and included documentation into
example page // branched jsdoc templates into own version and added it
to the repo // added configurable id regexes to isolateId() and
isPossibleId() to allow for searching for ids which are not integers
Date: 3 years ago
Size: 674 bytes
 

Contents

Class file image Download
/*global document */ (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'; } } } })();