Guest User

Untitled

a guest
Apr 16th, 2020
1,649
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).ready(function() {
  2.    
  3.     if ("junoSubscriptionEmail" in localStorage) {
  4.         console.log(localStorage.junoSubscriptionEmail);
  5.         $('input[name="email"]').val(localStorage.junoSubscriptionEmail);
  6.     }
  7.     $('.ms-title-text-show').click();
  8.     var checkExist = setInterval(function() {
  9.         if ($('#ps__container').length) {
  10.             updateSMSElement();
  11.             clearInterval(checkExist);
  12.         }
  13.     }, 100);
  14.  
  15.     function updateSMSElement() {
  16.         var phoneContainerParent = $('input[name="phone"]').parent().parent();
  17.         var ps__container = $('#ps__container');
  18.         var smsHeadline = "Get 25% Off Next Order of Whitening Refills";
  19.         var smsSubline = "Sign up to the SNOW VIP list and we'll text you a coupon code off your next order";
  20.         //create container div for content
  21.         $('<div id="ps__content"></div>').insertBefore('#ps__footer');
  22.         //move content into content container
  23.         $('#ps__container .ch-checkbox').appendTo($('#ps__content'));
  24.         $('#ps__container .ch-label').appendTo($('#ps__content'));
  25.         //change initial text
  26.         $('#ps__content .ch-label span span').text(smsHeadline)
  27.         //create additional text
  28.         $('<p>' + smsSubline + '</p>').insertAfter($('#ps__content .ch-label'));
  29.         //style div
  30.         $('#ps__content').css({
  31.             'padding': '10px',
  32.             'border': 'solid 1px #e6e6e6',
  33.             'background': '#fafafa'
  34.         });
  35.         //style headline
  36.         $('#ps__content label span.ch-custom-label').css({
  37.             'font-weight': 'bolder',
  38.             'color': '#333333'
  39.         });
  40.         //style subline
  41.         $('#ps__content p').css({
  42.             'line-height': '1.2',
  43.             'font-size': '14px'
  44.         });
  45.         //move container to phone field
  46.         $(phoneContainerParent).after(ps__container);
  47.     }
  48. });
RAW Paste Data