Skip to content

Commit

Permalink
Updated account creation process and content.
Browse files Browse the repository at this point in the history
  • Loading branch information
monicanagent committed Dec 20, 2018
1 parent d6f79d1 commit 5b403a9
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 5 deletions.
17 changes: 13 additions & 4 deletions src/web/scripts/CypherPokerUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,15 @@ class CypherPokerUI {
var typeSplit = accountType.split("/");
this.cypherpoker.createAccount(typeSplit[0], password, typeSplit[1]).then(newAccount => {
this.hide(element);
element = this.getTemplateByName("help").elements[0];
if (typeSplit[1] == "test3") {
var helpElement = element.querySelector("#new_account_btc_test3");
} else {
helpElement = element.querySelector("#new_account_btc");
}
helpElement.innerHTML = helpElement.innerHTML.split("%address%").join(newAccount.address);
this.show(helpElement);
this.showDialog();
var newOptionElement = document.createElement("option");
var optionValue = newAccount.address + ":" + newAccount.type + "/" + newAccount.network;
newOptionElement.setAttribute("value", optionValue);
Expand All @@ -508,10 +517,10 @@ class CypherPokerUI {
currentAccounts.appendChild(newOptionElement);
currentAccounts.value = optionValue; //set new item as current selection
element.querySelector("#accountPassword").value = newAccount.password; //set password for account
this.showDialog("Account created: "+newAccount.address);
this.hideDialog(4000);
this.show(element);
this.show(manageElement);
// this.showDialog("Account created: "+newAccount.address);
// this.hideDialog(4000);
// this.show(element);
// this.show(manageElement);
}).catch(error => {
this.showDialog(error);
});
Expand Down
2 changes: 1 addition & 1 deletion src/web/templates/accountCreate.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<div id="createAccountForm" name="createAccountForm" class="createAccountFormContainer">
<input type="password" id="newAccountPassword" name="newAccountPassword" placeholder="New account password" />&nbsp;&nbsp;<button class="helpButton" onclick="ui.onHelpButtonClick('create_account_password')">?</button><br/>
Account cryptocurrency type: <select id="newAccountType" class="newAccountList">
<option value="bitcoin/test3">Testnet Bitcoin</option>
<option value="bitcoin/main">Bitcoin</option>
<option value="bitcoin/test3">Test Bitcoin</option>
</select>&nbsp;&nbsp;<button class="helpButton" onclick="ui.onHelpButtonClick('create_account_type')">?</button><br/>
<button id="newAccountButton" class="accountButton" onclick="ui.onAccountButtonClick('create_account')">CREATE ACCOUNT</button>
</div>
44 changes: 44 additions & 0 deletions src/web/templates/help.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,50 @@
<br/>
<button id="helpClose" class="helpContentButton" onclick="ui.onHelpButtonClick('close')">OKAY</button>
</div>
<div id="new_account_btc_test3" hidden="true">
A new Bitcoin testnet address / account has been created:<br/>
<br/>
<b>%address%</b><br/>
<br/>
You now need to deposit some funds to this address / account before you can begin playing.<br/>
<br/>
<button id="" onclick="ui.copyToClipboard('%address%')">Click here to copy the address to the clipboard... </button><br/>
<br/>
... then deposit to the new address from one of the following faucets:<br/>
<br/>
<a href="https://testnet-faucet.mempool.co/" target="_blank">https://testnet-faucet.mempool.co</a><br/>
<a href="http://bitcoinfaucet.uo1.net/" target="_blank">http://bitcoinfaucet.uo1.net/</a><br/>
<br/>
You can check the status of the deposit using blockchain explorers such as:<br/>
<br/>
<a href="https://www.blocktrail.com/tBTC" target="_blank">https://www.blocktrail.com/tBTC</a><br/>
<a href="https://testnet.blockexplorer.com/" target="_blank">https://testnet.blockexplorer.com/</a><br/>
<br/>
When the transaction is confirmed, refresh this page to complete the deposit.<br/>
<br/>
Click on any <button class="helpButton">?</button> button for additional help.<br/>
</div>
<div id="new_account_btc" hidden="true">
A new Bitcoin address / account has been created:<br/>
<br/>
<b>%address%</b><br/>
<br/>
You now need to deposit some funds to this address / account before you can begin playing.<br/>
<br/>
<button id="" onclick="ui.copyToClipboard('%address%')">Click here to copy the address to the clipboard... </button><br/>
<br/>
... then deposit to the new address from your Bitcoin wallet or wallet service.<br/>
<br/>
You can check the status of the deposit using blockchain explorers such as:<br/>
<br/>
<a href="https://www.blockchain.com/explorer" target="_blank">https://www.blockchain.com/explorer</a><br/>
<a href="https://live.blockcypher.com/btc/" target="_blank">https://live.blockcypher.com/btc/</a><br/>
<br/>
When the transaction is confirmed, refresh this page to complete the deposit.<br/>
<br/>
Click on any <button class="helpButton">?</button> button for additional help.<br/>
</div>
<br/>
<div id="select_copy_account" hidden="true">
Use the selection box on the left to choose an account for game play, <br/>
cash outs, or transfers.<br/>
Expand Down

0 comments on commit 5b403a9

Please sign in to comment.