Skip to content

Commit

Permalink
Updated Passky to v7.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zigazajc007 committed Sep 25, 2022
1 parent 0429e39 commit 28b69f6
Show file tree
Hide file tree
Showing 14 changed files with 335 additions and 496 deletions.
35 changes: 18 additions & 17 deletions css/tailwind.min.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
! tailwindcss v3.1.6 | MIT License | https://tailwindcss.com
! tailwindcss v3.1.8 | MIT License | https://tailwindcss.com
*/

/*
Expand Down Expand Up @@ -355,13 +355,6 @@ input::-moz-placeholder, textarea::-moz-placeholder {
/* 2 */
}

input:-ms-input-placeholder, textarea:-ms-input-placeholder {
opacity: 1;
/* 1 */
color: #9ca3af;
/* 2 */
}

input::placeholder,
textarea::placeholder {
opacity: 1;
Expand Down Expand Up @@ -865,6 +858,23 @@ video {
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

@-webkit-keyframes spin {
to {
transform: rotate(360deg);
}
}

@keyframes spin {
to {
transform: rotate(360deg);
}
}

.animate-\[spin_0\.7s_ease-in-out\] {
-webkit-animation: spin 0.7s ease-in-out;
animation: spin 0.7s ease-in-out;
}

.cursor-pointer {
cursor: pointer;
}
Expand Down Expand Up @@ -1269,11 +1279,6 @@ video {
color: rgb(107 114 128 / var(--tw-placeholder-opacity));
}

.placeholder-gray-500:-ms-input-placeholder {
--tw-placeholder-opacity: 1;
color: rgb(107 114 128 / var(--tw-placeholder-opacity));
}

.placeholder-gray-500::placeholder {
--tw-placeholder-opacity: 1;
color: rgb(107 114 128 / var(--tw-placeholder-opacity));
Expand Down Expand Up @@ -1554,10 +1559,6 @@ video {
margin-left: 1.5rem;
}

.lg\:block {
display: block;
}

.lg\:flex {
display: flex;
}
Expand Down
5 changes: 2 additions & 3 deletions export.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,15 @@
<script src="js/lang.js"></script>
<script src="js/header.js"></script>
<script src="js/aes.js"></script>
<script src="js/jquery-3.6.0.min.js"></script>
<script src="js/jquery.min.js"></script>
</head>
<body class="primaryBackgroundColor">
<nav class="secondaryBackgroundColor shadow">
<div class="max-w-7xl mx-auto px-2 sm:px-4 lg:px-8">
<div class="flex justify-between h-16">
<div class="flex px-2 lg:px-0">
<div class="flex-shrink-0 flex items-center">
<img class="block lg:hidden h-8 w-auto" src="images/logo.png" alt="Passky">
<img class="hidden lg:block h-8 w-auto" src="images/logo.png" alt="Passky">
<img id="logo" class="h-8 w-auto animate-[spin_0.7s_ease-in-out]" src="images/logo.png" alt="Passky">
</div>
<div class="hidden lg:ml-6 lg:flex lg:space-x-8">
<a id="passwords-link" href="passwords.html" class="mainMenuLink border-transparent inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">
Expand Down
15 changes: 11 additions & 4 deletions js/default-functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function randRange(min, max) {
var range = max - min;
var requestBytes = Math.ceil(Math.log2(range) / 8);
if (!requestBytes) return min;

var maxNum = Math.pow(256, requestBytes);
var ar = new Uint8Array(requestBytes);

Expand All @@ -110,13 +110,13 @@ function refreshPasswords(){
if(response['error'] != 0 && response['error'] != 8) return;

if(response['error'] == 0){
writeData('passwords', JSON.stringify(response['passwords']));
writeData('passwords', JSON.stringify(response['passwords']));
}else{
writeData('passwords', '{}');
writeData('passwords', '{}');
}

window.location.href = 'passwords.html';
}).catch(err);
}).catch();

}

Expand Down Expand Up @@ -148,4 +148,11 @@ function isSessionValid(){
function logout(){
clearStorage();
window.location.href = 'index.html';
}

function startAuthenticator(){
if (!isSessionValid()) logout();
window.setInterval(function() {
if (!isSessionValid()) logout();
}, 1500);
}
29 changes: 13 additions & 16 deletions js/export.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
initStorageCache.then(() => {
startAuthenticator();

document.getElementById("passwords-link").innerText = lang[readData('lang')]["passwords"];
document.getElementById("import-export-link").innerText = lang[readData('lang')]["import_export"];
document.getElementById("settings-link").innerText = lang[readData('lang')]["settings"];
document.getElementById("signout-link").innerText = lang[readData('lang')]["signout"];

document.getElementById("passwords-link-mobile").innerText = lang[readData('lang')]["passwords"];
document.getElementById("import-export-link-mobile").innerText = lang[readData('lang')]["import_export"];
document.getElementById("settings-link-mobile").innerText = lang[readData('lang')]["settings"];
document.getElementById("signout-link-mobile").innerText = lang[readData('lang')]["signout"];

document.getElementById("passky-backup-btn-text").innerText = lang[readData('lang')]["backup"];

document.getElementById("passky-import-btn-text").innerText = lang[readData('lang')]["import"];
document.getElementById("lastpass-import-btn-text").innerText = lang[readData('lang')]["import"];
document.getElementById("bitwarden-import-btn-text").innerText = lang[readData('lang')]["import"];

document.getElementById("passky-export-btn-text").innerText = lang[readData('lang')]["export"];
document.getElementById("lastpass-export-btn-text").innerText = lang[readData('lang')]["export"];

document.getElementById("dialog-button-cancel").innerText = lang[readData('lang')]["cancel"];

window.setInterval(function(){
if(!isSessionValid()) logout();
}, 2000);
document.getElementById("dialog-button-cancel").innerText = lang[readData('lang')]["cancel"];
});

function import_passky(){
Expand Down Expand Up @@ -146,7 +143,7 @@ function export_keepassxc(){
exportedPasswords[i]["Created"] = new Date().toISOString();
}

downloadTxt($.csv.fromObjects(exportedPasswords), "keepassxc_" + getDate(new Date()) + ".csv");
downloadTxt($.csv.fromObjects(exportedPasswords), "keepassxc_" + getDate(new Date()) + ".csv");
}

function export_nordpass(){
Expand Down Expand Up @@ -475,10 +472,10 @@ function changeDialog(style, text, text2){
//Import Error
document.getElementById('dialog-icon').className = "mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10";
document.getElementById('dialog-icon').innerHTML = "<svg class='h-6 w-6 text-red-600' xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor' aria-hidden='true'><path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z' /></svg>";

document.getElementById('dialog-title').innerText = lang[readData('lang')]["error"];
document.getElementById('dialog-text').innerText = lang[readData('lang')]["import_invalid"];

document.getElementById('dialog-button').className = "dangerButton inline-flex justify-center w-full rounded-md border border-transparent shadow-sm px-4 py-2 text-base font-medium focus:outline-none sm:w-auto sm:text-sm";
document.getElementById('dialog-button').innerText = lang[readData('lang')]["try_again"];
document.getElementById('dialog-button').onclick = () => changeDialog(text, text2);
Expand All @@ -487,10 +484,10 @@ function changeDialog(style, text, text2){
//Import Success
document.getElementById('dialog-icon').className = "mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-green-100 sm:mx-0 sm:h-10 sm:w-10";
document.getElementById('dialog-icon').innerHTML = "<svg class='h-6 w-6 text-green-600' xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor' aria-hidden='true'><path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 13l4 4L19 7' /></svg>";

document.getElementById('dialog-title').innerText = lang[readData('lang')]["success"];
document.getElementById('dialog-text').innerText = text;

document.getElementById('dialog-button').className = "successButton inline-flex justify-center w-full rounded-md border border-transparent shadow-sm px-4 py-2 text-base font-medium focus:outline-none sm:w-auto sm:text-sm";
document.getElementById('dialog-button').innerText = lang[readData('lang')]["okay"];
document.getElementById('dialog-button').onclick = () => refreshPasswords();
Expand All @@ -499,10 +496,10 @@ function changeDialog(style, text, text2){
//Error
document.getElementById('dialog-icon').className = "mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10";
document.getElementById('dialog-icon').innerHTML = "<svg class='h-6 w-6 text-red-600' xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor' aria-hidden='true'><path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z' /></svg>";

document.getElementById('dialog-title').innerText = lang[readData('lang')]["error"];
document.getElementById('dialog-text').innerText = text;

document.getElementById('dialog-button').className = "dangerButton inline-flex justify-center w-full rounded-md border border-transparent shadow-sm px-4 py-2 text-base font-medium focus:outline-none sm:w-auto sm:text-sm";
document.getElementById('dialog-button').innerText = lang[readData('lang')]["okay"];
document.getElementById('dialog-button').onclick = () => hide('dialog');
Expand Down
12 changes: 11 additions & 1 deletion js/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,19 @@ function getAllStorageData() {
});
}

function detectLanguage(){
for(const language of navigator.languages){
if(Object.keys(lang).includes(language)){
writeData('lang', language);
break;
}
}
if(readData('lang') == null || typeof(readData('lang')) == 'undefined') writeData('lang', 'en');
}

function setTheme(){
if(readData('theme') == null || typeof(readData('theme')) == 'undefined') writeData('theme', 'dark');
if(readData('lang') == null || typeof(readData('lang')) == 'undefined') writeData('lang', 'en');
if(readData('lang') == null || typeof(readData('lang')) == 'undefined') detectLanguage();
if(readData('sessionDuration') == null || typeof(readData('sessionDuration')) == 'undefined') writeData('sessionDuration', '20');

if(!(["dark", "tokyoNight", "monokai", "solarizedDark", "light", "blue", "nord", "dracula", "gray"].includes(readData('theme')))) writeData('theme', 'dark');
Expand Down
2 changes: 0 additions & 2 deletions js/jquery-3.6.0.min.js

This file was deleted.

2 changes: 2 additions & 0 deletions js/jquery.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 28b69f6

Please sign in to comment.