Add growler notification log. Semantics have yet to be worked out.
authorJan Schneider <jan@horde.org>
Tue, 3 Nov 2009 17:29:03 +0000 (18:29 +0100)
committerJan Schneider <jan@horde.org>
Tue, 3 Nov 2009 17:29:03 +0000 (18:29 +0100)
kronolith/js/kronolith.js
kronolith/lib/Kronolith.php
kronolith/templates/index/index.inc

index 78a2d24..ee484f4 100644 (file)
@@ -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
         });
index 54b97b0..c32052e 100644 (file)
@@ -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\"")),
index 69e4687..e26143f 100644 (file)
@@ -4,6 +4,7 @@
 
   <!-- ini user zone -->
   <div id="kronolithUser">
+   <span style="display:none"><a href="#" id="kronolithNotifications" title="<?php echo _("These items need your attention") ?>">2 notifications</a> <span class="kronolithSeparator">&middot;</span></span>
    <a href="#" id="kronolithOptions"><?php echo _("Options") ?></a><?php if ($help_link) echo ' <span class="kronolithSeparator">&middot;</span> ' . $help_link; if ($logout_link) echo ' <span class="kronolithSeparator">|</span> ' . $logout_link ?>
   </div>
   <!-- end user zone -->