footer.php
3.1 KB
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
<footer id="new-footer">
<div id="footer-sidebar" class="secondary clear">
<div id="footer-sidebar2">
<?php
if (is_active_sidebar('footer')) {
dynamic_sidebar('footer');
}
?>
</div>
</div>
<!-- Change cookie name for new banner -->
<script type='text/javascript'>
jQuery( document ).ready(function($) {
if(getCookie('CWL-viewed-COVID-19-current-policy')){
$('#COVID-19-home-info-bar').addClass('hide');
}else{
$('#COVID-19-home-info-bar').removeClass('hide');
setTimeout(function() {
$('#COVID-19-home-info-bar').addClass('expand');
}, 100);
}
$(document).on("click",".closeHomeBanner , .readHomeBanner", function() {
setCookie('viewed-home-COVID-19-current-policy', true, 1);
$('#COVID-19-home-info-bar').addClass('hide');
});
function setCookie(cname, cvalue, exdays) {
var d = new Date();
d.setTime(d.getTime() + (exdays * 60 * 60 * 1000));
var expires = "expires="+d.toUTCString();
var host = window.location.hostname;
var domain_only = host.substr(host.indexOf("."))
if(domain_only == ".ca" || domain_only == ".com" || domain_only == ".test") {
domain_only = "."+window.location.hostname;
}
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/;Domain="+domain_only;
}
function getCookie(c_name) {
var c_value = document.cookie,
c_start = c_value.indexOf(" " + c_name + "=");
if (c_start == -1) c_start = c_value.indexOf(c_name + "=");
if (c_start == -1) {
c_value = null;
} else {
c_start = c_value.indexOf("=", c_start) + 1;
var c_end = c_value.indexOf(";", c_start);
if (c_end == -1) {
c_end = c_value.length;
}
c_value = unescape(c_value.substring(c_start, c_end));
}
return c_value;
}
});
</script>
</footer>
</div><!-- end of content-wrap -->
<div class="modal fade" id="contact-modal" tabindex="-1" role="dialog" aria-labelledby="contact-modalTitle" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h5 class="modal-title" id="contact-modalTitle">Thank you for your request.</h5>
</div>
<div class="modal-body">
</div>
</div>
</div>
</div>
<?php wp_footer() ?>
</body>
</html>