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

Commit 6ef0536

Browse files
Fix-408
1 parent f45b157 commit 6ef0536

4 files changed

Lines changed: 59 additions & 28 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: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
4547
if(preDefThemes) {
4648
preDefThemes.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

6767
if(getVoice) {
6868
getVoice.addEventListener("click",(e) => {
@@ -76,32 +76,34 @@ if(getVoice) {
7676

7777
if(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

8484
if(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+
9091
if(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+
9698
if(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

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

133127
themeColorPicker.on("change", function(color){

src/options.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
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"/>
1112
<script type="text/javascript" src="js/ldcp.min.js"></script>
13+
<script type="text/javascript" src="js/notifications.min.js"></script>
1214
</head>
1315
<body>
1416
<div class="container">

0 commit comments

Comments
 (0)