mirror of
https://github.com/emn178/js-md5.git
synced 2026-08-13 04:44:03 +08:00
### Added - TypeScript interfaces. - HMAC feature. ### Fixed - deprecated `new Buffer`, replace with `Buffer.from`. - dependencies and security issues. - don't modify global Array and ArrayBuffer prototypes. - refactor: simplify formatMessage internal logic. ### Changed - remove `eval` and use `require` directly. - throw error by Error oject. - throw error if update after finalize - use unsigned right shift.
26 lines
671 B
JavaScript
26 lines
671 B
JavaScript
/*global document */
|
|
(() => {
|
|
const source = document.getElementsByClassName('prettyprint source linenums');
|
|
let i = 0;
|
|
let lineNumber = 0;
|
|
let lineId;
|
|
let lines;
|
|
let totalLines;
|
|
let 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';
|
|
}
|
|
}
|
|
}
|
|
})();
|