Ignore:
Timestamp:
07/12/12 14:40:42 (12 years ago)
Author:
acoutinho
Message:

Ticket #2951 - Implementacao da funcionalidade de alarms desktop com suporte a eventos

Location:
sandbox/2.4.2-expresso1/prototype/modules/calendar
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • sandbox/2.4.2-expresso1/prototype/modules/calendar/js/calendar.codecs.js

    r6533 r6768  
    2222            fontColor: "fff", 
    2323            timezone: 'America/Sao_Paulo', 
    24             weekStart: 'SUN' 
     24            weekStart: 'SUN', 
     25            useDesktopNotification: 0 
    2526        }; 
    2627 
  • sandbox/2.4.2-expresso1/prototype/modules/calendar/js/init.js

    r6444 r6768  
    11$(document).ready(function() { 
     2 
    23        //Remove o icone de configuraçõe padrão antigo do expresso 
    34        $('#sideboxdragarea').addClass('hidden'); 
     
    348349        //listEvents(); 
    349350}); 
     351 
     352 
     353function useDesktopNotification(){ 
     354        return !!parseInt(User.preferences.useDesktopNotification); 
     355} 
  • sandbox/2.4.2-expresso1/prototype/modules/calendar/js/load.js

    r6444 r6768  
    9494} 
    9595 
    96 Alarms = { 
    97     load: function(){ 
    98         var eventsDay = DataLayer.get('alarm:schedulable',['=', 'date', Date.today().getTime()]); 
    99         if(eventsDay) 
    100         for(var i = 0; i < eventsDay.length; i++){ 
    101             this.addAlarm( eventsDay[i] ); 
    102         } 
    103     }, 
    104          
    105     addAlarm: function( eventDay ){             
    106         if(!DataLayer.tasks[parseInt(eventDay.sendTime)]){ 
    107             DataLayer.task( parseInt(eventDay.sendTime) , function( timestamp ){ 
    108                 var path = User.moduleName == 'expressoCalendar' ? '' : '../prototype/modules/calendar/'; 
    109                 DataLayer.render(path+'templates/alarm.ejs',{ 
    110                     event: eventDay 
    111                 }, function( html ){                                 
    112                     $.Zebra_Dialog(html , { 
    113                         'type':     'question', 
    114                         'overlay_opacity': '0.5', 
    115                         'buttons':  ['Fechar'], 
    116                         'onClose':  function(clicked) {} 
    117                     }); 
    118                 }); 
    119             }); 
    120         } 
    121     } 
    122 } 
    123  
    12496Calendar.load(); 
    125 Alarms.load(); 
  • sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/index.ejs

    r6525 r6768  
    9292<script type='text/javascript' src='<?= MODULESURL ?>/js/calendar.codecs.js'></script> 
    9393<script type='text/javascript' src='<?= MODULESURL ?>/js/load.js'></script>      
     94<script type='text/javascript' src='<?= MODULESURL ?>/js/calendar.alarms.js'></script>   
    9495 
    9596<script type='text/javascript' src='<?= MODULESURL ?>/js/I18n.js'></script> 
     
    9798<script type="text/javascript" src="<?= MODULESURL ?>/js/init.js"></script> 
    9899<script type="text/javascript" src="<?= MODULESURL ?>/js/drag_area.js"></script> 
     100<script type="text/javascript" src="<?= MODULESURL ?>/js/desktop.notification.js"></script> 
    99101 
    100102</head> 
  • sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/preferences_calendar.ejs

    r5510 r6768  
    7272 
    7373                        <p class="input-group"> 
    74                                 <label for="defaultCalendar">Agenda padrão:</label> 
    75                                 <select name="defaultCalendar" > 
    76                                         <%for(var i = 0; i < data.calendars.length; i++){%> 
    77                                                 <option value="<%=data.calendars[i].id%>"> <%= data.calendars[i].name %></option> 
    78                                         <%}%> 
     74                                <label for="useDesktopNotification">Usar alarme desktop:</label> 
     75                                <select name="useDesktopNotification" > 
     76                                        <option value="1" <%= data.preferences.useDesktopNotification == '1' ? 'selected="selected"' : '' %>>Sim</option> 
     77                                        <option value="0" <%= data.preferences.useDesktopNotification != '1' ? 'selected="selected"' : '' %>>Não</option> 
    7978                                </select> 
    8079                        </p> 
Note: See TracChangeset for help on using the changeset viewer.