1- localStorage . clear ( )
21document . getElementById ( 'sec-notif' ) . style . transform = 'scale(0)'
32
4- function colormode ( ) {
5- if ( document . getElementById ( 'menu1' ) . style . backgroundColor === 'white' ) {
3+ try {
4+ console . log ( localStorage . getItem ( "colormode" ) )
5+ colormode ( localStorage . getItem ( "colormode" ) )
6+ } catch ( e ) { colormode ( "light" ) }
7+
8+ function colorbridge ( ) {
9+ if ( document . getElementById ( 'menu1' ) . style . backgroundColor === 'white' ) colormode ( "dark" )
10+ else colormode ( "light" )
11+ }
12+
13+ function colormode ( pref ) {
14+ if ( pref === 'dark' ) {
15+ localStorage . setItem ( "colormode" , "dark" )
616 document . getElementById ( 'filter' ) . style . opacity = '70%'
717 document . getElementById ( 'menu1' ) . style . backgroundColor = 'black'
818 document . getElementById ( 'sec-notif' ) . style . backgroundColor = 'black'
@@ -25,11 +35,23 @@ function colormode(){
2535 document . getElementById ( 'sub-select1' ) . style . borderColor = 'white'
2636 document . getElementById ( 'sel-txt' ) . style . color = 'white' ;
2737 //console.log(document.querySelector('.multiselect-wrapper').style)
28- //document.querySelector('.multiselect-wrapper').style.borderColor = 'white'
38+ //document.querySelector('.multiselect-wrapper').classList.add('invert')
2939 //document.querySelector('.multiselect-wrapper').style.backgroundColor = 'black'
30- //console.log(document.querySelector('.multiselect-wrapper').style)
31- document . getElementById ( 'top-bar' ) . classList . add ( 'invert' )
32- } else {
40+ try {
41+ document . querySelector ( '.multiselect-wrapper ul' ) . style . backgroundColor = 'black' ;
42+ document . querySelector ( '.multiselect-wrapper ul' ) . style . color = 'white' ;
43+ document . querySelector ( '.multiselect-list' ) . style . color = 'white' ;
44+ document . querySelector ( '.multiselect-list' ) . style . backgroundColor = 'black' ;
45+ } catch ( e ) {
46+ console . log ( e )
47+ }
48+ document . getElementById ( 'top-bar' ) . classList . add ( 'invert' ) ;
49+ document . getElementById ( 'err-path' ) . style . color = 'white'
50+ document . getElementById ( 'error' ) . style . color = 'white'
51+ document . getElementById ( 'success' ) . style . color = 'white' ;
52+ document . getElementById ( "notification" ) . style . backgroundColor = 'black'
53+ } else if ( pref === 'light' ) {
54+ localStorage . setItem ( "colormode" , "light" )
3355 document . getElementById ( 'filter' ) . style . opacity = '5%'
3456 document . getElementById ( 'menu1' ) . style . backgroundColor = 'white'
3557 document . getElementById ( 'sec-notif' ) . style . backgroundColor = 'white'
@@ -45,13 +67,29 @@ function colormode(){
4567 }
4668 document . getElementsByClassName ( 'gg-dark-mode' ) [ 0 ] . style . backgroundColor = null
4769 document . getElementById ( 'sec-notif' ) . style . color = 'black' ;
48- document . getElementById ( 'top-bar' ) . classList . remove ( 'invert' )
70+ document . getElementById ( 'top-bar' ) . classList . remove ( 'invert' ) ;
71+ try {
72+ document . querySelector ( '.multiselect-wrapper' ) . classList . remove ( 'invert' ) ;
73+ document . querySelector ( '.multiselect-wrapper ul' ) . style . backgroundColor = 'white' ;
74+ document . querySelector ( '.multiselect-wrapper ul' ) . style . color = 'black' ;
75+ document . querySelector ( '.multiselect-list' ) . style . color = 'black' ;
76+ document . querySelector ( '.multiselect-list' ) . style . backgroundColor = 'white' ;
77+ } catch ( e ) {
78+ console . log ( e )
79+ }
80+ document . getElementById ( 'sub-select1' ) . style . backgroundColor = 'white'
81+ document . getElementById ( 'sub-select1' ) . style . borderColor = 'black'
82+ document . getElementById ( 'sel-txt' ) . style . color = 'black' ;
83+ document . getElementById ( 'err-path' ) . style . color = 'black'
84+ document . getElementById ( 'error' ) . style . color = 'black'
85+ document . getElementById ( 'success' ) . style . color = 'black' ;
86+ document . getElementById ( "notification" ) . style . backgroundColor = 'white'
4987 }
5088}
5189
52- function handler ( value ) {
90+ function handler ( value ) {
91+ console . log ( 'entered' )
5392 if ( ! value ) {
54-
5593 document . getElementById ( 'sec-notif' ) . style . visibility = 'visible'
5694 document . getElementById ( 'sec-notif' ) . style . transform = 'scale(1)'
5795 document . getElementsByClassName ( 'btn-select' ) [ 0 ] . children [ 0 ] . innerHTML = 'Folder selected' }
@@ -71,11 +109,12 @@ function handler(value){
71109 . then ( response => {
72110 console . log ( response )
73111 switch ( response . status ) {
74- case 404 : {
112+ case 220 : {
75113 console . log ( 'path was not valid' )
76114 document . getElementsByClassName ( 'btn-select' ) [ 0 ] . children [ 0 ] . innerHTML = 'No Folder selected'
77115 document . getElementById ( 'path-ph' ) . innerHTML = null ;
78-
116+ document . getElementById ( 'sec-notif' ) . style . transform = 'scale(0)'
117+ document . getElementById ( 'sec-notif' ) . style . visibility = 'hidden'
79118 document . getElementById ( 'notification' ) . style . display = 'block' ;
80119 document . getElementById ( 'err-path' ) . style . display = 'block' ;
81120 document . getElementById ( 'notification' ) . style . opacity = '100%' ;
@@ -84,8 +123,9 @@ function handler(value){
84123 setTimeout ( ( ) => {
85124 document . getElementById ( 'err-path' ) . style . display = 'none' ;
86125 document . getElementById ( 'notification' ) . style . display = 'none' ;
87- } , 1000 )
88- } , 3000 )
126+ window . location . reload ( )
127+ } , 500 )
128+ } , 2000 )
89129 } break ;
90130 case 205 : {
91131 console . log ( 'path was valid' )
0 commit comments