]> source.dussan.org Git - nextcloud-server.git/commitdiff
highlight the current view
authorGeorg Ehrke <dev@georgswebsite.de>
Sat, 14 Jan 2012 23:06:26 +0000 (00:06 +0100)
committerGeorg Ehrke <dev@georgswebsite.de>
Sat, 14 Jan 2012 23:06:26 +0000 (00:06 +0100)
apps/calendar/js/calendar.js
apps/calendar/templates/calendar.php

index ae586661ccc85c910f9d48c18259103f607795fe..33a78b3e3222e4fcf90d6cafe6d99cecc2745885 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
+ * Copyright (c) 2012 Georg Ehrke <ownclouddev at georgswebsite dot de>
  * Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl>
  * This file is licensed under the Affero General Public License version 3 or
  * later.
@@ -345,6 +345,11 @@ Calendar={
                        }
                        
                },
+               reseticonhighlight: function(){
+                       $('#oneweekview_radio').css('color', '#000000');
+                       $('#onemonthview_radio').css('color', '#000000');
+                       $('#listview_radio').css('color', '#000000');
+               },
                Calendar:{
                        overview:function(){
                                if($('#choosecalendar_dialog').dialog('isOpen') == true){
@@ -669,12 +674,18 @@ $(document).ready(function(){
        });
        $('#oneweekview_radio').click(function(){
                $('#calendar_holder').fullCalendar('changeView', 'agendaWeek');
+               Calendar.UI.reseticonhighlight();
+               $('#oneweekview_radio').css('color', '#6193CF');
        });
        $('#onemonthview_radio').click(function(){
                $('#calendar_holder').fullCalendar('changeView', 'month');
+               Calendar.UI.reseticonhighlight();
+               $('#onemonthview_radio').css('color', '#6193CF');
        });
        $('#listview_radio').click(function(){
                $('#calendar_holder').fullCalendar('changeView', 'list');
+               Calendar.UI.reseticonhighlight();
+               $('#listview_radio').css('color', '#6193CF');
        });
        $('#today_input').click(function(){
                $('#calendar_holder').fullCalendar('today');
index 50d3d70347a791716d8f1a090b281f6410ee39cc..6b2cd68c6fbe39aedabcc8c781731a1ecd45374d 100755 (executable)
                                        echo '$(\'#calendar_holder\').fullCalendar(\'gotoDate\', ' . $year . ', ' . --$month . ', ' . $day . ');';
                                        echo '$(\'#dialog_holder\').load(OC.filePath(\'calendar\', \'ajax\', \'editeventform.php\') + \'?id=\' +  ' . $_['showevent'] . ' , Calendar.UI.startEventDialog);';
                                }
+                               
+                               switch(OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'currentview', 'month')){
+                                       case 'agendaWeek':
+                                               echo '$(\'#oneweekview_radio\').css(\'color\', \'#6193CF\');';
+                                               break;
+                                       case 'month':
+                                               echo '$(\'#onemonthview_radio\').css(\'color\', \'#6193CF\');';
+                                               break;
+                                       case 'list':
+                                               echo '$(\'#listview_radio\').css(\'color\', \'#6193CF\');';
+                                               break;
+                                       default:
+                                               break;
+                               }
                                ?>
                                });
                                </script>