<?xml version='1.0' encoding='UTF-8'?><uidget><metadata><name>Agenda</name><api_version>1.0</api_version><size height='500' width='650' /><server>local://CalendarCptServer</server><blog en='662' /></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;Titre de l&apos;évènement&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;Choisir une couleur&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;Ou une autre couleur&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 id=&quot;use_hour_text&quot; for=&quot;use_hour&quot;&gt;Préciser les heures&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;Début&lt;/label&gt;
					&lt;div class=&quot;day_container&quot;&gt;
						&lt;select class=&quot;start_day_chooser&quot;&gt;
							&lt;option value=&quot;1&quot;&gt;Lundi&lt;/option&gt;
							&lt;option value=&quot;2&quot;&gt;Mardi&lt;/option&gt;
							&lt;option value=&quot;3&quot;&gt;Mercredi&lt;/option&gt;
							&lt;option value=&quot;4&quot;&gt;Jeudi&lt;/option&gt;
							&lt;option value=&quot;5&quot;&gt;Vendredi&lt;/option&gt;
							&lt;option value=&quot;6&quot;&gt;Samedi&lt;/option&gt;
							&lt;option value=&quot;0&quot;&gt;Dimanche&lt;/option&gt;
						&lt;/select&gt;
					&lt;/div&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;Fin&lt;/label&gt;
					&lt;div class=&quot;day_container&quot;&gt;
						&lt;select class=&quot;end_day_chooser&quot;&gt;
							&lt;option value=&quot;1&quot;&gt;Lundi&lt;/option&gt;
							&lt;option value=&quot;2&quot;&gt;Mardi&lt;/option&gt;
							&lt;option value=&quot;3&quot;&gt;Mercredi&lt;/option&gt;
							&lt;option value=&quot;4&quot;&gt;Jeudi&lt;/option&gt;
							&lt;option value=&quot;5&quot;&gt;Vendredi&lt;/option&gt;
							&lt;option value=&quot;6&quot;&gt;Samedi&lt;/option&gt;
							&lt;option value=&quot;0&quot;&gt;Dimanche&lt;/option&gt;
						&lt;/select&gt;
					&lt;/div&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; Supprimer&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;

&lt;!-- Windows selection mode --&gt;

&lt;div class=&quot;uica_mode_selection_window editor_interface&quot;&gt;
	&lt;div class=&quot;uica_mode_selection_header&quot;&gt;
		&lt;h3&gt;Choisissez le mode d&apos;affichage&lt;/h3&gt;
	&lt;/div&gt;
	&lt;div class=&quot;uica_mode_selection_first_choice_container&quot; data-mode=&quot;calendar&quot;&gt;
	  &lt;div class=&quot;uica_mode_selection_choice_header&quot;&gt;
	  	&lt;h3&gt;Calendrier&lt;/h3&gt;
		&lt;/div&gt;
	  &lt;div class=&quot;uica_mode_selection_content&quot;&gt;
			&lt;img class=&quot;uica_mode_selection_illustration&quot; src=&quot;/components/UI_Calendar/agenda.svg&quot; alt=&quot;&quot;&gt;
			&lt;p&gt;Affiche un calendrier sur sur votre site - ajoutez et modifiez des évènements à des dates spécifiques.&lt;/p&gt;
		&lt;/div&gt;
	  &lt;div class=&quot;uica_mode_selection_footer&quot;&gt;
			&lt;button type=&quot;button&quot; class=&quot;uica_mode_selection_calendar_choice btn btn-primary&quot; value=&quot;calendar&quot;&gt;Mode Calendrier&lt;/button&gt;
		&lt;/div&gt;
	&lt;/div&gt;
	&lt;div class=&quot;uica_mode_selection_second_choice_container&quot; data-mode=&quot;agenda&quot;&gt;
		&lt;div class=&quot;uica_mode_selection_choice_header&quot;&gt;
			&lt;h3&gt;Horaires&lt;/h3&gt;
		&lt;/div&gt;
		&lt;div class=&quot;uica_mode_selection_content&quot;&gt;
			&lt;img class=&quot;uica_mode_selection_illustration&quot; src=&quot;/components/UI_Calendar/emploie_du_temps.svg&quot; alt=&quot;&quot;&gt;
			&lt;p&gt;Vous avez une activité avec un planning récurrent ? Utilisez le mode Horaires.&lt;/p&gt;
		&lt;/div&gt;
		&lt;div class=&quot;uica_mode_selection_footer&quot;&gt;
			&lt;button type=&quot;button&quot; class=&quot;uica_mode_selection_agenda_choice btn btn-primary&quot; value=&quot;agenda&quot;&gt;Mode Horaires&lt;/button&gt;
		&lt;/div&gt;
	&lt;/div&gt;
&lt;/div&gt;
</content><properties><bloc><radio class='default_mode_radio' default='&apos;not_set&apos;' display='Mode Horaires|Mode Calendrier' help='Le module Agenda a 2 types d&apos;affichage :&lt;br/&gt;
				- un Calendrier : avec des évènements à des dates spécifiques (idéal pour afficher des réservations par exemple).&lt;br/&gt;
				- des Horaires : qui ne montrent que certains jours d&apos;une semaine (idéal pour afficher vos horaires d&apos;ouverture par exemple)' name='default_mode' title='Style d&apos;affichage' values='agenda|calendar' /></bloc><bloc class='calendar_mode_option'><checkbox default='true' help='Si coché, un bouton sera affiché en haut pour sélectionner la vue &apos;Mois&apos;.' name='month' title='Vues disponibles' value='Mois' /><checkbox default='true' help='Si coché, un bouton sera affiché en haut pour sélectionner la vue &apos;Semaine&apos;.' name='agendaWeek' value='Semaine' /><checkbox default='true' help='Si coché, un bouton sera affiché en haut pour sélectionner la vue &apos;Planning&apos;.' name='listMonth' value='Planning' /><checkbox default='false' help='Si coché, un bouton sera affiché en haut pour sélectionner la vue &apos;Planning annuel&apos;.' name='listYear' value='Planning annuel' /><checkbox default='true' help='Si coché, un bouton sera affiché en haut pour sélectionner la vue &apos;Jour&apos;.' name='agendaDay' value='Jour' /><checkbox default='false' help='Si coché, les visiteurs ne pourront pas consulter les évènements passés dans le calendrier.' name='blockPast' title='Autres options' value='Présent et futur seulement' /><radio class='defaultDayRadio' default='&apos;now&apos;' display='La période actuelle|La dernière période affichée' help='Choisissez sur quels jours le calendrier s&apos;ouvre&lt;br&gt;La période contenant le jour où le visiteur a ouvert votre site&lt;br&gt;La période de votre choix : le calendrier s&apos;ouvrira toujours sur la même période, celle qui est affichée au moment où votre page est sauvegardée.' name='default_date' text='' title='Période affichée' values='now|current_day' /></bloc><bloc class='agenda_mode_option'><label text='' title='Options de l&apos;agenda' /><select default='&apos;0&apos;' display='Lundi|Mardi|Mercredi|Jeudi|Vendredi|Samedi|Dimanche' help='Définissez le premier jour de la semaine' name='agenda_start_date' title='Premier jour' values='0|1|2|3|4|5|6' /><radio class='defaultDayRadio' default='30' display='5min|10 min|15 min|30 min|60 min' name='event_duration' text='' title='Période affichée' values='5|10|15|30|60' /><slider class='uim_prop_custom uim_prop_font_size agenda_mode_option' default='5' help='Définissez combien de jours sont affichés.' maximum='7' minimum='1' name='week_day_number' title='Nombre de jours' /></bloc><bloc><slider class='uim_prop_custom agenda_mode_option calendar_mode_option agenda_mode_option_start_hour' default='8' help='Définissez la première heure de chaque jour.' maximum='23' minimum='0' name='start_hour' title='Heure de début' /><slider class='uim_prop_custom agenda_mode_option calendar_mode_option agenda_mode_option_day_duration' default='12' help='Définissez combien d&apos;heures sont affichées chaque jour.' maximum='24' minimum='1' name='day_duration' title='Durée du jour (en heures)' /></bloc><calendar_selector default='[]' help='Afficher des évènements de calendriers Google personnels ou publics' icon='calendar' name='calendarsFile' /></properties><design_properties><trigger_preset class='gtbackdrop_prop_custom' gt_type='backdrop' help='Sélectionnez un style prédéfini de fond' icon='palette' mode='select' name='backdrop_preset' text='Style de fond' /><trigger_preset class='gtbutton_prop_custom' gt_type='button' help='Sélectionnez un style prédéfini pour les boutons de l&apos;entête' icon='palette' mode='select' name='buttons_preset' text='Style des boutons' /></design_properties></view><script>UI_Calendar={scriptLoaded:!1,getLang:!1};UI_List.UI_Calendar={
initialize:function(e){this.cpt=e
;e.setOptions([&quot;locked&quot;,&quot;footer&quot;])
;this.importCSS(&quot;//cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.4.0/fullcalendar.min.css&quot;,&quot;uica_css1&quot;)
},onDisplay:function(e){var t=this
;if(!this.cpt.data.default_mode){
this.cpt.data.default_mode=&quot;calendar&quot;
;this.cpt.data.week_day_number=5
;this.cpt.data.agenda_start_date=0;this.cpt.data.start_hour=8
;this.cpt.data.day_duration=12;this.cpt.data.event_duration=30}
this.locale=&quot;fr&quot;;this.defaultDay=moment()
;this.currentView=&quot;month&quot;
;this.button_header=null!=this.cpt.data.header_btn?this.cpt.data.header_btn:{
month:!0,agendaWeek:!0,listMonth:!0,agendaDay:!0}
;this.calendarNode=$(&quot;.uica_calendar&quot;,this.cpt.node)
;this.calendar=$(&quot;.uica_calendar_container&quot;,this.cpt.node)
;e.find(&quot;.uica_mode_selection_window&quot;).hide()
;e.css(&quot;overflow&quot;,&quot;visible&quot;)
;this.cpt.use_graphical_preset(&quot;button&quot;,[&quot;buttons_preset&quot;])
;this.cpt.use_graphical_preset(&quot;backdrop&quot;,[&quot;backdrop_preset&quot;])
;if(&quot;editor&quot;==v.mode){if(&quot;not_set&quot;!=this.cpt.data.default_mode){
this.onDisplayCorrectMode(e);this.displayCalendar()
}else this.askChoice(e)
;this.calendarNode.on(&quot;click&quot;,function(e){var a=$(e.target)
;a.hasClass(&quot;fc-day&quot;)||a.hasClass(&quot;fc-day-top&quot;)||a.closest(&quot;.fc-event-container&quot;).length||t.cleanAndHidePopup()
})}else{this.instantiateViewerModePopup(e)
;this.displayCalendar()}},askChoice:function(e){var t=this
;this.choice_window={
window_container:e.find(&quot;.uica_mode_selection_window&quot;),
first_choice_container:e.find(&quot;.uica_mode_selection_first_choice_container&quot;),
second_choice_container:e.find(&quot;.uica_mode_selection_second_choice_container&quot;)
};this.choice_window.window_container.show();var a=function(){
var a=$(this).data(&quot;mode&quot;);t.onDisplayCorrectMode(e)
;t.cpt.setData(&quot;default_mode&quot;,a)
;t.cpt.propertyNode.find(&quot;.default_mode_radio input[value=&quot;+a+&quot;]&quot;).click()
};this.choice_window.first_choice_container.click(a)
;this.choice_window.second_choice_container.click(a)},
displayCalendar:function(){
if(&quot;not_set&quot;!=this.cpt.data.default_mode){var e=this
;if(this.calendar.fullCalendar){e.header_btn=&quot;&quot;
;$.each(this.button_header,function(t,a){
a&amp;&amp;(e.header_btn+=&quot;&quot;==e.header_btn?t:&quot;,&quot;+t)})
;if(&quot;calendar&quot;==this.cpt.data.default_mode||this.cpt.data.default_mode==undefined){
e.calendarHash={header:{left:&quot;prev,next today&quot;,center:&quot;title&quot;,
right:e.header_btn},firstDay:1,timeFormat:&quot;HH:mm&quot;,
defaultDate:&quot;now&quot;==e.cpt.data.default_date?moment().format():this.cpt.data.saved_initial_date,
defaultView:this.cpt.data.saved_view,locale:this.locale,
weekNumbers:this.button_header.agendaWeek,
height:&quot;mobile_tree&quot;==deviceController.device?&quot;auto&quot;:&quot;parent&quot;,
navLinks:!0,eventLimit:!1,timezone:&quot;local&quot;,nowIndicator:!0,
eventTextColor:&quot;#ffffff&quot;,views:{agendaWeek:{
minTime:moment.duration({hours:e.cpt.data.start_hour}),
maxTime:moment.duration({
hours:e.cpt.data.start_hour+e.cpt.data.day_duration})},
listYear:{type:&quot;list&quot;,buttonText:&quot;My schedule&quot;,duration:{years:1
}}}}
;if(this.cpt.data.externalCalendar&amp;&amp;this.cpt.data.externalCalendar.length&gt;0){
e.calendarHash.googleCalendarApiKey=&quot;AIzaSyCWforQeNUlsCkrtK_BcmLtfifWJ0Ic0d0&quot;
;e.calendarHash.eventSources=this.cpt.data.externalCalendar}
}else e.calendarHash={header:!1,defaultView:&quot;agendaPeriodWeek&quot;,
height:&quot;mobile_tree&quot;==deviceController.device?&quot;auto&quot;:&quot;parent&quot;,
timeFormat:&quot;HH:mm&quot;,locale:this.locale,timezone:&quot;local&quot;,
firstDay:7==e.cpt.data.week_day_number?parseInt(this.cpt.data.agenda_start_date)+1:this.cpt.data.agenda_start_date,
views:{agendaPeriodWeek:{type:&quot;agenda&quot;,minTime:moment.duration({
hours:e.cpt.data.start_hour}),maxTime:moment.duration({
hours:e.cpt.data.start_hour+e.cpt.data.day_duration}),
slotDuration:moment.duration({minutes:e.cpt.data.event_duration
}),columnFormat:&quot;dddd&quot;,allDayText:&quot;Tout le jour&quot;,duration:{
days:e.cpt.data.week_day_number}}}}
;&quot;editor&quot;==v.mode?e.specificHash={selectable:!0,selectHelper:!0,
editable:!0,select:function(t,a,n){var o=function(){
e.defaultDay=t;e.cleanPopup()
;e.showNewEventPopup(t,a,n,e.cpt.data.default_mode)
;e.calendar.fullCalendar(&quot;renderEvent&quot;,{id:&quot;selected_zone&quot;,
title:&quot;&quot;,start:t,end:a,rendering:&quot;background&quot;})}
;if(e.cpt.idserver)o();else if(confirm(sprintf(&quot;Souhaitez-vous sauvegarder cette page (dans le brouillon) pour commencer la configuration du module ?&quot;))){
e.cpt.page.saveAndCleanHistory();o()}},viewRender:function(t){
e.calendar.find(&quot;.fc-view&quot;).off(&quot;mousedown.uica_&quot;+e.cpt.id).on(&quot;mousedown.uica_&quot;+e.cpt.id,function(){
blockSelector.node.draggable(&quot;disable&quot;)
;$(window).off(&quot;mouseup.uica_&quot;+e.cpt.id).one(&quot;mouseup.uica_&quot;+e.cpt.id,function(){
blockSelector.node.draggable(&quot;enable&quot;)})})
;&quot;now&quot;!=e.cpt.data.default_date&amp;&amp;e.cpt.setData(&quot;saved_initial_date&quot;,e.calendar.fullCalendar(&quot;getDate&quot;))
;&quot;agendaPeriodWeek&quot;!=t.name&amp;&amp;e.cpt.setData(&quot;saved_view&quot;,t.name)
},unselect:function(){editorController.deselect()},
addEvent:function(){},eventRender:function(t,a){
e.cpt.data.blockPast&amp;&amp;&quot;background&quot;==t.rendering&amp;&amp;a.attr(&quot;title&quot;,&quot;Les \xe9v\xe9nements pr\xe9sents ici ne seront pas affich\xe9s sur votre site&quot;)
},eventClick:function(t,a){if(t.url){a.currentTarget.href=&quot;#&quot;
;e.showModifyPopup(t,a,$(this),e.cpt.data.default_mode);return!1
}e.showModifyPopup(t,a,$(this),e.cpt.data.default_mode)},
eventDrop:function(t){e.addOrModifyEvent(t,&quot;dropped&quot;)},
eventResize:function(t){e.addOrModifyEvent(t,&quot;resized&quot;)},
events:function(t,a,n,o){e.cpt.ask({
request:&quot;agenda&quot;==e.cpt.data.default_mode?&quot;get_agenda_events&quot;:&quot;get_all_events&quot;,
data:{start:t,end:a}},function(t){o(t.events);e.color_past()})}
}:e.specificHash={selectable:!1,selectHelper:!1,editable:!1,
eventRender:function(t,a){
&quot;background&quot;!=t.rendering&amp;&amp;a.on(&quot;mousemove&quot;,function(a){
if(!e.viewer.popup_locked){
clearTimeout(e.viewer.popviewer_event_window_to)
;e.viewer.popviewer_event_window_to=setTimeout(function(){
e.showPopupViewer(t,a,$(this))},500)}
}).on(&quot;mouseleave&quot;,function(t){var a=$(t.relatedTarget)
;clearTimeout(e.viewer.popviewer_event_window_to)
;a.closest(&quot;.uica_viewer_event_window&quot;).length||e.viewer.popup_locked||e.cleanViewerPopup()
})},eventClick:function(t,a){if(t.url){a.currentTarget.href=&quot;#&quot;
;e.showPopupViewer(t,a,$(this));e.viewer.popup_locked=!0
;return!1}e.showPopupViewer(t,a,$(this))
;e.viewer.popup_locked=!0},viewRender:function(t){var a=moment()
;if(e.cpt.data.blockPast)if(a&gt;=t.start){
$(&quot;.fc-prev-button&quot;,e.cpt.node).prop(&quot;disabled&quot;,!0).addClass(&quot;fc-state-disabled&quot;)
;a&gt;=t.end&amp;&amp;e.calendar.fullCalendar(&quot;gotoDate&quot;,a)
}else $(&quot;.fc-prev-button&quot;,e.cpt.node).removeClass(&quot;fc-state-disabled&quot;).prop(&quot;disabled&quot;,!1)
;e.cleanViewerPopup()},events:function(t,a,n,o){e.cpt.ask({
request:&quot;agenda&quot;==e.cpt.data.default_mode?&quot;get_agenda_events&quot;:&quot;get_all_events&quot;,
data:{start:t,end:a}},function(t){o(t.events);e.color_past()})}}
;this.calendar.fullCalendar(&quot;destroy&quot;)
;this.calendar.fullCalendar(Object.extend(this.calendarHash,this.specificHash))
;if(&quot;agenda&quot;==this.cpt.data.default_mode){
this.date_week_start=moment(&quot;1980-01-01&quot;).add(this.cpt.data.agenda_start_date-1,&quot;days&quot;)
;this.calendar.fullCalendar(&quot;gotoDate&quot;,this.date_week_start)
}else if(!this.cpt.data.default_mode){this.cpt.propertyNode
;&quot;editor&quot;==v.mode&amp;&amp;this.cpt.setData(&quot;default_mode&quot;,&quot;calendar&quot;)}
this.calendar.find(&quot;button.fc-button&quot;).addClass(&quot;site_button&quot;)
;this.getWeekHeightRatio();this.applyPreset()}else{
UI_Calendar.scriptLoaded||(UI_Calendar.scriptLoaded=$.getScript(&quot;//cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.4.0/fullcalendar.min.js&quot;))
;UI_Calendar.scriptLoaded.done(function(){
UI_Calendar.getLang||(UI_Calendar.getLang=$.getScript(&quot;//cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.4.0/locale-all.js&quot;))
;UI_Calendar.getLang.done(function(){
UI_Calendar.getGcal||(UI_Calendar.getGcal=$.getScript(&quot;//cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.4.0/gcal.min.js&quot;))
;UI_Calendar.getGcal.done(function(){e.displayCalendar()
}).fail(function(){
dbg.error(&quot;fullCalendar gcal.min.js can not be loaded&quot;)})
}).fail(function(){
dbg.error(&quot;fullCalendar locale-all.js can not be loaded&quot;)})
}).fail(function(){
dbg.error(&quot;fullCalendar.min.js can not be loaded&quot;)})}}},
onDisplayCorrectMode:function(e){
&quot;editor&quot;==v.mode?this.instantiateEditorModePopup(e):this.instantiateViewerModePopup(e)
},color_past:function(){
&quot;agenda&quot;!=this.cpt.data.default_mode&amp;&amp;this.cpt.data.blockPast&amp;&amp;this.calendar.fullCalendar(&quot;renderEvent&quot;,{
allDay:!0,editable:!1,color:&quot;#AAA&quot;,rendering:&quot;background&quot;,
start:moment().subtract(10,&quot;years&quot;),end:moment().startOf(&quot;day&quot;)
})},create_color_selector:function(){var e=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(){
e.n.cs.color_selector_main.toggle()})
;$.each(e.colors_alt,function(t,a){
var n=$(&quot;&lt;div class=&apos;uica_cs_one_color_card&apos;&gt;&quot;,e.cpt.node),o=$(&quot;&lt;div class=&apos;uica_cs_color_container&apos;&gt;&quot;,e.cpt.node)
;n.on(&quot;click&quot;,function(){
e.n.color_picker.chromoselector(&quot;setColor&quot;,a).trigger(&quot;blur&quot;)
;e.setColorPopup(e.n.color_picker.chromoselector(&quot;getColor&quot;).getRgbString())
}).on(&quot;blur&quot;,function(){e.n.cs.color_selector_main.toggle()})
;n.css(&quot;background-color&quot;,a);o.appendTo(n)
;n.prependTo(e.n.cs.color_selector_container)})},
setColorPopup:function(e){
var t=this,a=e.replace(/[^\d,]/g,&quot;&quot;).split(&quot;,&quot;),n=(299*a[0]+587*a[1]+114*a[2])/1e3&gt;125?&quot;rgb(0,0,0)&quot;:&quot;rgb(255,255,255)&quot;
;t.n.header_windows.css(&quot;background-color&quot;,e)
;t.n.windowAE.css(&quot;border-color&quot;,e)
;t.n.header_windows.find(&quot;.uica_te&quot;).css(&quot;border-color&quot;,n)
;t.n.header_windows.add(t.n.header_windows.find(&quot;.uica_te&quot;)).css(&quot;color&quot;,n)
},setDefaultDate:function(){var e=this
;if(&quot;now&quot;==e.cpt.data.default_date){
e.calendar.fullCalendar(&quot;gotoDate&quot;,moment().format())
;e.cpt.setData(&quot;saved_initial_date&quot;,moment().format())
}else e.calendar.fullCalendar(&quot;gotoDate&quot;,e.cpt.data.saved_initial_date)
},importCSS:function(e,t){if(!$(&quot;#&quot;+t).length){
var a=document.getElementsByTagName(&quot;head&quot;)[0],n=document.createElement(&quot;link&quot;)
;n.rel=&quot;stylesheet&quot;;n.type=&quot;text/css&quot;;n.href=e;n.media=&quot;all&quot;
;n.id=t;a.appendChild(n)}},
instantiateEditorModePopup:function(e){var t=this
;e=this.cpt.node;this.n={windowAE:e.find(&quot;.uica_window&quot;),
header_windows:e.find(&quot;.uica_header_window&quot;),
close_button:e.find(&quot;.uica_window_close_btn&quot;),
input_start_datepicker:e.find(&quot;.uica_startdatepicker&quot;),
input_end_datepicker:e.find(&quot;.uica_enddatepicker&quot;),
title_event:e.find(&quot;.uica_title_event&quot;),
description_event:e.find(&quot;.uica_ptxt&quot;),
submit_btn:e.find(&quot;.uica_submit_btn&quot;),
checkbox_hour:e.find(&quot;.uica_input_use_hour&quot;),
color_picker:e.find(&quot;.uica_colorPicker&quot;),
button_cs:e.find(&quot;.uica_cs_opener&quot;),
delete_button:e.find(&quot;.uica_delete_btn&quot;),
start_day_chooser:e.find(&quot;.start_day_chooser&quot;).hide(),
end_day_chooser:e.find(&quot;.end_day_chooser&quot;).hide()};this.n.cs={
color_selector_main:e.find(&quot;.uica_color_selector&quot;),
color_selector_container:e.find(&quot;.uica_cs_container&quot;),
color_selector_one_color_card:e.find(&quot;.uica_cs_one_color_card&quot;),
color_selector_color_container:e.find(&quot;.uica_cs_color_container&quot;),
color_selector_card_more:e.find(&quot;.uica_cs_card_more&quot;),
color_selector_card_more_icon:e.find(&quot;.uica_cs_card_more_icon&quot;),
color_selector_close_btn:e.find(&quot;.uica_cf_close_btn&quot;),
color_selector_card_more_text:e.find(&quot;.uica_cs_card_more_text&quot;)}
;t.n.delete_button.find(&quot;.fonticon&quot;).html($.fn.fonticon(&quot;delete&quot;))
;t.n.cs.color_selector_main.hide();t.create_color_selector()
;t.n.windowAE.hide().appendTo(&quot;#site&quot;).click(function(){
editorController.deselect()});t.n.delete_button.hide()
;t.to_delete=[];t.delete_to=null
;t.n.button_cs.off(&quot;click&quot;).on(&quot;click&quot;,function(){
t.n.cs.color_selector_main.toggle()})
;t.n.close_button.off(&quot;click&quot;).on(&quot;click&quot;,function(){
t.cleanAndHidePopup()});t.n.color_picker.chromoselector({
speed:0,color2str:function(e){return e.getRgbString()},
update:function(){
var e=$(this).chromoselector(&quot;getColor&quot;).getRgbString()
;t.setColorPopup(e)},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(){t.n.color_picker.css({
&quot;background-color&quot;:&quot;#fff&quot;,
&quot;border-color&quot;:t.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;)
;t.n.color_picker.chromoselector(&quot;setColor&quot;,&quot;#F4511E&quot;).trigger(&quot;blur&quot;)
},instantiateViewerModePopup:function(e){var t=this
;color_selector_main=e.find(&quot;.uica_color_selector&quot;).hide()
;t.viewer={
popviewer_event_window:e.find(&quot;.uica_viewer_event_window&quot;),
popviewer_header_window:e.find(&quot;.uica_viewer_header_window&quot;),
popviewer_uica_title_event:e.find(&quot;.uica_viewer_title_event&quot;),
popviewer_content:e.find(&quot;.uica_viewer_content&quot;),
popviewer_event_dates:e.find(&quot;.uica_viewer_event_dates&quot;),
popviewer_date_event:e.find(&quot;.uica_viewer_date_event&quot;),
popviewer_uica_elements:e.find(&quot;.uica_viewer_uica_elements&quot;),
popviewer_description_container:e.find(&quot;.uica_viewer_description_container&quot;),
popviewer_close_btn:e.find(&quot;.uica_viewer_close_btn&quot;)}
;t.viewer.popviewer_close_btn.off(&quot;click&quot;).on(&quot;click&quot;,function(){
t.cleanViewerPopup()});t.popup_position={x:0,y:0}
;t.viewer.hovered_event=!1;t.viewer.popup_locked=!1
;t.viewer.popviewer_event_window.hide()},
showPopupViewer:function(e,t){var a=this,n=$(&quot;#body&quot;)
;if(this.current_popup_event!=e||!a.viewer.popviewer_event_window.is(&quot;:visible&quot;)){
this.current_popup_event=e;a.viewer.hovered_event=!0
;a.viewer.popviewer_uica_title_event.html(e.title+&quot;&amp;nbsp&quot;)
;if(&quot;agenda&quot;==a.cpt.data.default_mode)a.viewer.popviewer_date_event.html(sprintf(&quot;Du %1$s au %2$s&quot;,&quot;&lt;span&gt;&quot;+e.start.locale(this.locale).format(&quot;HH:mm&quot;)+&quot;&lt;/span&gt;&quot;,&quot;&lt;span&gt;&quot;+e.end.locale(this.locale).format(&quot;HH:mm&quot;)+&quot;&lt;/span&gt;&quot;));else{
var o=1==moment.duration(e.end.diff(e.start)).days()
;!o&amp;&amp;e.allDay&amp;&amp;(e.end=e.end.startOf(&quot;day&quot;).subtract(1,&quot;day&quot;))
;a.viewer.popviewer_date_event.html(e.allDay&amp;&amp;o?sprintf(&quot;Le %1$s&quot;,&quot;&lt;span&gt;&quot;+e.start.locale(this.locale).format(&quot;LL&quot;)+&quot;&lt;/span&gt;&quot;):sprintf(&quot;Du %1$s au %2$s&quot;,&quot;&lt;span&gt;&quot;+e.start.locale(this.locale).format(e.allDay?&quot;LL&quot;:&quot;LLLL&quot;)+&quot;&lt;/span&gt;&quot;,&quot;&lt;span&gt;&quot;+e.end.locale(this.locale).format(e.allDay?&quot;LL&quot;:&quot;LLLL&quot;)+&quot;&lt;/span&gt;&quot;))
}if(e.description){a.viewer.popviewer_uica_elements.show()
;a.viewer.popviewer_description_container.html(e.description).css(&quot;max-height&quot;,$(window).height()/2+&quot;px&quot;)
}else a.viewer.popviewer_uica_elements.hide()
;&quot;undefined&quot;!=typeof e.url||a.setColorPopupViewer(e.color)
;a.viewer.popviewer_event_window.appendTo($(&quot;#body&quot;)).css({
left:Math.min(t.pageX,n.offset().left+n.width()-a.viewer.popviewer_event_window.width())-n.offset().left,
top:Math.min(t.pageY-50,n.offset().top+n.height()-a.viewer.popviewer_event_window.height()-50)-n.offset().top,
&quot;z-index&quot;:9e4}).show()}},setColorPopupViewer:function(e){
var t=this,a=e.replace(/[^\d,]/g,&quot;&quot;).split(&quot;,&quot;),n=(299*a[0]+587*a[1]+114*a[2])/1e3&gt;125?&quot;rgb(0,0,0)&quot;:&quot;rgb(255,255,255)&quot;
;t.viewer.popviewer_header_window.css(&quot;background-color&quot;,e)
;t.viewer.popviewer_header_window.css(&quot;color&quot;,n)
;t.viewer.popviewer_event_window.css(&quot;border-color&quot;,e)},
cleanViewerPopup:function(){var e=this
;e.viewer.popviewer_event_window.hide();e.viewer.popup_locked=!1
;e.current_popup_event=null
;e.viewer.popviewer_uica_title_event.html(&quot;&quot;)
;e.viewer.popviewer_date_event.html(&quot;&quot;)
;e.viewer.popviewer_description_container.empty()},
instantiateDatePicker:function(e,t){var a=this
;if(!a.n.data_dp_start){
this.n.input_start_datepicker.datetimepicker({collapse:!1,
locale:this.locale})
;this.n.input_end_datepicker.datetimepicker({collapse:!1,
locale:this.locale})
;this.n.data_dp_start=this.n.input_start_datepicker.data(&quot;DateTimePicker&quot;)
;this.n.data_dp_end=this.n.input_end_datepicker.data(&quot;DateTimePicker&quot;)
;a.n.input_start_datepicker.on(&quot;dp.change&quot;,function(e){
if(!a.setting_popup){var t=a.n.data_dp_end,n=t.viewDate()
;a.onDpChange(e.date,n,t,e)}})
;a.n.input_end_datepicker.on(&quot;dp.change&quot;,function(e){
if(!a.setting_popup){var t=a.n.data_dp_start,n=t.viewDate()
;a.onDpChange(n,e.date,t,e)}})
;a.n.start_day_chooser.add(a.n.end_day_chooser).on(&quot;change&quot;,function(){
var e=a.getAgendaPopupDates()
;&quot;add&quot;==a.current_action&amp;&amp;a.update_selected_zone(e[0],e[1])})
;&quot;add&quot;==this.current_action&amp;&amp;a.update_selected_zone(e,t)}
&quot;agenda&quot;==this.cpt.data.default_mode?a.setFormat(&quot;agenda&quot;):a.n.checkbox_hour.is(&quot;:checked&quot;)?a.setFormat(&quot;hour&quot;):a.setFormat(&quot;day&quot;)
},setFormat:function(e){
var t=this.n.data_dp_start,a=this.n.data_dp_end,n=t.viewDate(),o=a.viewDate()
;if(&quot;hour&quot;==e){t.format(&quot;DD/MM/YYYY HH:mm&quot;)
;a.format(&quot;DD/MM/YYYY HH:mm&quot;)}else if(&quot;agenda&quot;==e){
t.format(&quot;HH:mm&quot;);a.format(&quot;HH:mm&quot;)}else{t.format(&quot;DD/MM/YYYY&quot;)
;a.format(&quot;DD/MM/YYYY&quot;)}t.date(n.local());a.date(o.local())},
onDpChange:function(e,t,a,n){var o=a.viewDate()
;if(&quot;calendar&quot;==this.cpt.data.default_mode)e&gt;t&amp;&amp;a.date(o.subtract(n.oldDate.diff(n.date)));else{
var i=this.getAgendaPopupDates();e=i[0];t=i[1]}
&quot;add&quot;==this.current_action&amp;&amp;this.update_selected_zone(e,t)},
getAgendaPopupDates:function(){
var e=this.calendar.fullCalendar(&quot;getView&quot;).start,t=moment().locale(this.locale).startOf(&quot;week&quot;).isoWeekday()%7,a=this.n.data_dp_start.viewDate(),n=this.n.data_dp_end.viewDate(),o=moment().locale(this.locale).hour(a.hour()).minute(a.minute()).year(e.year()).month(e.month()).date(e.date()).weekday((this.n.start_day_chooser.val()-t+7)%7),i=moment().locale(this.locale).hour(n.hour()).minute(n.minute()).year(e.year()).month(e.month()).date(e.date()).weekday((this.n.end_day_chooser.val()-t+7)%7)
;o&gt;=i&amp;&amp;i.add(7,&quot;days&quot;);return[o,i]},
update_selected_zone:function(e,t){
this.calendar.fullCalendar(&quot;getView&quot;)
;this.selected_zone=this.calendar.fullCalendar(&quot;clientEvents&quot;,&quot;selected_zone&quot;)
;if(this.selected_zone[0]){this.selected_zone[0].start=e
;this.selected_zone[0].end=t
;this.calendar.fullCalendar(&quot;updateEvent&quot;,this.selected_zone[0])
}else this.calendar.fullCalendar(&quot;renderEvent&quot;,{
id:&quot;selected_zone&quot;,title:&quot;&quot;,start:e,end:t,rendering:&quot;background&quot;
})},showPopup:function(e,t,a,n){var o=this,i={
x:$(&quot;#advised_width_center&quot;),y:$(&quot;#body&quot;)}
;o.instantiateDatePicker(e,t);setTimeout(function(){
o.n.windowAE.appendTo(&quot;#site_tools&quot;).show().css({
top:Math.min(a.pageY-100,i.y.offset().top+i.y.height()-o.n.windowAE.height()-50)-$(&quot;#site_tools&quot;).offset().top,
left:Math.min(a.pageX,i.x.offset().left+i.x.width()-o.n.windowAE.width())-$(&quot;#site_tools&quot;).offset().left,
&quot;z-index&quot;:9e4})},100);if(&quot;agenda&quot;==n){
o.n.start_day_chooser.show().val(e.format(&quot;d&quot;))
;o.n.end_day_chooser.show().val(t.format(&quot;d&quot;))
;o.n.checkbox_hour.hide()}else{o.n.start_day_chooser.hide()
;o.n.end_day_chooser.hide();o.n.checkbox_hour.show()}
o.n.checkbox_hour.prop(&quot;checked&quot;,!(0==e.minutes()&amp;&amp;0==e.hours()&amp;&amp;0==t.minutes()&amp;&amp;0==t.hours())).trigger(&quot;change&quot;)
;o.n.delete_button.hide();o.n.checkbox_hour.change(function(){
o.instantiateDatePicker(o.n.data_dp_start.viewDate(),o.n.data_dp_end.viewDate())
});shortcut.remove(&quot;enter&quot;);shortcut.add(&quot;enter&quot;,function(){
o.n.submit_btn.trigger(&quot;click&quot;)})},
showModifyPopup:function(e,t,a,n){var o=this
;this.setting_popup=!0;if(&quot;undefined&quot;!=typeof e.url){
o.showPopup(e.start,e.end,t,n);o.n.checkbox_hour.hide()
;o.n.title_event.val(e.title)
;o.n.description_event.html(e.description)
;o.n.data_dp_start.date(e.start);o.n.data_dp_end.date(e.end)
;o.n.button_cs.hide();o.n.submit_btn.hide()
;$(&quot;#use_hour_text&quot;).hide()}else{this.current_action=&quot;modify&quot;
;o.showPopup(e.start,e.end,t,n);o.n.title_event.val(e.title)
;o.n.button_cs.show();o.n.description_event.html(e.description)
;o.n.checkbox_hour.prop(&quot;checked&quot;,!e.allDay).trigger(&quot;change&quot;)
;o.n.data_dp_start.date(e.start);o.n.data_dp_end.date(e.end)
;o.setColorPopup(e.color)
;o.n.submit_btn.html(&quot;Modifier l&apos;\xe9v\xe8nement&quot;)
;o.n.color_picker.chromoselector(&quot;setColor&quot;,e.color).trigger(&quot;blur&quot;)
;o.n.submit_btn.off(&quot;click&quot;).on(&quot;click&quot;,function(){
o.addOrModifyEvent(e)})
;o.n.delete_button.show().off(&quot;click&quot;).on(&quot;click&quot;,function(){
o.calendar.fullCalendar(&quot;removeEvents&quot;,e.id);o.removeEvent(e,a)
;o.cleanAndHidePopup()});shortcut.remove(&quot;delete&quot;)
;shortcut.add(&quot;delete&quot;,function(){
o.n.delete_button.trigger(&quot;click&quot;)});$(&quot;#use_hour_text&quot;).show()}
this.setting_popup=!1},showNewEventPopup:function(e,t,a,n){
var o=this;this.setting_popup=!0;this.current_action=&quot;add&quot;
;o.showPopup(e,t,a,n);o.n.data_dp_start.date(e.local())
;o.n.data_dp_end.date(t.local())
;o.n.submit_btn.html(&quot;Ajouter un \xe9v\xe8nement&quot;)
;o.n.submit_btn.off(&quot;click&quot;).on(&quot;click&quot;,function(){
o.addOrModifyEvent()});$(&quot;#use_hour_text&quot;).show()
;o.n.checkbox_hour.show();o.n.submit_btn.show()
;o.n.button_cs.show();this.setting_popup=!1},
cleanPopup:function(){var e=this;editorController.deselect()
;if(&quot;not_set&quot;!=this.cpt.data.default_mode){
e.n.title_event.val(&quot;&quot;);e.n.description_event.html(&quot;&quot;)
;shortcut.remove(&quot;delete&quot;);shortcut.add(&quot;delete&quot;,delete_block,{
type:&quot;keydown&quot;,disable_in_input:!0});shortcut.remove(&quot;enter&quot;)
;shortcut.add(&quot;enter&quot;,function(){
find_active_buttons(&quot;btn-enter&quot;).filter(&quot;:first&quot;).click()},{
type:&quot;keydown&quot;,disable_in_textarea:!0})
;if(e.calendar.fullCalendar){e.calendar.fullCalendar(&quot;unselect&quot;)
;e.calendar.fullCalendar(&quot;removeEvents&quot;,&quot;selected_zone&quot;)}}},
cleanAndHidePopup:function(){if(this.n){
if(&quot;not_set&quot;==this.cpt.data.default_mode)return
;this.cleanPopup();this.n.cs.color_selector_main.hide()
;this.n.windowAE.hide()}},getEvent:function(e){var t=this
;editorController.pause();if(e){e.title=t.n.title_event.val()
;e.start=t.n.data_dp_start.viewDate()
;e.end=t.n.data_dp_end.viewDate()
;e.description=t.n.description_event.html()
;e.color=t.n.color_picker.chromoselector(&quot;getColor&quot;).getRgbString()
;e.all_day=!t.n.checkbox_hour.is(&quot;:checked&quot;)}else e={
title:t.n.title_event.val(),start:t.n.data_dp_start.viewDate(),
end:t.n.data_dp_end.viewDate(),
description:t.n.description_event.html(),
color:t.n.color_picker.chromoselector(&quot;getColor&quot;).getRgbString(),
all_day:!t.n.checkbox_hour.is(&quot;:checked&quot;)};return e},
addOrModifyEvent:function(e,t){var a,n=this;a=t?e:n.getEvent(e)
;if(&quot;agenda&quot;==n.cpt.data.default_mode&amp;&amp;!t){
var o=n.getAgendaPopupDates();a.start=o[0];a.end=o[1]}
n.cpt.ask({request:&quot;add_or_update_event&quot;,event:a},function(e){
if(e.success){n.calendar.fullCalendar(&quot;refetchEvents&quot;)
;n.cleanAndHidePopup()
}else statusController.message(e.message,&quot;warning&quot;)},function(){
dbg.error(&quot;Event modification error&quot;)})},
removeEvent:function(e){var t=this;t.to_delete.push(e)
;t.delete_to&amp;&amp;clearTimeout(t.delete_to);t.cleanAndHidePopup()
;t.delete_to=setTimeout(function(){
$.each(t.to_delete,function(e,a){t.confirmRemoveEvent(a.id)})
;t.cleanAndHidePopup();t.to_delete=[];statusController.hide()
},5e3)
;statusController.message(&quot;&lt;b&gt;Cet \xe9v\xe8nement va \xeatre supprim\xe9.&lt;/b&gt;&lt;br&gt;&lt;a href=&apos;#&apos; id=&apos;cancel_deletion_btn&apos;&gt;Annuler&lt;/a&gt;&quot;,&quot;success&quot;)
;$(&quot;#cancel_deletion_btn&quot;,t.cpt.node).on(&quot;click&quot;,function(){
t.to_delete=[];clearTimeout(t.delete_to)
;t.calendar.fullCalendar(&quot;refetchEvents&quot;)
;statusController.hide()})},confirmRemoveEvent:function(e){
var t=this;t.cpt.ask({request:&quot;remove_event&quot;,id:e},function(){
t.calendar.fullCalendar(&quot;refetchEvents&quot;)},function(){
dbg.error(&quot;Event deletion error&quot;)})},
onPropertyChanged:function(e){
if(e.include(&quot;external_window&quot;))this.displayCalendar();else{
if(e.include(&quot;default_mode&quot;)){
this.choice_window&amp;&amp;this.choice_window.window_container.remove()
;this.displayOptions(this.cpt.data.default_mode)
;this.displayCalendar();this.cleanAndHidePopup()}
if(&quot;calendar&quot;==this.cpt.data.default_mode){
if(e.include(&quot;agendaDay&quot;)||e.include(&quot;listMonth&quot;)||e.include(&quot;agendaWeek&quot;)||e.include(&quot;listYear&quot;)||e.include(&quot;month&quot;)){
this.button_header[e[0]]=this.cpt.data[e[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)}
e.include(&quot;default_date&quot;)&amp;&amp;this.setDefaultDate()
;if(e.include(&quot;blockPast&quot;)){
this.calendar.fullCalendar(&quot;destroy&quot;);this.displayCalendar()}
}else if(e.include(&quot;start_hour&quot;)){
var t=this.cpt.data.start_hour+this.cpt.data.day_duration
;t&gt;24&amp;&amp;this.cpt.setData(&quot;day_duration&quot;,this.cpt.data.day_duration-(t-24))
}
(e.include(&quot;start_hour&quot;)||e.include(&quot;day_duration&quot;)||e.include(&quot;event_duration&quot;)||e.include(&quot;agenda_start_date&quot;)||e.include(&quot;week_day_number&quot;))&amp;&amp;this.displayCalendar()
}
(e.include(&quot;buttons_preset&quot;)||e.include(&quot;backdrop_preset&quot;))&amp;&amp;this.applyPreset()
},onSelect:function(){
this.displayOptions(this.cpt.data.default_mode)
;1==blockSelector.selected_cpts.length&amp;&amp;this.cpt.init_sliders()
},onResize:function(){this.cleanAndHidePopup()},
onResizeStop:function(){this.cleanAndHidePopup()
;this.displayCalendar();this.setHeight()},onMoveStop:function(){
this.cleanAndHidePopup()},onDeselect:function(){
this.cleanAndHidePopup()},displayOptions:function(e){
var t=$(this.cpt.propertyNode).add(this.cpt.propertyDesignNode)
;if(&quot;agenda&quot;==e){$(&quot;.calendar_mode_option&quot;,t).hide()
;$(&quot;span.agenda_mode_option, li.agenda_mode_option&quot;,t).show()
;$(&quot;.default_mode_radio&quot;,t).show()}else if(&quot;calendar&quot;==e){
$(&quot;span.agenda_mode_option, li.agenda_mode_option&quot;,t).hide()
;$(&quot;.calendar_mode_option&quot;,t).show()
;$(&quot;.default_mode_radio&quot;,t).show()}else if(&quot;not_set&quot;==e){
$(&quot;.calendar_mode_option&quot;,t).hide()
;$(&quot;.default_mode_radio&quot;,t).hide()
;$(&quot;span.agenda_mode_option, li.agenda_mode_option&quot;,t).hide()}
filesSelector.apis.calendar||$(&quot;.property_calendar_selector&quot;,t).hide()
;$(&quot;.gtbackdrop_prop_custom, .gtbutton_prop_custom&quot;,t).toggle(GraphicalType.available)
},getWeekHeightRatio:function(){
var e=20,t=$(&quot;.fc-time-grid .fc-slats td&quot;,this.cpt.node).height(e+&quot;px&quot;),a=$(&quot;.fc-time-grid-container&quot;,this.cpt.node).height()/$(&quot;.fc-slats tr&quot;,this.cpt.node).length-($($(&quot;.fc-slats tr&quot;,this.cpt.node).get(1)).height()-e)
;if(a&gt;e){t.height(a.toFixed(1)+&quot;px&quot;)
;this.calendar.fullCalendar(&quot;option&quot;,&quot;height&quot;,&quot;parent&quot;)
}else t.css(&quot;height&quot;,&quot;&quot;)},onDeviceChanged:function(){var e=this
;setTimeout(function(){e.displayCalendar()},150)},
applyPreset:function(){if(GraphicalType.available){
var e=this,t=GraphicalType.graphical_types.backdrop.preset_data.prefix
;this.calendar.removeClassMatch(new RegExp(t))
;if(a=this.cpt.getGTPreset(&quot;backdrop&quot;,&quot;backdrop_preset&quot;)){
this.calendar.addClass(t+&quot; &quot;+t+&quot;_&quot;+a)
;this.calendar.find(&quot;.fc-header-toolbar&quot;).addClass(&quot;gt_backdrop_title&quot;)
;this.calendar.find(&quot;.fc-view-container&quot;).addClass(&quot;gt_backdrop_content&quot;)
;this.calendar.find(&quot;.fc-view-container&quot;).prepend(this.calendar.find(&quot;.fc-left&quot;).add(this.calendar.find(&quot;.fc-right&quot;)))
}else{
this.calendar.find(&quot;.fc-header-toolbar&quot;).removeClass(&quot;gt_backdrop_title&quot;)
;this.calendar.find(&quot;.fc-view-container&quot;).removeClass(&quot;gt_backdrop_content&quot;)
}t=GraphicalType.graphical_types.button.preset_data.prefix
;var a,n=$().add(this.calendar.find(&quot;.fc-header-toolbar .fc-button-group, .fc-view-container .fc-button-group&quot;)).add(this.calendar.find(&quot;.fc-left&quot;))
;this.cpt.data.header_btn&amp;&amp;1==Object.keys(this.cpt.data.header_btn).find_all(function(t){
return!!e.cpt.data.header_btn[t]
}).length&amp;&amp;(n=n.add(this.calendar.find(&quot;.fc-right&quot;)))
;n.removeClassMatch(new RegExp(t))
;(a=this.cpt.getGTPreset(&quot;button&quot;,&quot;buttons_preset&quot;))&amp;&amp;n.addClass(&quot;gtbutton_preset &quot;+t+&quot;_&quot;+a)
}this.setHeight()},setHeight:function(){
if(this.cpt.getGTPreset(&quot;backdrop&quot;,&quot;backdrop_preset&quot;)&amp;&amp;this.calendar&amp;&amp;this.calendar.fullCalendar&amp;&amp;0!=$(&quot;.fc-head&quot;).length){
var e=&quot;calendar&quot;==this.cpt.data.default_mode?this.calendar.find(&quot;.fc-day-grid-container&quot;):this.calendar.find(&quot;.fc-view&quot;),t=e.parent()
;e.detach()
;if(&quot;calendar&quot;==this.cpt.data.default_mode)var a=this.calendar.parent().height()-Math.max(this.calendar.find(&quot;.fc-left&quot;).height(),this.calendar.find(&quot;.fc-right&quot;).height())-(this.calendar.find(&quot;.gt_backdrop_title&quot;).outerHeight()-this.calendar.find(&quot;.gt_backdrop_title&quot;).height())-(parseInt(this.calendar.find(&quot;.gt_backdrop_title&quot;).css(&quot;margin-top&quot;))+parseInt(this.calendar.find(&quot;.gt_backdrop_title&quot;).css(&quot;margin-bottom&quot;)));else a=this.calendar.parent().height()-this.calendar.height()
;e.appendTo(t);this.calendar.fullCalendar(&quot;option&quot;,&quot;height&quot;,a)}}
};</script><style>.uica_calendar{height:100%}
.fc-view-container:not(.gt_backdrop_content){background-color:#fff}
.uica_window,.uica_viewer_event_window,.uica_mode_selection_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,.uica_mode_selection_window .uica_viewer_description_container{overflow:auto}
.uica_mode_selection_window{top:0;left:0;width:100%;border:1px solid;height:100%;background:#fff;z-index:11;max-width:none;text-align:center;border:none}
.uica_header_window,.uica_viewer_header_window,.uica_mode_selection_header{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:#43a6dd}
.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 #43a6dd}
.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}
.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}
.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}
.start_day_chooser,.end_day_chooser{padding:4px;width:100%;border:1px solid #999}
.uica_mode_selection_first_choice_container,.uica_mode_selection_second_choice_container{cursor:pointer;text-align:center;width:40%;margin:10px 5%;border-radius:2px;bottom:0;top:0;min-height:80%;float:left}
.uica_mode_selection_first_choice_container .uica_mode_selection_choice_header,.uica_mode_selection_second_choice_container .uica_mode_selection_choice_header{line-height:4}
.uica_mode_selection_first_choice_container .uica_mode_selection_footer,.uica_mode_selection_second_choice_container .uica_mode_selection_footer{border-top:1px solid lightgrey;padding:10px}
.uica_mode_selection_first_choice_container .uica_mode_selection_content,.uica_mode_selection_second_choice_container .uica_mode_selection_content{margin:10px;text-align:left}
.uica_mode_selection_first_choice_container .uica_mode_selection_illustration,.uica_mode_selection_second_choice_container .uica_mode_selection_illustration{width:100%}
.UI_Calendar .uica_calendar .gtbackdrop_preset .gt_backdrop_title{margin-bottom:0}
.fc-button-group,.fc-icon{vertical-align:top}
.gtbackdrop_preset .fc-left{float:left}
.gtbackdrop_preset .fc-right{text-align:right}
.gtbackdrop_preset .fc-right,.gtbackdrop_preset .fc-left{margin-bottom:10px}
.gtbutton_preset .fc-today-button{margin-left:.75em}
.gtbackdrop_preset .fc-unthemed td.fc-today{font-weight:900;text-shadow:0 0 3px rgba(0,0,0,.5)}
.gtbackdrop_preset td.fc-today{background:0 0}</style></uidget>