diff --git a/README.md b/README.md index 84285bf..5fd31cd 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,8 @@


AutoJoomer extension on Chrome Webstore - Add to your browser

AutoJoomer GitHub repo - https://www.github.com/vishal-lokare/AutoJoomer

-

AutoJoomer website - https://www.autojoomer.co/

+

AutoJoomer website - https://autojoomer-21321.web.app/

+

AutoJoomer app on - Play Store

@@ -46,11 +47,15 @@ Many more to come. ## Installation -If you are just a user, then you can install the extension from the Chrome Webstore. +![image](https://user-images.githubusercontent.com/94455615/198865183-c0d16224-84e4-4dcd-bc55-4820eaf9b678.png) + +1. To Install the AutoJoomer Extension head to Chrome Webstore +2. Search for AUTOJOOMER and add it to your Chrome, Brave or Edge. +* Or you can directly click on this link 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 vishal-lokare/AutoJoomer, and clone it to your Local Computer. 2. Open your browser, go to @@ -70,8 +75,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 ``` @@ -82,7 +88,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 Sync Fork 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 @@ -102,7 +110,8 @@ Repeat the installation process again. ## Future Updates -

-> Publish extension in the Chrome Web Store. (Finally Published 🥳)

+-

Publish extension in the Chrome Web Store. (Finally Published 🥳)

+-

Add 2023 batch support in the extension.

## License diff --git a/src/js/popup.html b/src/js/popup.html index 4faa2ff..fc972c5 100644 --- a/src/js/popup.html +++ b/src/js/popup.html @@ -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; @@ -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; @@ -341,16 +345,16 @@

Login

- +

LMS

-
+ +

Contributions

- diff --git a/src/js/popup.js b/src/js/popup.js index f287cf1..5938509 100644 --- a/src/js/popup.js +++ b/src/js/popup.js @@ -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) // } @@ -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"); @@ -179,3 +199,4 @@ async function connect_wifi() { // offline.style.display="none"; // online.style.display="flex"; } + diff --git a/src/pages/login/app.js b/src/pages/login/app.js index cf1e9fe..6609f1c 100644 --- a/src/pages/login/app.js +++ b/src/pages/login/app.js @@ -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 = ""; @@ -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"; } }); @@ -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 = ""; } }); @@ -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; } }); diff --git a/src/pages/login/login.html b/src/pages/login/login.html index 1e3bc48..8ad23cf 100644 --- a/src/pages/login/login.html +++ b/src/pages/login/login.html @@ -14,7 +14,8 @@

Login

-
+ +
Login
+
@@ -54,6 +56,7 @@

Login

+ diff --git a/src/pages/login/login.js b/src/pages/login/login.js index cc5c30e..5857d9e 100644 --- a/src/pages/login/login.js +++ b/src/pages/login/login.js @@ -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"; + } + }); + }; \ No newline at end of file diff --git a/src/pages/login/style.css b/src/pages/login/style.css index 9d9befc..a0f69cb 100644 --- a/src/pages/login/style.css +++ b/src/pages/login/style.css @@ -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; @@ -29,7 +39,7 @@ body { padding: 20px 0; } .form-container { - padding: 24px; + padding: 14px; display: flex; justify-content: flex-start; align-items: center; @@ -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); }