]> git.mxchange.org Git - friendica.git/blob - view/smarty3/event_head.tpl
add warning message about automatically generated templates
[friendica.git] / view / smarty3 / event_head.tpl
1 {{*
2  *      AUTOMATICALLY GENERATED TEMPLATE
3  *      DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN
4  *
5  *}}<link rel='stylesheet' type='text/css' href='{{$baseurl}}/library/fullcalendar/fullcalendar.css' />
6 <script language="javascript" type="text/javascript"
7           src="{{$baseurl}}/library/fullcalendar/fullcalendar.min.js"></script>
8
9 <script>
10         function showEvent(eventid) {
11                 $.get(
12                         '{{$baseurl}}/events/?id='+eventid,
13                         function(data){
14                                 $.fancybox(data);
15                         }
16                 );                      
17         }
18         
19         $(document).ready(function() {
20                 $('#events-calendar').fullCalendar({
21                         events: '{{$baseurl}}/events/json/',
22                         header: {
23                                 left: 'prev,next today',
24                                 center: 'title',
25                                 right: 'month,agendaWeek,agendaDay'
26                         },                      
27                         timeFormat: 'H(:mm)',
28                         eventClick: function(calEvent, jsEvent, view) {
29                                 showEvent(calEvent.id);
30                         },
31                         
32                         eventRender: function(event, element, view) {
33                                 //console.log(view.name);
34                                 if (event.item['author-name']==null) return;
35                                 switch(view.name){
36                                         case "month":
37                                         element.find(".fc-event-title").html(
38                                                 "<img src='{0}' style='height:10px;width:10px'>{1} : {2}".format(
39                                                         event.item['author-avatar'],
40                                                         event.item['author-name'],
41                                                         event.title
42                                         ));
43                                         break;
44                                         case "agendaWeek":
45                                         element.find(".fc-event-title").html(
46                                                 "<img src='{0}' style='height:12px; width:12px'>{1}<p>{2}</p><p>{3}</p>".format(
47                                                         event.item['author-avatar'],
48                                                         event.item['author-name'],
49                                                         event.item.desc,
50                                                         event.item.location
51                                         ));
52                                         break;
53                                         case "agendaDay":
54                                         element.find(".fc-event-title").html(
55                                                 "<img src='{0}' style='height:24px;width:24px'>{1}<p>{2}</p><p>{3}</p>".format(
56                                                         event.item['author-avatar'],
57                                                         event.item['author-name'],
58                                                         event.item.desc,
59                                                         event.item.location
60                                         ));
61                                         break;
62                                 }
63                         }
64                         
65                 })
66                 
67                 // center on date
68                 var args=location.href.replace(baseurl,"").split("/");
69                 if (args.length>=4) {
70                         $("#events-calendar").fullCalendar('gotoDate',args[2] , args[3]-1);
71                 } 
72                 
73                 // show event popup
74                 var hash = location.hash.split("-")
75                 if (hash.length==2 && hash[0]=="#link") showEvent(hash[1]);
76                 
77         });
78 </script>
79
80
81 <script language="javascript" type="text/javascript"
82           src="{{$baseurl}}/library/tinymce/jscripts/tiny_mce/tiny_mce_src.js"></script>
83 <script language="javascript" type="text/javascript">
84
85
86         tinyMCE.init({
87                 theme : "advanced",
88                 mode : "textareas",
89                 plugins : "bbcode,paste",
90                 theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",
91                 theme_advanced_buttons2 : "",
92                 theme_advanced_buttons3 : "",
93                 theme_advanced_toolbar_location : "top",
94                 theme_advanced_toolbar_align : "center",
95                 theme_advanced_blockformats : "blockquote,code",
96                 gecko_spellcheck : true,
97                 paste_text_sticky : true,
98                 entity_encoding : "raw",
99                 add_unload_trigger : false,
100                 remove_linebreaks : false,
101                 force_p_newlines : false,
102                 force_br_newlines : true,
103                 forced_root_block : '',
104                 content_css: "{{$baseurl}}/view/custom_tinymce.css",
105                 theme_advanced_path : false,
106                 setup : function(ed) {
107                         ed.onInit.add(function(ed) {
108                                 ed.pasteAsPlainText = true;
109                         });
110                 }
111
112         });
113
114
115         $(document).ready(function() { 
116
117                 $('#event-share-checkbox').change(function() {
118
119                         if ($('#event-share-checkbox').is(':checked')) { 
120                                 $('#acl-wrapper').show();
121                         }
122                         else {
123                                 $('#acl-wrapper').hide();
124                         }
125                 }).trigger('change');
126
127
128                 $('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
129                         var selstr;
130                         $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
131                                 selstr = $(this).text();
132                                 $('#jot-public').hide();
133                         });
134                         if(selstr == null) {
135                                 $('#jot-public').show();
136                         }
137
138                 }).trigger('change');
139
140         });
141
142 </script>
143