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

Commit 0c22512

Browse files
Merge branch 'master' into Fix-408
2 parents 1d9ee02 + bf6435b commit 0c22512

13 files changed

Lines changed: 59 additions & 71 deletions

File tree

.github/ISSUE_TEMPLATE.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
**I'm submitting a ...** (check one with "x")
1+
**I'm submitting a ...** <!-- check one with "x" -->
22
- [ ] bug report
33
- [ ] feature request
44
- [ ] support request => Please do not submit support requests here, instead ask your query in our [Gitter channel](https://gitter.im/fossasia/susi_server)
@@ -25,11 +25,14 @@ insert any relevant code here else remove this section
2525

2626
<!-- Add information about the system you're facing this bug on. If you think this is irrelevant or if it's a UI bug or a feature request, please remove this section -->
2727

28+
**Screenshots of the issue:**
29+
<!-- Wherever applicable attach a screenshot of the issue. -->
30+
2831
```
2932
Your operating system
3033
```
3134

3235
**Would you like to work on the issue?**
3336

34-
Please let us know if you can work on it or the issue should be assigned to someone else.
37+
<!-- Please let us know if you can work on it or the issue should be assigned to someone else. -->
3538
```

src/css/login.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,18 @@ label {
6969
border-radius: 0.25rem;
7070
}
7171

72+
.input-group>#password {
73+
padding-right: 3rem;
74+
}
75+
7276
#passwordlim{
7377
color: white;
7478
}
7579

80+
#passwordmatch{
81+
color: white;
82+
}
83+
7684
#loggedin{
7785
margin-top: 15px;
7886
}
@@ -99,3 +107,6 @@ label {
99107
button{
100108
cursor: pointer;
101109
}
110+
.pointer {
111+
cursor: pointer;
112+
}

src/js/login.js

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ var defaultThemeValue = "";
1414
var password = document.getElementById("password");
1515
var pass = document.getElementById("pass");
1616
var cPass = document.getElementById("cPass");
17-
var cemail = document.getElementById("cemail");
1817
var cpassword = document.getElementById("cpassword");
1918
var passwordlim = document.getElementById("passwordlim");
2019
var newPassword = document.getElementById("newPassword");
2120
var toggle = document.getElementById("toggle");
2221
var settings=document.getElementById("settings");
22+
var username = document.getElementById("username");
2323

2424
chrome.storage.sync.get("darktheme", (obj) => {
2525
if (obj.darktheme === true) {
@@ -40,11 +40,11 @@ toggle.addEventListener("click", ()=>{
4040
});
4141

4242
pass.addEventListener("click", ()=>{
43-
$("#cPass").toggle();
43+
pass.innerHTML = ($("#cPass").toggle().is(":visible"))?("Click here to hide change password form"):("Click here to change password");
4444
});
4545

4646
newPassword.addEventListener("keyup", ()=>{
47-
if(newPassword.value.length<6){
47+
if(newPassword.value.length<6 || newPassword.value.length>64 ){
4848
passwordlim.removeAttribute("hidden");
4949
document.getElementById("csubmit").setAttribute("disabled", "true");
5050
} else {
@@ -53,14 +53,22 @@ newPassword.addEventListener("keyup", ()=>{
5353
}
5454
});
5555

56+
confirmPassword.addEventListener("keyup", ()=>{
57+
if(confirmPassword.value !== newPassword.value){
58+
passwordmatch.removeAttribute("hidden");
59+
} else {
60+
passwordmatch.setAttribute("hidden", "true");
61+
}
62+
});
63+
5664
cPass.addEventListener("submit", (e)=>{
5765
e.stopPropagation();
58-
var loginEP = BASE_URL+"/aaa/changepassword.json?"+"changepassword="+ cemail.value + "&password="+ cpassword.value + "&newpassword=" + newPassword.value + "&access_token=" + accessToken ;
66+
var loginEP = BASE_URL+"/aaa/changepassword.json?"+"changepassword="+ username.value + "&password="+ cpassword.value + "&newpassword=" + newPassword.value + "&access_token=" + accessToken ;
5967
$.ajax({
6068
url:loginEP,
6169
dataType: "jsonp",
6270
jsonp: "callback",
63-
crossDomain: true,
71+
crossDomain: true,
6472
success: (response) => {
6573
alert(response.message);
6674
cPass.style.display = "none";
@@ -179,10 +187,16 @@ loginForm.addEventListener("submit", (event) => {
179187
event.preventDefault();
180188
var email = document.getElementById("username").value;
181189
var password = document.getElementById("password").value;
190+
var isEmailValid = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i.test(email);
182191
if (!email) {
183192
showStatus("Email field cannot be empty",true);
184193
return;
185-
} else if (!password) {
194+
}
195+
else if(!isEmailValid){
196+
showStatus("Please enter a valid email", true);
197+
return;
198+
}
199+
else if (!password) {
186200
showStatus("Password field cannot be empty",true);
187201
return;
188202
}

src/js/options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ restore.addEventListener("click", ()=>{
124124
localimage.addEventListener("change",()=>{
125125
var tmppath = URL.createObjectURL(localimage.files[0]);
126126
localStorage.setItem("theValue",tmppath);
127-
displayNotification("success", " Image Updates", 1000);
127+
displayNotification("success", " Image Updated", 1000);
128128
});
129129

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

src/js/signup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ let showsignupBlock = (show) => {
2222
};
2323

2424
password.addEventListener("keyup", ()=>{
25-
if(password.value.length<6){
25+
if(password.value.length<6 || password.value.length>64){
2626
passwordlim.removeAttribute("hidden");
2727
document.getElementById("signupbutton").setAttribute("disabled", "true");
2828
} else {

src/login.html

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
<div class="col-md-8">
1515
<div class="card">
1616
<img src="images/susi-logo.png" class="img-fluid signin-image">
17-
17+
1818
<button class="btn btn-warning" id="settings">SUSI Settings</button>
1919
<br/>
2020
<div class="alert alert-danger error col-md-10" id="error">
2121

2222
Error
2323
</div>
24-
24+
2525

2626

2727
<div class="nologgedin" id="nologgedin">
@@ -36,7 +36,7 @@
3636
<div class="input-group">
3737
<input type="password" class="form-control" id="password" placeholder="Password">
3838
<span class="field-icon">
39-
<i class="fa fa-eye" id="toggle"></i>
39+
<i class="fa fa-eye-slash pointer" id="toggle"></i>
4040
</span>
4141
</div>
4242
</div>
@@ -51,26 +51,29 @@
5151
</p>
5252
</form>
5353
</div>
54-
54+
5555
<div class="loggedin" id="loggedin">
5656
<button class="btn btn-danger" name="Logout" id="logout">Logout</button>
5757
<br/>
58-
58+
5959
<div style="text-align: center">
6060
<a style="color:#fff;" id="pass" href="#" >Click here to change password</a>
6161
</div>
6262
</div>
6363
<form id="cPass" style="display:none;">
64-
<div class="form-group">
65-
<input type="email" class="form-control fmargin" id="cemail" placeholder="Email">
66-
</div>
6764
<div class="form-group">
6865
<input type="password" class="form-control fmargin" id="cpassword" placeholder="Password">
6966
</div>
7067
<div class="form-group">
7168
<input type="password" class="form-control fmargin" id="newPassword" placeholder="New Password">
7269
<div style="text-align: center">
73-
<small hidden id="passwordlim">Minimum 6 characters required</small>
70+
<small hidden id="passwordlim">Allowed password length is 6 to 64 characters</small>
71+
</div>
72+
</div>
73+
<div class="form-group">
74+
<input type="password" class="form-control fmargin" id="confirmPassword" placeholder="Confirm New Password">
75+
<div style="text-align: center">
76+
<small hidden id="passwordmatch">Password does not match.</small>
7477
</div>
7578
</div>
7679
<div style="text-align: center">

src/options.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ <h3>Settings Page</h3>
7373
<span>Upload Local Image</span>
7474
</div>
7575
<div class="col-sm-7">
76-
<input id="localupload" type="file" placeholder="Background URL" id="backUrl">
76+
<input id="localupload" type="file" placeholder="Background URL" id="backUrl" accept="image/*">
7777
</div>
7878
</div>
7979
</form>

src/popup.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,11 @@
3131
<div style="z-index: 2;" class="dropdown">
3232
<div id="dropdown"><img src="images/dots.png" style="width: auto; height: 20px;"></div>
3333
<div class="dropdown-content">
34-
<a href="https://chat.susi.ai/" target="_blank"><li>Chat<img src="images/chat.svg"></li></a>
35-
<a href="https://skills.susi.ai/" target="_blank"><li>Skills<img src="images/skills.svg"></li></a>
34+
<a href="https://chat.susi.ai/overview" target="_blank"><li>About<img src="images/about.svg" ></li></a>
3635
<a href="" id="clear"><li>Clear Chat<img src="images/clearAll.svg" ></li></a>
3736
<a id="export"><li>Export<img src="images/export.svg"></li></a>
3837
<a href="options.html" target="_blank"><li id="settings-tab">Settings<img src="images/settings.svg" ></li></a>
39-
<a href="https://chat.susi.ai/overview" target="_blank"><li>About<img src="images/about.svg" ></li></a>
4038
<a href="login.html" target="_blank"><li id="log">Login<img src="images/login.svg" > </li></a>
41-
<a href="options.html" target="_blank"><li>Settings <img src="images/settings-icon.svg"></li></a>
4239
</div>
4340
</div>
4441
</header>

src/recover.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
<p style="text-align: center;color:#fff;">
3535
There is nothing here!! Recovery link is sent to your email.
3636
</p>
37+
<p style="text-align: center;">
38+
<a href="login.html" class="btn btn-success" style="color: #fff; ">Login</a>
39+
</p>
3740
<br />
3841
</div>
3942
</div>

src/script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ let composeMyMessage = (text, t= getCurrentTime()) => {
554554
});
555555
};
556556

557-
let restoreMessages = (storageItems = []) => {
557+
let restoreMessages = (storageItems) => {
558558
if (!storageItems && !accessToken) {
559559
var htmlMsg = "<div class='empty-history'> Start by saying \"Hi\"</div>";
560560
$(htmlMsg).appendTo(messages);

0 commit comments

Comments
 (0)