Advertisement
Guest User

Untitled

a guest
Apr 19th, 2017
1,926
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 15.21 KB | None | 0 0
  1.  
  2. <script language="JavaScript" type="text/javascript">
  3.  
  4. // Copyright (C) 2015 Comcast Cable Communications, LLC
  5. // Contact Us: http://customer.xfinity.com/contact-us/
  6. // Intended use of this message is to display critical and time sensitive notifications to customers.
  7. /*
  8. This program is free software; you can redistribute it and/or
  9. modify it under the terms of the GNU General Public License
  10. as published by the Free Software Foundation; either version 2
  11. of the License, or (at your option) any later version.
  12.  
  13. This program is distributed in the hope that it will be useful,
  14. but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. GNU General Public License for more details.
  17.  
  18. You should have received a copy of the GNU General Public License
  19. along with this program; if not, write to the Free Software
  20. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  21.  
  22. http://www.gnu.org/licenses/old-licenses/lgpl-2.0.en.html
  23.  
  24. */
  25. var _ComcastAlert = (function(){
  26.     return {
  27.         SYS_URL: '/e8f6b078-0f35-11de-85c5-efc5ef23aa1f/aupm/notify.do'
  28.         , dragObj: {zIndex: 999999}
  29.         , browser: null
  30.         , comcastCheck: 1
  31.         , comcastTimer: null
  32.         , xmlhttp: null
  33.  
  34.         , go: function(){
  35.             if(self.location !== top.location) return;
  36.             if(document.body){
  37.                 _ComcastAlert.ComcastBrowserNotice();
  38.                 _ComcastAlert.browser = _ComcastAlert.checkBrowser();
  39.                 _ComcastAlert.getXmlhttp();
  40.                 _ComcastAlert.checkBulletin();
  41.                 return _ComcastAlert;
  42.             }else{
  43.                 setTimeout(_ComcastAlert.go, 200);
  44.             }
  45.         }
  46.  
  47.         , ComcastBrowserNotice: function(){
  48.             var image_url = 'http://bnpsa.g.comcast.net:80/images/mydevicealert/browser/';
  49.             var comcastAlertAnalytics = 'DPE_Group_19_D3_EOL_Speed_Own_All.png';
  50.             var notice_width = '600px';
  51.             var notice_height = '550px';
  52.             var winObj = {
  53.                 image_url: image_url
  54.                 , comcastAlertAnalytics: comcastAlertAnalytics
  55.                 , notice_width: notice_width
  56.                 , notice_height: notice_height
  57.                 , comcastlogo_url: '<img src="' + image_url + 'comcast-logo-115x50.png" height="50" width="115"/>'
  58.                 , xfinitylogo_url: '<img src="' + image_url + 'Xfinity-Logo-White-221x124.png" height="55" width="99"/>'
  59.                 , headertext1: '<b>We&#39;ve increased Internet speeds in your area.</b>'
  60.                 , headertext2:  '<b>Update your modem to start enjoying them.</b>'
  61.                 , textline1: 'We&#39;ve noticed you have an older modem that can&#39;t keep up with faster Internet speeds now available in your area.'
  62.                 , textline2: 'To start enjoying faster Internet, you can:'
  63.                 , textline3: '<b>Buy from a retailer</b>'
  64.                 , textline4: 'Before you make your purchase, visit <a href=\"#\" onClick="document.location.href=\'' + this.SYS_URL + '?dispatch=ackBulletinRedirectSleep&redirectName=dpe_mydeviceinfo_portal\'"><font color=#008EC9>mydeviceinfo.xfinity.com</font></a> to view a list of modems certified on our network.'
  65.                 , textline5: '<b>Lease an XFINITY Gateway</b> (current lease fees would apply)'
  66.                 , textline6: 'Visit <a href=\"#\" onClick="document.location.href=\'' + this.SYS_URL + '?dispatch=ackBulletinRedirectSleep&redirectName=dpe_device_upgrade_portal\'"><font color=#008EC9>xfinity.com/deviceupgrade</font></a> to order a self-install kit or call <font color=#008EC9></br>1-855-242-2876</font>.'
  67.                 , textline7: 'Questions? Find answers at <a href=\"#\" onClick="document.location.href=\'' + this.SYS_URL + '?dispatch=ackBulletinRedirectSleep&redirectName=dpe_trade_up\'"><font color=#008EC9>xfinity.com/tradeup</font></a>.'
  68.                 , textline8: 'Thank you for choosing XFINITY. Ensuring that you get the most from your Internet service is part of our commitment to improving your overall experience.'
  69.                 , textline9: 'Equipment Update'
  70.                 , privacypolicylink: '<a href="http://my.xfinity.com/privacy/" target="_new" style="color: #000000">PRIVACY POLICY</a>'
  71.                 , termslink: '<a href="http://my.xfinity.com/terms/" target="_new" style="color: #000000">TERMS OF SERVICE</a>'
  72.                 , closebulletin: '<a href=\"#\" onClick=\"javascript:_ComcastAlert.close_comcast_alert()\"><img src="' + image_url + 'close_button_78x78.png" height="28" width="28"/></a>'
  73.                 , ackbulletin: '<a href=\"#\" onClick="document.location.href=\'' + this.SYS_URL + '?dispatch=ackBulletinRedirectSleep&redirectName=dpe_trade_up\'"><img src="' + image_url + 'trade_up_now_button_270x90.png" height="40" width="121"/></a>'
  74.                 , analytics: '<img src="' + image_url + encodeURIComponent(comcastAlertAnalytics) + '?' + _ComcastAlert.comcastContentnoCache() + '">'
  75.             };
  76.             this.createWindow(winObj);
  77.         }
  78.  
  79.  
  80.         , createWindow: function(winObj){
  81.             var html = '<style type="text/css">';
  82.             html += '#comcast_content {width: ' + winObj.notice_width + '; height:' + winObj.notice_height + '; background:#ffffff; border: 1px solid #454545; position:absolute; top:150px; left:100px; zoom:1; z-index: 9999999999; opacity:0.99; filter:alpha(opacity=99);}';
  83.             html += '#comcast_content .header {height: 60px; width: ' + winObj.notice_width + '; background-color:#000000; repeat-x; z-index: 99999999;}';
  84.             html += '#comcast_content .content-wrapper {padding-left: 5px; padding-right: 5px; padding-bottom: 5px;}';
  85.             html += '#comcast_content .titletext1 {margin: 30px 20px 20px 30px; color: #303030; text-align: left; padding: 0; font: 22px/24px bold Helvetica, Geneva, sans-serif; font-weight: 200;}';
  86.             html += '#comcast_content .titletext2 {margin: 15px 20px 20px 30px; color: #303030; text-align: left; padding: 0; font: 16px/18px bold Helvetica, Geneva, sans-serif; font-weight: 200;}';
  87.             html += '#comcast_content .textcontent1 {margin: 15px 20px 0 30px; color: #303030; text-align: left; padding: 0; font: 15px/16px Helvetica, Geneva, sans-serif; font-weight: 200; line-height: 1.1;}';
  88.             html += '#comcast_content .textcontent2 {margin: 40px 20px 0 30px; color: #4C4C4C; text-align: left; padding: 0; font: 15px/16px Helvetica, Geneva, sans-serif; font-weight: 200; line-height: 1.2;}';
  89.             html += '#comcast_content .textcontent3 {margin: 10px 20px 0 40px; color: #000000; text-align: left; padding: 0; font: 15px/15px Helvetica, Geneva, sans-serif; font-weight: 200; line-height: 1.0;}';
  90.             html += '#comcast_content .privacystatement {display: inline-block; position:absolute; bottom:5px; left:20px; font: 12px/12px Helvetica, Geneva, sans-serif; font-weight: 200; text-align: bottom; white-space:nowrap;}';
  91.             html += '#comcast_content .privacystatement:link {color:#000000; text-decoration:none;}';
  92.             html += '#comcast_content .privacystatement:visited {color:#000000; text-decoration:none;}';
  93.             html += '#comcast_content .privacystatement:hover {color:#000000; text-decoration:underline;}';
  94.             html += '#comcast_content .termsofservice {display: inline-block; position:absolute; bottom:5px; left:150px; font: 12px/12px Helvetica, Geneva, sans-serif; font-weight: 200; text-align: bottom; white-space:nowrap;}';
  95.             html += '#comcast_content .termsofservice:link {color:#000000; text-decoration:none;}';
  96.             html += '#comcast_content .termsofservice:visited {color:#000000; text-decoration:none;}';
  97.             html += '#comcast_content .termsofservice:hover {color:#000000; text-decoration:underline;}';
  98.             html += '#comcast_content .comcastlogo {display: inline-block; position:absolute; bottom:5px; right:5px; margin: 0 0 0 0; height:50px; width:115px; z-index: 9999999999;}';
  99.             html += '#comcast_content .comcastanalytics {display: inline-block; position:absolute; bottom:3px; right:3px; height: 1px; width: 1px; z-index: -99999; margin: 0 0 0 0;  }';
  100.             html += '#comcast_content .acknowledgebutton {display: inline-block; margin: 15px 20px 0 30px; color: #303030; text-align: left; padding: 0; font: 14px/16px Verdana, Geneva, sans-serif; line-height: 1.2; z-index: 9999999999; }';
  101.             html += '#comcast_content .xfinitylogo {display: inline-block; position:absolute; z-index: 9999999999; left:10px; top:5px; margin: 0 0 0 0; height:62px; width:110px;}';
  102.             html += '#comcast_content .closebn {display: inline-block; position:absolute; z-index: 9999999999; left:555px; top:16px; height:32px; width:32px; margin: 0 0 0 0;}';
  103.             html += '</style>';
  104.             html += '<div class="main-wrapper" id="comcast_content">';
  105.                 html += '<div class="header" onmousedown="javascript:_ComcastAlert.dragStart(event,\'comcast_content\')">';
  106.                 html += '</div>';
  107.                     html += '<div class="content-wrapper">';
  108.                         html += '<p class="xfinitylogo">';
  109.                         html += winObj.xfinitylogo_url;
  110.                         html += '</p>';
  111.                         html += '<p class="closebn">';
  112.                         html += winObj.closebulletin;
  113.                         html += '</p>';
  114.                         html += '<p class="titletext1">';
  115.                         html += winObj.headertext1;
  116.                         html += '</p>';
  117.                         html += '<p class="titletext2">';
  118.                         html += winObj.headertext2;
  119.                         html += '</p>';
  120.                         html += '<p class="textcontent1">';
  121.                         html += winObj.textline1;
  122.                         html += '</p>';
  123.                         html += '<p class="textcontent1">';
  124.                         html += winObj.textline2;
  125.                         html += '</p>';
  126.                         html += '<p class="textcontent3">';
  127.                         html += winObj.textline3;
  128.                         html += '</p>';
  129.                         html += '<p class="textcontent3">';
  130.                         html += winObj.textline4;
  131.                         html += '</p>';
  132.                         html += '<p class="textcontent3">';
  133.                         html += winObj.textline5;
  134.                         html += '</p>';
  135.                         html += '<p class="textcontent3">';
  136.                         html += winObj.textline6;
  137.                         html += '</p>';
  138.                         html += '<p class="textcontent1">';
  139.                         html += winObj.textline7;
  140.                         html += '</p>';
  141.                         html += '<p class="textcontent1">';
  142.                         html += winObj.textline8;
  143.                         html += '</p>';
  144.                         html += '<p class="textcontent2">';
  145.                         html += winObj.textline9;
  146.                         html += '</p>';
  147.                         html += '<p class="privacystatement">';
  148.                         html += winObj.privacypolicylink;
  149.                         html += '</p>';
  150.                         html += '<p class="termsofservice">';
  151.                         html += winObj.termslink;
  152.                         html += '</p>';
  153.                         html += '<p class="comcastlogo">';
  154.                         html += winObj.comcastlogo_url;
  155.                         html += '</p>';
  156.                         html += '<p class="comcastanalytics">';
  157.                         html += winObj.analytics;
  158.                         html += '</p>';
  159.                         html += '</div>';
  160.                     html += '</div>';
  161.             html += '</div>';
  162.             document.body.innerHTML = document.body.innerHTML + html;
  163.         }
  164.  
  165.         // Function to Determine browser and version. Copyright 2001 by Mike Hall.
  166.  
  167.         , checkBrowser: function() {
  168.             var ua, s, i;
  169.             var browser = {
  170.                 isIE: false
  171.                 , isNS: false
  172.                 , version: null
  173.             };
  174.             ua = navigator.userAgent;
  175.             s = "MSIE";
  176.             if ((i = ua.indexOf(s)) >= 1) {
  177.                 browser.isIE = true; browser.version = parseFloat(ua.substr(i + s.length));
  178.             }
  179.             s = "Netscape6/";
  180.             if ((i = ua.indexOf(s)) >= 0) {
  181.                 browser.isNS = true; browser.version = parseFloat(ua.substr(i + s.length));
  182.             }
  183.                 s = "Gecko";
  184.             if ((i = ua.indexOf(s)) >= 0) {
  185.                 browser.isNS = true; browser.version = 6.1;
  186.             }
  187.             return browser;
  188.         }
  189.  
  190.         , dragStart: function(event, id) {
  191.             var browser1 = _ComcastAlert.browser;
  192.             var dragObj = _ComcastAlert.dragObj;
  193.             var el;
  194.             var x, y;
  195.             if (id) dragObj.elNode = document.getElementById(id);
  196.             else {
  197.                 if (browser1.isIE) dragObj.elNode = window.event.srcElement;
  198.                 if (browser1.isNS) dragObj.elNode = event.target;
  199.                 if (dragObj.elNode.nodeType == 3) dragObj.elNode = dragObj.elNode.parentNode;
  200.             }
  201.             if (browser1.isIE) {
  202.                 x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft;
  203.                 y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop;
  204.             }
  205.             if (browser1.isNS) {
  206.                 x = event.clientX + window.scrollX;
  207.                 y = event.clientY + window.scrollY;
  208.             }
  209.             dragObj.cursorStartX = x;
  210.             dragObj.cursorStartY = y;
  211.             dragObj.elStartLeft = parseInt(dragObj.elNode.style.left, 10);
  212.             dragObj.elStartTop  = parseInt(dragObj.elNode.style.top, 10);
  213.             if (isNaN(dragObj.elStartLeft)) dragObj.elStartLeft = 100;
  214.             if (isNaN(dragObj.elStartTop)) dragObj.elStartTop = 50;
  215.             if (browser1.isIE) {
  216.                 document.attachEvent("onmousemove", _ComcastAlert.dragGo);
  217.                 document.attachEvent("onmouseup",  _ComcastAlert.dragStop);
  218.                 window.event.cancelBubble = true;
  219.                 window.event.returnValue = false; }
  220.             if (browser1.isNS) {
  221.                 document.addEventListener("mousemove", _ComcastAlert.dragGo,  true);
  222.                 document.addEventListener("mouseup",  _ComcastAlert.dragStop, true);
  223.                 event.preventDefault();
  224.             }
  225.         }
  226.  
  227.             // End Function
  228.  
  229.  
  230.         , comcastContentnoCache: function() {
  231.                return Math.round(Math.random() * 96151252);
  232.                 }
  233.  
  234.         , dragGo: function(event) {
  235.             var browser1 = _ComcastAlert.browser;
  236.             var dragObj = _ComcastAlert.dragObj;
  237.             var x, y;
  238.             if (browser1.isIE) {
  239.                 x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft;
  240.                 y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop;
  241.             }
  242.             if (browser1.isNS) {
  243.                 x = event.clientX + window.scrollX; y = event.clientY + window.scrollY;
  244.             }
  245.             dragObj.elNode.style.left = (dragObj.elStartLeft + x - dragObj.cursorStartX) + "px";
  246.             dragObj.elNode.style.top = (dragObj.elStartTop + y - dragObj.cursorStartY) + "px";
  247.             if (browser1.isIE) { window.event.cancelBubble = true; window.event.returnValue = false; }
  248.             if (browser1.isNS) event.preventDefault();
  249.         }
  250.  
  251.         , dragStop: function(event) {
  252.             var browser1 = _ComcastAlert.browser;
  253.             if (browser1.isIE) {
  254.                 document.detachEvent("onmousemove", _ComcastAlert.dragGo);
  255.                 document.detachEvent("onmouseup",  _ComcastAlert.dragStop);
  256.             }
  257.             if (browser1.isNS) {
  258.                 document.removeEventListener("mousemove", _ComcastAlert.dragGo,  true);
  259.                 document.removeEventListener("mouseup",  _ComcastAlert.dragStop, true);
  260.             }
  261.         }
  262.  
  263.         , getXmlhttp: function(){
  264.             var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try {  xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) {  xmlhttp = false; } } @end @*/
  265.             if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
  266.                 try {
  267.                     xmlhttp = new XMLHttpRequest();
  268.                 } catch (e) {
  269.                     xmlhttp=false;
  270.                 }
  271.             }
  272.             if (!xmlhttp && window.createRequest) {
  273.                 try {
  274.                     xmlhttp = window.createRequest();
  275.                 } catch (e) {
  276.                     xmlhttp=false;
  277.                 }
  278.             }
  279.             this.xmlhttp = xmlhttp;
  280.         }
  281.  
  282.         , checkBulletin: function(){
  283.             if(_ComcastAlert.comcastCheck==0) { return; }
  284.             var xmlhttp = _ComcastAlert.xmlhttp;
  285.             xmlhttp.open("GET", _ComcastAlert.SYS_URL+'?dispatch=checkBulletin',true);
  286.             xmlhttp.onreadystatechange = function() {
  287.                 if (xmlhttp.readyState == 4) {
  288.                     if(xmlhttp.responseText.indexOf('43a1028c-7d11-11de-b687-1f15c5ad6a13') == -1){
  289.                         document.getElementById('comcast_content').style.display="none";
  290.                         _ComcastAlert.comcastCheck = 0;
  291.                     }
  292.                     _ComcastAlert.comcastTimer = setTimeout("_ComcastAlert.checkBulletin()",5000);
  293.                 };
  294.             };
  295.             xmlhttp.send(null);
  296.         }
  297.  
  298.         , close_comcast_alert: function() {
  299.             document.getElementById('comcast_content').style.display = "none";
  300.             _ComcastAlert.sendAck();
  301.         }
  302.  
  303.  
  304.         , acknowledge: function() {
  305.             _ComcastAlert.sendAck();
  306.             document.getElementById('comcast_content').style.display = "none";
  307.         }
  308.         , sendAck: function(){
  309.             var xmlhttp = _ComcastAlert.xmlhttp;
  310.             xmlhttp.open("GET", _ComcastAlert.SYS_URL+'?dispatch=ackBulletin',true);
  311.             xmlhttp.send(null)
  312.         }
  313.     }
  314. }());
  315.  
  316. _ComcastAlert.go();
  317. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement