aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/faucet/faucet.html
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-05-02 18:52:51 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-05-04 16:42:43 +0800
commit8a28408616cab76bf756170a4f39025c821e4d21 (patch)
tree3211df8c26ac55f4743827edf7af461fb233a3e1 /cmd/faucet/faucet.html
parente1dc7ece624a2f539b71f1dfb5901047f7a9f214 (diff)
downloaddexon-8a28408616cab76bf756170a4f39025c821e4d21.tar.gz
dexon-8a28408616cab76bf756170a4f39025c821e4d21.tar.zst
dexon-8a28408616cab76bf756170a4f39025c821e4d21.zip
cmd/faucet, cmd/puppeth: support multi-tiered faucet
Diffstat (limited to 'cmd/faucet/faucet.html')
-rw-r--r--cmd/faucet/faucet.html11
1 files changed, 8 insertions, 3 deletions
diff --git a/cmd/faucet/faucet.html b/cmd/faucet/faucet.html
index 9e02134b7..56dd37623 100644
--- a/cmd/faucet/faucet.html
+++ b/cmd/faucet/faucet.html
@@ -51,7 +51,10 @@
<div class="input-group">
<input id="gist" type="text" class="form-control" placeholder="GitHub Gist URL containing your Ethereum address...">
<span class="input-group-btn">
- <button class="btn btn-default" type="button" onclick="{{if .Recaptcha}}grecaptcha.execute(){{else}}submit(){{end}}">Give me Ether!</button>
+ <button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Give me Ether <i class="fa fa-caret-down" aria-hidden="true"></i></button>
+ <ul class="dropdown-menu dropdown-menu-right">{{range $idx, $amount := .Amounts}}
+ <li><a style="text-align: center;" onclick="tier={{$idx}}; {{if $.Recaptcha}}grecaptcha.execute(){{else}}submit({{$idx}}){{end}}">{{$amount}} / {{index $.Periods $idx}}</a></li>{{end}}
+ </ul>
</span>
</div>{{if .Recaptcha}}
<div class="g-recaptcha" data-sitekey="{{.Recaptcha}}" data-callback="submit" data-size="invisible"></div>{{end}}
@@ -77,8 +80,9 @@
<div class="row" style="margin-top: 32px;">
<div class="col-lg-12">
<h3>How does this work?</h3>
- <p>This Ether faucet is running on the {{.Network}} network. To prevent malicious actors from exhausting all available funds or accumulating enough Ether to mount long running spam attacks, requests are tied to GitHub accounts. Anyone having a GitHub account may request funds within the permitted limit of <strong>{{.Amount}} Ether(s) / {{.Period}}</strong>.{{if .Recaptcha}} The faucet is running invisible reCaptcha protection against bots.{{end}}</p>
+ <p>This Ether faucet is running on the {{.Network}} network. To prevent malicious actors from exhausting all available funds or accumulating enough Ether to mount long running spam attacks, requests are tied to GitHub accounts. Anyone having a GitHub account may request funds within the permitted limits.</p>
<p>To request funds, simply create a <a href="https://gist.github.com/" target="_about:blank">GitHub Gist</a> with your Ethereum address pasted into the contents (the file name doesn't matter), copy paste the gists URL into the above input box and fire away! You can track the current pending requests below the input field to see how much you have to wait until your turn comes.</p>
+ {{if .Recaptcha}}<em>The faucet is running invisible reCaptcha protection against bots.</em>{{end}}
</div>
</div>
</div>
@@ -88,10 +92,11 @@
// Global variables to hold the current status of the faucet
var attempt = 0;
var server;
+ var tier = 0;
// Define the function that submits a gist url to the server
var submit = function({{if .Recaptcha}}captcha{{end}}) {
- server.send(JSON.stringify({url: $("#gist")[0].value{{if .Recaptcha}}, captcha: captcha{{end}}}));{{if .Recaptcha}}
+ server.send(JSON.stringify({url: $("#gist")[0].value, tier: tier{{if .Recaptcha}}, captcha: captcha{{end}}}));{{if .Recaptcha}}
grecaptcha.reset();{{end}}
};
// Define a method to reconnect upon server loss