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