11// From rust:
2- /* global sourcesIndex */
2+ /* global srcIndex */
33
44// Local js definitions:
55/* global addClass, getCurrentValue, onEachLazy, removeClass, browserSupportsHistoryApi */
@@ -101,9 +101,9 @@ function createSidebarToggle() {
101101 return sidebarToggle ;
102102}
103103
104- // This function is called from "source -files.js", generated in `html/render/write_shared.rs`.
104+ // This function is called from "src -files.js", generated in `html/render/write_shared.rs`.
105105// eslint-disable-next-line no-unused-vars
106- function createSourceSidebar ( ) {
106+ function createSrcSidebar ( ) {
107107 const container = document . querySelector ( "nav.sidebar" ) ;
108108
109109 const sidebarToggle = createSidebarToggle ( ) ;
@@ -118,9 +118,9 @@ function createSourceSidebar() {
118118 title . className = "title" ;
119119 title . innerText = "Files" ;
120120 sidebar . appendChild ( title ) ;
121- Object . keys ( sourcesIndex ) . forEach ( key => {
122- sourcesIndex [ key ] [ NAME_OFFSET ] = key ;
123- hasFoundFile = createDirEntry ( sourcesIndex [ key ] , sidebar , "" , hasFoundFile ) ;
121+ Object . keys ( srcIndex ) . forEach ( key => {
122+ srcIndex [ key ] [ NAME_OFFSET ] = key ;
123+ hasFoundFile = createDirEntry ( srcIndex [ key ] , sidebar , "" , hasFoundFile ) ;
124124 } ) ;
125125
126126 container . appendChild ( sidebar ) ;
@@ -133,7 +133,7 @@ function createSourceSidebar() {
133133
134134const lineNumbersRegex = / ^ # ? ( \d + ) (?: - ( \d + ) ) ? $ / ;
135135
136- function highlightSourceLines ( match ) {
136+ function highlightSrcLines ( match ) {
137137 if ( typeof match === "undefined" ) {
138138 match = window . location . hash . match ( lineNumbersRegex ) ;
139139 }
@@ -172,15 +172,15 @@ function highlightSourceLines(match) {
172172 }
173173}
174174
175- const handleSourceHighlight = ( function ( ) {
175+ const handleSrcHighlight = ( function ( ) {
176176 let prev_line_id = 0 ;
177177
178178 const set_fragment = name => {
179179 const x = window . scrollX ,
180180 y = window . scrollY ;
181181 if ( browserSupportsHistoryApi ( ) ) {
182182 history . replaceState ( null , null , "#" + name ) ;
183- highlightSourceLines ( ) ;
183+ highlightSrcLines ( ) ;
184184 } else {
185185 location . replace ( "#" + name ) ;
186186 }
@@ -221,15 +221,15 @@ const handleSourceHighlight = (function() {
221221window . addEventListener ( "hashchange" , ( ) => {
222222 const match = window . location . hash . match ( lineNumbersRegex ) ;
223223 if ( match ) {
224- return highlightSourceLines ( match ) ;
224+ return highlightSrcLines ( match ) ;
225225 }
226226} ) ;
227227
228228onEachLazy ( document . getElementsByClassName ( "src-line-numbers" ) , el => {
229- el . addEventListener ( "click" , handleSourceHighlight ) ;
229+ el . addEventListener ( "click" , handleSrcHighlight ) ;
230230} ) ;
231231
232- highlightSourceLines ( ) ;
232+ highlightSrcLines ( ) ;
233233
234- window . createSourceSidebar = createSourceSidebar ;
234+ window . createSrcSidebar = createSrcSidebar ;
235235} ) ( ) ;
0 commit comments