@@ -37,18 +37,19 @@ if(micAccess) {
3737 audio : true
3838 } , ( stream ) => {
3939 stream . getTracks ( ) . forEach ( track => track . stop ( ) ) ;
40+ displayNotification ( "success" , " Mic Access Granted" , 1000 ) ;
4041 } , ( ) => {
41- console . log ( "no access" ) ;
42+ displayNotification ( "error" , " No Access" , 1000 ) ;
4243 } ) ;
4344 } ) ;
4445}
46+
4547if ( preDefThemes ) {
4648preDefThemes . addEventListener ( "click" , ( e ) => {
4749 if ( e . target !== e . currentTarget ) {
4850 theme = e . target . id ;
4951 console . log ( theme ) ;
5052 }
51-
5253 e . stopPropagation ;
5354 } ) ;
5455}
@@ -57,12 +58,11 @@ if(msgPaneThemes) {
5758 msgPaneThemes . addEventListener ( "click" , ( e ) => {
5859 if ( e . target !== e . currentTarget ) {
5960 msgTheme = e . target . id ;
60- console . log ( msgTheme ) ;
61+ console . log ( msgTheme ) ;
6162 }
62-
63- e . stopPropagation ;
64- } ) ;
65- }
63+ e . stopPropagation ;
64+ } ) ;
65+ }
6666
6767if ( getVoice ) {
6868 getVoice . addEventListener ( "click" , ( e ) => {
@@ -76,32 +76,34 @@ if(getVoice) {
7676
7777if ( submitThemeColor ) {
7878 submitThemeColor . addEventListener ( "click" , ( ) => {
79- localStorage . setItem ( "theme" , theme ) ;
80- alert ( "Success" ) ;
81- } ) ;
79+ localStorage . setItem ( "theme" , theme ) ;
80+ displayNotification ( "info" , "Theme successfully changed" , 1000 ) ;
81+ } ) ;
8282}
8383
8484if ( submitMsgPaneColor ) {
8585 submitMsgPaneColor . addEventListener ( "click" , ( ) => {
86- localStorage . setItem ( "msgTheme" , msgTheme ) ;
87- alert ( "Success" ) ;
88- } ) ;
86+ localStorage . setItem ( "msgTheme" , msgTheme ) ;
87+ displayNotification ( "warning" , " Message Pane Color Changed" , 1000 ) ;
88+ } ) ;
8989}
90+
9091if ( submitSusiVoice ) {
9192 submitSusiVoice . addEventListener ( "click" , ( ) => {
92- localStorage . setItem ( "voice" , voice ) ;
93- alert ( "Success" ) ;
94- } ) ;
93+ localStorage . setItem ( "voice" , voice ) ;
94+ displayNotification ( "success" , "Voice successfully changed" , 1000 ) ;
95+ } ) ;
9596}
97+
9698if ( backgroundChange ) {
9799 backgroundChange . addEventListener ( "submit" , ( e ) => {
98100 e . preventDefault ( ) ;
99101 theValue = backUrl . value ;
100102 if ( ! theValue ) {
101- alert ( " Error: No value specified" ) ;
103+ displayNotification ( "error" , " Error Background Not Changed" , 1000 ) ;
102104 } else {
103105 localStorage . setItem ( "theValue" , theValue ) ;
104- alert ( "Successfully stored" ) ;
106+ displayNotification ( "warning" , " Background successfully changed" , 1000 ) ;
105107 }
106108 } ) ;
107109}
@@ -112,22 +114,14 @@ restore.addEventListener("click", ()=>{
112114 userItems . forEach ( item => {
113115 localStorage . removeItem ( item ) ;
114116 } ) ;
117+ displayNotification ( "warning" , " Restored Settings" , 1000 ) ;
115118 }
116119} ) ;
117120
118121localimage . addEventListener ( "change" , ( ) => {
119122 var tmppath = URL . createObjectURL ( localimage . files [ 0 ] ) ;
120123 localStorage . setItem ( "theValue" , tmppath ) ;
121- alert ( "Image Updated" ) ;
122- } ) ;
123-
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- }
124+ displayNotification ( "success" , " Image Updates" , 1000 ) ;
131125} ) ;
132126
133127themeColorPicker . on ( "change" , function ( color ) {
0 commit comments