Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- (function() {
- var cookieEmailName = '__subscribedus';
- var form = document.querySelector('.' + self.identifier + ' [tabindex] form');
- form.setAttribute('bi-type', 'adoric-form');
- form.setAttribute('bi-id', self.campaignTitle);
- function writeCookie(key, value, expires) {
- var now = new Date();
- var time = now.getTime();
- time += 3600 * 1000 * 12;
- now.setTime(time);
- var cookieString = key + '=' + value + '; expires=' + now.toUTCString() + '; path=/';
- if (expires) {
- cookieString += cookieString + '; expires=' + now.toUTCString() + '; path=/';
- } else {
- cookieString += cookieString + '; expires=Fri, 31 Dec 9999 23:59:59 GMT"; path=/';
- }
- window.document.cookie = cookieString;
- return value;
- };
- function utf8_to_b64(str) {
- return window.btoa(unescape(encodeURIComponent(str)));
- }
- form.addEventListener('submit', function() {
- var emailField = form.querySelector('INPUT[name*="mail"]');
- if (emailField) {
- writeCookie(cookieEmailName, utf8_to_b64(emailField.value));
- }
- });
- })();
- </script>
Add Comment
Please, Sign In to add comment