Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate multiple wallets #103 #258

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9315,7 +9315,7 @@
.right { text-align: right; }
.walletarea { display: none; border: 1px solid #BFBFBF; background-color: white; }
hr { margin: 20px 0; border-top: 1px dashed #008000; }
.keyarea { height: 110px; text-align: left; position: relative; padding: 25px 25px 10px; }
.keyarea { height: 110px; text-align: left; position: relative; padding: 25px 25px 10px; margin-bottom: 20px; }
.keyarea .public { float: left; }
.keyarea .pubaddress { display: inline-block; height: 40px; padding: 0 0 0 10px; float: left; }
.keyarea .privwif { margin: 0; float: right; text-align: right; padding: 0 20px 0 0; position: relative; }
Expand Down Expand Up @@ -9470,7 +9470,7 @@

#paperarea { min-height: 120px; display: none; }
#paperarea .keyarea { border: 1px solid #BFBFBF; border-top: 0; }
#paperarea .keyarea.art { display: block; height: auto; border: 0; font-family: Ubuntu, Arial; padding: 0; margin: 0; }
#paperarea .keyarea.art { display: block; height: auto; border: 0; font-family: Ubuntu, Arial; padding: 0; }
#paperarea .artwallet .papersvg { width: 1004px; height: 426px; border: 0; margin: 0; padding: 0; left: 0; }
#paperarea .artwallet .qrcode_public { top: 263px; left: 780px; z-index: 100; margin: 0; float: none; display: block; position: absolute; background-color: #FFFFFF;
padding: 5px 5px 2px 5px; }
Expand Down Expand Up @@ -9883,6 +9883,7 @@ <h3 class="faqQuestion"><a class="faqLink" onclick="ninja.toggleFaqQuestion('faq
<div id="papercommands" class="row">
<span><label id="paperlabelencrypt" for="paperencrypt" class="i18n">BIP38 Encrypt?</label> <input type="checkbox" id="paperencrypt" onchange="ninja.wallets.paperwallet.toggleEncrypt(this);" /></span>
<span><label id="paperlabelBIPpassphrase" for="paperpassphrase" class="i18n">Passphrase:</label> <input type="text" id="paperpassphrase" /></span>
<span><label id="paperlabelamount" for="amount" class="i18n">amount:</label> <input type="text" id="amount" value="1" /></span>

<br/>
<input type="button" id="papergenerate" value="Randomly generate" onclick="ninja.wallets.paperwallet.build(document.getElementById('paperpassphrase').value);" />
Expand Down Expand Up @@ -12393,18 +12394,15 @@ <h3>Release notes</h3>
document.getElementById("main").setAttribute("class", ""); // remove 'paper' class from main div
},

remaining: null, // use to keep track of how many addresses are left to process when building the paper wallet
count: 0,
pageBreakAtDefault: 1,
pageBreakAtArtisticDefault: 1,
pageBreakAt: null,
pageBreakAt: 3,

build: function (passphrase) {
var numWallets = 1;
var pageBreakAt = 1;
ninja.wallets.paperwallet.remaining = numWallets;
const amount = document.getElementById("amount").value;

// use to keep track of how many addresses are left to process when building the paper wallet
ninja.wallets.paperwallet.remaining = amount;
ninja.wallets.paperwallet.count = 0;
ninja.wallets.paperwallet.pageBreakAt = pageBreakAt;

document.getElementById("paperkeyarea").innerHTML = "";
if (ninja.wallets.paperwallet.encrypt) {
if (passphrase == "") {
Expand Down
1 change: 1 addition & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ <h3 class="faqQuestion"><a class="faqLink" onclick="ninja.toggleFaqQuestion('faq
<div id="papercommands" class="row">
<span><label id="paperlabelencrypt" for="paperencrypt" class="i18n">BIP38 Encrypt?</label> <input type="checkbox" id="paperencrypt" onchange="ninja.wallets.paperwallet.toggleEncrypt(this);" /></span>
<span><label id="paperlabelBIPpassphrase" for="paperpassphrase" class="i18n">Passphrase:</label> <input type="text" id="paperpassphrase" /></span>
<span><label id="paperlabelamount" for="amount" class="i18n">amount:</label> <input type="text" id="amount" value="1" /></span>

<br/>
<input type="button" id="papergenerate" value="Randomly generate" onclick="ninja.wallets.paperwallet.build(document.getElementById('paperpassphrase').value);" />
Expand Down
4 changes: 2 additions & 2 deletions src/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ a { position: relative; z-index: 20; text-decoration: none; color: #d58424; }
.right { text-align: right; }
.walletarea { display: none; border: 1px solid #BFBFBF; background-color: white; }
hr { margin: 20px 0; border-top: 1px dashed #008000; }
.keyarea { height: 110px; text-align: left; position: relative; padding: 25px 25px 10px; }
.keyarea { height: 110px; text-align: left; position: relative; padding: 25px 25px 10px; margin-bottom: 20px; }
.keyarea .public { float: left; }
.keyarea .pubaddress { display: inline-block; height: 40px; padding: 0 0 0 10px; float: left; }
.keyarea .privwif { margin: 0; float: right; text-align: right; padding: 0 20px 0 0; position: relative; }
Expand Down Expand Up @@ -159,7 +159,7 @@ h1 { margin: 0px; height: 91px; }

#paperarea { min-height: 120px; display: none; }
#paperarea .keyarea { border: 1px solid #BFBFBF; border-top: 0; }
#paperarea .keyarea.art { display: block; height: auto; border: 0; font-family: Ubuntu, Arial; padding: 0; margin: 0; }
#paperarea .keyarea.art { display: block; height: auto; border: 0; font-family: Ubuntu, Arial; padding: 0; }
#paperarea .artwallet .papersvg { width: 1004px; height: 426px; border: 0; margin: 0; padding: 0; left: 0; }
#paperarea .artwallet .qrcode_public { top: 263px; left: 780px; z-index: 100; margin: 0; float: none; display: block; position: absolute; background-color: #FFFFFF;
padding: 5px 5px 2px 5px; }
Expand Down
15 changes: 6 additions & 9 deletions src/ninja.paperwallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,15 @@ ninja.wallets.paperwallet = {
document.getElementById("main").setAttribute("class", ""); // remove 'paper' class from main div
},

remaining: null, // use to keep track of how many addresses are left to process when building the paper wallet
count: 0,
pageBreakAtDefault: 1,
pageBreakAtArtisticDefault: 1,
pageBreakAt: null,
pageBreakAt: 3,

build: function (passphrase) {
var numWallets = 1;
var pageBreakAt = 1;
ninja.wallets.paperwallet.remaining = numWallets;
const amount = document.getElementById("amount").value;

// use to keep track of how many addresses are left to process when building the paper wallet
ninja.wallets.paperwallet.remaining = amount;
ninja.wallets.paperwallet.count = 0;
ninja.wallets.paperwallet.pageBreakAt = pageBreakAt;

document.getElementById("paperkeyarea").innerHTML = "";
if (ninja.wallets.paperwallet.encrypt) {
if (passphrase == "") {
Expand Down