@@ -37,9 +37,15 @@ if(micAccess) {
3737 audio : true
3838 } , ( stream ) => {
3939 stream . getTracks ( ) . forEach ( track => track . stop ( ) ) ;
40+ displayNotification ( 'success' , ' Mic Access Granted' , 1000 ) ;
41+
42+
4043 } , ( ) => {
4144 console . log ( "no access" ) ;
45+ displayNotification ( 'error' , ' No Access' , 1000 ) ;
46+
4247 } ) ;
48+
4349 } ) ;
4450}
4551if ( preDefThemes ) {
@@ -77,31 +83,31 @@ if(getVoice) {
7783if ( submitThemeColor ) {
7884 submitThemeColor . addEventListener ( "click" , ( ) => {
7985 localStorage . setItem ( "theme" , theme ) ;
80- alert ( "Success" ) ;
81- } ) ;
86+ displayNotification ( 'info' , 'Theme successfully changed' , 1000 ) ;
87+ } ) ;
8288}
8389
8490if ( submitMsgPaneColor ) {
8591 submitMsgPaneColor . addEventListener ( "click" , ( ) => {
8692 localStorage . setItem ( "msgTheme" , msgTheme ) ;
87- alert ( "Success" ) ;
88- } ) ;
93+ displayNotification ( 'warning' , ' Message Pane Color Changed' , 1000 ) ;
94+ } ) ;
8995}
9096if ( submitSusiVoice ) {
9197 submitSusiVoice . addEventListener ( "click" , ( ) => {
9298 localStorage . setItem ( "voice" , voice ) ;
93- alert ( "Success" ) ;
94- } ) ;
99+ displayNotification ( 'success' , 'Voice successfully changed' , 1000 ) ;
100+ } ) ;
95101}
96102if ( backgroundChange ) {
97103 backgroundChange . addEventListener ( "submit" , ( e ) => {
98104 e . preventDefault ( ) ;
99105 theValue = backUrl . value ;
100106 if ( ! theValue ) {
101- alert ( " Error: No value specified" ) ;
107+ displayNotification ( 'error' , ' Error Background Not Changed' , 1000 ) ;
102108 } else {
103109 localStorage . setItem ( "theValue" , theValue ) ;
104- alert ( "Successfully stored" ) ;
110+ displayNotification ( 'warning' , ' Background successfully changed' , 1000 ) ;
105111 }
106112 } ) ;
107113}
@@ -111,24 +117,19 @@ restore.addEventListener("click", ()=>{
111117 userItems = [ "theValue" , "voice" , "msgTheme" , "theme" ] ;
112118 userItems . forEach ( item => {
113119 localStorage . removeItem ( item ) ;
120+
114121 } ) ;
122+ displayNotification ( 'warning' , ' Restored Settings' , 1000 ) ;
123+
115124 }
116125} ) ;
117126
118127localimage . addEventListener ( "change" , ( ) => {
119128 var tmppath = URL . createObjectURL ( localimage . files [ 0 ] ) ;
120129 localStorage . setItem ( "theValue" , tmppath ) ;
121- alert ( " Image Updated" ) ;
130+ displayNotification ( 'success' , ' Image Updates' , 1000 ) ;
122131} ) ;
123132
124- restore . addEventListener ( "click" , ( ) => {
125- if ( confirm ( "This will remove your customized settings. This action is irreversible." ) ) {
126- userItems = [ "theValue" , "voice" , "msgTheme" , "theme" ] ;
127- userItems . forEach ( item => {
128- localStorage . removeItem ( item ) ;
129- } ) ;
130- }
131- } ) ;
132133
133134themeColorPicker . on ( "change" , function ( color ) {
134135 themeColorPickerButton . style . backgroundColor = color ;
0 commit comments