G2 templates, question mark and accredible scripts. HackerRank notes.

This commit is contained in:
Norm Rasmussen
2023-06-08 16:53:46 -04:00
parent 20ef5dab44
commit b5a86e1abb
8 changed files with 247 additions and 63 deletions

Binary file not shown.

View File

@ -81,7 +81,7 @@
{% endif %}
{% if training_session.session_url %}
<i class="uk-icon-globe"></i>
<a class="session-link" href="{{ training_session.session_url }}">{{ training_session.session_url }}</a>
<a class="session-link" href="{{ training_session.session_url }}">Join Now</a>
{% endif %}
</p>
</div>
@ -152,8 +152,14 @@
width: 100%;
}
.session-link {
a.session-link,
a.session-link:hover {
display: none;
background-color: #009cbd;
padding: 8px;
color: #fff;
text-decoration: none;
margin-top: 8px;
}
.uk-icon-globe {
@ -176,7 +182,7 @@
button.style.display = "none";
}
function adjustLink() {
/*function adjustLink() {
var buttonText = returnRegisterButtonText()
if (buttonText === "Unregister") {
@ -195,9 +201,9 @@
} else if ($("button[data-test='register-button']").length) {
return $("button[data-test='register-button']").text()
}
}
}*/
function setEventListenerToRegisterOrUnregisterButton() {
/*function setEventListenerToRegisterOrUnregisterButton() {
var buttonText = returnRegisterButtonText()
if (buttonText === "Unregister") {
$("button[data-test='unregister-button']")[0].addEventListener("click", function() {
@ -208,9 +214,9 @@
setTimeout(adjustLink, 500);
})
}
}
}*/
$( document ).ready(function() {
/*$("document").ready(function() {
adjustLink()
setEventListenerToRegisterOrUnregisterButton()
@ -219,5 +225,27 @@
setEventListenerToRegisterOrUnregisterButton()
}, 500);
})
})
})*/
$( window ).on( "load", function() {
if ($(".session-dialog__footer-buttons button").length) {
if ($(".session-dialog__footer-buttons button").attr("data-test") == "unregister-button") {
$(".session-link").css("display", "inline-block")
}
$(".session-dialog__footer-buttons").click(function(e) {
const buttonStatus = $(this).find("button").attr("data-test");
if (buttonStatus == "register-button") {
$(".session-link").css("display", "inline-block")
}
if (buttonStatus == "unregister-button") {
$(".session-link").hide()
}
})
}
});
</script>