Skip to content

Commit

Permalink
Multi fixes, pre Hacktoberfest 2023 (#215)
Browse files Browse the repository at this point in the history
* Display Login Page on StartUp for first time users 1/2 (#185)

* Added checklog script

* checklog to check if user logged in

checklog script checks if user has already logged in before to show log in page on start

* Redirect to popup after user enters login info

* Readme logo fix (#188)

* Removed logo

* Fixed the colour of the log in button

* Udated Login Page

* Update README.md

Co-authored-by: Pranjal Prasoon <thegreatishukumar100@gmail.com>
Co-authored-by: Vishal Lokare <31512838+vishal-lokare@users.noreply.github.com>
Co-authored-by: Pranjal Prasoon <79872203+motaboii@users.noreply.github.com>
Co-authored-by: Sumanth Kotikalapudi <kotikalapudisumanth@gmail.com>
Co-authored-by: Aditya Srinivas Menon <adityasrinivas.menon@gmail.com>

* Version 3.0.2

* Update popup.html (#196)

* fixed reset bug in login

* added autojoomer navbar

* Updated login page UI

* added link on the logo

* Update (#197)

* Removed logo

* Fixed the colour of the log in button

* Udated Login Page

* toast added

* toast added

Co-authored-by: Pranjal Prasoon <thegreatishukumar100@gmail.com>
Co-authored-by: Vishal Lokare <31512838+vishal-lokare@users.noreply.github.com>
Co-authored-by: Pranjal Prasoon <79872203+motaboii@users.noreply.github.com>
Co-authored-by: Sumanth Kotikalapudi <kotikalapudisumanth@gmail.com>
Co-authored-by: Aditya Srinivas Menon <adityasrinivas.menon@gmail.com>

* Branch display fix (#192)

* This commit will fix the bug(displaying CSE instead of CSY for BCY
students) in the login page.

* Bug Fix - CSY Display

* New Idea for Fixing bug

* Found the error and Fixed it.

* #186 LMS button fixed to divert user to correct website. (#199)

* Update popup.html

* Description
This PR solves #187
Changed the default value for branch, and batch so it gets updated after Logging in.
Added CSY branch which wasn't mentioned before.
Doesn't get stuck at CSE all the time.

Type of change
 Bug fix (non-breaking change which fixes an issue)
Browsers Tested on?
 Chrome
Checklist:
 My code follows the style guidelines of this project
 I have performed a self-review of my own code
 I have checked the responsiveness of the component I built
 I have commented on my code, particularly in hard-to-understand areas
 My changes generate no new warnings

Co-authored-by: Vishal Lokare <31512838+vishal-lokare@users.noreply.github.com>

* Replace Timeout on Login Page with Back Button 2/2 (#200)

* Replaced timeout with button to go back

* Replaced timeout with back button for login page

Co-authored-by: Vishal Lokare <31512838+vishal-lokare@users.noreply.github.com>

* Border Properties for footer buttons edited. (#207)

* Update README.md (#210)

* Color change (#211)

* toast added

* toast added

* updates

* Removed unwanted commit message leftover

---------

Co-authored-by: Neeraj P Yetheendran <46917698+NXPY123@users.noreply.github.com>
Co-authored-by: D PRIYATHAM <priyathamdarisi@gmail.com>
Co-authored-by: Pranjal Prasoon <thegreatishukumar100@gmail.com>
Co-authored-by: Pranjal Prasoon <79872203+motaboii@users.noreply.github.com>
Co-authored-by: Sumanth Kotikalapudi <kotikalapudisumanth@gmail.com>
Co-authored-by: Aditya Srinivas Menon <adityasrinivas.menon@gmail.com>
Co-authored-by: SAkET ROsHAn RAi <78961362+SRR-CODER@users.noreply.github.com>
Co-authored-by: Nikhil Menon <nikhil9302@gmail.com>
Co-authored-by: Nikhil Menon <74824711+nikhil9302@users.noreply.github.com>
Co-authored-by: Manas Gupta <82592534+Manas0109@users.noreply.github.com>
Co-authored-by: N.N.L.Keerthana <nyshadham21bcs185@iiitkottayam.ac.in>
  • Loading branch information
12 people authored Sep 30, 2023
1 parent f5cb715 commit ceedb1e
Show file tree
Hide file tree
Showing 7 changed files with 136 additions and 49 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,15 @@ Many more to come.

## Installation

If you are just a user, then you can install the extension from the <a href="https://chrome.google.com/webstore/detail/autojoomer/gbclbcfjcjnajkkibmadammhkbmgbiao">Chrome Webstore</a>.
![image](https://user-images.githubusercontent.com/94455615/198865183-c0d16224-84e4-4dcd-bc55-4820eaf9b678.png)

1. To Install the AutoJoomer Extension head to <a href="https://chrome.google.com/webstore/category/extensions"> Chrome Webstore</a>
2. Search for <b>AUTOJOOMER</b> and add it to your Chrome, Brave or Edge.
* Or you can directly click on this <a href="https://chrome.google.com/webstore/detail/autojoomer/gbclbcfjcjnajkkibmadammhkbmgbiao">AutoJoomer_link</a> to add the Extension to your browser.

And for contributors, they can follow the below steps to add the extension in Developer mode.

1. Download all the files to a folder either by the "Download as ZIP" button or by cloning the repo.
1. Fork the repo <b><a href = "https://github.com/vishal-lokare/AutoJoomer">vishal-lokare/AutoJoomer</a></b>, and clone it to your Local Computer.

2. Open your browser, go to

Expand All @@ -70,8 +74,9 @@ Everytime you make any change in your local code, go to "chrome://extensions" or

## How to stay updated

Users from Chrome Webstore will get updates automatically.
Google Chrome Webstore will update Extensions automatically with in 2-3 days, if you are a user who added the extension from chrome webstore, your extension will get updated automatically.

If you are a developer or contributor,
To stay up-to-date with the latest version hosted on GitHub, while being in the same directory where the downloaded files are, run

```
Expand All @@ -82,7 +87,9 @@ in the terminal and restart your browser / reload the extension.

OR

Repeat the installation process again.
Go to your forked repo, and Click On <i>Sync Fork</i> to get updated with all the commits from the main Repository.
![image](https://user-images.githubusercontent.com/94455615/198865630-0ec6e099-f23f-40ad-9060-e82c1f173c57.png)


## Tech Stack Used

Expand Down
10 changes: 7 additions & 3 deletions src/js/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,9 @@
width: 100%;
justify-content: center;
border-right: solid #000000 0.5px;
border-left: solid #000000 0.5px;
border-top: solid #000000 0.5px;
border-bottom: solid #000000 0.5px;
background-color: #DDE8FB;
text-decoration: none;
color: #000000;
Expand Down Expand Up @@ -255,7 +257,9 @@
color: #ffffff;
width: 100%;
border-right: solid #ffffff 0.5px;
border-left: solid #ffffff 0.5px;
border-top: solid #ffffff 0.5px;
border-bottom: solid #ffffff 0.5px;
text-decoration: none;
padding: 0.75em 0;

Expand Down Expand Up @@ -341,16 +345,16 @@
<p class="foot_txt">Login</p>
</a>

<a href="https://lms.iiitkottayam.ac.in/login/index.php" target="_blank" class="foot_item foot_box">
<a class="foot_item foot_box" id="lms_button" href="">
<p class="foot_txt">LMS</p>
</a>
</a>
<a href="" class="foot_item foot_box">

<p class="foot_txt">Contributions</p>
</a>
</div>
</footer>


</body>

</html>
31 changes: 26 additions & 5 deletions src/js/popup.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
let checker = 0;

let study_year="";
window.onload = function () {
theme(); //checks theme
// pingURL();
//isOnline();
};

document.addEventListener("DOMContentLoaded", function () {
window.onload = function populate() {
const year = document.querySelector("#year");
//fetch AutoJoomerYear

chrome.storage.local.get("AutoJoomerYear", function (result) {
study_year = result["AutoJoomerYear"];
});
}

document.addEventListener("DOMContentLoaded", function (){
document.getElementById("nav_button").addEventListener("click", mode_change);
document
.getElementById("nav_logo")
.addEventListener("click", open_autojoomer);
document.getElementById("nav_logo").addEventListener("click", open_autojoomer);
document.getElementById("lms_button").addEventListener("click", open_lms);
});


// function getRandomString () {
// return Math.random().toString(36).substring(2, 15)
// }
Expand Down Expand Up @@ -105,6 +114,17 @@ function open_autojoomer() {
window.open("https://www.autojoomer.co/", (target = "_blank"));
}

function open_lms()
{
//study_year = document.login_form.year.selectedIndex;
if(study_year == 2020)
{window.open("https://lms.iiitkottayam.ac.in/", (target="_blank"));}
else if(study_year == 2019 || study_year == 2021)
{window.open("https://lmsone.iiitkottayam.ac.in/", (target="_blank"));}
else
{alert("KINDLY ENTER YOUR CREDENTIALS");}
}

function mode_change() {
let element1 = document.body;
element1.classList.toggle("dark_bg");
Expand Down Expand Up @@ -179,3 +199,4 @@ async function connect_wifi() {
// offline.style.display="none";
// online.style.display="flex";
}

65 changes: 47 additions & 18 deletions src/pages/login/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,18 @@ let firstChange = 0;
year.disabled = true;
branch.disabled = true;
batch.disabled = true;
let logo = document.getElementById("nav_logo");

logo.addEventListener("click", open_autojoomer);

function open_autojoomer() {
window.open("https://www.autojoomer.co/", (target = "_blank"));
}

for(let i = 0; i < elements.length; i++) {
elements[i].addEventListener("keyup", () => {
if (!firstChange) {
firstChange++;
firstChange++;
if (!firstChange) {
roll.value = "";
password.value = "";
year.value = "";
Expand All @@ -35,9 +42,11 @@ roll.addEventListener("keyup", () => {
year.value = "2019";
branch.value = "CSE";
batch.value = "";
} else if (yearValue == 2020) {
}
else if (yearValue == 2020) {
year.value = "2020";
} else if (yearValue == 2021) {
}
else if (yearValue == 2021) {
year.value = "2021";
}
});
Expand All @@ -49,30 +58,35 @@ roll.addEventListener("keyup", () => {
branchValue = inputValue.slice(4, 7);
if (branchValue == "BCS") {
branch.value = "CSE";
} else if (branchValue == "BEC") {
}
else if (branchValue == "BEC") {
if (year.value != "2019") {
branch.value = "ECE";
}
} else if (branchValue == "BCY") {
if (year.value != "2019" || year.value != "2020") {
branch.value = "BCY";
}
else if (branchValue == "BCY") {
if (year.value != "2019" && year.value != "2020") {
branch.value = "CSY";
}
}
});

//batch
var batchValue = "";
var setvalue = "";
roll.addEventListener("keyup", () => {
let inputValue = roll.value.toUpperCase();
batchValue = inputValue[10];
if (year.value != "2019") {
if (inputValue.length > 10) {
if (inputValue.length > 10) {
batchValue = inputValue[10];
if (year.value != "2019") {
if (batchValue % 2 == 0) {
batch.value = "2";
} else {
}
else {
batch.value = "1";
}
} else batch.value = "";
}
else batch.value = "";
}
});

Expand All @@ -85,23 +99,38 @@ btn.addEventListener("click", () => {
alert("Invalid Roll Number");
return;
}
if (pattern.test(roll.value)) {
let t =pattern.test(roll.value);
if (t) {
alert("You have been Logged In");
chrome.storage.local.set({ ["AutoJoomerUsername"]: roll.value });
chrome.storage.local.set({ ["AutoJoomerPassword"]: password.value });
chrome.storage.local.set({ ["AutoJoomerYear"]: yearValue });
chrome.storage.local.set({ ["AutoJoomerBranch"]: branchValue });
chrome.storage.local.set({ ["AutoJoomerBatch"]: batchValue });
chrome.storage.local.set({ ["AutoJoomerBatch"]: setvalue });
btn.setAttribute(
"style",
"background: var(--light); color: rgba(9, 9, 121, 1);"
"background: var(--light); color: rgba(9, 9, 120, 1);"
);
btn.disabled = true;
btn.innerText = "Saved";
setTimeout(() => { //redirecting to popup.html

//Create button to go back
const div = document.getElementsByClassName("form-container")[0];
const back_button = document.createElement('BUTTON');
back_button.className = "submit-btn";
back_button.id = "back";
const text = document.createTextNode("Home");
back_button.onclick = function() { //Redirect to popup
window.open("/src/js/popup.html", "_self");
}, 1000);
}
back_button.appendChild(text);
//append line break
div.appendChild(document.createElement("br"));
div.appendChild(back_button);

} else {
alert("Roll number does not exist");
alert("The Roll number does not exist");
return;
}
});
9 changes: 6 additions & 3 deletions src/pages/login/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
<body>
<div class="form-container">
<h1>Login</h1>
<form method="post">
<form name="login_form" method="post">

<div class="form-group">
<label for="roll">LMS Roll No.</label>
<input type="text" class="form-input" name="roll" id="roll" maxlength="11"
Expand All @@ -28,19 +29,20 @@ <h1>Login</h1>
<div class="form-group-col">
<label for="year">Year: </label>
<select name="year" id="year">
<option value="">Select Year</option>
<option selected="selected" value="">Select Year</option>
<option value="2019">2019</option>
<option value="2020">2020</option>
<option value="2021">2021</option>
</select>
</div>

<div class="form-group-col">
<label for="branch">Branch: </label>
<select name="branch" id="branch">
<option value="">Select branch</option>
<option value="CSE">CSE</option>
<option value="ECE">ECE</option>
<option value="BCY">BCY</option>
<option value="CSY">CSY</option>
</select>

</div>
Expand All @@ -54,6 +56,7 @@ <h1>Login</h1>
</div>
</div>
<button id="mb" type="button" class="submit-btn">Log In</button>

</form>
</div>

Expand Down
39 changes: 26 additions & 13 deletions src/pages/login/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,41 @@ window.onload = function populate() {
const year = document.querySelector("#year");
const branch = document.querySelector("#branch");
const batch = document.querySelector("#batch");

//fetch AutoJoomerUsername, AutoJoomerYear, AutoJoomerBranch and AutoJoomerBatch
chrome.storage.local.get("AutoJoomerUsername", function (result) {
document.getElementById("roll").value = result["AutoJoomerUsername"];
});
document.getElementById("password").value = "******";

document.getElementById("password").value = "*******";

chrome.storage.local.get("AutoJoomerYear", function (result) {
year.value = result["AutoJoomerYear"];
document.getElementById("year").value = result["AutoJoomerYear"];
});

chrome.storage.local.get("AutoJoomerBranch", function (result) {
switch(result["AutoJoomerBranch"]) {
case "ECE": {
branch.value = "ECE";
}
default: {
branch.value = "CSE";
}
if (result["AutoJoomerBranch"] == "BCS"){
document.getElementById("branch").value = "CSE";
}
else if (result["AutoJoomerBranch"] == "BCY"){
document.getElementById("branch").value = "CSY";
}
if (result["AutoJoomerBranch"] == "BEC"){
document.getElementById("branch").value = "ECE";
}
// branch.value = result["AutoJoomerBranch"];
});

chrome.storage.local.get("AutoJoomerBatch", function (result) {
if(result["AutoJoomerBatch"] % 2) batch.value = 1;
else batch.value = 2;
// document.getElementById("batch").value = result["AutoJoomerBatch"];
if (result["AutoJoomerBatch"] == ""){
document.getElementById("batch").value = "";
}
else if (result["AutoJoomerBatch"] % 2 == 1){
document.getElementById("batch").value = "1";
}
else if (result["AutoJoomerBatch"] % 2 == 0){
document.getElementById("batch").value = "2";
}

});

};
16 changes: 13 additions & 3 deletions src/pages/login/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@
scroll-behavior: smooth;
}

.navbar {
padding: 5px 2px;
display: flex;
width: 100%;
justify-content:center;
align-items: center;
background-color: #4990F5;
margin-bottom: 1rem;
}

:root {
--font-family: "Montserrat", sans-serif;
--light: white;
Expand All @@ -29,7 +39,7 @@ body {
padding: 20px 0;
}
.form-container {
padding: 24px;
padding: 14px;
display: flex;
justify-content: flex-start;
align-items: center;
Expand Down Expand Up @@ -86,11 +96,11 @@ body {
font-size: 1.2rem;
font-family: var(--font-family);
cursor: pointer;
border: 2px solid rgba(9, 9, 121, 1);
/*border: 2px solid;*/

transition: all 200ms ease-in-out;

background: rgba(9, 9, 121, 1);
background: #4990F5;
color: var(--light);

}
Expand Down

0 comments on commit ceedb1e

Please sign in to comment.