Changeset 5884
- Timestamp:
- 04/05/12 10:43:40 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/prototype/modules/mail/js/followupflag.js
r5880 r5884 244 244 updateCacheFollowupflag(selectedMessageIds, folders, true); 245 245 winElement.dialog("close"); 246 alarmFollowupflaged(); 246 247 }); 247 248 winElement.find('.menu-configure-followupflag .save').button("option", "disabled", true); … … 415 416 * constrói as duas possíveis janela de alerta, utilizando o mesmo template 416 417 */ 417 418 $('#main_table').ready(function(){ 419 var toIterate = [ 420 { 421 attrDeadline: 'doneDeadline', 422 caption: {singular:'You have one undone message today:', plural:"You have %1 undone messages today:"}, 423 onOk: function(event){ 424 if($(event.target).parents('.doneDeadline').find('[name="stopAlert"]').is(':checked')){ 425 $.cookie("fadeCompleted", (new Date).toString("dd/MM/yyyy"), { expires: 1 }); 426 } 427 }, 428 enable: ($.cookie("fadeCompleted") != (new Date).toString("dd/MM/yyyy")) 429 }, 430 { 431 attrDeadline: 'alarmDeadline', 432 caption: {singular:'You have a follow up due for today:', plural:'You have %1 follow ups due for today:'}, 433 onOk: function(event){ 434 if($(event.target).parents('.alarmDeadline').find('[name="stopAlert"]').is(':checked')){ 435 $.cookie("fadeAlarm", (new Date).toString("dd/MM/yyyy"), { expires: 1 }); 436 } 437 }, 438 enable: ($.cookie("fadeAlarm") != (new Date).toString("dd/MM/yyyy")) 439 } 440 ]; 441 var i = 0; 442 while (it = toIterate.pop()){ 443 if (!it.enable) continue; 418 function alarmFollowupflaged(){ 419 $('.followupflag-alarm').remove(); 420 421 var toIterate = [ 422 { 423 attrDeadline: 'doneDeadline', 424 caption: { 425 singular:'You have one undone message today:', 426 plural:"You have %1 undone messages today:" 427 }, 428 onOk: function(event){ 429 if($(event.target).parents('.doneDeadline').find('[name="stopAlert"]').is(':checked')){ 430 $.cookie("fadeCompleted", (new Date).toString("dd/MM/yyyy"), { 431 expires: 1 432 }); 433 } 434 }, 435 enable: ($.cookie("fadeCompleted") != (new Date).toString("dd/MM/yyyy")) 436 }, 437 { 438 attrDeadline: 'alarmDeadline', 439 caption: { 440 singular:'You have a follow up due for today:', 441 plural:'You have %1 follow ups due for today:' 442 }, 443 onOk: function(event){ 444 if($(event.target).parents('.alarmDeadline').find('[name="stopAlert"]').is(':checked')){ 445 $.cookie("fadeAlarm", (new Date).toString("dd/MM/yyyy"), { 446 expires: 1 447 }); 448 } 449 }, 450 enable: ($.cookie("fadeAlarm") != (new Date).toString("dd/MM/yyyy")) 451 } 452 ]; 453 var i = 0; 454 while (it = toIterate.pop()){ 455 if (!it.enable) continue; 444 456 445 457 var alarmInRange = DataLayer.get('followupflagged', {filter: ['AND', ['>', it.attrDeadline, (new Date()).set({hour:0, minute:0, second:0}).toString('yyyy-MM-dd 00:00:00')], ['<', it.attrDeadline, (new Date()).set({hour:0, minute:0, second:0}).addHours(24).toString('yyyy-MM-dd 00:00:00')]], criteria: {deepness: 1}}); … … 461 473 get_lang(it.caption.plural, alarmInRange.length); 462 474 463 var data = {alarmInRange : alarmInRange, caption: caption, it : it}; 464 var dialogText = DataLayer.render("../prototype/modules/mail/templates/followupflag_alarm_list.ejs", data); 475 var data = { 476 alarmInRange : alarmInRange, 477 caption: caption, 478 it : it 479 }; 480 var dialogText = DataLayer.render("../prototype/modules/mail/templates/followupflag_alarm_list.ejs", data); 465 481 466 482 /** 467 483 * A última dialog criada é a dialog mais ao alto 468 484 */ 469 470 471 472 485 var offsetHeight = $('.ZebraDialog.right-bottom:last').length ? 486 $(window).height() - $('.ZebraDialog.right-bottom:last').position().top : 0; 487 488 /** 473 489 * Se for a primeira, desloca para cima do rodapé do grid 474 490 * caso contrário desloca para um pouco acima da última dialog criada 475 491 */ 476 492 offsetHeight = !offsetHeight ? 35 : offsetHeight + 20 ; 477 493 478 479 480 481 482 483 484 494 var dialog = new $.Zebra_Dialog(dialogText, { 495 'buttons': ['Ok'], 496 'modal': false, 497 'vcenter_short_message': false, 498 'position': ['right - 20', 'bottom - ' + offsetHeight.toString() ], 499 'custom_class': 'right-bottom followupflag-alarm '+it.attrDeadline, 500 }).dialog; 485 501 486 502 $(".ZebraDialog.followupflag-alarm .ZebraDialog_Button0").click(it.onOk); 487 503 488 489 490 504 $(".ZebraDialog.followupflag-alarm .display-options .more").click(function(event) { 505 $(event.target).parents('.followupflag-alarm').find('.message-list').css('height', 'auto'); 506 }); 491 507 492 } 493 } 508 } 509 } 510 511 } 512 513 $('#main_table').ready(function(){ 514 alarmFollowupflaged(); 494 515 });
Note: See TracChangeset
for help on using the changeset viewer.