Skip to content
This repository was archived by the owner on May 21, 2026. It is now read-only.

Commit 8311be9

Browse files
Fix-408
1 parent f45b157 commit 8311be9

4 files changed

Lines changed: 57 additions & 17 deletions

File tree

src/css/notifications.min.css

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
@import url(http://fonts.googleapis.com/css?family=Open+Sans:700,400);
2+
.notification {
3+
width: 300px;
4+
height: 80px;
5+
position: absolute;
6+
bottom: 10px;
7+
right: -300px;
8+
background: #ecf0f1;
9+
margin-bottom: 10px;
10+
font-family: 'Open Sans', sans-serif;
11+
font-size: 16px;
12+
padding: 0 15px;
13+
-webkit-box-sizing: border-box;
14+
-moz-box-sizing: border-box;
15+
box-sizing: border-box;
16+
line-height: 80px;
17+
border-left: 5px solid
18+
}
19+
.notification-info {
20+
border-left-color: #3498db;
21+
color: #3498db
22+
}
23+
.notification-success {
24+
border-left-color: #0a632f;
25+
color: #06883c
26+
}
27+
.notification-warning {
28+
border-left-color: #e67e22;
29+
color: #e67e22
30+
}
31+
.notification-error {
32+
border-left-color: #e74c3c;
33+
color: #e74c3c
34+
}

src/js/notifications.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/js/options.js

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}
4551
if(preDefThemes) {
@@ -77,31 +83,31 @@ if(getVoice) {
7783
if(submitThemeColor) {
7884
submitThemeColor.addEventListener("click",()=>{
7985
localStorage.setItem("theme",theme);
80-
alert("Success");
81-
});
86+
displayNotification('info', 'Theme successfully changed', 1000);
87+
});
8288
}
8389

8490
if(submitMsgPaneColor) {
8591
submitMsgPaneColor.addEventListener("click",()=>{
8692
localStorage.setItem("msgTheme",msgTheme);
87-
alert("Success");
88-
});
93+
displayNotification('warning', ' Message Pane Color Changed', 1000);
94+
});
8995
}
9096
if(submitSusiVoice) {
9197
submitSusiVoice.addEventListener("click",()=>{
9298
localStorage.setItem("voice",voice);
93-
alert("Success");
94-
});
99+
displayNotification('success', 'Voice successfully changed', 1000);
100+
});
95101
}
96102
if(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

118127
localimage.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

133134
themeColorPicker.on("change", function(color){
134135
themeColorPickerButton.style.backgroundColor = color;

src/options.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
99
<link rel="stylesheet" href="css/options.css">
1010
<link rel="stylesheet" type="text/css" href="css/ldcp.css"/>
11+
<link rel="stylesheet" type="text/css" href="css/notifications.min.css"/>
12+
1113
<script type="text/javascript" src="js/ldcp.min.js"></script>
14+
<script type="text/javascript" src="js/notifications.min.js"></script>
15+
1216
</head>
1317
<body>
1418
<div class="container">

0 commit comments

Comments
 (0)