Advertisement
JoeTortuga

MeetingRoom Screen Slideshow

Mar 1st, 2012
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2.     <head>
  3.         <title>Press F11 to view in a full window</title>
  4.        
  5.         <link rel="stylesheet" href="/mrs/site/styles/screenbase.css" type="text/css" />
  6.         <script type="text/javascript">
  7.             djConfig = {
  8.                 isDebug: false
  9.             };
  10.         </script>
  11.         <script type="text/javascript" src="/js/dojo/dojo.js"></script>
  12.         <script type="text/javascript" src="/js/functions.js"></script>
  13.         <script type="text/javascript">
  14.            
  15.             //loadPanes, which refreshes the screens will be called every reloadTime seconds
  16.             var reloadTime = 60 * 10;
  17.             //reloadTime = 60;
  18.             //doSetup will be called instead of loadPanes(It calls loadPanes) every setupIterations
  19.             var setupIterations = 6;
  20.             var curIteration = 1;
  21.            
  22.             var divs = new Array();
  23.             var divsHTML = new Array();
  24.             var delay = new Array();
  25.             var events = new Array();
  26.             var schedule = new Array(); //currently 30 minutes -- this is in seconds
  27.             var roomID;
  28.             var nextItem = 0;
  29.             var curItem = 0;
  30.            
  31.             //initialize screen
  32.             function init()
  33.             {
  34.                
  35.                 roomID = getGetParam("rid");
  36.                 doSetup();
  37.                 setTimeout("showNextItem()",3000);  //give it 3 seconds to initialize
  38.                 setupClock();
  39.  
  40.             }
  41.            
  42.             //initialize time display, we're only displaying minutes so it'll be off for 15s at most
  43.             function setupClock()
  44.             {
  45.                 var clockSpan = dojo.byId("clock");
  46.                 var d = new Date();
  47.                 var snippet = "";
  48.                 snippet = dojo.date.strftime(d, "%b %d, %Y  %I:%M %p");
  49.                
  50.                
  51.                 clockSpan.innerHTML = snippet;
  52.                
  53.                 setTimeout("setupClock()",15000);
  54.             }
  55.            
  56.             //gather the panes we're going to display
  57.             function doSetup()
  58.             {
  59.                 curIteration = 1;                  
  60.                 //build standard url format for architcture
  61.                 var theURL = buildURL("scrann.setup","rid="+roomID);
  62.                
  63.                 var kw =
  64.                 {
  65.                     mimetype: "text/json",
  66.                     url: theURL,
  67.                     load: function(type, data, evt)
  68.                     {
  69.                         //parse data, and load the various panels we're showing
  70.                         divs = data.screens.names;
  71.                         delay = data.screens.times;
  72.                         events = data.screens.events;
  73.                         schedule = data.schedule;
  74.                         loadPanes();
  75.                     }                  
  76.                 }
  77.                 dojo.io.bind(kw);
  78.             }
  79.                
  80.            
  81.             //grab the room id we're desplaying the schedule for, along with any other
  82.             //get parameters on the url
  83.             function getGetParam(param)
  84.             {
  85.                 var searchString = document.location.search;
  86.                 searchString = searchString.substring(1);
  87.  
  88.                 var nvPairs = searchString.split("&");
  89.  
  90.                 for (i = 0; i < nvPairs.length; i++)
  91.                 {
  92.                      var nvPair = nvPairs[i].split("=");
  93.                      var name = nvPair[0];
  94.                      var value = nvPair[1];
  95.                      if(name == param)
  96.                                 return value;
  97.                 }
  98.                 return "";
  99.             }
  100.            
  101.             //Grab the core panel info with the schedule and current meeting occupants
  102.             function getData(divName,eventName)
  103.             {
  104.                 var theURL = buildURL(eventName,"rid="+roomID);
  105.                 var kw =
  106.                 {
  107.                     mimetype: "text/plain",
  108.                     url: theURL,
  109.                     load: function(type, data, evt)
  110.                     {
  111.                         divsHTML[divName] = data;
  112.                     },
  113.                     error: function(t, e)
  114.                     {
  115.                         dojo.debug("Error!... " + e.message);
  116.                     }
  117.                 };
  118.                 dojo.io.bind(kw);
  119.  
  120.             }
  121.            
  122.             //load the panels and fill in the info. Also switch out the panes based on
  123.             // the db schedule we're passed in  We'll reload this every few minutes, it
  124.             // will normally only change daily, but not always.  adjust above variable
  125.             // "reloadTime" if this is resource intensive.
  126.             function loadPanes()
  127.             {
  128.                 for(i=1; i < divs.length; i++) //yes we're purposefully skipping number 0
  129.                 {
  130.                     getData(divs[i],events[i]);                
  131.                 }
  132.            
  133.                 loadPane("minschedule",buildURL("scrann.schedule","rid="+roomID));
  134.                
  135.                 if(curIteration == setupIterations)
  136.                 {
  137.                     setTimeout("doSetup()",reloadTime * 1000);
  138.                 } else {
  139.                     curIteration++;
  140.                     setTimeout("loadPanes()",reloadTime * 1000);
  141.                 }
  142.             }
  143.            
  144.            
  145.             //Slide to next pane with a simple animation, showing our county logo
  146.             // between frames
  147.             function showNextItem()
  148.             {
  149.                 curItem = schedule[nextItem];
  150.                 hidePane("nonlogo");
  151.                
  152.                 if(curItem == 0)
  153.                     dojo.lfx.html.fadeIn('logo', 500).play()
  154.                 else
  155.                 {
  156.                     dojo.lfx.html.fadeOut('logo', 500).play()
  157.                     setTimeout("showNonLogo(divs[curItem])",500);
  158.        
  159.                 }
  160.                 //schedule this item based on the displaytime/delay of the current pane
  161.                 setTimeout("showNextItem()",delay[curItem] * 1000);
  162.                 nextItem++;
  163.                 if(nextItem >= schedule.length)
  164.                     nextItem = 0;
  165.             }
  166.            
  167.             //load the core pane with the stored html we got from the server
  168.             function showNonLogo(divName)
  169.             {
  170.                 var c = dojo.widget.byId("content");
  171.                 /*var v = dojo.byId(divName);*/
  172.                 c.setContent(divsHTML[divName]);
  173.                 showPane("nonlogo");
  174.             }
  175.  
  176.         </script>
  177.         <script language="JavaScript" type="text/javascript">
  178.             dojo.require("dojo.event.*");
  179.             dojo.require("dojo.io.*");
  180.             dojo.require("dojo.lfx.*");
  181.             dojo.require("dojo.date.format");
  182.             dojo.require("dojo.widget.ContentPane");
  183.             dojo.require("dojo.widget.LayoutContainer");
  184.  
  185.             dojo.addOnLoad(init);
  186.         </script>
  187.     </head>
  188.     <body>
  189.         <div dojoType="ContentPane" class="fullPane" id="logo">
  190.             <div style="color:#0D0;top:0.5in;position:relative;">
  191.                 <h1>Employer name</h1>
  192.                 <h1> Location</h1>
  193.                 <h2>Address</h2>
  194.                 <h2 style="color:white" id="clock"></h2>
  195.                 <div style="color:#0D0;margin-left:20px"><img src="/mrs/site/images/fc_logo.gif"/></div>
  196.             </div>
  197.         </div>
  198.         <div dojoType="ContentPane" id="nonlogo" class="fullPane" style="height:100%">
  199.             <div dojoType="ContentPane" id="content" style="height:70%">
  200.             </div>
  201.             <div dojoType="ContentPane" href="" id="minschedule" style="height:30%margin-left:3%;" cacheContent="false"></div>
  202.         </div>
  203.  
  204.        
  205.     </body>
  206. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement