All pastes #2057394 Raw Edit

Untitled

public text v1 · immutable
#2057394 ·published 2011-05-12 13:14 UTC
rendered paste body
    <?xml version="1.0" encoding="UTF-16"?>
     
    <html><head>
     
    <meta name="viewport" content="width=320, minimum-scale=1.0, maximum-scale=1.0"/>
     
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
     
    <!--loose-->
     
    <style>
     
    body {
     
            background-color: transparent; 
     
            margin: 0;
     
            padding: 0;
     
            height: 480px;
     
            width: 320px;
     
            }
     
    #main {
     
            height: 360px;
     
            position: absolute;
     
            top: 120px;
     
            width: 320px;
     
            color: white;
     
            text-align: center;
     
            }
     
    #controls {
     
            height: 480px;
     
            position: absolute;
     
            top: 0px;
     
            width: 320px;
     
            color: white;
     
            text-align: center;
     
            background: #000000;
     
            z-index: 2;
     
            }
    #controlRight {
     
            position: absolute;
     
            top: 0px;
     
            right: -1px;
     
            width: 35px;
     
            height: 380px;
     
            z-index: 5;
     
            }
     
    #controlLeft {
     
            position: absolute;
     
            top: 0px;
     
            left: -1px;
     
            width: 35px;
     
            height: 380px;
     
            z-index: 5;
     
            }
     
    #container {
     
            position: absolute;
     
            bottom: 0px;
     
            width: 100%;
     
            }
     
    img.source-image {
     
            margin: 0;
            
            padding: 0;
            
            top: 0px;
            
            height: 480px;
            
            position: absolute;
            
            z-index:-1;
            
            -webkit-transition-property: opacity;
            
            -webkit-transition-duration: 1s;
            
            -webkit-transition-delay: 0.5s;
     
            }
     
    #info, #infoCalendar, #infoNotified {
     
            background: url(imgs/lcd_large.png) repeat-x;
     
            width: 100%;
     
            height: auto;
     
            border-top: 1px solid black;
     
            border-bottom: 1px solid black;
     
            font-family:Helvetica;
     
            font-size:12px;
     
            font-weight:bold;
     
            text-align: center;
     
            text-shadow: 0px 1px 0px black;
     
            color:white;
     
            }
     
    #em1, #em2, #em3, #cal1, #cal2, #cal3, #cal4, #cal5, #cal6 {
     
            font-weight: bold;
     
            margin: 5px;
     
            overflow: hidden;
     
    }
     
    </style>
     
    <script type="text/javascript">
     
            var stockList=new Array("LUV","HRB","FDO");
            
            var stockCounter = 0;
            
            var now=new Date();
     
            var seed=now.getMilliseconds();
     
            var xmlReq = new XMLHttpRequest();
     
            var launchReq = new XMLHttpRequest();
     
            var xmlReqCal = new XMLHttpRequest();
     
            var xmlReqNote = new XMLHttpRequest();
     
            var img1 = new Image();
     
            var img2 = new Image();
            
            var activeImage = 1;
     
            var totfolders = 2;
     
            var unread = 0;
     
            var randfolders=1+Math.floor(Math.random(seed)*totfolders);
     
            if (randfolders > 1) 
     
                    {
     
                    var totpics = 100;
     
                    var randpics=1+Math.floor(Math.random(seed)*totpics);
     
                    img1.src = "imgs/flickr/flickr" + randpics + ".jpg";
     
            }
     
            else 
     
            {
     
                    var randpics = getFile('http://127.0.0.1/cgi-bin/increment.cgi');
     
                    img1.src = "imgs/save/" + randpics + ".jpg";
     
            }
     
            function setLeft(containerName)
            
            {
    var left = 0;
     
    document.getElementById(containerName).style.left = 0;
     
    if (containerName == "background-1")
    {
     
    left = (478 * img1.width / img1.height - 320 ) / (-2);
     
    } else {
     
    left = (478 * img2.width / img2.height - 320 ) / (-2);
     
    }
                    document.getElementById(containerName).style.left = left;
                    //document.getElementById('note').innerHTML= left;
            }
            
            function stocks()
            {
    var currentDate = new Date();
            var H = currentDate.getHours();
                    if ( document.getElementById('controls').style.display == 'block' ) {
                            document.getElementById('controls').style.display='none';
                    } 
                    document.getElementById('infoNotified').style.display='none';
                    document.getElementById('infoCalendar').style.display='none';
                    document.getElementById('info').style.style='none';
                    document.getElementById('background-1').src="http://chart.finance.yahoo.com/z?s="+stockList[stockCounter]+"&t=1d&q=c&l=off&z=l&c=%5EDJI&a=v&p=s&lang=en-US&region=US";
                    document.getElementById('background-1').style.left = -(H-8)*20+110 ;
                    document.getElementById('background-1').style.width = 475 ;
                    stockCounter++;
                    if (stockCounter >= stockList.length){stockCounter=0;};
                    setTimeout("stocks()",1000*10*3);
            }
            function updateSlide()
            
            {
     
    randpics = getFile('http://127.0.0.1/cgi-bin/increment.cgi');
     
    if (activeImage == 1 ) 
                    
                    {
     
    img2 = new Image();
     
    img2.onLoad=setTimeout("setLeft('background-2')",500);
     
    img2.src = "imgs/save/" + randpics + ".jpg";
     
    document.getElementById('background-2').src=img2.src;
     
    document.getElementById('background-1').style.opacity=0;
     
    document.getElementById('background-2').style.opacity=1;
     
    activeImage = 2;
                            
                    } else {
     
    img1 = new Image();
     
    img1.onLoad=setTimeout("setLeft('background-1')",500);
     
    img1.src = "imgs/save/" + randpics + ".jpg";
     
    document.getElementById('background-1').src=img1.src;
     
    document.getElementById('background-2').style.opacity=0;
     
    document.getElementById('background-1').style.opacity=1;
     
    activeImage = 1;
                            
                    }
                    
            } 
     
            function dateFromUTC( dateAsString, ymdDelimiter ) {
     
                    var pattern = new RegExp( "(\\d{4})" + ymdDelimiter + "(\\d{2})" + ymdDelimiter + "(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})Z" );
     
                    var parts = dateAsString.match( pattern );
     
     
     
                    return new Date( Date.UTC(
     
                            parseInt( parts[1] )
     
                            , parseInt( parts[2], 10 ) - 1
     
                            , parseInt( parts[3], 10 )
     
                            , parseInt( parts[4], 10 )
     
                            , parseInt( parts[5], 10 )
     
                            , parseInt( parts[6], 10 )
     
                            , 0
     
                    ));
     
            }
     
            function getFile(url) {
     
                    AJAX=new XMLHttpRequest();
     
                    AJAX.open("GET", url, false);
     
                    AJAX.send(null);
     
                    return AJAX.responseXML.getElementsByTagName("number")[0].firstChild.nodeValue;
     
            }
     
            function getNotified()
     
                    {
     
                    xmlReqNote.onreadystatechange = processNotified;
     
                    xmlReqNote.timeout = 2000;
     
                    xmlReqNote.open("GET", "http://127.0.0.1/cgi-bin/notified.cgi", true);
     
                    xmlReqNote.send();
     
            }
     
            function processNotified()
                    {
                    if (xmlReqNote.readyState != 4) 
                     return;
                    if (xmlReqNote.status != 200 && xmlReqNote.status != 0) 
                     return;
                    var nowTicks=now.getTime() - 360000000
                    dA=dateFromUTC( xmlReqNote.responseXML.getElementsByTagName("date")[0].firstChild.nodeValue, '-');
                    if (nowTicks < dA.getTime())
                            {
                            document.getElementById('note1').innerHTML="&#149 "+xmlReqNote.responseXML.getElementsByTagName("name")[0].firstChild.nodeValue.substr(0,100);
                            document.getElementById('infoNotified').style.display='block';
                            }
                    dB=dateFromUTC( xmlReqNote.responseXML.getElementsByTagName("date")[1].firstChild.nodeValue, '-');
                    if (nowTicks < dB.getTime())
                            {
                            document.getElementById('note2').innerHTML="&#149 "+xmlReqNote.responseXML.getElementsByTagName("name")[1].firstChild.nodeValue.substr(0,100);
                            }
                    dC=dateFromUTC( xmlReqNote.responseXML.getElementsByTagName("date")[2].firstChild.nodeValue, '-');
                    if (nowTicks < dC.getTime())
                            {
                            document.getElementById('note3').innerHTML="&#149 "+xmlReqNote.responseXML.getElementsByTagName("name")[2].firstChild.nodeValue.substr(0,100);
                            }
                    dD=dateFromUTC( xmlReqNote.responseXML.getElementsByTagName("date")[3].firstChild.nodeValue, '-');
                    if (nowTicks < dD.getTime())
                            {
                            document.getElementById('note4').innerHTML="&#149 "+xmlReqNote.responseXML.getElementsByTagName("name")[3].firstChild.nodeValue.substr(0,100);
                            }
                    dE=dateFromUTC( xmlReqNote.responseXML.getElementsByTagName("date")[4].firstChild.nodeValue, '-');
                    if (nowTicks < dE.getTime())
                            {
                            document.getElementById('note5').innerHTML="&#149 "+xmlReqNote.responseXML.getElementsByTagName("name")[4].firstChild.nodeValue.substr(0,100);
                            }
                    dF=dateFromUTC( xmlReqNote.responseXML.getElementsByTagName("date")[5].firstChild.nodeValue, '-');
                    if (nowTicks < dF.getTime())
                            {
                            document.getElementById('note6').innerHTML="&#149 "+xmlReqNote.responseXML.getElementsByTagName("name")[5].firstChild.nodeValue.substr(0,100);
                            }
            }
            function getMail()
     
                    {
     
                    xmlReq.onreadystatechange = processMail;
     
                    xmlReq.timeout = 2000;
     
                    xmlReq.open("GET", "http://127.0.0.1/cgi-bin/mail.cgi", true);
     
                    xmlReq.send();
     
                    }
     
            function processMail() 
     
                    {
     
                    if (xmlReq.readyState != 4) 
     
                    return;
     
                    if (xmlReq.status != 200 && xmlReq.status != 0) 
     
                    return;
     
                    if ( xmlReq.responseXML.getElementsByTagName("name")[0].firstChild.nodeValue ) {
     
                    document.getElementById('em1').innerHTML=xmlReq.responseXML.getElementsByTagName("name")[0].firstChild.nodeValue + " : " + xmlReq.responseXML.getElementsByTagName("title")[0].firstChild.nodeValue
     
                    document.getElementById('info').style.display='block';
     
                    }
     
                    if ( xmlReq.responseXML.getElementsByTagName("name")[1].firstChild.nodeValue ) {
     
                    document.getElementById('em2').innerHTML=xmlReq.responseXML.getElementsByTagName("name")[1].firstChild.nodeValue + " : " + xmlReq.responseXML.getElementsByTagName("title")[1].firstChild.nodeValue
     
                    }
     
                    if ( xmlReq.responseXML.getElementsByTagName("name")[2].firstChild.nodeValue ) {
     
                    document.getElementById('em3').innerHTML=xmlReq.responseXML.getElementsByTagName("name")[2].firstChild.nodeValue + " : " + xmlReq.responseXML.getElementsByTagName("title")[2].firstChild.nodeValue
     
                    }
     
            }
     
     
     
            function getCalendar()
     
                    {
     
                    xmlReqCal.onreadystatechange = processCalendar;
     
                    xmlReqCal.timeout = 2000;
     
                    xmlReqCal.open("GET", "http://127.0.0.1/calendar.xml", true);
     
                    xmlReqCal.send();
     
                    }
     
function processCalendar() {
	if (xmlReqCal.readyState != 4) { return	}
	if (xmlReqCal.status != 200 && xmlReq.status != 0) { return	}
document.getElementById('infoCalendar').style.display='block';
	if (xmlReqCal.responseXML.getElementsByTagName("title")[0].firstChild.nodeValue != "NULL" ) {		
		var myDate1 = new Date( (parseFloat(xmlReqCal.responseXML.getElementsByTagName("title")[0].firstChild.nodeValue)+978292800+14400)*1000);       
		if (now.getDay() == myDate1.getDay()){
			var myDay1="Today "
		} else {
			var myDay1="Tomorrow "
		}
		minutes = myDate1.getMinutes()
		if (minutes < 10){ minutes = "0" + minutes }
		dateText=myDate1.getHours() + ":" + minutes 
		if (dateText == "0:00") {
			dateText = "All Day"
		} else {
			dateText = "at " + dateText
		}
		if (dateText == "All Day" || now.getHours() <= myDate1.getHours() ){
			document.getElementById('infoCalendar').style.display='block';
			document.getElementById('cal1').innerHTML=myDay1 + dateText + " - " + xmlReqCal.responseXML.getElementsByTagName("name")[0].firstChild.nodeValue
		}
	}
	if (xmlReqCal.responseXML.getElementsByTagName("title")[1].firstChild.nodeValue != "NULL" ) {
		var myDate2 = new Date( (parseFloat(xmlReqCal.responseXML.getElementsByTagName("title")[1].firstChild.nodeValue)+978292800+14400)*1000);
		if (now.getDay() == myDate2.getDay()){
			var myDay2="Today "
		} else {
			var myDay2="Tomorrow "
		} 
		minutes = myDate2.getMinutes()
		if (minutes < 10){ minutes = "0" + minutes }
		dateText=myDate2.getHours() + ":" + minutes 
		if (dateText == "0:00") {
			dateText = "All Day"
		} else {
			dateText = "at " + dateText
		}
		if (dateText == "All Day" || now.getHours() <= myDate2.getHours() ){
			document.getElementById('infoCalendar').style.display='block';
			document.getElementById('cal2').innerHTML=myDay2 + dateText + " - " + xmlReqCal.responseXML.getElementsByTagName("name")[1].firstChild.nodeValue
		}
	}
	if (xmlReqCal.responseXML.getElementsByTagName("title")[2].firstChild.nodeValue != "NULL" ) {
		var myDate3 = new Date( (parseFloat(xmlReqCal.responseXML.getElementsByTagName("title")[2].firstChild.nodeValue)+978292800+14400)*1000);
		if (now.getDay() == myDate3.getDay()){
			var myDay3="Today "
		} else {
			var myDay3="Tomorrow "
		} 
		minutes = myDate3.getMinutes()
		if (minutes < 10){ minutes = "0" + minutes }
		dateText=myDate3.getHours() + ":" + minutes 
		if (dateText == "0:00") {
			dateText = "All Day"
		} else {
			dateText = "at " + dateText
		}
		if (dateText == "All Day" || now.getHours() <= myDate3.getHours() ){
			document.getElementById('infoCalendar').style.display='block';
			document.getElementById('cal3').innerHTML=myDay3 + dateText + " - " + xmlReqCal.responseXML.getElementsByTagName("name")[2].firstChild.nodeValue
		}
	}
}
     
            function iconClick(name)
     
                    {
     
                            //document.getElementById('note').innerHTML=name;
     
                            if (name == "Refresh") {
                                    
                                    document.getElementById('infoNotified').style.display='none';
     
                                    document.getElementById('infoCalendar').style.display='none';
     
                                    document.getElementById('info').style.display='none';
                                    
                                    updateSlide();
     
                            }
     
                            if (name == "Controls") {
     
                                    if ( document.getElementById('controls').style.display == 'block' ) {
     
                                            document.getElementById('controls').style.display='none';
     
                                    } else {
     
                                            document.getElementById('controls').style.display='block';
     
                                    }
     
                            }
                            
                            if (name == "stocks") {
                                    stocks()
                            }
                            
                            if (name == "Radar") {
                                    if ( document.getElementById('controls').style.display == 'block' ) {
                                            document.getElementById('controls').style.display='none';
                                    } 
                                    document.getElementById('infoNotified').style.display='none';
                                    document.getElementById('infoCalendar').style.display='none';
                                    document.getElementById('info').style.style='none';
                                    document.getElementById('background-1').src="http://radar.weather.gov/ridge/Conus/Loop/northeast_loop.gif";
                                    document.getElementById('background-1').style.left = 0 ;
                            }
     
                            if (name == "Google") {
     
                                    window.location = "http://www.google.com/m?gl=us&site=images"
     
                                    }
     
                            if (name == "Latitude") {
     
                                    window.location = "http://maps.google.com/maps/m?";
     
                                    }
     
                            if (name == "Flickr") {
     
                                    window.location = "http://m.flickr.com/#/explore/interesting/"
     
                                    }
     
                            if (name == "ScheduledTV") {
     
                                    window.location = "http://assoc.blogsite.org/gbpvr.html"
     
                                    }
     
                            if (name == "Buzz") {
     
                                    window.location = "http://m.google.com/app/buzz?source=mog&hl=us#-buzz:view=following"
     
                                    }
     
                            }
     
            function updateData()
     
                    {
     
                    getCalendar()
     
                    getMail()
     
                    getNotified()
     
            }
     
            function onLoad()
     
                    {
     
    //document.getElementById('background-1').addEventListener('webkitTransitionEnd', function( event ) { slideshow(event); },false);
     
                    getCalendar()
     
                    getMail()
     
                    getNotified()
     
                    setInterval ( updateData(), 100000 );
     
                    if (img1.width < 10)
     
                            {
     
                            document.getElementById('note').innerHTML=randpics
     
                            img1.src = "imgs/save/1.jpg"
     
                    }
                    
                    document.getElementById('background-1').src=img1.src;
                    
                    document.getElementById('background-1').onLoad=setLeft("background-1");
                    
                    // document.getElementById('note').innerHTML= document.getElementById('background-1').style.left + '-' + img1.width + '-' + img1.height;
     
            }
     
            </script>
     
    </head>
     
    <body onload="onLoad()">
     
    <img class="source-image" id="background-1" name="background-1" src="" alt="" style="opacity: 1; z-index: -1;" />
     
    <img class="source-image" id="background-2" name="background-2" src="" alt="" style="opacity: 0; z-index: -2;" />
     
     
    <div id="controls" style="display:none">
     
            <a id="clockBackground"><img id="radarIcon" src="imgs/ClockBackground.png" width="320" height="120" /></a>
     
            <a id="radar" href="javascript:iconClick('Radar');"><img id="radarIcon" src="imgs/radarIcon.png" width="64" height="64"/></a>
     
            <a id="google" href="javascript:iconClick('Google');"><img id="googleIcon" src="imgs/googleIcon.png" width="64" height="64"/></a>
     
            <a id="flickr" href="javascript:iconClick('Flickr');"><img id="flickrIcon" src="imgs/flickrIcon.png" width="64" height="64"/></a>
     
            <a id="ScheduledTV" href="javascript:iconClick('ScheduledTV');"><img id="ScheduledTVIcon" src="imgs/ScheduledTVIcon.png" width="64" height="64"/></a>
     
            <a id="Buzz" href="javascript:iconClick('Buzz');"><img id="BuzzIcon" src="imgs/buzzIcon.png" width="64" height="64"/></a>
            
            <a id="stocks" href="javascript:iconClick('stocks');"><img id="stocksIcon" src="imgs/stocksIcon.png" width="64" height="64"/></a>
    </div>
     
    <div id="main">
     
    <a href="javascript:iconClick('Call');"><img id="CallIcon" src="imgs/call.png" style="display:none" width="32" height="32"/></a>
     
    <a href="javascript:iconClick('Mail');"><img id="MailIcon" src="imgs/mail.png" style="display:none" width="32" height="32"/></a>
     
    <a id="controlRight" href="javascript:iconClick('Refresh');"><img id="controlIcon" src="imgs/control.png" /></a>
     
    <a id="controlLeft" href="javascript:iconClick('Controls');"><img id="controlIcon" src="imgs/control.png" /></a>
     
    <div id="container">
     
    <div><a id="note"></a></div>
     
    <div id="info" style="display:none">
     
    <div id="em1"></div>
     
    <div id="em2"></div>
     
    <div id="em3"></div>
     
    </div>
     
    <div id="infoCalendar" style="display:none">
     
    <div id="cal1"></div>
     
    <div id="cal2"></div>
     
    <div id="cal3"></div>
     
    <div id="cal4"></div>
     
    <div id="cal5"></div>
     
    <div id="cal6"></div>
     
    </div>
     
    <div id="infoNotified" style="display:none">
     
    <div id="note1"></div>
     
    <div id="note2"></div>
     
    <div id="note3"></div>
     
    <div id="note4"></div>
     
    <div id="note5"></div>
     
    <div id="note6"></div>
     
    </div>
     
    </div>
     
    </div>
     
    </body>
     
    </html>