]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/frio/templates/event_head.tpl
frio: add intro action buttons for mobile devices
[friendica.git] / view / theme / frio / templates / event_head.tpl
index e0cfceec96912af6a050857abd6bc70bee3641b1..4d14a3884a1ef57a91faf0d242bc81a4cfab0645 100644 (file)
@@ -4,28 +4,19 @@
          src="{{$baseurl}}/library/fullcalendar/fullcalendar.min.js"></script>
 
 <script>
-
+       // loads the event into a modal
        function showEvent(eventid) {
-               
-                       addToModal('{{$baseurl}}/events/?id='+eventid);
-       
-       }
-
-       function doEventPreview() {
-               $('#event-edit-preview').val(1);
-               $.post('events',$('#event-edit-form').serialize(), function(data) {
-                       $.colorbox({ html: data });
-               });
-               $('#event-edit-preview').val(0);
+                       addToModal('{{$baseurl}}{{$module_url}}/?id='+eventid);
        }
 
        function changeView(action, viewName) {
                $('#events-calendar').fullCalendar(action, viewName);
                var view = $('#events-calendar').fullCalendar('getView');
-               $('#title').text(view.title);
+               $('#fc-title').text(view.title);
        }
 
        $(document).ready(function() {
+               // start the fullCalendar
                $('#events-calendar').fullCalendar({
                        firstDay: {{$i18n.firstDay}},
                        monthNames: ['{{$i18n.January}}','{{$i18n.February}}','{{$i18n.March}}','{{$i18n.April}}','{{$i18n.May}}','{{$i18n.June}}','{{$i18n.July}}','{{$i18n.August}}','{{$i18n.September}}','{{$i18n.October}}','{{$i18n.November}}','{{$i18n.December}}'],
@@ -42,7 +33,7 @@
                                week: '{{$i18n.week}}',
                                day: '{{$i18n.day}}'
                        },
-                       events: '{{$baseurl}}/events/json/',
+                       events: '{{$baseurl}}{{$module_url}}/json/',
                        header: {
                                left: '',
                        //      center: 'title',
@@ -54,7 +45,7 @@
                        },
                        loading: function(isLoading, view) {
                                if(!isLoading) {
-                                       $('td.fc-day').dblclick(function() { window.location.href='/events/new?start='+$(this).data('date'); });
+                                       $('td.fc-day').dblclick(function() { addToModal('/events/new?start='+$(this).data('date')); });
                                }
                        },
                        
                        }
                        
                })
-               
+
                // center on date
                var args=location.href.replace(baseurl,"").split("/");
+               {{if $modparams == 2}}
+               if (args.length>=5) {
+                       $("#events-calendar").fullCalendar('gotoDate',args[3] , args[4]-1);
+               }
+               {{else}}
                if (args.length>=4) {
                        $("#events-calendar").fullCalendar('gotoDate',args[2] , args[3]-1);
-               } 
+               }
+               {{/if}} 
 
                // echo the title
                var view = $('#events-calendar').fullCalendar('getView');
                $("#comment-edit-text-desc").bbco_autocomplete('bbcode');
                {{/if}}
 
-               $('body').change("#event-share-checkbox", function() {
-
-                       if ($('#event-share-checkbox').is(':checked')  && !( $('#event-share-checkbox').attr("disabled"))) { 
-                               $('#acl-wrapper').show();
-                               $("a#event-perms-lnk").parent("li").show();
-                               toggleEventNav("a#event-perms-lnk");
-                               eventAclActive();
-                       }
-                       else {
-                               $('#acl-wrapper').hide();
-                               $("a#event-perms-lnk").parent("li").hide();
-                       }
-               }).trigger('change');
-
-
-               $('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
-                       var selstr;
-                       $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
-                               selstr = $(this).text();
-                               $('#jot-public').hide();
-                       });
-                       if(selstr == null) {
-                               $('#jot-public').show();
-                       }
-
-               }).trigger('change');
-
-               // Event nav menu.
-               $("body").on("click", "#event-nav li a", function(e){
-                       e.preventDefault();
-                       toggleEventNav(this);
-               });
-
        });
 
 </script>
-
-<script>
-       // the following functions show/hide the specific event-edit content 
-       // in dependence of the selected nav
-       function eventAclActive() {
-               $("#event-edit-wrapper, .modal-body #jot-preview-content, .modal-body #jot-fbrowser-wrapper").hide();
-               $("#event-acl-wrapper").show();
-       }
-
-
-       function previewActive() {
-               $(".modal-body #profile-jot-wrapper, .modal-body #profile-jot-acl-wrapper,.modal-body #jot-fbrowser-wrapper").hide();
-               preview_post();
-       }
-
-       function eventEditActive() {
-               $("#event-acl-wrapper, .modal-body #jot-preview-content, .modal-body #jot-fbrowser-wrapper").hide();
-               $("#event-edit-wrapper").show();
-
-               //make sure jot text does have really the active class (we do this because there are some
-               // other events which trigger jot text
-               toggleEventNav($("#event-edit-lnk"));
-       }
-
-       // Give the active "event-nav" list element the class "active"
-       function toggleEventNav (elm) {
-               // select all li of #event-nav and remove the active class
-               $(elm).closest("#event-nav").children("li").removeClass("active");
-               // add the active class to the parent of the link which was selected
-               $(elm).parent("li").addClass("active");
-       }
-</script>