-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmember-dashboard.js
34 lines (29 loc) · 1.2 KB
/
member-dashboard.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
$(function () {
var zoomzilla_public_api = 'https://cfzoomzilla.herokuapp.com/public_api/registrant';
var email = localStorage.getItem("cfz_email") || localStorage.getItem("garlic:"+document.location.host+"*>input.email");
var occasion_id = _CFZ.occasion_id || null;
$.ajax(zoomzilla_public_api + '?occasion_id=' + occasion_id + '&email=' + email)
.done(function (data) {
var zoomLink = null;
var allowed = data.allowed;
if (data.error || !allowed) {
console.log(data.error);
zoomLink = "javascript:alert('Looks like there was a problem looking up your Zoom Room. Please contact the help desk.')";
$(document).on('click', '[href="#zoomzilla-link"]', function () {
console.log(zoomLink);
$(this).attr('href', zoomLink).attr('target','_top');
});
return false;
}
if (data.room) {
zoomLink = data.room.link;
} else {
zoomLink = "javascript:alert('It appears you have not yet been assigned a Zoom link. Please contact the help desk.')";
}
if (zoomLink) {
$(document).on('click', '[href="#zoomzilla-link"]', function () {
$(this).attr('href', zoomLink).attr('target','_blank');
});
}
});
});