forked from rstudio/ai-blog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_subscribe.html
71 lines (61 loc) · 2.34 KB
/
_subscribe.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
<div id="subscribe-caption" style="line-height: 1.2; margin-bottom: 2px;">Enjoy this blog? Get notified of new posts by email:</div>
<script src="https://app-ab02.marketo.com/js/forms2/js/forms2.min.js"></script>
<form class="mtktoBlogEmailForm" id="mktoForm_2224"></form>
<script>
// establish metrics based on where the form is located
var in_sidebar = $('#subscribe-caption').parents('.sidebar-section').length;
if (in_sidebar) {
var form_width = 190;
var base_width = form_width - 23;
var email_width = base_width + 'px';
var label_width = (base_width - 20) + 'px';
var button_width = email_width;
var button_padding = '30px';
var button_margin = '';
var font_size = '12px';
} else {
var form_width = 400;
var base_width = form_width - 23;
var email_width = base_width + 'px';
var label_width = (base_width - 20) + 'px';
var button_width = email_width;
var button_padding = '30px';
var button_margin = '12px';
var font_size = '15px';
}
$('#subscribe-caption')
.css('width', base_width)
.css('font-size', font_size);
MktoForms2.loadForm("https://app-ab02.marketo.com", "709-NXN-706", 2224, function(form) {
// get jquery reference to form
form = $(form.getFormElem().get(0));
$(form).css('width', form_width + 'px');
$(form).find('.mktoOffset').remove();
$(form).find('.mktoGutter').remove();
$(form).find('.mktoEmailField').css('width', email_width);
$(form).find('.mktoLabel').children().attr('style', 'font-weight: 400');
$(form).find('.mktoLabel')
.css('width', label_width)
.css('font-size', font_size);
$(form).find('.mktoButtonRow')
.css('width', button_width)
.css('text-align', 'center');
$(form).find('.mktoButtonWrap').attr('style', '');
$(form).find('.mktoButton')
.css('margin-top', '10px')
.css('padding-left', button_padding)
.css('padding-right', button_padding)
.css('font-size', font_size)
.css('margin-top', button_margin);
});
</script>
Posts also available at <a href="https://www.r-bloggers.com">r-bloggers</a>
<script>
document.addEventListener("DOMContentLoaded", function(){
var menulink = document.querySelector("a[href='#category:R']");
if (menulink) menulink.parentNode.style.display = "None";
for (var e of document.querySelectorAll(".dt-tag")) {
if (e.innerHTML == 'R') e.style.display = "None";
}
});
</script>