From 1741b1c6866496e02c8ec4ccf11290e3ca069dc8 Mon Sep 17 00:00:00 2001 From: Danny Coates Date: Wed, 10 Jan 2018 10:02:14 -0800 Subject: [PATCH] use monospace font for password display --- app/templates/share.js | 10 +--------- assets/main.css | 1 + 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/app/templates/share.js b/app/templates/share.js index 4191287f..622d7f90 100644 --- a/app/templates/share.js +++ b/app/templates/share.js @@ -12,21 +12,13 @@ function passwordComplete(state, password) { password: '
'
     })}`
   ]);
-  const displayPassword = [];
-  for (let i = 0; i < password.length; i++) {
-    displayPassword[i] = '●';
-  }
-
   const passwordOriginal = document.createElement('div');
   passwordOriginal.className = 'passwordOriginal';
   passwordOriginal.innerText = password;
 
   const passwordStar = document.createElement('div');
   passwordStar.className = 'passwordStar';
-  passwordStar.innerText = displayPassword
-    .toString()
-    .split(',')
-    .join('');
+  passwordStar.innerText = password.replace(/./g, '●');
   el.lastElementChild.appendChild(passwordOriginal);
   el.lastElementChild.appendChild(passwordStar);
   return el;
diff --git a/assets/main.css b/assets/main.css
index 0ae4621b..7b3a6c20 100644
--- a/assets/main.css
+++ b/assets/main.css
@@ -146,6 +146,7 @@ button {
 }
 
 pre {
+  font-family: monospace;
   font-weight: 600;
   display: inline-block;
 }