Nuke new.js.
authorJan Schneider <jan@horde.org>
Mon, 19 Apr 2010 13:02:57 +0000 (15:02 +0200)
committerJan Schneider <jan@horde.org>
Tue, 20 Apr 2010 08:33:39 +0000 (10:33 +0200)
Update end date when using the date picker too.

kronolith/js/kronolith.js
kronolith/js/new.js [deleted file]
kronolith/lib/Kronolith.php
kronolith/new.php

index 1586e90..bcce5d6 100644 (file)
@@ -4105,6 +4105,15 @@ KronolithCore = {
         Prototype.emptyFunction();
     },
 
+    /**
+     * Handles date selections from a date picker.
+     */
+    datePickerHandler: function(e)
+    {
+        e.element().previous().setValue(e.memo.toString(Kronolith.conf.date_format));
+        this.updateEndTime()
+    },
+
     onDrop: function(e)
     {
         var drop = e.element(),
@@ -5179,3 +5188,4 @@ document.observe('DragDrop2:drag', KronolithCore.onDrag.bindAsEventListener(Kron
 document.observe('DragDrop2:drop', KronolithCore.onDrop.bindAsEventListener(KronolithCore));
 document.observe('DragDrop2:end', KronolithCore.onDragEnd.bindAsEventListener(KronolithCore));
 document.observe('DragDrop2:start', KronolithCore.onDragStart.bindAsEventListener(KronolithCore));
+document.observe('Horde_Calendar:select', KronolithCore.datePickerHandler.bindAsEventListener(KronolithCore));
diff --git a/kronolith/js/new.js b/kronolith/js/new.js
deleted file mode 100644 (file)
index 8a6ae21..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-var KronolithNew = {
-    calendarSelectHandler: function(e)
-    {
-        e.element().previous().setValue(e.memo.toString(Kronolith.conf.date_format));
-    }
-};
-
-document.observe('Horde_Calendar:select', KronolithNew.calendarSelectHandler.bindAsEventListener(KronolithNew));
-
index bfbef64..cd35a08 100644 (file)
@@ -77,7 +77,6 @@ class Kronolith
         Horde::addScriptFile('date/' . $datejs, 'horde');
         Horde::addScriptFile('date/date.js', 'horde');
         Horde::addScriptFile('kronolith.js', 'kronolith');
-        Horde::addScriptFile('new.js', 'kronolith');
         Horde_Ui_JsCalendar::init();
 
         if (isset($GLOBALS['language'])) {
index b5a11a5..3418d2e 100644 (file)
@@ -76,7 +76,6 @@ foreach ($all_calendars as $id => $calendar) {
 }
 
 $title = _("Add a new event");
-Horde::addScriptFile('new.js', 'kronolith');
 Horde::addScriptFile('popup.js', 'horde');
 require KRONOLITH_TEMPLATES . '/common-header.inc';
 require KRONOLITH_TEMPLATES . '/menu.inc';