<?xml version='1.0' encoding='UTF-8'?><uidget><metadata><name>Blog</name><description>Create a blog</description><help><![CDATA[The Blog block allows you to write and publish as many articles as you want on your website. Each article can be illustrated by an image. &lt;br&gt; The Blog block content is designed to maximize your Search Engine Optimization (separate pages, titles, cross links). &lt;br&gt; With Facebook comments, your visitors can react to your articles by posting comments (which can be moderated if needed). ]]></help><api_version>1.0</api_version><server>local://BlogCptServer</server><size height='400' width='625' /><blog en='308' /><max bg='0' url='1' /></metadata><view><content>&lt;div class=&quot;uib_list&quot;&gt;
  &lt;div class=&quot;uib_search&quot;&gt;&lt;/div&gt;
	&lt;div class=&quot;uib_list_categories&quot;&gt;&lt;ul&gt;&lt;/ul&gt;&lt;/div&gt;
	&lt;div class=&quot;ui_list_pages&quot;&gt;&lt;/div&gt;
	&lt;div class=&quot;uib_articles&quot;&gt;&lt;/div&gt;
	&lt;div class=&quot;ui_list_pages&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;uib_view&quot;&gt;
	&lt;ul class=&quot;uib_view_back_ul&quot;&gt;&lt;li class=&quot;uib_view_back site_button&quot;&gt;← Back to article list&lt;/li&gt;&lt;/ul&gt;
	&lt;br /&gt;
	&lt;div class=&quot;uib_view_img&quot;&gt;
		&lt;img src=&apos;/assets/loadingAnimation.gif&apos;&gt;
	&lt;/div&gt;
	&lt;div class=&quot;uib_view_title font_title_1&quot;&gt;&lt;/div&gt;
	&lt;div class=&quot;uib_view_date&quot;&gt;&lt;/div&gt;
	&lt;div class=&quot;uib_view_content_first&quot; onselectstart=&quot;return false;&quot;&gt;&lt;/div&gt;
	&lt;div class=&quot;uib_view_content_last&quot; onselectstart=&quot;return false;&quot;&gt;&lt;/div&gt;
	&lt;div class=&quot;uib_view_categories uib_list_categories&quot;&gt;&lt;/div&gt;
	&lt;ul class=&quot;uib_view_ul&quot;&gt;
		&lt;li class=&quot;uib_view_next_article site_button&quot;&gt;&amp;lt;&amp;lt; Newer article&lt;/li&gt;
		&lt;li class=&quot;uib_view_last_article site_button&quot;&gt;Older article &amp;gt;&amp;gt;&lt;/li&gt;
	&lt;/ul&gt;
	&lt;ul class=&quot;uib_view_back_ul&quot;&gt;&lt;li class=&quot;uib_view_back site_button&quot;&gt;← Back to article list&lt;/li&gt;&lt;/ul&gt;
	&lt;div class=&quot;uib_view_facebook_comments&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;uib_edit&quot;&gt;
	&lt;input type=&apos;hidden&apos; name=&apos;id_article&apos; /&gt;

	&lt;div class=&quot;uib_cmd_p navbar_editor_blocks admin_elem&quot;&gt;&lt;div class=&apos;helpEditor ned_item fonticon uib_edit_cancel&apos; help=&apos;Cancel&apos; data-position=&apos;top&apos; data-color=&apos;blue&apos;&gt;&lt;/div&gt;&lt;div class=&apos;helpEditor ned_item fonticon uib_edit_delete&apos; help=&apos;Delete&apos; data-position=&apos;top&apos; data-color=&apos;blue&apos;&gt;&lt;/div&gt;&lt;div class=&apos;helpEditor ned_item fonticon uib_edit_save&apos; help=&apos;Save &amp;amp; Publish&apos; data-position=&apos;top&apos; data-color=&apos;blue&apos;&gt;&lt;/div&gt;&lt;/div&gt;

	&lt;br /&gt;
	&lt;br /&gt;
	&lt;div class=&quot;uib_edit_errors blocks_errors&quot;&gt;&lt;/div&gt;
	&lt;div style=&quot;text-align:center;margin-bottom:5px;&quot;&gt;&lt;span class=&quot;uib_edit_restore_img admin_elem eba_btn ib editor_block_actions&quot;&gt;Cancel this image&lt;/span&gt;&lt;/div&gt;
	&lt;div style=&quot;text-align:center&quot;&gt;
		&lt;div class=&quot;uib_edit_img&quot;&gt;
			&lt;div class=&quot;uib_img&quot;&gt;&lt;/div&gt;
		&lt;/div&gt;
	&lt;/div&gt;
	&lt;div style=&quot;position:relative&quot;&gt;
		&lt;div class=&quot;uib_edit_title_wrapper&quot;&gt;
			&lt;input type=&quot;text&quot; class=&quot;font_title_1 uib_edit_title live_edit&quot; name=&quot;title&quot; id=&quot;title&quot; placeholder=&quot;Enter the title here&quot;/&gt;
		&lt;/div&gt;
		&lt;span class=&quot;uib_edit_published_at_parent&quot;&gt;
			Article published on &amp;nbsp;&lt;input type=&quot;text&quot; name=&quot;published_at&quot; class=&quot;uib_edit_published_at live_edit&quot; size=&quot;15&quot;/&gt;
		&lt;/span&gt;
		&lt;div class=&quot;uib_edit_cat_wrapper editor_interface admin_elem&quot;&gt;
			&lt;select class=&quot;uib_edit_form_categories&quot; data-placeholder=&quot;Select these article categories&quot; multiple&gt;&lt;/select&gt;
		&lt;/div&gt;

		&lt;div class=&quot;uib_edit_published_wrapper editor_interface admin_elem&quot;&gt;
			&lt;b&gt;Published&lt;/b&gt;
			&lt;div class=&quot;prop_switch&quot;&gt;
				&lt;input type=&quot;checkbox&quot; class=&quot;uib_edit_published&quot; name=&quot;published&quot; /&gt;
				&lt;label&gt;&lt;/label&gt;
			&lt;/div&gt;
		&lt;/div&gt;
	&lt;/div&gt;
	&lt;div class=&quot;block_section&quot;&gt;
		&lt;b class=&quot;admin_elem admin_title&quot; title=&quot;(optional, 160 characters)&quot;&gt;Summary (visible on article list page and on top of article page)&lt;/b&gt;
		&lt;div class=&quot;uit_tbl uit_tbl_m&quot;&gt;
			&lt;div class=&quot;uit_ct&quot;&gt;
				&lt;div class=&quot;tl&quot;&gt;&lt;/div&gt;
				&lt;div class=&quot;tr&quot;&gt;&lt;/div&gt;
				&lt;div class=&quot;br&quot;&gt;&lt;/div&gt;
				&lt;div class=&quot;bl&quot;&gt;&lt;/div&gt;
				&lt;div class=&quot;c&quot;&gt;
					&lt;div class=&quot;uib_content_first uit_cttxt uit_cttxt_m&quot; placeholder=&quot;Enter the summary here&quot; uitype=&quot;editor&quot; uiname=&quot;content_first&quot; uinocb=&quot;true&quot;&gt;&lt;/div&gt;
				&lt;/div&gt;
			&lt;/div&gt;
		&lt;/div&gt;
	&lt;/div&gt;
	&lt;div class=&quot;block_section&quot;&gt;
		&lt;b class=&quot;admin_elem admin_title&quot;&gt;Article content (only visible on article page)&lt;/b&gt;
		&lt;div class=&quot;uit_tbl uit_tbl_m&quot;&gt;
			&lt;div class=&quot;uit_ct&quot;&gt;
				&lt;div class=&quot;tl&quot;&gt;&lt;/div&gt;
				&lt;div class=&quot;tr&quot;&gt;&lt;/div&gt;
				&lt;div class=&quot;br&quot;&gt;&lt;/div&gt;
				&lt;div class=&quot;bl&quot;&gt;&lt;/div&gt;
				&lt;div class=&quot;c&quot;&gt;
					&lt;div class=&quot;uib_content_last uit_cttxt uit_cttxt_m&quot; placeholder=&quot;Enter the article here&quot; uitype=&quot;editor&quot; uiname=&quot;content_last&quot; uinocb=&quot;true&quot;&gt;&lt;/div&gt;
				&lt;/div&gt;
			&lt;/div&gt;
		&lt;/div&gt;
	&lt;/div&gt;
	&lt;div class=&quot;admin_elem block_section&quot;&gt;
		&lt;b class=&quot;admin_title&quot;&gt;Search engine description (optional, 160 characters)&lt;/b&gt;
		&lt;textarea type=&quot;text&quot; class=&quot;uib_edit_seo_description&quot; name=&quot;seo_description&quot; id=&quot;seo_description&quot; maxlength=160 &gt;&lt;/textarea&gt;
	&lt;/div&gt;
&lt;/div&gt;
</content><properties><script_call help='' icon='facebook' method='editFacebookComments' text='Comments' /><server_manage help='Add, delete, rename and order categories. Choose which categories are shown in this block.' icon='folder' name='manage' text='Manage Categories' url='/cpt_blog/cat_manage' /><inputText default='&apos;Read more&apos;' name='read_more' placeholder='Text of the &apos;Read more&apos; buttons' title='Set the buttons text' /><number default='5' help='Set how many articles are shown per page.' maximum='25' minimum='1' name='rows' title='Articles/page' /><checkbox default='true' help='If checked, the height of the block will automatically be adapted to its content, possibly hiding blocks below it. In the other case a scrollbar will appear.' name='size' value='Auto-Size' /><checkbox default='true' help='Prevent visitors of your website from selecting paragraphs of your articles and copiing your texts.' name='protect' value='Text protection' /><checkbox default='false' help='By activating this feature, &lt;b&gt;your visitors will not be able to download these images&lt;/b&gt; by right clicking on an image or by drag-dropping it or by browsing the source of the page.' name='protect_images' value='Anti-download' /><checkbox default='true' help='By activating this feature, your visitors will be able to &lt;b&gt;search your blog&lt;/b&gt; for articles or categories.' name='search_field' value='Search field' /></properties><design_properties><checkbox default='true' help='Display the summary on top of the article page' name='display_summary' value='Summary in article' /><select class='uib_list_style' default='&apos;m&apos;' display='Basic|Modern' help='Set the style of the list. The modern style is customisable' name='style' title='Style of articles list' values='b|m' /><trigger_preset class='uib_prop_custom uib_prop_style uib_btn_choice_style' help='Several styles are available. Pick the one that best fits your articles list.' icon='palette' text='Choose a style' trigger='manage_style' url='/cpt/blog_styles' /></design_properties><preset_properties><notice text='All changes made below will apply to &lt;b&gt;all the blocks of your website&lt;/b&gt; which use this style' /><html val='[hr][h3]Layout[/h3]' /><number default='3' help='Set how many articles are shown per line.' maximum='6' minimum='1' name='nb_columns' title='Articles per line' /><options design='true' name='options_background' sortable='false' title='Customize articles' uniq='true'><option icon='format_color_fill' name='opt_bg_color' title='Background color'><colors background='' default='[&apos;rgba(255,255,255,1)&apos;]' display='' elts='1' name='bg_color' /></option><option icon='select_all' name='opt_padding' title='Padding'><space default='[5,5,5,5]' name='padding' /></option><option icon='border_all' name='opt_border' title='Border'><border default='({&apos;all&apos;:[3, &apos;solid&apos;, &apos;theme_color&apos;, true], &apos;bt&apos;:[3, &apos;solid&apos;, &apos;theme_color&apos;, false], &apos;br&apos;:[3, &apos;solid&apos;, &apos;theme_color&apos;, false], &apos;bb&apos;:[3, &apos;solid&apos;, &apos;theme_color&apos;, false], &apos;bl&apos;:[3, &apos;solid&apos;, &apos;theme_color&apos;, false]})' name='border' /></option><option icon='flip_to_back' name='opt_shadow' title='Shadow'><box_shadow default='[45, 5, 0, 5, &apos;rgba(0,0,0,0.4)&apos;, false, &apos;3px 3px 5px 0px rgba(0,0,0,0.4)&apos;]' name='shadow' /></option><option icon='rounded_corner' name='opt_radius' title='Radius'><radius default='[5,5,5,5]' maximum='50' minimum='0' name='radius' /></option><option icon='t_code' name='opt_css' title='Custom CSS'><css default='&apos;node{a: b;}&apos;' name='css' /></option><option class='v_gap_prop' icon='arrow_tb' name='opt_v_gap' title='Vertical spacing'><slider default='20' maximum='120' minimum='0' name='v_gap' /></option><option icon='bi_arrow' name='opt_h_gap' title='Horizontal spacing'><slider default='20' maximum='120' minimum='0' name='h_gap' /></option></options><html val='[hr][h3]Header[/h3]' /><select default='0' display='None|Effect 1|Effect 2|Effect 3' name='effect' title='Hover effect' values='0|1|2|3' /><slider default='250' maximum='400' minimum='100' name='min_h' title='Height of header' /><select class='text_position' default='&apos;b&apos;' display='Outside the image|Inside the image' name='text_position' title='Position of the text' values='b|i' /><select class='text_v_align for_tp_i' default='&apos;flex-end&apos;' display='Bottom|Center|Top' name='text_v_align' title='Vertical alignment of the texts' values='flex-end|center|start' /><select class='img_bg_style' default='&apos;f&apos;' display='Full|Strip' name='img_bg_style' title='Background style of the texts' values='f|s' /><gradient class='img_bg_val' default='[&apos;vertical&apos;,&apos;50%!rgba(0,0,0,0.5)&apos;]' help='Tips: For a single color, delete the points so that only one is left. For a gradient, add one or more points.' name='img_filter' title='Color or gradient' /><options design='true' name='options_title' sortable='false' title='Customize titles' uniq='true'><option icon='sort_by_alpha' name='opt_font_size' title='Font size'><slider default='18' maximum='150' minimum='10' name='font_size' /></option><option allow_optional='true' icon='font_download' name='opt_font_weight' title='Font weight'><select default='700' display='*Light|Normal|Bold' name='font_weight' values='300|400|700' /></option><option icon='format_color_text' name='opt_text_color' title='Text color'><colors background='' default='[&apos;theme_color&apos;]' display='' elts='1' name='text_color' /></option><option icon='format_align_center' name='opt_align' title='Align'><align default='&apos;left&apos;' name='align' with_justify='false' /></option><option icon='select_all' name='opt_padding' title='Padding'><space default='[5,5,5,5]' name='padding' /></option><option icon='format_color_fill' name='opt_bg_color' title='Background color'><colors background='' default='[&apos;rgba(255,255,255,1)&apos;]' display='' elts='1' name='bg_color' /></option><option icon='t_code' name='opt_css' title='Custom CSS'><css default='&apos;node{a: b;}&apos;' name='css' /></option></options><options design='true' name='options_date' sortable='false' title='Customize dates' uniq='true'><option icon='sort_by_alpha' name='opt_font_size' title='Font size'><slider default='14' maximum='40' minimum='7' name='font_size' /></option><option allow_optional='true' icon='font_download' name='opt_font_weight' title='Font weight'><select default='700' display='*Light|Normal|Bold' name='font_weight' values='300|400|700' /></option><option icon='format_color_text' name='opt_text_color' title='Text color'><colors background='' default='[&apos;theme_color&apos;]' display='' elts='1' name='text_color' /></option><option icon='format_align_center' name='opt_align' title='Align'><align default='&apos;left&apos;' name='align' with_justify='false' /></option><option icon='select_all' name='opt_padding' title='Padding'><space default='[5,5,5,5]' name='padding' /></option><option icon='t_code' name='opt_css' title='Custom CSS'><css default='&apos;node{a: b;}&apos;' name='css' /></option></options><html val='[hr][h3]Summary[/h3]' /><checkbox default='true' name='desc_on_list' value='Summary on the list' /><checkbox default='true' name='btn_on_list' value='Button on the list' /><options design='true' name='options_summary' sortable='false' title='Customize summaries' uniq='true'><option icon='sort_by_alpha' name='opt_font_size' title='Font size'><slider default='14' maximum='150' minimum='10' name='font_size' /></option><option allow_optional='true' icon='font_download' name='opt_font_weight' title='Font weight'><select default='400' display='*Light|Normal|Bold' name='font_weight' values='300|400|700' /></option><option icon='format_color_text' name='opt_text_color' title='Text color'><colors background='' default='[&apos;rgba(101, 101, 101, 1)&apos;]' display='' elts='1' name='text_color' /></option><option icon='format_align_center' name='opt_align' title='Align'><align default='&apos;left&apos;' name='align' with_justify='true' /></option><option icon='select_all' name='opt_padding' title='Padding'><space default='[5,5,5,5]' name='padding' /></option><option icon='t_code' name='opt_css' title='Custom CSS'><css default='&apos;node{a: b;}&apos;' name='css' /></option></options></preset_properties></view><script>var Cache=Class.create();
Cache.prototype={initialize:function(){this.cache={}
},compute_default:function(){return null
},get:function(c,b){var d=this.cache[c]||(this.cache[c]=(b||this.compute_default)());
if(d&amp;&amp;d.done){var a=this;
d.done(function(e){a.cache[c]=e
})
}return d
}};
UI_Blog={articles:{},cpts:[],cache:new Cache(),preset_data:{default_presets:[&quot;default_1&quot;,&quot;default_2&quot;,&quot;default_3&quot;,&quot;default_4&quot;,&quot;default_5&quot;],default_preset_index:1,css_style:{},prefix:&quot;uiblog_preset_&quot;},cptServer:function(){return this.cpts.find(function(a){return a.idserver
})
},updatePreset:function(){$.each(UI_Blog.cpts,function(a,b){if(parseInt(b.data.preset)&gt;UI_Blog.preset_data.default_presets.length&amp;&amp;!presetController.find(b.component_type_id,b.data.preset)){if($(&quot;#design_blocks_wrapper&quot;).hasClass(&quot;active&quot;)&amp;&amp;blockSelector.isSelected(b)){historyController.offRecords(function(){$(&quot;.ui_blog_styles section[data-cssid=&quot;+UI_Blog.preset_data.default_preset_index+&quot;] .rad&quot;).prop(&quot;checked&quot;,true).click()
})
}else{historyController.offRecords(function(){b.setData(&quot;preset&quot;,UI_Blog.preset_data.default_preset_index)
})
}}b.ui.applyPreset()
})
},onPropertyPresetChanged:function(a){a.push(&quot;preset_properties&quot;);
this.cpts.each(function(b){b.ui.onPropertyChanged(a)
})
},getDefaultOptions:function(){var b=false,a={};
if(b){a={nb_columns:3,h_gap:14,v_gap:32,text_position:&quot;i&quot;,text_v_align:&quot;center&quot;,img_bg_style:&quot;f&quot;,img_filter:[&quot;vertical&quot;,[[&quot;0%&quot;,&quot;rgba(0, 0, 0, 0.12)&quot;],[&quot;100%&quot;,&quot;rgba(0, 0, 0, 0.52)&quot;]]],desc_on_list:true,options_title:{opt_1535534642850:{type:&quot;opt_font_size&quot;,title:&quot;Taille d&apos;écriture&quot;,font_size:28},opt_1535535862025:{type:&quot;opt_align&quot;,title:&quot;Alignement&quot;,align:&quot;center&quot;},opt_1535535865416:{type:&quot;opt_font_weight&quot;,title:&quot;Epaisseur de l&apos;écriture&quot;,allow_optional:&quot;true&quot;,font_weight:&quot;400&quot;},opt_1535535876765:{type:&quot;opt_text_color&quot;,title:&quot;Couleur du texte&quot;,text_color:[&quot;rgba(255,255,255,1)&quot;]},opt_1535535921694:{type:&quot;opt_css&quot;,title:&quot;CSS personnalisé&quot;,css:&quot;&quot;},opt_1535536902128:{type:&quot;opt_padding&quot;,title:&quot;Marges internes&quot;,padding:[0,0,10,0]},opt_1535542456557:{type:&quot;opt_bg_color&quot;,title:&quot;Couleur d&apos;arrière-plan&quot;,bg_color:[&quot;rgba(255,255,255,0.2)&quot;]}},options_title_order:[&quot;opt_1535534642850&quot;,&quot;opt_1535535862025&quot;,&quot;opt_1535535865416&quot;,&quot;opt_1535535876765&quot;,&quot;opt_1535535921694&quot;,&quot;opt_1535536902128&quot;,&quot;opt_1535542456557&quot;],options_date:{opt_1535536319198:{type:&quot;opt_font_size&quot;,title:&quot;Taille d&apos;écriture&quot;,font_size:17},opt_1535536326038:{type:&quot;opt_font_weight&quot;,title:&quot;Epaisseur de l&apos;écriture&quot;,allow_optional:&quot;true&quot;,font_weight:&quot;300&quot;},opt_1535536334835:{type:&quot;opt_text_color&quot;,title:&quot;Couleur du texte&quot;,text_color:[&quot;rgba(254,254,254,1)&quot;]},opt_1535536357957:{type:&quot;opt_align&quot;,title:&quot;Alignement&quot;,align:&quot;center&quot;},opt_1535536364418:{type:&quot;opt_css&quot;,title:&quot;CSS personnalisé&quot;,css:&quot;node{font-style:italic;}&quot;}},options_date_order:[&quot;opt_1535536319198&quot;,&quot;opt_1535536326038&quot;,&quot;opt_1535536334835&quot;,&quot;opt_1535536357957&quot;,&quot;opt_1535536364418&quot;],min_h:214,options_summary:{opt_1535543855582:{type:&quot;opt_font_size&quot;,title:&quot;Taille d&apos;écriture&quot;,font_size:15},opt_1535543859153:{type:&quot;opt_font_weight&quot;,title:&quot;Epaisseur de l&apos;écriture&quot;,allow_optional:&quot;true&quot;,font_weight:&quot;400&quot;},opt_1535543863550:{type:&quot;opt_text_color&quot;,title:&quot;Couleur du texte&quot;,text_color:[&quot;rgba(0,0,0,1)&quot;]},opt_1535543871772:{type:&quot;opt_align&quot;,title:&quot;Alignement&quot;,align:&quot;justify&quot;},opt_1535543875999:{type:&quot;opt_padding&quot;,title:&quot;Marges internes&quot;,padding:[5,5,5,5]}},options_summary_order:[&quot;opt_1535543855582&quot;,&quot;opt_1535543859153&quot;,&quot;opt_1535543863550&quot;,&quot;opt_1535543871772&quot;,&quot;opt_1535543875999&quot;],options_background:{opt_1535545482624:{type:&quot;opt_bg_color&quot;,title:&quot;Couleur d&apos;arrière-plan&quot;,bg_color:[&quot;rgba(255,255,255,1)&quot;]},opt_1535545585245:{type:&quot;opt_border&quot;,title:&quot;Bordure&quot;,border:{all:[4,&quot;solid&quot;,&quot;rgba(103,173,206,1)&quot;,true],bt:[3,&quot;solid&quot;,&quot;rgba(103,173,206,1)&quot;,false],br:[3,&quot;solid&quot;,&quot;rgba(103,173,206,1)&quot;,false],bb:[3,&quot;solid&quot;,&quot;rgba(103,173,206,1)&quot;,false],bl:[3,&quot;solid&quot;,&quot;rgba(103,173,206,1)&quot;,false]}},opt_1535545599436:{type:&quot;opt_padding&quot;,title:&quot;Marges internes&quot;,padding:[5,5,5,5]},opt_1535545601715:{type:&quot;opt_shadow&quot;,title:&quot;Ombre&quot;,shadow:[45,5,0,29,&quot;rgba(0,0,0,0.4)&quot;,false,&quot;3px 3px 29px 0px rgba(0,0,0,0.4)&quot;]},opt_1535545612198:{type:&quot;opt_radius&quot;,title:&quot;Arrondi&quot;,radius:[19,19,19,19]}},options_background_order:[&quot;opt_1535545482624&quot;,&quot;opt_1535545585245&quot;,&quot;opt_1535545599436&quot;,&quot;opt_1535545601715&quot;,&quot;opt_1535545612198&quot;]}
}else{a={nb_columns:3,h_gap:20,v_gap:30,min_h:250,text_position:&quot;b&quot;,text_v_align:&quot;center&quot;,img_bg_style:&quot;f&quot;,img_filter:[&quot;vertical&quot;,[[&quot;0%&quot;,&quot;rgba(0, 0, 0, 0.12)&quot;],[&quot;100%&quot;,&quot;rgba(0, 0, 0, 0.52)&quot;]]],desc_on_list:true,options_title:{opt_1535552924980:{type:&quot;opt_font_weight&quot;,title:&quot;Epaisseur de l&apos;écriture&quot;,allow_optional:&quot;true&quot;,font_weight:700},opt_1535552928234:{type:&quot;opt_font_size&quot;,title:&quot;Taille d&apos;écriture&quot;,font_size:18},opt_1535553254890:{type:&quot;opt_padding&quot;,title:&quot;Marges internes&quot;,padding:[10,0,5,0]}},options_title_order:[&quot;opt_1535552924980&quot;,&quot;opt_1535552928234&quot;,&quot;opt_1535553254890&quot;],options_date:{opt_1535553120999:{type:&quot;opt_padding&quot;,title:&quot;Marges internes&quot;,padding:[0,0,10,0]},opt_1535553177570:{type:&quot;opt_font_size&quot;,title:&quot;Taille d&apos;écriture&quot;,font_size:13}},options_date_order:[&quot;opt_1535553120999&quot;,&quot;opt_1535553177570&quot;],options_summary:{opt_1535553189904:{type:&quot;opt_font_size&quot;,title:&quot;Taille d&apos;écriture&quot;,font_size:15}},options_summary_order:[&quot;opt_1535553189904&quot;],options_background:{},options_background_order:[]}
}return a
},searchArticles:function(b){var a=this;
return this.cpts[0].ask({request:&quot;search_query&quot;,query:b,version_id:v.id},function(c){a.cpts[0].ui._getListArticles(c.articles)
})
},getListArticles:function(a){return this.cptServer().ui._getListArticles(a)
},addCpt:function(a){this.cpts.push(a);
if(!this.cpts[0].idserver&amp;&amp;a.idserver){this.cpts.reverse()
}},remCpt:function(a){this.cpts.remove(a)
}};
UI_List.UI_Blog={initialize:function(a){this.order=[];
this.categories={};
this.all_categories={};
this.cpt=a;
UI_Blog.addCpt(a);
this.pageSelected=0;
this.img_tmp=null;
this.url=null;
this.fbSizeInterval=null;
this.node=null;
this.sigCtl=new Signal(this);
this.updateProperty=[];
a.setOptions([&quot;locked&quot;])
},onResizeStop:function(){if(this.cpt.W()&lt;320&amp;&amp;v.mode==&quot;editor&quot;){this.cpt.setXYZWH({w:320})
}this._resizeCpt()
},onHashChange:function(){this._setUrl()
},onDisplay:function(a){var o=this;
this.node=a;
this.list=$(&quot;div.uib_list&quot;,a);
this.view=$(&quot;div.uib_view&quot;,a);
this.edit=$(&quot;div.uib_edit&quot;,a);
$(&quot;div.uib_search&quot;,a).generateComponentSearchbar({type:&quot;blog&quot;,placeholder:&quot;Search an article, category, ...&quot;,types:{category:&quot;Categories&quot;,word:&quot;Keywords&quot;,article:&quot;Articles&quot;}});
this.user_date_format=&quot;MM/DD/YYYY&quot;;
this.n={search:$(&quot;div.uib_search&quot;,a),search_counter:$(&quot;div.uib_nbr_search_results&quot;,a),suggestions_list:$(&quot;div.ui_search_suggest&quot;,a)};
this.list_articles=$(&quot;div.uib_articles&quot;,this.list);
this.list_pages=$(&quot;div.ui_list_pages&quot;,this.list);
this.list_categories=$(&quot;div.uib_list_categories&quot;,this.list).not(&quot;.uib_view_categories&quot;);
this.size_getter_el=$(&quot;&lt;div&gt;&lt;/div&gt;&quot;).appendTo(a).css(&quot;clear&quot;,&quot;both&quot;)[0];
Date.format=(&quot;mm/dd/yyyy&quot;);
var c=0;
var g=a.find(&quot;.uib_view_facebook_comments&quot;);
this.fbSizeInterval=setInterval(function(){if(a.is(&quot;:visible&quot;)&amp;&amp;o.view.is(&quot;:visible&quot;)){var d=g.find(&quot;iframe:first&quot;);
if(d.length&gt;0){var f=d.height();
if(c!=f){o._resizeCpt()
}c=f
}}},500);
if(!this.component.data.style){this.component.data.style=&quot;b&quot;
}this.component.data.preset=this.component.data.preset||UI_Blog.preset_data.default_preset_index;
this.component.data.btn_on_list=this.component.data.btn_on_list||true;
if(this.cpt.data.style==&quot;m&quot;){$(&quot;head&quot;).append(&quot;&lt;style id=&apos;loading_blog&apos;&gt;.uib_articles &gt; div:not(.ph-item){opacity:0;}&lt;/style&gt;&quot;);
var b=&apos;&lt;div class=&quot;ph-item&quot;&gt;&lt;div class=&quot;ph-col-4&quot;&gt;&lt;div class=&quot;ph-picture&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;ph-row&quot;&gt;&lt;div class=&quot;ph-col-6&quot;&gt;&lt;/div&gt;&lt;div class=&quot;ph-col-6 empty&quot;&gt;&lt;/div&gt;&lt;div class=&quot;ph-col-2&quot;&gt;&lt;/div&gt;&lt;div class=&quot;ph-col-10 empty&quot;&gt;&lt;/div&gt;&lt;div class=&quot;ph-col-8&quot;&gt;&lt;/div&gt;&lt;div class=&quot;ph-col-4 empty&quot;&gt;&lt;/div&gt;&lt;div class=&quot;ph-col-12&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&apos;;
var l=&apos;&lt;div class=&quot;ph-item&quot;&gt;&lt;div class=&quot;ph-col-12&quot;&gt;&lt;div class=&quot;ph-picture&quot;&gt;&lt;/div&gt;&lt;div class=&quot;ph-row&quot;&gt;&lt;div class=&quot;ph-col-4&quot;&gt;&lt;/div&gt;&lt;div class=&quot;ph-col-8 empty&quot;&gt;&lt;/div&gt;&lt;div class=&quot;ph-col-12&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;ph-row&quot;&gt;&lt;div class=&quot;ph-col-12&quot;&gt;&lt;/div&gt;&lt;div class=&quot;ph-col-2&quot;&gt;&lt;/div&gt;&lt;div class=&quot;ph-col-10 empty&quot;&gt;&lt;/div&gt;&lt;div class=&quot;ph-col-8 big&quot;&gt;&lt;/div&gt;&lt;div class=&quot;ph-col-4 big empty&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&apos;;
var n=presetController.find(this.cpt.component_type_id,this.cpt.data.preset);
var m=n?n.data.nb_columns:ThemeConfig.UI_Blog[&quot;default_&quot;+this.cpt.data.preset].nb_columns;
for(var e=0;
e&lt;3;
e++){o.list_articles.append(m&gt;1?l:b)
}}if(v.mode==&quot;editor&quot;){this.edit.click(function(){o._deselectEditor()
});
if(this.cpt.data.search_field==undefined){this.cpt.data.search_field=true
}var k=new Date();
$(&quot;.uib_edit_published_at&quot;,a).datetimepicker({format:this.user_date_format,defaultDate:moment(),widgetPositioning:{vertical:&quot;bottom&quot;},widgetParent:$(&quot;.uib_edit_published_at_parent&quot;,a)}).css({cursor:&quot;pointer&quot;});
this.edit_editors=this.edit.find(&quot;div[uitype=editor]&quot;);
$(&quot;&lt;li class=&apos;admin_elem it&apos;&gt;&quot;).attr(&quot;title&quot;,&quot;Create a new blog post&quot;).html(&quot;&lt;div&gt;&lt;div class=&apos;fonticon admin_title&apos;&gt;&quot;+$.fn.fonticon(&quot;add&quot;)+&quot;&lt;/div&gt;&lt;div class=&apos;admin_title&apos;&gt;Create a new blog post&lt;/div&gt;&lt;/div&gt;&quot;).addClass(&quot;editor_add_item&quot;).insertBefore(this.list_articles).on(&quot;click&quot;,function(){o.editArticle(null)
});
$(&quot;.uib_edit_img&quot;,this.edit).click(function(){filesSelector.open({type:&quot;image&quot;,maxItems:1,files:[o.img_tmp]},function(f){if(f&amp;&amp;f[0]){o.img_tmp=f[0];
o.refreshImage($(&quot;.uib_img&quot;,o.edit));
$(&quot;.uib_edit_restore_img&quot;).css({visibility:&quot;visible&quot;,&quot;pointer-events&quot;:&quot;auto&quot;});
$(&quot;.uib_img&quot;,o.edit).editable_node({type:&quot;image&quot;});
setTimeout(function(){o._resizeCpt()
},2550)
}})
});
this.edit.find(&quot;.uib_edit_cancel&quot;).html($.fn.fonticon(&quot;arrow_width_left&quot;)).on(&quot;click&quot;,function(){o._deselectEditor();
o.updateList();
o._resizeCpt()
});
$(&quot;.uib_edit_restore_img&quot;).click(function(){o.img_tmp={width:28,id:0,thumbnails:{normal:&quot;/images/default.png&quot;},height:128,name:&quot;default.png&quot;,is_default:true,removable:false,url:&quot;/images/default.png&quot;};
$(&quot;.uib_edit_img&quot;,a).html(&apos;&lt;div class=&quot;uib_img&quot;&gt;&lt;img src=&quot;/images/default.png&quot; style=&quot;width: 128px; height: 128px;&quot;&gt;&lt;/div&gt;&apos;).find(&quot;.uib_img&quot;).editable_node({type:&quot;image&quot;});
$(&quot;.uib_img_ed&quot;).show();
$(&quot;.uib_edit_restore_img&quot;).css({visibility:&quot;hidden&quot;,&quot;pointer-events&quot;:&quot;none&quot;})
});
this.edit.find(&quot;.uib_edit_save&quot;).html($.fn.fonticon(&quot;apply&quot;)).click(function(){o._saveArticle()
});
this.edit.find(&quot;.uib_edit_delete&quot;).html($.fn.fonticon(&quot;remove&quot;)).click(function(){if(confirm(&quot;Are you sure to want to delete this article?&quot;)){var d=o.edit.find(&quot;input[name=id_article]&quot;).val();
o.cpt.ask({request:&quot;delete&quot;,id:parseInt(d)},function(f){sigCtl.emit(&quot;Blog.removeArticle&quot;,d);
o._getListCategories(true).then(function(){o.updateList()
})
},function(f){})
}});
var j=$.Deferred();
if(!this.cpt.idserver){this.component.data.tmp_cat_name=this.component.page.name;
$(&quot;.uib_btn_new&quot;,a).hide();
var h=function(){var d=confirm(&quot;Do you want to save this page (as a draft) to start the block configuration?&quot;);
if(d){o.cpt.page.setHasChanged();
o.cpt.page.saveAndCleanHistory().then(function(){sigCtl.emit(&quot;Blog.updateCategories&quot;,o.cpt.id);
j.resolve()
})
}return d
};
h()
}else{j.resolve()
}j.then(function(){o._getListCategories().then(function(){o.updateList();
o._manage_kendo(&quot;create&quot;)
})
});
this.sigCtl.connect(&quot;Blog.updateArticle&quot;,function(f,d,i){if(d!=o.component.id){o.updateProperty.push(&quot;Article&quot;)
}});
this.sigCtl.connect(&quot;Blog.updateCategories&quot;,function(f,d){if(d!=o.component.id){o.updateProperty.push(&quot;Categories&quot;)
}});
this.sigCtl.connect(&quot;Blog.updateArticleDate&quot;,function(){o.updateProperty.push(&quot;Categories&quot;)
});
this.sigCtl.connect(&quot;Blog.updateArticleCategories&quot;,function(i,d,f){if(d!=o.component.id){o.updateProperty.push(&quot;Categories&quot;,&quot;Article&quot;)
}});
this.sigCtl.connect(&quot;Blog.removeArticle&quot;,function(d,f){delete UI_Blog.articles[f];
o.updateProperty.push(&quot;Article&quot;)
});
setTimeout(function(){if(!o._has_articles()){$(&quot;.admin_elem.it.editor_add_item&quot;,o.node).css(&quot;display&quot;,&quot;inline-table&quot;);
o._resizeCpt()
}},500);
this._resizeCpt();
this.selectCat(&quot;all&quot;)
}else{this.protectText(this.node);
this.edit.remove()
}$.extend(this,componentSearchBar);
this.search_field_available=true;
this.onPropertyChanged([&quot;search_field&quot;]);
this.bindSearch()
},onShow:function(){var c=this;
var b=$.Deferred();
if(v.mode==&quot;viewer&quot;){this._getListCategories().then(function(){c._setUrl();
b.resolve()
})
}else{b.resolve()
}if(this.updateProperty.length){var a=$.Deferred();
if(this.updateProperty.include(&quot;Categories&quot;)){c._getListCategories(true).then(function(){c._manage_kendo(&quot;update&quot;);
c.updateCategoriesList();
if(c.updateProperty.include(&quot;Article&quot;)){c.updateList()
}a.resolve()
})
}else{if(this.updateProperty.include(&quot;Article&quot;)){c.updateList();
a.resolve()
}}a.then(function(){c.updateProperty=[]
})
}},onSelect:function(){this.node.addClass(&quot;block_selected&quot;);
if(this.edit.is(&quot;:visible&quot;)){$(&quot;div[uitype=editor]&quot;,this.edit).each(function(){$(this).editable_node({type:&quot;text&quot;})
});
$(&quot;.uib_img&quot;,this.edit).editable_node({type:&quot;image&quot;})
}$(&quot;.admin_elem.it.editor_add_item&quot;,this.node).css(&quot;display&quot;,&quot;inline-table&quot;);
if(presetController.find(this.cpt.component_type_id,this.cpt.data.preset)){presetController.load_panel(this.cpt,this.cpt.data.preset);
this.cpt.component_type.default_preset=parseInt(this.cpt.data.preset)
}this.showProp();
this._resizeCpt()
},onDeselect:function(){this.node.removeClass(&quot;block_selected&quot;);
$(&quot;div[uitype=editor]&quot;,this.edit).each(function(){$(this).editable_node({action:&quot;destroy&quot;})
});
$(&quot;.uib_img&quot;,this.edit).editable_node({action:&quot;destroy&quot;});
$(&quot;.uib_img_ed&quot;,this.node).hide();
if(!this._has_articles()){$(&quot;.admin_elem.it.editor_add_item&quot;,this.node).css(&quot;display&quot;,&quot;inline-table&quot;)
}else{$(&quot;.admin_elem.it.editor_add_item&quot;,this.node).hide()
}this._resizeCpt()
},onRemove:function(){UI_Blog.remCpt(this.cpt)
},onPropertyChanged:function(a){var b=this;
if(a.include(&quot;read_more&quot;)){this.list.find(&quot;.uib_rm_link&quot;).text(this.cpt.data.read_more)
}if(a.include(&quot;search_field&quot;)){this.n.search.toggle(!!(this.search_field_available&amp;&amp;this.cpt.data.search_field))
}if(a.include(&quot;rows&quot;)){if(this.list.is(&quot;:visible&quot;)){this.updateList()
}}if(a.include(&quot;size&quot;)){this._resizeCpt()
}if(a.include(&quot;manage&quot;)){this._getListCategories(true).then(function(){b._manage_kendo(&quot;update&quot;);
b.updateCategoriesList();
b.pageSelected=0;
b.updateList();
sigCtl.emit(&quot;Blog.updateCategories&quot;,b.component.id)
})
}if(a.include(&quot;style&quot;)){this.list.removeClassMatch(/uibs_/).addClass(&quot;uibs_&quot;+this.cpt.data.style);
if(this.component.data.style==&quot;m&quot;){presetController.loadDefaultPresets(this.cpt.component_type);
this.applyPreset()
}else{this.node.removeClassMatch(/uiblog_preset/);
this.node.find(&quot;.uib_title&quot;).addClass(&quot;font_title_3&quot;)
}this._createAllArticles();
this._setGUIList()
}if(a.include(&quot;preset&quot;)){this.applyPreset()
}if(a.include(&quot;preset_properties&quot;)){if(a.include(&quot;effect&quot;)){var g=presetController.find(this.cpt.component_type_id,this.cpt.data.preset);
var c=$(this.component.propertyNode).add(this.component.propertyDesignNode);
var h=c.find(&quot;.img_filter&quot;).data(&quot;ClassyGradient&quot;);
if(g.data.effect&gt;0){var e=ThemeConfig.UI_Blog[&quot;default_&quot;+g.data.effect].img_filter;
g.data.img_filter=e;
h.setupPoints(e[1])
}else{h.setupPoints([[&quot;50%&quot;,&quot;rgba(0, 0, 0, 0.0)&quot;]])
}h.update()
}this._setGUIList()
}this.showProp()
},showProp:function(){var a=$(this.component.propertyNode).add(this.component.propertyDesignNode);
$(&quot;.uib_prop_style&quot;,a).toggle(this.component.data.style==&quot;m&quot;)
},_setGUIList:function(){var c=$(this.component.propertyNode).add(this.component.propertyDesignNode);
var d=presetController.find(this.cpt.component_type_id,this.cpt.data.preset);
$(&quot;.h_gap_prop, li.for_tp_i&quot;,c).add(this.list.find(&quot;.uib_content_first&quot;)).css(&quot;display&quot;,&quot;&quot;);
var a=this.list.add($(&quot;#list_styles.ui_blog_styles&quot;).find(&quot;.uiblog_preset_&quot;+this.component.data.preset+&quot; .uib_list&quot;));
a.removeClassMatch(/uibs_col_/).removeClassMatch(/uibs_text_pos_/).removeClassMatch(/uibs_effect_/).removeClass(&quot;btn_on&quot;);
if(this.component.data.style==&quot;b&quot;){return
}var b={};
if(!d){b=$.extend({},ThemeConfig.UI_Blog[&quot;default_&quot;+this.cpt.data.preset]);
b.nb_columns=b.nb_columns
}else{b=d.data
}if(d){if(b.nb_columns==1){$(&quot;.h_gap_prop&quot;,c).hide()
}if(b.text_position==&quot;b&quot;){$(&quot;li.for_tp_i&quot;,c).hide()
}}if(b.btn_on_list){a.addClass(&quot;btn_on&quot;)
}a.find(&quot;.uib_content_first&quot;).toggle(b.desc_on_list);
this._setTextPosition();
a.addClass(&quot;uibs_col_&quot;+b.nb_columns);
a.addClass(&quot;uibs_effect_&quot;+b.effect);
a.addClass(&quot;uibs_text_pos_&quot;+b.text_position+&quot;_&quot;+b.img_bg_style)
},onEdit:function(){this.component.propertyDefaultAction();
$(&quot;.uib_img_ed&quot;,this.node).show()
},_updatePage:function(){var b=this;
var a=Math.ceil(this.currentPageOrder().length/this.cpt.data.rows);
this.pageSelected=Math.max(0,Math.min(this.pageSelected,a-1));
if(a&gt;1){this.paginate=$.fn.paginate(this.list_pages,a,this.pageSelected,1,3,function(c){b._changePage(c)
})
}else{this.list_pages.empty()
}},_changePage:function(b){if(this.pageSelected!=b){this.pageSelected=b;
this.updateUrl();
this.updateList()
}},updateList:function(){var b=this,c=this.pageSelected;
this._updatePage();
var a=b.currentPageArticles();
var d=a.find_all(function(e){return !UI_Blog.articles[e]
});
if(b.component.data.style==&quot;m&quot;){presetController.loadDefaultPresets(b.cpt.component_type);
b.applyPreset()
}return this._getListArticles(d).then(function(){b.list.addClass(&quot;uibs_&quot;+b.cpt.data.style);
b._createAllArticles();
b.list.show();
b.view.hide();
b.edit.hide();
b._resizeCpt();
b._setGUIList();
if(b.articleIdToSelect){b.selectArticle(b.articleIdToSelect);
b.articleIdToSelect=null
}if(b.categoryIdToSelect){b.selectCat(b.categoryIdToSelect);
b.categoryIdToSelect=null
}})
},updateCategoriesList:function(){$(&quot;.uib_list_categories&quot;,this.node).find(&quot;ul&quot;).html(&quot;&quot;);
if(this.categories.length&gt;1){this._createAllCategories(this.categories,this.list_categories)
}},_createAllCategories:function(c,a){var b=this;
a.find(&quot;ul&quot;).html(&quot;&quot;);
if(a==b.list_categories){this._createCategorie(&quot;all&quot;,a)
}c.each(function(d){b._createCategorie(d,a)
})
},_createCategorie:function(a,b){var c=this;
b.find(&quot;ul&quot;).append($(&quot;&lt;li class=&apos;site_categ&apos;&gt;&quot;+(this.all_categories[a]?this.all_categories[a].name:&quot;All&quot;)+&quot;&lt;/li&gt;&quot;).data(&quot;idcat&quot;,a).on(&quot;click&quot;,function(d){c.pageSelected=0;
c.selectCat(a)
}))
},selectCat:function(a){var b=this;
if(this.categories.length||(!this.categories.length&amp;&amp;a==&quot;all&quot;)){b.categoryIdToSelect=null;
this.selectedCategorie=(a==&quot;all&quot;)?&quot;all&quot;:this.getCategorie(a);
b.list_categories.find(&quot;li&quot;).each(function(e,d){var c=$(d).data(&quot;idcat&quot;);
if(c==a){$(d).addClass(&quot;selected&quot;)
}else{$(d).removeClass(&quot;selected&quot;)
}});
if(a!=&quot;all&quot;){v.scroll_to_component(b.cpt)
}b.updateUrl();
b.updateList()
}else{this.categoryIdToSelect=a
}},selectArticle:function(b){var a=this;
if(this.order.length){if(this.order.include(b)){this._getListArticles([b]).then(function(){if(v.mode==&quot;editor&quot;){blockSelector.select(a.cpt.node);
a.editArticle(UI_Blog.articles[b])
}else{a._switchArticle(b)
}v.scroll_to_component(a.cpt)
})
}}else{this.articleIdToSelect=b
}},getCategorie:function(a){return this.all_categories[Object.keys(this.all_categories).find(function(b){return b==parseInt(a)
})]
},_createAllArticles:function(){var a=this;
a.list_articles.find(&quot;&gt;*:not(.ph-item)&quot;).remove();
this.currentPageArticles().each(function(b){if(UI_Blog.articles[b]){a._createArticle(UI_Blog.articles[b])
}});
this._resizeCpt()
},_createArticle:function(g){this.current_page_type=&quot;l&quot;;
var k=this;
this.img_tmp=g.img;
var f=this._translateDate(g.published_at,false);
var e=$(&quot;&lt;div class=&apos;uib_article&apos;&gt;&lt;/div&gt;&quot;).append(&quot;&lt;div class=&apos;uib_list_img_w&apos;&gt;&lt;div class=&apos;uib_list_img&apos;&gt;&lt;img src=&apos;/images/spacer.gif&apos;&gt;&lt;/div&gt;&lt;/div&gt;&quot;).append($(&quot;&lt;div class=&apos;uib_text_w&apos;&gt;&quot;).append($(&quot;&lt;div class=&apos;uib_title &quot;+(this.cpt.data.style!=&quot;m&quot;?&quot;font_title_3&quot;:&quot;&quot;)+&quot;&apos;&gt;&lt;/div&gt;&quot;).text(g.title)).append(&quot;&lt;span class=&apos;uib_date&apos;&gt;&quot;+f+&quot;&lt;/span&gt;&quot;));
if(!g.published){$(e).prepend(&quot;&lt;span class=&apos;unpublished admin_elem ib&apos; title=&apos;Unpublished article&apos;&gt;&lt;/span&gt;&quot;)
}e.append(&quot;&lt;div class=&apos;uib_content_first&apos; onselectstart=&apos;return false;&apos;&gt;&quot;+g.content_first+&quot;&lt;/div&gt;&quot;);
var j=presetController.find(this.cpt.component_type_id,this.cpt.data.preset);
if(j&amp;&amp;!j.data.desc_on_list){v.mode==&quot;editor&quot;?e.find(&quot;.uib_content_first&quot;).hide():e.find(&quot;.uib_content_first&quot;).remove()
}if(v.mode!=&quot;editor&quot;){var i=$(&quot;.uib_list_img, .uib_title&quot;,e);
if(this.cpt.data.style==&quot;m&quot;){i=i.add($(&quot;.uib_list_img_w&quot;,e))
}i.click(function(){k.updateUrl(g)
});
$(&quot;.uib_title&quot;,e).css(&quot;cursor&quot;,&quot;pointer&quot;);
this.protectText(e)
}else{e.css(&quot;cursor&quot;,&quot;pointer&quot;);
e.on(&quot;click&quot;,function(){k.editArticle(g)
})
}if(!g.img.is_default){e.attr(&quot;style&quot;,&quot;min-height: 136px;&quot;)
}e.appendTo(this.list_articles);
if(v.mode==&quot;editor&quot;){$(&quot;.uib_list_img&quot;,e).click(function(){k.editArticle(g)
})
}else{$(&quot;.uib_view_back&quot;,this.node).unbind(&quot;click&quot;).bind(&quot;click&quot;,function(){$(&quot;.uib_view_title,.uib_view_date,.uib_view_content_first,.uib_view_content_last&quot;,k.node).empty();
k.updateList();
k._resizeCpt();
k.updateUrl()
});
if(this.cpt.data.facebook_comment&amp;&amp;this.cpt.data.facebook_display_nb_comment){$(&quot;.uib_read_more&quot;,e).prepend(&quot;&lt;span class=&apos;fb_nb_cmt&apos;&gt;&quot;+sprintf(&quot;%1$s comments&quot;,&apos;&lt;fb:comments-count href=&quot;https://www.sitew.com/facebook_comment/blog/&apos;+g.id+&apos;&quot;&gt;&lt;/fb:comments-count&gt;&apos;)+&quot;&lt;/span&gt;&quot;);
$(&quot;.fb_nb_cmt&quot;,e).click(function(){k._switchArticle(g.id,&quot;0&quot;,true)
})
}$(&quot;.uib_list_img&quot;,e).click(function(){k.updateUrl(g)
});
if(this.cpt.data.facebook_comment){this.init_facebook()
}}$(&quot;&lt;div class=&apos;uib_read_more&apos;&gt;&lt;/div&gt;&quot;).appendTo(e);
var b=this.cpt.data.read_more?this.cpt.data.read_more:&quot;Read more&quot;;
$(&quot;.uib_read_more&quot;,e).append(&apos;&lt;span class=&quot;uib_rm_link site_button&quot;&gt;&apos;+b+&quot;&lt;/span&gt;&quot;);
$(&quot;.uib_rm_link&quot;,e).click(function(){k.updateUrl(g)
});
if(!this.img_tmp.is_default){var d=$(&quot;.uib_list_img&quot;,e);
if(this.cpt.data.style==&quot;m&quot;){d.empty();
var h=function(){d.css(&quot;background-image&quot;,&quot;url(&quot;+bestImgSrc(g.img,d.width(),d.height())+&quot;)&quot;)
};
if(d.width()){h()
}else{Misc.poll(function(){return e.is(&quot;:visible&quot;)
},function(){h()
})
}}else{d.setImage(g.img,128,128,{protect:((this.cpt.data.protect_images||v.page_bg.security.content_protection)&amp;&amp;v.mode!=&quot;editor&quot;)})
}}else{$(&quot;.uib_list_img&quot;,e).hide()
}},_setTextPosition:function(g){var f=this.list.add($(&quot;#list_styles.ui_blog_styles&quot;).find(&quot;.uiblog_preset_&quot;+this.component.data.preset+&quot; .uib_list&quot;));
f.removeClassMatch(/uibs_tp_/);
if(this.component.data.style==&quot;b&quot;){return
}var a=this;
var e=g?g:f.find(&quot;.uib_article&quot;);
var d=presetController.find(this.cpt.component_type_id,this.cpt.data.preset);
var b={};
if(!d){b=$.extend({},ThemeConfig.UI_Blog[&quot;default_&quot;+this.cpt.data.preset]);
b.nb_columns=b.nb_columns
}else{b=d.data
}f.addClass(&quot;uibs_tp_&quot;+b.text_position);
e.each(function(){var h=$(this);
var c=$(&quot;.uib_list_img&quot;,h);
if(b.nb_columns==1){if(b.text_position==&quot;b&quot;){if(!h.find(&quot;.uib_content_first .uib_text_w&quot;).length){$(&quot;.uib_content_first&quot;,h).prepend($(&quot;.uib_text_w&quot;,h))
}}else{if(h.find(&quot;.uib_content_first .uib_text_w, &gt;.uib_text_w&quot;).length){$(&quot;.uib_list_img&quot;,h).after($(&quot;.uib_text_w&quot;,h))
}}if(h.find(&quot;.uib_content_first .uib_read_more&quot;)){h.append(h.find(&quot;.uib_content_first .uib_read_more&quot;))
}}else{if(b.text_position==&quot;b&quot;&amp;&amp;$(&quot;.uib_list_img_w&quot;,h).find(&quot;.uib_text_w&quot;).length){$(&quot;.uib_list_img_w&quot;,h).after(h.find(&quot;.uib_list_img_w .uib_text_w&quot;))
}else{if(b.text_position==&quot;i&quot;&amp;&amp;c.is(&quot;:empty&quot;)){c.after(h.find(&quot;.uib_text_w&quot;))
}}if(h.find(&quot;&gt; .uib_read_more&quot;)){$(&quot;.uib_content_first&quot;,h).append(h.find(&quot;&gt; .uib_read_more&quot;))
}}})
},_getContent:function(c){var a=this;
var b=$.Deferred();
if(UI_Blog.articles[c].isLoaded){b.resolve()
}else{this.cpt.ask({request:&quot;get_content&quot;,id:c},function(e){var d=UI_Blog.articles[c];
d.content_last=e.content_last;
d.categories=e.categories;
d.isLoaded=true;
b.resolve()
},function(d){})
}return b
},_deselectEditor:function(){editorController.deselect();
this.edit_editors.height(&quot;auto&quot;);
var a=$(&quot;[uitype=editor].editing&quot;);
if(this.edit.is(&quot;:visible&quot;)){$(&quot;div[uitype=editor]&quot;,this.edit).each(function(){$(this).editable_node({type:&quot;text&quot;})
})
}this._resizeCpt()
},_resizeCpt:function(a){if(deviceController.device==&quot;mobile_tree&quot;){this.cpt.node.css(&quot;width&quot;,&quot;100%&quot;);
v.checkHeight()
}else{if(this.cpt.data.size){this.cpt.componentBody.css(&quot;overflow-y&quot;,&quot;hidden&quot;);
this.cpt.setSize({h:10000});
var b=this.cpt.W();
if(b&lt;320){b=320
}this.cpt.setSize({h:Math.max(this.size_getter_el.offsetTop,this.n.suggestions_list.height())+50,w:b})
}else{this.cpt.componentBody.css(&quot;overflow-y&quot;,&quot;auto&quot;)
}}if(this.cpt.data.style==&quot;m&quot;){this.cpt.componentBody.css(&quot;overflow-x&quot;,&quot;visible&quot;)
}this.list.toggleClass(&quot;uib_responsive&quot;,this.cpt.node.width()&lt;400)
},isLoaded:function(a){UI_Blog.articles[a].isLoaded
},getArticlesFromCat:function(a,c){var b=[];
$.each(UI_Blog.articles,function(d,e){$.each(e.categories,function(g,f){if(f==a||a==&quot;all&quot;){if(c){b.push(e)
}else{b[parseInt(e.id)]=e
}}})
});
return b
},getCurrentArticle:function(){return $(&quot;input[name=id_article]&quot;,this.edit).val()
},editArticle:function(b){var d=this;
var c=null;
var e=$.Deferred();
if(!b){$(&quot;.uib_edit_restore_img&quot;,d.edit).css({visibility:&quot;hidden&quot;,&quot;pointer-events&quot;:&quot;none&quot;});
b={content_first:&quot;&quot;,content_last:&quot;&quot;,title:&quot;&quot;,id:&quot;&quot;,published:false,categories:null};
b.img={width:128,id:0,thumbnails:{normal:&quot;default.png&quot;},height:128,name:&quot;default.png&quot;,is_default:true,removable:false,url:&quot;default.png&quot;};
c=new Date().asString();
editorController.setContent($(&quot;div[uitype=editor]:eq(1)&quot;,this.edit));
e.resolve()
}else{c=this._translateDate(b.published_at,false);
this._getContent(b.id).then(function(){editorController.setContent($(&quot;div[uitype=editor]:eq(1)&quot;,d.edit),UI_Blog.articles[b.id].content_last);
setTimeout(function(){d._deselectEditor()
},50);
setTimeout(function(){d._resizeCpt()
},2000);
e.resolve()
})
}e.then(function(){if(!b.img.is_default){$(&quot;.uib_edit_restore_img&quot;,d.edit).css({visibility:&quot;visible&quot;,&quot;pointer-events&quot;:&quot;auto&quot;});
$(&quot;.uib_img&quot;,d.edit).setImage(b.img,d.cpt.W())
}else{$(&quot;.uib_edit_restore_img&quot;,d.edit).css({visibility:&quot;hidden&quot;,&quot;pointer-events&quot;:&quot;none&quot;});
$(&quot;.uib_img&quot;,d.edit).html(&apos;&lt;img src=&quot;/images/default.png&quot; style=&quot;width: 128px; height: 128px; &quot;&gt;&apos;)
}d.img_tmp=b.img;
$(&quot;.uib_edit_title&quot;,d.edit).val(b.title);
$(&quot;.uib_edit_seo_description&quot;,d.edit).val(b.seo_description);
$(&quot;.uib_edit_published_at&quot;,d.edit).val(c);
editorController.setContent($(&quot;div[uitype=editor]:eq(0)&quot;,d.edit),b.content_first);
$(&quot;input[name=id_article]&quot;,d.edit).val(b.id);
d._manage_kendo(&quot;select&quot;);
$(&quot;.uib_edit_published&quot;,d.edit).unbind().bind(&quot;click change&quot;,function(){if($(d).is(&quot;:checked&quot;)){$(&quot;.uib_edit_save&quot;,d.edit).attr(&quot;help&quot;,&quot;Save &amp;amp; Publish&quot;)
}else{$(&quot;.uib_edit_save&quot;,d.edit).attr(&quot;help&quot;,&quot;Save&quot;)
}}).prop(&quot;checked&quot;,b.published).change();
var a=&quot;cpt_&quot;+d.cpt.getId();
$(&quot;.uib_edit_published_wrapper&quot;,d.edit).find(&quot;label&quot;).attr(&quot;for&quot;,a);
$(&quot;.uib_edit_published_wrapper&quot;,d.edit).find(&quot;input&quot;).attr(&quot;id&quot;,a);
setTimeout(function(){d._deselectEditor()
},50);
d._deselectEditor();
$(&quot;.uib_img_ed&quot;,d.edit).show();
d.list.hide();
d.edit.show();
$(&quot;div[uitype=editor]&quot;,d.edit).each(function(){$(this).editable_node({type:&quot;text&quot;})
});
$(&quot;.uib_img&quot;,d.edit).editable_node({type:&quot;image&quot;});
d._resizeCpt()
})
},_manage_kendo:function(c){if(v.mode==&quot;viewer&quot;){return
}var a=this;
var b=$(&quot;select.uib_edit_form_categories&quot;,this.node);
var e=b.data(&quot;kendoMultiSelect&quot;);
if(!b.data(&quot;kendoMultiSelect&quot;)||c==&quot;create&quot;){b.kendoMultiSelect({dataTextField:&quot;name&quot;,dataValueField:&quot;id&quot;});
e=b.data(&quot;kendoMultiSelect&quot;);
this._manage_kendo(&quot;update&quot;)
}else{if(c==&quot;update&quot;){e.setDataSource(new kendo.data.DataSource({data:Object.values(a.all_categories)}))
}else{if(c==&quot;select&quot;){var d=a.getCurrentArticle();
if(d){e.value(UI_Blog.articles[a.getCurrentArticle()].categories)
}else{e.value(this.categories)
}}}}},_switchArticle:function(f,d,e){if(d==&quot;0&quot;&amp;&amp;this.current_page_type==&quot;a&quot;&amp;&amp;this.current_article==f){return
}this.current_page_type=&quot;a&quot;;
var f=parseInt(f);
var b=this;
var a=this.order;
var c=a.indexOf(f);
switch(d){case&quot;+&quot;:f=a[c-1];
break;
case&quot;-&quot;:f=a[c+1];
break
}this.pageSelected=Math.floor(a.indexOf(f)/this.cpt.data.rows);
b._getListArticles([f]).then(function(){var h=UI_Blog.articles[f];
b.current_article=h.id;
var g=h.id==a[0];
var j=h.id==a[a.length-1];
$(&quot;.uib_view_last_article, .uib_view_next_article&quot;,b.view).show();
if(j){$(&quot;.uib_view_last_article&quot;,b.view).hide()
}if(g){$(&quot;.uib_view_next_article&quot;,b.view).hide()
}$(&quot;.uib_view_back&quot;).unbind(&quot;click&quot;).click(function(){$(&quot;.uib_view_title,.uib_view_date,.uib_view_content_first,.uib_view_content_last&quot;,b.view).empty();
b.updateList();
b.updateUrl()
});
$(&quot;.uib_view_title&quot;,b.view).text(h.title);
$(&quot;.uib_view_date&quot;,b.view).html(&quot;Article published on &quot;+b._translateDate(h.published_at,false));
if(b.component.data.display_summary!==false){$(&quot;.uib_view_content_first&quot;,b.view).show();
$(&quot;.uib_view_content_first&quot;,b.view).html(h.content_first)
}else{$(&quot;.uib_view_content_first&quot;,b.view).hide()
}if(h.categories.length&amp;&amp;b.categories.length&gt;1){b._createAllCategories(h.categories,$(&quot;.uib_view_categories&quot;,b.view))
}$(&quot;.uib_view_content_last&quot;,b.view).html(&quot;&lt;img src=&apos;/assets/loadingAnimation.gif&apos;&gt;&quot;);
$(&quot;.uib_view_img&quot;,b.view).html(&quot;&lt;img src=&apos;/images/spacer.gif&apos;&gt;&quot;);
b.update_facebook(h);
b._getContent(h.id).then(function(){$(&quot;.uib_view_content_last&quot;,b.view).html(UI_Blog.articles[h.id].content_last);
b._resizeCpt();
setTimeout(function(){b._resizeCpt()
},500);
setTimeout(function(){b._resizeCpt()
},5000);
if(e){setTimeout(function(){$(&quot;.uib_view_facebook_comments&quot;,b.node).scrollIntoView()
},10)
}else{v.scroll_to_component(b.component)
}});
$(&quot;.uib_view_last_article&quot;,b.node).unbind(&quot;click&quot;).click(function(){b._switchArticle(h.id,&quot;-&quot;)
});
$(&quot;.uib_view_next_article&quot;,b.node).unbind(&quot;click&quot;).click(function(){b._switchArticle(h.id,&quot;+&quot;)
});
b.img_tmp=h.img;
var i=$(&quot;.uib_view_img&quot;,b.view);
if(!h.img.is_default){i.show();
setTimeout(function(){i.setImage(h.img,Math.min(h.img.width,i.width()),null,{protect:((b.cpt.data.protect_images||v.page_bg.security.content_protection)&amp;&amp;v.mode!=&quot;editor&quot;)})
})
}else{i.hide()
}b.updateUrl(h);
b.list.hide();
b.view.show();
b._resizeCpt()
})
},updateUrl:function(b){if(b){this.cpt.page.setCptUrl(&quot;/b&quot;+b.id+&quot;a/&quot;+b.title.to_alphanumeric(),b.title,false,true)
}else{if(this.selectedCategorie&amp;&amp;this.selectedCategorie!=&quot;all&quot;){var d=this.selectedCategorie;
if(d[0]==&quot;search_query&quot;){this.cpt.page.setCptUrl(&quot;/b&quot;+this.pageSelected+&quot;s/&quot;+d[1].to_alphanumeric(),d[1],true)
}else{this.cpt.page.setCptUrl(&quot;/b&quot;+d.id+&quot;c&quot;+this.pageSelected+&quot;/&quot;+d.name.to_alphanumeric(),d.name,true)
}}else{this.selectedCategorie=&quot;all&quot;;
this.cpt.page.setCptUrl(&quot;/b&quot;+this.pageSelected+&quot;l/All&quot;,false,true)
}}},_setUrl:function(){var b=this;
if(v.selectedPageFg==this.cpt.page&amp;&amp;v.mode==&quot;viewer&quot;){if(!v.selectedPageFg.cptUrl){this.pageSelected=0;
b.selectCat(this.categoryIdToSelect?this.categoryIdToSelect:&quot;all&quot;)
}else{var a=this.cpt.page.cptUrl.match(/b(\d+)([lacs])(\d+)?\/(.*)?/);
if(a){if(a[2]==&quot;l&quot;){this.pageSelected=parseInt(a[1]);
b.selectCat(&quot;all&quot;)
}else{if(a[2]==&quot;c&quot;){this.pageSelected=a[3]?a[3]:0;
b.selectCat(a[1])
}else{if(a[2]==&quot;a&quot;){var c=function(){b._switchArticle(a[1],&quot;0&quot;)
};
if(this.currentPageOrder().length==0){this._getListArticles(c)
}else{c()
}}else{if(a[2]==&quot;s&quot;){this.selectSearch(decodeURI(a[4]),parseInt(a[1]))
}}}}}}}},selectSearch:function(c,b){this.cpt.page.setCptUrl(&quot;/b&quot;+b+&quot;s/&quot;+encodeURI(c),c,true);
$(&quot;input&quot;,this.n.search).val(c);
this.n.search.toggleClass(&quot;ui_search_result&quot;,c!=&quot;&quot;);
if(c==&quot;&quot;){this.selectCat(null);
this.n.search_counter.html(&quot;&quot;);
this.list_categories.show()
}else{this.list_categories.hide();
this.pageSelected=b||0;
var a=this;
this.selectedCategorie=[&quot;search_query&quot;,c];
a.cpt.ask({request:&quot;search_query&quot;,query:c,version_id:v.id}).then(function(d){UI_Blog.cache.get(&quot;search:&quot;+c,function(){return d
});
a.updateList();
$(&quot;.uib_nbr_search_results&quot;,a.n.search).html(sprintf(&quot;%1$d results for %2$s&quot;,a.currentPageOrder().length,&quot;&lt;span&gt;&quot;+$(&quot;&lt;div&gt;&quot;).text(a.selectedCategorie[1]).html()+&quot;&lt;/span&gt;&quot;))
})
}},currentPageArticles:function(){var a=this.cpt.data.rows*this.pageSelected;
var b=[];
b=this.currentPageOrder();
return b.slice(a,a+this.cpt.data.rows)
},currentPageOrder:function(){var a=null;
if(this.selectedCategorie){a=UI_Blog.cache.get(&quot;search:&quot;+this.selectedCategorie[1])
}return this.selectedCategorie&amp;&amp;this.selectedCategorie[0]==&quot;search_query&quot;?(a?a.results.articles:[]):this.selectedCategorie==&quot;all&quot;||!this.selectedCategorie?this.order:this.selectedCategorie.order
},editFacebookComments:function(){var a=this;
if(this.prop_node){this._loadFacebookCommentForm()
}else{this.prop_node=$(&quot;&lt;div id=&apos;cpt_blog_properties&apos;&gt;&lt;/div&gt;&quot;).appendTo(&quot;body&quot;).hide();
$.ajax({url:&quot;/facebook_comment/manage&quot;,dataType:&quot;html&quot;,name:&quot;Loading block manager...&quot;,success:function(b){a.prop_node.html(b).HandleHelpTooltip();
$(&quot;.app_id&quot;,a.prop_node).restrictTo(&quot;int&quot;,0,10000000000000000);
a._loadFacebookCommentForm()
}})
}},_loadFacebookCommentForm:function(){tb_show(null,&quot;TB_inline?inlineId=cpt_blog_properties&amp;height=470&amp;width=820&amp;modal=true&quot;);
var b=$(&quot;#TB_window&quot;);
var a=this;
if(this.cpt.data.facebook_comment){$(&quot;.facebook_name_page&quot;,b).val(this.cpt.data.facebook_name);
$(&quot;.facebook_nb_comment&quot;,b).val(this.cpt.data.facebook_nb_comment);
$(&quot;.app_id&quot;,b).val(this.cpt.data.facebook_appId);
$(&quot;.facebook_display_nb_comment&quot;,b).prop(&quot;checked&quot;,this.cpt.data.facebook_display_nb_comment);
$(&quot;.facebook_manage&quot;,b).show()
}else{$(&quot;.facebook_name_page&quot;,b).val(&quot;&quot;);
$(&quot;.facebook_nb_comment&quot;,b).val(&quot;5&quot;);
$(&quot;.app_id&quot;,b).val(&quot;&quot;);
$(&quot;.facebook_display_nb_comment&quot;,b).prop(&quot;checked&quot;,false);
$(&quot;.facebook_manage&quot;,b).hide()
}var c=function(){if($(&quot;.facebook_manage&quot;,b).is(&quot;:visible&quot;)){$(&quot;#enable_facebook_comment&quot;).html(&quot;Disable Facebook comments&quot;)
}else{$(&quot;#enable_facebook_comment&quot;).html(&quot;Enable Facebook comments&quot;)
}};
c();
$(&quot;#enable_facebook_comment&quot;,b).unbind().click(function(){$(&quot;.facebook_manage&quot;,b).toggle();
c()
});
b.find(&quot;#btn_close_window&quot;).unbind().click(function(){tb_remove()
});
b.find(&quot;#btn_save&quot;).unbind().click(function(){if(!$(&quot;.facebook_manage&quot;,b).is(&quot;:visible&quot;)){a.cpt.data.facebook_comment=false;
a.cpt.setHasChanged();
tb_remove()
}else{if($(&quot;.facebook_name_page&quot;,b).val()==&quot;&quot;){$(&quot;.fb_errors&quot;,b).html(&quot;Your Facebook nickname can not be empty&quot;).show()
}else{$(&quot;.fb_errors&quot;,b).hide();
a.cpt.data.facebook_comment=true;
a.cpt.data.facebook_name=$(&quot;.facebook_name_page&quot;,b).val();
a.cpt.data.facebook_nb_comment=$(&quot;.facebook_nb_comment&quot;,b).val();
a.cpt.data.facebook_appId=$(&quot;.app_id&quot;,b).val();
a.cpt.data.facebook_display_nb_comment=$(&quot;.facebook_display_nb_comment&quot;,b).is(&quot;:checked&quot;);
a.cpt.setHasChanged();
tb_remove()
}}})
},init_facebook:function(){var h=&quot;facebook-jssdk&quot;;
if(window.FB){window.FB.XFBML.parse()
}else{if($(&quot;#&quot;+h).length==0&amp;&amp;v.mode!=&quot;editor&quot;){var g=document,b=&quot;script&quot;,e=&quot;//connect.facebook.net/en_US/all.js#version=v2.5&amp;xfbml=1&quot;;
if(this.cpt.data.facebook_appId&amp;&amp;this.cpt.data.facebook_appId!=&quot;&quot;&amp;&amp;this.cpt.data.facebook_appId!=&quot;0&quot;){e=e+&quot;&amp;appId=&quot;+this.cpt.data.facebook_appId
}var f,c=g.getElementsByTagName(b)[0];
f=g.createElement(b);
f.id=h;
f.src=e;
c.parentNode.insertBefore(f,c)
}else{var a=this;
setTimeout(function(){a.init_facebook()
},100)
}}},update_facebook:function(c){if(this.cpt.data.facebook_comment){var f=&quot;light&quot;;
var b=$(&quot;.uib_view_facebook_comments&quot;).css(&quot;background-color&quot;).match(/(.*?)rgb\((\d+), (\d+), (\d+)\)/);
if(!b){$(&quot;.uib_view_facebook_comments&quot;).css(&quot;background-color&quot;,&quot;#fff&quot;)
}else{var d=$.fn.rgbToHsl(parseInt(b[2],16),parseInt(b[3],16),parseInt(b[4],16));
if(d[2]&lt;0.5||d[0]&gt;0.6&amp;&amp;d[0]&lt;0.7&amp;&amp;d[2]&gt;0.45&amp;&amp;d[2]&lt;0.635){f=&quot;dark&quot;
}}var e=&apos;&lt;div class=&quot;fb-comments&quot; data-href=&quot;https://www.sitew.com/facebook_comment/blog/&apos;+c.id+&apos;&quot; data-num-posts=&quot;&apos;+this.cpt.data.facebook_nb_comment+&apos;&quot; data-width=&quot;&apos;+parseInt(this.cpt.W()-20)+&apos;&quot; colorscheme=&quot;&apos;+f+&apos;&quot;&gt;&lt;/div&gt;&apos;;
$(&quot;.uib_view_facebook_comments&quot;,this.cpt.node).html(e);
this.init_facebook()
}},refreshImage:function(a){if(this.img_tmp!=null){a=a.setImage(this.img_tmp,a.width())
}},_getListArticles:function(d){var a=this;
var c;
if(d&amp;&amp;d.length){c=d.filter(function(e){return !UI_Blog.articles[e]
});
if(c.length){this.articles_loading=$.Deferred();
var b=this.articles_loading;
this.cpt.ask({request:&quot;get_articles&quot;,missing:c,all:v.mode==&quot;editor&quot;},function(e){$.extend(UI_Blog.articles,e.articles);
if(b==a.articles_loading){b.resolve()
}});
return b
}else{return $.Deferred().resolve()
}}else{return $.Deferred().resolve()
}},_getListCategories:function(b){var a=this;
if(!this.order.length||b){if(!a.categories_loading){a.categories_loading=this.cpt.ask({request:&quot;get_categories&quot;,site_id:v.site_id,all:v.mode==&quot;editor&quot;},function(c){a.categories_loading=null;
a.categories=c.categories;
a.all_categories=c.all_categories;
a.order=c.order;
a.updateCategoriesList()
})
}return a.categories_loading
}else{a.categories_loading=null;
return $.Deferred().resolve()
}},_getOrder:function(){var a=this;
return this.cpt.ask({request:&quot;get_order&quot;,site_id:v.site_id,all:v.mode==&quot;editor&quot;},function(b){a.order=b.order;
Object.values(b.categories).each(function(c){a.all_categories[c.id].order=c.order
})
})
},_has_articles:function(){return this.list_articles.find(&quot;.uib_article&quot;).length
},_translateDate:function(a,b){var c=&quot;&quot;;
if(a.match(&quot;/&quot;)){c=this.user_date_format
}else{if(a.split(&quot;-&quot;)[0].length==4){c=&quot;YYYY-MM-DD&quot;
}else{c=&quot;DD-MM-YYYY&quot;
}}var e=moment(a,c);
if(b){finalDate=e.format(&quot;DD-MM-YYYY&quot;)
}else{finalDate=e.format(this.user_date_format)
}return finalDate
},_saveArticle:function(){var a=this;
$(&quot;.uib_edit_errors&quot;,this.edit).hide();
this._deselectEditor();
if($(&quot;.uib_img img&quot;,this.node).attr(&quot;src&quot;)==&quot;/images/default.png&quot;){this.img_tmp={width:128,id:0,thumbnails:{normal:&quot;/images/default.png&quot;},height:128,name:&quot;default.png&quot;,is_default:true,removable:false,url:&quot;/images/default.png&quot;}
}var c=this._translateDate($(&quot;.uib_edit_published_at&quot;,this.edit).val(),true);
var b={id:$(&quot;input[name=id_article]&quot;,this.edit).val(),title:$(&quot;.uib_edit_title&quot;,this.edit).val(),seo_description:$(&quot;.uib_edit_seo_description&quot;,this.edit).val(),published_at:c,published:$(&quot;.uib_edit_published&quot;,this.edit).is(&quot;:checked&quot;),content_first:editorController.getContent($(&quot;div.uib_content_first&quot;,this.edit)),content_last:editorController.getContent($(&quot;div.uib_content_last&quot;,this.edit)),img:this.img_tmp,categories:$(&quot;select.uib_edit_form_categories&quot;,this.edit).val()};
if(UI_Blog.articles[b.id]&amp;&amp;a._translateDate(b.published_at)!=a._translateDate(UI_Blog.articles[b.id].published_at)){sigCtl.emit(&quot;Blog.updateArticleDate&quot;)
}if(UI_Blog.articles[b.id]&amp;&amp;(!b.categories||(b.categories.length&amp;&amp;!b.categories.equals(UI_Blog.articles[b.id].categories)))){sigCtl.emit(&quot;Blog.updateArticleCategories&quot;,a.component.id,b.id)
}this.cpt.ask($.extend({request:&quot;create&quot;},b),function(d){sigCtl.emit(&quot;Blog.updateArticle&quot;,a.component.id,d.id);
a._getOrder().then(function(){UI_Blog.articles[d.id]=b;
UI_Blog.articles[d.id].id=d.id;
a.updateList();
a._resizeCpt()
})
},function(d){$(&quot;.uib_edit_errors&quot;,a.edit).html(d.join(&quot;&lt;br /&gt;&quot;)).show()
});
$(&quot;.uib_btn_new&quot;,this.node).show()
},protectText:function(a){if(this.cpt.data.protect){$(&quot;.uib_view_content_last, .uib_view_content_first, .uib_content_first&quot;,a).addClass(&quot;text_protected&quot;)
}else{$(&quot;.uib_view_content_last, .uib_view_content_first, .uib_content_first&quot;,a).attr(&quot;onselectstart&quot;,&quot;return true&quot;)
}},onFontFamilyUpdate:function(){this._resizeCpt()
},applyPreset:function(){var a=this;
var b=this.cpt.getData(&quot;preset&quot;);
this.node.removeClassMatch(/uiblog_preset/).addClass(&quot;uiblog_preset uiblog_preset_&quot;+b);
this._setGUIList();
setTimeout(function(){$(&quot;#loading_blog, .ph-item&quot;).remove();
a._resizeCpt()
},500)
},onPanelPresetLoad:function(){var a=this;
presetController.create_panel(this.cpt);
$(&quot;#list_styles .create_preset&quot;).on(&quot;click&quot;,function(){presetController.create(a.cpt)
});
$(&quot;.ui_blog_styles&quot;).on(&quot;change&quot;,&quot;.rad&quot;,function(){if($(this).val()!=a.cpt.data.preset){a.cpt.setData(&quot;preset&quot;,$(this).val());
if($(&quot;#design_blocks_wrapper&quot;).hasClass(&quot;active&quot;)){$(&quot;#design_blocks_wrapper&quot;).desactivate()
}}presetController.load_panel(a.cpt,$(this).val());
$(this).closest(&quot;section&quot;).addClass(&quot;selected&quot;).siblings().removeClass(&quot;selected&quot;)
});
$(&quot;.ui_blog_styles&quot;).on(&quot;click&quot;,&quot;section&quot;,function(){$(this).find(&quot;.rad&quot;).prop(&quot;checked&quot;,true).trigger(&quot;change&quot;)
});
$.each($(&quot;.ui_blog_styles &gt; section:not(.preset_interface)&quot;),function(b,e){var c=$(e);
var d=parseInt(c.data(&quot;cssid&quot;));
$(&quot;.actionPreset&quot;,e).hide();
if(!presetController.find(a.cpt.component_type_id,c.data(&quot;cssid&quot;))){$(&quot;.convertPreset&quot;,e).show()
}else{$(&quot;.revertPreset&quot;,e).show();
$(&quot;.dyn_presets .uiblog_preset_&quot;+c.data(&quot;cssid&quot;)).closest(&quot;section&quot;).hide();
if(presetController.find(a.cpt.component_type_id,a.cpt.getData(&quot;preset&quot;))){$(&quot;#list_styles &gt; section[data-cssid=&quot;+a.cpt.getData(&quot;preset&quot;)+&quot;]&quot;).trigger(&quot;click&quot;)
}}$(&quot;.convertPreset&quot;,e).on(&quot;click&quot;,function(){var f=presetController.create(a.cpt,d);
$(this).hide();
$(e).find(&quot;.revertPreset&quot;).show();
$(&quot;.UI_blog&quot;,e).removeClassMatch(/uiblog_preset/).addClass(&quot;uiblog_preset uiblog_preset_&quot;+d);
$(&quot;#loading_preset&quot;).hide();
historyController.add(presetController,[e,&quot;customizePreset&quot;,a.component.component_type],false)
});
$(&quot;.revertPreset&quot;,e).on(&quot;click&quot;,function(){historyController.offRecords(function(){var f=presetController.find(a.cpt.component_type_id,d);
if(f){presetController.find(a.cpt.component_type_id,d).remove()
}});
UI_Blog.updatePreset();
$(&quot;.UI_blog&quot;,e).removeClassMatch(/uiblog_preset/).addClass(&quot;uiblog_preset_&quot;+d);
$(&quot;.convertPreset&quot;,e).show();
$(this).add($(&quot;.clonePreset&quot;,e)).hide()
});
presetController.bind_preset_name(a.cpt.component_type,c,d)
});
$(&quot;input[name=selected_blog_style][value=&quot;+this.cpt.data.preset+&quot;]:first&quot;).prop(&quot;checked&quot;,true).click();
setTimeout(function(){var b=$(&quot;#list_styles section.selected&quot;);
var c=b.position().top;
if(b.closest(&quot;.lt_pp&quot;).length){c+=b.closest(&quot;.lt_pp&quot;).position().top
}$(&quot;#design_blocks_wrapper&quot;).mCustomScrollbar(&quot;scrollTo&quot;,c)
},200)
},create_preset_selection_node:function(c){var a=this;
var b=$(&quot;#list_styles section:not(.preset_interface):eq(0)&quot;).clone(false);
b.find(&quot;.UI_Blog&quot;).removeClassMatch(/uiblog_preset/).addClass(&quot;uiblog_preset uiblog_preset_&quot;+c);
b.removeAttr(&quot;data-cssid&quot;).removeData(&quot;cssid&quot;);
$(&quot;#list_styles .dyn_presets&quot;).append(b);
$(&quot;.revertPreset, .convertPreset&quot;,b).hide();
$(&quot;.removePreset&quot;,b).show().on(&quot;click&quot;,function(){var d=$(&quot;.dyn_presets section&quot;).index(this.closest(&quot;section&quot;));
var e=$(&quot;.dyn_presets section&quot;)[d];
presetController.find(a.cpt.component_type_id,c).remove(d,e);
e.remove()
});
$(&quot;.clonePreset&quot;,b).show().on(&quot;click&quot;,function(){presetController.create(a.cpt,c);
return false
});
b.find(&quot;input&quot;).attr(&quot;id&quot;,&quot;rad_uit_&quot;+c).val(c);
b.find(&quot;label&quot;).attr(&quot;for&quot;,&quot;rad_uit_&quot;+c);
presetController.bind_preset_name(this.cpt.component_type,b,c,true);
return b
}};</script><style>.uib_view_title,.uib_edit_title{font-size:32px;margin:10px 0;padding-bottom:10px;text-align:center}
.uib_view_date{opacity:.5}
.uib_view_content_first,.uib_view_content_last{text-align:justify;margin:1em 0}
.uib_view_back{border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;cursor:pointer;text-align:center;padding:5px}
.uib_view_ul,.uib_view_back_ul{list-style-type:none;text-align:center;padding:10px 0}
.uib_view_img{text-align:center;height:auto;margin:0 auto;position:relative}
.uib_view_ul li,.uib_view_back_ul li{-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;cursor:pointer;display:inline-block;zoom:1;*display:inline;margin:0 10px;padding:2px 20px}
.text_protected{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
.uib_article{position:relative}
.uibs_b .uib_article{margin:0 0 10px;padding:10px 10px 5px}
.uibs_b .uib_title{font-size:25px;padding-left:5px;margin-bottom:5px;font-weight:400}
.uibs_b .uib_date{opacity:.7;display:inline-block;padding-bottom:4px;z-index:100}
.uibs_b .uib_content_first{font-size:12px;padding-bottom:7px;text-align:justify}
.uibs_m .uib_articles{display:grid}
.uibs_m .uib_date{display:block}
.uibs_m .uib_list_img_w{overflow:hidden;cursor:pointer}
.uibs_m .uib_list_img{min-height:200px;background-repeat:no-repeat;background-size:cover;background-position:50% 50%;display:flex;position:relative;cursor:pointer;transition:all .32s;-webkit-transition:all .32s}
.uibs_m.btn_on .uib_article{padding-bottom:40px}
.uibs_m.btn_on .uib_read_more{text-align:center;position:absolute;bottom:5px;right:5px;left:5px}
.uibs_m.btn_on .uib_read_more .uib_rm_link{display:inline-block}
.uibs_m.uibs_col_1 .uib_article{padding-bottom:inherit}
.uibs_m.uibs_col_1 .uib_content_first{align-self:center}
.uibs_m.uibs_col_1.btn_on .uib_read_more{min-width:100px;align-self:center;position:relative;bottom:auto;left:auto;right:auto}
.uibs_m.uibs_tp_i .uib_list_img_w{position:relative;display:flex}
.uibs_m.uibs_tp_i .uib_list_img{position:absolute;top:0;left:0;right:0;bottom:0}
.uibs_m.uibs_tp_i .uib_text_w{z-index:20}
.uibs_m.uibs_text_pos_b_f .uib_list_img::after,.uibs_m.uibs_text_pos_i_f .uib_list_img::after{content:&quot;&quot;;position:absolute;top:0;left:0;right:0;bottom:0;pointer-events:none}
.uib_text_w{display:inline-block;z-index:10;box-sizing:border-box}
.uibs_m .uib_text_w{width:100%}
.uibs_m.uibs_col_1 .uib_article{display:flex}
.uibs_m.uibs_col_1 .uib_list_img{flex:0 0 230px}
.uibs_m.uibs_col_1 .uib_list_img_w{min-width:230px;align-self:start}
.uib_responsive.uibs_m .uib_article{display:block}
.UI_Blog .uib_responsive .uib_articles{grid-template-columns:auto}
@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.UI_Blog .uibs_m .uib_articles{text-align:center}
.UI_Blog .uibs_m .uib_article{display:inline-block;vertical-align:top;text-align:left}
.UI_Blog .uibs_col_1.uibs_m .uib_article{margin-bottom:20px}
.UI_Blog .uibs_col_1.uibs_m .uib_article .uib_list_img_w,.UI_Blog .uibs_col_1.uibs_m .uib_article .uib_content_first,.UI_Blog .uibs_col_1.uibs_m .uib_article .uib_read_more{vertical-align:middle;display:inline-block}
.UI_Blog .uibs_col_1.uibs_m .uib_article .uib_text_w{position:relative}
.UI_Blog .uibs_col_1.uibs_m .uib_article .uib_content_first{max-width:calc(100% - 230px - 150px)}
.UI_Blog .uibs_col_2.uibs_m .uib_article{width:calc(50% - 40px);margin:20px}
.UI_Blog .uibs_col_3.uibs_m .uib_article{width:calc(33.33333% - 40px);margin:20px}
.UI_Blog .uibs_col_4.uibs_m .uib_article{width:calc(25% - 40px);margin:20px}
.UI_Blog .uibs_col_5.uibs_m .uib_article{width:calc(20% - 40px);margin:20px}
}
.uibs_effect_1 .uib_list_img{transform:scale(1.2);-webkit-transform:scale(1.2)}
.uibs_effect_1 .uib_article:hover .uib_list_img{transform:scale(1);-webkit-transform:scale(1)}
.uibs_tp_i.uibs_effect_2 .uib_title{transform:translate3d(0,-20px,0);-webkit-transform:translate3d(0,-20px,0);transition:all .32s}
.uibs_tp_i.uibs_effect_2 .uib_date{transform:translate3d(0,20px,0);-webkit-transform:translate3d(0,20px,0);transition:opacity .35s,transform .35s;opacity:0}
.uibs_tp_i.uibs_effect_2 .uib_article:hover .uib_title,.uibs_tp_i.uibs_effect_2 .uib_article:hover .uib_date{transform:translate3d(0,0,0)}
.uibs_tp_i.uibs_effect_2 .uib_article:hover .uib_date{opacity:1}
.uibs_tp_i.uibs_effect_2 .uib_article:hover .uib_list_img_w::after,.uibs_tp_i.uibs_effect_2 .uib_article:hover .uib_list_img_w::before{opacity:1;-webkit-transform:scale(1);transform:scale(1)}
.uibs_effect_2 .uib_list_img_w{position:relative}
.uibs_effect_2 .uib_list_img_w::after,.uibs_effect_2 .uib_list_img_w::before{position:absolute;top:30px;right:30px;bottom:30px;left:30px;content:&apos;&apos;;opacity:0;-webkit-transition:opacity .35s,-webkit-transform .35s;transition:opacity .35s,transform .35s;box-sizing:border-box}
.uibs_effect_2 .uib_list_img_w::after{border-right:1px solid #fff;border-left:1px solid #fff;-webkit-transform:scale(1,0);transform:scale(1,0)}
.uibs_effect_2 .uib_list_img_w::before{border-top:1px solid #fff;border-bottom:1px solid #fff;-webkit-transform:scale(0,1);transform:scale(0,1);z-index:1}
.uibs_effect_2 .uib_article:hover .uib_list_img_w::after,.uibs_effect_2 .uib_article:hover .uib_list_img_w::before{opacity:1;-webkit-transform:scale(1);transform:scale(1)}
.uibs_effect_3 .uib_list_img_w{background-color:#000}
.uibs_effect_3 .uib_list_img{-webkit-transition:opacity 1.8s,-webkit-transform 1.8s;transition:opacity 1.8s,transform 1.8s;opacity:.9}
.uibs_effect_3 .uib_article:hover .uib_list_img{opacity:.4;-webkit-transform:scale3d(1.1,1.1,1);transform:scale3d(1.1,1.1,1)}
.uib_edit_published{margin-bottom:25px}
.uib_edit_seo_description{width:100%;height:40px}
#seo_description{min-height:150px}
.unpublished{background:url(https://ssl.sitew.org/images/blog/editor_icons/barred_eye.svg) no-repeat scroll;padding:6px;width:10px;height:10px;background-size:contain;background-position:50% 50%;position:absolute;top:10px;right:10px;z-index:20}
.uib_edit_title{width:100%;box-sizing:border-box}
.uib_edit_published_at{margin:5px 0;text-align:center}
.uib_edit,.uib_view{min-height:300px;display:none;margin:5px;padding:5px}
.uib_edit_facebook{display:none}
.uib_td_desc{margin-top:20px}
.uib_td_desc .uit_tbl .c{height:auto}
.uib_read_more{bottom:0;padding:5px;position:relative;right:0;text-align:right}
.uib_read_more .uib_rm_link,.uib_read_more .fb_nb_cmt{padding:0 5px 0 20px;cursor:pointer}
.uib_desc_ed_c{float:left;position:relative;width:100%;height:0;z-index:100}
.uib_desc_ed{position:absolute;left:40%;top:0;filter:alpha(opacity=70);-moz-opacity:.7;opacity:.7;cursor:pointer}
.uib_desc{min-height:150px}
.uibs_b .uib_list_img{float:left;height:auto;z-index:50;padding:8px 15px 10px 0;cursor:pointer}
.UI_Blog .uit_tbl_m .uit_ct .c{padding:15px}
.uib_img_ed{left:45px;opacity:.7;filter:alpha(opacity=70);position:absolute;top:35px;display:none}
.uib_edit .uib_content_first,.uib_edit .uib_content_last{min-height:150px}
#enable_facebook_comment{background:#7abcff;background:-moz-linear-gradient(top,#7abcff 0,#60abf8 44%,#4096ee 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#7abcff),color-stop(44%,#60abf8),color-stop(100%,#4096ee));background:-webkit-linear-gradient(top,#7abcff 0,#60abf8 44%,#4096ee 100%);background:-o-linear-gradient(top,#7abcff 0,#60abf8 44%,#4096ee 100%);background:-ms-linear-gradient(top,#7abcff 0,#60abf8 44%,#4096ee 100%);background:linear-gradient(to bottom,#7abcff 0,#60abf8 44%,#4096ee 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=&apos;#7abcff&apos;, endColorstr=&apos;#4096ee&apos;, GradientType=0);border-radius:5px;-webkit-border-radius:5px;-moz-border-radius:5px;box-shadow:0 1px 2px 0 #000;-moz-box-shadow:0 1px 2px 0 #000;-webkit-box-shadow:0 1px 2px 0 #000;color:#FFF;cursor:pointer;font-size:16px;height:29px;line-height:30px;text-align:center;text-shadow:0 1px 1px #000}
#enable_facebook_comment:hover{background:#4096ee;background:-moz-linear-gradient(top,#4096ee 1%,#60abf8 44%,#7abcff 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(1%,#4096ee),color-stop(44%,#60abf8),color-stop(100%,#7abcff));background:-webkit-linear-gradient(top,#4096ee 1%,#60abf8 44%,#7abcff 100%);background:-o-linear-gradient(top,#4096ee 1%,#60abf8 44%,#7abcff 100%);background:-ms-linear-gradient(top,#4096ee 1%,#60abf8 44%,#7abcff 100%);background:linear-gradient(to bottom,#4096ee 1%,#60abf8 44%,#7abcff 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=&apos;#4096ee&apos;, endColorstr=&apos;#7abcff&apos;, GradientType=0)}
.facebook_nb_comment{color:#2E2E2E;font-size:12px;font-weight:700;height:29px;padding:6px 0;vertical-align:middle;width:45px}
.uib_view_facebook_comments{padding-top:10px}
.uib_view_facebook_comments:empty{display:none}
.uib_edit_errors,.fb_errors{display:none;max-width:300px;margin:0 auto}
.uib_warn{color:#b00;background-color:#FFF;padding:5px;font-size:16px;font-weight:800;text-decoration:underline;text-align:center}
.editor_add_item{width:100%;min-height:165px;box-sizing:border-box;margin-bottom:10px}
.block_selected .uib_article{cursor:pointer}
.uib_img&gt;div:not(.edit_ui_wrapper) img{width:100%;height:auto}
.uib_edit input.uib_edit_title:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=button]):not([type=submit]){font-size:34px;width:calc(100% - 80px)}
.uib_edit_published_wrapper{position:absolute;top:10px;right:10px}
.detected_device_mobile .uib_view img{width:auto;height:auto;max-width:100%}
.block_selected .uib_edit .uib_content_first:not(.editing),.block_selected .uib_edit .uib_content_last:not(.editing){max-height:200px}
.uib_list .ui_list_pages{clear:both}</style></uidget>