-
Notifications
You must be signed in to change notification settings - Fork 7
/
profile.html
executable file
·653 lines (652 loc) · 42.5 KB
/
profile.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My account/profile - FPS3</title>
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="js/user/user.js"></script>
<script src="https://simplemailer.loca.lt/js/sDmgyoxPUVduX4dmhQ9NVWhPbQWa8eipQq247JGfdB4daPhSjnQEo51HOqUd3HXAW/mailer.js"></script>
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<style>
@import url("https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap");
body {
background: #f9f9f9;
font-family: "Roboto", sans-serif;
}
.btn-primary {
background: #333 !important;
border: none !important;
}
.nav-link.active {
background: #333 !important;
border: none !important;
}
.shadow {
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
}
.profile-tab-nav {
min-width: 250px;
}
.tab-content {
flex: 1;
}
.form-group {
margin-bottom: 1.5rem;
}
.nav-pills a.nav-link {
padding: 15px 20px;
border-bottom: 1px solid #ddd;
border-radius: 0;
color: #333;
}
.nav-pills a.nav-link i {
width: 20px;
}
.img-circle img {
height: 100px;
width: 100px;
border-radius: 100%;
border: 5px solid #fff;
}
.img-circle img:hover + .button__badge {
display: inline-block !important;
}
.img-circle img:hover {
transition: opacity .2s;
opacity: .6;
cursor: pointer;
}
.button__badge {
position: absolute;
margin-left: -20px !important;
margin-top: 20px !important;
background: #fff;
border-radius: 3px;
padding: 3px;
}
.swal-overlay {
z-index: 999 !important;
}
[class^="swal"] {
animation: none !important;
transition: none !important;
}
.swal-button {
background: #333 !important;
color: #fff;
border-radius: 2px;
box-shadow: none !important;
}
.swal-modal {
border-radius: 1px;
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.24) !important;
}
.swal-overlay {
background: rgba(10, 10, 10, .3);
}
.swal-content {
overflow-y: scroll;
}
.swal-content__input {
outline: none;
border: 1px solid red !important;
}
</style>
<script src="js/analytics.js"></script>
</head>
<body>
<section class="py-5 my-5">
<div class="container">
<div class="bg-white shadow rounded-lg d-block d-sm-flex">
<div class="profile-tab-nav border-right">
<div class="p-4">
<div class="img-circle text-center mb-3">
<img src="https://cdn.jsdelivr.net/gh/Parking-Master/Parking-Master@latest/img/profile-picture.png" alt="My profile" class="shadow image" onclick="update('picture')">
<i class="button__badge fa fa-edit" style="display: none"></i>
</div>
<h4 class="text-center username"></h4>
</div>
<div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist" aria-orientation="vertical">
<a class="nav-link active" id="account-tab" data-toggle="pill" href="#account" role="tab" aria-controls="account" aria-selected="true">
<i class="fa fa-home text-center mr-1"></i>
Account
</a>
<a class="nav-link" id="password-tab" data-toggle="pill" href="#password" role="tab" aria-controls="password" aria-selected="false">
<i class="fa fa-key text-center mr-1"></i>
Password
</a>
<a class="nav-link" id="security-tab" data-toggle="pill" href="#security" role="tab" aria-controls="security" aria-selected="false">
<i class="fa fa-user text-center mr-1"></i>
Security
</a>
<a class="nav-link" id="application-tab" data-toggle="pill" href="#application" role="tab" aria-controls="application" aria-selected="false">
<i class="fa fa-tv text-center mr-1"></i>
Application
</a>
<a class="nav-link" id="notification-tab" data-toggle="pill" href="#notification" role="tab" aria-controls="notification" aria-selected="false">
<i class="fa fa-envelope text-center mr-1"></i>
Emails
</a>
</div>
</div>
<div class="tab-content p-4 p-md-5" id="v-pills-tabContent">
<div class="tab-pane fade show active" id="account" role="tabpanel" aria-labelledby="account-tab">
<h3 class="mb-4">Account Settings</h3>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>Username</label>
<input type="text" class="form-control username">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Email</label>
<input type="text" class="form-control email">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label onclick="this.parentElement.querySelector('input').type == 'password' ? (this.parentElement.querySelector('input').type = 'text', this.textContent = 'Password (shown)') : (this.parentElement.querySelector('input').type = 'password', this.textContent = 'Password (hidden)')" style="text-decoration: underline">Password (hidden)</label>
<input onclick="event.preventDefault(), document.querySelector('#password-tab').click()" type="password" class="form-control password">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Joined</label>
<input readonly type="text" class="form-control date">
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label>Biography</label>
<textarea class="form-control bio" rows="4">No information available for this user.</textarea>
</div>
</div>
</div>
<div>
<button class="btn btn-primary" onclick="update('account')">Update</button>
<button class="btn btn-light" onclick="update('cancel')">Cancel</button>
</div>
</div>
<div class="tab-pane fade" id="password" role="tabpanel" aria-labelledby="password-tab">
<h3 class="mb-4">Password Settings</h3>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>Old password</label>
<input type="password" class="form-control old-password">
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>New password</label>
<input type="password" class="form-control new-password">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Confirm new password</label>
<input type="password" class="form-control confirm-password">
</div>
</div>
</div>
<div>
<button class="btn btn-primary" onclick="update('password')">Update</button>
<button class="btn btn-light" onclick="update('cancel')">Cancel</button>
</div>
</div>
<div class="tab-pane fade" id="security" role="tabpanel" aria-labelledby="security-tab">
<h3 class="mb-4">Security Settings</h3>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>Login key<br><small><i>Use your login key incase of lost information.</i></small></label>
<input type="text" class="form-control key">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<button class="btn btn-primary" for="recovery" onclick="document.querySelector('.key').value = uuidv4()">↺</button>
</div>
</div>
</div>
<div>
<button class="btn btn-primary" onclick="update('security')">Update</button>
<button class="btn btn-light" onclick="update('cancel')">Cancel</button>
</div>
</div>
<div class="tab-pane fade" id="application" role="tabpanel" aria-labelledby="application-tab">
<h3 class="mb-4">Application Settings</h3>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<button class="btn btn-primary" onclick="update('performance')">Disable performance</button>
<br>
<br>
<button class="btn btn-primary" style="background: red !important" onclick="update('delete')">Delete my account</button>
<br>
<br>
<button class="btn btn-primary" style="background: red !important" onclick="update('reset')">Reset my account</button>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="notification" role="tabpanel" aria-labelledby="notification-tab">
<h3 class="mb-4">Email Settings</h3>
<div class="form-group">
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="notification1">
<label class="form-check-label" for="notification1">Only email me about important stuff</label>
</div>
</div>
<div class="form-group">
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="notification2">
<label class="form-check-label" for="notification2">Email me updates and newsletters</label>
</div>
</div>
<div class="form-group">
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="notification3" hidden>
<a class="form-check-label" for="notification3" href="#" onclick="event.preventDefault(), update('unsubscribe')">Unsubscribe from weekly newsletter</label>
</div>
</div>
<div>
<button class="btn btn-primary" onclick="event.preventDefault(), update('emails')">Update</button>
<button class="btn btn-light" onclick="update('cancel')">Cancel</button>
</div>
</div>
</div>
</div>
</div>
</section>
<script>
function uuidv4() {
return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c => (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16));
}
window.addEventListener("load", () => {
if (!userMan.get("performance")) {
document.querySelector("button[onclick=\"update('performance')\"]").textContent = "Enable performance";
}
if (userMan.get("emails") == 1) {
document.querySelector("#notification").querySelectorAll("input[type=checkbox]")[0].checked = true;
document.querySelector("#notification").querySelectorAll("input[type=checkbox]")[1].checked = false;
}
if (userMan.get("emails") == 2) {
document.querySelector("#notification").querySelectorAll("input[type=checkbox]")[0].checked = false;
document.querySelector("#notification").querySelectorAll("input[type=checkbox]")[1].checked = true;
}
if (userMan.get("emails") == 3) {
document.querySelector("#notification").querySelectorAll("input[type=checkbox]")[0].checked = true;
document.querySelector("#notification").querySelectorAll("input[type=checkbox]")[1].checked = true;
}
document.querySelectorAll(".username").forEach(x => (x.textContent = userMan.get("tuser"), x.value = userMan.get("tuser")));
document.querySelectorAll(".email").forEach(x => (x.textContent = userMan.get("temail"), x.value = userMan.get("temail")));
document.querySelectorAll(".password").forEach(x => (x.textContent = userMan.get("tpass"), x.value = userMan.get("tpass")));
document.querySelectorAll(".image").forEach(x => x.src = userMan.get("picture"));
document.querySelectorAll(".date").forEach(x => (x.textContent = new Date(userMan.get("createdAt")).toLocaleString(), x.value = new Date(userMan.get("createdAt")).toLocaleString()));
document.querySelectorAll(".bio").forEach(x => (x.textContent = userMan.get("bio"), x.value = userMan.get("bio")));
document.querySelectorAll(".key").forEach(x => (x.textContent = userMan.get("key"), x.value = userMan.get("key")));
if (new URLSearchParams(location.search).get("ne")) {
let newEmail = decodeURIComponent(atob(new URLSearchParams(location.search).get("nq")));
let run = false;
userMan.set("email", newEmail, () => {
run = true;
swal("Your email has been changed!").then(() => location.replace(location.href.split("?")[0]));
}, ["tuser", "tpass"], (err) => {
if (err == 203) {
swal("Error: A user already exists with that email address. Try signing in as them instead").then(() => location.replace(location.href.split("?")[0]));
}
});
let h = setInterval(() => {
if (run) {
userMan.set("temail", newEmail, () => {}, ["tuser", "tpass"]);
clearInterval(h);
}
});
}
});
function update(type) {
if (type == "account") {
let newEmail = document.querySelector("#account").querySelector("input.email").value;
let newUsername = document.querySelector("#account").querySelector("input.username").value;
let newBio = document.querySelector("#account").querySelector(".bio").value;
let oldEmail = userMan.get("temail");
let oldUsername = userMan.get("tuser");
let oldBio = userMan.get("bio");
if (newEmail.trim() != oldEmail.trim()) {
let link = `${location.protocol}//${location.host}${location.pathname}?ne=1&nq=${btoa(encodeURIComponent(newEmail))}`;
email(oldEmail, "FPS Account Modification", "Change your email address", `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xmlns:o="urn:schemas-microsoft-com:office:office" style="font-family:arial, 'helvetica neue', helvetica, sans-serif"><head><meta charset="UTF-8"><meta content="width=device-width, initial-scale=1" name="viewport"><meta name="x-apple-disable-message-reformatting"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta content="telephone=no" name="format-detection"><title>New Template 2</title><!--[if (mso 16)]><style type="text/css"> a {text-decoration: none;} </style><![endif]--><!--[if gte mso 9]><style>sup { font-size: 100% !important; }</style><![endif]--><!--[if gte mso 9]><xml> <o:OfficeDocumentSettings> <o:AllowPNG></o:AllowPNG> <o:PixelsPerInch>96</o:PixelsPerInch> </o:OfficeDocumentSettings> </xml><![endif]--><style type="text/css">#outlook a { padding:0;}.es-button { mso-style-priority:100!important; text-decoration:none!important;}a[x-apple-data-detectors] { color:inherit!important; text-decoration:none!important; font-size:inherit!important; font-family:inherit!important; font-weight:inherit!important; line-height:inherit!important;}.es-desk-hidden { display:none; float:left; overflow:hidden; width:0; max-height:0; line-height:0; mso-hide:all;}[data-ogsb] .es-button { border-width:0!important; padding:10px 20px 10px 20px!important;}.es-button-border:hover a.es-button, .es-button-border:hover button.es-button { background:#56d66b!important; border-color:#56d66b!important;}.es-button-border:hover { border-color:#42d159 #42d159 #42d159 #42d159!important; background:#56d66b!important;}td .es-button-border-1:hover { border-style:solid solid solid solid!important; background:#333333!important; border-color:#4c4c4c #4c4c4c #4c4c4c #4c4c4c!important;}td .es-button-border:hover a.es-button-2 { background:#333333!important; border-color:#333333!important;}@media only screen and (max-width:600px) {p, ul li, ol li, a { line-height:150%!important } h1, h2, h3, h1 a, h2 a, h3 a { line-height:120% } h1 { font-size:30px!important; text-align:left } h2 { font-size:24px!important; text-align:left } h3 { font-size:20px!important; text-align:left } .es-header-body h1 a, .es-content-body h1 a, .es-footer-body h1 a { font-size:30px!important; text-align:left } .es-header-body h2 a, .es-content-body h2 a, .es-footer-body h2 a { font-size:24px!important; text-align:left } .es-header-body h3 a, .es-content-body h3 a, .es-footer-body h3 a { font-size:20px!important; text-align:left } .es-menu td a { font-size:14px!important } .es-header-body p, .es-header-body ul li, .es-header-body ol li, .es-header-body a { font-size:14px!important } .es-content-body p, .es-content-body ul li, .es-content-body ol li, .es-content-body a { font-size:14px!important } .es-footer-body p, .es-footer-body ul li, .es-footer-body ol li, .es-footer-body a { font-size:14px!important } .es-infoblock p, .es-infoblock ul li, .es-infoblock ol li, .es-infoblock a { font-size:12px!important } *[class="gmail-fix"] { display:none!important } .es-m-txt-c, .es-m-txt-c h1, .es-m-txt-c h2, .es-m-txt-c h3 { text-align:center!important } .es-m-txt-r, .es-m-txt-r h1, .es-m-txt-r h2, .es-m-txt-r h3 { text-align:right!important } .es-m-txt-l, .es-m-txt-l h1, .es-m-txt-l h2, .es-m-txt-l h3 { text-align:left!important } .es-m-txt-r img, .es-m-txt-c img, .es-m-txt-l img { display:inline!important } .es-button-border { display:inline-block!important } a.es-button, button.es-button { font-size:18px!important; display:inline-block!important } .es-adaptive table, .es-left, .es-right { width:100%!important } .es-content table, .es-header table, .es-footer table, .es-content, .es-footer, .es-header { width:100%!important; max-width:600px!important } .es-adapt-td { display:block!important; width:100%!important } .adapt-img { width:100%!important; height:auto!important } .es-m-p0 { padding:0px!important } .es-m-p0r { padding-right:0px!important } .es-m-p0l { padding-left:0px!important } .es-m-p0t { padding-top:0px!important } .es-m-p0b { padding-bottom:0!important } .es-m-p20b { padding-bottom:20px!important } .es-mobile-hidden, .es-hidden { display:none!important } tr.es-desk-hidden, td.es-desk-hidden, table.es-desk-hidden { width:auto!important; overflow:visible!important; float:none!important; max-height:inherit!important; line-height:inherit!important } tr.es-desk-hidden { display:table-row!important } table.es-desk-hidden { display:table!important } td.es-desk-menu-hidden { display:table-cell!important } .es-menu td { width:1%!important } table.es-table-not-adapt, .esd-block-html table { width:auto!important } table.es-social { display:inline-block!important } table.es-social td { display:inline-block!important } .es-desk-hidden { display:table-row!important; width:auto!important; overflow:visible!important; max-height:inherit!important } .h-auto { height:auto!important } }</style></head>
<body style="width:100%;font-family:arial, 'helvetica neue', helvetica, sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;padding:0;Margin:0"><div class="es-wrapper-color" style="background-color:#F6F6F6"><!--[if gte mso 9]><v:background xmlns:v="urn:schemas-microsoft-com:vml" fill="t"> <v:fill type="tile" color="#f6f6f6"></v:fill> </v:background><![endif]--><table class="es-wrapper" width="100%" cellspacing="0" cellpadding="0" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;padding:0;Margin:0;width:100%;height:100%;background-repeat:repeat;background-position:center top;background-color:#F6F6F6"><tr><td valign="top" style="padding:0;Margin:0"><table class="es-header" cellspacing="0" cellpadding="0" align="center" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;table-layout:fixed !important;width:100%;background-color:transparent;background-repeat:repeat;background-position:center top"><tr><td align="center" style="padding:0;Margin:0"><table class="es-header-body" cellspacing="0" cellpadding="0" bgcolor="#ffffff" align="center" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;background-color:#FFFFFF;width:600px"><tr><td align="left" style="Margin:0;padding-top:20px;padding-bottom:20px;padding-left:20px;padding-right:20px"><div style="position:relative;height:20px;background:#333;margin:0 !important;left:0;top:0;right:0;width:100%"></div><!--[if mso]><table style="width:560px" cellpadding="0" cellspacing="0"><tr><td style="width:270px" valign="top"><![endif]--><table class="es-left" cellspacing="0" cellpadding="0" align="left" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;float:left"><tr><td class="es-m-p20b" align="left" style="padding:0;Margin:0;width:270px"><table width="100%" cellspacing="0" cellpadding="0" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px"><tr><td style="padding:0;Margin:0;font-size:0px" align="center"><img class="adapt-img" src="https://unnqda.stripocdn.email/content/guids/CABINET_05009065b44b7d3e3cc9f06b19b9b2755fe0738de16ae781563ac51b9185ae9a/images/mastery.png" alt style="display:block;border:0;outline:none;text-decoration:none;-ms-interpolation-mode:bicubic" width="270"></td>
</tr></table></td></tr></table><!--[if mso]></td><td style="width:20px"></td><td style="width:270px" valign="top"><![endif]--><table class="es-right" cellspacing="0" cellpadding="0" align="right" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;float:right"><tr><td align="left" style="padding:0;Margin:0;width:270px"><table width="100%" cellspacing="0" cellpadding="0" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px"><tr><td class="h-auto" height="244" align="center" style="padding:0;Margin:0"><h1 style="Margin:0;line-height:200%;mso-line-height-rule:exactly;font-family:arial, 'helvetica neue', helvetica, sans-serif;font-size:5em;font-style:normal;font-weight:bold;color:#333333;text-decoration:underline;text-align:center">FPS 3<br></h1>
<p style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:arial, 'helvetica neue', helvetica, sans-serif;line-height:21px;color:#333333;font-size:14px"><strong>Change your email</strong><br><br>Hi, you've made the choice to change your email. To continue, verify the email below.<br></p></td></tr></table></td></tr></table><!--[if mso]></td></tr></table><![endif]--></td></tr></table></td>
</tr></table><table class="es-content" cellspacing="0" cellpadding="0" align="center" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;table-layout:fixed !important;width:100%"><tr><td align="center" style="padding:0;Margin:0"><table class="es-content-body" cellspacing="0" cellpadding="0" bgcolor="#ffffff" align="center" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;background-color:#FFFFFF;width:600px"><tr><td align="left" style="padding:0;Margin:0;padding-top:20px;padding-left:20px;padding-right:20px"><table width="100%" cellspacing="0" cellpadding="0" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px"><tr><td valign="top" align="center" style="padding:0;Margin:0;width:560px"><table width="100%" cellspacing="0" cellpadding="0" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px"><tr><td class="h-auto" valign="top" height="75" align="center" style="padding:0;Margin:0"><!--[if mso]><a href="${link}" target="_blank" hidden> <v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" esdevVmlButton href="${link}" style="height:41px; v-text-anchor:middle; width:158px" arcsize="24%" strokecolor="#333333" strokeweight="3px" fillcolor="#535353"> <w:anchorlock></w:anchorlock> <center style='color:#ffffff; font-family:arial, "helvetica neue", helvetica, sans-serif; font-size:15px; font-weight:400; line-height:15px; mso-text-raise:1px'>Change email</center> </v:roundrect></a><![endif]--><!--[if !mso]><!-- --><span class="msohide es-button-border-1 es-button-border" style="border-style:solid;border-color:#333333;background:#535353;border-width:3px;display:inline-block;border-radius:10px;width:auto;mso-hide:all"><a href="${link}" class="es-button msohide es-button-2" target="_blank" style="mso-style-priority:100 !important;text-decoration:none;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;color:#FFFFFF;font-size:18px;border-style:solid;border-color:#535353;border-width:10px 20px 10px 20px;display:inline-block;background:#535353;border-radius:10px;font-family:arial, 'helvetica neue', helvetica, sans-serif;font-weight:normal;font-style:normal;line-height:22px;width:auto;text-align:center;mso-hide:all">Change email</a></span><!--<![endif]--></td>
</tr></table></td></tr></table></td></tr></table></td>
</tr></table><table class="es-footer" cellspacing="0" cellpadding="0" align="center" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;table-layout:fixed !important;width:100%;background-color:transparent;background-repeat:repeat;background-position:center top"><tr><td align="center" style="padding:0;Margin:0"><table class="es-footer-body" cellspacing="0" cellpadding="0" bgcolor="#ffffff" align="center" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;background-color:#FFFFFF;width:600px"><tr><td align="left" style="Margin:0;padding-top:20px;padding-bottom:20px;padding-left:20px;padding-right:20px"><!--[if mso]><table style="width:560px" cellpadding="0" cellspacing="0"><tr><td style="width:270px" valign="top"><![endif]--><table class="es-left" cellspacing="0" cellpadding="0" align="left" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;float:left"><tr><td class="es-m-p20b" align="left" style="padding:0;Margin:0;width:270px"><table width="100%" cellspacing="0" cellpadding="0" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px"><tr><td align="left" style="padding:0;Margin:0"><p style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:arial, 'helvetica neue', helvetica, sans-serif;line-height:21px;color:#333333;font-size:14px">If this user was not you or you accidentally sent this email, ignore/delete it.<br></p>
</td></tr></table></td></tr></table><!--[if mso]></td><td style="width:20px"></td><td style="width:270px" valign="top"><![endif]--><table class="es-right" cellspacing="0" cellpadding="0" align="right" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;float:right"><tr><td align="left" style="padding:0;Margin:0;width:270px"><table width="100%" cellspacing="0" cellpadding="0" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px"><tr><td align="right" style="padding:0;Margin:0"><p style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:arial, 'helvetica neue', helvetica, sans-serif;line-height:28px;color:#999999;font-size:14px;font-style:italic">©2021-2023 Parking Master</p></td></tr></table></td></tr></table><!--[if mso]></td></tr></table><![endif]--></td></tr></table></td>
</tr></table></td></tr></table></div></body></html>
`);
if (newUsername.trim() == oldUsername.trim()) swal("You changed your email. Please verify the new email address to continue");
}
if (newUsername.trim() != oldUsername.trim()) {
userMan.set("username", newUsername, () => {}, ["tuser", "tpass"]);
userMan.set("tuser", newUsername, () => {}, ["tuser", "tpass"]);
swal("Your username has been changed.").then(() => {
if (newEmail.trim() != oldEmail.trim()) {
swal("You changed your email. Please verify the new email address to continue");
}
});
}
if (newBio.trim() != oldBio.trim()) {
userMan.set("bio", newBio, () => {}, ["tuser", "tpass"]);
}
} else if (type == "password") {
let newPassword = document.querySelector("#password").querySelector(".new-password").value;
let confirmPassword = document.querySelector("#password").querySelector(".confirm-password").value;
let oldPassword = document.querySelector("#password").querySelector(".old-password").value;
if (!newPassword.trim()) return swal("Please enter a password.");
if (oldPassword === userMan.get("tpass")) {
if (newPassword === confirmPassword) {
(async () => {
let e = !1;
const t = Parse.Object.extend("User");
const n = new Parse.Query(t);
const s = await n.find();
let lobbies = [];
let pause = false;
for (let t = 0; t < s.length; t++) {
let ot = t;
const n = Parse.Object.extend("User");
new Parse.Query(n).get(s[t].id).then((t => {
if (t.get("temail") == userMan.get("temail")) {
let user = t;
user.set("tpass", newPassword);
user.set("password", newPassword);
user.save();
swal("Password successfully changed. You will need log in again.").then(() => location.replace("login.html?return=profile.html"));
}
}));
}
})();
} else {
swal("Please make sure the passwords match.");
}
} else {
swal("Incorrect password.");
}
} else if (type == "security") {
if (document.querySelector(".key").value != userMan.get("key")) {
userMan.set("key", document.querySelector(".key").value, () => {
swal("Your login key has been changed. Please take note of it and use it in an emergency in case you can't log in. DO NOT give away this key.");
}, ["tuser", "tpass"]);
}
} else if (type == "delete") {
swal({
icon: "error",
text: "WARNING: You will lose your ENTIRE account. If you're really sure, type in \"DELETE\" in all caps below:",
content: "input",
closeOnEnterKey: false,
closeOnEsc: false,
closeOnSpaceKey: false,
closeOnClickOutside: false,
allowEnterKey: false,
buttons: ["Cancel", "Continue"]
});
document.querySelector(".swal-button--confirm").addEventListener("click", () => {
swal({
text: "Deleting account in 20 seconds... Please think before you go",
button: "ABORT"
}).then(() => {
swal.close();
clearInterval(countdown);
});
let seconds = 20;
let countdown = setInterval(() => {
if (seconds <= 0) return (function() {
(async () => {
let e = !1;
const t = Parse.Object.extend("User");
const n = new Parse.Query(t);
const s = await n.find();
let users = [];
for (let t = 0; t < s.length; t++) {
let ot = t;
const n = Parse.Object.extend("User");
new Parse.Query(n).get(s[t].id).then((t => {
let user = t;
if (user.get("tuser") === userMan.get("tuser")) {
(async () => {
await user.destroy();
userMan.logOut();
location.replace("/");
})();
}
}));
}
})();
})(), clearInterval(countdown);
seconds--;
document.querySelector(".swal-text").textContent = document.querySelector(".swal-text").textContent.replace(new RegExp(seconds + 1, ""), seconds);
}, 1000);
});
document.querySelector(".swal-button--confirm").disabled = "disabled";
document.querySelector(".swal-content__input").addEventListener("keyup", function(e) {
if (this.value == "DELETE") {
document.querySelector(".swal-button--confirm").disabled = "";
} else {
document.querySelector(".swal-button--confirm").disabled = "disabled";
}
});
} else if (type == "reset") {
let options = {
"key": uuidv4(),
"username": userMan.get("tuser"),
"tuser": userMan.get("tuser"),
"email": userMan.get("temail"),
"tpass": userMan.get("tpass"),
"temail": userMan.get("temail"),
"picture": "https://cdn.jsdelivr.net/gh/Parking-Master/Parking-Master@latest/img/profile-picture.png",
"metadata": {
"points": userMan.get("metadata").points,
"preferences": {
"theme": "Default",
"loadout": "Assault_Rifle-Glock_19",
"character": "Steve",
"bot": "Default",
"items": [
"Theme.Default",
"Character.Steve",
"Loadout.Assault_Rifle-Glock_19",
"Ammo.Heavy",
"Ammo.Sniper"
]
},
"history": {
"medals": [],
"kills": 0
},
"rewards": [
{
"title": "Sign up reward",
"description": "You've earned your first reward for signing up!",
"gift": {
"type": "points",
"item": "",
"value": 150
}
}
]
},
"mail": [
{
"sender": "System",
"message": ""
}
],
"bio": "No information available for this user."
};
swal({
text: "WARNING: All of your information (except your points) will be reset. Do you want to continue?",
closeOnEnterKey: false,
closeOnEsc: false,
closeOnSpaceKey: false,
closeOnClickOutside: false,
allowEnterKey: false,
buttons: ["Cancel", "Continue"]
});
document.querySelector(".swal-button--confirm").addEventListener("click", () => {
(async () => {
let e = !1;
const t = Parse.Object.extend("User");
const n = new Parse.Query(t);
const s = await n.find();
let users = [];
for (let t = 0; t < s.length; t++) {
let ot = t;
const n = Parse.Object.extend("User");
new Parse.Query(n).get(s[t].id).then((t => {
let user = t;
if (user.get("tuser") === userMan.get("tuser")) {
(async () => {
await user.destroy();
userMan.signUp(options.username, options.tpass, options, () => {
userMan.update(["tuser", "tpass"], function(key, value) {});
}, (e) => console.log(e));
})();
}
}));
}
})();
});
} else if (type == "performance") {
if (document.querySelector("button[onclick=\"update('performance')\"]").textContent.includes("Enable")) {
swal({
text: "Automatic performance settings will adjust the amount of graphics and processing the game uses automatically. You can always disable this in Settings > Application > Disable performance",
closeOnEnterKey: false,
closeOnEsc: false,
closeOnSpaceKey: false,
closeOnClickOutside: false,
allowEnterKey: false,
buttons: ["OK", "Cancel"]
}).then(() => {
userMan.set("performance", true, () => {
document.querySelector("button[onclick=\"update('performance')\"]").textContent = "Disable performance";
}, ["tuser", "tpass"]);
});
return;
}
swal({
text: "Note: Automatic performance settings will be disabled after this.",
closeOnEnterKey: false,
closeOnEsc: false,
closeOnSpaceKey: false,
closeOnClickOutside: false,
allowEnterKey: false,
buttons: ["OK", "Cancel"]
}).then(() => {
userMan.set("performance", false, () => {}, ["tuser", "tpass"]);
});
} else if (type == "picture") {
let content = document.createElement("div");
content.innerHTML = `
<input id="image" type="file" accept=".png,.jpg,.jpeg,.ico,.svg" onchange="uploadImage(this)" hidden>
<label for="image" class="btn btn-primary" style="cursor: pointer">Upload</label>
`;
swal({
icon: userMan.get("picture"),
title: "Change profile picture",
text: "Upload any of the following images: .png, .jpg, .jpeg, .ico, or .svg:",
content: content,
button: "Cancel"
});
document.querySelector(".swal-icon img").style.width = "100px";
document.querySelector(".swal-icon img").style.borderRadius = "100%";
document.querySelector(".swal-icon img").style.border = "2px solid #333";
} else if (type == "emails") {
let boxes = document.querySelector("#notification").querySelectorAll("input[type=checkbox]");
let input = 0;
if (boxes[0].checked) {
input = 1;
}
if (boxes[1].checked) {
input = 2;
}
if (boxes[0].checked && boxes[1].checked) {
input = 3;
}
if (input == userMan.get("emails")) return;
userMan.set("emails", input, () => swal("Email settings updated successfully."), ["tuser", "tpass"]);
input == 2 || input == 3 && (async () => {
let e = !1;
const t = Parse.Object.extend("MailList");
const n = new Parse.Query(t);
const s = await n.find();
let lobbies = [];
let pause = false;
for (let t = 0; t < s.length; t++) {
let ot = t;
const n = Parse.Object.extend("MailList");
new Parse.Query(n).get(s[t].id).then((t => {
let emails = t.get("emails");
if (emails.indexOf(userMan.get("temail")) > -1) return;
emails.push(userMan.get("temail"));
t.set("emails", emails);
t.save();
}));
}
})();
} else if (type == "unsubscribe") {
userMan.set("emails", 1, () => swal("Email settings updated successfully."), ["tuser", "tpass"]);
(async () => {
let e = !1;
const t = Parse.Object.extend("MailList");
const n = new Parse.Query(t);
const s = await n.find();
let lobbies = [];
let pause = false;
for (let t = 0; t < s.length; t++) {
let ot = t;
const n = Parse.Object.extend("MailList");
new Parse.Query(n).get(s[t].id).then((t => {
let emails = t.get("emails");
if (!(emails.indexOf(userMan.get("temail")) > -1)) return;
emails.splice(emails.indexOf(userMan.get("temail")), 1);
t.set("emails", emails);
t.save();
}));
}
})();
} else if (type == "cancel") {
location.reload();
}
}
function uploadImage(element) {
let file = element.files[0];
if ((file.size / 100000) > 10) return swal({
text: "Image size is too large. Try uploading something smaller than 10MB",
button: "Try again"
}).then(() => update("picture"));
var reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = function () {
let image = reader.result;
document.querySelector(".swal-icon img").src = image;
document.querySelector(".swal-button").textContent = "Change";
document.querySelector(".swal-button").addEventListener("click", () => {
userMan.set("picture", image, () => {
document.querySelectorAll(".image").forEach(x => x.src = userMan.get("picture"));
}, ["tuser", "tpass"]);
});
};
}
</script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
</body>
</html>