Option to disable A-Z index, get an extra password per page

Fixes #2
This commit is contained in:
Ian Gulliver
2018-12-05 05:48:21 +00:00
parent 1d7becc1da
commit 05997919ed
2 changed files with 23 additions and 3 deletions

View File

@@ -250,6 +250,11 @@ overview,product {
} }
letter { letter {
display: none;
}
product.index-letters letter {
display: block;
font-family: 'copernicus'; font-family: 'copernicus';
font-weight: 600; font-weight: 600;
font-size: 4em; font-size: 4em;
@@ -312,6 +317,10 @@ overview,product {
grid-row-gap: 0.2em; grid-row-gap: 0.2em;
} }
product.index-letters passwordBlock:nth-of-type(6) {
display: none;
}
passwordLabel,websiteLabel,usernameLabel { passwordLabel,websiteLabel,usernameLabel {
text-align: right; text-align: right;
} }

View File

@@ -15,7 +15,7 @@ class PassMate {
this.MASTER_PASSWORD_LENGTH = 32; this.MASTER_PASSWORD_LENGTH = 32;
this.PAGES_PER_LETTER = 2; this.PAGES_PER_LETTER = 2;
this.PASSWORDS_PER_PAGE = 5; this.PASSWORDS_PER_PAGE = 6;
this.VERSION = 0; this.VERSION = 0;
this.pages = []; this.pages = [];
@@ -58,13 +58,23 @@ class PassMate {
this.product.classList.remove('passwords-readable'); this.product.classList.remove('passwords-readable');
this.product.classList.add('passwords-' + key); this.product.classList.add('passwords-' + key);
}); });
let shortItem = this.addElement('li', formats); let shortItem = this.addElement('li', formats);
format.add('short', this.addElement('button', shortItem, 'Short: 5EQaDfNS')); format.add('short', this.addElement('button', shortItem, 'Short: 5EQaDfNS'));
let readableItem = this.addElement('li', formats); let readableItem = this.addElement('li', formats);
format.add('readable', this.addElement('button', readableItem, 'Readable: LeasedBarneyPlays565')); format.add('readable', this.addElement('button', readableItem, 'Readable: LeasedBarneyPlays565'));
let indexStep = this.addElement('li', instr, 'Choose your preferred index format:');
let indexes = this.addElement('ul', indexStep);
let index = new Select((key) => {
this.product.classList.remove('index-letters');
this.product.classList.remove('index-none');
this.product.classList.add('index-' + key);
});
let indexLettersItem = this.addElement('li', indexes);
index.add('letters', this.addElement('button', indexLettersItem, 'Letters: Look up by website name, A-Z'));
let indexNoneItem = this.addElement('li', indexes);
index.add('none', this.addElement('button', indexNoneItem, 'None: Use passwords from the beginning'));
let printReqStep = this.addElement('li', instr, 'Check that your printer supports two-sided printing. You\'ll need to print with the following settings:'); let printReqStep = this.addElement('li', instr, 'Check that your printer supports two-sided printing. You\'ll need to print with the following settings:');
let printreqs = this.addElement('ul', printReqStep); let printreqs = this.addElement('ul', printReqStep);
this.addElement('li', printreqs, 'Paper size: Letter'); this.addElement('li', printreqs, 'Paper size: Letter');
@@ -73,6 +83,7 @@ class PassMate {
let printStep = this.addElement('li', instr); let printStep = this.addElement('li', instr);
let print = this.addElement('button', printStep, 'Click here to print the book!'); let print = this.addElement('button', printStep, 'Click here to print the book!');
print.style.cursor = 'pointer';
printStep.addEventListener('click', () => { printStep.addEventListener('click', () => {
window.print(); window.print();
}); });