-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsettings.html
131 lines (130 loc) · 5.03 KB
/
settings.html
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<div class="row">
<div class="col-lg-6 text-center">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>Two Factor Authentication</h5>
</div>
<div class="ibox-content">
<div class="btn-group btn-toggle">
<button class="btn btn-lg btn-default switch2fa" id="switch2faon" onclick="setup2fa()">ON</button>
<button class="btn btn-lg btn-danger switch2fa" id="switch2faoff" onclick="setup2fa()">OFF</button>
</div>
</div>
</div>
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>Notification Settings</h5>
</div>
<div class="ibox-content">
<b>Email</b><br>
<span class="checkbox" style="display: inline-block; margin-right: 30px;">
<label><input type="checkbox" id="transactionEmail" style="margin-top: 2px;" onclick="toggleEmailSettings('transaction')">Transaction Notifications</label>
</span>
<span class="checkbox" style="display: inline-block;">
<label><input type="checkbox" id="newsletterEmail" style="margin-top: 2px;" onclick="toggleEmailSettings('newsletter')">Newsletter</label>
</span>
<br><br>
<button class="btn btn-primary" onclick="toggleEmailSettings('globalresubscribe');">I am not receiving emails, check unsubscribe list</button>
</div>
</div>
</div>
<div class="col-lg-6 text-center">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>API Key</h5>
</div>
<div class="ibox-content">
<div class="generalbox">
<h3>API</h3>
<button class="btn btn-primary" onclick="showAPIKey()">Show API Key</button>
<div class="linkbox hide" id="apikey"></div>
<div class="hide" id="additional-api-buttons">
<button class="btn btn-primary" onclick="copyToClipboard('apikey');">Copy To Clipboard</button>
<button class="btn btn-primary" onclick="resetAPIKey();">Reset API Key</button>
</div>
<select class="form-control w300c breakword" id="apilevel" onchange="updateAPILevel()">
<option value="0">0 - Off, no API access, select another option to use API</option>
<option value="1">1 - Read access to check balances, some private data such as siteID's</option>
<option value="2">2 - Write access can make transfers and exports, full control</option>
</select>
<script>$('#apilevel option[value="'+user.apiLevel+'"]').attr("selected", "selected");</script>
<div class="linkbox">For information on the API please visit: <a href="https://developer.jsecoin.com/" target="_blank">https://developer.jsecoin.com/</a></div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12 text-center">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>Account Details</h5>
</div>
<div class="ibox-content">
<p>Full name:</p>
<div class="form-group">
<input type="text" id="newname" class="form-control w300c" placeholder="Full Name">
</div>
<p>E-mail:<br><small>(not possible to change email address)</small></p>
<div class="form-group">
<input type="email" id="newemail" class="form-control w300c" readonly>
</div>
<p>Address:</p>
<div class="form-group">
<textarea class="form-control w300c" id="newaddress" placeholder="Address"></textarea>
</div>
<button class="btn btn-primary" onclick="updateDetails()">Update Details</button>
<hr>
<div><a href="javascript:void(0)" onclick="loadPage('ResetPassword');">Change Password</a></div>
<br>
<div><a href="javascript:void(0)" onclick="deleteAccount();">Delete Account</a></div>
<br>
<h3>Public Key:</h3>
<div class="linkbox" id="publicKeyBox"></div>
</div>
</div>
</div>
</div>
<script>
$('.titletext').html('Settings');
$('#publicKeyBox').html(user.publicKey);
if (user.twoFactorAuth) {
$('#switch2faon').removeClass('btn-default').addClass('btn-primary');
$('#switch2faoff').removeClass('btn-danger').addClass('btn-default');
$('.switch2fa').attr("onclick","remove2fa()");
}
if (user.noNewsletter) {
$('#newsletterEmail').prop('checked', false);
} else {
$('#newsletterEmail').prop('checked', true);
}
if (user.noEmailTransaction) {
$('#transactionEmail').prop('checked', false);
} else {
$('#transactionEmail').prop('checked', true);
}
$('#newname').val(user.name);
$('#newemail').val(user.email);
$('#newaddress').val(user.address);
function deleteAccount() {
if (confirm('Are you sure you want to delete your JSEcoin account?')) {
setTimeout(function() {
if (confirm('Are you sure? All funds held in the account will be lost and this action is not reversible.')) {
var credentials = {};
credentials.session = user.session;
$.ajax({url:jseServer+'/account/delete/',type:'POST',contentType:'application/json',data: JSON.stringify(credentials)}).done(function(data) {
var returnObject = JSON.parse(data);
if (returnObject.fail) {
notify (returnObject.notification);
} else if (returnObject.success) {
notify('Account deleted :(');
setTimout(function() {
document.location.href = 'https://platform.jsecoin.com';
},2000);
}
});
}
}, 1000);
}
}
</script>