@@ -20,7 +20,15 @@ function colormode(){
2020 document . getElementById ( 'sec-notif' ) . style . color = 'white'
2121 document . querySelector ( '.security-notification input' ) . style . color = 'white'
2222 document . querySelector ( '.security-notification input' ) . style . backgroundColor = 'black'
23- document . querySelector ( '.security-notification input' ) . style . borderColor = 'white'
23+ document . querySelector ( '.security-notification input' ) . style . borderColor = 'white' ;
24+ document . getElementById ( 'sub-select1' ) . style . backgroundColor = 'black'
25+ document . getElementById ( 'sub-select1' ) . style . borderColor = 'white'
26+ document . getElementById ( 'sel-txt' ) . style . color = 'white' ;
27+ //console.log(document.querySelector('.multiselect-wrapper').style)
28+ //document.querySelector('.multiselect-wrapper').style.borderColor = 'white'
29+ //document.querySelector('.multiselect-wrapper').style.backgroundColor = 'black'
30+ //console.log(document.querySelector('.multiselect-wrapper').style)
31+ document . getElementById ( 'top-bar' ) . classList . add ( 'invert' )
2432 } else {
2533 document . getElementById ( 'filter' ) . style . opacity = '5%'
2634 document . getElementById ( 'menu1' ) . style . backgroundColor = 'white'
@@ -36,7 +44,8 @@ function colormode(){
3644 document . getElementsByClassName ( 'choice-rec' ) [ i ] . style . backgroundColor = 'white'
3745 }
3846 document . getElementsByClassName ( 'gg-dark-mode' ) [ 0 ] . style . backgroundColor = null
39- document . getElementById ( 'sec-notif' ) . style . color = 'black'
47+ document . getElementById ( 'sec-notif' ) . style . color = 'black' ;
48+ document . getElementById ( 'top-bar' ) . classList . remove ( 'invert' )
4049 }
4150}
4251
@@ -65,7 +74,18 @@ function handler(value){
6574 case 404 : {
6675 console . log ( 'path was not valid' )
6776 document . getElementsByClassName ( 'btn-select' ) [ 0 ] . children [ 0 ] . innerHTML = 'No Folder selected'
68- document . getElementById ( 'path-ph' ) . innerHTML = null
77+ document . getElementById ( 'path-ph' ) . innerHTML = null ;
78+
79+ document . getElementById ( 'notification' ) . style . display = 'block' ;
80+ document . getElementById ( 'err-path' ) . style . display = 'block' ;
81+ document . getElementById ( 'notification' ) . style . opacity = '100%' ;
82+ setTimeout ( ( ) => {
83+ document . getElementById ( 'notification' ) . style . opacity = '0%' ;
84+ setTimeout ( ( ) => {
85+ document . getElementById ( 'err-path' ) . style . display = 'none' ;
86+ document . getElementById ( 'notification' ) . style . display = 'none' ;
87+ } , 1000 )
88+ } , 3000 )
6989 } break ;
7090 case 205 : {
7191 console . log ( 'path was valid' )
@@ -87,11 +107,7 @@ function handler(value){
87107 } break ;
88108 }
89109 } )
90- . then ( message => {
91- console . log ( message ) ;
92- // Handle the response as needed
93- } )
94- . catch ( error => console . error ( 'Error:' , error ) ) ;
110+ . catch ( error => { console . error ( 'Error:' , error ) ; error ( ) } ) ;
95111 }
96112}
97113
@@ -120,15 +136,13 @@ function Multidirres(){
120136 } break ;
121137
122138 case 201 : {
123- console . log ( 'TASK COMPLETED' )
139+ success ( )
124140 } break ;
125141 }
126142 } )
127- . then ( ( mes ) => {
128- console . log ( mes )
129- } )
130143 . catch ( ( e ) => {
131- console . log ( e )
144+ console . log ( e ) ;
145+ error ( )
132146 } )
133147}
134148
@@ -139,10 +153,39 @@ function recursivech(choice){
139153 'Content-Type' : 'application/json' ,
140154 }
141155 } ) . then ( ( res ) => {
142- console . log ( res )
143- } ) . then ( ( mes ) => {
144-
156+ if ( res . status === 200 ) {
157+ success ( )
158+ } else {
159+ error ( )
160+ }
145161 } ) . catch ( ( e ) => {
146162 console . log ( e )
163+ error ( )
147164 } )
165+ }
166+
167+ function error ( ) {
168+ document . getElementById ( 'notification' ) . style . display = 'block' ;
169+ document . getElementById ( 'error' ) . style . display = 'block' ;
170+ document . getElementById ( 'notification' ) . style . opacity = '100%' ;
171+ setTimeout ( ( ) => {
172+ document . getElementById ( 'notification' ) . style . opacity = '0%' ;
173+ setTimeout ( ( ) => {
174+ document . getElementById ( 'notification' ) . style . display = 'none' ;
175+ document . getElementById ( 'error' ) . style . display = 'none' ;
176+ } , 1000 )
177+ } , 3000 )
178+ }
179+
180+ function success ( ) {
181+ document . getElementById ( 'notification' ) . style . display = 'block' ;
182+ document . getElementById ( 'success' ) . style . display = 'block' ;
183+ document . getElementById ( 'notification' ) . style . opacity = '100%' ;
184+ setTimeout ( ( ) => {
185+ document . getElementById ( 'notification' ) . style . opacity = '0%' ;
186+ setTimeout ( ( ) => {
187+ document . getElementById ( 'notification' ) . style . display = 'none' ;
188+ document . getElementById ( 'success' ) . style . display = 'none' ;
189+ } , 1000 )
190+ } , 3000 )
148191}
0 commit comments