add text to display when no events are present.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 13 Nov 2010 19:50:04 +0000 (14:50 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 13 Nov 2010 19:50:04 +0000 (14:50 -0500)
If too many mobile specific items start appearing, maybe
add a mobile specific includeJSVars() method.

kronolith/js/kronolithmobile.js
kronolith/lib/Kronolith.php

index 89d59b3..7c58d03 100644 (file)
@@ -20,6 +20,7 @@
         data = data.response;
         $("#daycontent ul").detach();
         $("#todayheader").html(KronolithMobile.currentDate.toString(Kronolith.conf.date_format));
+
         var list = $('<ul>').attr({ 'data-role': 'listview' });
         var type = data.cal.split('|')[0], cal = data.cal.split('|')[1];
         if (data.events) {
                     list.append(item.append(a));
                 });
             });
-            list.listview();
-            $("#daycontent").append(list);
+        } else {
+            list.append($('<li>').append(Kronolith.text.noevents));
         }
+        list.listview();
+        $("#daycontent").append(list);
     },
 
     loadEvent: function(cal, idy, d)
index cb17a5a..6045d5c 100644 (file)
@@ -314,6 +314,7 @@ class Kronolith
             'wrong_date_format' => sprintf(_("You used an unknown date format \"%s\". Please try something like \"%s\"."), '#{wrong}', '#{right}'),
             'wrong_time_format' => sprintf(_("You used an unknown time format \"%s\". Please try something like \"%s\"."), '#{wrong}', '#{right}'),
             'fix_form_values' => _("Please enter correct values in the form first."),
+            'noevents' => _("No events to display"),
         );
         for ($i = 1; $i <= 12; ++$i) {
             $code['text']['month'][$i - 1] = Horde_Nls::getLangInfo(constant('MON_' . $i));