Revision 6768,
1.5 KB
checked in by acoutinho, 12 years ago
(diff) |
Ticket #2951 - Implementacao da funcionalidade de alarms desktop com suporte a eventos
|
-
Property svn:executable set to
*
|
Line | |
---|
1 | Alarms = {
|
---|
2 | load: function(){
|
---|
3 | var eventsDay = DataLayer.get('alarm:schedulable',['=', 'date', Date.today().getTime()]);
|
---|
4 | if(eventsDay)
|
---|
5 | for(var i = 0; i < eventsDay.length; i++){
|
---|
6 | this.addAlarm( eventsDay[i] );
|
---|
7 | }
|
---|
8 | },
|
---|
9 |
|
---|
10 | addAlarm: function( eventDay ){
|
---|
11 | if(!DataLayer.tasks[parseInt(eventDay.sendTime)]){
|
---|
12 | DataLayer.task( parseInt(eventDay.sendTime) , function( timestamp ){
|
---|
13 |
|
---|
14 | if(!activePage && !!parseInt(User.preferences.useDesktopNotification) && desktopNotification.verifyComplement()){
|
---|
15 |
|
---|
16 | desktopNotification.sentNotification(
|
---|
17 | '../expressoCalendar/templates/default/images/navbar.png',
|
---|
18 | 'Você possui um compromisso agendado:',
|
---|
19 | eventDay.event_start + ' ' + eventDay.schedulable.startTime + ' - ' + eventDay.schedulable.summary
|
---|
20 | );
|
---|
21 |
|
---|
22 | /* TODO
|
---|
23 | var onClose = function(){
|
---|
24 | if(window.location.pathname.indexoOf('expressoCalendar') >= 0)
|
---|
25 | window.location = url_host + '/expressoCalendar';
|
---|
26 | };
|
---|
27 | */
|
---|
28 | desktopNotification.showNotification();
|
---|
29 |
|
---|
30 | }else{
|
---|
31 |
|
---|
32 | var path = User.moduleName == 'expressoCalendar' ? '' : '../prototype/modules/calendar/';
|
---|
33 | DataLayer.render(path+'templates/alarm.ejs',{
|
---|
34 | event: eventDay
|
---|
35 | }, function( html ){
|
---|
36 | $.Zebra_Dialog(html , {
|
---|
37 | 'type': 'question',
|
---|
38 | 'overlay_opacity': '0.5',
|
---|
39 | 'buttons': ['Fechar'],
|
---|
40 | 'onClose': function(clicked) {}
|
---|
41 | });
|
---|
42 | });
|
---|
43 | }
|
---|
44 |
|
---|
45 | });
|
---|
46 | }
|
---|
47 | }
|
---|
48 | }
|
---|
49 | Alarms.load(); |
---|
Note: See
TracBrowser
for help on using the repository browser.