]> git.mxchange.org Git - friendica.git/commitdiff
frio - event - code clean up + docu
authorrabuzarus <>
Fri, 17 Jun 2016 12:27:33 +0000 (14:27 +0200)
committerrabuzarus <>
Fri, 17 Jun 2016 12:27:33 +0000 (14:27 +0200)
include/datetime.php
view/theme/frio/js/theme.js
view/theme/frio/templates/event_form.tpl
view/theme/frio/templates/events-js.tpl

index 4b0bbb576d283330291279878fdc4b645560f99f..949f68dec59c7db8d4a7db288f38d1229ac1f300 100644 (file)
@@ -298,8 +298,7 @@ function datetimesel($format, $min, $max, $default, $label, $id = 'datetimepicke
        $o .= replace_macros($tpl,array(
                        '$field' => array($id, $label, $input_text, '', (($required) ? '*' : ''), 'placeholder="' . $readable_format . '"'),
                ));
-//     $o .= "<div class='date'><input type='text' placeholder='$readable_format' name='$id' id='$id' $input_text />";
-//     $o .= '</div>';
+
        $o .= "<script type='text/javascript'>";
        $o .= "\$(function () {var picker = \$('#id_$id').datetimepicker({step:5,format:'$dateformat' $minjs $maxjs $pickers $defaultdatejs}); $extra_js})";
        $o .= "</script>";
index 414df7c1a9103557f88e57bc305a76c0bcf7b61f..f3bd543c170a5601110556d63d49b14efa1e39ba 100644 (file)
@@ -481,160 +481,3 @@ String.prototype.rtrim = function() {
        var trimmed = this.replace(/\s+$/g, '');
        return trimmed;
 };
-
-
-        
-//     $(document).ready(function() {
-//             $('#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}}'],
-//                     monthNamesShort: ['{{$i18n.Jan}}','{{$i18n.Feb}}','{{$i18n.Mar}}','{{$i18n.Apr}}','{{$i18n.May}}','{{$i18n.Jun}}','{{$i18n.Jul}}','{{$i18n.Aug}}','{{$i18n.Sep}}','{{$i18n.Oct}}','{{$i18n.Nov}}','{{$i18n.Dec}}'],
-//                     dayNames: ['{{$i18n.Sunday}}','{{$i18n.Monday}}','{{$i18n.Tuesday}}','{{$i18n.Wednesday}}','{{$i18n.Thursday}}','{{$i18n.Friday}}','{{$i18n.Saturday}}'],
-//                     dayNamesShort: ['{{$i18n.Sun}}','{{$i18n.Mon}}','{{$i18n.Tue}}','{{$i18n.Wed}}','{{$i18n.Thu}}','{{$i18n.Fri}}','{{$i18n.Sat}}'],
-//                     buttonText: {
-//                             prev: "<span class='fc-text-arrow'>&lsaquo;</span>",
-//                             next: "<span class='fc-text-arrow'>&rsaquo;</span>",
-//                             prevYear: "<span class='fc-text-arrow'>&laquo;</span>",
-//                             nextYear: "<span class='fc-text-arrow'>&raquo;</span>",
-//                             today: '{{$i18n.today}}',
-//                             month: '{{$i18n.month}}',
-//                             week: '{{$i18n.week}}',
-//                             day: '{{$i18n.day}}'
-//                     },
-//                     events: '{{$baseurl}}/events/json/',
-//                     header: {
-//                             left: '',
-//                     //      center: 'title',
-//                             right: ''
-//                     },                      
-//                     timeFormat: 'H(:mm)',
-//                     eventClick: function(calEvent, jsEvent, view) {
-//                             showEvent(calEvent.id);
-//                     },
-//                     loading: function(isLoading, view) {
-//                             if(!isLoading) {
-//                                     $('td.fc-day').dblclick(function() { window.location.href='/events/new?start='+$(this).data('date'); });
-//                             }
-//                     },
-//                     
-//                     eventRender: function(event, element, view) {
-//                             //console.log(view.name);
-//                             if (event.item['author-name']==null) return;
-//                             switch(view.name){
-//                                     case "month":
-//                                     element.find(".fc-event-title").html(
-//                                             "<img src='{0}' style='height:10px;width:10px'>{1} : {2}".format(
-//                                                     event.item['author-avatar'],
-//                                                     event.item['author-name'],
-//                                                     event.title
-//                                     ));
-//                                     break;
-//                                     case "agendaWeek":
-//                                     element.find(".fc-event-title").html(
-//                                             "<img src='{0}' style='height:12px; width:12px'>{1}<p>{2}</p><p>{3}</p>".format(
-//                                                     event.item['author-avatar'],
-//                                                     event.item['author-name'],
-//                                                     event.item.desc,
-//                                                     event.item.location
-//                                     ));
-//                                     break;
-//                                     case "agendaDay":
-//                                     element.find(".fc-event-title").html(
-//                                             "<img src='{0}' style='height:24px;width:24px'>{1}<p>{2}</p><p>{3}</p>".format(
-//                                                     event.item['author-avatar'],
-//                                                     event.item['author-name'],
-//                                                     event.item.desc,
-//                                                     event.item.location
-//                                     ));
-//                                     break;
-//                             }
-//                     }
-//                     
-//             })
-//             
-//             // center on date
-//             var args=location.href.replace(baseurl,"").split("/");
-//             if (args.length>=4) {
-//                     $("#events-calendar").fullCalendar('gotoDate',args[2] , args[3]-1);
-//             } 
-//
-//             // echo the title
-//             var view = $('#events-calendar').fullCalendar('getView');
-//             $('#fc-title').text(view.title);
-//
-//             // show event popup
-//             var hash = location.hash.split("-")
-//             if (hash.length==2 && hash[0]=="#link") showEvent(hash[1]);
-//             
-//     });
-       
-//             $(document).ready(function() {
-//             $('#events-calendar').fullCalendar({
-//
-//                     events: '{{$baseurl}}/events/json/',
-//                     header: {
-//                             left: '',
-//                     //      center: 'title',
-//                             right: ''
-//                     },                      
-//                     timeFormat: 'H(:mm)',
-//                     eventClick: function(calEvent, jsEvent, view) {
-//                             showEvent(calEvent.id);
-//                     },
-//                     loading: function(isLoading, view) {
-//                             if(!isLoading) {
-//                                     $('td.fc-day').dblclick(function() { window.location.href='/events/new?start='+$(this).data('date'); });
-//                             }
-//                     },
-//                     
-//                     eventRender: function(event, element, view) {
-//                             //console.log(view.name);
-//                             if (event.item['author-name']==null) return;
-//                             switch(view.name){
-//                                     case "month":
-//                                     element.find(".fc-event-title").html(
-//                                             "<img src='{0}' style='height:10px;width:10px'>{1} : {2}".format(
-//                                                     event.item['author-avatar'],
-//                                                     event.item['author-name'],
-//                                                     event.title
-//                                     ));
-//                                     break;
-//                                     case "agendaWeek":
-//                                     element.find(".fc-event-title").html(
-//                                             "<img src='{0}' style='height:12px; width:12px'>{1}<p>{2}</p><p>{3}</p>".format(
-//                                                     event.item['author-avatar'],
-//                                                     event.item['author-name'],
-//                                                     event.item.desc,
-//                                                     event.item.location
-//                                     ));
-//                                     break;
-//                                     case "agendaDay":
-//                                     element.find(".fc-event-title").html(
-//                                             "<img src='{0}' style='height:24px;width:24px'>{1}<p>{2}</p><p>{3}</p>".format(
-//                                                     event.item['author-avatar'],
-//                                                     event.item['author-name'],
-//                                                     event.item.desc,
-//                                                     event.item.location
-//                                     ));
-//                                     break;
-//                             }
-//                     }
-//                     
-//             })
-//             
-//             // center on date
-//             var args=location.href.replace(baseurl,"").split("/");
-//             if (args.length>=4) {
-//                     $("#events-calendar").fullCalendar('gotoDate',args[2] , args[3]-1);
-//             } 
-//
-//             // echo the title
-//             var view = $('#events-calendar').fullCalendar('getView');
-//             $('#fc-title').text(view.title);
-//
-//             // show event popup
-//             var hash = location.hash.split("-")
-//             if (hash.length==2 && hash[0]=="#link") showEvent(hash[1]);
-//             
-//     });
-       
\ No newline at end of file
index 6ccce703b2b527ba18d8b9c6f20198fa154c9b97..97892d186b6383f89e957e8a8bfacea423099589 100644 (file)
                <input type="hidden" name="uri" value="{{$uri}}" />
                <input type="hidden" name="preview" id="event-edit-preview" value="0" />
 
+               {{* The tab conten with the necessary basic settings *}}
                <div id="event-edit-wrapper">
 
+                       {{* The event title *}}
                        {{include file="field_input.tpl" field=$summary}}
 
                        <div id="event-edit-time">
+                               {{* The field for event starting time *}}
                                {{$s_dsel}}
 
+                               {{* The field for event finish time *}}
                                {{$f_dsel}}
 
+                               {{* checkbox if the the event doesn't have a finish time *}}
                                {{include file="field_checkbox.tpl" field=$nofinish}}
 
+                               {{* checkbox for adjusting the event time to the timezone of the user *}}
                                {{include file="field_checkbox.tpl" field=$adjust}}
                        </div>
 
+                       {{* checkbox to enable event sharing and the permissions tab *}}
                        {{if ! $eid}}
                        {{include file="field_checkbox.tpl" field=$share}}
                        {{/if}}
 
+                       {{* The submit button - saves the event *}}
                        <div class="pull-right" >
                                <button id="event-submit" type="submit" name="submit" class="btn btn-primary" value="{{$submit|escape:'html'}}">{{$submit}}</button>
                        </div>
                        <div class="clear"></div>
                </div>
 
+               {{* The advanced tab *}}
                <div id="event-desc-wrapper" style="display: none">
 
+                       {{* The textarea for the event description *}}
                        <div class="form-group">
                                <div id="event-desc-text"><b>{{$d_text}}</b></div>
                                <textarea id="comment-edit-text-desc" class="form-control" name="desc" >{{$d_orig}}</textarea>
                                <div class="clear"></div>
                        </div>
 
+                       {{* The textarea for the event location *}}
                        <div class="form-group">
                                <div id="event-location-text"><b>{{$l_text}}</b></div>
                                <textarea id="comment-edit-text-loc" class="form-control" name="location">{{$l_orig}}</textarea>
                        </div>
                </div>
 
+               {{* The tab for the permissions (if event sharing is enabled) *}}
                <div id="event-acl-wrapper" style="display: none">
                        {{$acl}}
                </div>
 
+               {{* The tab for the event preview (content is inserted by js) *}}
                <div id="event-preview" style="display: none"></div>
 
                <div class="clear"></div>
index 8734d4ea8322f4ec179d4ec3f4b0fb8d52e95f07..9e46b5c48ad50ecb7468c069d4ca493fcfac9c80 100644 (file)
@@ -2,10 +2,13 @@
        {{$tabs}}
        {{include file="section_title.tpl" title=$title}}
 
+       {{* The link to create a new event *}}
        <div id="new-event-link"><a onclick="addToModal('{{$new_event.0}}')" >{{$new_event.1}}</a></div>
 
+       {{* We create our own fullcallendar header (with title & calendar view *}}
        <div id="fc-header">
                <div id="fc-header-right" class="pull-right">
+                       {{* The dropdown to change the callendar view *}}
                        <ul class="nav nav-pills">
                                <li class="dropdown pull-right">
                                        <a class="btn btn-link btn-sm dropdown-toggle" type="button" id="event-calendar-views" data-toggle="dropdown" aria-expanded="true">
                                </li>
                        </ul>
                </div>
+
+               {{* The buttons to change the month/weeks/days *}}
                <div id="fc-fc-header-left" class="btn-group">
                        <button class="btn btn-eventnav" onclick="changeView('prev', false);" title="{{$prev}}"><i class="fa fa-angle-up" aria-hidden="true"></i></i></button>
                        <button class="btn btn-eventnav btn-separator" onclick="changeView('next', false);" title="{{$next}}"><i class="fa fa-angle-down" aria-hidden="true"></i></i></button>
                        <button class="btn btn-eventnav btn-separator" onclick="changeView('today', false);" title="{{$today}}"><i class="fa fa-bullseye"></i></button>
                </div>
 
+               {{* The title (e.g. name of the mont/week/day) *}}
                <div id="event-calendar-title"><h4 id="fc-title"></h4></div>
 
        </div>
+
+       {{* This is the container where the fullCalendar is inserted through js *}}
        <div id="events-calendar"></div>
 </div>