2 <link rel='stylesheet' type='text/css' href='{{$baseurl}}/library/fullcalendar/fullcalendar.css' />
3 <script language="javascript" type="text/javascript"
4 src="{{$baseurl}}/library/fullcalendar/fullcalendar.min.js"></script>
8 // loads the event into a modal
9 function showEvent(eventid) {
10 addToModal('{{$baseurl}}/events/?id='+eventid);
14 // Load the html of the actual event and incect the output to the
16 function doEventPreview() {
17 $('#event-edit-preview').val(1);
18 $.post('events',$('#event-edit-form').serialize(), function(data) {
19 $("#event-preview").append(data);
21 $('#event-edit-preview').val(0);
24 function changeView(action, viewName) {
25 $('#events-calendar').fullCalendar(action, viewName);
26 var view = $('#events-calendar').fullCalendar('getView');
27 $('#fc-title').text(view.title);
30 $(document).ready(function() {
31 // start the fullCalendar
32 $('#events-calendar').fullCalendar({
33 firstDay: {{$i18n.firstDay}},
34 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}}'],
35 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}}'],
36 dayNames: ['{{$i18n.Sunday}}','{{$i18n.Monday}}','{{$i18n.Tuesday}}','{{$i18n.Wednesday}}','{{$i18n.Thursday}}','{{$i18n.Friday}}','{{$i18n.Saturday}}'],
37 dayNamesShort: ['{{$i18n.Sun}}','{{$i18n.Mon}}','{{$i18n.Tue}}','{{$i18n.Wed}}','{{$i18n.Thu}}','{{$i18n.Fri}}','{{$i18n.Sat}}'],
39 prev: "<span class='fc-text-arrow'>‹</span>",
40 next: "<span class='fc-text-arrow'>›</span>",
41 prevYear: "<span class='fc-text-arrow'>«</span>",
42 nextYear: "<span class='fc-text-arrow'>»</span>",
43 today: '{{$i18n.today}}',
44 month: '{{$i18n.month}}',
45 week: '{{$i18n.week}}',
48 events: '{{$baseurl}}/events/json/',
55 eventClick: function(calEvent, jsEvent, view) {
56 showEvent(calEvent.id);
58 loading: function(isLoading, view) {
60 $('td.fc-day').dblclick(function() { window.location.href='/events/new?start='+$(this).data('date'); });
64 eventRender: function(event, element, view) {
65 //console.log(view.name);
66 if (event.item['author-name']==null) return;
69 element.find(".fc-event-title").html(
70 "<img src='{0}' style='height:10px;width:10px'>{1} : {2}".format(
71 event.item['author-avatar'],
72 event.item['author-name'],
77 element.find(".fc-event-title").html(
78 "<img src='{0}' style='height:12px; width:12px'>{1}<p>{2}</p><p>{3}</p>".format(
79 event.item['author-avatar'],
80 event.item['author-name'],
86 element.find(".fc-event-title").html(
87 "<img src='{0}' style='height:24px;width:24px'>{1}<p>{2}</p><p>{3}</p>".format(
88 event.item['author-avatar'],
89 event.item['author-name'],
100 var args=location.href.replace(baseurl,"").split("/");
101 if (args.length>=4) {
102 $("#events-calendar").fullCalendar('gotoDate',args[2] , args[3]-1);
106 var view = $('#events-calendar').fullCalendar('getView');
107 $('#fc-title').text(view.title);
110 var hash = location.hash.split("-")
111 if (hash.length==2 && hash[0]=="#link") showEvent(hash[1]);
117 {{if $editselect != 'none'}}
118 <script language="javascript" type="text/javascript"
119 src="{{$baseurl}}/library/tinymce/jscripts/tiny_mce/tiny_mce_src.js"></script>
120 <script language="javascript" type="text/javascript">
126 plugins : "bbcode,paste",
127 theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",
128 theme_advanced_buttons2 : "",
129 theme_advanced_buttons3 : "",
130 theme_advanced_toolbar_location : "top",
131 theme_advanced_toolbar_align : "center",
132 theme_advanced_blockformats : "blockquote,code",
133 theme_advanced_resizing : true,
134 gecko_spellcheck : true,
135 paste_text_sticky : true,
136 entity_encoding : "raw",
137 add_unload_trigger : false,
138 remove_linebreaks : false,
139 //force_p_newlines : false,
140 //force_br_newlines : true,
141 forced_root_block : 'div',
142 content_css: "{{$baseurl}}/view/custom_tinymce.css",
143 theme_advanced_path : false,
144 setup : function(ed) {
145 ed.onInit.add(function(ed) {
146 ed.pasteAsPlainText = true;
152 $(document).ready(function() {
153 $('.comment-edit-bb').hide();
156 <script language="javascript" type="text/javascript">
160 $(document).ready(function() {
161 {{if $editselect = 'none'}}
162 $("#comment-edit-text-desc").bbco_autocomplete('bbcode');
165 // go to the permissions tab if the checkbox is checked
166 $('body').on("change", "#id_share", function() {
168 if ($('#id_share').is(':checked') && !( $('#id_share').attr("disabled"))) {
169 $('#acl-wrapper').show();
170 $("a#event-perms-lnk").parent("li").show();
171 toggleEventNav("a#event-perms-lnk");
175 $('#acl-wrapper').hide();
176 $("a#event-perms-lnk").parent("li").hide();
178 }).trigger('change');
180 // disable the finish time input if the user disable it
181 $('body').on("change", "#id_nofinish", function() {
182 enableDisableFinishDate()
183 }).trigger('change');
185 // js for the permission sextion
186 $('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
188 $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
189 selstr = $(this).text();
190 $('#jot-public').hide();
193 $('#jot-public').show();
196 }).trigger('change');
198 // Change the event nav menu.tabs on click
199 $("body").on("click", "#event-nav > li > a", function(e){
201 toggleEventNav(this);
204 // this is experimental. We maybe can make use of it to inject
205 // some js code while the event modal opens
206 //$('body').on('show.bs.modal', function () {
207 // enableDisableFinishDate();
210 // clear some elements (e.g. the event-preview container) when
211 // selecting a event nav link so it don't appear more than once
212 $('body').on("click", "#event-nav a", function(e) {
213 $("#event-preview").empty();
223 // the following functions show/hide the specific event-edit content
224 // in dependence of the selected nav
225 function eventAclActive() {
226 $("#event-edit-wrapper, #event-preview").hide();
227 $("#event-acl-wrapper").show();
231 function eventPreviewActive() {
232 $("#event-acl-wrapper, #event-edit-wrapper").hide();
233 $("#event-preview").show();
237 function eventEditActive() {
238 $("#event-acl-wrapper, #event-preview").hide();
239 $("#event-edit-wrapper").show();
241 //make sure jot text does have really the active class (we do this because there are some
242 // other events which trigger jot text
243 toggleEventNav($("#event-edit-lnk"));
246 // Give the active "event-nav" list element the class "active"
247 function toggleEventNav (elm) {
248 // select all li of #event-nav and remove the active class
249 $(elm).closest("#event-nav").children("li").removeClass("active");
250 // add the active class to the parent of the link which was selected
251 $(elm).parent("li").addClass("active");
254 // this function load the content of the edit url into a modal
255 function eventEdit(url) {
256 var char = qOrAmp(url);
257 url = url + char + 'mode=none';
259 $.get(url, function(data) {
260 $("#modal-body").empty();
261 $("#modal-body").append(data);
267 // disable the input for the finish date if it is not available
268 function enableDisableFinishDate() {
269 if( $('#id_nofinish').is(':checked'))
270 $('#id_finish_text').prop("disabled", true);
272 $('#id_finish_text').prop("disabled", false);