Navigate to month/week/day from year view.
authorJan Schneider <jan@horde.org>
Fri, 5 Jun 2009 14:25:19 +0000 (16:25 +0200)
committerJan Schneider <jan@horde.org>
Fri, 5 Jun 2009 14:25:43 +0000 (16:25 +0200)
kronolith/js/src/kronolith.js
kronolith/templates/index/year.inc
kronolith/themes/screen.css

index ac43b74..c4625f7 100644 (file)
@@ -526,7 +526,8 @@ KronolithCore = {
 
         // Set month name.
         table.down('SPAN')
-            .setText(Date.CultureInfo.monthNames[month]);
+            .setText(Date.CultureInfo.monthNames[month])
+            .writeAttribute('date', year.toPaddedString(4) + (month + 1).toPaddedString(2) + '01');
 
         // Build month table.
         this.buildMinical(tbody, new Date(year, month, 1));
@@ -1584,6 +1585,25 @@ KronolithCore = {
                 e.stop();
                 return;
 
+            case 'kronolithViewYear':
+                var tmp = orig;
+                if (tmp.tagName != 'td') {
+                    tmp.up('td');
+                }
+                if (tmp) {
+                    if (tmp.readAttribute('weekdate') &&
+                        tmp.hasClassName('kronolithMinicalWeek')) {
+                        this.go('week:' + tmp.readAttribute('weekdate'));
+                    } else if (tmp.hasClassName('kronolithMinicalDate')) {
+                        this.go('month:' + tmp.readAttribute('date'));
+                    } else if (tmp.readAttribute('date') &&
+                               !tmp.hasClassName('empty')) {
+                        this.go('day:' + tmp.readAttribute('date'));
+                    }
+                }
+                e.stop();
+                return;
+
             case 'kronolithSearchButton':
                 this.go('search:' + $F('kronolithSearchContext') + ':' + $F('kronolithSearchTerm'))
                 break;
index 42383c1..e70b85b 100644 (file)
@@ -26,7 +26,7 @@
 
 <table id="kronolithYearTemplate" style="display:none" cellspacing="1" cellpadding="0" border="0">
   <caption>
-    <span></span>
+    <span class="kronolithMinicalDate"></span>
   </caption>
   <thead><tr>
     <th class="kronolithMinicalEmpty">&nbsp;</th>
index 46b0cdd..cf6d10c 100644 (file)
@@ -827,7 +827,9 @@ div#kronolithEventTopTags span:hover {
     border-bottom: 1px #000 dotted;
     text-align: left;
 }
-#kronolithMinicalDate {
+.kronolithMinical caption span {
+    overflow: hidden;
+    white-space: nowrap;
     cursor: pointer;
 }
 #kronolithMinicalPrev, #kronolithMinicalNext {