Keep poking away at some phpdoc
authorMichael J. Rubinsky <mrubinsk@horde.org>
Tue, 16 Nov 2010 14:34:08 +0000 (09:34 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Tue, 16 Nov 2010 15:26:42 +0000 (10:26 -0500)
kronolith/js/mobile.js

index e2f1c11..edf8d36 100644 (file)
@@ -17,7 +17,7 @@
     calendars:  [],
     loadedCalendars: [],
     events: [],
-    
+
     /**
      * Perform an Ajax action
      *
         $.post(Kronolith.conf.URI_AJAX + action, params, callback, 'json');
     },
 
+    /**
+     * Load all events between start and end time. Returns short version of
+     * event info.
+     *
+     * @param Date start
+     * @param Date end
+     */
     loadEvents: function(start, end)
     {
         KronolithMobile.loadedCalendars = [];
@@ -47,6 +54,9 @@
         }
     },
 
+    /**
+     * Used as sorting funtion to Array.sort for sorting events by start time
+     */
     sortEvents: function(events)
     {
         return  events.sort(function(a, b) {
     },
 
     /**
-     * Callback for the listEvents AJAX request.
+     * Callback for the listEvents AJAX request. For now, assume we are in
+     * day view, wait for all calendar responses to be received and then build
+     * the event elements in the listview.
+     *
+     * @param object data  The ajax response.
      */
     listEventsCallback: function(data)
     {
@@ -72,6 +86,7 @@
                 });
             });
         }
+
         if (KronolithMobile.loadedCalendars.length == KronolithMobile.calendars.length) {
             var events = KronolithMobile.sortEvents(KronolithMobile.events);
             list = $('<ul>').attr({'data-role': 'listview'});
      *
      * @param string cal    The calendar name returned from the ajax request.
      * @param object event  The event object returned from the ajax request.
+     * @param string id     The event identifier
      */
     buildDayEvent: function(cal, event, id)
     {
         return item.append(a);
     },
 
+    /**
+     * Retrieve a single event from the server.
+     *
+     * @param string cal  The calendar identifier.
+     * @param string id   The event identifier.
+     * @param Date   d    The date the event occurs.
+     */
     loadEvent: function(cal, id, d)
     {
         KronolithMobile.doAction('getEvent',
                                  KronolithMobile.loadEventCallback);
     },
 
+    /**
+     * Callback for loadEvent call.  Assume we are in Event view for now, build
+     * the event view structure and attach to DOM.
+     *
+     * @param object data  The ajax response.
+     */
     loadEventCallback: function(data)
     {
          var event, list, text;
 
         return [start, end];
     },
+
     /**
      * Creates a mini calendar suitable for the navigation calendar and the
      * year view.
         // Next and Prev day links for the day view.
         $('.kronolithDayHeader .kronolithPrevDay').bind('click', KronolithMobile.showPrevDay);
         $('.kronolithDayHeader .kronolithNextDay').bind('click', KronolithMobile.showNextDay);
-        
+
         // Load today's events
         $(".kronolithDayDate").html(KronolithMobile.currentDate.toString(Kronolith.conf.date_format));
         KronolithMobile.loadEvents(KronolithMobile.currentDate, KronolithMobile.currentDate);