Set window title on view change.
authorJan Schneider <jan@horde.org>
Mon, 25 May 2009 16:34:38 +0000 (18:34 +0200)
committerJan Schneider <jan@horde.org>
Tue, 26 May 2009 12:52:07 +0000 (14:52 +0200)
kronolith/js/src/kronolith.js
kronolith/templates/index/year.inc

index 8bf9a83..5328167 100644 (file)
@@ -104,6 +104,7 @@ KronolithCore = {
     setTitle: function(title)
     {
         document.title = Kronolith.conf.name + ' :: ' + title;
+        return title;
     },
 
     showNotifications: function(msgs)
@@ -256,7 +257,7 @@ KronolithCore = {
             this.dayEvents = [];
             this.dayGroups = [];
             this.allDayEvents = [];
-            $('kronolithViewDay').down('caption span').setText(date.toString('D'));
+            $('kronolithViewDay').down('caption span').setText(this.setTitle(date.toString('D')));
             break;
 
         case 'week':
@@ -269,7 +270,7 @@ KronolithCore = {
                 dates = this.viewDates(date, view),
                 day = dates[0].clone();
 
-            $('kronolithViewWeek').down('caption span').setText(Kronolith.text.week.interpolate({ week: date.getWeek() }));
+            $('kronolithViewWeek').down('caption span').setText(this.setTitle(Kronolith.text.week.interpolate({ week: date.getWeek() })));
 
             for (var i = 0; i < 7; i++) {
                 div.writeAttribute('id', 'kronolithEventsWeek' + day.dateString());
@@ -287,7 +288,7 @@ KronolithCore = {
                 dates = this.viewDates(date, view),
                 day = dates[0].clone(), row;
 
-            $('kronolithViewMonth').down('caption span').setText(date.toString('MMMM'));
+            $('kronolithViewMonth').down('caption span').setText(this.setTitle(date.toString('MMMM yyyy')));
 
             // Remove old rows. Maybe we should only rebuild the calendars if
             // necessary.
@@ -306,6 +307,10 @@ KronolithCore = {
 
             break;
 
+        case 'year':
+            $('kronolithViewYear').down('caption span').setText(this.setTitle(date.toString('yyyy')));
+            break;
+
         case 'agenda':
             var tbody = $('kronolithViewAgendaBody');
 
@@ -321,7 +326,6 @@ KronolithCore = {
 
             // Build new calendar view.
             tbody.insert(this.createAgendaDay(date, 0).show());
-
             break;
         }
     },
index 134684d..3b76e99 100644 (file)
@@ -1,8 +1,8 @@
 <div id="kronolithViewYear" class="kronolithView kronolithViewYear" style="display:none">
 <table class="kronolithView kronolithViewYear">
   <caption>
-    <div id="kronolithLoadingyear" class="kronolithLoading" style="display:none"></div>
-    <span><?php echo $today->format("Y") ?></span>
+    <div id="kronolithLoadingyear" class="kronolithLoading"></div>
+    <span></span>
     <span class="kronolithNavigation">
       <a class="kronolithGotoToday"><?php echo _("Today") ?></a>
       <a title="<?php echo _("Previous") ?>" class="kronolithPrev">&lt;</a>