Skip to content

Commit

Permalink
Updated electron and Passky to v3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BuildTools committed Sep 2, 2021
1 parent 1ef09de commit c18e9ac
Show file tree
Hide file tree
Showing 20 changed files with 2,063 additions and 9,342 deletions.
10 changes: 10 additions & 0 deletions css/index.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
body{
min-width: 300px;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button{
-webkit-appearance: none;
margin: 0;
}

input[type=number]{
-moz-appearance: textfield;
}
9 changes: 9 additions & 0 deletions css/settings.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
::-webkit-scrollbar {
width: 8px;
}

body{
min-width: 500px;
min-height: 500px;
overflow-x: hidden;
}
50 changes: 9 additions & 41 deletions export.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,9 @@
<a id="import-export-link" href="#" class="mainMenuLinkSelected inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">
Import & Export
</a>
<a id="theme-link" href="#" class="mainMenuLink border-transparent inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">
Theme
<a id="settings-link" href="settings.html" class="mainMenuLink border-transparent inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">
Settings
</a>
<select id="lang-link" class="mainMenuLink border-transparent block pl-3 pr-4 py-2 border-b-4 text-base focus:outline-none font-medium">
<option value="en">English</option>
<option value="zh-CN">Chinese (Simplified)</option>
<option value="hi">Hindi</option>
<option value="fr">French</option>
<option value="ru">Russian</option>
<option value="de">German</option>
<option value="it">Italian</option>
<option value="pl">Polish</option>
<option value="cs">Czech</option>
<option value="sv-SE">Swedish</option>
<option value="nl">Dutch</option>
<option value="sl">Slovenian</option>
<option value="bs">Bosnian</option>
<option value="ro">Romanian</option>
</select>
<a id="signout-link" href="#" class="mainMenuLink border-transparent inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">
Sign out
</a>
Expand All @@ -71,23 +55,7 @@
<div id="mobile-menu" class="hidden pt-2 pb-3 space-y-1">
<a id="passwords-link-mobile" href="passwords.html" class="mainMenuMobileLink border-transparent block pl-3 pr-4 py-2 border-l-4 text-base font-medium">Passwords</a>
<a id="import-export-link-mobile" href="#" class="mainMenuMobileLinkSelected block pl-3 pr-4 py-2 border-l-4 text-base font-medium">Import & Export</a>
<a id="theme-link-mobile" href="#" class="mainMenuMobileLink border-transparent block pl-3 pr-4 py-2 border-l-4 text-base font-medium">Theme</a>
<select id="lang-link-mobile" class="mainMenuMobileLink border-transparent w-full block pl-3 pr-4 py-2 border-l-4 text-base focus:outline-none font-medium">
<option value="en">English</option>
<option value="zh-CN">Chinese (Simplified)</option>
<option value="hi">Hindi</option>
<option value="fr">French</option>
<option value="ru">Russian</option>
<option value="de">German</option>
<option value="it">Italian</option>
<option value="pl">Polish</option>
<option value="cs">Czech</option>
<option value="sv-SE">Swedish</option>
<option value="nl">Dutch</option>
<option value="sl">Slovenian</option>
<option value="bs">Bosnian</option>
<option value="ro">Romanian</option>
</select>
<a id="settings-link-mobile" href="settings.html" class="mainMenuMobileLink border-transparent block pl-3 pr-4 py-2 border-l-4 text-base font-medium">Settings</a>
<a id="signout-link-mobile" href="#" class="mainMenuMobileLink border-transparent block pl-3 pr-4 py-2 border-l-4 text-base font-medium">Sign out</a>
</div>
</div>
Expand Down Expand Up @@ -188,29 +156,29 @@ <h3 class="tertiaryColor mt-6 text-lg font-medium">Bitwarden</h3>
</li>
<li class="secondaryBackgroundColor col-span-1 flex flex-col text-center rounded-lg shadow divide-y divide-gray-200">
<div class="flex-1 flex flex-col p-8">
<img id="dashline-logo" class="w-24 h-24 flex-shrink-0 mx-auto rounded-full" src="images/dashline.png" alt="Dashline">
<h3 class="tertiaryColor mt-6 text-lg font-medium">Dashline</h3>
<img id="dashlane-logo" class="w-24 h-24 flex-shrink-0 mx-auto rounded-full" src="images/dashlane.png" alt="Dashlane">
<h3 class="tertiaryColor mt-6 text-lg font-medium">Dashlane</h3>
</div>
<div>
<div class="-mt-px flex divide-x divide-gray-200">
<div class="w-0 flex-1 flex">
<a id="dashline-import-btn" href="#" class="importExportButtons relative -mr-px w-0 flex-1 inline-flex items-center justify-center py-4 text-sm font-medium border border-transparent">
<a id="dashlane-import-btn" href="#" class="importExportButtons relative -mr-px w-0 flex-1 inline-flex items-center justify-center py-4 text-sm font-medium border border-transparent">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" stroke="#2c3e50" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<path d="M14 3v4a1 1 0 0 0 1 1h4" />
<path d="M5 13v-8a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-5.5m-9.5 -2h7m-3 -3l3 3l-3 3" />
</svg>
<span id="dashline-import-btn-text" class="ml-3">Import</span>
<span id="dashlane-import-btn-text" class="ml-3">Import</span>
</a>
</div>
<div class="w-0 flex-1 flex">
<a id="dashline-export-btn" href="#" class="importExportButtons relative -mr-px w-0 flex-1 inline-flex items-center justify-center py-4 text-sm font-medium border border-transparent">
<a id="dashlane-export-btn" href="#" class="importExportButtons relative -mr-px w-0 flex-1 inline-flex items-center justify-center py-4 text-sm font-medium border border-transparent">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" stroke="#2c3e50" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<path d="M14 3v4a1 1 0 0 0 1 1h4" />
<path d="M11.5 21h-4.5a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v5m-5 6h7m-3 -3l3 3l-3 3" />
</svg>
<span id="dashline-export-btn-text" class="ml-3">Export</span>
<span id="dashlane-export-btn-text" class="ml-3">Export</span>
</a>
</div>
</div>
Expand Down
File renamed without changes
38 changes: 23 additions & 15 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,45 +36,53 @@
</div>
<div>
<label for="password" class="sr-only">Password</label>
<input id="password" name="password" type="password" autocomplete="current-password" required class="tertiaryBackgroundColor tertiaryColor primaryBorderColor appearance-none rounded-none relative block w-full px-3 py-2 border rounded-b-md focus:outline-none focus:z-10 sm:text-sm" placeholder="Password">
<input id="password" name="password" type="password" autocomplete="current-password" required class="tertiaryBackgroundColor tertiaryColor primaryBorderColor appearance-none rounded-none relative block w-full px-3 py-2 border focus:outline-none focus:z-10 sm:text-sm" placeholder="Password">
</div>
<div>
<label for="otp" class="sr-only">OTP</label>
<input id="otp" name="otp" type="number" autocomplete="off" class="tertiaryBackgroundColor tertiaryColor primaryBorderColor appearance-none rounded-none relative block w-full px-3 py-2 border rounded-b-md focus:outline-none focus:z-10 sm:text-sm" placeholder="OTP">
</div>
</div>

<div id="error-dialog" class="fixed z-10 inset-0 overflow-y-auto invisible" aria-labelledby="error-dialog-modal-title" role="dialog" aria-modal="true">
<div id="dialog" class="fixed z-10 inset-0 overflow-y-auto invisible" aria-labelledby="dialog-title" role="dialog" aria-modal="true">
<div class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
<div class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" aria-hidden="true"></div>
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">&#8203;</span>
<div class="secondaryBackgroundColor inline-block align-bottom rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-sm sm:w-full sm:p-6">
<div>
<div class="mx-auto flex items-center justify-center h-12 w-12 rounded-full bg-red-100">
<div class="secondaryBackgroundColor inline-block align-bottom rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full sm:p-6">
<div class="sm:flex sm:items-start">
<div id="dialog-icon" class="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">
<svg class="h-6 w-6 text-red-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="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>
</div>
<div class="mt-3 text-center sm:mt-5">
<h3 class="tertiaryColor text-lg leading-6 font-medium" id="error-dialog-modal-title">
ERROR
</h3>
<div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left">
<h3 class="tertiaryColor text-lg leading-6 font-medium" id="dialog-title"></h3>
<div class="mt-2">
<p id="error-dialog-modal-text" class="secondaryColor text-sm">
</p>
<p class="secondaryColor text-sm" id="dialog-text"></p>
</div>
</div>
</div>
<div class="mt-5 sm:mt-6">
<button type="button" id="error-dialog-okay" class="dangerButton inline-flex justify-center w-full rounded-md border border-transparent shadow-sm px-4 py-2 text-base focus:outline-none font-medium sm:text-sm">
<div class="mt-5 sm:mt-4 sm:ml-10 sm:pl-4 sm:flex">
<button id="dialog-button" type="button" class="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">
Okay
</button>
<button id="dialog-button-cancel" type="button" class="cancelButton mt-2 w-full inline-flex justify-center rounded-md border px-4 py-2 text-base font-medium shadow-sm focus:outline-none sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm">
Cancel
</button>
</div>
</div>
</div>
</div>

<div class="text-center">
<button id="btn_signin" type="submit" class="primaryButton group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white">
Sign in
</button>
<a id="dont_have_account_link" href="register.html" class="primaryColor">
Don't have account yet? Sign up here.
<button id="btn_signup" type="button" class="cancelButton group relative w-full flex justify-center my-2 py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white">
Sign up
</button>
<a href="#" id="forgot_username" class="primaryColor">
Forgot username?
</a>
</div>
</form>
Expand Down
59 changes: 15 additions & 44 deletions js/default-functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,38 +42,6 @@ function toggleMenu(){
}
}

function changeTheme(){
switch(localStorage.theme){
case "dark":
document.getElementById("css-theme").href = "css/themes/blue.css";
document.getElementById("theme-link").innerText = lang[localStorage.lang]["theme"] + " (Blue)";
document.getElementById("theme-link-mobile").innerText = lang[localStorage.lang]["theme"] + " (Blue)";
localStorage.theme = "blue";
break;
case "blue":
document.getElementById("css-theme").href = "css/themes/light.css";
document.getElementById("theme-link").innerText = lang[localStorage.lang]["theme"] + " (Light)";
document.getElementById("theme-link-mobile").innerText = lang[localStorage.lang]["theme"] + " (Light)";
localStorage.theme = "light";
break;
default:
document.getElementById("css-theme").href = "css/themes/dark.css";
document.getElementById("theme-link").innerText = lang[localStorage.lang]["theme"] + " (Dark)";
document.getElementById("theme-link-mobile").innerText = lang[localStorage.lang]["theme"] + " (Dark)";
localStorage.theme = "dark";
break;
}
}

function changeLanguage(){
if(document.getElementById('mobile-menu').className == 'hidden pt-2 pb-3 space-y-1'){
localStorage.lang = document.getElementById("lang-link").value;
}else{
localStorage.lang = document.getElementById("lang-link-mobile").value;
}
location.reload();
}

function copyToClipboard(text){
let textArea = document.createElement("textarea");
textArea.value = text;
Expand Down Expand Up @@ -138,25 +106,24 @@ function getDate(date){

function isPasswordWebsiteValid(website){
if(website == null || typeof(website) == 'undefined') return false;
if(website.length == 0) return false;
if(!(website.length >= 5 && website.length <= 255) || website.includes(" ")) return false;
if(website.includes("'") || website.includes('"') || website.includes("\\")) return false;
return true;
}

function isPasswordUsernameValid(username){
if(username == null || typeof(username) == 'undefined') return false;
if(username.length == 0) return false;
if(!(username.length >= 3 && username.length <= 255) || username.includes(" ")) return false;
if(username.includes("'") || username.includes('"') || username.includes("\\")) return false;
if(!(username.length >= 3 && username.length <= 255)) return false;
return true;
}

function isPasswordPasswordValid(password){
if(password == null || typeof(password) == 'undefined') return false;
if(password.length == 0) return false;
if(!(password.length >= 8 && password.length <= 255) || password.includes(" ")) return false;
if(password.includes("'") || password.includes('"') || password.includes("\\")) return false;
if(!(password.length >= 5 && password.length <= 255)) return false;
return true;
}

function isPasswordMessageValid(message){
if(message.length > 10000) return false;
return true;
}

Expand All @@ -182,7 +149,7 @@ function refreshPasswords(){

xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("Authorization", "Basic " + btoa(localStorage.username + ":" + sha512(localStorage.password)));
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

xhr.onreadystatechange = function () {

Expand All @@ -196,7 +163,10 @@ function refreshPasswords(){

if(json['error'] == 0){
let passwords = json['passwords'];
for(let i = 0; i < passwords.length; i++) passwords[i].password = CryptoJS.AES.decrypt(passwords[i].password, localStorage.password).toString(CryptoJS.enc.Utf8);
for(let i = 0; i < passwords.length; i++){
passwords[i].password = CryptoJS.AES.decrypt(passwords[i].password, localStorage.password).toString(CryptoJS.enc.Utf8);
passwords[i].message = CryptoJS.AES.decrypt(passwords[i].message, localStorage.password).toString(CryptoJS.enc.Utf8);
}
localStorage.passwords = JSON.stringify(passwords);
}else{
localStorage.passwords = "{}";
Expand All @@ -206,17 +176,18 @@ function refreshPasswords(){
}

};
xhr.send("");
xhr.send("otp=" + encodeURIComponent(localStorage.secret));
}

function clearStorage(){
delete localStorage.password;
delete localStorage.passwords;
delete localStorage.secret;
delete localStorage.loginTime;
}

function isSessionValid(){
if(localStorage.url == null || typeof(localStorage.url) == 'undefined' || localStorage.username == null || typeof(localStorage.username) == 'undefined' || localStorage.password == null || typeof(localStorage.password) == 'undefined' || localStorage.passwords == null || typeof(localStorage.passwords) == 'undefined' || localStorage.loginTime == null || typeof(localStorage.loginTime) == 'undefined' || ((parseFloat(localStorage.loginTime) + 1200000)) < new Date().getTime()){
if(localStorage.url == null || typeof(localStorage.url) == 'undefined' || localStorage.username == null || typeof(localStorage.username) == 'undefined' || localStorage.password == null || typeof(localStorage.password) == 'undefined' || localStorage.passwords == null || typeof(localStorage.passwords) == 'undefined' || localStorage.loginTime == null || typeof(localStorage.loginTime) == 'undefined' || localStorage.sessionDuration == null || typeof(localStorage.sessionDuration) == 'undefined' || ((parseFloat(localStorage.loginTime) + (localStorage.sessionDuration * 60000))) < new Date().getTime()){
clearStorage();
return false;
}
Expand Down
Loading

0 comments on commit c18e9ac

Please sign in to comment.