From 4959602fecece714a8a9caae50699c97bdba5ddc Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Thu, 21 May 2009 16:19:50 +0200 Subject: [PATCH] Handle new Today links. --- kronolith/js/src/kronolith.js | 14 +++++++++----- kronolith/templates/index/agenda.inc | 2 +- kronolith/templates/index/day.inc | 2 +- kronolith/templates/index/month.inc | 2 +- kronolith/templates/index/week.inc | 2 +- kronolith/templates/index/year.inc | 1 + kronolith/themes/screen.css | 2 +- 7 files changed, 15 insertions(+), 10 deletions(-) diff --git a/kronolith/js/src/kronolith.js b/kronolith/js/src/kronolith.js index 07905d270..a70e6a54e 100644 --- a/kronolith/js/src/kronolith.js +++ b/kronolith/js/src/kronolith.js @@ -1230,11 +1230,6 @@ KronolithCore = { e.stop(); return; - case 'kronolithToday': - this.go(Kronolith.conf.login_view + ':' + new Date().dateString()); - e.stop(); - return; - case 'id_fullday': this.eventForm.select('.edit_at').each(Element.toggle); e.stop(); @@ -1365,6 +1360,15 @@ KronolithCore = { break; } + // Caution, this only works if the element has definitely only a + // single CSS class. + switch (elt.className) { + case 'kronolithGotoToday': + this.go(this.view + ':' + new Date().dateString()); + e.stop(); + return; + } + if (elt.hasClassName('kronolithEvent')) { this.editEvent(elt.readAttribute('calendar'), elt.readAttribute('eventid')); e.stop(); diff --git a/kronolith/templates/index/agenda.inc b/kronolith/templates/index/agenda.inc index 60bbff5e4..b94e12bc3 100644 --- a/kronolith/templates/index/agenda.inc +++ b/kronolith/templates/index/agenda.inc @@ -3,7 +3,7 @@ - " class="kronolithToday"> + " class="kronolithPrev">< " class="kronolithNext">> diff --git a/kronolith/templates/index/day.inc b/kronolith/templates/index/day.inc index 83b43a6a9..c3ee0a77e 100644 --- a/kronolith/templates/index/day.inc +++ b/kronolith/templates/index/day.inc @@ -4,7 +4,7 @@ - "> + "> ">< ">> diff --git a/kronolith/templates/index/month.inc b/kronolith/templates/index/month.inc index b47dcf186..76820a047 100644 --- a/kronolith/templates/index/month.inc +++ b/kronolith/templates/index/month.inc @@ -3,7 +3,7 @@ - "> + "> ">< ">> diff --git a/kronolith/templates/index/week.inc b/kronolith/templates/index/week.inc index ec65298cf..06f4bb2f7 100644 --- a/kronolith/templates/index/week.inc +++ b/kronolith/templates/index/week.inc @@ -12,7 +12,7 @@ - "> + "> ">< ">> diff --git a/kronolith/templates/index/year.inc b/kronolith/templates/index/year.inc index 58e7bbca5..bf8b5d43f 100644 --- a/kronolith/templates/index/year.inc +++ b/kronolith/templates/index/year.inc @@ -3,6 +3,7 @@ format("Y") ?> + " class="kronolithPrev">< " class="kronolithNext">> diff --git a/kronolith/themes/screen.css b/kronolith/themes/screen.css index 053c0d714..65f26ac7f 100644 --- a/kronolith/themes/screen.css +++ b/kronolith/themes/screen.css @@ -980,7 +980,7 @@ div.kronolithView div.kronolithViewBody div.kronolithRow { right: 15px; background-image: url("graphics/left.png"); } -#kronolithBody caption .kronolithToday { +.kronolithGotoToday { position: absolute; right: 35px; } -- 2.11.0