From: Jan Schneider Date: Wed, 15 Apr 2009 14:10:14 +0000 (+0200) Subject: Create new events from month view. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=36d3f47c15d755f4284e923c15064cfbceeb98ff;p=horde.git Create new events from month view. --- diff --git a/kronolith/js/src/kronolith.js b/kronolith/js/src/kronolith.js index 83d9c18b4..48d9eb584 100644 --- a/kronolith/js/src/kronolith.js +++ b/kronolith/js/src/kronolith.js @@ -372,6 +372,8 @@ KronolithCore = { cell.down('.kronolithDay') .setText(day.getDate()) .writeAttribute('date', dateString); + cell.down('.kronolithAddEvent') + .writeAttribute('date', dateString); cell = cell.next(); day.add(1).day(); } @@ -1165,6 +1167,10 @@ KronolithCore = { this.editEvent(elt.readAttribute('calendar'), elt.readAttribute('eventid')); e.stop(); return; + } else if (elt.hasClassName('kronolithAddEvent')) { + this.editEvent(null, null, elt.readAttribute('date')); + e.stop(); + return; } else if (elt.hasClassName('kronolithEventTag')) { $('kronolithTagACTrigger').kronolithTagger.addNewTagNode(elt.getText()); e.stop(); @@ -1211,7 +1217,7 @@ KronolithCore = { */ }, - editEvent: function(calendar, id) + editEvent: function(calendar, id, date) { RedBox.onDisplay = function() { try { @@ -1228,7 +1234,7 @@ KronolithCore = { RedBox.loading(); this.doAction('GetEvent', { 'cal': calendar, 'id': id }, this._editEvent.bind(this)); } else { - var d = new Date(); + var d = date ? Date.parseExact(date, 'yyyyMMdd') : new Date(); $('kronolithEventId').value = ''; $('kronolithEventCalendar').value = Kronolith.conf.default_calendar; $('kronolithEventDelete').hide(); diff --git a/kronolith/templates/index/month.inc b/kronolith/templates/index/month.inc index 40a31938c..5b655978e 100644 --- a/kronolith/templates/index/month.inc +++ b/kronolith/templates/index/month.inc @@ -14,25 +14,25 @@ -
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/kronolith/themes/screen.css b/kronolith/themes/screen.css index f396643d1..66de3d80a 100644 --- a/kronolith/themes/screen.css +++ b/kronolith/themes/screen.css @@ -1037,18 +1037,6 @@ div.kronolithView div.kronolithViewBody div.kronolithRow div .kronolithCorner { height: auto; border: none; } -div.kronolithView div.kronolithViewBody div.kronolithRow div a.kronolithAdd { - display: inline; - width: 15px; - height: 15px; - line-height: 15px; - padding: 2px; - text-align: center; - background: transparent url("graphics/new_small_fade.png") 3px 5px no-repeat; -} -div.kronolithView div.kronolithViewBody div.kronolithRow div a.kronolithAdd:hover { - background-image: url("graphics/new_small.png"); -} div.kronolithView div.kronolithViewBody div.kronolithRow div.kronolithOtherMonth { background: #f7f7f7; } @@ -1108,16 +1096,17 @@ div.kronolithView div.kronolithViewBody div.kronolithRow div div.kronolithMore a vertical-align: middle; font-weight: bold; } -a.kronolithAdd { +.kronolithAddEvent { display: inline; width: auto; + width: 15px; height: 15px; line-height: 15px; padding: 2px; text-align: center; background: transparent url("graphics/new_small_fade.png") 3px 5px no-repeat; } -a.kronolithAdd:hover { +.kronolithAddEvent:hover { background-image: url("graphics/new_small.png"); } .kronolithOtherMonth {