Skip to content

Commit

Permalink
Application page deprecate old encryption #154
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer committed Nov 16, 2021
1 parent 7a4e993 commit fa11195
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 64 deletions.
3 changes: 1 addition & 2 deletions app/application/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<link rel="stylesheet" href="./src/css/index.css" />
<!-- js -->
<script defer src="./src/js/index.js"></script>
<script defer src="./src/js/save.js"></script>
<!-- favicon -->
<link rel="shortcut icon" href="../../img/icon.ico" type="image/x-icon" />
</head>
Expand Down Expand Up @@ -188,7 +187,7 @@ <h3 class="pt-3">Save code(s)</h3>
<h4>Save your code(s) to your computer for future use.</h4>
<div class="flex flex-row items-center justify-center">
<div class="gap-3">
<button class="buttoni" onclick="saveChooser()">
<button class="buttoni" onclick="saveCodes()">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
</svg>
Expand Down
26 changes: 11 additions & 15 deletions app/application/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -654,17 +654,10 @@ setInterval(() => {
check_for_internet()
}, 5000)

// ? save chooser
const saveChooser = () => {
if (file.security.new_encryption === true) {
newSave()
} else {
save()
}
}

// new save method
const newSave = () => {
/**
* Save imported codes to disk
*/
const saveCodes = () => {
let password
let key

Expand Down Expand Up @@ -719,8 +712,10 @@ const newSave = () => {
key.fill(0)
}

// load save
const loadSave = () => {
/**
* Load saved codes from disk
*/
const loadCodes = () => {
let password
let key

Expand Down Expand Up @@ -766,8 +761,8 @@ const loadSave = () => {
})
}

if (file.security.require_password === false && file.security.new_encryption === true) {
loadSave()
if (file.security.require_password === false) {
loadCodes()
}

let dropdown_state = false
Expand All @@ -792,6 +787,7 @@ const dropdown = () => {

document.querySelector("#checkbox0").checked = file.settings.search_bar_filter.name
document.querySelector("#checkbox1").checked = file.settings.search_bar_filter.description

// ? dropdown checkboxes
document.querySelector("#checkbox0").addEventListener("click", () => {
if (file.settings.search_bar_filter.name === true) {
Expand Down
8 changes: 0 additions & 8 deletions app/application/src/js/save.js

This file was deleted.

Loading

0 comments on commit fa11195

Please sign in to comment.