From 0e54f8fcfb22414996ddd4d00544edcf8f90690b Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Tue, 3 Nov 2009 18:29:03 +0100 Subject: [PATCH] Add growler notification log. Semantics have yet to be worked out. --- kronolith/js/kronolith.js | 12 +++++++----- kronolith/lib/Kronolith.php | 4 +++- kronolith/templates/index/index.inc | 1 + 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index 78a2d24f4..ee484f4b5 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -27,6 +27,7 @@ KronolithCore = { loading: 0, date: new Date(), taskType: 'all', + growls: 0, doActionOpts: { onException: function(r, e) { KronolithCore.debug('onException', e); }, @@ -130,6 +131,8 @@ KronolithCore = { log: true, sticky: m.type == 'horde.error' }); + $('kronolithNotifications').update(Kronolith.text.alerts.interpolate({ 'count': ++this.growls })); + $('kronolithNotifications').up().show(); } }, this); }, @@ -2068,12 +2071,12 @@ KronolithCore = { this.go('search:' + $F('kronolithSearchContext') + ':' + $F('kronolithSearchTerm')) break; - case 'alertsloglink': - tmp = $('alertsloglink').down('A'); + case 'kronolithNotifications': if (this.Growler.toggleLog()) { - tmp.update(DIMP.text.hidealog); + elt.update(Kronolith.text.hidelog); + this.growls = 0; } else { - tmp.update(DIMP.text.showalog); + elt.up().hide(); } break; } @@ -2390,7 +2393,6 @@ KronolithCore = { /* Add Growler notifications. */ this.Growler = new Growler({ - location: 'br', log: true, noalerts: Kronolith.text.noalerts }); diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index 54b97b0d1..c32052e0d 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -188,7 +188,9 @@ class Kronolith 'ajax_timeout' => _("There has been no contact with the remote server for several minutes. The server may be temporarily unavailable or network problems may be interrupting your session. You will not see any updates until the connection is restored."), 'ajax_recover' => _("The connection to the remote server has been restored."), 'alarm' => _("Alarm:"), - 'noalerts' => _("No Alerts"), + 'noalerts' => _("No Notifications"), + 'alerts' => str_replace('%d', '#{count}', _("%d notifications")), + 'hidelog' => _("Hide Notifications"), 'week' => str_replace('%d', '#{week}', _("Week %d")), 'agenda' => _("Agenda"), 'searching' => str_replace('%s', '#{term}', _("Events matching \"%s\"")), diff --git a/kronolith/templates/index/index.inc b/kronolith/templates/index/index.inc index 69e4687a6..e26143f57 100644 --- a/kronolith/templates/index/index.inc +++ b/kronolith/templates/index/index.inc @@ -4,6 +4,7 @@
+ ">2 notifications · · ' . $help_link; if ($logout_link) echo ' | ' . $logout_link ?>
-- 2.11.0