From 241298ea23cfd63946ad43fbe4669d72f03c8c85 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 11 Feb 2010 10:47:20 -0700 Subject: [PATCH] Request #6232: Show alarm notifications in DIMP. --- imp/docs/CHANGES | 1 + imp/js/DimpCore.js | 26 ++++++++++++++++++++------ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/imp/docs/CHANGES b/imp/docs/CHANGES index e84db882f..6b6fde019 100644 --- a/imp/docs/CHANGES +++ b/imp/docs/CHANGES @@ -2,6 +2,7 @@ v5.0-git -------- +[mms] Display alarm notifications in DIMP (Request #6232). [mms] Auto-determine charset for text attachments (Bug #8858). [mms] Remove IE 6 (and below) and Safari 2 (and below) support for DIMP. [mms] Add chance to switch between forward options on compose page when using diff --git a/imp/js/DimpCore.js b/imp/js/DimpCore.js index c6c5be02d..9fdb6e7c5 100644 --- a/imp/js/DimpCore.js +++ b/imp/js/DimpCore.js @@ -12,6 +12,7 @@ var DimpCore = { // Vars used and defaulting to null/false: // DMenu, Growler, inAjaxCallback, is_init, is_logout // onDoActionComplete + alarms: {}, growler_log: true, server_error: 0, @@ -205,28 +206,41 @@ var DimpCore = { } msgs.find(function(m) { - var log = 0; - switch (m.type) { case 'horde.ajaxtimeout': this.logout(m.message); return true; + case 'horde.alarm': + if (!this.alarms[m.alarm.id]) { + this.Growler.growl(m.alarm.title + ': ' + m.alarm.text, { + className: 'horde-alarm', + sticky: 1, + log: 1 + }); + this.alarms[m.alarm.id] = 1; + } + break; + case 'horde.error': case 'horde.message': case 'horde.success': case 'horde.warning': - log = 1; - // Fall through to below case. + this.Growler.growl(m.message, { + className: m.type.replace('.', '-'), + life: (m.type == 'horde.error' ? 12 : 8), + log: 1 + }); + break; case 'imp.reply': case 'imp.forward': case 'imp.redirect': this.Growler.growl(m.message, { className: m.type.replace('.', '-'), - life: (m.type == 'horde.error' ? 12 : 8), - log: log + life: 8 }); + break; } }, this); }, -- 2.11.0