<?xml version='1.0' encoding='UTF-8'?><uidget><metadata><name>Agenda</name><description>Add a calendar to your website</description><help>
			This block displays a nice and dynamic calendar on you website. You can customize its events easily: title, color, dates, description.
			
		</help><api_version>1.0</api_version><size height='600' width='500' /><server>local://CalendarCptServer</server><blog en='550' /></metadata><view><content>&lt;!-- CALENDAR CONTAINER --&gt;
&lt;div class=&quot;uica_calendar&quot;&gt;
	&lt;div class=&quot;uica_calendar_container&quot;&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;!-- Add Event form --&gt;
&lt;div class=&quot;uica_window&quot; style=&quot;display:none;&quot;&gt;
		&lt;div class=&quot;uica_header_window&quot;&gt;
			&lt;input class=&quot;uica_title_event uica_te&quot; type=&quot;text&quot; name=&quot;title_event&quot; placeholder=&quot;Event title&quot;&gt;
			&lt;!--COLOR PICKER --&gt;

			&lt;span class=&quot;fonticon uica_window_close_btn&quot;&gt;✖&lt;/span&gt;
			&lt;button class=&quot;uica_cs_opener&quot; style=&quot;padding: 3px 8px;border-radius: 2px;border: 0px solid;background-color: transparent;margin-left: 10px;float:right&quot;&gt;
				&lt;span class=&quot;fonticon&quot;&gt;&amp;#xe902;&lt;/span&gt;
			&lt;/button&gt;
			&lt;div class=&quot;uica_color_selector&quot;&gt;
				&lt;div class=&quot;uica_cs_square&quot;&gt;&lt;/div&gt;
				&lt;div class=&quot;uica_cs_title&quot;&gt;
					&lt;span&gt;Choose a color&lt;/span&gt;
					&lt;span class=&quot;fonticon uica_cf_close_btn&quot;&gt;✖&lt;/span&gt;
				&lt;/div&gt;
				&lt;div class=&quot;uica_cs_container&quot;&gt;
					&lt;div class=&quot;uica_cs_card_more&quot;&gt;
						&lt;span class=&quot;uica_cs_textcolor&quot;&gt;Or another color&lt;/span&gt;
							&lt;input class=&quot;uica_colorPicker input_colorPicker&quot;&gt;
					&lt;/div&gt;
				&lt;/div&gt;
			&lt;/div&gt;
		&lt;/div&gt;
		&lt;div class=&quot;uica_content&quot;&gt;
			&lt;div class=&quot;uica_event_dates&quot;&gt;

				&lt;!-- Jour entier==&gt; checkbox --&gt;
				&lt;div&gt;
					&lt;label for=&quot;use_hour&quot;&gt;Specify hours&lt;/label&gt;
					&lt;input class=&quot;uica_input_use_hour&quot; name=&apos;use_hour&apos; type=&apos;checkbox&apos; value=&apos;use_hour&apos;&gt;
				&lt;/div&gt;
				&lt;div&gt;
					&lt;label for=&quot;start_date&quot;&gt;Start Date&lt;/label&gt;
          &lt;div class=&apos;input-group date uica_startdatepicker&apos;&gt;
              &lt;input type=&apos;text&apos; class=&quot;form-control&quot; style=&quot;height: 29px;border-radius: 2px;padding-left:45px;&quot; required=&quot;required&quot;/&gt;
              &lt;span class=&quot;input-group-addon&quot;&gt;
                  &lt;span class=&quot;fonticon&quot;&gt;⏨&lt;/span&gt;
              &lt;/span&gt;
          &lt;/div&gt;
				&lt;/div&gt;
				&lt;div&gt;
					&lt;label for=&quot;end_date&quot;&gt;End Date&lt;/label&gt;
          &lt;div class=&apos;input-group date uica_enddatepicker&apos;&gt;
              &lt;input type=&apos;text&apos; class=&quot;form-control&quot; style=&quot;height: 29px;border-radius: 2px;padding-left:45px;&quot; required=&quot;required&quot;/&gt;
              &lt;span class=&quot;input-group-addon&quot;&gt;
                  &lt;span class=&quot;fonticon&quot;&gt;⏨&lt;/span&gt;
              &lt;/span&gt;
          &lt;/div&gt;
				&lt;/div&gt;
			&lt;/div&gt;
			&lt;div class=&quot;uica_elements uica_textcontainer&quot;&gt;
				&lt;label&gt;Description: &lt;/label&gt;
				&lt;div class=&quot;uica_ptxt&quot; uitype=&quot;editor&quot; uinocb=&quot;true&quot;&gt;&lt;/div&gt;
			&lt;/div&gt;
		&lt;/div&gt;
		&lt;div class=&quot;uica_footer&quot;&gt;
				&lt;button class=&quot;uica_delete_btn btn btn-default&quot;&gt;&lt;span class=&quot;fonticon&quot; style=&quot;font-size: 14px;&quot;&gt;ऀ&lt;/span&gt; Delete&lt;/button&gt;
				&lt;button class=&quot;uica_submit_btn btn btn-primary&quot;&gt;&lt;/button&gt;
		&lt;/div&gt;
&lt;/div&gt;

&lt;!-- Popup viewer form --&gt;
&lt;div class=&quot;uica_viewer_event_window&quot; style=&quot;display:none;&quot;&gt;
		&lt;div class=&quot;uica_viewer_header_window&quot;&gt;
			&lt;span class=&quot;fonticon uica_viewer_close_btn&quot;&gt;✖&lt;/span&gt;
			&lt;label class=&quot;uica_viewer_title_event uica_te&quot;&gt;&lt;/label&gt;
		&lt;/div&gt;
		&lt;div class=&quot;uica_viewer_content&quot;&gt;
			&lt;div class=&quot;uica_viewer_event_dates&quot;&gt;
				&lt;span class=&quot;uica_viewer_date_event&quot;&gt;&lt;/span&gt;
			&lt;/div&gt;
			&lt;div class=&quot;uica_viewer_uica_elements&quot;&gt;
				&lt;label&gt;Description&lt;/label&gt;
				&lt;div class=&quot;uica_viewer_description_container&quot;&gt;&lt;/div&gt;
			&lt;/div&gt;
		&lt;/div&gt;
	&lt;/form&gt;
&lt;/div&gt;
</content><properties><label text='Available views' /><checkbox default='true' help='If checked, a button will be displayed at the top to select the &apos;month&apos; view' name='month' value='Month' /><checkbox default='true' help='If checked, a button will be displayed at the top to select the &apos;week&apos; view' name='agendaWeek' value='Week' /><checkbox default='true' help='If checked, a button will be displayed at the top to select the &apos;list&apos; view' name='listMonth' value='List' /><checkbox default='true' help='If checked, a button will be displayed at the top to select the &apos;day&apos; view' name='agendaDay' value='Day' /><radio class='dafaultDayRadio' default='&apos;now&apos;' display='The current period|The last displayed period' help='Choose on which day the calendar is opened&lt;br&gt;The period containing the day the user open your website&lt;br&gt;The period of your choice: the calendar will always open on the same period, the one displayed when you last saved your website.' name='default_date' title='Period displayed' values='now|current_day' /></properties><design_properties /></view><script>UI_Calendar={scriptLoaded:false,getLang:false};
UI_List.UI_Calendar={initialize:function(a){this.cpt=a;
a.setOptions([&quot;locked&quot;]);
this.importCSS(&quot;//cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.1.0/fullcalendar.min.css&quot;,&quot;uica_css1&quot;)
},onDisplay:function(b){var a=this;
this.locale=&quot;en&quot;;
this.defaultDay=moment();
this.currentView=&quot;month&quot;;
this.button_header=(this.cpt.data.header_btn!=null)?this.cpt.data.header_btn:{month:true,agendaWeek:true,listMonth:true,agendaDay:true};
this.calendarNode=$(&quot;.uica_calendar&quot;,this.cpt.node);
this.calendar=$(&quot;.uica_calendar_container&quot;,this.cpt.node);
if(v.mode==&quot;editor&quot;){a.onDisplayEditorMode(b)
}else{a.onDisplayViewerMode(b)
}if(!UI_Calendar.scriptLoaded){UI_Calendar.scriptLoaded=$.getScript(&quot;//cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.2.0/fullcalendar.min.js&quot;)
}UI_Calendar.scriptLoaded.done(function(c,d){if(!UI_Calendar.getLang){UI_Calendar.getLang=$.getScript(&quot;//cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.2.0/locale-all.js&quot;)
}UI_Calendar.getLang.done(function(e,f){a.displayCalendar()
}).fail(function(g,f,e){dbg.error(&quot;fullCalendar locale-all.js can not be loaded&quot;)
})
}).fail(function(e,d,c){dbg.error(&quot;fullCalendar.min.js can not be loaded&quot;)
})
},onDisplayEditorMode:function(b){var a=this;
this.n={windowAE:b.find(&quot;.uica_window&quot;),header_windows:b.find(&quot;.uica_header_window&quot;),close_button:b.find(&quot;.uica_window_close_btn&quot;),input_start_datepicker:b.find(&quot;.uica_startdatepicker&quot;),input_end_datepicker:b.find(&quot;.uica_enddatepicker&quot;),title_event:b.find(&quot;.uica_title_event&quot;),description_event:b.find(&quot;.uica_ptxt&quot;),submit_btn:b.find(&quot;.uica_submit_btn&quot;),checkbox_hour:b.find(&quot;.uica_input_use_hour&quot;),color_picker:b.find(&quot;.uica_colorPicker&quot;),button_cs:b.find(&quot;.uica_cs_opener&quot;),delete_button:b.find(&quot;.uica_delete_btn&quot;)};
this.n.cs={color_selector_main:b.find(&quot;.uica_color_selector&quot;),color_selector_container:b.find(&quot;.uica_cs_container&quot;),color_selector_one_color_card:b.find(&quot;.uica_cs_one_color_card&quot;),color_selector_color_container:b.find(&quot;.uica_cs_color_container&quot;),color_selector_card_more:b.find(&quot;.uica_cs_card_more&quot;),color_selector_card_more_icon:b.find(&quot;.uica_cs_card_more_icon&quot;),color_selector_close_btn:b.find(&quot;.uica_cf_close_btn&quot;),color_selector_card_more_text:b.find(&quot;.uica_cs_card_more_text&quot;)};
a.n.cs.color_selector_main.hide();
a.n.windowAE.hide().appendTo(&quot;#site&quot;).click(function(){editorController.deselect()
});
a.n.delete_button.hide();
a.n.input_start_datepicker.datetimepicker({collapse:false,format:&quot;DD/MM/YYYY&quot;});
a.n.input_end_datepicker.datetimepicker({collapse:false,format:&quot;DD/MM/YYYY&quot;});
this.create_color_selector();
a.n.button_cs.unbind(&quot;click&quot;).on(&quot;click&quot;,function(){a.n.cs.color_selector_main.toggle()
});
a.n.close_button.unbind(&quot;click&quot;).on(&quot;click&quot;,function(){a.cleanAndHidePopup()
});
a.n.color_picker.chromoselector({speed:0,color2str:function(c){return c.getRgbString()
},update:function(){var c=$(this).chromoselector(&quot;getColor&quot;).getRgbString();
a.setColorPopup(c)
},save:function(){$(this).css(&quot;border-color&quot;,$(this).chromoselector(&quot;getColor&quot;).getRgbString()).val($(this).chromoselector(&quot;getColor&quot;).getRgbString())
}}).on(&quot;focus&quot;,function(){a.n.color_picker.css({&quot;background-color&quot;:&quot;#fff&quot;,&quot;border-color&quot;:a.n.color_picker.chromoselector(&quot;getColor&quot;).getRgbString(),color:&quot;#333&quot;,cursor:&quot;text&quot;,&quot;background-image&quot;:&quot;&quot;})
}).on(&quot;blur&quot;,function(){$(this).css({&quot;background-color&quot;:$(this).chromoselector(&quot;getColor&quot;).getRgbString(),&quot;border-color&quot;:&quot;#fff&quot;,color:&quot;transparent&quot;,cursor:&quot;pointer&quot;})
}).css(&quot;background-color&quot;,$(&quot;#u2_foreground&quot;).css(&quot;background-color&quot;)).val($(&quot;#u2_foreground&quot;).css(&quot;background-color&quot;)).css(&quot;color&quot;,&quot;transparent&quot;);
a.n.color_picker.chromoselector(&quot;setColor&quot;,&quot;#F4511E&quot;).trigger(&quot;blur&quot;)
},onDisplayViewerMode:function(b){var a=this;
color_selector_main=b.find(&quot;.uica_color_selector&quot;).hide();
a.viewer={popviewer_event_window:b.find(&quot;.uica_viewer_event_window&quot;),popviewer_header_window:b.find(&quot;.uica_viewer_header_window&quot;),popviewer_uica_title_event:b.find(&quot;.uica_viewer_title_event&quot;),popviewer_content:b.find(&quot;.uica_viewer_content&quot;),popviewer_event_dates:b.find(&quot;.uica_viewer_event_dates&quot;),popviewer_date_event:b.find(&quot;.uica_viewer_date_event&quot;),popviewer_uica_elements:b.find(&quot;.uica_viewer_uica_elements&quot;),popviewer_description_container:b.find(&quot;.uica_viewer_description_container&quot;),popviewer_close_btn:b.find(&quot;.uica_viewer_close_btn&quot;)};
a.viewer.popviewer_close_btn.unbind(&quot;click&quot;).on(&quot;click&quot;,function(){a.cleanViewerPopup()
});
a.popup_position={x:0,y:0};
a.viewer.hovered_event=false;
a.viewer.popup_locked=false;
a.viewer.popviewer_event_window.hide()
},displayCalendar:function(){var a=this;
a.header_btn=&quot;&quot;;
$.each(this.button_header,function(b,c){if(c){a.header_btn+=(a.header_btn==&quot;&quot;)?b:&quot;,&quot;+b
}});
a.calendarHash={header:{left:&quot;prev,next today&quot;,center:&quot;title&quot;,right:a.header_btn},firstDay:1,defaultDate:this.cpt.data.saved_initial_date,defaultView:this.cpt.data.saved_view,locale:this.locale,weekNumbers:this.button_header.agendaWeek,height:&quot;parent&quot;,navLinks:true,eventLimit:true,timezone:&quot;local&quot;,nowIndicator:true,eventTextColor:&quot;#ffffff&quot;};
if(v.mode==&quot;editor&quot;){a.specificHash={selectable:true,selectHelper:true,editable:true,select:function(e,d,c){var b=function(){a.defaultDay=e;
a.cleanPopup();
a.showNewEventPopup(e,d,c)
};
if(a.cpt.id){b()
}else{if(confirm(sprintf(&quot;Do you want to save the page &apos;%1$s&apos; (as a draft) to start adding events?&quot;,a.cpt.page.name))){a.cpt.page.save();
b()
}}},viewRender:function(b,c){if(a.cpt.data.default_date!=&quot;now&quot;){a.cpt.setData(&quot;saved_initial_date&quot;,a.calendar.fullCalendar(&quot;getDate&quot;))
}a.cpt.setData(&quot;saved_view&quot;,b.name)
},eventRender:function(c,b){if(c.rendering==&quot;background&quot;){if(c.last){c.last=!c.last
}else{b.hide()
}}},unselect:function(d,c,b){editorController.deselect()
},addEvent:function(b){},eventClick:function(d,c,b){a.showModifyPopup(d,c,$(this))
},eventAfterAllRender:function(){a.calendarNode.on(&quot;click&quot;,function(b){var c=$(b.target);
if(!(c.hasClass(&quot;fc-day&quot;)||c.hasClass(&quot;fc-day-top&quot;)||c.closest(&quot;.fc-event-container&quot;).length)){a.cleanAndHidePopup()
}});
a.calendar.find(&quot;.fc-view&quot;).mousedown(function(){blockSelector.node.draggable(&quot;disable&quot;);
$(window).one(&quot;mouseup&quot;,function(){blockSelector.node.draggable(&quot;enable&quot;)
})
})
},eventDrop:function(c,d,b){a.sendEventModified(c)
},eventResize:function(b){a.sendEventModified(b)
},events:function(e,b,c,d){a.cpt.ask({request:&quot;get_all_events&quot;,data:{start:e,end:b}},function(f){d(f.events)
})
}}
}else{a.specificHash={selectable:false,selectHelper:false,editable:false,eventRender:function(c,b){b.on(&quot;mousemove&quot;,function(d){if(!a.viewer.popup_locked){clearTimeout(a.viewer.popviewer_event_window_to);
a.viewer.popviewer_event_window_to=setTimeout(function(){a.showPopupViewer(c,d,$(this))
},500)
}}).on(&quot;mouseleave&quot;,function(d){var e=$(d.relatedTarget);
clearTimeout(a.viewer.popviewer_event_window_to);
if(!(e.closest(&quot;.uica_viewer_event_window&quot;).length)&amp;&amp;(!a.viewer.popup_locked)){a.cleanViewerPopup()
}})
},eventClick:function(d,c,b){a.showPopupViewer(d,c,$(this));
a.viewer.popup_locked=true
},viewRender:function(b,c){a.cleanViewerPopup()
},events:function(e,b,c,d){a.cpt.ask({request:&quot;get_all_events&quot;,data:{start:e,end:b}},function(f){d(f.events)
})
}}
}this.calendar.fullCalendar(Object.extend(a.calendarHash,a.specificHash))
},create_color_selector:function(){var a=this;
this.colors=[&quot;#F44336&quot;,&quot;#E91E63&quot;,&quot;#9C27B0&quot;,&quot;#673AB7&quot;,&quot;#3F51B5&quot;,&quot;#2196F3&quot;,&quot;#03A9F4&quot;,&quot;#00BCD4&quot;,&quot;#009688&quot;,&quot;#4CAF50&quot;,&quot;#8BC34A&quot;,&quot;#CDDC39&quot;,&quot;#FFEB3B&quot;,&quot;#FFC107&quot;,&quot;#FF9800&quot;,&quot;#FF5722&quot;,&quot;#795548&quot;,&quot;#9E9E9E&quot;,&quot;#607D8B&quot;];
this.colors_alt=[&quot;#F4511E&quot;,&quot;#F6BF26&quot;,&quot;#0B8043&quot;,&quot;#33B679&quot;,&quot;#039BE5&quot;,&quot;#3F51B5&quot;,&quot;#7986CB&quot;,&quot;#8E24AA&quot;,&quot;#E67C73&quot;,&quot;#616161&quot;,&quot;#C0CA33&quot;,&quot;#F44336&quot;,&quot;#E91E63&quot;,&quot;#9C27B0&quot;,&quot;#FF5722&quot;,&quot;#795548&quot;,&quot;#9E9E9E&quot;,&quot;#607D8B&quot;];
this.n.cs.color_selector_close_btn.on(&quot;click&quot;,function(){a.n.cs.color_selector_main.toggle()
});
$.each(a.colors_alt,function(b,c){new_color_card=$(&quot;&lt;div class=&apos;uica_cs_one_color_card&apos;&gt;&quot;);
new_color_container=$(&quot;&lt;div class=&apos;uica_cs_color_container&apos;&gt;&quot;);
new_color_card.on(&quot;click&quot;,function(){a.n.color_picker.chromoselector(&quot;setColor&quot;,c).trigger(&quot;blur&quot;);
a.setColorPopup(a.n.color_picker.chromoselector(&quot;getColor&quot;).getRgbString())
}).on(&quot;blur&quot;,function(){a.n.cs.color_selector_main.toggle()
});
new_color_card.css(&quot;background-color&quot;,c);
new_color_container.appendTo(new_color_card);
new_color_card.prependTo(a.n.cs.color_selector_container)
})
},setColorPopup:function(c){var b=this;
var d=c.replace(/[^\d,]/g,&quot;&quot;).split(&quot;,&quot;);
var a=(((d[0]*299+d[1]*587+d[2]*114)/1000)&gt;125)?&quot;rgb(0,0,0)&quot;:&quot;rgb(255,255,255)&quot;;
b.n.header_windows.css(&quot;background-color&quot;,c);
b.n.windowAE.css(&quot;border-color&quot;,c);
b.n.header_windows.find(&quot;.uica_te&quot;).css(&quot;border-color&quot;,a);
b.n.header_windows.add(b.n.header_windows.find(&quot;.uica_te&quot;)).css(&quot;color&quot;,a)
},setDefaultDate:function(){var a=this;
if(a.cpt.data.default_date==&quot;now&quot;){a.calendar.fullCalendar(&quot;gotoDate&quot;,moment().format());
a.cpt.setData(&quot;saved_initial_date&quot;,moment().format())
}else{a.calendar.fullCalendar(&quot;gotoDate&quot;,a.cpt.data.saved_initial_date)
}},importCSS:function(b,a){if(!$(&quot;#&quot;+a).length){var c=document.getElementsByTagName(&quot;head&quot;)[0];
var d=document.createElement(&quot;link&quot;);
d.rel=&quot;stylesheet&quot;;
d.type=&quot;text/css&quot;;
d.href=b;
d.media=&quot;all&quot;;
d.id=a;
c.appendChild(d)
}},showPopupViewer:function(e,b,d){var c=this;
var a=$(&quot;#body&quot;);
if(this.current_popup_event==e&amp;&amp;c.viewer.popviewer_event_window.is(&quot;:visible&quot;)){return
}this.current_popup_event=e;
c.viewer.hovered_event=true;
c.viewer.popviewer_uica_title_event.html(e.title+&quot; &quot;);
c.viewer.popviewer_date_event.html(sprintf(&quot;From %1$s to %2$s&quot;,&quot;&lt;span&gt;&quot;+((e.allDay)?e.start.locale(this.locale).format():e.start.locale(this.locale).format(&quot;LLLL&quot;))+&quot;&lt;/span&gt;&quot;,&quot;&lt;span&gt;&quot;+((e.allDay)?e.end.locale(this.locale).format():e.end.locale(this.locale).format(&quot;LLLL&quot;))+&quot;&lt;/span&gt;&quot;));
if(e.description){c.viewer.popviewer_uica_elements.show();
c.viewer.popviewer_description_container.html(e.description).css(&quot;max-height&quot;,($(window).height()/2)+&quot;px&quot;)
}else{c.viewer.popviewer_uica_elements.hide()
}c.setColorPopupViewer(e.color);
c.viewer.popviewer_event_window.appendTo($(&quot;#body&quot;)).css({left:Math.min(b.pageX,a.offset().left+a.width()-c.viewer.popviewer_event_window.width())-a.offset().left,top:Math.min(b.pageY-50,a.offset().top+a.height()-c.viewer.popviewer_event_window.height()-50)-a.offset().top,&quot;z-index&quot;:90000}).show()
},setColorPopupViewer:function(c){var b=this;
var d=c.replace(/[^\d,]/g,&quot;&quot;).split(&quot;,&quot;);
var a=(((d[0]*299+d[1]*587+d[2]*114)/1000)&gt;125)?&quot;rgb(0,0,0)&quot;:&quot;rgb(255,255,255)&quot;;
b.viewer.popviewer_header_window.css(&quot;background-color&quot;,c);
b.viewer.popviewer_header_window.css(&quot;color&quot;,a);
b.viewer.popviewer_event_window.css(&quot;border-color&quot;,c)
},cleanViewerPopup:function(){var a=this;
a.viewer.popviewer_event_window.hide();
a.viewer.popup_locked=false;
a.current_popup_event=null;
a.viewer.popviewer_uica_title_event.html(&quot;&quot;);
a.viewer.popviewer_date_event.html(&quot;&quot;);
a.viewer.popviewer_description_container.empty()
},showPopup:function(e,c,b){var d=this;
var a={x:$(&quot;#advised_width_center&quot;),y:$(&quot;#body&quot;)};
setTimeout(function(){d.n.windowAE.appendTo(&quot;#site_tools&quot;).show().css({top:Math.min(b.pageY-100,a.y.offset().top+a.y.height()-d.n.windowAE.height()-50)-$(&quot;#site_tools&quot;).offset().top,left:Math.min(b.pageX,a.x.offset().left+a.x.width()-d.n.windowAE.width())-$(&quot;#site_tools&quot;).offset().left,&quot;z-index&quot;:90000})
},100);
d.n.checkbox_hour.prop(&quot;checked&quot;,!(e.minutes()==0&amp;&amp;e.hours()==0&amp;&amp;c.minutes()==0&amp;&amp;c.hours()==0)).trigger(&quot;change&quot;);
d.n.input_start_datepicker.data(&quot;DateTimePicker&quot;).date(e.local());
d.n.input_end_datepicker.data(&quot;DateTimePicker&quot;).date(c.local());
d.n.delete_button.hide();
d.n.checkbox_hour.change(function(){d.n.input_start_datepicker.data(&quot;DateTimePicker&quot;).destroy();
d.n.input_end_datepicker.data(&quot;DateTimePicker&quot;).destroy();
if($(this).is(&quot;:checked&quot;)){d.n.input_start_datepicker.datetimepicker({collapse:false,locale:d.locale});
d.n.input_end_datepicker.datetimepicker({collapse:false,locale:d.locale})
}else{d.n.input_start_datepicker.datetimepicker({collapse:false,locale:d.locale,format:&quot;DD/MM/YYYY&quot;});
d.n.input_end_datepicker.datetimepicker({collapse:false,locale:d.locale,format:&quot;DD/MM/YYYY&quot;})
}d.n.input_start_datepicker.data(&quot;DateTimePicker&quot;).date(e);
d.n.input_end_datepicker.data(&quot;DateTimePicker&quot;).date(c)
})
},showModifyPopup:function(d,a,c){var b=this;
b.showPopup(d.start,d.end,a);
b.n.title_event.val(d.title);
b.n.description_event.html(d.description);
b.n.checkbox_hour.prop(&quot;checked&quot;,!d.allDay).trigger(&quot;change&quot;);
b.n.input_start_datepicker.data(&quot;DateTimePicker&quot;).date(d.start);
b.n.input_end_datepicker.data(&quot;DateTimePicker&quot;).date(d.end);
b.setColorPopup(d.color);
b.n.submit_btn.html(&quot;Modify Event&quot;);
b.n.color_picker.chromoselector(&quot;setColor&quot;,d.color).trigger(&quot;blur&quot;);
b.n.submit_btn.unbind(&quot;click&quot;).on(&quot;click&quot;,function(){b.modifyEvent(d)
});
b.n.delete_button.show().unbind(&quot;click&quot;).on(&quot;click&quot;,function(){b.calendar.fullCalendar(&quot;removeEvents&quot;,d.id);
b.removeEvent(d.id,c);
b.cleanAndHidePopup()
})
},showNewEventPopup:function(d,b,a){var c=this;
c.showPopup(d,b,a);
c.n.submit_btn.html(&quot;Add Event&quot;);
c.n.submit_btn.unbind(&quot;click&quot;).on(&quot;click&quot;,function(){c.addNewEvent()
})
},cleanPopup:function(){var a=this;
a.n.title_event.val(&quot;&quot;);
a.n.description_event.html(&quot;&quot;);
a.calendar.fullCalendar(&quot;unselect&quot;);
editorController.deselect()
},cleanAndHidePopup:function(){this.cleanPopup();
this.n.cs.color_selector_main.hide();
this.n.windowAE.hide()
},addNewEvent:function(){var a=this;
editorController.pause();
a.new_event={title:a.n.title_event.val(),start:a.n.input_start_datepicker.data(&quot;DateTimePicker&quot;).viewDate(),end:a.n.input_end_datepicker.data(&quot;DateTimePicker&quot;).viewDate(),description:a.n.description_event.html(),color:a.n.color_picker.chromoselector(&quot;getColor&quot;).getRgbString(),all_day:!a.n.checkbox_hour.is(&quot;:checked&quot;)};
a.cpt.ask({request:&quot;add_event&quot;,event:a.new_event},function(b){if(b.success){a.calendar.fullCalendar(&quot;refetchEvents&quot;);
a.cleanAndHidePopup()
}else{statusController.message(b.message,&quot;warning&quot;)
}},function(){dbg.error(&quot;Event creation error&quot;)
})
},modifyEvent:function(b){var a=this;
a.date_picker_value=a.n.input_start_datepicker.data(&quot;DateTimePicker&quot;);
editorController.pause();
b.title=a.n.title_event.val();
b.start=a.n.input_start_datepicker.data(&quot;DateTimePicker&quot;).viewDate();
b.end=a.n.input_end_datepicker.data(&quot;DateTimePicker&quot;).viewDate();
b.description=a.n.description_event.html();
b.color=a.n.color_picker.chromoselector(&quot;getColor&quot;).getRgbString();
b.all_day=!a.n.checkbox_hour.is(&quot;:checked&quot;);
a.sendEventModified(b)
},removeEvent:function(d,c){var b=this;
var a=setTimeout(function(){b.confirmRemoveEvent(d);
statusController.hide()
},5000);
statusController.message(&quot;&lt;b&gt;This event is about to be deleted.&lt;/b&gt;&lt;br&gt;&lt;a href=&apos;#&apos; id=&apos;cancel_deletion_btn&apos;&gt;Cancel&lt;/a&gt;&quot;,&quot;success&quot;);
$(&quot;#cancel_deletion_btn&quot;).on(&quot;click&quot;,function(){this.calendar.fullCalendar(&quot;refetchEvents&quot;);
statusController.hide();
clearTimeout(a)
})
},sendEventModified:function(b){var a=this;
a.cpt.ask({request:&quot;update_event&quot;,event:b},function(c){if(c.success){a.calendar.fullCalendar(&quot;refetchEvents&quot;);
a.cleanAndHidePopup()
}else{statusController.message(c.message,&quot;warning&quot;)
}},function(){dbg.error(&quot;Event modification error&quot;)
})
},confirmRemoveEvent:function(b){var a=this;
a.cpt.ask({request:&quot;remove_event&quot;,id:b},function(c){a.calendar.fullCalendar(&quot;refetchEvents&quot;)
},function(){dbg.error(&quot;Event deletion error&quot;)
})
},onPropertyChanged:function(a){if(a.include(&quot;agendaDay&quot;)||a.include(&quot;listMonth&quot;)||a.include(&quot;agendaWeek&quot;)||a.include(&quot;month&quot;)){this.button_header[a[0]]=this.cpt.data[a[0]];
this.cleanAndHidePopup();
this.calendar.fullCalendar(&quot;destroy&quot;);
this.displayCalendar();
this.calendar.fullCalendar(&quot;changeView&quot;,this.header_btn.split(&quot;,&quot;)[0]);
this.cpt.setData(&quot;header_btn&quot;,this.button_header)
}if(a.include(&quot;default_date&quot;)){this.setDefaultDate()
}},onSelect:function(){},onResize:function(){editorController.deselect();
this.cleanAndHidePopup()
},onShow:function(){},onResizeStop:function(){editorController.deselect();
this.cleanAndHidePopup();
this.calendar.fullCalendar(&quot;destroy&quot;);
this.displayCalendar()
},onMoveStop:function(){editorController.deselect();
this.cleanAndHidePopup()
},onDeselect:function(){editorController.deselect();
this.cleanAndHidePopup()
}};</script><style>.uica_calendar{height:100%}
.fc-view-container{background-color:#fff}
.uica_window,.uica_viewer_event_window{box-shadow:0 2px 2px rgba(0,0,0,.3);transition:.2s;border-radius:2px;position:absolute;pointer-events:auto;background-color:#fff;max-width:440px;min-width:300px;width:300px;border:1px solid}
.uica_window .uica_viewer_description_container,.uica_viewer_event_window .uica_viewer_description_container{overflow:auto}
.uica_header_window,.uica_viewer_header_window{display:block;transition:.3s all;box-shadow:0 1px 2px rgba(0,0,0,.6);color:#fff;padding:10px;border-radius:2px 2px 0 0;background-color:#2196F3}
.uica_window_close_btn,.uica_viewer_close_btn{float:right;font-size:16px;cursor:pointer;margin-left:7px;margin-top:5px}
.editor_interface .uica_window input.uica_title_event{background-color:rgba(255,255,255,.16);color:#fff;padding:3px;border:1px solid rgba(237,237,237,.69);font-size:13px;transition:background-color .25s ease-out,border-color .25s ease-out;width:calc(100% - 70px)}
.editor_interface .uica_window input.uica_title_event:focus{border-color:#fff;background-color:rgba(255,255,255,.3)}
.input_date{font-size:25px;transition:.3s;border-style:none;border-bottom:1px solid #000}
.input_date:focus{border-style:none;border-bottom:1px solid #2196F3}
.uica_elements,.uica_viewer_uica_elements{margin-top:10px}
.uica_content,.uica_viewer_content{padding:10px}
.uica_event_dates{display:block}
.uica_ptxt,.body.uica_ptxt{background-color:transparent;color:#333;font-size:14px}
.uica_window .uica_ptxt,.body .uica_ptxt{border:2px solid #ccc;height:100px;overflow:auto}
.uica_footer{text-align:center;padding-bottom:10px}
.uica_submit_btn.btn.btn-default,.uica_delete_btn.btn.btn-danger{margin:5px;border-radius:2px}
.input-group-addon{transition:all .3s linear;padding:6px 12px;font-size:15px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border-radius:0 2px 0 2px;top:1px;position:absolute;height:27px;left:1px;box-shadow:0 2px 2px #0001a inset}
.input-group-addon:hover{background-color:#2196F3;color:#fff}
.input-group-addon .fonticon{cursor:pointer}
.form-control{display:block;width:100%;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc}
.input-group{margin-top:5px;position:relative;border-collapse:separate}
.uica_colorPicker{border:1px solid;border-radius:4px;float:right;width:100px;padding:2px 10px}
.uica_cs_container{text-align:center}
.uica_cs_one_color_card{height:30px;display:inline-block;width:30px;margin:4px;padding:5px;border-radius:50%;cursor:pointer;vertical-align:top;transition:.2s all}
.uica_cs_one_color_card:hover{box-shadow:0 2px 3px 0 #696969}
.uica_cs_title{background-color:#6db21e;box-shadow:0 1px 4px rgba(0,0,0,.6);padding:11px 10px;margin:-9px;margin-bottom:10px;border-radius:2px 2px 0 0}
.uica_color_selector{display:block;position:absolute;top:52px;left:10px;z-index:1;background-color:#fff;box-shadow:0 .5px 0 0 #fff inset,0 1px 2px 0 #696969;border-radius:6px;padding:9px;right:10px}
.uica_cf_close_btn{float:right;font-size:16px;cursor:pointer}
.fc-event{text-align:center;transition:.2s all}
.fc-event:hover{transition:.3s all;box-shadow:0 1px 2px rgba(0,0,0,.19),1px 2px 7px rgba(0,0,0,.23)}
.uica_cs_card_more{border-top:1px solid gray;padding-top:7px}
.uica_cs_textcolor{color:grey;cursor:default;display:inline-block;position:relative;top:3px}
.uica_cs_square{height:20px;position:absolute;background-color:#6db21e;width:20px;left:78%;transform:rotate(45deg);top:-8px;border-radius:3px}
.uica_viewer_date_event span{font-weight:700;white-space:nowrap}
.uica_cs_opener .fonticon{font-size:18px;cursor:pointer}
.UI_Calendar .fc-state-default{text-shadow:none;background-image:none;box-shadow:none}
.UI_Calendar .fc-state-disabled{display:none}</style></uidget>