File tree Expand file tree Collapse file tree 6 files changed +92
-9
lines changed
Expand file tree Collapse file tree 6 files changed +92
-9
lines changed Original file line number Diff line number Diff line change 11function showImg ( ) {
22 $ ( '#form' ) . hide ( ) ;
3- $ ( '#loading_img ' ) . css ( { 'display' : 'block' } ) ;
3+ $ ( '#loading-img ' ) . css ( { 'display' : 'block' } ) ;
44}
55
66function hideImg ( ) {
77 $ ( '#form' ) . show ( ) ;
8- $ ( '#loading_img' ) . css ( { 'display' : 'none' } ) ;
8+ $ ( '#loading-img' ) . css ( { 'display' : 'none' } ) ;
9+ }
10+
11+ function loadLoadingAnimation ( elementId ) {
12+ fetch ( "/static/fact_loading.svg" )
13+ . then ( response => response . text ( ) )
14+ . then ( data => {
15+ document . getElementById ( elementId ) . innerHTML = data ;
16+ } )
17+ . catch ( error => {
18+ console . error ( 'Error loading loading animation:' , error ) ;
19+ } ) ;
920}
Original file line number Diff line number Diff line change @@ -67,13 +67,11 @@ <h3 class="mb-3">Search Firmware Database</h3>
6767 </ div >
6868
6969
70- < button type ="submit " value =submit class ="btn btn-primary " id ="input_submit " onclick =" showImg() " >
70+ < button type ="submit " value =submit class ="btn btn-primary " id ="input_submit ">
7171 < i class ="fas fa-search "> </ i > Search
7272 </ button >
7373
7474 </ form >
75-
76- < img id ="loading_img " src ="{{ url_for('.static', filename='Pacman.gif') }} " style ="display: none; margin: auto; "/>
7775 </ div >
7876</ div >
7977
Original file line number Diff line number Diff line change 2929 }
3030 } ) ;
3131 </ script >
32+ < script type ="text/javascript " src ="{{ url_for('static', filename='js/loading.js') }} "> </ script >
3233
3334 < style >
3435 {# styling for file preview line lumbers # }
@@ -119,9 +120,11 @@ <h3>
119120
120121 < div id ="summary-div ">
121122 < div class ="mb-3 border " id ="loading-summary-gif " style ="display: none; padding: 5px; text-align: center ">
122- < img src ="{{ url_for( "static ", filename = "Pacman.gif ") }} " alt="loading gif ">
123123 < p > Loading summary for included files...</ p >
124124 </ div >
125+ < script >
126+ loadLoadingAnimation ( 'loading-summary-gif' ) ;
127+ </ script >
125128 </ div >
126129 < script type ="text/javascript " src ="{{ url_for('static', filename='js/show_analysis_summary.js') }} "> </ script >
127130
Original file line number Diff line number Diff line change 3939 </div >
4040 </div >
4141 <div id =" preview-loading-gif" class =" border" style =" display : block ; padding : 5px ; text-align : center " >
42- <img src =" {{ url_for('static', filename = 'Pacman.gif') }}" alt =" loading..." >
4342 </div >
43+ <script >
44+ loadLoadingAnimation (' preview-loading-gif' );
45+ </script >
4446 <div id =" preview-content" class =" m-0 mt-2 p-0" ></div >
4547 </div >
4648
Original file line number Diff line number Diff line change @@ -178,8 +178,12 @@ <h3 class="mb-3">Upload Firmware</h3>
178178 </ form >
179179 </ div >
180180
181- < img id ="loading_img " src ="{{ url_for('.static', filename='Pacman.gif') }} "
182- alt ="loading... " style ="display: none; margin: auto; "/>
181+ < div class ="mb-3 " id ="loading-img " style ="display: none; padding: 5px; text-align: center ">
182+ < p > Upload in progress...</ p >
183+ </ div >
184+ < script >
185+ loadLoadingAnimation ( 'loading-img' ) ;
186+ </ script >
183187 </ div >
184188 </ div >
185189
You can’t perform that action at this time.
0 commit comments