/* DimpCore object. */
var DimpCore = {
// Vars used and defaulting to null/false:
- // DMenu, alertrequest, inAjaxCallback, is_init, is_logout,
+ // DMenu, Growler, inAjaxCallback, is_init, is_logout,
// onDoActionComplete
server_error: 0,
case 'imp.redirect':
case 'dimp.request':
case 'dimp.sticky':
- var iefix, log, tmp,
- alerts = $('hordeAlerts'),
- div = new Element('DIV', { className: m.type.replace('.', '-') }),
+ var log, tmp,
msg = m.message;
- if (!alerts) {
- alerts = new Element('DIV', { id: 'hordeAlerts' });
- $(document.body).insert(alerts);
+ if (!this.Growler) {
+ this.Growler = new Growler({ location: 'br' });
}
if ($w('dimp.request dimp.sticky').indexOf(m.type) == -1) {
msg = msg.unescapeHTML().unescapeHTML();
}
- alerts.insert(div.update(msg));
-
- // IE6 has a bug that does not allow the body of a div to be
- // clicked to trigger an onclick event for that div (it only
- // seems to be an issue if the div is overlaying an element
- // that itself contains an image). However, the alert box
- // normally displays over the message list, and we use several
- // graphics in the default message list layout, so we see this
- // buggy behavior 99% of the time. The workaround is to
- // overlay the div with a like sized div containing a clear
- // gif, which tricks IE into the correct behavior.
- if (DIMP.conf.is_ie6) {
- iefix = new Element('DIV', { id: 'hordeIE6AlertsFix' }).clonePosition(div, { setLeft: false, setTop: false });
- iefix.insert(div.remove());
- alerts.insert(iefix);
- }
-
- if ($w('horde.error dimp.request dimp.sticky').indexOf(m.type) == -1) {
- this.alertsFade.bind(this, div).delay(m.type == 'horde.warning' ? 10 : 3);
- }
- if (m.type == 'dimp.request') {
- this.alertrequest = div;
- }
+ // TODO: dimp.request
+ this.Growler.growl(msg, {
+ className: m.type.replace('.', '-'),
+ life: (m.type == 'horde.error') ? 10 : 5,
+ sticky: true
+// sticky: m.type == 'dimp.sticky'
+ });
if (tmp = $('hordeAlertslog')) {
switch (m.type) {
}, this);
},
- alertsFade: function(elt)
- {
- if (elt) {
- Effect.Fade(elt, { duration: 1.5, afterFinish: this.removeAlert.bind(this) });
- }
- },
-
toggleAlertsLog: function()
{
var alink = $('alertsloglink').down('A'),
var elt = e.element(), id, opts, tmp;
- if (this.alertrequest) {
- this.alertsFade(this.alertrequest);
- this.alertrequest = null;
- }
-
while (Object.isElement(elt)) {
id = elt.readAttribute('id');
this.toggleAlertsLog();
break;
- case 'hordeAlerts':
- this.alertsFade(elt);
- break;
-
case 'largeaddrspan_active':
tmp = elt.down();
[ tmp.down(), tmp.down(1), tmp.next() ].invoke('toggle');
padding-left: 4px;
}
-#hordeAlerts div.dimp-sticky {
- background-color: #ebe20c;
- background-image: url("graphics/warning.png");
- border-color: #807b00;
- color: #000;
-}
-#hordeAlerts div.imp-reply {
- background-image: url("graphics/mail_answered.png");
-}
-#hordeAlerts div.imp-forward, #hordeAlerts div.imp-redirect {
- background-image: url("graphics/mail_forwarded.png");
-}
-
/* Drag and drop styles. */
.drag, .dragdrop {
background: #eee;
background-image: url("graphics/locked.png");
vertical-align: sub;
}
+
+/* Growler notification styles. */
+#Growler div.dimp-sticky {
+ background-color: #ebe20c;
+ background-image: url("graphics/warning.png");
+ border-color: #807b00;
+ color: #000;
+}
+#Growler div.imp-reply {
+ background-image: url("graphics/mail_answered.png");
+}
+#Growler div.imp-forward, div.imp-redirect {
+ background-image: url("graphics/mail_forwarded.png");
+}
-#hordeAlerts div.imp-forward, #hordeAlerts div.imp-redirect {
- background-image: url("graphics/mail_forwarded.png");
-}
-
#sidebarPanel .base {
background-image: url("graphics/folder.png");
}
#attach_list div, span.attachmentImg {
background-image: url("graphics/attachment.png");
}
-#hordeAlerts div.dimp-sticky {
- background-image: url("graphics/warning.png");
-}
.header {
border-left: 1px solid #999;
#ctx_message_unsetflag span.contextImg, #ctx_draft_unsetflag span.contextImg, #oa_unsetflag span.contextImg {
background-image: url("graphics/mail_clearflag.png");
}
-#hordeAlerts div.imp-reply {
- background-image: url("graphics/mail_answered.png");
-}
#ctx_draft_resume span.contextImg {
background-image: url("graphics/mail_draft.png");
}
span.readonlyImg {
background-image: url("graphics/locked.png");
}
+
+#Growler div.dimp-sticky {
+ background-image: url("graphics/warning.png");
+}
+#Growler div.imp-reply {
+ background-image: url("graphics/mail_answered.png");
+}
+#Growler div.imp-forward, #Growler div.imp-redirect {
+ background-image: url("graphics/mail_forwarded.png");
+}