Skip to content

Commit

Permalink
Merge branch 'vish' into update
Browse files Browse the repository at this point in the history
  • Loading branch information
vishal-lokare committed Jan 8, 2022
2 parents 3a43819 + 24d51ea commit 32da49e
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 15 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "AutoJoomer",
"version": "2.2.0",
"version": "2.2.1",
"manifest_version": 2,
"permissions": [
"tabs"
Expand Down
2 changes: 1 addition & 1 deletion popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,4 @@
</div>
</body>

</html>
</html>
55 changes: 43 additions & 12 deletions popup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
//global variables
var username;
var password;
var branch;
var confirmation;
window.onload = function () {
document.getElementById("button").addEventListener("click", savevalues);
username = document.getElementById("username");
password = document.getElementById("password");
branch = document.getElementById("branch");
confirmation = document.getElementById("confirmation");
populator();
document.getElementById("button").addEventListener("click", saveValues);
document.getElementById("button").innerHTML = "SAVE";
document.getElementById("button").disabled = false;

Expand Down Expand Up @@ -30,20 +40,41 @@ window.onload = function () {
});
}

function savevalues() {
function saveValues() {
username = document.getElementById("username");
password = document.getElementById("password");
branch = document.getElementById("branch");
confirmation = document.getElementById("confirmation");
document.getElementById("button").style.color = "white";
document.getElementById("button").innerHTML = "RESTART BROWSER";
document.getElementById("button").disabled = true;
var username = document.getElementById("username").value;
var password = document.getElementById("password").value;
var branch = document.getElementById("branch").value;
var confirmation;
var uname = username.value;
var pass = password.value;
var bran = branch.value;
if (document.getElementById("confirmation").checked)
confirmation = 1;
conf = 1;
else
confirmation = 0;
window.localStorage.setItem("AutoJoomerUsername", JSON.stringify(username));
window.localStorage.setItem("AutoJoomerPassword", JSON.stringify(password));
window.localStorage.setItem("AutoJoomerBranch", JSON.stringify(branch));
window.localStorage.setItem("AutoJoomerConfirmation", JSON.stringify(confirmation));
conf = 0;
window.localStorage.setItem("AutoJoomerUsername", JSON.stringify(uname));
window.localStorage.setItem("AutoJoomerPassword", JSON.stringify(pass));
window.localStorage.setItem("AutoJoomerBranch", JSON.stringify(bran));
window.localStorage.setItem("AutoJoomerConfirmation", JSON.stringify(conf));
}

function populator() {
username = document.getElementById("username");
password = document.getElementById("password");
branch = document.getElementById("branch");
confirmation = document.getElementById("confirmation");
//setting the values
if (JSON.parse(window.localStorage.getItem("AutoJoomerUsername")) != null)
username.value = JSON.parse(window.localStorage.getItem("AutoJoomerUsername"));
if (JSON.parse(window.localStorage.getItem("AutoJoomerPassword")) != null)
password.value = JSON.parse(window.localStorage.getItem("AutoJoomerPassword"));
if (JSON.parse(window.localStorage.getItem("AutoJoomerBranch")) != null)
branch.value = JSON.parse(window.localStorage.getItem("AutoJoomerBranch"));
if (JSON.parse(window.localStorage.getItem("AutoJoomerConfirmation")) == 1)
confirmation.checked = true;
if (JSON.parse(window.localStorage.getItem("AutoJoomerConfirmation")) == 0)
confirmation.checked = false;
}
3 changes: 2 additions & 1 deletion version_updates.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"2.1.0": "Added full page time table.",
"2.1.1": "Added support for extra classes and all other club meets/events",
"2.1.2": "Added an About Us page",
"2.2.0": "Automatically updates in realtime on changes to database"
"2.2.0": "Automatically updates in realtime on changes to database",
"2.2.1": "Automatic values fill in popup"
}

0 comments on commit 32da49e

Please sign in to comment.