File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
buildSrc/src/main/resources Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 116
116
}
117
117
showImage ( document . getElementsByClassName ( "item" ) [ 0 ] , "build-order.png" ) ;
118
118
119
+ // Basic filtering with no ui... just type things
120
+ let search = '' ;
121
+ function filter ( text ) {
122
+ Array . from ( document . getElementsByClassName ( "item" ) ) . forEach ( li => {
123
+ const cell = li . getElementsByTagName ( "td" ) ;
124
+ if ( cell . length === 0 ) {
125
+ // Not a module...
126
+ } else if ( cell [ 0 ] . innerText . includes ( text ) || text === null ) {
127
+ // make li visible
128
+ li . style . display = "block" ;
129
+ } else {
130
+ li . style . display = "none" ;
131
+ }
132
+ } ) ;
133
+ }
134
+ document . addEventListener ( "keydown" , event => {
135
+ if ( event . keyCode >= 65 && event . keyCode <= 90 ) {
136
+ search = ( search == null ? '' : search ) + event . key ;
137
+ } else {
138
+ search = null ;
139
+ }
140
+ filter ( search ) ;
141
+ } ) ;
119
142
</ script >
120
143
</ body >
121
144
</ html >
You can’t perform that action at this time.
0 commit comments