Mon Nov 13 2017
Copied to clipboard! Copy reply
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
 trigger: [{
                command: "writeHTML",
                arguments: [{
                    html: "<!--\n<style>\n        .pushdown {\n            display: table;\n            height: 200px;\n            width: 100%;\n            \n        }\n\n        .pushdown > div {\n            display: table-cell;\n            vertical-align: middle;\n        }\n\n        .pushdown > .pushdown-left {\n            width: 40%;\n            background: url('')  no-repeat #ecc200 right center;\n            background-size: 50%;\n    \n        }\n\n        .pushdown-divider {\n            width: 25px;\n            background: url('') no-repeat #262626;\n            background-size: contain;\n        }\n\n        .pushdown > .pushdown-right {\n            background: url('') #262626;\n            padding-left: 2em;\n            background-size: contain;\n        }\n        .pushdown > .pushdown-right h3 {\n            font-size: 1.5em;\n            color: #fff;\n            margin-top:0;\n        }\n\n        .pushdown > .pushdown-right p {\n            color: #ecc200;\n        }\n\n        .pushdown-actions {\n            position: relative;\n            margin-top: 1em;\n        }\n        .pushdown > .pushdown-right input[type=email] {\n            display: inline-block;\n            padding: 8px;\n            box-sizing: border-box;\n            width: 200px;\n            border: 1px solid transparent;\n        }\n\n        .pushdown > .pushdown-right input[type=submit] {\n            background: transparent;\n            border: 2px solid white;\n            color: white;\n            padding: 8px 20px;\n            display: inline-block;\n            transition: background-color 0.3s, color 0.3s;\n        }\n\n        .pushdown-right input[type=submit]:hover {\n            background-color: #fff;\n            color: #262626\n        }\n\n        .email-error {\n            position: absolute;\n            bottom: -25px;\n            color: red;\n            display: none;\n        }\n\n        @media (max-width: 600px) {\n            .pushdown {\n                height: auto;\n                padding: 0.5em 0.5em 2em 0.5em;\n                box-sizing: border-box;\n                display:  block;\n                background: url('')  #262626;\n                background-size: contain;\n            }\n            .pushdown, .pushdown > div {\n                display:  block;\n                margin: 0 auto;\n            }\n\n            .pushdown > .pushdown-left {\n                width: 100%;               \n\n                \n            }\n            .pushdown > .pushdown-right {\n                padding-left: 0;\n                background: url('') no-repeat;\n                background-position: top right;\n                background-size: 35%;\n            }\n\n            .pushdown > .pushdown-right h3 {\n                width: 50%;\n                padding-top: 20px;\n                line-height:  32px;\n                font-size: 2em;\n            }\n\n            .pushdown > .pushdown-right p {\n                margin-top: 15px;\n                width: 70%;\n                line-height: 25px;\n            }\n            \n            .pushdown-actions {\n                text-align: center;                \n                position: relative;\n            }\n            .pushdown > .pushdown-right input[type=email],\n            .pushdown > .pushdown-right input[type=submit] {\n                display: block;\n                width: 100%;\n                margin: 0 auto;\n                padding: 15px 10px;\n            }\n\n            .pushdown > .pushdown-right input[type=submit] {\n                margin-top: 1em;\n                border-radius: 4px;\n            }            \n        }\n        \n    </style>\n\n    <div class=\"pushdown\">\n        <div class=\"pushdown-left\"></div>\n        <div class=\"pushdown-divider\"></div>\n        <div class=\"pushdown-right\">\n            <h3>Be the first to know</h3>\n            <p>Sign up for a first look at our best Black Friday and Cyber Monday deals.</p>\n\n            <form class=\"pushdown-actions\">\n                <input type=\"email\" placeholder=\"EMAIL ADDRESS\" class=\"pushdown-email\">\n                <input type=\"submit\" value=\"GET ON THE LIST\">\n                <div class=\"email-error\">Email is invalid</div>\n            </form>\n        </div>\n    </div>\n\n    <script>\n        /*\n         * So i started doing it jqueryless, then used jquery\n         * for some dom stuff because we still use jquery everywhere\n         * and they want this launched asap.\n         * ps: rip viserion\n         */\n        isDesktop = (function() {\n            if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) \n            {\n                return false\n            }\n            else\n            {\n                return true\n            }\n        })();\n\n        var qs = document.querySelector.bind(document)\n\n        // Append pushdown to top, then make it visible\n        var $pushdown = $('.pushdown').detach()\n        $('body').prepend($pushdown)\n        $pushdown.slideDown()\n\n        var $form = qs('form.pushdown-actions')\n        $form.addEventListener('submit', function(e) {\n          e.preventDefault()\n          var email = qs('.pushdown-email').value\n\n          if (! validateEmail(email))\n          {\n              showErrorMessage()\n          }\n          else\n          {\n            verify_real_email_pushdown(email, emailAcceptedPushdown, emailRejectedPushdown)\n          }\n        })\n\n        function submitEmailToEC(email)\n        {\n            var defer = jQuery.Deferred()\n            var data = {\n                email : email,\n                //demo_lang : map[demoLang],\n                cis_name : 'GetOnTheList',\n                website: 'US_WEBSITE',\n                //form_type : 'demo',\n                demo_type : isDesktop ? 'Specialoffer_Desktop' : 'Specialoffer_Mobile',\n                form_url : window.location.pathname,\n                newsletter_type : \"Bottom_Landing_GOTL\",\n                cid : _satellite.getVar(\"mostrecentcampaign\")\n            }\n\n            var url = (\\.stg\\.)|(\\.local)/i)>-1 ?'//www.stg' :'//www')\n            + '';\n\n            var request = $.ajax({\n                url: url,\n                type: \"POST\",\n                data: data\n            });\n\n            request.done(function(msg) {\n            if (JSON.parse(msg)[0]['cisFlag']  == 'true') {\n                defer.resolve('success')\n            } else {\n                defer.resolve('fail')\n            }\n            })\n\n            return defer.promise()  \n        }\n\n        function validateEmail(email)\n        {\n            var re = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n            return re.test(email);\n        }\n\n        function showErrorMessage()\n        {\n            qs('.email-error').style.display = 'block'\n        }\n\n        function emailAcceptedPushdown(email)\n        {         \n          $.when( submitEmailToEC(email)).then(\n            // Success\n            function() {\n              $(document).trigger('demo_events_version', {version: 1})\n              $(document).trigger('special_offer')\n              window.setTimeout(function() {\n                window.location.href = '//'\n              },1000)\n              \n            },\n            // Rejected\n            function() {\n              showErrorMessage()\n            }\n          )\n        }\n\n        function emailRejectedPushdown()\n        {\n          showErrorMessage()\n        }\n\n        function verify_real_email_pushdown(email, success_cb, failure_cb)\n        {        \n\n\n          if(window.briteverifyToken)\n          {\n\n            var token = window.briteverifyToken;\n            var url = ''+token+'&email='+email+'&_=';\n\n            var script = document.createElement('script');\n            script.src = url;\n            document.body.appendChild(script);\n\n\n            // if the script url doesn't work (maybe they changed the api)\n            script.onerror = function(e)\n            {\n              // ignore verification and move on\n              success_cb(email);\n            };\n\n            window.briteverify = function(data)\n            {\n              try\n              {\n\n                if(data.status!=='invalid')\n                {\n                  success_cb(email);\n                }\n                else\n                {\n                  failure_cb();\n                }\n                document.body.removeChild(script);\n            }\n            catch(e)\n            {\n              // if error, ignore verification and move on\n              success_cb(email);\n            }\n              delete window.briteverify;\n            }\n          }\n        }\n    </script>\n-->"
                }, {
                    html: "<!--!Fj -->"
                }, {
                    html: "\n<script>\n  \n(!window.location.hostname.match(/espanol/i)) && (function(){\n  // build the rto and insert it invisibly into the document\n  var target = '';\n  \n  var rto = document.createElement('div');\n = 'avventura_rto_container';\n  rto.innerHTML = '<!-- START Catalyst POP OVER PROMO --><div class=\"pop-over\" style=\"display:none\"></div><style>.pop-over { background: url(\"\") no-repeat center; background-size: cover; padding: 23% 6.5% 8.5% 6.5%; text-align: right; position: relative; cursor: pointer; } @media (max-width: 768px) { .pop-over { background: url(\"\") no-repeat center; background-size: contain; padding:0; height: 343px; position: relative; cursor: pointer; } } .pop-over .close-btn { position: absolute; top:1.5em; right:1.5em; width:3vw; padding-bottom: 3vw; background:url(\"\") no-repeat center; background-size: contain; cursor: pointer;} .pop-over a { width: 28.5%; display: inline-block;} .pop-over a img { width: 100%;transition:transform 0.3s;} .pop-over a img:hover {transform:scale(1.03);}</style> <script> window.setTimeout(function(){ $(\".pop-over\").slideDown(); $(\".pop-over .close-btn\").click(function(){$(\".pop-over\").slideUp();}) },2000);</scr'+'ipt><!-- END Catalyst POP OVER PROMO -->';\n  document.body.insertBefore(rto,document.body.firstChild);\n  window.setTimeout(function(){\n    $(\".pop-over\").slideDown();\n    $('.pop-over').on('click', function(){ window.location.href = target; })\n    $('.peter-close-btn').attr('style','width: 10em; height: 10em; background: url(/assets/close_o.png); background-repeat: no-repeat; background-position: right top; width: 15vw; height: 15vh; max-width: 15vw; max-height: 15vh;');\n    $(document).on('click', '.peter-close-btn', function(){ $(\".pop-over\").slideUp(); });\n    document.cookie = \"shownCatalyst=true; expires=Fri, 31 Dec 9999 23:59:59 GMT;\";\n  },1000);\n\n})();\n\n</script>\n"
            scope: {
                URI: {
                    include: [/^\/$|^ $/i]