-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
67 lines (54 loc) · 2.76 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
function copyToClipboard() {
var copyLink=$('#copyLink').val();
var $temp = $("<input>");
$("body").append($temp);
$temp.val(copyLink).select();
document.execCommand("copy");
$temp.remove();
alert("Copied On clipboard");
}
$(document).ready(function() {
var hashParams = window.location.hash.substr(1).split('=')[1];//.substr(1).split('&'); // substr(1) to remove the `#`
$(".getRefLink").click(function() {
$("#refs").removeAttr("style");
var referred = $("#Account").html();
$("#copyLink").val("https://airdrop.codtokens.com#ref="+referred);
var link=$("#reff").html("<a href='https://airdrop.codtokens.com#ref="+referred+"'>https://airdrop.codtokens.com#ref="+referred+"</a>");
//alert(link);
})
if (hashParams != undefined) {
//alert(hashParams);
//$(".")
$(".claim").click(function(){
var referred = $("#Account").html();
$("#reff").html("<a href='https://airdrop.codtokens.com#ref="+referred+"'>https://airdrop.codtokens.com#ref="+referred+"</a>");
claimRefToken(hashParams);
});
$(".presale").click(function(){
var referred = $("#Account").html();
$("#reff").html("<a href='https://airdrop.codtokens.com#ref="+referred+"'>https://airdrop.codtokens.com#ref="+referred+"</a>");
if (parseFloat($("#ethV").val())>0.003) {
preSaleRef(($("#ethV").val()),hashParams);
} else {
alert("Amount too low");
}
});
} else {
// alert("New Link");
$(".claim").click(function(){
var referred = $("#Account").html();
$("#reff").html("<a href='https://airdrop.codtokens.com#ref="+referred+"'>https://airdrop.codtokens.com#ref="+referred+"</a>");
//alert(referred);
claimToken();
});
$(".presale").click(function(){
var referred = $("#Account").html();
$("#reff").html("<a href='https://airdrop.codtokens.com#ref="+referred+"'>https://airdrop.codtokens.com#ref="+referred+"</a>");
if (parseFloat($("#ethV").val())>0.003) {
preSale(($("#ethV").val()));
} else {
alert("Amount too low");
}
});
}
});