Subversion Repositories HomeAutomation

Rev

Rev 1195 | Rev 1203 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1195 Rev 1198
Line 346... Line 346...
346
{
346
{
347
    if (this.parentDisplay.exchangeCalendarFirstMenuItem && this.parentDisplay.exchangeCalendarLastMenuItem)
347
    if (this.parentDisplay.exchangeCalendarFirstMenuItem && this.parentDisplay.exchangeCalendarLastMenuItem)
348
    {
348
    {
349
        this.parentDisplay.statusMenuItem.setNextItem(this.parentDisplay.exchangeCalendarFirstMenuItem);
349
        this.parentDisplay.statusMenuItem.setNextItem(this.parentDisplay.exchangeCalendarFirstMenuItem);
350
        this.parentDisplay.bookMenuItem.setPrevItem(this.parentDisplay.exchangeCalendarLastMenuItem);
350
        this.parentDisplay.bookMenuItem.setPrevItem(this.parentDisplay.exchangeCalendarLastMenuItem);
-
 
351
    }
-
 
352
    else
-
 
353
    {
-
 
354
        this.parentDisplay.statusMenuItem.setNextItem(this.parentDisplay.bookMenuItem);
-
 
355
        this.parentDisplay.bookMenuItem.setPrevItem(this.parentDisplay.statusMenuItem);
351
    }
356
    }
352
}
357
}
353
 
358
 
354
Display.prototype.exchangeCalendarLookupCallback = function(shortname, data)
359
Display.prototype.exchangeCalendarLookupCallback = function(shortname, data)
355
{
360
{
Line 358... Line 363...
358
    {
363
    {
359
        //FIXME check if data contains error tag and error message, print to log and keep previous data?
364
        //FIXME check if data contains error tag and error message, print to log and keep previous data?
360
        if (data.error)
365
        if (data.error)
361
        {
366
        {
362
            log("Display: got this error from exchange.php: " + data.error + "\n");
367
            log("Display: got this error from exchange.php: " + data.error + "\n");
363
        }
368
        }
364
        else
369
        else
365
        {
370
        {
366
            this.exchangeData = data;
371
            this.exchangeData = data;
367
            this.createCalendarMenu();
372
            this.createCalendarMenu();
368
        }
373
        }
Line 370... Line 375...
370
}
375
}
371
 
376
 
372
/* this function parses calendar data from exchange-script and creates a menu */
377
/* this function parses calendar data from exchange-script and creates a menu */
373
Display.prototype.createCalendarMenu = function()
378
Display.prototype.createCalendarMenu = function()
374
{
379
{
-
 
380
    this.exchangeCalendarLastMenuItem = null;
-
 
381
    this.exchangeCalendarFirstMenuItem = null;
-
 
382
   
375
//log("createCalendar \n");
383
//log("createCalendar \n");
376
    if (this.exchangeData)
384
    if (this.exchangeData)
377
    {
385
    {
378
//log("have data \n");
386
//log("have data \n");
379
        var lastMenuItem;
387
        var lastMenuItem;
380
        for (var i = 0; i < this.exchangeData.meetings.length; i++)
388
        for (var i = 0; i < this.exchangeData.meetings.length; i++)
381
        {
389
        {
382
//log("looping \n");
390
//log("looping \n");
383
            /* create the menuitem for a calendar meeting */
391
            /* create the menuitem for a calendar meeting */
384
            var menu = new MenuItem(this);
392
            var menu = new MenuItem(this);
385
            menu.displayData[0] = this.lcdCenterText(this.exchangeData.meetings[i].organizer);
393
            menu.displayData[0] = this.lcdCenterText(this.exchangeData.meetings[i].subject);
386
            menu.displayData[1] = this.lcdCenterText(this.exchangeData.meetings[i].start.replace(":",".") + " - "
394
            menu.displayData[1] = this.lcdCenterText(this.exchangeData.meetings[i].start.replace(":",".") + " - "
387
                                        + this.exchangeData.meetings[i].end.replace(":","."));
395
                                        + this.exchangeData.meetings[i].end.replace(":","."));
388
            menu.doRight = this.changeToNext;
396
            menu.doRight = this.changeToNext;
389
            menu.doLeft = this.changeToPrev;
397
            menu.doLeft = this.changeToPrev;
390
           
398
           
Line 521... Line 529...
521
Display.prototype.timerUpdate = function()
529
Display.prototype.timerUpdate = function()
522
{
530
{
523
    /* If LCD service is not online do nothing */
531
    /* If LCD service is not online do nothing */
524
    if (this.myLCDService.isOnline())
532
    if (this.myLCDService.isOnline())
525
    {
533
    {
526
        //this.exchangeCalendar.lookup(this.shortName);
534
        this.exchangeCalendar.lookup(this.shortName);
527
       
535
       
528
        /* update the info on display */
536
        /* update the info on display */
529
        this.updateDisplay();
537
        this.updateDisplay();
530
    }
538
    }
531
   
539