Page Builder: Live Composer – drag and drop website builder (visual front end site editor) - Version 1.3.3

Version Description

  • August 9th 2017 =
Download this release

Release Info

Developer LiveComposer
Plugin Icon 128x128 Page Builder: Live Composer – drag and drop website builder (visual front end site editor)
Version 1.3.3
Comparing to
See all releases

Code changes from version 1.3.2.1 to 1.3.3

ds-live-composer.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: https://www.livecomposerplugin.com
5
  * Description: Front-end page builder for WordPress with drag and drop editing. Build PRO responsive websites and landing pages. Visually customize any page element.
6
  * Author: Live Composer Team
7
- * Version: 1.3.2.1
8
  * Author URI: https://livecomposerplugin.com
9
  * License: GPL2
10
  * License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -42,7 +42,7 @@ if ( ! defined( 'DS_LIVE_COMPOSER_VER' ) && version_compare( PHP_VERSION, '5.3.0
42
  * Constants
43
  */
44
 
45
- define( 'DS_LIVE_COMPOSER_VER', '1.3.2.1' );
46
 
47
  define( 'DS_LIVE_COMPOSER_SHORTNAME', __( 'Live Composer', 'live-composer-page-builder' ) );
48
  define( 'DS_LIVE_COMPOSER_BASENAME', plugin_basename( __FILE__ ) );
4
  * Plugin URI: https://www.livecomposerplugin.com
5
  * Description: Front-end page builder for WordPress with drag and drop editing. Build PRO responsive websites and landing pages. Visually customize any page element.
6
  * Author: Live Composer Team
7
+ * Version: 1.3.3
8
  * Author URI: https://livecomposerplugin.com
9
  * License: GPL2
10
  * License URI: https://www.gnu.org/licenses/gpl-2.0.html
42
  * Constants
43
  */
44
 
45
+ define( 'DS_LIVE_COMPOSER_VER', '1.3.3' );
46
 
47
  define( 'DS_LIVE_COMPOSER_SHORTNAME', __( 'Live Composer', 'live-composer-page-builder' ) );
48
  define( 'DS_LIVE_COMPOSER_BASENAME', plugin_basename( __FILE__ ) );
includes/display-functions.php CHANGED
@@ -594,7 +594,11 @@ function dslc_filter_content( $content ) {
594
  $template_code = false; // LC code if current post powered by template.
595
  $template_id = false; // ID of the template that powers current post.
596
 
597
- // Wrapping all LC elements ( unless header/footer outputed by theme ).
 
 
 
 
598
  if ( ! defined( 'DS_LIVE_COMPOSER_HF_AUTO' ) || DS_LIVE_COMPOSER_HF_AUTO ) {
599
  $composer_wrapper_before = '<div id="dslc-content" class="dslc-content dslc-clearfix">';
600
  $composer_wrapper_after = '</div>';
594
  $template_code = false; // LC code if current post powered by template.
595
  $template_id = false; // ID of the template that powers current post.
596
 
597
+ // Wrapping all LC elements ( unless header/footer outputed by the theme ).
598
+ // Class .dslc-content needed to have all the elements properly styled.
599
+ // When DS_LIVE_COMPOSER_HF_AUTO = true LC outputs header and footer,
600
+ // automatically adding div .dslc-content before header
601
+ // and closing it after the footer.
602
  if ( ! defined( 'DS_LIVE_COMPOSER_HF_AUTO' ) || DS_LIVE_COMPOSER_HF_AUTO ) {
603
  $composer_wrapper_before = '<div id="dslc-content" class="dslc-content dslc-clearfix">';
604
  $composer_wrapper_after = '</div>';
includes/header-footer.php CHANGED
@@ -542,6 +542,8 @@ function dslc_hf_get_headerfooter( $post_id = false, $hf_type = 'header' ) {
542
  // Var defaults.
543
  $append = '';
544
  $wrapper_start = '';
 
 
545
 
546
  if ( $header_footer[ $hf_type ] && is_numeric( $header_footer[ $hf_type ] ) ) {
547
  $hf_id = $header_footer[ $hf_type ];
@@ -566,16 +568,22 @@ function dslc_hf_get_headerfooter( $post_id = false, $hf_type = 'header' ) {
566
 
567
  $header_link = DSLC_EditorInterface::get_editor_link_url( $hf_id );
568
 
569
- // Set the HTML for the edit overlay.
570
- $append = '<div class="dslc-hf-block-overlay"><a target="_blank" href="' . $header_link . '" class="dslc-hf-block-overlay-button dslca-link">' . __( 'Edit Header','live-composer-page-builder' ) . '</a>';
 
 
 
 
 
 
 
 
571
 
572
  if ( 'fixed' === $position ) {
573
- $append .= ' <span class="dslc-hf-block-overlay-text">' . __( 'To preview FIXED positioning click on "Hide Editor" button.','live-composer-page-builder' ) . '</span>';
574
  } elseif ( 'absolute' === $position ) {
575
- $append .= ' <span class="dslc-hf-block-overlay-text">' . __( 'To preview ABSOLUTE positioning click on "Hide Editor" button.','live-composer-page-builder' ) . '</span>';
576
  }
577
-
578
- $append .= '</div>';
579
  }
580
 
581
  // Initiate simple html rendering cache.
@@ -589,16 +597,25 @@ function dslc_hf_get_headerfooter( $post_id = false, $hf_type = 'header' ) {
589
  $cached_html = $cache->get_cache( $cache_id );
590
 
591
  // Insert header/footer editing overlay code before the last </div>
592
- $cached_html = substr_replace( $cached_html, $append, strrpos( $cached_html, '</div>' ), 0 );
 
 
593
 
594
- // $cached_html .= $append;
595
  return do_shortcode( $cached_html );
596
  }
597
  }
598
 
599
  // Wrap if handled by theme.
 
 
 
 
600
  if ( defined( 'DS_LIVE_COMPOSER_HF_AUTO' ) && ! DS_LIVE_COMPOSER_HF_AUTO ) {
601
- $wrapper_start = '<div id="dslc-content" class="dslc-content dslc-clearfix">';
 
 
 
 
602
  }
603
 
604
  // If the page displayed is header/footer, do not repeat.
@@ -611,7 +628,12 @@ function dslc_hf_get_headerfooter( $post_id = false, $hf_type = 'header' ) {
611
 
612
  // Render content. Support both old and new version of the page code.
613
  $rendered_code = dslc_render_content( get_post_meta( $hf_id, 'dslc_code', true ) );
614
- $rendered_code = $code_before . $wrapper_start . '<div id="dslc-' . $hf_type . '" class="dslc-' . $hf_type . '-pos-' . $position . '">' . $rendered_code . $append . '</div>' . $code_after;
 
 
 
 
 
615
 
616
  $rendered_code = dslc_decode_shortcodes( $rendered_code );
617
 
@@ -624,7 +646,7 @@ function dslc_hf_get_headerfooter( $post_id = false, $hf_type = 'header' ) {
624
  } else {
625
 
626
  // If no header/footer applied.
627
- return $code_before . $wrapper_start . '' . $code_after;
628
  } // End if().
629
  }
630
 
542
  // Var defaults.
543
  $append = '';
544
  $wrapper_start = '';
545
+ $wrapper_end = '';
546
+ $editing_parametters = '';
547
 
548
  if ( $header_footer[ $hf_type ] && is_numeric( $header_footer[ $hf_type ] ) ) {
549
  $hf_id = $header_footer[ $hf_type ];
568
 
569
  $header_link = DSLC_EditorInterface::get_editor_link_url( $hf_id );
570
 
571
+ $editing_parametters .= ' data-editing-link="' . $header_link . '"';
572
+ $editing_parametters .= ' data-editing-type="' . $hf_type . '"';
573
+
574
+ if ( 'header' === $hf_type ) {
575
+ $editing_parametters .= ' data-editing-label="' . __( 'Edit Header','live-composer-page-builder' ) . '"';
576
+ } else {
577
+ $editing_parametters .= ' data-editing-label="' . __( 'Edit Footer','live-composer-page-builder' ) . '"';
578
+ }
579
+
580
+ // ============================================================
581
 
582
  if ( 'fixed' === $position ) {
583
+ $editing_parametters .= ' data-editing-sublabel="' . __( 'To preview FIXED positioning click on "Hide Editor" button.','live-composer-page-builder' ) . '"';
584
  } elseif ( 'absolute' === $position ) {
585
+ $editing_parametters .= ' data-editing-sublabel="' . __( 'To preview ABSOLUTE positioning click on "Hide Editor" button.','live-composer-page-builder' ) . '"';
586
  }
 
 
587
  }
588
 
589
  // Initiate simple html rendering cache.
597
  $cached_html = $cache->get_cache( $cache_id );
598
 
599
  // Insert header/footer editing overlay code before the last </div>
600
+ if ( stristr( $cached_html, 'data-hf' ) ) {
601
+ $cached_html = substr_replace( $cached_html, $editing_parametters, strrpos( $cached_html, 'data-hf' ), 0 );
602
+ }
603
 
 
604
  return do_shortcode( $cached_html );
605
  }
606
  }
607
 
608
  // Wrap if handled by theme.
609
+ // Class .dslc-content needed to have all the elements properly styled.
610
+ // When DS_LIVE_COMPOSER_HF_AUTO = false theme outputs LC header and footer,
611
+ // so we need to add div with .dslc-content before the header
612
+ // and closing it after the footer.
613
  if ( defined( 'DS_LIVE_COMPOSER_HF_AUTO' ) && ! DS_LIVE_COMPOSER_HF_AUTO ) {
614
+ if ( 'header' === $hf_type ) {
615
+ $wrapper_start = '<div id="dslc-content" class="dslc-content dslc-clearfix">';
616
+ } elseif ( 'footer' === $hf_type ) {
617
+ $wrapper_end = '</div>';
618
+ }
619
  }
620
 
621
  // If the page displayed is header/footer, do not repeat.
628
 
629
  // Render content. Support both old and new version of the page code.
630
  $rendered_code = dslc_render_content( get_post_meta( $hf_id, 'dslc_code', true ) );
631
+
632
+ if ( ! empty( $rendered_code ) && ! dslc_is_editor_active() ) {
633
+ $rendered_code = '<div id="dslc-' . $hf_type . '" class="dslc-' . $hf_type . '-pos-' . $position . '" data-hf>' . $rendered_code . $append . '</div>';
634
+ }
635
+
636
+ $rendered_code = $code_before . $wrapper_start . $rendered_code . $wrapper_end . $code_after;
637
 
638
  $rendered_code = dslc_decode_shortcodes( $rendered_code );
639
 
646
  } else {
647
 
648
  // If no header/footer applied.
649
+ return $code_before . $wrapper_start . '' . $wrapper_end . $code_after;
650
  } // End if().
651
  }
652
 
js/builder.all.min.js CHANGED
@@ -1,5 +1,5 @@
1
- "use strict";function dslc_ui_animations(){if(dslcDebug)console.log("dslc_ui_animations");jQuery(document).on("mouseenter",".dslca-modules-area-manage",function(){jQuery(this).closest(".dslc-modules-area").addClass("dslca-options-hovered")}).on("mouseleave",".dslca-modules-area-manage",function(){jQuery(this).closest(".dslc-modules-area").removeClass("dslca-options-hovered")});jQuery(document).on("mouseenter",".dslca-drag-not-in-progress .dslc-module-front",function(a){if(!jQuery("body").hasClass("dslca-composer-hidden")){if(jQuery(this).height()<190)jQuery(".dslca-module-manage",this).addClass("dslca-horizontal");else jQuery(".dslca-module-manage",this).removeClass("dslca-horizontal")}}).on("mouseleave",".dslca-drag-not-in-progress .dslc-module-front",function(a){if(!jQuery("body").hasClass("dslca-composer-hidden")){}});jQuery(document).on("mouseenter",".dslca-drag-not-in-progress .dslc-modules-area",function(a){var b=jQuery(this);if(!jQuery("body").hasClass("dslca-composer-hidden")){if(jQuery(this).height()<130)jQuery(".dslca-modules-area-manage",this).addClass("dslca-horizontal");else jQuery(".dslca-modules-area-manage",this).removeClass("dslca-horizontal")}}).on("mouseleave",".dslca-drag-not-in-progress .dslc-modules-area",function(a){var b=jQuery(this);if(!jQuery("body").hasClass("dslca-composer-hidden")){}})}jQuery(document).ready(function(){dslc_ui_animations()});"use strict";function dslc_save_composer(){if(dslcDebug)console.log("dslc_save_composer");dslc_generate_code();dslca_gen_content_for_search();var a=jQuery("#dslca-code").val(),b=jQuery("#dslca-content-for-search").val(),c=jQuery(".dslca-container").data("post-id");jQuery("body").addClass("dslca-saving-in-progress");jQuery(".dslca-save-composer .dslca-icon").removeClass("dslc-icon-ok").addClass("dslc-icon-spin dslc-icon-spinner");jQuery.ajax({method:"POST",type:"POST",url:DSLCAjax.ajaxurl,data:{action:"dslc-ajax-save-composer",dslc:"active",dslc_post_id:c,dslc_code:a,dslc_content_for_search:b},timeout:3e4}).done(function(a){if(a.status=="success"){jQuery(".dslca-save-composer").fadeOut(250);jQuery(".dslca-save-draft-composer").fadeOut(250);jQuery("body").append('<iframe class="lbmn-cache-iframe" id="lbmn-cache-iframe-'+c+'" src="'+DSLCSiteData.siteurl+"/?p="+c+'" ></iframe>');jQuery(".lbmn-cache-iframe").each(function(a,b){jQuery(b).load(function(){jQuery(b).remove()})})}else{alert("Something went wrong, please try to save again. Are you sure to make any changes? Error Code: "+a.status)}}).fail(function(a){if(a.statusText=="timeout"){alert("The request timed out after 30 seconds. Server do not respond in time. Please try again.")}else{alert("Something went wrong. Please try again. Error Code: "+a.statusText)}}).always(function(a){jQuery(".dslca-save-composer .dslca-icon").removeClass("dslc-icon-spin dslc-icon-spinner").addClass("dslc-icon-ok");jQuery("body").removeClass("dslca-saving-in-progress")})}function dslc_save_draft_composer(){if(dslcDebug)console.log("dslc_save_draft_composer");var a=jQuery("#dslca-code").val(),b=jQuery(".dslca-container").data("post-id");jQuery("body").addClass("dslca-saving-in-progress");jQuery(".dslca-save-draft-composer .dslca-icon").removeClass("dslc-icon-ok").addClass("dslc-icon-spin dslc-icon-spinner");jQuery.post(DSLCAjax.ajaxurl,{action:"dslc-ajax-save-draft-composer",dslc:"active",dslc_post_id:b,dslc_code:a},function(a){jQuery(".dslca-save-draft-composer .dslca-icon").removeClass("dslc-icon-spin dslc-icon-spinner").addClass("dslc-icon-save");if(a.status=="success"){jQuery(".dslca-save-draft-composer").fadeOut(250)}else{alert("Something went wrong, please try to save again.")}jQuery("body").removeClass("dslca-saving-in-progress")})}function dslc_generate_code(){if(dslcDebug)console.log("dslc_generate_code");var a="",b,c="",d="",e=12,f=12,g=0,h=0,i,j,k,l,m,n="",o;jQuery("#dslc-main .dslc-modules-area",LiveComposer.Builder.PreviewAreaDocument).each(function(){if(jQuery(".dslc-module-front",this).length){jQuery(this).removeClass("dslc-modules-area-empty").addClass("dslc-modules-area-not-empty");jQuery(".dslca-no-content",this).hide()}else{jQuery(this).removeClass("dslc-modules-area-not-empty").addClass("dslc-modules-area-empty");jQuery(".dslca-no-content:not(:visible)",this).show().css({"-webkit-animation-name":"dslcBounceIn","-moz-animation-name":"dslcBounceIn","animation-name":"dslcBounceIn","animation-duration":"0.6s","-webkit-animation-duration":"0.6s",padding:0}).animate({padding:"35px 0"},300)}});jQuery("#dslc-main .dslc-modules-section",LiveComposer.Builder.PreviewAreaDocument).each(function(){m=jQuery(this);o=dslc_generate_section_code(m);m.find(".dslca-section-code").val(o);d=d+o+","});d=d.slice(0,-1);d="["+d+"]";jQuery("#dslca-code").val(d);jQuery("#dslca-export-code").val(d)}function dslc_generate_section_code(a){if(dslcDebug)console.log("dslc_generate_section_code");var b="",c,d="",e="",f=12,g=12,h=0,i=0,j,k,l,m,n,o="",p="",q;n=a;if(jQuery(".dslc-modules-area",n).length){n.removeClass("dslc-modules-section-empty").addClass("dslc-modules-section-not-empty")}else{n.removeClass("dslc-modules-section-not-empty").addClass("dslc-modules-section-empty")}jQuery(".dslc-modules-area.dslc-last-col, .dslc-modules-area.dslc-first-col",this).removeClass("dslc-last-col dslc-first-col");jQuery(".dslc-module-front.dslc-last-col, .dslc-module-front.dslc-first-col",this).removeClass("dslc-last-col dslc-first-col");i=0;p=n.find(".dslca-section-code").val();q=JSON.parse(p);o="";jQuery(".dslca-modules-section-settings input",n).each(function(){var a=jQuery(this);var b=a.data("id");var c=a.val();o=o+b+'="'+c+'" ';q[b]=c});if(undefined!==q["give_new_id"]){delete q["give_new_id"]}q["content"]=[];jQuery(".dslc-modules-area",n).each(function(){h=0;k=jQuery(this);j=parseInt(k.data("size"));l="no";m="no";i+=j;jQuery(this).removeClass("dslc-first-col");jQuery(this).removeClass("dslc-last-col");if(i==g){jQuery(this).addClass("dslc-last-col").next(".dslc-modules-area").addClass("dslc-first-col");i=0;l="yes"}else if(i>g){jQuery(this).removeClass("dslc-last-col").addClass("dslc-first-col");i=j;m="yes"}if(i==j){m="yes";jQuery(this).removeClass("dslc-last-col").addClass("dslc-first-col")}var a='{"element_type":"module_area","last":"'+l+'","first":"'+m+'","size":"'+j+'"}';a=JSON.parse(a);if(undefined!==a["give_new_id"]){delete a["give_new_id"]}a.content=[];jQuery(".dslc-module-front",k).each(function(){var d=jQuery(this);c=parseInt(d[0].getAttribute("data-dslc-module-size"));var e="no";var g="no";jQuery(this).removeClass("dslc-first-col");jQuery(this).removeClass("dslc-last-col");h+=c;if(h==f){jQuery(this).addClass("dslc-last-col");jQuery(this).next(".dslc-module-front").addClass("dslc-first-col");h=0;e="yes";g="yes"}else if(h>f){jQuery(this).removeClass("dslc-last-col").addClass("dslc-first-col");h=c;g="yes"}if(h==c){g="yes";jQuery(this).removeClass("dslc-last-col").addClass("dslc-first-col")}try{b=d[0].querySelector(".dslca-module-code").value}catch(i){console.info("No DSLC code found in module: "+d[0].getAttribute("id"))}if(""!==b){var j=JSON.parse(b);j.last=e;jQuery.each(j,function(a,b){if(false===b||""===b){delete j[a]}if("give_new_id"===a){delete j[a]}});d[0].querySelector(".dslca-module-code").value=JSON.stringify(j);a["content"].push(j)}b=""});q["content"].push(a)});var r=JSON.stringify(q);return r}jQuery(document).ready(function(a){a(document).on("click",".dslca-save-composer-hook",function(b){b.preventDefault();if(!a("body").hasClass("dslca-module-saving-in-progress")&&!a("body").hasClass("dslca-saving-in-progress")){dslc_save_composer()}});a(document).on("click",".dslca-save-draft-composer-hook",function(b){b.preventDefault();if(!a("body").hasClass("dslca-module-saving-in-progress")&&!a("body").hasClass("dslca-saving-in-progress")){dslc_save_draft_composer()}})});function dslca_gen_content_for_search(){if(dslcDebug)console.log("dslca_gen_content_for_search");var a=document.getElementById("dslca-content-for-search");if(null===a){return}var b=a.value;var c="";var d=LiveComposer.Builder.PreviewAreaWindow.document.querySelectorAll("#dslc-main .dslc-module-front [data-exportable-content]");if(undefined!==d){Array.prototype.forEach.call(d,function(a,b){var d;if(a.getAttribute("data-exportable-content")!==""){var e=a.getAttribute("data-exportable-content");d="<"+e+">"+a.innerHTML+"</"+e+">"}else{d=a.innerHTML}if(d!==null){c+=d.replace(/\s+/g," ").trim()+"\n"}})}a.value=c;if(b!==c){dslc_show_publish_button()}}var massagesTicker=jQuery("#editor-messages").newsTicker({row_height:40,max_rows:2,speed:900,direction:"up",duration:12e3,autostart:1,pauseOnHover:1,start:function(){jQuery("#editor-messages").css("opacity","1")}});jQuery(document).ready(function(a){a(document).on("click",".dslc-editor-messages-hide",function(b){var c=a(".dslc-editor-messages-hide").data("can-hide");if(c=="1"){jQuery.post(DSLCAjax.ajaxurl,{action:"dslc-ajax-hidden-panel"});a(".dslc-editor-messages-section").css("display","none");a(".dslca-container").removeClass("active-message-panel")}else{a("#editor-messages").html('<div class="dslc-notice"><a href="https://livecomposerplugin.com/add-ons/?utm_source=editing-sreen&utm_medium=editor-messages&utm_campaign=add-ons" target="_blank">You can hide this panel once you have any of our premium add-ons installed.</a></div>')}});if(a("div.dslc-editor-messages-section").length){a(".dslc-editor-messages-section").css("display","block");a(".dslca-container").addClass("active-message-panel")}});"use strict";var dslcRegularFontsArray=DSLCFonts.regular;var dslcGoogleFontsArray=DSLCFonts.google;var dslcAllFontsArray=dslcRegularFontsArray.concat(dslcGoogleFontsArray);var dslcIconsCurrentSet=DSLCIcons.fontawesome;var dslcDebug=false;var LiveComposer={Builder:{Elements:{},UI:{},Actions:{},Flags:{},PreviewFrame:{},Helpers:{}},Production:{},Utils:{}};(function(){LiveComposer.Builder.Flags={windowScroller:false,panelOpened:false,generate_code_after_row_changed:true};LiveComposer.Builder.Actions={postponed_actions_queue:{},add_postponed_action:function(a){if(a===undefined){return}if(isNaN(this.postponed_actions_queue[a])){this.postponed_actions_queue[a]=0}this.postponed_actions_queue[a]+=1},release_postponed_actions:function(){var a=this;jQuery.each(this.postponed_actions_queue,function(b,c){if(1<c){a.postponed_actions_queue[b]-=1}else if(1==c){window[b]();a.postponed_actions_queue[b]-=1}})}};LiveComposer.Builder.Helpers.insertModule=function(a,b){var c=jQuery(a),b=jQuery(b);var d=[];c.find("script").each(function(){d.push(this.innerHTML);this.parentNode.removeChild(this)});b.after(c).remove();d.forEach(function(a){var b=LiveComposer.Builder.PreviewAreaDocument[0].createElement("script");b.innerHTML=a;b.type="text/javascript";LiveComposer.Builder.PreviewAreaDocument[0].getElementById(c[0].id).appendChild(b)});d=null;b=null;return c}})();"use strict";LiveComposer.Builder.UI.CModalWindow=function(a){if(typeof a!="object"||this.instancesExists===true)return false;var b=this;var c='<div class="dslca-prompt-modal dslca-prompt-modal-active">'+'<div class="dslca-prompt-modal-content"><div class="dslca-prompt-modal-msg">'+'<span class="dslca-prompt-modal-title">'+a.title+"</span>"+'<span class="dslca-prompt-modal-descr">'+a.content+"</span></div>";var d="";if(a.confirm||a.cancel){d='<div class="dslca-prompt-modal-actions">'+'<a href="#" class="dslca-prompt-modal-confirm-hook"><span class="dslc-icon dslc-icon-ok">'+"</span>"+(a.confirm_title?a.confirm_title:"Confirm")+'</a><span class="dslca-prompt-modal-cancel-hook"><span class="dslc-icon dslc-icon-remove">'+"</span>"+(a.cancel_title?a.cancel_title:"Cancel")+"</span></div>"}else{d='<div class="dslca-prompt-modal-actions">'+'<a href="#" class="dslca-prompt-modal-confirm-hook"><span class="dslc-icon dslc-icon-ok">'+"</span>"+(a.ok_title?a.ok_title:"OK")+"</a></div>"}c+=d+"</div>";c=jQuery(c);if(typeof a.confirm!="function")a.confirm=function(){};if(typeof a.cancel!="function")a.cancel=function(){};c.find(".dslca-prompt-modal-confirm-hook").click(function(d){d.stopPropagation();c.find(".dslca-prompt-modal-content").animate({top:"55%"},400);c.animate({opacity:0},400,function(){a.confirm();b.instancesExists=false;jQuery(this).remove()});return false});c.find(".dslca-prompt-modal-cancel-hook").click(function(d){d.stopPropagation();c.find(".dslca-prompt-modal-content").animate({top:"55%"},400);c.animate({opacity:0},400,function(){jQuery(this).remove();b.instancesExists=false;a.cancel()});return false});c.hide();jQuery("body").append(c);c.css({opacity:0}).show().animate({opacity:1},400);c.find(".dslca-prompt-modal-content").css({top:"55%"}).animate({top:"50%"},400);this.instancesExists=true};"use strict";function dslc_show_modal(a,b){if(typeof dslcDebug!=="undefined"&&dslcDebug)console.log("dslc_show_modal");if(jQuery(".dslca-modal:visible").length){dslc_hide_modal("",jQuery(".dslca-modal:visible"))}var b=jQuery(b);var c=jQuery(".dslca-container").height();b.outerHide({clbk:function(){dslc_hide_modal("",jQuery(".dslca-modal:visible"))}});var d=jQuery(a).position(),e=b.outerWidth()/2-a.outerWidth()/2,f=d.left-e;b.css({left:f});jQuery(".dslca-prompt-modal-custom").insertAfter(b);if(jQuery(".dslca-prompt-modal-custom").length>0){jQuery(".dslca-prompt-modal-custom").fadeIn()}b.addClass("dslca-modal-open").show()}function dslc_hide_modal(a,b){if(typeof dslcDebug!=="undefined"&&dslcDebug)console.log("dslc_hide_modal");console.log("dslc_hide_modal");var b=jQuery(b);b.outerHide("destroy");b.hide();if(jQuery(".dslca-prompt-modal-custom").length>0){jQuery(".dslca-prompt-modal-custom").fadeOut()}b.removeClass("dslca-modal-open")}jQuery(document).ready(function(a){a(document).on("click",".dslca-open-modal-hook",function(a){a.preventDefault();var b=jQuery(this).data("modal");dslc_show_modal(jQuery(this),b)});jQuery(document).on("click",".dslca-close-modal-hook",function(a){a.preventDefault();if(!jQuery(this).hasClass("dslca-action-disabled")){var b=jQuery(this).data("modal");dslc_hide_modal(jQuery(this),b)}})});function dslc_js_confirm(a,b,c){if(typeof dslcDebug!=="undefined"&&dslcDebug)console.log("dslc_js_confirm");jQuery(".dslca-prompt-modal").addClass("dslca-prompt-modal-active");jQuery(".dslca-prompt-modal").data("id",a);jQuery(".dslca-prompt-modal").data("target",c);jQuery(".dslca-prompt-modal-msg").html(b);jQuery(".dslca-prompt-modal").css({opacity:0}).show().animate({opacity:1},400);jQuery(".dslca-prompt-modal-content").css({top:"55%"}).animate({top:"50%"},400)}function dslc_js_confirm_close(){if(typeof dslcDebug!=="undefined"&&dslcDebug)console.log("dslc_js_confirm_close");jQuery(".dslca-prompt-modal").removeClass("dslca-prompt-modal-active");jQuery(".dslca-prompt-modal").animate({opacity:0},400,function(){jQuery(this).hide();jQuery(".dslca-prompt-modal-cancel-hook").show();jQuery(".dslca-prompt-modal-confirm-hook").html('<span class="dslc-icon dslc-icon-ok"></span>'+DSLCString.str_confirm)});jQuery(".dslca-prompt-modal-content").animate({top:"55%"},400)}function dslc_modal_keypress_events(a){if(a.which==13){if(jQuery(".dslca-prompt-modal-active").length){jQuery(".dslca-prompt-modal-confirm-hook").trigger("click")}}else if(a.which==27){if(jQuery(".dslca-prompt-modal-active").length){jQuery(".dslca-prompt-modal-cancel-hook").trigger("click")}}}jQuery(document).ready(function(a){a(document).on("click",".dslca-prompt-modal-cancel-hook",function(a){a.preventDefault();var b=jQuery(".dslca-prompt-modal").data("id");var c=jQuery(".dslca-prompt-modal").data("target");if(b=="edit_in_progress"){dslc_module_options_cancel_changes(function(){c.trigger("click")})}else if(b=="delete_module"){}dslc_js_confirm_close();jQuery(".dslca-prompt-modal").data("id","")});a(document).on("click",".dslca-prompt-modal-confirm-hook",function(b){b.preventDefault();var c=jQuery(".dslca-prompt-modal").data("id");var d=jQuery(".dslca-prompt-modal").data("target");var e=true;if(c=="edit_in_progress"){dslc_module_options_confirm_changes(function(){d.trigger("click")})}else if(c=="disable_lc"){window.location=d}else if("delete_module"===c){var f=d.closest(".dslc-module-front");dslc_delete_module(f)}else if("delete_modules_area"===c){var g=d.closest(".dslc-modules-area");var h=g.closest(".dslc-modules-section-inner");dslc_modules_area_delete(g)}else if(c=="delete_modules_section"){dslc_row_delete(d.closest(".dslc-modules-section"))}else if(c=="export_modules_section"){}else if(c=="import_modules_section"){dslc_row_import(a(".dslca-prompt-modal textarea").val());a(".dslca-prompt-modal-confirm-hook span").css({opacity:0});a(".dslca-prompt-modal-confirm-hook .dslca-loading").show();e=false}if(e)dslc_js_confirm_close();jQuery(".dslca-prompt-modal").data("id","")})});"use strict";jQuery(document).on("editorFrameLoaded",function(){var a=jQuery;var b=function(){if(LiveComposer.Builder.Flags.panelOpened){LiveComposer.Builder.UI.shakePanelConfirmButton();return false}return true};LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-copy-module-hook",function(c){c.preventDefault();if(!b())return false;if(!a(this).hasClass("dslca-action-disabled")){dslc_module_copy(a(this).closest(".dslc-module-front"))}});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-delete-module-hook",function(c){c.preventDefault();if(!b())return false;var d=this;if(!a(this).hasClass("dslca-action-disabled")){LiveComposer.Builder.UI.CModalWindow({title:DSLCString.str_del_module_title,content:DSLCString.str_del_module_descr,confirm:function(){var a=jQuery(d).closest(".dslc-module-front");dslc_delete_module(a)}})}});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-module-edit-hook, .dslc-module-front > div:not(.dslca-module-manage)",function(b){if(dslcDebug)console.log("dslca-module-edit-hook");b.preventDefault();var c=jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).length;var d=jQuery(".dslca-modules-section-being-edited",LiveComposer.Builder.PreviewAreaDocument).length;if(a("body").hasClass("dslca-composer-hidden")||c>0||d>0){if(jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument)[0]!=jQuery(this).closest(".dslc-module-front")[0]){LiveComposer.Builder.UI.shakePanelConfirmButton()}return false}var e=a(this).closest(".dslc-module-front"),f=e.data("dslc-module-id");a(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-module-being-edited");e.addClass("dslca-module-being-edited");dslc_module_options_show(f);jQuery("body",LiveComposer.Builder.PreviewAreaDocument).addClass("module-editing-in-progress")});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-change-width-module-hook",function(c){c.preventDefault();if(!b())return false;if(!a(this).hasClass("dslca-action-disabled")){jQuery(".dslca-change-width-module-options",this).toggle();a(this).closest(".dslc-module-front").toggleClass("dslca-change-width-active")}});LiveComposer.Builder.PreviewAreaDocument.on("mouseleave",".dslca-change-width-module-options",function(b){jQuery(this).hide();a(this).closest(".dslc-module-front").removeClass("dslca-change-width-active")});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-change-width-module-options span",function(){dslc_module_width_set(jQuery(this).closest(".dslc-module-front"),jQuery(this).data("size"))});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-module-get-defaults-hook",function(){var b=jQuery(this).closest(".dslc-module-front");var c=dslc_dm_get_defaults(b);var d='<span class="dslca-prompt-modal-title">Module Defaults</span>'+'<span class="dslca-prompt-modal-descr">The code bellow is used to alter the defaults.</span>'+"<textarea></textarea><br><br>";a(".dslca-prompt-modal-cancel-hook").hide();a(".dslca-prompt-modal-confirm-hook").html('<span class="dslc-icon dslc-icon-ok"></span>OK');dslc_js_confirm("dev_mode_get_default",d,b)});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-refresh-module-hook",function(a){jQuery(this).css({"-webkit-animation-name":"dslcRotate","-moz-animation-name":"dslcRotate","animation-name":"dslcRotate","animation-duration":"0.6s","-webkit-animation-duration":"0.6s","animation-iteration-count":"infinite","-webkit-animation-iteration-count":"infinite"});jQuery(this).closest(".dslc-module-front").addClass("dslca-module-being-edited");dslc_module_output_altered(function(){jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-module-being-edited")})});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-wysiwyg-actions-edit-hook",function(){var a=jQuery(this).parent().siblings(".dslca-editable-content");var b=a.closest(".dslc-module-front");if(b.hasClass("dslc-module-handle-like-accordion")){LiveComposer.Builder.PreviewAreaWindow.dslc_accordion_generate_code(b.find(".dslc-accordion"));var c=b.find('.dslca-module-option-front[data-id="accordion_content"]').val();var d=c.split("(dslc_sep)");var e=a.closest(".dslc-accordion-item").index();var f=d[e].trim().replace(/<lctextarea/g,"<textarea").replace(/<\/lctextarea/g,"</textarea")}else if(b.hasClass("dslc-module-handle-like-tabs")){LiveComposer.Builder.PreviewAreaWindow.dslc_tabs_generate_code(b.find(".dslc-tabs"));var c=b.find('.dslca-module-option-front[data-id="tabs_content"]').val();var d=c.split("(dslc_sep)");var e=a.closest(".dslc-tabs-tab-content").index();var f=d[e].trim().replace(/<lctextarea/g,"<textarea").replace(/<\/lctextarea/g,"</textarea")}else{var f=b.find('.dslca-module-option-front[data-id="'+a.data("id")+'"]').val().replace(/<lctextarea/g,"<textarea").replace(/<\/lctextarea/g,"</textarea")}if(f.includes("%")){f=f.replace(/%\(\(%/g,"[");f=f.replace(/%\)\)%/g,"]");f=f.replace(/%\(%/g,"[");f=f.replace(/%\)%/g,"]");f=f.replace(/%\{%/g,"[");f=f.replace(/%\}%/g,"]")}if(typeof tinymce!="undefined"){var g=tinymce.get("dslcawpeditor");if(jQuery("#wp-dslcawpeditor-wrap").hasClass("tmce-active")){g.setContent(f,{format:"html"})}else{jQuery("textarea#dslcawpeditor").val(f)}if(!b.hasClass("dslca-module-being-edited")){b.find(".dslca-module-edit-hook").trigger("click")}jQuery(".dslca-wp-editor").show();a.addClass("dslca-wysiwyg-active");jQuery("#dslcawpeditor_ifr, #dslcawpeditor").css({height:jQuery(".dslca-wp-editor").height()-300})}else{console.info("Live Composer: TinyMCE is undefined.")}});LiveComposer.Builder.PreviewAreaDocument.on("blur",".dslca-editable-content",function(){if(!jQuery("body").hasClass("dslca-composer-hidden")&&jQuery(this).data("type")=="simple"){dslc_editable_content_gen_code(jQuery(this))}}).on("paste",".dslca-editable-content:not(.inline-editor)",function(){if(!jQuery("body").hasClass("dslca-composer-hidden")&&jQuery(this).data("type")=="simple"){var a=jQuery(this);setTimeout(function(){if(a.data("type")=="simple"){a.html(a.text())}dslc_editable_content_gen_code(a)},100)}}).on("focus",".dslca-editable-content",function(){if(jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).length>0&&!jQuery(this).closest(".dslc-module-front").hasClass("dslca-module-being-edited")){jQuery(this).trigger("blur")}}).on("keyup",".dslca-editable-content",function(){if(jQuery(this).data("type")=="simple"){jQuery(this).closest(".dslc-module-front").addClass("dslca-module-change-made")}})});function dslc_module_delete(a){if(dslcDebug)console.log("dslc_delete_module");a.addClass("dslca-module-being-deleted");if(a.hasClass("dslca-module-being-edited")){dslc_show_section(".dslca-modules")}setTimeout(function(){a.remove();dslc_generate_code();dslc_show_publish_button()},1e3);a.css({"-webkit-animation-name":"dslcBounceOut2","-moz-animation-name":"dslcBounceOut2","animation-name":"dslcBounceOut2","animation-duration":"0.6s","-webkit-animation-duration":"0.6s"}).animate({opacity:0},500,function(){a.css({marginBottom:0}).animate({height:0},400,"easeOutQuart")})}function dslc_module_copy(a){if(dslcDebug)console.log("dslc_copy_module");jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-module-being-edited");var b=a[0].cloneNode(true);jQuery(b).appendTo(a.closest(".dslc-modules-area")).css({"-webkit-animation-name":"none","-moz-animation-name":"none","animation-name":"none","animation-duration":"0","-webkit-animation-duration":"0",opacity:0}).addClass("dslca-module-being-edited");dslc_module_new_id(b);dslc_generate_code();jQuery(b).css({opacity:0}).removeClass("dslca-module-being-edited").animate({opacity:1},300);dslc_show_publish_button()}function dslc_module_new_id(a){var b=LiveComposer.Utils.get_unique_id();var c=a.getAttribute("id");a.setAttribute("data-module-id",b);a.setAttribute("id","dslc-module-"+b);var d=a.getElementsByTagName("style")[0];var e=d.textContent;d.setAttribute("id","#css-for-dslc-module-"+b);e=e.split(c).join("dslc-module-"+b);d.textContent=e;LiveComposer.Utils.update_module_property_raw(a,"module_instance_id",b)}function dslc_module_width_set(a,b){if(dslcDebug)console.log("dslc_module_width_set");var c="dslc-"+b+"-col";a.removeClass("dslc-1-col dslc-2-col dslc-3-col dslc-4-col dslc-5-col dslc-6-col dslc-7-col dslc-8-col dslc-9-col dslc-10-col dslc-11-col dslc-12-col").addClass(c);a[0].setAttribute("data-dslc-module-size",b);LiveComposer.Utils.update_module_property_raw(a[0],"dslc_m_size",b);LiveComposer.Builder.PreviewAreaWindow.dslc_masonry();dslc_generate_code();dslc_show_publish_button()}function dslc_module_options_show(a){if(dslcDebug)console.log("dslc_module_options_show");var b=jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument),c=jQuery(".dslca-module-options-front textarea",b),d=jQuery(".dslca-header").data("default-section"),e=jQuery(jQuery("#pseudo-panel").html());jQuery("#wpwrap").append(e);var f={};f["action"]="dslc-ajax-display-module-options";f["dslc"]="active";f["dslc_module_id"]=a;f["dslc_post_id"]=jQuery(".dslca-container").data("data-post-id");f.dslc_url_vars=LiveComposer.Utils.get_page_params();c.each(function(){var a=jQuery(this),b=a.data("id"),c=a.val();if(c.includes("%")){c=c.replace(/%\(\(%/g,"[");c=c.replace(/%\)\)%/g,"]");c=c.replace(/%\(%/g,"[");c=c.replace(/%\)%/g,"]");c=c.replace(/%\{%/g,"[");c=c.replace(/%\}%/g,"]")}f[b]=c});jQuery(".dslca-wp-editor-actions").hide();jQuery(".dslca-wp-editor-notification").show();dslc_hide_publish_button();LiveComposer.Builder.UI.initInlineEditors();var g=jQuery(".dslca-module-options-front",b).children().clone();LiveComposer.Builder.moduleBackup=g;LiveComposer.Builder.Flags.panelOpened=true;e.show();e.addClass("show");jQuery.post(DSLCAjax.ajaxurl,f,function(a){e.remove();dslc_show_section(".dslca-module-edit");if(!jQuery("body").hasClass("rtl")){jQuery(".dslca-module-edit-options-inner").html(a.output)}else{jQuery(".dslca-module-edit-options-inner").html(a.output)}jQuery(".dslca-module-edit-options-tabs").html(a.output_tabs);var b=[];jQuery(".dslca-module-edit-options-inner .dslca-module-edit-option").each(function(){var a=jQuery(this).data("section");if(b.indexOf(a)==-1){b.push(a)}});var c=b.length;for(var f=0;f<c;f++){jQuery('.dslca-header .dslca-options-filter-hook[data-section="'+b[f]+'"]').show()}if(jQuery('.dslca-module-edit-option[data-section="'+d+'"]').length){jQuery('.dslca-header .dslca-options-filter-hook[data-section="'+d+'"]').show();jQuery('.dslca-header .dslca-options-filter-hook[data-section="'+d+'"]').trigger("click")}else{jQuery(".dslca-header .dslca-options-filter-hook:first").hide();jQuery(".dslca-header .dslca-options-filter-hook:first").next(".dslca-options-filter-hook").trigger("click")}jQuery(".dslca-module-edit-actions").show();jQuery(".dslca-wp-editor-notification").hide();jQuery(".dslca-wp-editor-actions").show();jQuery(".dslca-header .dslca-go-to-section-hook").hide();jQuery(".dslca-row-edit-actions").hide();LiveComposer.Builder.UI.loadOptionsDeps()})}function dslc_module_output_default(a,b){if(dslcDebug)console.log("dslc_module_output_default");jQuery.post(DSLCAjax.ajaxurl,{action:"dslc-ajax-add-module",dslc:"active",dslc_module_id:a,dslc_post_id:jQuery(".dslca-container").data("post-id"),dslc_url_vars:LiveComposer.Utils.get_page_params(),dslc_new_module:true},function(a){b(a)})}function dslc_module_output_altered(a){if(dslcDebug)console.log("dslc_module_output_altered");a=typeof a!=="undefined"?a:false;var b=jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument),c=b.data("dslc-module-id"),d=jQuery(".dslca-module-options-front textarea",b),e=b.data("module-id");var f={};f["action"]="dslc-ajax-add-module";f["dslc"]="active";f["dslc_module_id"]=c;f["dslc_module_instance_id"]=e;f["dslc_post_id"]=jQuery(".dslca-container").data("post-id");if(b.hasClass("dslca-preload-preset"))f["dslc_preload_preset"]="enabled";else f["dslc_preload_preset"]="disabled";b.removeClass("dslca-preload-preset");d.each(function(){var a=jQuery(this);var b=a.data("id");var c=a.val();f[b]=c});f.dslc_url_vars=LiveComposer.Utils.get_page_params();jQuery.post(DSLCAjax.ajaxurl,f,function(c){var d=LiveComposer.Builder.Helpers.insertModule(c.output,b);d.addClass("dslca-module-being-edited");c=null;d=null;LiveComposer.Builder.PreviewAreaWindow.dslc_carousel();LiveComposer.Builder.PreviewAreaWindow.dslc_masonry();LiveComposer.Builder.PreviewAreaWindow.dslc_tabs();LiveComposer.Builder.PreviewAreaWindow.dslc_init_accordion();var e=new Event("dslc_module_output_altered");LiveComposer.Builder.PreviewAreaWindow.dispatchEvent(e);if(a){a(c)}})}function dslc_module_output_reload(a,b){if(dslcDebug)console.log("dslc_module_output_reload");b=typeof b!=="undefined"?b:false;var c=a.data("dslc-module-id"),d=jQuery(".dslca-module-options-front textarea",a),e=a.data("module-id");var f={};f["action"]="dslc-ajax-add-module";f["dslc"]="active";f["dslc_module_id"]=c;f["dslc_module_instance_id"]=e;f["dslc_post_id"]=jQuery(".dslca-container").data("post-id");f["dslc_preload_preset"]="enabled";a.removeClass("dslca-preload-preset");d.each(function(){var a=jQuery(this);var b=a.data("id");var c=a.val();f[b]=c});a.append('<div class="dslca-module-reloading"><span class="dslca-icon dslc-icon-spin dslc-icon-refresh"></span></div>');jQuery.post(DSLCAjax.ajaxurl,f,function(c){a.after(c.output).next().addClass("dslca-module-being-edited");a.remove();dslc_generate_code();dslc_show_publish_button();LiveComposer.Builder.PreviewAreaWindow.dslc_carousel();LiveComposer.Builder.PreviewAreaWindow.dslc_masonry();LiveComposer.Builder.PreviewAreaWindow.dslc_tabs();LiveComposer.Builder.PreviewAreaWindow.dslc_init_accordion();if(b){b(c)}jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-module-being-edited")})}function dslc_delete_module(a){dslc_module_delete(a)}function dslc_copy_module(a){dslc_module_copy(a)}function dslc_display_module_options(a){dslc_module_options_show(a)}function dslc_get_module_output(a,b){dslc_module_output_default(a,b)}function dslc_preview_change(a){dslc_module_output_altered(a)}function dslc_reload_module(a,b){dslc_module_output_reload(a,b)}"use strict";LiveComposer.Builder.Elements.CModuleArea=function(a){var b=this;this.section=jQuery(a).closest(".dslc-modules-section");this.elem=a;this.observer=new mqMutationObserver(a,function(){var c=b.elem.classList;if(a.querySelectorAll(".dslc-module-front").length==0){c.add("dslc-modules-area-empty");c.remove("dslc-modules-area-not-empty")}else{c.remove("dslc-modules-area-empty");c.add("dslc-modules-area-not-empty")}},{childList:true});this.sortable=Sortable.create(a,{group:"modules",animation:350,handle:".dslca-move-module-hook",draggable:".dslc-module-front",ghostClass:"dslca-module-ghost",chosenClass:"dslca-module-dragging",scroll:true,scrollSensitivity:150,scrollSpeed:15,setData:function(a,b){a.setData(LiveComposer.Utils.msieversion()!==false?"Text":"text/html",b.innerHTML)},onStart:function(a){a.oldIndex;jQuery("body").removeClass("dslca-drag-not-in-progress").addClass("dslca-drag-in-progress");jQuery("body",LiveComposer.Builder.PreviewAreaWindow.document).removeClass("dslca-drag-not-in-progress").addClass("dslca-drag-in-progress")},onEnd:function(a){a.oldIndex;a.newIndex;a.preventDefault();dslc_generate_code();
2
- LiveComposer.Builder.UI.stopScroller();jQuery("body").removeClass("dslca-drag-in-progress").addClass("dslca-drag-not-in-progress");jQuery("body",LiveComposer.Builder.PreviewAreaWindow.document).removeClass("dslca-drag-in-progress").addClass("dslca-drag-not-in-progress")},onAdd:function(a){var c=a.item;a.from;if(jQuery(c).data("id")=="DSLC_M_A"){dslc_modules_area_add(jQuery(b.section).find(".dslc-modules-section-wrapper .dslc-modules-section-inner"));c.remove()}},onUpdate:function(a){var b=a.item;dslc_show_publish_button()},onSort:function(a){},onRemove:function(a){},onFilter:function(a){var b=a.item},onMove:function(a){a.dragged;a.draggedRect;a.related;a.relatedRect;if(jQuery(".dslc-modules-area-empty").find(".dslc-module-front").length>0){jQuery(this).removeClass("dslc-modules-area-empty").addClass("dslc-modules-area-not-empty");jQuery(".dslca-no-content:not(:visible)",this).show().css({"-webkit-animation-name":"dslcBounceIn","-moz-animation-name":"dslcBounceIn","animation-name":"dslcBounceIn","animation-duration":"0.6s","-webkit-animation-duration":"0.6s",padding:0}).animate({padding:"35px 0"},300,function(){})}}});jQuery(a).attr("data-jsinit","initialized");jQuery(document).on("LC.sortableOff",function(){b.sortable&&b.sortable.option&&b.sortable.option("disabled",true)});jQuery(document).on("LC.sortableOn",function(){b.sortable&&b.sortable.option&&b.sortable.option("disabled",false)})};"use strict";jQuery(document).on("editorFrameLoaded",function(){function a(){var a=jQuery(".dslc-modules-area",LiveComposer.Builder.PreviewAreaDocument);jQuery(a).each(function(a,b){new LiveComposer.Builder.Elements.CModuleArea(b)})}var b=function(){if(LiveComposer.Builder.Flags.panelOpened){LiveComposer.Builder.UI.shakePanelConfirmButton();return false}return true};if(!jQuery("#dslc-main .dslc-modules-section",LiveComposer.Builder.PreviewAreaDocument).length&&!jQuery("#dslca-tut-page",LiveComposer.Builder.PreviewAreaDocument).length){dslc_row_add(a())}else{a()}LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-copy-modules-area-hook",function(a){a.preventDefault();if(!b())return false;if(!jQuery(this).hasClass("dslca-action-disabled")){var c=jQuery(this).closest(".dslc-modules-area");dslc_copy_modules_area(c)}});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-delete-modules-area-hook",function(a){a.preventDefault();if(!b())return false;if(!jQuery(this).hasClass("dslca-action-disabled")){var c=jQuery(this).closest(".dslc-modules-area").hasClass("dslc-modules-area-empty");if(!c){var d=jQuery(this);LiveComposer.Builder.UI.CModalWindow({title:DSLCString.str_del_area_title,content:DSLCString.str_del_area_descr,confirm:function(){var a=d.closest(".dslc-modules-area");dslc_modules_area_delete(a)}})}else{var e=jQuery(this).closest(".dslc-modules-area");dslc_delete_modules_area(e)}}});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-change-width-modules-area-options span",function(){if(!b())return false;if(!jQuery(this).hasClass("dslca-action-disabled")){dslc_modules_area_width_set(jQuery(this).closest(".dslc-modules-area"),jQuery(this).data("size"))}});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-change-width-modules-area-hook",function(a){a.preventDefault();if(!b())return false;if(!jQuery(this).hasClass("dslca-action-disabled")){if(jQuery(".dslca-change-width-modules-area-options:visible",this).length){jQuery(".dslca-change-width-modules-area-options",this).hide()}else{jQuery(".dslca-change-width-modules-area-options",this).show()}}});LiveComposer.Builder.PreviewAreaDocument.on("mouseleave",".dslca-change-width-modules-area-options",function(a){jQuery(this).hide()});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-add-modules-area-hook",function(a){a.preventDefault();if(!b())return false;dslc_modules_area_add(jQuery(this).closest(".dslc-modules-section").find(".dslc-modules-section-inner"))})});function dslc_modules_area_add(a){if(dslcDebug)console.log("dslc_add_modules_area");var b='<div class="dslc-modules-area dslc-col dslc-12-col dslc-modules-area-empty " data-size="12">'+'<div class="dslca-modules-area-manage"> <div class="dslca-modules-area-manage-inner">'+'<span class="dslca-manage-action dslca-copy-modules-area-hook" title="Duplicate" ><span class="dslca-icon dslc-icon-copy">'+'</span></span> <span class="dslca-manage-action dslca-move-modules-area-hook" title="Drag to move" >'+'<span class="dslca-icon dslc-icon-move"></span></span>'+'<span class="dslca-manage-action dslca-change-width-modules-area-hook" title="Change width" >'+'<span class="dslca-icon dslc-icon-columns"></span> <div class="dslca-change-width-modules-area-options">'+'<span>Container Width</span><span data-size="1">1/12</span><span data-size="2">2/12</span>'+'<span data-size="3">3/12</span><span data-size="4">4/12</span> <span data-size="5">5/12</span><span data-size="6">6/12</span>'+'<span data-size="7">7/12</span><span data-size="8">8/12</span> <span data-size="9">9/12</span><span data-size="10">10/12</span>'+'<span data-size="11">11/12</span><span data-size="12">12/12</span> </div> </span>'+'<span class="dslca-manage-action dslca-delete-modules-area-hook" title="Delete" ><span class="dslca-icon dslc-icon-remove"></span></span> </div> </div>'+"</div>";jQuery(b).appendTo(a).css({height:0}).animate({height:99},300,function(){jQuery(this).css({height:"auto"})}).addClass("dslca-init-animation");var c=jQuery(".dslc-modules-area-empty",LiveComposer.Builder.PreviewAreaDocument);jQuery(c).each(function(a,b){new LiveComposer.Builder.Elements.CModuleArea(b)});dslc_drag_and_drop();dslc_generate_code();dslc_show_publish_button()}function dslc_modules_area_delete(a){if(dslcDebug)console.log("dslc_delete_modules_area");var b=a.closest(".dslc-modules-section").find(".dslc-modules-section-inner"),c=false;a.addClass("dslca-modules-area-being-deleted");if(b.find(".dslc-modules-area").length<2){c=true}if(a.find(".dslca-module-being-edited").length){jQuery(".dslca-header .dslca-options-filter-hook",LiveComposer.Builder.PreviewAreaDocument).hide();jQuery(".dslca-module-edit-actions",LiveComposer.Builder.PreviewAreaDocument).hide();jQuery(".dslca-header .dslca-go-to-section-hook",LiveComposer.Builder.PreviewAreaDocument).show();dslc_show_section(".dslca-modules")}setTimeout(function(){if(c){var d=a.closest(".dslc-modules-section-inner");if(2<=a.closest("#dslc-main").find(".dslc-modules-section").length){dslc_row_delete(a.closest(".dslc-modules-section"))}else{a.remove();dslc_modules_area_add(b)}}a.remove();dslc_generate_code();dslc_show_publish_button()},900);a.css({"-webkit-animation-name":"dslcBounceOut","-moz-animation-name":"dslcBounceOut","animation-name":"dslcBounceOut","animation-duration":"0.6s","-webkit-animation-duration":"0.6s",overflow:"hidden"}).animate({opacity:0},600).animate({height:0,marginBottom:0},300,function(){a.remove();dslc_generate_code();dslc_show_publish_button()})}function dslc_modules_area_copy(a){if(dslcDebug)console.log("dslc_copy_modules_area");var b,c=a.closest(".dslc-modules-section").find(".dslc-modules-section-inner");var d=a.clone().appendTo(c);new LiveComposer.Builder.Elements.CModuleArea(d[0]);d.find(".dslca-modules-area-manage").trigger("mouseleave");d.data("size",a.data("size")).find(".dslc-module-front").css({"-webkit-animation-name":"none","-moz-animation-name":"none","animation-name":"none","animation-duration":"0","-webkit-animation-duration":"0",opacity:0}).each(function(){var a=jQuery(this);dslc_module_new_id(a[0]);jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-module-being-edited");dslc_generate_code();a.animate({opacity:1},300)});dslc_drag_and_drop();dslc_show_publish_button();dslc_generate_code()}function dslc_modules_area_width_set(a,b){if(dslcDebug)console.log("dslc_modules_area_width_set");var c="dslc-"+b+"-col";a.removeClass("dslc-1-col dslc-2-col dslc-3-col dslc-4-col dslc-5-col dslc-6-col dslc-7-col dslc-8-col dslc-9-col dslc-10-col dslc-11-col dslc-12-col").addClass(c).data("size",b);LiveComposer.Builder.PreviewAreaWindow.dslc_masonry();if(LiveComposer.Builder.Flags.panelOpened){return false}dslc_generate_code();dslc_show_publish_button()}LiveComposer.Builder.moduleareas_init=function(){jQuery("#dslc-main .dslc-modules-area",LiveComposer.Builder.PreviewAreaDocument).each(function(){if(jQuery(this).data("jsinit")!=="initialized"){new LiveComposer.Builder.Elements.CModuleArea(this)}})};function dslc_add_modules_area(a){dslc_modules_area_add(a)}function dslc_delete_modules_area(a){dslc_modules_area_delete(a)}function dslc_copy_modules_area(a){dslc_modules_area_copy(a)}"use strict";function dslc_update_preset(){if(dslcDebug)console.log("dslc_update_preset");var a=jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument),b=a.find('.dslca-module-option-front[data-id="css_load_preset"]').val(),c=a.find(".dslca-module-code").val(),d=a.data("dslc-module-id");if("none"!==b&&""!==b){jQuery.post(DSLCAjax.ajaxurl,{action:"dslc-ajax-save-preset",dslc_preset_name:b,dslc_preset_code:c,dslc_module_id:d},function(b){if(b.preset_setting=="enabled"){jQuery(".dslc-module-front:not(#"+a.attr("id")+')[data-dslc-module-id="'+a.data("dslc-module-id")+'"][data-dslc-preset="'+a.data("dslc-preset")+'"]',LiveComposer.Builder.PreviewAreaDocument).each(function(){dslc_module_output_reload(jQuery(this))})}})}}jQuery(document).ready(function(a){a(document).on("keypress",'.dslca-module-edit-field[name="css_save_preset"]',function(b){if(b.which==13){var c=a(this).val(),d=c.toLowerCase().replace(/\s/g,"-");a("body").addClass("dslca-new-preset-added");a('.dslca-module-edit-field[name="css_load_preset"]').append('<option value="'+d+'">'+d+"</option>").val(d).trigger("change");a(this).val("")}});a(document).on("change",'.dslca-module-edit-field[name="css_load_preset"]',function(b){a(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).addClass("dslca-preload-preset")})});"use strict";LiveComposer.Builder.Elements.CRow=function(a){var b=this;this.elem=a;var c=jQuery(a).find(".dslc-modules-section-wrapper .dslc-modules-section-inner").eq(0)[0];jQuery(a).droppable({drop:function(a,b){var c=jQuery(this).find(".dslc-modules-section-inner");var d=b.draggable.data("id");if(d=="DSLC_M_A"){dslc_modules_area_add(c)}}});this.sortable=jQuery(c).sortable({connectWith:".dslc-modules-section-inner",items:".dslc-modules-area",handle:'.dslca-move-modules-area-hook:not(".dslca-action-disabled")',placeholder:"dslca-modules-area-placeholder",cursorAt:{top:0,left:0},tolerance:"intersect",scroll:true,scrollSensitivity:100,scrollSpeed:15,sort:function(){jQuery(this).removeClass("ui-state-default")},over:function(a,b){var c=b.placeholder.closest(".dslc-modules-section");jQuery(c).removeClass("dslc-modules-section-empty").addClass("dslc-modules-section-not-empty");c.siblings(".dslc-modules-section").each(function(){if(jQuery(".dslc-modules-area:not(.ui-sortable-helper)",jQuery(this)).length){jQuery(this).removeClass("dslc-modules-section-empty").addClass("dslc-modules-section-not-empty")}else{jQuery(this).removeClass("dslc-modules-section-not-empty").addClass("dslc-modules-section-empty")}})},remove:function(){jQuery(b.elem).find(".dslc-modules-area").length==0&&dslc_modules_area_add(jQuery(c))},update:function(a,b){dslc_generate_code();dslc_show_publish_button()},start:function(a,b){b.placeholder.html('<span class="dslca-placeholder-help-text"><span class="dslca-placeholder-help-text-inner">'+DSLCString.str_area_helper_text+"</span></span>");if(!jQuery(b.item).hasClass("dslc-12-col")){b.placeholder.width(b.item.width()-10)}else{b.placeholder.width(b.item.width()).css({margin:0})}jQuery("body").removeClass("dslca-drag-not-in-progress").addClass("dslca-drag-in-progress dslca-modules-area-drag-in-progress");jQuery(".dslc-modules-section-inner").sortable("refreshPositions")},stop:function(a,b){LiveComposer.Builder.UI.stopScroller();jQuery("body").removeClass("dslca-drag-in-progress dslca-modules-area-drag-in-progress").addClass("dslca-drag-not-in-progress");jQuery(".dslca-anim-opacity-drop").removeClass("dslca-anim-opacity-drop")},change:function(a,b){}});jQuery(a).attr("data-jsinit","initialized");jQuery(document).on("LC.sortableOff",function(){if(undefined!==b.sortable.sortable("instance")){b.sortable.sortable("option","disabled",true)}});jQuery(document).on("LC.sortableOn",function(){if(undefined!==b.sortable.sortable("instance")){b.sortable.sortable("option","disabled",false)}})};"use strict";jQuery(document).on("editorFrameLoaded",function(){var a=jQuery;var b=function(){if(LiveComposer.Builder.Flags.panelOpened){LiveComposer.Builder.UI.shakePanelConfirmButton();return false}return true};jQuery(".dslc-modules-section",LiveComposer.Builder.PreviewAreaDocument).each(function(){new LiveComposer.Builder.Elements.CRow(this)});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-delete-modules-section-hook",function(c){if(!b())return false;c.preventDefault();var d=this;if(!a(this).hasClass("dslca-action-disabled")){LiveComposer.Builder.UI.CModalWindow({title:DSLCString.str_del_row_title,content:DSLCString.str_del_row_descr,confirm:function(){dslc_row_delete(a(d).closest(".dslc-modules-section"))}})}});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-import-modules-section-hook",function(a){a.preventDefault();if(!b())return false;if(!jQuery(this).hasClass("dslca-action-disabled")){LiveComposer.Builder.UI.CModalWindow({title:DSLCString.str_import_row_title,content:DSLCString.str_import_row_descr+"<br><br><textarea></textarea>",confirm:function(){dslc_row_import(jQuery(".dslca-prompt-modal textarea").val());jQuery(".dslca-prompt-modal-confirm-hook span").css({opacity:0});jQuery(".dslca-prompt-modal-confirm-hook .dslca-loading").show()},confirm_title:DSLCString.str_import})}});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-export-modules-section-hook",function(c){c.preventDefault();if(!b())return false;if(!a(this).hasClass("dslca-action-disabled")){a(".dslca-prompt-modal-cancel-hook").hide();a(".dslca-prompt-modal-confirm-hook").html('<span class="dslc-icon dslc-icon-ok"></span>'+DSLCString.str_ok);LiveComposer.Builder.UI.CModalWindow({title:DSLCString.str_export_row_title,content:DSLCString.str_export_row_descr+"<br><br><textarea>"+"["+dslc_generate_section_code(a(this).closest(".dslc-modules-section"))+"]"+"</textarea></span>"})}});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-copy-modules-section-hook",function(){if(!b())return false;if(!jQuery(this).hasClass("dslca-action-disabled")){dslc_row_copy(jQuery(this).closest(".dslc-modules-section"))}});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-add-modules-section-hook",function(c){c.preventDefault();if(!b())return false;var d=a(this);if(!a(this).hasClass("dslca-action-disabled")){d.find(".dslca-icon").removeClass("dslc-icon-align-justify").addClass("dslc-icon-spinner dslc-icon-spin");dslc_row_add(function(){d.find(".dslca-icon").removeClass("dslc-icon-spinner dslc-icon-spin").addClass("dslc-icon-align-justify")})}});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-edit-modules-section-hook",function(){if(!b())return false;var c=this;var d=jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).length;var e=jQuery(".dslca-modules-section-being-edited",LiveComposer.Builder.PreviewAreaDocument).length;if(a("body").hasClass("dslca-composer-hidden")||d>0||e>0)return false;if(!a(this).hasClass("dslca-action-disabled")){dslc_row_edit(a(this).closest(".dslc-modules-section"))}jQuery("body",LiveComposer.Builder.PreviewAreaDocument).addClass("section-editing-in-progress")})});function dslc_row_add(a){if(dslcDebug)console.log("dslc_row_add");a=typeof a!=="undefined"?a:false;var b=jQuery.Deferred();var c=sessionStorage;var d=jQuery();var e=c.getItem("cache-dslc-ajax-add-modules-section");if(null===e){jQuery.post(DSLCAjax.ajaxurl,{action:"dslc-ajax-add-modules-section",dslc:"active"},function(e){c.setItem("cache-dslc-ajax-add-modules-section",e.output);d=dslc_row_after_add(e.output);if(a){a()}return b})}else{d=dslc_row_after_add(e);if(a){a()}return b}}function dslc_row_after_add(a){var b=jQuery(a);b.appendTo(LiveComposer.Builder.PreviewAreaDocument.find("#dslc-main"));dslc_drag_and_drop();dslc_generate_code();dslc_show_publish_button();new LiveComposer.Builder.Elements.CRow(b);new LiveComposer.Builder.Elements.CModuleArea(b.find(".dslc-modules-area").eq(0)[0]);b.find(".dslc-modules-area").addClass("dslc-modules-area-empty dslc-last-col");return b}function dslc_row_delete(a){if(dslcDebug)console.log("dslc_row_delete");if(a.find(".dslca-module-being-edited")){jQuery(".dslca-header .dslca-options-filter-hook").hide();jQuery(".dslca-module-edit-actions").hide();jQuery(".dslca-header .dslca-go-to-section-hook").show();dslc_show_section(".dslca-modules")}a.trigger("mouseleave").remove();dslc_generate_code();dslc_show_publish_button()}function dslc_row_edit(a){if(dslcDebug)console.log("dslc_row_edit");var b,c;jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-module-being-edited");jQuery(".dslca-modules-section-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-modules-section-being-edited").removeClass("dslca-modules-section-change-made");a.addClass("dslca-modules-section-being-edited");jQuery(".dslca-header .dslca-go-to-section-hook").hide();jQuery('.dslca-row-options-filter-hook[data-section="styling"], .dslca-row-options-filter-hook[data-section="responsive"]').show();jQuery('.dslca-row-options-filter-hook[data-section="styling"]').trigger("click");jQuery(".dslca-header .dslca-options-filter-hook").hide();jQuery(".dslca-module-edit-actions").hide();jQuery(".dslca-row-edit-actions").show();jQuery(".dslca-modules-section-edit-field").each(function(){if("type"===jQuery(this).data("id")){if(""===jQuery('.dslca-modules-section-being-edited .dslca-modules-section-settings input[data-id="type"]',LiveComposer.Builder.PreviewAreaDocument).val()||"wrapped"===jQuery('.dslca-modules-section-being-edited .dslca-modules-section-settings input[data-id="type"]',LiveComposer.Builder.PreviewAreaDocument).val()){jQuery('select[data-id="type"]').val("wrapper").change()}}if(jQuery(this).data("id")=="border-top"){if(jQuery('.dslca-modules-section-being-edited .dslca-modules-section-settings input[data-id="border"]',LiveComposer.Builder.PreviewAreaDocument).val().indexOf("top")>=0){jQuery(this).prop("checked",true);jQuery(this).siblings(".dslca-modules-section-edit-option-checkbox-hook").find(".dslca-icon").removeClass("dslc-icon-check-empty").addClass("dslc-icon-check")}else{jQuery(this).prop("checked",false);jQuery(this).siblings(".dslca-modules-section-edit-option-checkbox-hook").find(".dslca-icon").removeClass("dslc-icon-check").addClass("dslc-icon-check-empty")}}else if(jQuery(this).data("id")=="border-right"){if(jQuery('.dslca-modules-section-being-edited .dslca-modules-section-settings input[data-id="border"]',LiveComposer.Builder.PreviewAreaDocument).val().indexOf("right")>=0){jQuery(this).prop("checked",true);jQuery(this).siblings(".dslca-modules-section-edit-option-checkbox-hook").find(".dslca-icon").removeClass("dslc-icon-check-empty").addClass("dslc-icon-check")}else{jQuery(this).prop("checked",false);jQuery(this).siblings(".dslca-modules-section-edit-option-checkbox-hook").find(".dslca-icon").removeClass("dslc-icon-check").addClass("dslc-icon-check-empty")}}else if(jQuery(this).data("id")=="border-bottom"){if(jQuery('.dslca-modules-section-being-edited .dslca-modules-section-settings input[data-id="border"]',LiveComposer.Builder.PreviewAreaDocument).val().indexOf("bottom")>=0){jQuery(this).prop("checked",true);jQuery(this).siblings(".dslca-modules-section-edit-option-checkbox-hook").find(".dslca-icon").removeClass("dslc-icon-check-empty").addClass("dslc-icon-check")}else{jQuery(this).prop("checked",false);jQuery(this).siblings(".dslca-modules-section-edit-option-checkbox-hook").find(".dslca-icon").removeClass("dslc-icon-check").addClass("dslc-icon-check-empty")}}else if(jQuery(this).data("id")=="border-left"){if(jQuery('.dslca-modules-section-being-edited .dslca-modules-section-settings input[data-id="border"]',LiveComposer.Builder.PreviewAreaDocument).val().indexOf("left")>=0){jQuery(this).prop("checked",true);jQuery(this).siblings(".dslca-modules-section-edit-option-checkbox-hook").find(".dslca-icon").removeClass("dslc-icon-check-empty").addClass("dslc-icon-check")}else{jQuery(this).prop("checked",false);jQuery(this).siblings(".dslca-modules-section-edit-option-checkbox-hook").find(".dslca-icon").removeClass("dslc-icon-check").addClass("dslc-icon-check-empty")}}else if(jQuery(this).hasClass("dslca-modules-section-edit-field-checkbox")){if(jQuery('.dslca-modules-section-being-edited .dslca-modules-section-settings input[data-id="'+jQuery(this).data("id")+'"]',LiveComposer.Builder.PreviewAreaDocument).val().indexOf(jQuery(this).data("val"))>=0){jQuery(this).prop("checked",true);jQuery(this).siblings(".dslca-modules-section-edit-option-checkbox-hook").find(".dslca-icon").removeClass("dslc-icon-check-empty").addClass("dslc-icon-check")}else{jQuery(this).prop("checked",false);jQuery(this).siblings(".dslca-modules-section-edit-option-checkbox-hook").find(".dslca-icon").removeClass("dslc-icon-check").addClass("dslc-icon-check-empty")}}else{jQuery(this).val(jQuery('.dslca-modules-section-being-edited .dslca-modules-section-settings input[data-id="'+jQuery(this).data("id")+'"]',LiveComposer.Builder.PreviewAreaDocument).val());if(jQuery(this).hasClass("dslca-modules-section-edit-field-colorpicker")){var a=jQuery(this);jQuery(this).closest(".dslca-modules-section-edit-option").find(".sp-preview-inner").removeClass("sp-clear-display").css({"background-color":a.val()});jQuery(this).css({"background-color":a.val()})}}});jQuery(".dslca-modules-section-edit-field-upload").each(function(){var a=jQuery(this).closest(".dslca-modules-section-edit-option");if(jQuery(this).val()&&jQuery(this).val()!=="disabled"){jQuery(".dslca-modules-section-edit-field-image-add-hook",a).hide();jQuery(".dslca-modules-section-edit-field-image-remove-hook",a).show()}else{jQuery(".dslca-modules-section-edit-field-image-remove-hook",a).hide();jQuery(".dslca-modules-section-edit-field-image-add-hook",a).show()}});dslc_show_section(".dslca-modules-section-edit");LiveComposer.Builder.Flags.panelOpened=true;dslc_hide_publish_button()}function dslc_row_edit_cancel(a){if(dslcDebug)console.log("dslc_row_cancel_changes");a=typeof a!=="undefined"?a:false;LiveComposer.Builder.Flags.generate_code_after_row_changed=false;jQuery(".dslca-modules-section-being-edited .dslca-modules-section-settings input",LiveComposer.Builder.PreviewAreaDocument).each(function(){jQuery(this).val(jQuery(this).data("def"));jQuery('.dslca-modules-section-edit-field[data-id="'+jQuery(this).data("id")+'"]').val(jQuery(this).data("def")).trigger("change")});LiveComposer.Builder.Flags.generate_code_after_row_changed=true;dslc_generate_code();dslc_show_publish_button();dslc_show_section(".dslca-modules");jQuery(".dslca-row-edit-actions").hide();jQuery(".dslca-row-options-filter-hook").hide();jQuery(".dslca-header .dslca-go-to-section-hook").show();dslc_show_publish_button;jQuery(".dslca-modules-section-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-modules-section-being-edited dslca-modules-section-change-made");if(a){a()}LiveComposer.Builder.Flags.panelOpened=false;jQuery("body",LiveComposer.Builder.PreviewAreaDocument).removeClass("section-editing-in-progress")}function dslc_row_edit_confirm(a){if(dslcDebug)console.log("dslc_confirm_row_changes");a=typeof a!=="undefined"?a:false;jQuery(".dslca-modules-section-being-edited .dslca-modules-section-settings input",LiveComposer.Builder.PreviewAreaDocument).each(function(){jQuery(this).data("def",jQuery(this).val())});dslc_show_section(".dslca-modules");jQuery(".dslca-row-edit-actions").hide();jQuery(".dslca-row-options-filter-hook").hide();jQuery(".dslca-header .dslca-go-to-section-hook").show();jQuery(".dslca-modules-section-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-modules-section-being-edited dslca-modules-section-change-made");dslc_generate_code();dslc_show_publish_button();if(a){a()}LiveComposer.Builder.Flags.panelOpened=false;jQuery("body",LiveComposer.Builder.PreviewAreaDocument).removeClass("section-editing-in-progress")}function dslc_row_copy(a){if(dslcDebug)console.log("dslc_row_copy");var b,c,d;c=a.clone().appendTo(jQuery("#dslc-main",LiveComposer.Builder.PreviewAreaDocument));c[0].removeAttribute("data-jsinit");c.find(".dslc-modules-area").each(function(){var b=jQuery(this).index();jQuery(this).data("size",a.find(".dslc-modules-area:eq( "+b+" )").data("size"));this.removeAttribute("data-jsinit")});new LiveComposer.Builder.Elements.CRow(c);c.find(".dslc-module-front").css({"-webkit-animation-name":"none","-moz-animation-name":"none","animation-name":"none","animation-duration":"0","-webkit-animation-duration":"0",opacity:0}).each(function(){var a=jQuery(this);dslc_module_new_id(a[0]);LiveComposer.Builder.rows_init();LiveComposer.Builder.moduleareas_init();dslc_generate_code();dslc_drag_and_drop();jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-module-being-edited");a.animate({opacity:1},300);dslc_show_publish_button()});dslc_section_new_id(c[0])}function dslc_section_new_id(a){if(dslcDebug)console.log("dslc_section_new_id");var b=LiveComposer.Utils.get_unique_id();a.setAttribute("data-section-id",b);LiveComposer.Utils.update_section_property_raw(a,"section_instance_id",b)}function dslc_row_import(a){if(dslcDebug)console.log("dslc_row_import");jQuery.post(DSLCAjax.ajaxurl,{action:"dslc-ajax-import-modules-section",dslc:"active",dslc_modules_section_code:a},function(a){dslc_js_confirm_close();jQuery("#dslc-main",LiveComposer.Builder.PreviewAreaDocument).append(a.output);LiveComposer.Builder.PreviewAreaWindow.dslc_bg_video();LiveComposer.Builder.PreviewAreaWindow.dslc_carousel();LiveComposer.Builder.PreviewAreaWindow.dslc_masonry();LiveComposer.Builder.rows_init();LiveComposer.Builder.moduleareas_init();dslc_drag_and_drop();dslc_generate_code();dslc_show_publish_button()})}function dslc_add_modules_section(){dslc_row_add()}function dslc_delete_modules_section(a){dslc_row_delete(a)}function dslc_edit_modules_section(a){dslc_row_edit(a)}function dslc_copy_modules_section(a){dslc_row_copy(a)}function dslc_import_modules_section(a){dslc_row_import(a)}jQuery(document).ready(function(a){a(document).on("click",".dslca-row-edit-save",function(){dslc_row_edit_confirm();a(".dslca-currently-editing").removeAttr("style");a(".dslca-row-options-filter-hook.dslca-active").removeClass("dslca-active");LiveComposer.Builder.PreviewAreaWindow.dslc_responsive_classes(true)});a(document).on("click",".dslca-row-edit-cancel",function(){dslc_row_edit_cancel();a(".dslca-currently-editing").removeAttr("style");a(".dslca-row-options-filter-hook.dslca-active").removeClass("dslca-active");LiveComposer.Builder.PreviewAreaWindow.dslc_responsive_classes(true)})});LiveComposer.Builder.rows_init=function(){jQuery("#dslc-main .dslc-modules-section",LiveComposer.Builder.PreviewAreaDocument).each(function(){if(jQuery(this).data("jsinit")!=="initialized"){new LiveComposer.Builder.Elements.CRow(this)}})};jQuery(document).ready(function(a){var b=function(a){var b=.75;var c=500;var d=100;var e=jQuery(".dslca-section-scroller",a);var f=jQuery(".dslca-section-scroller-inner",a)[0];e.on("wheel",function(a){g(a.originalEvent.deltaY||a.originalEvent.deltaX);return false});function g(a){if(a<0){a=-d}else{a=d}a=a*b;var c=e.find(".dslca-section-scroller-content").width();var g=e.width();if(c<=g)return false;var h=c-g+10;a=parseInt(f.style.left||0)-a;a=a>=0?0:a;a=a<=-h?-h:a;f.style.left=a+"px"}jQuery(".dslca-section-scroller-prev",a).click(function(a){a.preventDefault();g(-c)});jQuery(".dslca-section-scroller-next",a).click(function(a){a.preventDefault();g(c)});jQuery(window).load(function(){jQuery(window).resize(function(){g(0)})})};b(jQuery(".dslca-section.dslca-modules"));b(jQuery(".dslca-section.dslca-templates-load"))});jQuery(document).ready(function(a){LiveComposer.Builder.UI.initPreviewAreaScroller=function(){var a=5;var b=6;LiveComposer.Builder.Flags.windowScroller=false;jQuery(LiveComposer.Builder.PreviewAreaDocument).on("dragleave",".lc-scroll-top-area, .lc-scroll-bottom-area",function(a){LiveComposer.Builder.UI.stopScroller()});jQuery(LiveComposer.Builder.PreviewAreaDocument).on("dragenter dragover",".lc-scroll-bottom-area",function(c){if(LiveComposer.Builder.Flags.windowScroller!==false)return false;LiveComposer.Utils.publish("LC.sortableOff",{});LiveComposer.Builder.Flags.windowScroller=setInterval(function(){LiveComposer.Builder.PreviewAreaWindow.scrollBy(0,a)},b)});jQuery(LiveComposer.Builder.PreviewAreaDocument).on("dragenter",".lc-scroll-top-area",function(c){if(LiveComposer.Builder.Flags.windowScroller!==false)return false;LiveComposer.Utils.publish("LC.sortableOff",{});LiveComposer.Builder.Flags.windowScroller=setInterval(function(){LiveComposer.Builder.PreviewAreaWindow.scrollBy(0,-a)},b)});jQuery(LiveComposer.Builder.PreviewAreaDocument).on("dragend mouseup","body",function(a){LiveComposer.Builder.Flags.windowScroller&&LiveComposer.Builder.UI.stopScroller()})};LiveComposer.Builder.UI.stopScroller=function(){LiveComposer.Utils.publish("LC.sortableOn",{});clearInterval(LiveComposer.Builder.Flags.windowScroller);LiveComposer.Builder.Flags.windowScroller=false};jQuery("#scroller-stopper").on("dragover",function(){LiveComposer.Builder.UI.stopScroller()})});"use strict";LiveComposer.Builder.Elements.CSectionsContainer=function(a){var b=this;this.sortable=jQuery(a).sortable({items:".dslc-modules-section",handle:'.dslca-move-modules-section-hook:not(".dslca-action-disabled")',placeholder:"dslca-modules-section-placeholder",tolerance:"intersect",cursorAt:{bottom:10},axis:"y",scroll:true,scrollSensitivity:140,scrollSpeed:5,sort:function(){jQuery(this).removeClass("ui-state-default")},update:function(a,b){dslc_show_publish_button()},start:function(a,b){jQuery("body").removeClass("dslca-drag-not-in-progress").addClass("dslca-drag-in-progress");jQuery("body",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-drag-not-in-progress").addClass("dslca-drag-in-progress");b.placeholder.html('<span class="dslca-placeholder-help-text"><span class="dslca-placeholder-help-text-inner">'+DSLCString.str_row_helper_text+"</span></span>");jQuery(".dslc-content").sortable("refreshPositions")},stop:function(a,b){dslc_generate_code();LiveComposer.Builder.UI.stopScroller();jQuery("body",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-drag-in-progress").addClass("dslca-drag-not-in-progress");jQuery("body").removeClass("dslca-drag-in-progress").addClass("dslca-drag-not-in-progress");jQuery(".dslca-anim-opacity-drop").removeClass("dslca-anim-opacity-drop")}});jQuery(document).on("LC.sortableOff",function(){if(undefined!==b.sortable.sortable("instance")){b.sortable.sortable("option","disabled",true)}});jQuery(document).on("LC.sortableOn",function(){if(undefined!==b.sortable.sortable("instance")){b.sortable.sortable("option","disabled",false)}})};"use strict";jQuery(document).ready(function(a){dslc_module_options_tooltip();dslc_module_options_font();dslc_module_options_icon();dslc_module_options_icon_returnid();dslc_module_options_text_align();dslc_module_options_checkbox();dslc_module_options_box_shadow();dslc_module_options_text_shadow();var b="";b+=".dslca-module-edit-field-colorpicker";b+=", .dslca-modules-section-edit-field-colorpicker";b+=", .dslca-module-edit-option-box-shadow-color";b+=", .dslca-module-edit-option-text-shadow-color";jQuery(document).on("click",b,function(){dslc_module_options_color(this);var a=jQuery(this).closest(".dslca-color-option");var b=jQuery(".dslca-module-edit-options-inner");
3
- var c=a.find(".wp-picker-holder");var d=a.offset();var e=d.left+15;var f=window.innerWidth;var g=260;if(f<e+g){e=f-g}c.css("left",e+"px");jQuery(b).on("scroll",function(b){d=a.offset();var e=d.left+15;var f=window.innerWidth;var g=260;if(f<e+g){e=f-g}c.css("left",e+"px")})});jQuery(".dslca-container").on("mouseenter",".dslca-module-edit-option-slider",function(){dslc_module_options_numeric(this)});jQuery(".dslca-container").on("mouseenter",".dslca-modules-section-edit-option-slider",function(){dslc_module_options_numeric(this)});jQuery(".dslca-module-edit-form").submit(function(a){a.preventDefault();dslc_module_output_altered()});a(document).on("click",".dslca-module-edit-options-tab-hook",function(b){b.preventDefault();dslc_module_options_tab_filter(a(this))});a(document).on("click",".dslca-options-filter-hook",function(b){b.preventDefault();var c=jQuery(".dslca-options-filter-hook.dslca-active").data("section");var d=jQuery(this).data("section");a(".dslca-options-filter-hook.dslca-active").removeClass("dslca-active");a(this).addClass("dslca-active");dslc_module_options_section_filter(d);if(c=="responsive"){jQuery(".dslca-container-loader").show();LiveComposer.Builder.PreviewAreaWindow.dslc_responsive_classes();dslc_module_output_altered(function(){jQuery(".dslca-container-loader").hide()});jQuery("#page-builder-preview-area").resizable("destroy").attr("style","")}if(d=="responsive"){jQuery("#page-builder-preview-area").resizable()}});jQuery(document).on("click",".dslca-module-edit-save",function(a){a.preventDefault();dslc_module_options_confirm_changes(function(){LiveComposer.Builder.UI.initInlineEditors({withRemove:true});LiveComposer.Builder.UI.unloadOptionsDeps();LiveComposer.Builder.Flags.panelOpened=false;jQuery("body",LiveComposer.Builder.PreviewAreaDocument).removeClass("module-editing-in-progress")});jQuery(".dslca-options-filter-hook.dslca-active").removeClass("dslca-active");dslc_disable_responsive_view()});jQuery(document).on("click",".dslca-module-edit-cancel",function(a){a.preventDefault();dslc_module_options_cancel_changes(function(){LiveComposer.Builder.UI.initInlineEditors({withRemove:true});LiveComposer.Builder.UI.unloadOptionsDeps();LiveComposer.Builder.Flags.panelOpened=false;jQuery("body",LiveComposer.Builder.PreviewAreaDocument).removeClass("module-editing-in-progress")});jQuery(".dslca-options-filter-hook.dslca-active").removeClass("dslca-active");dslc_disable_responsive_view()})});(function(){var a=jQuery;var b=LiveComposer.Builder;LiveComposer.Builder.Helpers.colorpickers=[];LiveComposer.Builder.UI.initInlineEditors=function(a){a=a||{};if(a.withRemove==true){try{LiveComposer.Builder.PreviewAreaWindow.tinyMCE.remove()}catch(b){console.info("No tinyMCE code found. Error code: 10181116.")}}LiveComposer.Builder.PreviewAreaWindow.tinyMCE.init({selector:".inline-editor.dslca-editable-content",editor_deselector:"mce-content-body",menubar:false,inline:true,plugins:"wordpress wplink lists paste",paste_as_text:true,paste_block_drop:true,style_formats:[{title:"Paragraph",format:"p"},{title:"Header 1",format:"h1"},{title:"Header 2",format:"h2"},{title:"Header 3",format:"h3"},{title:"Header 4",format:"h4"},{title:"Header 5",format:"h5"},{title:"Header 6",format:"h6"}],toolbar:"styleselect | bold italic blockquote | removeformat | bullist numlist "})};LiveComposer.Builder.UI.clearUtils=function(){if(dslcDebug)console.log("LiveComposer.Builder.UI.clearUtils");LiveComposer.Builder.UI.clearColorPickers();if(undefined!==LiveComposer.Builder.moduleBackup){LiveComposer.Builder.moduleBackup.remove()}jQuery(".temp-styles-for-module",LiveComposer.Builder.PreviewAreaDocument).remove();jQuery(".mce-tinymce",LiveComposer.Builder.PreviewAreaDocument).hide()};LiveComposer.Builder.UI.clearColorPickers=function(){if(Array.isArray(b.Helpers.colorpickers)){b.Helpers.colorpickers.forEach(function(a){if(!jQuery(a).hasClass("dslca-modules-section-edit-field")){jQuery(a).remove()}});b.Helpers.colorpickers=[]}jQuery("body").off("click.wpcolorpicker")};LiveComposer.Builder.Helpers.depsHandlers=[];LiveComposer.Builder.UI.loadOptionsDeps=function(){var b=this;a(".dslca-module-edit-option").each(function(){var b=this;var c=true;try{var d=JSON.parse(LiveComposer.Utils.b64_to_utf8(a(this).data("dep")))}catch(e){c=false}if(c){var f=function(){var b=this;var c={};if((b.type=="radio"||b.type=="checkbox")&&d[b.value]==undefined){return false}if(b.type=="checkbox"&&d[b.value]!=undefined){c[b.value]=d[b.value]}else{c=d}Object.keys(c).forEach(function(d){c[d].split(",").forEach(function(c){var e=a(".dslca-module-edit-option-"+c.trim()).closest(".dslca-module-edit-option");var f=true;if(b.type=="radio"||b.type=="checkbox"){f=a(b).is(":checked")}if(b.value==d&&f){e.show()}else{e.hide()}})})};a(document).on("change dslc-init-deps",'.dslca-module-edit-option *[data-id="'+a(this).data("id")+'"]',f);LiveComposer.Builder.Helpers.depsHandlers.push(f)}});a(".dslca-module-edit-option input, .dslca-module-edit-option select").trigger("dslc-init-deps")};LiveComposer.Builder.UI.unloadOptionsDeps=function(){LiveComposer.Builder.Helpers.depsHandlers.forEach(function(b){a(document).unbind("change",b);a(document).unbind("dslc-init-deps",b)});LiveComposer.Builder.Helpers.depsHandlers=[]};LiveComposer.Builder.Helpers.processInlineStyleTag=function(a){if(typeof a!="object")return false;var b="",c="";if(a.context.closest(".dslca-module-edit-option").data("tab")=="tablet_responsive"){b="@media only screen and (max-width: 1024px) and (min-width: 768px) {";c="}"}else if(a.context.closest(".dslca-module-edit-option").data("tab")=="phone_responsive"){b="@media only screen and (max-width: 767px) {";c="}"}a.styleContent=b+a.styleContent+c;var d=b+a.rule+a.elems;d=d.replace(/ /gi,"");if(LiveComposer.Builder.PreviewAreaDocument[0].getElementById(d)==null){var e=document.createElement("style");e.innerHTML=a.styleContent;e.id=d;e.className="temp-styles-for-module";LiveComposer.Builder.PreviewAreaDocument[0].body.appendChild(e)}else{LiveComposer.Builder.PreviewAreaDocument[0].getElementById(d).innerHTML=a.styleContent}};LiveComposer.Builder.UI.shakePanelConfirmButton=function(){jQuery(".dslca-module-edit-save").addClass("lc-shake-effect active");setTimeout(function(){jQuery(".dslca-module-edit-save").removeClass("lc-shake-effect active")},1e3)}})();function dslc_module_options_section_filter(a){if(dslcDebug)console.log("dslc_module_options_section_filter");jQuery(".dslca-module-edit-option").hide();jQuery('.dslca-module-edit-option[data-section="'+a+'"]').show();dslc_module_options_tab_filter()}function dslc_module_options_tab_filter(a){if(dslcDebug)console.log("dslc_module_options_tab_filter");var b=jQuery(".dslca-options-filter-hook.dslca-active").data("section");a=typeof a!=="undefined"?a:jQuery('.dslca-module-edit-options-tab-hook[data-section="'+b+'"]:first');var c=a.data("id");jQuery(".dslca-module-edit-options-tab-hook").removeClass("dslca-active");a.addClass("dslca-active");jQuery(".dslca-module-edit-options-tabs").show();jQuery(".dslca-module-edit-options-tab-hook").hide();jQuery('.dslca-module-edit-options-tab-hook[data-section="'+b+'"]').show();if(c){jQuery(".dslca-module-edit-option").hide();jQuery('.dslca-module-edit-option[data-tab="'+c+'"]').show();dslc_module_options_hideshow_tabs();if(jQuery(".dslca-module-edit-options-tab-hook:visible").length<2){jQuery(".dslca-module-edit-options-tabs").hide()}else{jQuery(".dslca-module-edit-options-tabs").show()}dslc_disable_responsive_view();if(c==DSLCString.str_res_tablet.toLowerCase()+"_responsive"){jQuery("body").removeClass("dslc-res-big dslc-res-smaller-monitor dslc-res-phone dslc-res-tablet");jQuery("body").addClass("dslc-res-tablet");jQuery("html").addClass("dslc-responsive-preview")}if(c==DSLCString.str_res_phone.toLowerCase()+"_responsive"){jQuery("body").removeClass("dslc-res-big dslc-res-smaller-monitor dslc-res-phone dslc-res-tablet");jQuery("body").addClass("dslc-res-phone");jQuery("html").addClass("dslc-responsive-preview")}if(c==DSLCString.str_res_tablet.toLowerCase()+"_responsive"||c==DSLCString.str_res_phone.toLowerCase()+"_responsive"){jQuery(".dslca-container-loader").show();dslc_module_output_altered(function(){jQuery(".dslca-container-loader").hide()})}}}function dslc_module_options_hideshow_tabs(){if(dslcDebug)console.log("dslc_module_options_hideshow_tabs");var a=jQuery(".dslca-options-filter-hook.dslca-active").data("section");if(a=="styling"){var b=jQuery(".dslca-module-edit"),c=true,d=true,e=true,f=true,g=true,h=true,i=true,j=true,k=true,l=true,m=true,n=true,o=true,p=true,q=true,r=true,s=true,t=true,u=true,v=true,w=true,x=true,y=true,z=true,A=true,B=true;if(!jQuery('.dslca-module-edit-field[value="main_heading"]').is(":checked"))c=false;if(!jQuery('.dslca-module-edit-field[value="filters"]').is(":checked"))d=false;if(!jQuery('.dslca-module-edit-field[value="arrows"]').is(":checked"))e=false;if(!jQuery('.dslca-module-edit-field[value="circles"]').is(":checked"))f=false;if(jQuery('.dslca-module-edit-field[data-id="type"]').val()!="carousel"){e=false;f=false}if(jQuery('.dslca-module-edit-field[data-id="pagination_type"]').val()=="disabled"){g=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="thumbnail"]').is(":checked")){h=false}if(jQuery('.dslca-module-edit-field[data-id*="elements"][value="content"]').length&&!jQuery('.dslca-module-edit-field[data-id*="elements"][value="title"]').is(":checked")){i=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="excerpt"]').is(":checked")){j=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="meta"]').is(":checked")){k=false}if(jQuery('.dslca-module-edit-field[data-id*="elements"][value="button"]').length&&!jQuery('.dslca-module-edit-field[data-id*="elements"][value="button"]').is(":checked")){l=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="categories"]').is(":checked")){m=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="separator"]').is(":checked")){o=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="count"]').is(":checked")){n=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="tags"]').is(":checked")){p=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="social"]').is(":checked")){q=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="position"]').is(":checked")){r=false}if(jQuery('.dslca-module-edit-field[data-id*="elements"][value="icon"]').length&&!jQuery('.dslca-module-edit-field[data-id*="elements"][value="icon"]').is(":checked")){s=false}if(jQuery('.dslca-module-edit-field[data-id*="elements"][value="content"]').length&&!jQuery('.dslca-module-edit-field[data-id*="elements"][value="content"]').is(":checked")){t=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="price"]').is(":checked")){u=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="price_2"]').is(":checked")){v=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="addtocart"]').is(":checked")){w=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="details"]').is(":checked")){x=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="quote"]').is(":checked")){y=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="author_name"]').is(":checked")){z=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="author_position"]').is(":checked")){A=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="image"]').is(":checked")){B=false}if(c)jQuery('.dslca-module-edit-options-tab-hook[data-id="heading_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="heading_styling"]').hide();if(d)jQuery('.dslca-module-edit-options-tab-hook[data-id="filters_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="filters_styling"]').hide();if(e)jQuery('.dslca-module-edit-options-tab-hook[data-id="carousel_arrows_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="carousel_arrows_styling"]').hide();if(f)jQuery('.dslca-module-edit-options-tab-hook[data-id="carousel_circles_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="carousel_circles_styling"]').hide();if(g)jQuery('.dslca-module-edit-options-tab-hook[data-id="pagination_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="pagination_styling"]').hide();if(h)jQuery('.dslca-module-edit-options-tab-hook[data-id="thumbnail_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="thumbnail_styling"]').hide();if(i)jQuery('.dslca-module-edit-options-tab-hook[data-id="title_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="title_styling"]').hide();if(j)jQuery('.dslca-module-edit-options-tab-hook[data-id="excerpt_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="excerpt_styling"]').hide();if(k)jQuery('.dslca-module-edit-options-tab-hook[data-id="meta_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="meta_styling"]').hide();if(l)jQuery('.dslca-module-edit-options-tab-hook[data-id="button_styling"], .dslca-module-edit-options-tab-hook[data-id="primary_button_styling"],'+' .dslca-module-edit-options-tab-hook[data-id="secondary_button_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="button_styling"], .dslca-module-edit-options-tab-hook[data-id="primary_button_styling"],'+' .dslca-module-edit-options-tab-hook[data-id="secondary_button_styling"]').hide();if(m)jQuery('.dslca-module-edit-options-tab-hook[data-id="categories_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="categories_styling"]').hide();if(o)jQuery('.dslca-module-edit-options-tab-hook[data-id="separator_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="separator_styling"]').hide();if(n)jQuery('.dslca-module-edit-options-tab-hook[data-id="count_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="count_styling"]').hide();if(p)jQuery('.dslca-module-edit-options-tab-hook[data-id="tags_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="tags_styling"]').hide();if(r)jQuery('.dslca-module-edit-options-tab-hook[data-id="position_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="position_styling"]').hide();if(q)jQuery('.dslca-module-edit-options-tab-hook[data-id="social_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="social_styling"]').hide();if(s)jQuery('.dslca-module-edit-options-tab-hook[data-id="icon_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="icon_styling"]').hide();if(t)jQuery('.dslca-module-edit-options-tab-hook[data-id="content_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="content_styling"]').hide();if(u)jQuery('.dslca-module-edit-options-tab-hook[data-id="price_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="price_styling"]').hide();if(v)jQuery('.dslca-module-edit-options-tab-hook[data-id="price_secondary_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="price_secondary_styling"]').hide();if(w||x)jQuery('.dslca-module-edit-options-tab-hook[data-id="other_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="other_styling"]').hide();if(y)jQuery('.dslca-module-edit-options-tab-hook[data-id="quote_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="quote_styling"]').hide();if(z)jQuery('.dslca-module-edit-options-tab-hook[data-id="author_name_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="author_name_styling"]').hide();if(A)jQuery('.dslca-module-edit-options-tab-hook[data-id="author_position_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="author_position_styling"]').hide();if(B)jQuery('.dslca-module-edit-options-tab-hook[data-id="image_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="image_styling"]').hide()}if(jQuery('.dslca-options-filter-hook[data-section="styling"]').hasClass("dslca-active")){if(jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).data("dslc-module-id")=="DSLC_Text_Simple"||jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).data("dslc-module-id")=="DSLC_TP_Content"||jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).data("dslc-module-id")=="DSLC_Html"||jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).data("dslc-module-id")=="DSLC_Shortcode"){var C=jQuery('.dslca-module-edit-option[data-id="css_custom"]'),D=C.find("select").val();if(D=="enabled"){jQuery('.dslca-module-edit-option[data-section="styling"]').css({visibility:"visible"});jQuery(".dslca-module-edit-option[data-tab]").css("visibility","visible");jQuery(".dslca-module-edit-options-tabs").show()}else{jQuery('.dslca-module-edit-option[data-section="styling"]').css({visibility:"hidden"});jQuery(".dslca-module-control-group.dslca-module-edit-option").css("visibility","hidden");jQuery(".dslca-module-edit-options-tabs").hide();C.css({visibility:"visible"})}}}else{jQuery(".dslca-module-edit-options-tabs").show()}if(jQuery('select.dslca-module-edit-field[data-id="css_res_t"]').val()=="disabled"){jQuery('.dslca-module-edit-option[data-id*="css_res_t"]').css("visibility","hidden");jQuery('.dslca-module-edit-option[data-tab="tablet_responsive"]').css("visibility","hidden")}else{jQuery('.dslca-module-edit-option[data-id*="css_res_t"]').css("visibility","visible");jQuery('.dslca-module-edit-option[data-tab="tablet_responsive"]').css("visibility","visible")}if(jQuery('select.dslca-module-edit-field[data-id="css_res_p"]').val()=="disabled"){jQuery('.dslca-module-edit-option[data-id*="css_res_p"]').css("visibility","hidden");jQuery('.dslca-module-edit-option[data-tab="phone_responsive"]').css("visibility","hidden")}else{jQuery('.dslca-module-edit-option[data-id*="css_res_p"]').css("visibility","visible");jQuery('.dslca-module-edit-option[data-tab="phone_responsive"]').css("visibility","visible")}jQuery('.dslca-module-edit-option[data-id="css_res_p"], .dslca-module-edit-option[data-id="css_res_t"]').css("visibility","visible")}function dslc_module_options_confirm_changes(a){if(dslcDebug)console.log("dslc_module_options_confirm_changes");a=typeof a!=="undefined"?a:false;if(jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).hasClass("dslc-module-DSLC_Sliders")){jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-module-being-edited")}else{jQuery("body").addClass("dslca-module-saving-in-progress");dslc_module_output_altered(function(){dslc_update_preset();dslc_generate_code();jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-module-being-edited");jQuery("body").removeClass("dslca-module-saving-in-progress");jQuery(".dslca-module-edit-options-inner").html("");jQuery(".dslca-module-edit-options-tabs").html("");LiveComposer.Builder.UI.clearUtils();if(a){a()}})}dslc_show_section(".dslca-modules");jQuery(".dslca-header .dslca-options-filter-hook").hide();jQuery(".dslca-module-edit-actions").hide();jQuery(".dslca-header .dslca-go-to-section-hook").show();dslc_show_publish_button()}function dslc_module_options_cancel_changes(a){if(dslcDebug)console.log("dslc_module_options_cancel_changes");a=typeof a!=="undefined"?a:false;var b=jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument);jQuery(".dslca-module-options-front",b).html("").append(LiveComposer.Builder.moduleBackup);dslc_module_output_altered(function(){dslc_generate_code();jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-module-being-edited");jQuery(".dslca-module-edit-options-inner").html("");jQuery(".dslca-module-edit-options-tabs").html("");LiveComposer.Builder.UI.clearUtils();if(a){a()}});dslc_show_section(".dslca-modules");jQuery(".dslca-header .dslca-options-filter-hook").hide();jQuery(".dslca-module-edit-actions").hide();jQuery(".dslca-header .dslca-go-to-section-hook").show();dslc_show_publish_button();LiveComposer.Builder.UI.clearUtils()}function dslc_module_options_tooltip(){jQuery(document).on("click",".dslca-module-edit-field-ttip-close",function(){jQuery(".dslca-module-edit-field-ttip, .dslca-module-edit-field-icon-ttip").hide()});jQuery(document).on("click",".dslca-module-edit-field-ttip-hook",function(){var a=jQuery(".dslca-module-edit-field-ttip"),b=a.find(".dslca-module-edit-field-ttip-inner"),c=jQuery(this),d,e;e=c.parent();if(e.parent().hasClass("dslca-modules-section-edit-option")){d=c.closest(".dslca-modules-section-edit-option").find(".dslca-module-edit-field-ttip-content").html()}else{d=c.closest(".dslca-module-edit-option").find(".dslca-module-edit-field-ttip-content").html()}if(a.is(":visible")){jQuery(".dslca-module-edit-field-ttip").hide()}else{b.html(d);var f=c.offset();var g=a.outerHeight();var h=a.outerWidth();var i=f.left-h/2+6;var j="50%";if(i<0){j=h/2+i+"px";i=0}jQuery(".dslca-module-edit-field-ttip").show().css({top:f.top-g-20,left:i});jQuery("head").append(jQuery("<style>.dslca-module-edit-field-ttip:after, .dslca-module-edit-field-ttip:before { left: "+j+" }</style>"))}});jQuery(document).on("click",".dslca-module-edit-field-icon-ttip-hook",function(){var a=jQuery(".dslca-module-edit-field-icon-ttip");var b=jQuery(this);if(a.is(":visible")){jQuery(".dslca-module-edit-field-icon-ttip").hide()}else{var c=b.offset();var d=a.outerHeight();var e=a.outerWidth();var f=c.left-e/2+6;var g="50%";if(f<0){g=e/2+f+"px";f=0}jQuery(".dslca-module-edit-field-icon-ttip").show().css({top:c.top-d-20,left:f});jQuery("head").append(jQuery("<style>.dslca-module-edit-field-icon-ttip:after, .dslca-module-edit-field-icon-ttip:before { left: "+g+" }</style>"))}})}function dslc_module_options_font(){jQuery(document).on("click",".dslca-module-edit-field-font-next",function(a){a.preventDefault();if(!jQuery(this).hasClass("dslca-font-loading")&&!jQuery(this).siblings(".dslca-font-loading").length){var b=jQuery(this).closest(".dslca-module-edit-option-font");var c=jQuery(".dslca-module-edit-field-font",b);var d=dslcAllFontsArray.indexOf(c.val());var e=d+1;jQuery(".dslca-module-edit-field-font-suggest",b).text("");c.val(dslcAllFontsArray[e]).trigger("change");jQuery(this).addClass("dslca-font-loading").find(".dslca-icon").removeClass("dslc-icon-chevron-right").addClass("dslc-icon-refresh dslc-icon-spin")}});jQuery(document).on("click",".dslca-module-edit-field-font-prev",function(a){a.preventDefault();if(!jQuery(this).hasClass("dslca-font-loading")&&!jQuery(this).siblings(".dslca-font-loading").length){var b=jQuery(this).closest(".dslca-module-edit-option-font");var c=jQuery(".dslca-module-edit-field-font",b);var d=dslcAllFontsArray.indexOf(c.val());var e=d-1;jQuery(".dslca-module-edit-field-font-suggest",b).text("");if(e<0){e=dslcAllFontsArray.length-1}c.val(dslcAllFontsArray[e]).trigger("change");jQuery(this).addClass("dslca-font-loading").find(".dslca-icon").removeClass("dslc-icon-chevron-left").addClass("dslc-icon-refresh dslc-icon-spin")}});jQuery(document).on("keyup",".dslca-module-edit-field-font",function(a){var b,c,d,e=false,f;b=jQuery(this);c=b.closest(".dslca-module-edit-option");if(a.which==38){jQuery(".dslca-module-edit-field-font-prev",c).click()}if(a.which==40){jQuery(".dslca-module-edit-field-font-next",c).click()}if(a.which!=13&&a.which!=38&&a.which!=40){d=b.val();var g=[];var h=new RegExp("^"+d,"i");var i=dslcAllFontsArray.length;var j=0;do{if(h.test(dslcAllFontsArray[j])){if(!e){var e=dslcAllFontsArray[j]}}j++}while(j<i);if(!e){f=d;jQuery(".dslca-module-edit-field-font-suggest",c).hide()}else{f=e;jQuery(".dslca-module-edit-field-font-suggest",c).show()}jQuery(".dslca-module-edit-field-font-suggest",c).text(f);if(f.length){b.val(f.substring(0,b.val().length))}}});jQuery(document).on("keypress",".dslca-module-edit-field-font",function(a){if(a.which==13){a.preventDefault();var b,c,d,e,f;b=jQuery(this);c=b.closest(".dslca-module-edit-option");jQuery(this).val(jQuery(".dslca-module-edit-field-font-suggest",c).text()).trigger("change");jQuery(".dslca-module-edit-field-font-suggest",c).text("")}})}function dslc_list_icon(a,b){var c=jQuery(a).closest(".dslca-module-edit-option-icon");var d=jQuery(".dslca-module-edit-field-icon",c);var e=dslcIconsCurrentSet.indexOf(d.val());if(b=="previous"){var f=e-1}else{var f=e+1}jQuery(".dslca-module-edit-field-icon-suggest",c).text("");if(f<0){f=dslcIconsCurrentSet.length-1}d.val(dslcIconsCurrentSet[f]).trigger("change")}function dslc_module_options_icon(){jQuery(document).on("keyup",".dslca-module-edit-field-icon",function(a){var b,c,d,e,f;b=jQuery(this);c=b.closest(".dslca-module-edit-option");if(a.which==38){dslc_list_icon(b,"previous")}if(a.which==40){dslc_list_icon(b,"next")}if(a.which!=13&&a.which!=38&&a.which!=40){d=b.val().toLowerCase();b.val(d);e=jQuery.grep(dslcIconsCurrentSet,function(a,b){return a.indexOf(d)==0});f=e[0];jQuery(".dslca-module-edit-field-icon-suggest",c).text(f)}});jQuery(document).on("keypress",".dslca-module-edit-field-icon",function(a){if(a.which==13){a.preventDefault();var b,c,d,e,f;b=jQuery(this);c=b.closest(".dslca-module-edit-option");jQuery(this).val(jQuery(".dslca-module-edit-field-icon-suggest",c).text()).trigger("change");jQuery(".dslca-module-edit-field-icon-suggest",c).text("")}})}function dslc_module_options_icon_returnid(){jQuery(document).on("click",'.dslca-open-modal-hook[data-modal^=".dslc-list-icons"]',function(a){jQuery(this).closest(".dslca-module-edit-option-icon").find("input").addClass("icon-modal-active")});jQuery(document).on("click",".dslca-modal-icons .icon-item",function(a){var b=jQuery(this).find(".icon-item_name").text();jQuery("input.icon-modal-active").val(b).change();dslc_hide_modal("",jQuery(".dslca-modal:visible"));jQuery("input.icon-modal-active").removeClass("icon-modal-active")})}function dslc_module_options_text_align(){jQuery(document).on("click",".dslca-module-edit-option-text-align-hook",function(){var a=jQuery(this),b=jQuery(this).closest(".dslca-module-edit-option-text-align-wrapper").find(".dslca-module-edit-option-text-align-hook"),c=a.data("val"),d=jQuery(this).closest(".dslca-module-edit-option-text-align-wrapper").siblings("input.dslca-module-edit-field");b.removeClass("dslca-active");a.addClass("dslca-active");d.val(c).trigger("change")})}function dslc_module_options_checkbox(){jQuery(document).on("click",".dslca-module-edit-option-checkbox-hook, .dslca-modules-section-edit-option-checkbox-hook",function(){var a=jQuery(this);var b=a.siblings('input[type="checkbox"]');if(b.prop("checked")){b.prop("checked",false);a.find(".dslca-icon").removeClass("dslc-icon-check").addClass("dslc-icon-check-empty")}else{b.prop("checked",true);a.find(".dslca-icon").removeClass("dslc-icon-check-empty").addClass("dslc-icon-check")}b.change()})}function dslc_module_options_box_shadow(){if(dslcDebug)console.log("dslc_module_options_box_shadow");jQuery(document).on("change",".dslca-module-edit-option-box-shadow-hor, "+".dslca-module-edit-option-box-shadow-ver, .dslca-module-edit-option-box-shadow-blur, .dslca-module-edit-option-box-shadow-spread,"+" .dslca-module-edit-option-box-shadow-color, .dslca-module-edit-option-box-shadow-inset",function(){var a=jQuery(this).closest(".dslca-module-edit-option"),b=a.find(".dslca-module-edit-field"),c=a.find(".dslca-module-edit-option-box-shadow-hor").val(),d=a.find(".dslca-module-edit-option-box-shadow-ver").val(),e=a.find(".dslca-module-edit-option-box-shadow-blur").val(),f=a.find(".dslca-module-edit-option-box-shadow-spread").val(),g=a.find(".dslca-module-edit-option-box-shadow-color").val(),h=a.find(".dslca-module-edit-option-box-shadow-inset").is(":checked");if(h){h=" inset"}else{h=""}var i=c+"px "+d+"px "+e+"px "+f+"px "+g+h;b.val(i).trigger("change")})}function dslc_module_options_text_shadow(){if(dslcDebug)console.log("dslc_module_options_text_shadow");jQuery(document).on("change",".dslca-module-edit-option-text-shadow-hor, .dslca-module-edit-option-text-shadow-ver,"+".dslca-module-edit-option-text-shadow-blur, .dslca-module-edit-option-text-shadow-color",function(){var a=jQuery(this).closest(".dslca-module-edit-option"),b=a.find(".dslca-module-edit-field"),c=a.find(".dslca-module-edit-option-text-shadow-hor").val(),d=a.find(".dslca-module-edit-option-text-shadow-ver").val(),e=a.find(".dslca-module-edit-option-text-shadow-blur").val(),f=a.find(".dslca-module-edit-option-text-shadow-color").val();var g=c+"px "+d+"px "+e+"px "+f;b.val(g).trigger("change")})}function dslc_module_options_color(a){if(dslcDebug)console.log("dslc_module_options_color");var b,c,d,e,f,g,h;var i=[],j,k;var l="dslcColors-"+document.domain;if(undefined!==localStorage[l]){j=JSON.parse(localStorage[l]);i=j}if(1>i.length){i.push("#78b")}if(2>i.length){i.push("#ab0")}if(3>i.length){i.push("#de3")}i.push("#fff");i.push("#000");i.push("rgba(0,0,0,0)");var m=a;jQuery(m).each(function(){var a=jQuery(this).closest(".dslca-color-option");var j=jQuery(this);h=jQuery(this).val();j.wpColorPicker({mode:"hsl",palettes:i,change:function(a,h){b=j;var i=j.wpColorPicker("color");if(i==null){e=""}else{e=i}b.val(e).trigger("change");b.css("background",e);c=b.data("affect-on-change-el");d=b.data("affect-on-change-rule");if(null!=c){jQuery(c,".dslca-module-being-edited").css(d,e)}f=jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument);g=b.data("id");jQuery('.dslca-module-option-front[data-id="'+g+'"]',f).val(e);f.addClass("dslca-module-change-made")}});var k=a.find(".wp-picker-holder .iris-picker");k.append('<button type="button" class="dslca-colorpicker-apply">Apply</button>');var m=a.find(".dslca-colorpicker-apply");j.wpColorPicker("open");jQuery(m).on("click",function(){if("#fff"!==e&&"#ffffff"!==e&&"#000"!==e&&"#000000"!==e&&"rgba(0,0,0,0)"!==e){if(undefined===localStorage[l]){var a=[e];localStorage[l]=JSON.stringify(a)}else{var a=JSON.parse(localStorage[l]);if(a.indexOf(e)==-1){a.unshift(e);if(3<a.length){a.pop()}}localStorage[l]=JSON.stringify(a)}}j.wpColorPicker("close")});LiveComposer.Builder.Helpers.colorpickers.push(jQuery(this))})}function dslc_module_options_numeric(a){if(dslcDebug)console.log("dslc_module_options_numeric");var b=a;jQuery(b).each(function(){var a=jQuery(this);if(0===jQuery(".dslca-module-edit-field-slider",a).length){a.append('<div class="dslca-module-edit-field-slider"></div>')}var b=true;if(a.hasClass("dslca-modules-section-edit-option")){b=false}else{b=true}if(b){var c=a.find(".dslca-module-edit-field")}else{var c=a.find(".dslca-modules-section-edit-field")}if(a.hasClass("dslca-modules-section-edit-option")){var c=a.find(".dslca-modules-section-edit-field")}else{var c=a.find(".dslca-module-edit-field")}var d="",e=a.find(".dslca-module-edit-field-slider"),f=parseFloat(c.val()),g=parseFloat(c.data("max")),h=parseFloat(c.data("min")),i=parseFloat(c.data("increment")),j=g,k=h;var l=false;if(undefined!==c.data("onlypositive")&&1===c.data("onlypositive")){l=true}if(f>=g){g=f*2}if(!l&&f<=h){h=f*2}e.slider({min:h,max:g,step:i,value:c.val(),slide:function(a,b){c.val(b.value+d);c.trigger("change")},change:function(b,c){if(c.value>=g||c.value<=h){e.slider("destroy");dslc_module_options_numeric(a)}}});e.show();jQuery(a).on("mouseleave",function(){if(undefined!==e.slider("instance")){jQuery(e).slider("destroy")}e.remove()});if(c[0].classList.contains("slider-initiated"))return;c[0].classList.add("slider-initiated");c.on("keyup",function(a){if(undefined===a){return false}if(a.shiftKey){if(a.keyCode==38){this.value=(parseInt(this.value)||0)+9;c.trigger("change")}if(a.keyCode==40){this.value=parseInt(this.value)+0-9;c.trigger("change")}}if(a.keyCode==8||a.keyCode==45){c.trigger("change");
4
- }if(a.keyCode>=48&&a.keyCode<=57||a.keyCode>=96&&a.keyCode<=105){c.trigger("change")}var b=a.which?a.which:a.keyCode;if((b>=48&&b<=57||b>=96&&b<=105)&&a.keyCode!=8&&a.keyCode!=39&&a.keyCode!=37&&a.keyCode!=46){return false}});c.on("change",function(a){if(l&&this.value<0){this.value=0}var c;if(b){c=jQuery(a.target.closest(".dslca-module-edit-option-slider"))}else{c=jQuery(a.target.closest(".dslca-modules-section-edit-option-slider"))}var d=c.find(".dslca-module-edit-field-slider");if(undefined!==d.slider("instance")){d.slider("value",this.value)}if(b){var e=jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument);e.addClass("dslca-module-change-made")}});return false})}function dslc_disable_responsive_view(){jQuery("html").removeClass("dslc-responsive-preview");jQuery("body").removeClass("dslc-res-big dslc-res-smaller-monitor dslc-res-phone dslc-res-tablet")}function dslc_filter_module_options(a){dslc_module_options_section_filter(a)}function dslc_show_module_options_tab(a){dslc_module_options_tab_filter(a)}function dslc_confirm_changes(a){dslc_module_options_confirm_changes(a)}function dslc_cancel_changes(a){dslc_module_options_cancel_changes(a)}function dslc_init_colorpicker(){dslc_module_options_color()}function dslc_init_options_slider(){dslc_module_options_numeric()}function dslc_module_edit_options_hideshow_tabs(){dslc_module_options_hideshow_tabs()}"use strict";function dslc_template_load(a){if(dslcDebug)console.log("dslc_load_template");var b,c;jQuery.post(DSLCAjax.ajaxurl,{action:"dslc-ajax-load-template",dslc:"active",dslc_template_id:a},function(a){jQuery("#dslc-main",LiveComposer.Builder.PreviewAreaDocument).html(a.output);LiveComposer.Builder.PreviewAreaWindow.dslc_carousel();dslc_drag_and_drop();dslc_show_publish_button();dslc_generate_code()})}function dslc_template_import(){if(dslcDebug)console.log("dslc_import_template");var a,b;jQuery(".dslca-modal-templates-import .dslca-modal-title").css({opacity:0});jQuery(".dslca-modal-templates-import .dslca-loading").show();jQuery.post(DSLCAjax.ajaxurl,{action:"dslc-ajax-import-template",dslc:"active",dslc_template_code:jQuery("#dslca-import-code").val()},function(a){jQuery("#dslc-main",LiveComposer.Builder.PreviewAreaDocument).html(a.output);jQuery(".dslca-modal-templates-import .dslca-loading").hide();jQuery(".dslca-modal-templates-import .dslca-modal-title").css({opacity:1});dslc_hide_modal("",".dslca-modal-templates-import");LiveComposer.Builder.PreviewAreaWindow.dslc_bg_video();dslc_drag_and_drop();dslc_show_publish_button();dslc_generate_code()})}function dslc_template_save(){if(dslcDebug)console.log("dslc_save_template");jQuery.post(DSLCAjax.ajaxurl,{action:"dslc-ajax-save-template",dslc:"active",dslc_template_code:jQuery("#dslca-code").val(),dslc_template_title:jQuery("#dslca-save-template-title").val()},function(a){dslc_hide_modal("",".dslca-modal-templates-save")})}function dslc_template_delete(a){if(dslcDebug)console.log("dslc_delete_template");jQuery.post(DSLCAjax.ajaxurl,{action:"dslc-ajax-delete-template",dslc:"active",dslc_template_id:a},function(b){jQuery('.dslca-template[data-id="'+a+'"]').fadeOut(200,function(){jQuery(this).remove()})})}function dslc_load_template(a){dslc_template_load(a)}function dslc_import_template(){dslc_template_import()}function dslc_save_template(){dslc_template_save()}function dslc_delete_template(a){dslc_template_delete(a)}jQuery(document).ready(function(a){jQuery(document).on("click",".dslca-template",function(a){a.preventDefault();dslc_template_load(jQuery(this).data("id"))});a(".dslca-template-import-form").submit(function(a){a.preventDefault();dslc_template_import()});a(".dslca-template-save-form").submit(function(a){a.preventDefault();dslc_template_save()});a(document).on("click",".dslca-delete-template-hook",function(b){b.stopPropagation();dslc_template_delete(a(this).data("id"))})});"use strict";window.onerror=function(a,b,c,d){dslca_generate_error_report(a,b,c,d)};jQuery(document).on("click",".dslca-show-js-error-hook",function(a){a.preventDefault();var b=document.getElementById("dslca-js-errors-report");if(!jQuery("body").hasClass("dslca-saving-in-progress")){LiveComposer.Builder.UI.CModalWindow({title:'<a href="https://livecomposerplugin.com/support/support-request/" target="_blank"><span class="dslca-icon dslc-icon-comment"></span> &nbsp; Open Support Ticket</a>',content:'<span class="dslca-error-report">'+b.value+"</span>"})}});jQuery(document).ready(function(a){jQuery("#page-builder-frame")[0].contentWindow.onerror=function(a,b,c,d){dslca_generate_error_report(a,b,c,d)};dslca_update_report_log();jQuery("body").addClass("dslca-enabled dslca-drag-not-in-progress");jQuery(".dslca-invisible-overlay").hide();jQuery(".dslca-section").eq(0).show();window.previewAreaTinyMCELoaded=function(){var a=this;LiveComposer.Builder.PreviewAreaWindow=this;LiveComposer.Builder.PreviewAreaDocument=jQuery(this.document);jQuery("#wpadminbar",LiveComposer.Builder.PreviewAreaDocument).remove();LiveComposer.Builder.UI.initInlineEditors();dslc_fix_contenteditable();var b=LiveComposer.Builder.PreviewAreaDocument.find("#dslc-main").eq(0)[0];new LiveComposer.Builder.Elements.CSectionsContainer(b);jQuery(document).trigger("editorFrameLoaded");dslc_drag_and_drop();dslc_generate_code();dslc_keypress_events();LiveComposer.Builder.UI.initPreviewAreaScroller()}});jQuery(document).on("click",".dslca-currently-editing",function(){var a=false,b=false,c;if(jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).length){a=jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument);c="#5890e5"}else if(jQuery(".dslca-modules-section-being-edited",LiveComposer.Builder.PreviewAreaDocument).length){a=jQuery(".dslca-modules-section-being-edited",LiveComposer.Builder.PreviewAreaDocument);c="#eabba9"}if(a){b=a.offset().top-100;if(b<0){b=0}var d=[];jQuery("html, body",LiveComposer.Builder.PreviewAreaDocument).animate({scrollTop:b},300,function(){a.removeAttr("style")})}});jQuery(window).keypress(function(a){if((a.metaKey||a.ctrlKey)&&a.keyCode==83){dslc_ajax_save_composer();a.preventDefault();return false}});jQuery(document).on("click",".dslca-hide-composer-hook",function(a){a.preventDefault();dslc_hide_composer()});jQuery(document).on("click",".dslca-show-composer-hook",function(a){a.preventDefault();dslc_show_composer()});jQuery(document).on("click",".dslca-go-to-modules-hook",function(a){a.preventDefault();dslc_show_section(".dslca-modules")});jQuery(document).on("click",".dslca-go-to-section-hook",function(a){a.preventDefault();if(jQuery(this).hasClass("dslca-active")){return}var b=jQuery(this).data("section");dslc_show_section(b);if(jQuery(this).hasClass("dslca-go-to-section-modules")||jQuery(this).hasClass("dslca-go-to-section-templates")){jQuery(this).addClass("dslca-active").siblings(".dslca-go-to-section-hook").removeClass("dslca-active")}});jQuery(document).on("click",".dslca-close-composer-hook",function(a){a.preventDefault();var b=jQuery(this).attr("href");if(!jQuery("body").hasClass("dslca-saving-in-progress")){LiveComposer.Builder.UI.CModalWindow({title:DSLCString.str_exit_title,content:DSLCString.str_exit_descr,confirm:function(){window.location=b}})}});jQuery(document).on("click",".dslca-submit",function(){jQuery(this).closest("form").submit()});jQuery(document).on("click",".dslca-section-title",function(a){a.stopPropagation();if(jQuery(".dslca-section-title-filter",this).length){dslc_generate_filters();jQuery(".dslca-section-title-filter-options").slideToggle(300)}});jQuery(document).on("click",".dslca-section-title-filter-options a",function(a){a.preventDefault();a.stopPropagation();var b=jQuery(this).data("origin");var c=jQuery(this).closest(".dslca-section");if(c.hasClass("dslca-templates-load")){jQuery(".dslca-section-title-filter-curr",c).text(jQuery(this).text())}else{jQuery(".dslca-section-title-filter-curr",c).text(jQuery(this).text())}jQuery(".dslca-section-scroller-inner").css({left:0});dslc_filter_origin(b,c);jQuery(".dslca-section-title-filter-options").slideToggle(300)});function dslc_hide_composer(){if(dslcDebug)console.log("dslc_hide_composer");jQuery(".dslca-hide-composer-hook").hide();jQuery(".dslca-show-composer-hook").show();jQuery("body").addClass("dslca-composer-hidden");jQuery("body",LiveComposer.Builder.PreviewAreaDocument).addClass("dslca-composer-hidden");jQuery(".dslca-container").css({bottom:jQuery(".dslca-container").outerHeight()*-1});jQuery(".dslca-header").hide()}function dslc_show_composer(){if(dslcDebug)console.log("dslc_show_composer");jQuery(".dslca-show-composer-hook").hide();jQuery(".dslca-hide-composer-hook").show();jQuery("body").removeClass("dslca-composer-hidden");jQuery("body",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-composer-hidden");jQuery(".dslca-container").css({bottom:0});jQuery(".dslca-header").show()}function dslc_show_publish_button(){if(dslcDebug)console.log("dslc_show_publish_button");jQuery(".dslca-save-composer").show().addClass("dslca-init-animation");jQuery(".dslca-save-draft-composer").show().addClass("dslca-init-animation")}function dslc_hide_publish_button(){if(dslcDebug)console.log("dslc_hide_publish_button");jQuery(".dslca-save-composer").hide();jQuery(".dslca-save-draft-composer").hide()}function dslc_show_section(a){if(dslcDebug)console.log("dslc_show_section");var b=jQuery(a).data("title"),c=jQuery(a).data("bg");jQuery(".dslca-container").css({bottom:-500});jQuery(".dslca-section").hide();jQuery(a).show();if(a==".dslca-module-edit"){jQuery(".dslca-currently-editing").show().find("strong").text(jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).attr("title")+" element")}else if(a==".dslca-modules-section-edit"){jQuery(".dslca-currently-editing").show().css("background-color","#e5855f").find("strong").text("Row")}else{jQuery(".dslca-currently-editing").hide().find("strong").text("")}dslc_module_options_tab_filter();jQuery(".dslca-container").css({bottom:0});jQuery(a).find("input.dslca-module-edit-field-colorpicker").each(function(a){jQuery(this).css("background",jQuery(this).val())})}function dslc_generate_filters(){if(dslcDebug)console.log("dslc_generate_filters");var a,b=[],c='<a html="#" data-origin="">Show All</a>',d=jQuery(".dslca-section:visible .dslca-origin");d.each(function(){a=jQuery(this);if(jQuery.inArray(a.data("origin"),b)==-1){b.push(a.data("origin"));c+='<a href="#" data-origin="'+a.data("origin")+'">'+a.data("origin")+"</a>"}});jQuery(".dslca-section:visible .dslca-section-title-filter-options").html(c).css("background",jQuery(".dslca-section:visible").data("bg"))}function dslc_filter_origin(a,b){if(dslcDebug)console.log("dslc_filter_origin");jQuery(".dslca-origin",b).attr("data-display-module","false");jQuery('.dslca-origin[data-origin="'+a+'"]',b).attr("data-display-module","true");if(a==""){jQuery(".dslca-origin",b).attr("data-display-module","true");jQuery(".dslca-origin.dslca-exclude",b).attr("data-display-module","false")}}function dslc_drag_and_drop(){if(dslcDebug)console.log("dslc_drag_and_drop");var a,b,c,d;var e=jQuery(".dslca-modules .dslca-section-scroller-content");if(e.length==0){e=[document.createElement("div")]}var f=Sortable.create(e[0],{sort:false,group:{name:"modules",pull:"clone",put:false},animation:150,handle:".dslca-module",draggable:".dslca-module",chosenClass:"dslca-module-dragging",scroll:true,scrollSensitivity:150,scrollSpeed:15,setData:function(a,b){a.setData(LiveComposer.Utils.msieversion()!==false?"Text":"text/html",b.innerHTML)},onStart:function(a){a.oldIndex;jQuery("body").removeClass("dslca-new-module-drag-not-in-progress").addClass("dslca-new-module-drag-in-progress");jQuery("body",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-new-module-drag-not-in-progress").addClass("dslca-new-module-drag-in-progress");jQuery("#dslc-header").addClass("dslca-header-low-z-index")},onEnd:function(a){a.oldIndex;a.newIndex;var e=a.item;a.preventDefault();if(jQuery(e).closest(".dslca-section-scroller-content").length>0)return false;jQuery(".dslca-options-hovered",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-options-hovered");b=jQuery(e.parentNode);c=e.dataset.id;dslc_generate_code();if(c=="DSLC_M_A"||jQuery("body").hasClass("dslca-module-drop-in-progress")||b.closest("#dslc-header").length||b.closest("#dslc-footer").length){}else{jQuery("body").addClass("dslca-module-drop-in-progress");dslc_module_output_default(c,function(a){d=a.output;var c=LiveComposer.Builder.Helpers.insertModule(d,jQuery(".dslca-module",b));setTimeout(function(){LiveComposer.Builder.PreviewAreaWindow.dslc_masonry();jQuery("body").removeClass("dslca-module-drop-in-progress")},700);jQuery(".dslca-no-content-primary",b).css({opacity:1});jQuery(".dslca-modules-area-manage",b).css({visibility:"visible"});LiveComposer.Builder.PreviewAreaWindow.dslc_carousel();LiveComposer.Builder.PreviewAreaWindow.dslc_tabs();LiveComposer.Builder.PreviewAreaWindow.dslc_init_accordion();dslc_generate_code();dslc_show_publish_button();LiveComposer.Builder.UI.initInlineEditors()});jQuery(e).find(".dslca-icon").attr("class","").attr("class","dslca-icon dslc-icon-refresh dslc-icon-spin");jQuery(".dslca-no-content-primary",b).css({opacity:0});jQuery(".dslca-modules-area-manage",b).css({visibility:"hidden"})}LiveComposer.Builder.UI.stopScroller();jQuery("body").removeClass("dslca-new-module-drag-in-progress").addClass("dslca-new-module-drag-not-in-progress");jQuery("body",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-new-module-drag-in-progress").addClass("dslca-new-module-drag-not-in-progress");jQuery("#dslc-header").removeClass("dslca-header-low-z-index")},onAdd:function(a){var b=a.item;a.from},onUpdate:function(a){var b=a.item;dslc_show_publish_button()},onSort:function(a){a.preventDefault()},onRemove:function(a){},onFilter:function(a){var b=a.item},onMove:function(a){a.dragged;a.draggedRect;a.related;a.relatedRect;jQuery(a.to).addClass("dslca-options-hovered")}})}function dslc_option_changed(){dslc_show_publish_button()}function dslc_module_dragdrop_init(){dslc_drag_and_drop()}function dslc_fix_contenteditable(){LiveComposer.Builder.PreviewAreaDocument.on("dragstart",".dslca-module, .dslc-module-front, .dslc-modules-area, .dslc-modules-section",function(a){jQuery("[contenteditable]",LiveComposer.Builder.PreviewAreaDocument).attr("contenteditable",false)});LiveComposer.Builder.PreviewAreaDocument.on("dragend mousedown",".dslca-module, .dslc-module-front, .dslc-modules-area, .dslc-modules-section",function(a){jQuery("[contenteditable]",LiveComposer.Builder.PreviewAreaDocument).attr("contenteditable",true)})}function dslc_toogle_control(a){if(a===undefined)a=false;if(!a)return;var b=jQuery(".dslca-module-edit-option-"+a);var c=b.find(".dslca-module-edit-field");var d=jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument);var e=d[0].id;var f="";if("tablet_responsive"===b.data("tab")){f="body.dslc-res-tablet "}else if("phone_responsive"===b.data("tab")){f="body.dslc-res-phone "}var g=c.data("affect-on-change-el");if(g===undefined)return;var h=g.split(",");g="";for(var i=0;i<h.length;i++){if(i>0){g+=", "}g+=f+"#"+e+" "+h[i]}var j=c.data("affect-on-change-rule").replace(/ /g,"");var k=j.split(",");var l;var m=c.data("ext");b.toggleClass("dslca-option-off");if(b.hasClass("dslca-option-off")){l=dslc_get_control_value(a);c.data("val-bckp",l);for(var i=0;i<k.length;i++){jQuery(g,LiveComposer.Builder.PreviewAreaDocument).css(k[i],"");disable_css_rule(g,k[i],e)}c.val("").trigger("change")}else{c.val(c.data("val-bckp")).trigger("change");l=dslc_get_control_value(a);l=dslc_combine_value_and_extension(l,m||"");for(var i=0;i<k.length;i++){var n=g+"{"+k[i]+": "+l+"}";LiveComposer.Builder.Helpers.processInlineStyleTag({context:b,rule:k[i],elems:g.replace(new RegExp("#"+e,"gi"),"").trim(),styleContent:n})}}}jQuery(document).ready(function(a){jQuery(document).on("click",".dslca-module-edit-option .dslc-control-toggle",function(a){a.preventDefault();var b=jQuery(a.target).closest(".dslca-module-edit-option").find(".dslca-module-edit-field").data("id");dslc_toogle_control(b)});jQuery(document).on("mousedown",".dslca-module-edit-option",function(b){var c=a(".dslc-control-toggle");if(!c.is(b.target)&&c.has(b.target).length===0){if(jQuery(b.target).closest(".dslca-module-edit-option").hasClass("dslca-option-off")){var d=a(b.target).closest(".dslca-module-edit-option").find(".dslca-module-edit-field").data("id");dslc_toogle_control(d)}}})});function disable_css_rule(a,b,c){var d;var e="css-for-"+c;var f=document.getElementById("page-builder-frame").contentWindow.document.getElementById(e);a=a.replace(/\s\s+/g," ");if(f){f=f.sheet;if(f["rules"]){d="rules"}else if(f["cssRules"]){d="cssRules"}else{}for(var g=0;g<f[d].length;g++){if(f[d][g].selectorText==a){if(f[d][g].style[b]){f[d][g].style[b]="";break}}}}}function dslc_combine_value_and_extension(a,b){if(""===a||null===a){return a}if(a.indexOf(b)==-1){a=a+b}return a}function dslc_get_control_value(a){var b=jQuery(".dslca-module-edit-option-"+a);var c="text";var d=b.find(".dslca-module-edit-field");var e;e=d.val();return e}function dslc_keypress_events(){jQuery([document,LiveComposer.Builder.PreviewAreaWindow.document]).unbind("keydown").bind("keydown",function(a){dslc_modal_keypress_events(a);dslc_disable_backspace_navigation(a);dslc_notice_on_refresh(a);dslc_save_page(a)})}function dslc_disable_backspace_navigation(a){var b=false;if(a.keyCode===8){var c=a.srcElement||a.target;if(c.tagName.toUpperCase()==="INPUT"&&(c.type.toUpperCase()==="TEXT"||c.type.toUpperCase()==="PASSWORD"||c.type.toUpperCase()==="NUMBER"||c.type.toUpperCase()==="FILE")||c.tagName.toUpperCase()==="TEXTAREA"||jQuery(c).hasClass("dslca-editable-content")||jQuery(c).hasClass("dslc-tabs-nav-hook-title")||jQuery(c).hasClass("dslc-accordion-title")){b=c.readOnly||c.disabled}else{b=true}}if(b){a.preventDefault()}}function dslc_notice_on_refresh(a){if(a.which==116||a.which===82&&a.metaKey){if(jQuery(".dslca-save-composer-hook").offsetParent!==null||jQuery(".dslca-module-edit-save").offsetParent!==null){a.preventDefault();LiveComposer.Builder.UI.CModalWindow({title:DSLCString.str_refresh_title,content:DSLCString.str_refresh_descr,confirm:function(){window.location.reload()}})}}}function dslc_save_page(a){if(a.which==83&&(a.metaKey||a.ctrlKey)){if(jQuery(".dslca-save-composer-hook").css("display")=="block"){dslc_save_composer();a.preventDefault();return false}}}function dslca_generate_error_report(a,b,c,d){var e="JavaScript error detected in a third-party plugin";if(b.match("wp-content/plugins/live-composer-page-builder/js")!=null){e="Live Composer returned JS error"}var f="";f+='<br /><strong style="color:#E55F5F;">'+e+"</strong><br />";f+=a+'<br /> File "'+b+'", line '+c+", char "+d+"<br />";if("undefined"!==typeof Storage){localStorage.setItem("js_errors_report",f)}}function dslca_update_report_log(){var a=document.getElementById("dslca-js-errors-report");var b=localStorage.getItem("js_errors_report");if(null!==b){a.value=b;localStorage.removeItem("js_errors_report");document.querySelector(".dslca-show-js-error-hook").setAttribute("style","visibility:visible")}}"use strict";LiveComposer.Utils={addslashes:function(a){a=a.replace(/\\/g,"\\\\");a=a.replace(/\'/g,"\\'");a=a.replace(/\"/g,'\\"');a=a.replace(/\0/g,"\\0");return a},basename:function(a){return a.split(/[\\\/]/).pop()},msieversion:function(){var a=window.navigator.userAgent;var b=a.indexOf("MSIE ");if(b>0||!!navigator.userAgent.match(/Trident.*rv\:11\./)){return parseInt(a.substring(b+5,a.indexOf(".",b)))}else{return false}},checkParams:function(a){if(!Array.isArray(a)){throw"Param is not array"}var b={integer:function(a){return isNaN(parseInt(a))},"float":function(a){return isNaN(parseFloat(a))},string:function(a){return a!=null&&a!=undefined&&typeof a=="string"},array:function(a){return Array.isArray(a)},object:function(a){return typeof a=="object"}};a.map(function(a){if(!b[a[1]](a[0])){throw"Param "+a[0]+" is not "+a[1]}})},utf8_to_b64:function(a){return window.btoa(unescape(encodeURIComponent(a)))},b64_to_utf8:function(a){return decodeURIComponent(escape(window.atob(a)))},get_page_params:function(){return decodeURIComponent(window.location.search.slice(1)).split("&").reduce(function a(b,c){c=c.split("=");b[c[0]]=c[1];return b},{})},get_unique_id:function(){return Math.random().toString(32).slice(2)},update_module_property_raw:function(a,b,c){var d=a.getElementsByClassName("dslca-module-code")[0];var e=a.querySelector('.dslca-module-option-front[data-id="'+b+'"]');var f=d.value;f=JSON.parse(f);f[b]=c;f=JSON.stringify(f);d.value=f;d.innerHTML=f;e.value=c;e.innerHTML=c},update_section_property_raw:function(a,b,c){var d=a.getElementsByClassName("dslca-section-code")[0];var e=a.querySelector('.dslca-modules-section-settings input[data-id="'+b+'"]');var f=d.value;f=JSON.parse(f);f[b]=c;f=JSON.stringify(f);d.value=f;d.innerHTML=f;e.setAttribute("value",c);e.setAttribute("data-def",c)},publish:function(a,b){b=b?b:{};this.checkParams([[a,"string"],[b,"object"]]);jQuery(document).trigger({type:a,message:{details:b}});LiveComposer.Builder.PreviewAreaWindow.dslca_publish_event(a,b)}};"use strict";function dslc_dm_get_defaults(a){if(dslcDebug)console.log("dslc_dm_get_defaults");var b=a.find(".dslca-module-code").val();jQuery.post(DSLCAjax.ajaxurl,{action:"dslc-ajax-dm-module-defaults",dslc:"active",dslc_modules_options:b},function(a){jQuery(".dslca-prompt-modal textarea").val(a.output)})}function dslc_editable_content_gen_code(a){if(dslcDebug)console.log("dslc_editable_content_gen_code");if(undefined===a){return false}var b,c,d;b=a.closest(".dslc-module-front");c=a.html().trim().replace(/<textarea/g,"<lctextarea").replace(/<\/textarea/g,"</lctextarea");d=a.data("id");jQuery('.dslca-module-option-front[data-id="'+d+'"]',b).val(c)}function dslc_filter_textarea(a){if(dslcDebug)console.log("dslc_filter_textarea");if(undefined===a){return false}var b;b=a.trim().replace(/<textarea/g,"<lctextarea").replace(/<\/textarea/g,"</lctextarea");return b}window.onbeforeunload=function(){return};jQuery(document).ready(function(a){jQuery(document).on("change",".dslca-modules-section-edit-field",function(){var b,c,d,e,f,g,h,i,j,k,l;b=a(this);c=b.data("id");f=b.val();g=f;h=f+b.data("ext");i=b.data("css-rule");d=a(".dslca-modules-section-being-edited",LiveComposer.Builder.PreviewAreaDocument);k=d;j=a('.dslca-modules-section-settings input[data-id="'+c+'"]',d);d.addClass("dslca-modules-section-change-made");if(b.hasClass("dslca-modules-section-edit-field-upload")){if(f&&f.length){f=a('.dslca-modules-section-settings input[data-id="dslca-img-url"]',d).val()}}if(i=="background-image"){f='url("'+f+'")';LiveComposer.Builder.PreviewAreaWindow.dslc_bg_video()}if(c=="bg_image_attachment"){d.removeClass("dslc-init-parallax")}if(c=="border-top"||c=="border-right"||c=="border-bottom"||c=="border-left"){var m=a('.dslca-modules-section-settings input[data-id="border_style"]').val();j=a('.dslca-modules-section-settings input[data-id="border"]',d);g="";var n=b.closest(".dslca-modules-section-edit-option-checkbox-wrapper");n.find(".dslca-modules-section-edit-field-checkbox").each(function(){if(a(this).is(":checked")){if(a(this).data("id")=="border-top"){g+="top "}else if(a(this).data("id")=="border-right"){g+="right "}else if(a(this).data("id")=="border-bottom"){g+="bottom "}else if(a(this).data("id")=="border-left"){g+="left "}}});if(b.is(":checked")){if(b.data("id")=="border-top"){d.css({"border-top-style":m})}else if(b.data("id")=="border-right"){d.css({"border-right-style":m})}else if(b.data("id")=="border-bottom"){d.css({"border-bottom-style":m})}else if(b.data("id")=="border-left"){d.css({"border-left-style":m})}}else{if(b.data("id")=="border-top"){d.css({"border-top-style":"hidden"})}else if(b.data("id")=="border-right"){d.css({"border-right-style":"hidden"})}else if(b.data("id")=="border-bottom"){d.css({"border-bottom-style":"hidden"})}else if(b.data("id")=="border-left"){d.css({"border-left-style":"hidden"})}}}else if(b.hasClass("dslca-modules-section-edit-field-checkbox")){var o=a(this).closest(".dslca-modules-section-edit-option-checkbox-wrapper").find(".dslca-modules-section-edit-field-checkbox");var p="";o.each(function(){if(a(this).prop("checked")){p+=a(this).data("val")+" "}});var g=p;if(b.data("id")=="show_on"){if(p.indexOf("desktop")!==-1){a(".dslca-modules-section-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslc-hide-on-desktop")}else{a(".dslca-modules-section-being-edited",LiveComposer.Builder.PreviewAreaDocument).addClass("dslc-hide-on-desktop")}if(p.indexOf("tablet")!==-1){a(".dslca-modules-section-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslc-hide-on-tablet")}else{a(".dslca-modules-section-being-edited",LiveComposer.Builder.PreviewAreaDocument).addClass("dslc-hide-on-tablet")}if(p.indexOf("phone")!==-1){a(".dslca-modules-section-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslc-hide-on-phone")}else{a(".dslca-modules-section-being-edited",LiveComposer.Builder.PreviewAreaDocument).addClass("dslc-hide-on-phone")}}}else if(c=="bg_image_attachment"&&f=="parallax"||c=="type"){if(c=="bg_image_attachment"){d.addClass("dslc-init-parallax");LiveComposer.Builder.PreviewAreaWindow.dslc_parallax()}else if(c=="type"){if(f=="full"){d.addClass("dslc-full")}else{d.removeClass("dslc-full")}LiveComposer.Builder.PreviewAreaWindow.dslc_masonry()}}else if(c=="columns_spacing"){if(f=="nospacing"){d.addClass("dslc-no-columns-spacing")}else{d.removeClass("dslc-no-columns-spacing")}}else if(c=="custom_class"){}else if(c=="custom_id"){}else if(c=="bg_video"){jQuery(".dslc-bg-video video",d).remove();if(f&&f.length){var q=f;q=q.replace(".webm","");q=q.replace(".mp4","");jQuery(".dslc-bg-video-inner",d).html('<video><source type="video/mp4" src="'+q+'.mp4" /><source type="video/webm" src="'+q+'.webm" /></video>');LiveComposer.Builder.PreviewAreaWindow.dslc_bg_video()}}else if(c=="bg_image_thumb"){if(g=="enabled"){if(jQuery("#dslca-post-data-thumb").length){var r="url('"+jQuery("#dslca-post-data-thumb").val()+"')";k.css(i,r)}}else if(g=="disabled"){k.css(i,"none")}}else{if(b.data("css-element")){k=jQuery(b.data("css-element"),d)}i=i.replace(/ /g,"").split(",");var s;if(null!=b.data("ext")){s=h}else{s=f}for(var t=0;t<i.length;t++){k.css(i[t],s)}}j.val(g);if(!LiveComposer.Builder.Flags.generate_code_after_row_changed)return false});jQuery(document).on("blur",".dslc-editable-area",function(b){var c=a(this).closest(".dslc-module-front");var d=a(this).data("dslc-option-id");var e=a(this).html();jQuery('.dslca-module-options-front textarea[data-id="'+d+'"]',c).val(e);dslc_module_output_altered()});jQuery(document).on("change",".dslca-module-edit-field",function(){if(dslcDebug)console.log("on change event for .dslca-module-edit-field");var b="",c="",d=jQuery(this),e=d.data("id"),f=d.closest(".dslca-module-edit-option"),g=jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument),h=g.data("dslc-module-id"),i=jQuery(".dslca-module-options-front textarea",g);g.addClass("dslca-module-change-made");if(f.hasClass("dslca-module-edit-option-select")||f.hasClass("dslca-module-edit-option-checkbox")){dslc_module_options_hideshow_tabs()}if(jQuery(this).closest(".dslca-module-edit-option").data("refresh-on-change")=="active"){if(f.find(".dslca-module-edit-option-checkbox-wrapper").length){var j=jQuery('input[type="checkbox"]',f);j.each(function(){if(a(this).prop("checked")){b=b+jQuery(this).val()+" "}})}else if(d.hasClass("dslca-module-edit-option-radio")){var b=jQuery(".dslca-module-edit-field:checked",d).val()}else{var b=d.val();if(e=="orientation"&&b=="horizontal"){var k=jQuery(".dslca-module-edit-option-thumb_width .dslca-module-edit-field");k.val("40").trigger("change")}else if(e=="orientation"&&b=="vertical"){var k=jQuery(".dslca-module-edit-option-thumb_width .dslca-module-edit-field");k.val("100").trigger("change")}}b=dslc_filter_textarea(b);jQuery('.dslca-module-options-front textarea[data-id="'+e+'"]',g).val(b);jQuery(".dslca-container-loader").show();dslc_module_output_altered(function(){jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).addClass("dslca-module-change-made");if(e=="css_load_preset"&&!jQuery("body").hasClass("dslca-new-preset-added")){dslc_module_options_show(h);jQuery(".dslca-container-loader").hide()}else{jQuery(".dslca-container-loader").hide()}jQuery("body").removeClass("dslca-new-preset-added");LiveComposer.Utils.publish("LC.moduleChange",{moduleId:h,optionID:e,optionVal:d.val()})})}else{if(d.hasClass("dslca-module-edit-field-font")){var l=d.val();l=l+":400,100,200,300,500,600,700,800,900";var m=d.data("affect-on-change-el");var n=d.data("affect-on-change-rule");var o=d.val();var p=o;var q=jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument);if(d.val().length&&dslcGoogleFontsArray.indexOf(d.val())!==-1){document.getElementById("page-builder-frame").contentWindow.WebFont.load({google:{families:[l]},active:function(a,b){if(jQuery(".dslca-font-loading").closest(".dslca-module-edit-field-font-next").length){jQuery(".dslca-font-loading").removeClass("dslca-font-loading").find(".dslca-icon").removeClass("dslc-icon-spin").addClass("dslc-icon-chevron-right")}else{jQuery(".dslca-font-loading").removeClass("dslca-font-loading").find(".dslca-icon").removeClass("dslc-icon-spin").addClass("dslc-icon-chevron-left")}var c=m.split(",");var e="#"+q[0].id+" "+c.join(", #"+q[0].id+" ")+" {"+n+": "+o+"}";LiveComposer.Builder.Helpers.processInlineStyleTag({context:d,rule:n,elems:m,styleContent:e})},inactive:function(a,b){if(jQuery(".dslca-font-loading").closest(".dslca-module-edit-field-font-next").length){jQuery(".dslca-font-loading").removeClass("dslca-font-loading").find(".dslca-icon").removeClass("dslc-icon-spin").addClass("dslc-icon-chevron-right")}else{jQuery(".dslca-font-loading").removeClass("dslca-font-loading").find(".dslca-icon").removeClass("dslc-icon-spin").addClass("dslc-icon-chevron-left")}}})}else{setTimeout(function(){if(jQuery(".dslca-font-loading.dslca-module-edit-field-font-next").length){jQuery(".dslca-font-loading").removeClass("dslca-font-loading").find(".dslca-icon").removeClass("dslc-icon-spin").addClass("dslc-icon-chevron-right")}else{jQuery(".dslca-font-loading").removeClass("dslca-font-loading").find(".dslca-icon").removeClass("dslc-icon-spin").addClass("dslc-icon-chevron-left")}var a=m.split(",");var b="#"+q[0].id+" "+a.join(", #"+q[0].id+" ")+" {"+n+": "+o+"}";LiveComposer.Builder.Helpers.processInlineStyleTag({context:d,rule:n,elems:m,styleContent:b})},100)}}else if(d.hasClass("dslca-module-edit-field-checkbox")){var j=jQuery('input[type="checkbox"]',f);j.each(function(){if(jQuery(this).prop("checked")){b=b+"solid ";c=c+a(this).val()+" "}else{b=b+"none "}})}if(!d.hasClass("dslca-module-edit-field-font")&&d.data("affect-on-change-el")!=null&&d.data("affect-on-change-rule")!=null){var r=d.data("ext")||"";var m=d.data("affect-on-change-el");var n=d.data("affect-on-change-rule");var o=d.val();var p=o;if(d.hasClass("dslca-module-edit-field-checkbox")){o=b;p=c}if(d.hasClass("dslca-module-edit-field-image")){o='url("'+o+'")'}if(null!==o&&o.length<1&&(n=="background-color"||n=="background")){o="transparent"}n.split(",").forEach(function(a){a=a.replace(/\s+/g,"");var b=jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument);var c=m.split(",");var e="#"+b[0].id+" "+c.join(", #"+b[0].id+" ")+" {"+a+": "+o+r+"}";LiveComposer.Builder.Helpers.processInlineStyleTag({context:d,rule:a,elems:m,styleContent:e})})}var s="";if(e.indexOf("css_")!==-1){s=p}else{s=d.val()}jQuery('.dslca-module-option-front[data-id="'+e+'"]',g).val(s);LiveComposer.Utils.publish("LC.moduleChange",{moduleId:g[0].id,optionID:e,optionVal:p||d.val()})}})});jQuery(document).ready(function(a){var b;jQuery(document).on("click",".dslca-module-edit-field-image-add-hook, .dslca-modules-section-edit-field-image-add-hook",function(){
5
- var a=jQuery(this);if(a.hasClass("dslca-module-edit-field-image-add-hook")){var c=a.siblings(".dslca-module-edit-field-image");var d=a.siblings(".dslca-module-edit-field-image-remove-hook")}else{var c=a.siblings(".dslca-modules-section-edit-field-upload");var d=a.siblings(".dslca-modules-section-edit-field-image-remove-hook")}var e=false;b=wp.media.frames.file_frame=wp.media({title:"Choose Image",button:{text:"Confirm"},multiple:e});b.on("select",function(){var e=b.state().get("selection").first().toJSON();c.val(e.id);var f=a.parent().attr("data-id");if(e.alt!=""&&f=="image"){jQuery('.dslca-module-edit-option-image_alt input[data-id="image_alt"]').val(e.alt)}if(e.title!=""&&f=="image"){jQuery('.dslca-module-edit-option-image_title input[data-id="image_title"]').val(e.title)}jQuery(".dslca-modules-section-being-edited",LiveComposer.Builder.PreviewAreaDocument).find('.dslca-modules-section-settings input[data-id="dslca-img-url"]').val(e.url);c.trigger("change");a.hide();d.show()});b.open()});jQuery(document).on("click",".dslca-module-edit-field-image-remove-hook, .dslca-modules-section-edit-field-image-remove-hook",function(){var a=jQuery(this);if(a.hasClass("dslca-module-edit-field-image-remove-hook")){var b=a.siblings(".dslca-module-edit-field-image");var c=a.siblings(".dslca-module-edit-field-image-add-hook")}else{var b=a.siblings(".dslca-modules-section-edit-field-upload");var c=a.siblings(".dslca-modules-section-edit-field-image-add-hook")}b.val("").trigger("change");var d=a.parent().attr("data-id");if(d=="image"){jQuery(".dslca-module-edit-option-image_alt input").attr("value","").trigger("change");jQuery(".dslca-module-edit-option-image_alt input").attr("data-val-bckp","").trigger("change");jQuery(".dslca-module-edit-option-image_title input").attr("value","").trigger("change");jQuery(".dslca-module-edit-option-image_title input").attr("data-val-bckp","").trigger("change")}a.hide();c.show()});jQuery(document).on("click",".dslca-wp-editor-save-hook",function(){var a=jQuery(".dslca-wysiwyg-active",LiveComposer.Builder.PreviewAreaDocument).closest(".dslc-module-front");if(typeof tinymce!="undefined"){if(jQuery("#wp-dslcawpeditor-wrap").hasClass("tmce-active")){var b=tinymce.get("dslcawpeditor");var c=b.getContent()}else{var c=jQuery("#dslcawpeditor").val()}jQuery(".dslca-wp-editor").hide();jQuery(".dslca-wysiwyg-active",LiveComposer.Builder.PreviewAreaDocument).html(c);if(a.hasClass("dslc-module-handle-like-accordion")){jQuery(".dslca-wysiwyg-active",LiveComposer.Builder.PreviewAreaDocument).siblings(".dslca-accordion-plain-content").val(c);var d=a.find(".dslc-accordion");LiveComposer.Builder.PreviewAreaWindow.dslc_accordion_generate_code(d)}else if(a.hasClass("dslc-module-handle-like-tabs")){jQuery(".dslca-wysiwyg-active",LiveComposer.Builder.PreviewAreaDocument).siblings(".dslca-tab-plain-content").val(c);var e=a.find(".dslc-tabs");LiveComposer.Builder.PreviewAreaWindow.dslc_tabs_generate_code(e)}dslc_editable_content_gen_code(jQuery(".dslca-wysiwyg-active",LiveComposer.Builder.PreviewAreaDocument));jQuery(".dslca-wysiwyg-active",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-wysiwyg-active")}else{console.info("Live Composer: TinyMCE is undefined.")}});jQuery(document).on("click",".dslca-wp-editor-cancel-hook",function(){a(".dslca-wp-editor").hide();a(".dslca-wysiwyg-active",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-wysiwyg-active")})});
1
+ "use strict";function dslc_ui_animations(){if(dslcDebug)console.log("dslc_ui_animations");jQuery(document).on("mouseenter",".dslca-modules-area-manage",function(){jQuery(this).closest(".dslc-modules-area").addClass("dslca-options-hovered")}).on("mouseleave",".dslca-modules-area-manage",function(){jQuery(this).closest(".dslc-modules-area").removeClass("dslca-options-hovered")});jQuery(document).on("mouseenter",".dslca-drag-not-in-progress .dslc-module-front",function(a){if(!jQuery("body").hasClass("dslca-composer-hidden")){if(jQuery(this).height()<190)jQuery(".dslca-module-manage",this).addClass("dslca-horizontal");else jQuery(".dslca-module-manage",this).removeClass("dslca-horizontal")}}).on("mouseleave",".dslca-drag-not-in-progress .dslc-module-front",function(a){if(!jQuery("body").hasClass("dslca-composer-hidden")){}});jQuery(document).on("mouseenter",".dslca-drag-not-in-progress .dslc-modules-area",function(a){var b=jQuery(this);if(!jQuery("body").hasClass("dslca-composer-hidden")){if(jQuery(this).height()<130)jQuery(".dslca-modules-area-manage",this).addClass("dslca-horizontal");else jQuery(".dslca-modules-area-manage",this).removeClass("dslca-horizontal")}}).on("mouseleave",".dslca-drag-not-in-progress .dslc-modules-area",function(a){var b=jQuery(this);if(!jQuery("body").hasClass("dslca-composer-hidden")){}})}jQuery(document).ready(function(){dslc_ui_animations()});"use strict";function dslc_save_composer(){if(dslcDebug)console.log("dslc_save_composer");dslc_generate_code();dslca_gen_content_for_search();var a=jQuery("#dslca-code").val(),b=jQuery("#dslca-content-for-search").val(),c=jQuery(".dslca-container").data("post-id");jQuery("body").addClass("dslca-saving-in-progress");jQuery(".dslca-save-composer .dslca-icon").removeClass("dslc-icon-ok").addClass("dslc-icon-spin dslc-icon-spinner");jQuery.ajax({method:"POST",type:"POST",url:DSLCAjax.ajaxurl,data:{action:"dslc-ajax-save-composer",dslc:"active",dslc_post_id:c,dslc_code:a,dslc_content_for_search:b},timeout:3e4}).done(function(a){if(a.status=="success"){jQuery(".dslca-save-composer").fadeOut(250);jQuery(".dslca-save-draft-composer").fadeOut(250);jQuery("body").append('<iframe class="lbmn-cache-iframe" id="lbmn-cache-iframe-'+c+'" src="'+DSLCSiteData.siteurl+"/?p="+c+'" ></iframe>');jQuery(".lbmn-cache-iframe").each(function(a,b){jQuery(b).load(function(){jQuery(b).remove()})})}else{alert("Something went wrong, please try to save again. Are you sure to make any changes? Error Code: "+a.status)}}).fail(function(a){if(a.statusText=="timeout"){alert("The request timed out after 30 seconds. Server do not respond in time. Please try again.")}else{alert("Something went wrong. Please try again. Error Code: "+a.statusText)}}).always(function(a){jQuery(".dslca-save-composer .dslca-icon").removeClass("dslc-icon-spin dslc-icon-spinner").addClass("dslc-icon-ok");jQuery("body").removeClass("dslca-saving-in-progress")})}function dslc_save_draft_composer(){if(dslcDebug)console.log("dslc_save_draft_composer");var a=jQuery("#dslca-code").val(),b=jQuery(".dslca-container").data("post-id");jQuery("body").addClass("dslca-saving-in-progress");jQuery(".dslca-save-draft-composer .dslca-icon").removeClass("dslc-icon-ok").addClass("dslc-icon-spin dslc-icon-spinner");jQuery.post(DSLCAjax.ajaxurl,{action:"dslc-ajax-save-draft-composer",dslc:"active",dslc_post_id:b,dslc_code:a},function(a){jQuery(".dslca-save-draft-composer .dslca-icon").removeClass("dslc-icon-spin dslc-icon-spinner").addClass("dslc-icon-save");if(a.status=="success"){jQuery(".dslca-save-draft-composer").fadeOut(250)}else{alert("Something went wrong, please try to save again.")}jQuery("body").removeClass("dslca-saving-in-progress")})}function dslc_generate_code(){if(dslcDebug)console.log("dslc_generate_code");var a="",b,c="",d="",e=12,f=12,g=0,h=0,i,j,k,l,m,n="",o;jQuery("#dslc-main .dslc-modules-area",LiveComposer.Builder.PreviewAreaDocument).each(function(){if(jQuery(".dslc-module-front",this).length){jQuery(this).removeClass("dslc-modules-area-empty").addClass("dslc-modules-area-not-empty");jQuery(".dslca-no-content",this).hide()}else{jQuery(this).removeClass("dslc-modules-area-not-empty").addClass("dslc-modules-area-empty");jQuery(".dslca-no-content:not(:visible)",this).show().css({"-webkit-animation-name":"dslcBounceIn","-moz-animation-name":"dslcBounceIn","animation-name":"dslcBounceIn","animation-duration":"0.6s","-webkit-animation-duration":"0.6s",padding:0}).animate({padding:"35px 0"},300)}});jQuery("#dslc-main .dslc-modules-section",LiveComposer.Builder.PreviewAreaDocument).each(function(){m=jQuery(this);o=dslc_generate_section_code(m);m.find(".dslca-section-code").val(o);d=d+o+","});d=d.slice(0,-1);d="["+d+"]";jQuery("#dslca-code").val(d);jQuery("#dslca-export-code").val(d)}function dslc_generate_section_code(a){if(dslcDebug)console.log("dslc_generate_section_code");var b="",c,d="",e="",f=12,g=12,h=0,i=0,j,k,l,m,n,o="",p="",q;n=a;if(jQuery(".dslc-modules-area",n).length){n.removeClass("dslc-modules-section-empty").addClass("dslc-modules-section-not-empty")}else{n.removeClass("dslc-modules-section-not-empty").addClass("dslc-modules-section-empty")}jQuery(".dslc-modules-area.dslc-last-col, .dslc-modules-area.dslc-first-col",this).removeClass("dslc-last-col dslc-first-col");jQuery(".dslc-module-front.dslc-last-col, .dslc-module-front.dslc-first-col",this).removeClass("dslc-last-col dslc-first-col");i=0;p=n.find(".dslca-section-code").val();q=JSON.parse(p);o="";jQuery(".dslca-modules-section-settings input",n).each(function(){var a=jQuery(this);var b=a.data("id");var c=a.val();o=o+b+'="'+c+'" ';q[b]=c});if(undefined!==q["give_new_id"]){delete q["give_new_id"]}q["content"]=[];jQuery(".dslc-modules-area",n).each(function(){h=0;k=jQuery(this);j=parseInt(k.data("size"));l="no";m="no";i+=j;jQuery(this).removeClass("dslc-first-col");jQuery(this).removeClass("dslc-last-col");if(i==g){jQuery(this).addClass("dslc-last-col").next(".dslc-modules-area").addClass("dslc-first-col");i=0;l="yes"}else if(i>g){jQuery(this).removeClass("dslc-last-col").addClass("dslc-first-col");i=j;m="yes"}if(i==j){m="yes";jQuery(this).removeClass("dslc-last-col").addClass("dslc-first-col")}var a='{"element_type":"module_area","last":"'+l+'","first":"'+m+'","size":"'+j+'"}';a=JSON.parse(a);if(undefined!==a["give_new_id"]){delete a["give_new_id"]}a.content=[];jQuery(".dslc-module-front",k).each(function(){var d=jQuery(this);c=parseInt(d[0].getAttribute("data-dslc-module-size"));var e="no";var g="no";jQuery(this).removeClass("dslc-first-col");jQuery(this).removeClass("dslc-last-col");h+=c;if(h==f){jQuery(this).addClass("dslc-last-col");jQuery(this).next(".dslc-module-front").addClass("dslc-first-col");h=0;e="yes";g="yes"}else if(h>f){jQuery(this).removeClass("dslc-last-col").addClass("dslc-first-col");h=c;g="yes"}if(h==c){g="yes";jQuery(this).removeClass("dslc-last-col").addClass("dslc-first-col")}try{b=d[0].querySelector(".dslca-module-code").value}catch(i){console.info("No DSLC code found in module: "+d[0].getAttribute("id"))}if(""!==b){var j=JSON.parse(b);j.last=e;jQuery.each(j,function(a,b){if(false===b||""===b){delete j[a]}if("give_new_id"===a){delete j[a]}});d[0].querySelector(".dslca-module-code").value=JSON.stringify(j);a["content"].push(j)}b=""});q["content"].push(a)});var r=JSON.stringify(q);return r}jQuery(document).ready(function(a){a(document).on("click",".dslca-save-composer-hook",function(b){b.preventDefault();if(!a("body").hasClass("dslca-module-saving-in-progress")&&!a("body").hasClass("dslca-saving-in-progress")){dslc_save_composer()}});a(document).on("click",".dslca-save-draft-composer-hook",function(b){b.preventDefault();if(!a("body").hasClass("dslca-module-saving-in-progress")&&!a("body").hasClass("dslca-saving-in-progress")){dslc_save_draft_composer()}})});function dslca_gen_content_for_search(){if(dslcDebug)console.log("dslca_gen_content_for_search");var a=document.getElementById("dslca-content-for-search");if(null===a){return}var b=a.value;var c="";var d=LiveComposer.Builder.PreviewAreaWindow.document.querySelectorAll("#dslc-main .dslc-module-front [data-exportable-content]");if(undefined!==d){Array.prototype.forEach.call(d,function(a,b){var d;if(a.getAttribute("data-exportable-content")!==""){var e=a.getAttribute("data-exportable-content");d="<"+e+">"+a.innerHTML+"</"+e+">"}else{d=a.innerHTML}if(d!==null){c+=d.replace(/\s+/g," ").trim()+"\n"}})}a.value=c;if(b!==c){dslc_show_publish_button()}}var massagesTicker=jQuery("#editor-messages").newsTicker({row_height:40,max_rows:2,speed:900,direction:"up",duration:12e3,autostart:1,pauseOnHover:1,start:function(){jQuery("#editor-messages").css("opacity","1")}});jQuery(document).ready(function(a){a(document).on("click",".dslc-editor-messages-hide",function(b){var c=a(".dslc-editor-messages-hide").data("can-hide");if(c=="1"){jQuery.post(DSLCAjax.ajaxurl,{action:"dslc-ajax-hidden-panel"});a(".dslc-editor-messages-section").css("display","none");a(".dslca-container").removeClass("active-message-panel")}else{a("#editor-messages").html('<div class="dslc-notice"><a href="https://livecomposerplugin.com/add-ons/?utm_source=editing-sreen&utm_medium=editor-messages&utm_campaign=add-ons" target="_blank">You can hide this panel once you have any of our premium add-ons installed.</a></div>')}});if(a("div.dslc-editor-messages-section").length){a(".dslc-editor-messages-section").css("display","block");a(".dslca-container").addClass("active-message-panel")}});"use strict";var dslcRegularFontsArray=DSLCFonts.regular;var dslcGoogleFontsArray=DSLCFonts.google;var dslcAllFontsArray=dslcRegularFontsArray.concat(dslcGoogleFontsArray);var dslcIconsCurrentSet=DSLCIcons.fontawesome;var dslcDebug=false;var LiveComposer={Builder:{Elements:{},UI:{},Actions:{},Flags:{},PreviewFrame:{},Helpers:{}},Production:{},Utils:{}};(function(){LiveComposer.Builder.Flags={windowScroller:false,panelOpened:false,generate_code_after_row_changed:true};LiveComposer.Builder.Actions={postponed_actions_queue:{},add_postponed_action:function(a){if(a===undefined){return}if(isNaN(this.postponed_actions_queue[a])){this.postponed_actions_queue[a]=0}this.postponed_actions_queue[a]+=1},release_postponed_actions:function(){var a=this;jQuery.each(this.postponed_actions_queue,function(b,c){if(1<c){a.postponed_actions_queue[b]-=1}else if(1==c){window[b]();a.postponed_actions_queue[b]-=1}})}};LiveComposer.Builder.Helpers.insertModule=function(a,b){var c=jQuery(a),b=jQuery(b);var d=[];c.find("script").each(function(){d.push(this.innerHTML);this.parentNode.removeChild(this)});b.after(c).remove();d.forEach(function(a){var b=LiveComposer.Builder.PreviewAreaDocument[0].createElement("script");b.innerHTML=a;b.type="text/javascript";LiveComposer.Builder.PreviewAreaDocument[0].getElementById(c[0].id).appendChild(b)});d=null;b=null;return c}})();"use strict";LiveComposer.Builder.UI.CModalWindow=function(a){if(typeof a!="object"||this.instancesExists===true)return false;var b=this;var c='<div class="dslca-prompt-modal dslca-prompt-modal-active">'+'<div class="dslca-prompt-modal-content"><div class="dslca-prompt-modal-msg">'+'<span class="dslca-prompt-modal-title">'+a.title+"</span>"+'<span class="dslca-prompt-modal-descr">'+a.content+"</span></div>";var d="";if(a.confirm||a.cancel){d='<div class="dslca-prompt-modal-actions">'+'<a href="#" class="dslca-prompt-modal-confirm-hook"><span class="dslc-icon dslc-icon-ok">'+"</span>"+(a.confirm_title?a.confirm_title:"Confirm")+'</a><span class="dslca-prompt-modal-cancel-hook"><span class="dslc-icon dslc-icon-remove">'+"</span>"+(a.cancel_title?a.cancel_title:"Cancel")+"</span></div>"}else{d='<div class="dslca-prompt-modal-actions">'+'<a href="#" class="dslca-prompt-modal-confirm-hook"><span class="dslc-icon dslc-icon-ok">'+"</span>"+(a.ok_title?a.ok_title:"OK")+"</a></div>"}c+=d+"</div>";c=jQuery(c);if(typeof a.confirm!="function")a.confirm=function(){};if(typeof a.cancel!="function")a.cancel=function(){};c.find(".dslca-prompt-modal-confirm-hook").click(function(d){d.stopPropagation();c.find(".dslca-prompt-modal-content").animate({top:"55%"},400);c.animate({opacity:0},400,function(){a.confirm();b.instancesExists=false;jQuery(this).remove()});return false});c.find(".dslca-prompt-modal-cancel-hook").click(function(d){d.stopPropagation();c.find(".dslca-prompt-modal-content").animate({top:"55%"},400);c.animate({opacity:0},400,function(){jQuery(this).remove();b.instancesExists=false;a.cancel()});return false});c.hide();jQuery("body").append(c);c.css({opacity:0}).show().animate({opacity:1},400);c.find(".dslca-prompt-modal-content").css({top:"55%"}).animate({top:"50%"},400);this.instancesExists=true};"use strict";function dslc_show_modal(a,b){if(typeof dslcDebug!=="undefined"&&dslcDebug)console.log("dslc_show_modal");if(jQuery(".dslca-modal:visible").length){dslc_hide_modal("",jQuery(".dslca-modal:visible"))}var b=jQuery(b);var c=jQuery(".dslca-container").height();b.outerHide({clbk:function(){dslc_hide_modal("",jQuery(".dslca-modal:visible"))}});var d=jQuery(a).position(),e=b.outerWidth()/2-a.outerWidth()/2,f=d.left-e;b.css({left:f});jQuery(".dslca-prompt-modal-custom").insertAfter(b);if(jQuery(".dslca-prompt-modal-custom").length>0){jQuery(".dslca-prompt-modal-custom").fadeIn()}b.addClass("dslca-modal-open").show()}function dslc_hide_modal(a,b){if(typeof dslcDebug!=="undefined"&&dslcDebug)console.log("dslc_hide_modal");console.log("dslc_hide_modal");var b=jQuery(b);b.outerHide("destroy");b.hide();if(jQuery(".dslca-prompt-modal-custom").length>0){jQuery(".dslca-prompt-modal-custom").fadeOut()}b.removeClass("dslca-modal-open")}jQuery(document).ready(function(a){a(document).on("click",".dslca-open-modal-hook",function(a){a.preventDefault();var b=jQuery(this).data("modal");dslc_show_modal(jQuery(this),b)});jQuery(document).on("click",".dslca-close-modal-hook",function(a){a.preventDefault();if(!jQuery(this).hasClass("dslca-action-disabled")){var b=jQuery(this).data("modal");dslc_hide_modal(jQuery(this),b)}})});function dslc_js_confirm(a,b,c){if(typeof dslcDebug!=="undefined"&&dslcDebug)console.log("dslc_js_confirm");jQuery(".dslca-prompt-modal").addClass("dslca-prompt-modal-active");jQuery(".dslca-prompt-modal").data("id",a);jQuery(".dslca-prompt-modal").data("target",c);jQuery(".dslca-prompt-modal-msg").html(b);jQuery(".dslca-prompt-modal").css({opacity:0}).show().animate({opacity:1},400);jQuery(".dslca-prompt-modal-content").css({top:"55%"}).animate({top:"50%"},400)}function dslc_js_confirm_close(){if(typeof dslcDebug!=="undefined"&&dslcDebug)console.log("dslc_js_confirm_close");jQuery(".dslca-prompt-modal").removeClass("dslca-prompt-modal-active");jQuery(".dslca-prompt-modal").animate({opacity:0},400,function(){jQuery(this).hide();jQuery(".dslca-prompt-modal-cancel-hook").show();jQuery(".dslca-prompt-modal-confirm-hook").html('<span class="dslc-icon dslc-icon-ok"></span>'+DSLCString.str_confirm)});jQuery(".dslca-prompt-modal-content").animate({top:"55%"},400)}function dslc_modal_keypress_events(a){if(a.which==13){if(jQuery(".dslca-prompt-modal-active").length){jQuery(".dslca-prompt-modal-confirm-hook").trigger("click")}}else if(a.which==27){if(jQuery(".dslca-prompt-modal-active").length){jQuery(".dslca-prompt-modal-cancel-hook").trigger("click")}}}jQuery(document).ready(function(a){a(document).on("click",".dslca-prompt-modal-cancel-hook",function(a){a.preventDefault();var b=jQuery(".dslca-prompt-modal").data("id");var c=jQuery(".dslca-prompt-modal").data("target");if(b=="edit_in_progress"){dslc_module_options_cancel_changes(function(){c.trigger("click")})}else if(b=="delete_module"){}dslc_js_confirm_close();jQuery(".dslca-prompt-modal").data("id","")});a(document).on("click",".dslca-prompt-modal-confirm-hook",function(b){b.preventDefault();var c=jQuery(".dslca-prompt-modal").data("id");var d=jQuery(".dslca-prompt-modal").data("target");var e=true;if(c=="edit_in_progress"){dslc_module_options_confirm_changes(function(){d.trigger("click")})}else if(c=="disable_lc"){window.location=d}else if("delete_module"===c){var f=d.closest(".dslc-module-front");dslc_delete_module(f)}else if("delete_modules_area"===c){var g=d.closest(".dslc-modules-area");var h=g.closest(".dslc-modules-section-inner");dslc_modules_area_delete(g)}else if(c=="delete_modules_section"){dslc_row_delete(d.closest(".dslc-modules-section"))}else if(c=="export_modules_section"){}else if(c=="import_modules_section"){dslc_row_import(a(".dslca-prompt-modal textarea").val());a(".dslca-prompt-modal-confirm-hook span").css({opacity:0});a(".dslca-prompt-modal-confirm-hook .dslca-loading").show();e=false}if(e)dslc_js_confirm_close();jQuery(".dslca-prompt-modal").data("id","")})});jQuery.fn.outerHide=function(a){var b=jQuery;a=a?a:{};var c=this;if("destroy"==a){b(document).unbind("click.outer_hide");return false}b(document).bind("click.outer_hide",function(d){if(b(d.target).closest(c).length==0&&d.target!=c&&b.inArray(b(d.target)[0],b(a.clickObj))==-1&&b(c).css("display")!="none"){if(a.clbk){a.clbk()}else{b(c).hide()}}})};"use strict";jQuery(document).on("editorFrameLoaded",function(){var a=jQuery;var b=function(){if(LiveComposer.Builder.Flags.panelOpened){LiveComposer.Builder.UI.shakePanelConfirmButton();return false}return true};LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-copy-module-hook",function(c){c.preventDefault();if(!b())return false;if(!a(this).hasClass("dslca-action-disabled")){dslc_module_copy(a(this).closest(".dslc-module-front"))}});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-delete-module-hook",function(c){c.preventDefault();if(!b())return false;var d=this;if(!a(this).hasClass("dslca-action-disabled")){LiveComposer.Builder.UI.CModalWindow({title:DSLCString.str_del_module_title,content:DSLCString.str_del_module_descr,confirm:function(){var a=jQuery(d).closest(".dslc-module-front");dslc_delete_module(a)}})}});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-module-edit-hook, .dslc-module-front > div:not(.dslca-module-manage)",function(b){if(dslcDebug)console.log("dslca-module-edit-hook");b.preventDefault();var c=jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).length;var d=jQuery(".dslca-modules-section-being-edited",LiveComposer.Builder.PreviewAreaDocument).length;if(a("body").hasClass("dslca-composer-hidden")||c>0||d>0){if(jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument)[0]!=jQuery(this).closest(".dslc-module-front")[0]){LiveComposer.Builder.UI.shakePanelConfirmButton()}return false}var e=a(this).closest(".dslc-module-front"),f=e.data("dslc-module-id");a(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-module-being-edited");e.addClass("dslca-module-being-edited");dslc_module_options_show(f);jQuery("body",LiveComposer.Builder.PreviewAreaDocument).addClass("module-editing-in-progress")});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-change-width-module-hook",function(c){c.preventDefault();if(!b())return false;if(!a(this).hasClass("dslca-action-disabled")){jQuery(".dslca-change-width-module-options",this).toggle();a(this).closest(".dslc-module-front").toggleClass("dslca-change-width-active")}});LiveComposer.Builder.PreviewAreaDocument.on("mouseleave",".dslca-change-width-module-options",function(b){jQuery(this).hide();a(this).closest(".dslc-module-front").removeClass("dslca-change-width-active")});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-change-width-module-options span",function(){dslc_module_width_set(jQuery(this).closest(".dslc-module-front"),jQuery(this).data("size"))});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-module-get-defaults-hook",function(){var b=jQuery(this).closest(".dslc-module-front");var c=dslc_dm_get_defaults(b);var d='<span class="dslca-prompt-modal-title">Module Defaults</span>'+'<span class="dslca-prompt-modal-descr">The code bellow is used to alter the defaults.</span>'+"<textarea></textarea><br><br>";a(".dslca-prompt-modal-cancel-hook").hide();a(".dslca-prompt-modal-confirm-hook").html('<span class="dslc-icon dslc-icon-ok"></span>OK');dslc_js_confirm("dev_mode_get_default",d,b)});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-refresh-module-hook",function(a){jQuery(this).css({"-webkit-animation-name":"dslcRotate","-moz-animation-name":"dslcRotate","animation-name":"dslcRotate","animation-duration":"0.6s","-webkit-animation-duration":"0.6s","animation-iteration-count":"infinite","-webkit-animation-iteration-count":"infinite"});jQuery(this).closest(".dslc-module-front").addClass("dslca-module-being-edited");dslc_module_output_altered(function(){jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-module-being-edited")})});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-wysiwyg-actions-edit-hook",function(){var a=jQuery(this).parent().siblings(".dslca-editable-content");var b=a.closest(".dslc-module-front");if(b.hasClass("dslc-module-handle-like-accordion")){LiveComposer.Builder.PreviewAreaWindow.dslc_accordion_generate_code(b.find(".dslc-accordion"));var c=b.find('.dslca-module-option-front[data-id="accordion_content"]').val();var d=c.split("(dslc_sep)");var e=a.closest(".dslc-accordion-item").index();var f=d[e].trim().replace(/<lctextarea/g,"<textarea").replace(/<\/lctextarea/g,"</textarea")}else if(b.hasClass("dslc-module-handle-like-tabs")){LiveComposer.Builder.PreviewAreaWindow.dslc_tabs_generate_code(b.find(".dslc-tabs"));var c=b.find('.dslca-module-option-front[data-id="tabs_content"]').val();var d=c.split("(dslc_sep)");var e=a.closest(".dslc-tabs-tab-content").index();var f=d[e].trim().replace(/<lctextarea/g,"<textarea").replace(/<\/lctextarea/g,"</textarea")}else{var f=b.find('.dslca-module-option-front[data-id="'+a.data("id")+'"]').val().replace(/<lctextarea/g,"<textarea").replace(/<\/lctextarea/g,"</textarea")}if(f.includes("%")){f=f.replace(/%\(\(%/g,"[");f=f.replace(/%\)\)%/g,"]");f=f.replace(/%\(%/g,"[");f=f.replace(/%\)%/g,"]");f=f.replace(/%\{%/g,"[");f=f.replace(/%\}%/g,"]")}if(typeof tinymce!="undefined"){var g=tinymce.get("dslcawpeditor");if(jQuery("#wp-dslcawpeditor-wrap").hasClass("tmce-active")){g.setContent(f,{format:"html"})}else{jQuery("textarea#dslcawpeditor").val(f)}if(!b.hasClass("dslca-module-being-edited")){b.find(".dslca-module-edit-hook").trigger("click")}jQuery(".dslca-wp-editor").show();a.addClass("dslca-wysiwyg-active");jQuery("#dslcawpeditor_ifr, #dslcawpeditor").css({height:jQuery(".dslca-wp-editor").height()-300})}else{console.info("Live Composer: TinyMCE is undefined.")}});LiveComposer.Builder.PreviewAreaDocument.on("blur",".dslca-editable-content",function(){if(!jQuery("body").hasClass("dslca-composer-hidden")&&jQuery(this).data("type")=="simple"){dslc_editable_content_gen_code(jQuery(this))}}).on("paste",".dslca-editable-content:not(.inline-editor)",function(){if(!jQuery("body").hasClass("dslca-composer-hidden")&&jQuery(this).data("type")=="simple"){var a=jQuery(this);setTimeout(function(){if(a.data("type")=="simple"){a.html(a.text())}dslc_editable_content_gen_code(a)},100)}}).on("focus",".dslca-editable-content",function(){if(jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).length>0&&!jQuery(this).closest(".dslc-module-front").hasClass("dslca-module-being-edited")){jQuery(this).trigger("blur")}}).on("keyup",".dslca-editable-content",function(){if(jQuery(this).data("type")=="simple"){jQuery(this).closest(".dslc-module-front").addClass("dslca-module-change-made")}})});function dslc_module_delete(a){if(dslcDebug)console.log("dslc_delete_module");a.addClass("dslca-module-being-deleted");if(a.hasClass("dslca-module-being-edited")){dslc_show_section(".dslca-modules")}setTimeout(function(){a.remove();dslc_generate_code();dslc_show_publish_button()},1e3);a.css({"-webkit-animation-name":"dslcBounceOut2","-moz-animation-name":"dslcBounceOut2","animation-name":"dslcBounceOut2","animation-duration":"0.6s","-webkit-animation-duration":"0.6s"}).animate({opacity:0},500,function(){a.css({marginBottom:0}).animate({height:0},400,"easeOutQuart")})}function dslc_module_copy(a){if(dslcDebug)console.log("dslc_copy_module");jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-module-being-edited");var b=a[0].cloneNode(true);jQuery(b).appendTo(a.closest(".dslc-modules-area")).css({"-webkit-animation-name":"none","-moz-animation-name":"none","animation-name":"none","animation-duration":"0","-webkit-animation-duration":"0",opacity:0}).addClass("dslca-module-being-edited");dslc_module_new_id(b);dslc_generate_code();jQuery(b).css({opacity:0}).removeClass("dslca-module-being-edited").animate({opacity:1},300);dslc_show_publish_button()}function dslc_module_new_id(a){var b=LiveComposer.Utils.get_unique_id();var c=a.getAttribute("id");a.setAttribute("data-module-id",b);a.setAttribute("id","dslc-module-"+b);var d=a.getElementsByTagName("style")[0];var e=d.textContent;d.setAttribute("id","#css-for-dslc-module-"+b);e=e.split(c).join("dslc-module-"+b);d.textContent=e;LiveComposer.Utils.update_module_property_raw(a,"module_instance_id",b)}function dslc_module_width_set(a,b){if(dslcDebug)console.log("dslc_module_width_set");var c="dslc-"+b+"-col";a.removeClass("dslc-1-col dslc-2-col dslc-3-col dslc-4-col dslc-5-col dslc-6-col dslc-7-col dslc-8-col dslc-9-col dslc-10-col dslc-11-col dslc-12-col").addClass(c);a[0].setAttribute("data-dslc-module-size",b);LiveComposer.Utils.update_module_property_raw(a[0],"dslc_m_size",b);LiveComposer.Builder.PreviewAreaWindow.dslc_masonry();dslc_generate_code();dslc_show_publish_button()}function dslc_module_options_show(a){if(dslcDebug)console.log("dslc_module_options_show");var b=jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument),c=jQuery(".dslca-module-options-front textarea",b),d=jQuery(".dslca-header").data("default-section"),e=jQuery(jQuery("#pseudo-panel").html());jQuery("#wpwrap").append(e);var f={};f["action"]="dslc-ajax-display-module-options";f["dslc"]="active";f["dslc_module_id"]=a;f["dslc_post_id"]=jQuery(".dslca-container").data("data-post-id");f.dslc_url_vars=LiveComposer.Utils.get_page_params();c.each(function(){var a=jQuery(this),b=a.data("id"),c=a.val();if(c.includes("%")){c=c.replace(/%\(\(%/g,"[");c=c.replace(/%\)\)%/g,"]");c=c.replace(/%\(%/g,"[");c=c.replace(/%\)%/g,"]");c=c.replace(/%\{%/g,"[");c=c.replace(/%\}%/g,"]")}f[b]=c});jQuery(".dslca-wp-editor-actions").hide();jQuery(".dslca-wp-editor-notification").show();dslc_hide_publish_button();LiveComposer.Builder.UI.initInlineEditors();var g=jQuery(".dslca-module-options-front",b).children().clone();LiveComposer.Builder.moduleBackup=g;LiveComposer.Builder.Flags.panelOpened=true;e.show();e.addClass("show");jQuery.post(DSLCAjax.ajaxurl,f,function(a){e.remove();dslc_show_section(".dslca-module-edit");if(!jQuery("body").hasClass("rtl")){jQuery(".dslca-module-edit-options-inner").html(a.output)}else{jQuery(".dslca-module-edit-options-inner").html(a.output)}jQuery(".dslca-module-edit-options-tabs").html(a.output_tabs);var b=[];jQuery(".dslca-module-edit-options-inner .dslca-module-edit-option").each(function(){var a=jQuery(this).data("section");if(b.indexOf(a)==-1){b.push(a)}});var c=b.length;for(var f=0;f<c;f++){jQuery('.dslca-header .dslca-options-filter-hook[data-section="'+b[f]+'"]').show()}if(jQuery('.dslca-module-edit-option[data-section="'+d+'"]').length){jQuery('.dslca-header .dslca-options-filter-hook[data-section="'+d+'"]').show();jQuery('.dslca-header .dslca-options-filter-hook[data-section="'+d+'"]').trigger("click")}else{jQuery(".dslca-header .dslca-options-filter-hook:first").hide();jQuery(".dslca-header .dslca-options-filter-hook:first").next(".dslca-options-filter-hook").trigger("click")}jQuery(".dslca-module-edit-actions").show();jQuery(".dslca-wp-editor-notification").hide();jQuery(".dslca-wp-editor-actions").show();jQuery(".dslca-header .dslca-go-to-section-hook").hide();jQuery(".dslca-row-edit-actions").hide();LiveComposer.Builder.UI.loadOptionsDeps()})}function dslc_module_output_default(a,b){if(dslcDebug)console.log("dslc_module_output_default");jQuery.post(DSLCAjax.ajaxurl,{action:"dslc-ajax-add-module",dslc:"active",dslc_module_id:a,dslc_post_id:jQuery(".dslca-container").data("post-id"),dslc_url_vars:LiveComposer.Utils.get_page_params(),dslc_new_module:true},function(a){b(a)})}function dslc_module_output_altered(a){if(dslcDebug)console.log("dslc_module_output_altered");a=typeof a!=="undefined"?a:false;var b=jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument),c=b.data("dslc-module-id"),d=jQuery(".dslca-module-options-front textarea",b),e=b.data("module-id");var f={};f["action"]="dslc-ajax-add-module";f["dslc"]="active";f["dslc_module_id"]=c;f["dslc_module_instance_id"]=e;f["dslc_post_id"]=jQuery(".dslca-container").data("post-id");if(b.hasClass("dslca-preload-preset"))f["dslc_preload_preset"]="enabled";else f["dslc_preload_preset"]="disabled";b.removeClass("dslca-preload-preset");d.each(function(){var a=jQuery(this);var b=a.data("id");var c=a.val();f[b]=c});f.dslc_url_vars=LiveComposer.Utils.get_page_params();jQuery.post(DSLCAjax.ajaxurl,f,function(c){var d=LiveComposer.Builder.Helpers.insertModule(c.output,b);d.addClass("dslca-module-being-edited");c=null;d=null;LiveComposer.Builder.PreviewAreaWindow.dslc_carousel();LiveComposer.Builder.PreviewAreaWindow.dslc_masonry();LiveComposer.Builder.PreviewAreaWindow.dslc_tabs();LiveComposer.Builder.PreviewAreaWindow.dslc_init_accordion();var e=new Event("dslc_module_output_altered");LiveComposer.Builder.PreviewAreaWindow.dispatchEvent(e);if(a){a(c)}})}function dslc_module_output_reload(a,b){if(dslcDebug)console.log("dslc_module_output_reload");b=typeof b!=="undefined"?b:false;var c=a.data("dslc-module-id"),d=jQuery(".dslca-module-options-front textarea",a),e=a.data("module-id");var f={};f["action"]="dslc-ajax-add-module";f["dslc"]="active";f["dslc_module_id"]=c;f["dslc_module_instance_id"]=e;f["dslc_post_id"]=jQuery(".dslca-container").data("post-id");f["dslc_preload_preset"]="enabled";a.removeClass("dslca-preload-preset");d.each(function(){var a=jQuery(this);var b=a.data("id");var c=a.val();f[b]=c});a.append('<div class="dslca-module-reloading"><span class="dslca-icon dslc-icon-spin dslc-icon-refresh"></span></div>');jQuery.post(DSLCAjax.ajaxurl,f,function(c){a.after(c.output).next().addClass("dslca-module-being-edited");a.remove();dslc_generate_code();dslc_show_publish_button();LiveComposer.Builder.PreviewAreaWindow.dslc_carousel();LiveComposer.Builder.PreviewAreaWindow.dslc_masonry();LiveComposer.Builder.PreviewAreaWindow.dslc_tabs();LiveComposer.Builder.PreviewAreaWindow.dslc_init_accordion();if(b){b(c)}jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-module-being-edited")})}function dslc_delete_module(a){dslc_module_delete(a)}function dslc_copy_module(a){dslc_module_copy(a)}function dslc_display_module_options(a){dslc_module_options_show(a)}function dslc_get_module_output(a,b){dslc_module_output_default(a,b)}function dslc_preview_change(a){dslc_module_output_altered(a)}function dslc_reload_module(a,b){dslc_module_output_reload(a,b)}"use strict";LiveComposer.Builder.Elements.CModuleArea=function(a){var b=this;this.section=jQuery(a).closest(".dslc-modules-section");this.elem=a;this.observer=new mqMutationObserver(a,function(){var c=b.elem.classList;if(a.querySelectorAll(".dslc-module-front").length==0){c.add("dslc-modules-area-empty");c.remove("dslc-modules-area-not-empty")}else{c.remove("dslc-modules-area-empty");c.add("dslc-modules-area-not-empty")}},{childList:true});this.sortable=Sortable.create(a,{group:"modules",animation:350,handle:".dslca-move-module-hook",draggable:".dslc-module-front",ghostClass:"dslca-module-ghost",chosenClass:"dslca-module-dragging",scroll:true,scrollSensitivity:150,scrollSpeed:15,setData:function(a,b){a.setData(LiveComposer.Utils.msieversion()!==false?"Text":"text/html",b.innerHTML);
2
+ },onStart:function(a){a.oldIndex;jQuery("body").removeClass("dslca-drag-not-in-progress").addClass("dslca-drag-in-progress");jQuery("body",LiveComposer.Builder.PreviewAreaWindow.document).removeClass("dslca-drag-not-in-progress").addClass("dslca-drag-in-progress")},onEnd:function(a){a.oldIndex;a.newIndex;a.preventDefault();dslc_generate_code();LiveComposer.Builder.UI.stopScroller();jQuery("body").removeClass("dslca-drag-in-progress").addClass("dslca-drag-not-in-progress");jQuery("body",LiveComposer.Builder.PreviewAreaWindow.document).removeClass("dslca-drag-in-progress").addClass("dslca-drag-not-in-progress")},onAdd:function(a){var c=a.item;a.from;if(jQuery(c).data("id")=="DSLC_M_A"){dslc_modules_area_add(jQuery(b.section).find(".dslc-modules-section-wrapper .dslc-modules-section-inner"));c.remove()}},onUpdate:function(a){var b=a.item;dslc_show_publish_button()},onSort:function(a){},onRemove:function(a){},onFilter:function(a){var b=a.item},onMove:function(a){a.dragged;a.draggedRect;a.related;a.relatedRect;if(jQuery(".dslc-modules-area-empty").find(".dslc-module-front").length>0){jQuery(this).removeClass("dslc-modules-area-empty").addClass("dslc-modules-area-not-empty");jQuery(".dslca-no-content:not(:visible)",this).show().css({"-webkit-animation-name":"dslcBounceIn","-moz-animation-name":"dslcBounceIn","animation-name":"dslcBounceIn","animation-duration":"0.6s","-webkit-animation-duration":"0.6s",padding:0}).animate({padding:"35px 0"},300,function(){})}}});jQuery(a).attr("data-jsinit","initialized");jQuery(document).on("LC.sortableOff",function(){b.sortable&&b.sortable.option&&b.sortable.option("disabled",true)});jQuery(document).on("LC.sortableOn",function(){b.sortable&&b.sortable.option&&b.sortable.option("disabled",false)})};"use strict";jQuery(document).on("editorFrameLoaded",function(){function a(){var a=jQuery(".dslc-modules-area",LiveComposer.Builder.PreviewAreaDocument);jQuery(a).each(function(a,b){new LiveComposer.Builder.Elements.CModuleArea(b)})}var b=function(){if(LiveComposer.Builder.Flags.panelOpened){LiveComposer.Builder.UI.shakePanelConfirmButton();return false}return true};if(!jQuery("#dslc-main .dslc-modules-section",LiveComposer.Builder.PreviewAreaDocument).length&&!jQuery("#dslca-tut-page",LiveComposer.Builder.PreviewAreaDocument).length){dslc_row_add(a())}else{a()}LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-copy-modules-area-hook",function(a){a.preventDefault();if(!b())return false;if(!jQuery(this).hasClass("dslca-action-disabled")){var c=jQuery(this).closest(".dslc-modules-area");dslc_copy_modules_area(c)}});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-delete-modules-area-hook",function(a){a.preventDefault();if(!b())return false;if(!jQuery(this).hasClass("dslca-action-disabled")){var c=jQuery(this).closest(".dslc-modules-area").hasClass("dslc-modules-area-empty");if(!c){var d=jQuery(this);LiveComposer.Builder.UI.CModalWindow({title:DSLCString.str_del_area_title,content:DSLCString.str_del_area_descr,confirm:function(){var a=d.closest(".dslc-modules-area");dslc_modules_area_delete(a)}})}else{var e=jQuery(this).closest(".dslc-modules-area");dslc_delete_modules_area(e)}}});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-change-width-modules-area-options span",function(){if(!b())return false;if(!jQuery(this).hasClass("dslca-action-disabled")){dslc_modules_area_width_set(jQuery(this).closest(".dslc-modules-area"),jQuery(this).data("size"))}});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-change-width-modules-area-hook",function(a){a.preventDefault();if(!b())return false;if(!jQuery(this).hasClass("dslca-action-disabled")){if(jQuery(".dslca-change-width-modules-area-options:visible",this).length){jQuery(".dslca-change-width-modules-area-options",this).hide()}else{jQuery(".dslca-change-width-modules-area-options",this).show()}}});LiveComposer.Builder.PreviewAreaDocument.on("mouseleave",".dslca-change-width-modules-area-options",function(a){jQuery(this).hide()});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-add-modules-area-hook",function(a){a.preventDefault();if(!b())return false;dslc_modules_area_add(jQuery(this).closest(".dslc-modules-section").find(".dslc-modules-section-inner"))})});function dslc_modules_area_add(a){if(dslcDebug)console.log("dslc_add_modules_area");var b='<div class="dslc-modules-area dslc-col dslc-12-col dslc-modules-area-empty " data-size="12">'+'<div class="dslca-modules-area-manage"> <div class="dslca-modules-area-manage-inner">'+'<span class="dslca-manage-action dslca-copy-modules-area-hook" title="Duplicate" ><span class="dslca-icon dslc-icon-copy">'+'</span></span> <span class="dslca-manage-action dslca-move-modules-area-hook" title="Drag to move" >'+'<span class="dslca-icon dslc-icon-move"></span></span>'+'<span class="dslca-manage-action dslca-change-width-modules-area-hook" title="Change width" >'+'<span class="dslca-icon dslc-icon-columns"></span> <div class="dslca-change-width-modules-area-options">'+'<span>Container Width</span><span data-size="1">1/12</span><span data-size="2">2/12</span>'+'<span data-size="3">3/12</span><span data-size="4">4/12</span> <span data-size="5">5/12</span><span data-size="6">6/12</span>'+'<span data-size="7">7/12</span><span data-size="8">8/12</span> <span data-size="9">9/12</span><span data-size="10">10/12</span>'+'<span data-size="11">11/12</span><span data-size="12">12/12</span> </div> </span>'+'<span class="dslca-manage-action dslca-delete-modules-area-hook" title="Delete" ><span class="dslca-icon dslc-icon-remove"></span></span> </div> </div>'+"</div>";jQuery(b).appendTo(a).css({height:0}).animate({height:99},300,function(){jQuery(this).css({height:"auto"})}).addClass("dslca-init-animation");var c=jQuery(".dslc-modules-area-empty",LiveComposer.Builder.PreviewAreaDocument);jQuery(c).each(function(a,b){new LiveComposer.Builder.Elements.CModuleArea(b)});dslc_drag_and_drop();dslc_generate_code();dslc_show_publish_button()}function dslc_modules_area_delete(a){if(dslcDebug)console.log("dslc_delete_modules_area");var b=a.closest(".dslc-modules-section").find(".dslc-modules-section-inner"),c=false;a.addClass("dslca-modules-area-being-deleted");if(b.find(".dslc-modules-area").length<2){c=true}if(a.find(".dslca-module-being-edited").length){jQuery(".dslca-header .dslca-options-filter-hook",LiveComposer.Builder.PreviewAreaDocument).hide();jQuery(".dslca-module-edit-actions",LiveComposer.Builder.PreviewAreaDocument).hide();jQuery(".dslca-header .dslca-go-to-section-hook",LiveComposer.Builder.PreviewAreaDocument).show();dslc_show_section(".dslca-modules")}setTimeout(function(){if(c){var d=a.closest(".dslc-modules-section-inner");if(2<=a.closest("#dslc-main").find(".dslc-modules-section").length){dslc_row_delete(a.closest(".dslc-modules-section"))}else{a.remove();dslc_modules_area_add(b)}}a.remove();dslc_generate_code();dslc_show_publish_button()},900);a.css({"-webkit-animation-name":"dslcBounceOut","-moz-animation-name":"dslcBounceOut","animation-name":"dslcBounceOut","animation-duration":"0.6s","-webkit-animation-duration":"0.6s",overflow:"hidden"}).animate({opacity:0},600).animate({height:0,marginBottom:0},300,function(){a.remove();dslc_generate_code();dslc_show_publish_button()})}function dslc_modules_area_copy(a){if(dslcDebug)console.log("dslc_copy_modules_area");var b,c=a.closest(".dslc-modules-section").find(".dslc-modules-section-inner");var d=a.clone().appendTo(c);new LiveComposer.Builder.Elements.CModuleArea(d[0]);d.find(".dslca-modules-area-manage").trigger("mouseleave");d.data("size",a.data("size")).find(".dslc-module-front").css({"-webkit-animation-name":"none","-moz-animation-name":"none","animation-name":"none","animation-duration":"0","-webkit-animation-duration":"0",opacity:0}).each(function(){var a=jQuery(this);dslc_module_new_id(a[0]);jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-module-being-edited");dslc_generate_code();a.animate({opacity:1},300)});dslc_drag_and_drop();dslc_show_publish_button();dslc_generate_code()}function dslc_modules_area_width_set(a,b){if(dslcDebug)console.log("dslc_modules_area_width_set");var c="dslc-"+b+"-col";a.removeClass("dslc-1-col dslc-2-col dslc-3-col dslc-4-col dslc-5-col dslc-6-col dslc-7-col dslc-8-col dslc-9-col dslc-10-col dslc-11-col dslc-12-col").addClass(c).data("size",b);LiveComposer.Builder.PreviewAreaWindow.dslc_masonry();if(LiveComposer.Builder.Flags.panelOpened){return false}dslc_generate_code();dslc_show_publish_button()}LiveComposer.Builder.moduleareas_init=function(){jQuery("#dslc-main .dslc-modules-area",LiveComposer.Builder.PreviewAreaDocument).each(function(){if(jQuery(this).data("jsinit")!=="initialized"){new LiveComposer.Builder.Elements.CModuleArea(this)}})};function dslc_add_modules_area(a){dslc_modules_area_add(a)}function dslc_delete_modules_area(a){dslc_modules_area_delete(a)}function dslc_copy_modules_area(a){dslc_modules_area_copy(a)}"use strict";function dslc_update_preset(){if(dslcDebug)console.log("dslc_update_preset");var a=jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument),b=a.find('.dslca-module-option-front[data-id="css_load_preset"]').val(),c=a.find(".dslca-module-code").val(),d=a.data("dslc-module-id");if("none"!==b&&""!==b){jQuery.post(DSLCAjax.ajaxurl,{action:"dslc-ajax-save-preset",dslc_preset_name:b,dslc_preset_code:c,dslc_module_id:d},function(b){if(b.preset_setting=="enabled"){jQuery(".dslc-module-front:not(#"+a.attr("id")+')[data-dslc-module-id="'+a.data("dslc-module-id")+'"][data-dslc-preset="'+a.data("dslc-preset")+'"]',LiveComposer.Builder.PreviewAreaDocument).each(function(){dslc_module_output_reload(jQuery(this))})}})}}jQuery(document).ready(function(a){a(document).on("keypress",'.dslca-module-edit-field[name="css_save_preset"]',function(b){if(b.which==13){var c=a(this).val(),d=c.toLowerCase().replace(/\s/g,"-");a("body").addClass("dslca-new-preset-added");a('.dslca-module-edit-field[name="css_load_preset"]').append('<option value="'+d+'">'+d+"</option>").val(d).trigger("change");a(this).val("")}});a(document).on("change",'.dslca-module-edit-field[name="css_load_preset"]',function(b){a(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).addClass("dslca-preload-preset")})});"use strict";LiveComposer.Builder.Elements.CRow=function(a){var b=this;this.elem=a;var c=jQuery(a).find(".dslc-modules-section-wrapper .dslc-modules-section-inner").eq(0)[0];jQuery(a).droppable({drop:function(a,b){var c=jQuery(this).find(".dslc-modules-section-inner");var d=b.draggable.data("id");if(d=="DSLC_M_A"){dslc_modules_area_add(c)}}});this.sortable=jQuery(c).sortable({connectWith:".dslc-modules-section-inner",items:".dslc-modules-area",handle:'.dslca-move-modules-area-hook:not(".dslca-action-disabled")',placeholder:"dslca-modules-area-placeholder",cursorAt:{top:0,left:0},tolerance:"intersect",scroll:true,scrollSensitivity:100,scrollSpeed:15,sort:function(){jQuery(this).removeClass("ui-state-default")},over:function(a,b){var c=b.placeholder.closest(".dslc-modules-section");jQuery(c).removeClass("dslc-modules-section-empty").addClass("dslc-modules-section-not-empty");c.siblings(".dslc-modules-section").each(function(){if(jQuery(".dslc-modules-area:not(.ui-sortable-helper)",jQuery(this)).length){jQuery(this).removeClass("dslc-modules-section-empty").addClass("dslc-modules-section-not-empty")}else{jQuery(this).removeClass("dslc-modules-section-not-empty").addClass("dslc-modules-section-empty")}})},remove:function(){jQuery(b.elem).find(".dslc-modules-area").length==0&&dslc_modules_area_add(jQuery(c))},update:function(a,b){dslc_generate_code();dslc_show_publish_button()},start:function(a,b){b.placeholder.html('<span class="dslca-placeholder-help-text"><span class="dslca-placeholder-help-text-inner">'+DSLCString.str_area_helper_text+"</span></span>");if(!jQuery(b.item).hasClass("dslc-12-col")){b.placeholder.width(b.item.width()-10)}else{b.placeholder.width(b.item.width()).css({margin:0})}jQuery("body").removeClass("dslca-drag-not-in-progress").addClass("dslca-drag-in-progress dslca-modules-area-drag-in-progress");jQuery(".dslc-modules-section-inner").sortable("refreshPositions")},stop:function(a,b){LiveComposer.Builder.UI.stopScroller();jQuery("body").removeClass("dslca-drag-in-progress dslca-modules-area-drag-in-progress").addClass("dslca-drag-not-in-progress");jQuery(".dslca-anim-opacity-drop").removeClass("dslca-anim-opacity-drop")},change:function(a,b){}});jQuery(a).attr("data-jsinit","initialized");jQuery(document).on("LC.sortableOff",function(){if(undefined!==b.sortable.sortable("instance")){b.sortable.sortable("option","disabled",true)}});jQuery(document).on("LC.sortableOn",function(){if(undefined!==b.sortable.sortable("instance")){b.sortable.sortable("option","disabled",false)}})};"use strict";jQuery(document).on("editorFrameLoaded",function(){var a=jQuery;var b=function(){if(LiveComposer.Builder.Flags.panelOpened){LiveComposer.Builder.UI.shakePanelConfirmButton();return false}return true};jQuery(".dslc-modules-section",LiveComposer.Builder.PreviewAreaDocument).each(function(){new LiveComposer.Builder.Elements.CRow(this)});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-delete-modules-section-hook",function(c){if(!b())return false;c.preventDefault();var d=this;if(!a(this).hasClass("dslca-action-disabled")){LiveComposer.Builder.UI.CModalWindow({title:DSLCString.str_del_row_title,content:DSLCString.str_del_row_descr,confirm:function(){dslc_row_delete(a(d).closest(".dslc-modules-section"))}})}});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-import-modules-section-hook",function(a){a.preventDefault();if(!b())return false;if(!jQuery(this).hasClass("dslca-action-disabled")){LiveComposer.Builder.UI.CModalWindow({title:DSLCString.str_import_row_title,content:DSLCString.str_import_row_descr+"<br><br><textarea></textarea>",confirm:function(){dslc_row_import(jQuery(".dslca-prompt-modal textarea").val());jQuery(".dslca-prompt-modal-confirm-hook span").css({opacity:0});jQuery(".dslca-prompt-modal-confirm-hook .dslca-loading").show()},confirm_title:DSLCString.str_import})}});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-export-modules-section-hook",function(c){c.preventDefault();if(!b())return false;if(!a(this).hasClass("dslca-action-disabled")){a(".dslca-prompt-modal-cancel-hook").hide();a(".dslca-prompt-modal-confirm-hook").html('<span class="dslc-icon dslc-icon-ok"></span>'+DSLCString.str_ok);LiveComposer.Builder.UI.CModalWindow({title:DSLCString.str_export_row_title,content:DSLCString.str_export_row_descr+"<br><br><textarea>"+"["+dslc_generate_section_code(a(this).closest(".dslc-modules-section"))+"]"+"</textarea></span>"})}});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-copy-modules-section-hook",function(){if(!b())return false;if(!jQuery(this).hasClass("dslca-action-disabled")){dslc_row_copy(jQuery(this).closest(".dslc-modules-section"))}});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-add-modules-section-hook",function(c){c.preventDefault();if(!b())return false;var d=a(this);if(!a(this).hasClass("dslca-action-disabled")){d.find(".dslca-icon").removeClass("dslc-icon-align-justify").addClass("dslc-icon-spinner dslc-icon-spin");dslc_row_add(function(){d.find(".dslca-icon").removeClass("dslc-icon-spinner dslc-icon-spin").addClass("dslc-icon-align-justify")})}});LiveComposer.Builder.PreviewAreaDocument.on("click",".dslca-edit-modules-section-hook",function(){if(!b())return false;var c=this;var d=jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).length;var e=jQuery(".dslca-modules-section-being-edited",LiveComposer.Builder.PreviewAreaDocument).length;if(a("body").hasClass("dslca-composer-hidden")||d>0||e>0)return false;if(!a(this).hasClass("dslca-action-disabled")){dslc_row_edit(a(this).closest(".dslc-modules-section"))}jQuery("body",LiveComposer.Builder.PreviewAreaDocument).addClass("section-editing-in-progress")})});function dslc_row_add(a){if(dslcDebug)console.log("dslc_row_add");a=typeof a!=="undefined"?a:false;var b=jQuery.Deferred();var c=sessionStorage;var d=jQuery();var e=c.getItem("cache-dslc-ajax-add-modules-section");if(null===e){jQuery.post(DSLCAjax.ajaxurl,{action:"dslc-ajax-add-modules-section",dslc:"active"},function(e){c.setItem("cache-dslc-ajax-add-modules-section",e.output);d=dslc_row_after_add(e.output);if(a){a()}return b})}else{d=dslc_row_after_add(e);if(a){a()}return b}}function dslc_row_after_add(a){var b=jQuery(a);b.appendTo(LiveComposer.Builder.PreviewAreaDocument.find("#dslc-main"));dslc_drag_and_drop();dslc_generate_code();dslc_show_publish_button();new LiveComposer.Builder.Elements.CRow(b);new LiveComposer.Builder.Elements.CModuleArea(b.find(".dslc-modules-area").eq(0)[0]);b.find(".dslc-modules-area").addClass("dslc-modules-area-empty dslc-last-col");return b}function dslc_row_delete(a){if(dslcDebug)console.log("dslc_row_delete");if(a.find(".dslca-module-being-edited")){jQuery(".dslca-header .dslca-options-filter-hook").hide();jQuery(".dslca-module-edit-actions").hide();jQuery(".dslca-header .dslca-go-to-section-hook").show();dslc_show_section(".dslca-modules")}a.trigger("mouseleave").remove();dslc_generate_code();dslc_show_publish_button()}function dslc_row_edit(a){if(dslcDebug)console.log("dslc_row_edit");var b,c;jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-module-being-edited");jQuery(".dslca-modules-section-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-modules-section-being-edited").removeClass("dslca-modules-section-change-made");a.addClass("dslca-modules-section-being-edited");jQuery(".dslca-header .dslca-go-to-section-hook").hide();jQuery('.dslca-row-options-filter-hook[data-section="styling"], .dslca-row-options-filter-hook[data-section="responsive"]').show();jQuery('.dslca-row-options-filter-hook[data-section="styling"]').trigger("click");jQuery(".dslca-header .dslca-options-filter-hook").hide();jQuery(".dslca-module-edit-actions").hide();jQuery(".dslca-row-edit-actions").show();jQuery(".dslca-modules-section-edit-field").each(function(){if("type"===jQuery(this).data("id")){if(""===jQuery('.dslca-modules-section-being-edited .dslca-modules-section-settings input[data-id="type"]',LiveComposer.Builder.PreviewAreaDocument).val()||"wrapped"===jQuery('.dslca-modules-section-being-edited .dslca-modules-section-settings input[data-id="type"]',LiveComposer.Builder.PreviewAreaDocument).val()){jQuery('select[data-id="type"]').val("wrapper").change()}}if(jQuery(this).data("id")=="border-top"){if(jQuery('.dslca-modules-section-being-edited .dslca-modules-section-settings input[data-id="border"]',LiveComposer.Builder.PreviewAreaDocument).val().indexOf("top")>=0){jQuery(this).prop("checked",true);jQuery(this).siblings(".dslca-modules-section-edit-option-checkbox-hook").find(".dslca-icon").removeClass("dslc-icon-check-empty").addClass("dslc-icon-check")}else{jQuery(this).prop("checked",false);jQuery(this).siblings(".dslca-modules-section-edit-option-checkbox-hook").find(".dslca-icon").removeClass("dslc-icon-check").addClass("dslc-icon-check-empty")}}else if(jQuery(this).data("id")=="border-right"){if(jQuery('.dslca-modules-section-being-edited .dslca-modules-section-settings input[data-id="border"]',LiveComposer.Builder.PreviewAreaDocument).val().indexOf("right")>=0){jQuery(this).prop("checked",true);jQuery(this).siblings(".dslca-modules-section-edit-option-checkbox-hook").find(".dslca-icon").removeClass("dslc-icon-check-empty").addClass("dslc-icon-check")}else{jQuery(this).prop("checked",false);jQuery(this).siblings(".dslca-modules-section-edit-option-checkbox-hook").find(".dslca-icon").removeClass("dslc-icon-check").addClass("dslc-icon-check-empty")}}else if(jQuery(this).data("id")=="border-bottom"){if(jQuery('.dslca-modules-section-being-edited .dslca-modules-section-settings input[data-id="border"]',LiveComposer.Builder.PreviewAreaDocument).val().indexOf("bottom")>=0){jQuery(this).prop("checked",true);jQuery(this).siblings(".dslca-modules-section-edit-option-checkbox-hook").find(".dslca-icon").removeClass("dslc-icon-check-empty").addClass("dslc-icon-check")}else{jQuery(this).prop("checked",false);jQuery(this).siblings(".dslca-modules-section-edit-option-checkbox-hook").find(".dslca-icon").removeClass("dslc-icon-check").addClass("dslc-icon-check-empty")}}else if(jQuery(this).data("id")=="border-left"){if(jQuery('.dslca-modules-section-being-edited .dslca-modules-section-settings input[data-id="border"]',LiveComposer.Builder.PreviewAreaDocument).val().indexOf("left")>=0){jQuery(this).prop("checked",true);jQuery(this).siblings(".dslca-modules-section-edit-option-checkbox-hook").find(".dslca-icon").removeClass("dslc-icon-check-empty").addClass("dslc-icon-check")}else{jQuery(this).prop("checked",false);jQuery(this).siblings(".dslca-modules-section-edit-option-checkbox-hook").find(".dslca-icon").removeClass("dslc-icon-check").addClass("dslc-icon-check-empty")}}else if(jQuery(this).hasClass("dslca-modules-section-edit-field-checkbox")){if(jQuery('.dslca-modules-section-being-edited .dslca-modules-section-settings input[data-id="'+jQuery(this).data("id")+'"]',LiveComposer.Builder.PreviewAreaDocument).val().indexOf(jQuery(this).data("val"))>=0){jQuery(this).prop("checked",true);jQuery(this).siblings(".dslca-modules-section-edit-option-checkbox-hook").find(".dslca-icon").removeClass("dslc-icon-check-empty").addClass("dslc-icon-check")}else{jQuery(this).prop("checked",false);jQuery(this).siblings(".dslca-modules-section-edit-option-checkbox-hook").find(".dslca-icon").removeClass("dslc-icon-check").addClass("dslc-icon-check-empty")}}else{jQuery(this).val(jQuery('.dslca-modules-section-being-edited .dslca-modules-section-settings input[data-id="'+jQuery(this).data("id")+'"]',LiveComposer.Builder.PreviewAreaDocument).val());if(jQuery(this).hasClass("dslca-modules-section-edit-field-colorpicker")){var a=jQuery(this);jQuery(this).closest(".dslca-modules-section-edit-option").find(".sp-preview-inner").removeClass("sp-clear-display").css({"background-color":a.val()});jQuery(this).css({"background-color":a.val()})}}});jQuery(".dslca-modules-section-edit-field-upload").each(function(){var a=jQuery(this).closest(".dslca-modules-section-edit-option");if(jQuery(this).val()&&jQuery(this).val()!=="disabled"){jQuery(".dslca-modules-section-edit-field-image-add-hook",a).hide();jQuery(".dslca-modules-section-edit-field-image-remove-hook",a).show()}else{jQuery(".dslca-modules-section-edit-field-image-remove-hook",a).hide();jQuery(".dslca-modules-section-edit-field-image-add-hook",a).show()}});dslc_show_section(".dslca-modules-section-edit");LiveComposer.Builder.Flags.panelOpened=true;dslc_hide_publish_button()}function dslc_row_edit_cancel(a){if(dslcDebug)console.log("dslc_row_cancel_changes");a=typeof a!=="undefined"?a:false;LiveComposer.Builder.Flags.generate_code_after_row_changed=false;jQuery(".dslca-modules-section-being-edited .dslca-modules-section-settings input",LiveComposer.Builder.PreviewAreaDocument).each(function(){jQuery(this).val(jQuery(this).data("def"));jQuery('.dslca-modules-section-edit-field[data-id="'+jQuery(this).data("id")+'"]').val(jQuery(this).data("def")).trigger("change")});LiveComposer.Builder.Flags.generate_code_after_row_changed=true;dslc_generate_code();dslc_show_publish_button();dslc_show_section(".dslca-modules");jQuery(".dslca-row-edit-actions").hide();jQuery(".dslca-row-options-filter-hook").hide();jQuery(".dslca-header .dslca-go-to-section-hook").show();dslc_show_publish_button;jQuery(".dslca-modules-section-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-modules-section-being-edited dslca-modules-section-change-made");if(a){a()}LiveComposer.Builder.Flags.panelOpened=false;jQuery("body",LiveComposer.Builder.PreviewAreaDocument).removeClass("section-editing-in-progress")}function dslc_row_edit_confirm(a){if(dslcDebug)console.log("dslc_confirm_row_changes");a=typeof a!=="undefined"?a:false;jQuery(".dslca-modules-section-being-edited .dslca-modules-section-settings input",LiveComposer.Builder.PreviewAreaDocument).each(function(){jQuery(this).data("def",jQuery(this).val())});dslc_show_section(".dslca-modules");jQuery(".dslca-row-edit-actions").hide();jQuery(".dslca-row-options-filter-hook").hide();jQuery(".dslca-header .dslca-go-to-section-hook").show();jQuery(".dslca-modules-section-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-modules-section-being-edited dslca-modules-section-change-made");dslc_generate_code();dslc_show_publish_button();if(a){a()}LiveComposer.Builder.Flags.panelOpened=false;jQuery("body",LiveComposer.Builder.PreviewAreaDocument).removeClass("section-editing-in-progress")}function dslc_row_copy(a){if(dslcDebug)console.log("dslc_row_copy");var b,c,d;c=a.clone().appendTo(jQuery("#dslc-main",LiveComposer.Builder.PreviewAreaDocument));c[0].removeAttribute("data-jsinit");c.find(".dslc-modules-area").each(function(){var b=jQuery(this).index();jQuery(this).data("size",a.find(".dslc-modules-area:eq( "+b+" )").data("size"));this.removeAttribute("data-jsinit")});new LiveComposer.Builder.Elements.CRow(c);c.find(".dslc-module-front").css({"-webkit-animation-name":"none","-moz-animation-name":"none","animation-name":"none","animation-duration":"0","-webkit-animation-duration":"0",opacity:0}).each(function(){var a=jQuery(this);dslc_module_new_id(a[0]);LiveComposer.Builder.rows_init();LiveComposer.Builder.moduleareas_init();dslc_generate_code();dslc_drag_and_drop();jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-module-being-edited");a.animate({opacity:1},300);dslc_show_publish_button()});dslc_section_new_id(c[0])}function dslc_section_new_id(a){if(dslcDebug)console.log("dslc_section_new_id");var b=LiveComposer.Utils.get_unique_id();a.setAttribute("data-section-id",b);LiveComposer.Utils.update_section_property_raw(a,"section_instance_id",b)}function dslc_row_import(a){if(dslcDebug)console.log("dslc_row_import");jQuery.post(DSLCAjax.ajaxurl,{action:"dslc-ajax-import-modules-section",dslc:"active",dslc_modules_section_code:a},function(a){dslc_js_confirm_close();jQuery("#dslc-main",LiveComposer.Builder.PreviewAreaDocument).append(a.output);LiveComposer.Builder.PreviewAreaWindow.dslc_bg_video();LiveComposer.Builder.PreviewAreaWindow.dslc_carousel();LiveComposer.Builder.PreviewAreaWindow.dslc_masonry();LiveComposer.Builder.rows_init();LiveComposer.Builder.moduleareas_init();dslc_drag_and_drop();dslc_generate_code();dslc_show_publish_button()})}function dslc_add_modules_section(){dslc_row_add()}function dslc_delete_modules_section(a){dslc_row_delete(a)}function dslc_edit_modules_section(a){dslc_row_edit(a)}function dslc_copy_modules_section(a){dslc_row_copy(a)}function dslc_import_modules_section(a){dslc_row_import(a)}jQuery(document).ready(function(a){a(document).on("click",".dslca-row-edit-save",function(){dslc_row_edit_confirm();a(".dslca-currently-editing").removeAttr("style");a(".dslca-row-options-filter-hook.dslca-active").removeClass("dslca-active");LiveComposer.Builder.PreviewAreaWindow.dslc_responsive_classes(true)});a(document).on("click",".dslca-row-edit-cancel",function(){dslc_row_edit_cancel();a(".dslca-currently-editing").removeAttr("style");a(".dslca-row-options-filter-hook.dslca-active").removeClass("dslca-active");LiveComposer.Builder.PreviewAreaWindow.dslc_responsive_classes(true)})});LiveComposer.Builder.rows_init=function(){jQuery("#dslc-main .dslc-modules-section",LiveComposer.Builder.PreviewAreaDocument).each(function(){if(jQuery(this).data("jsinit")!=="initialized"){new LiveComposer.Builder.Elements.CRow(this)}})};jQuery(document).ready(function(a){var b=function(a){var b=.75;var c=500;var d=100;var e=jQuery(".dslca-section-scroller",a);var f=jQuery(".dslca-section-scroller-inner",a)[0];e.on("wheel",function(a){g(a.originalEvent.deltaY||a.originalEvent.deltaX);return false});function g(a){if(a<0){a=-d}else{a=d}a=a*b;var c=e.find(".dslca-section-scroller-content").width();var g=e.width();if(c<=g)return false;var h=c-g+10;a=parseInt(f.style.left||0)-a;a=a>=0?0:a;a=a<=-h?-h:a;f.style.left=a+"px"}jQuery(".dslca-section-scroller-prev",a).click(function(a){a.preventDefault();g(-c)});jQuery(".dslca-section-scroller-next",a).click(function(a){a.preventDefault();g(c)});jQuery(window).load(function(){jQuery(window).resize(function(){g(0)})})};b(jQuery(".dslca-section.dslca-modules"));b(jQuery(".dslca-section.dslca-templates-load"))});jQuery(document).ready(function(a){LiveComposer.Builder.UI.initPreviewAreaScroller=function(){var a=5;var b=6;LiveComposer.Builder.Flags.windowScroller=false;jQuery(LiveComposer.Builder.PreviewAreaDocument).on("dragleave",".lc-scroll-top-area, .lc-scroll-bottom-area",function(a){LiveComposer.Builder.UI.stopScroller()});jQuery(LiveComposer.Builder.PreviewAreaDocument).on("dragenter dragover",".lc-scroll-bottom-area",function(c){if(LiveComposer.Builder.Flags.windowScroller!==false)return false;LiveComposer.Utils.publish("LC.sortableOff",{});LiveComposer.Builder.Flags.windowScroller=setInterval(function(){LiveComposer.Builder.PreviewAreaWindow.scrollBy(0,a)},b)});jQuery(LiveComposer.Builder.PreviewAreaDocument).on("dragenter",".lc-scroll-top-area",function(c){if(LiveComposer.Builder.Flags.windowScroller!==false)return false;LiveComposer.Utils.publish("LC.sortableOff",{});LiveComposer.Builder.Flags.windowScroller=setInterval(function(){LiveComposer.Builder.PreviewAreaWindow.scrollBy(0,-a)},b)});jQuery(LiveComposer.Builder.PreviewAreaDocument).on("dragend mouseup","body",function(a){LiveComposer.Builder.Flags.windowScroller&&LiveComposer.Builder.UI.stopScroller()})};LiveComposer.Builder.UI.stopScroller=function(){LiveComposer.Utils.publish("LC.sortableOn",{});clearInterval(LiveComposer.Builder.Flags.windowScroller);LiveComposer.Builder.Flags.windowScroller=false};jQuery("#scroller-stopper").on("dragover",function(){LiveComposer.Builder.UI.stopScroller()})});"use strict";LiveComposer.Builder.Elements.CSectionsContainer=function(a){var b=this;this.sortable=jQuery(a).sortable({items:".dslc-modules-section",handle:'.dslca-move-modules-section-hook:not(".dslca-action-disabled")',placeholder:"dslca-modules-section-placeholder",tolerance:"intersect",cursorAt:{bottom:10},axis:"y",scroll:true,scrollSensitivity:140,scrollSpeed:5,sort:function(){jQuery(this).removeClass("ui-state-default")},update:function(a,b){dslc_show_publish_button()},start:function(a,b){jQuery("body").removeClass("dslca-drag-not-in-progress").addClass("dslca-drag-in-progress");jQuery("body",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-drag-not-in-progress").addClass("dslca-drag-in-progress");b.placeholder.html('<span class="dslca-placeholder-help-text"><span class="dslca-placeholder-help-text-inner">'+DSLCString.str_row_helper_text+"</span></span>");jQuery(".dslc-content").sortable("refreshPositions")},stop:function(a,b){dslc_generate_code();LiveComposer.Builder.UI.stopScroller();jQuery("body",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-drag-in-progress").addClass("dslca-drag-not-in-progress");jQuery("body").removeClass("dslca-drag-in-progress").addClass("dslca-drag-not-in-progress");jQuery(".dslca-anim-opacity-drop").removeClass("dslca-anim-opacity-drop")}});jQuery(document).on("LC.sortableOff",function(){if(undefined!==b.sortable.sortable("instance")){b.sortable.sortable("option","disabled",true)}});jQuery(document).on("LC.sortableOn",function(){if(undefined!==b.sortable.sortable("instance")){b.sortable.sortable("option","disabled",false)}})};"use strict";jQuery(document).ready(function(a){dslc_module_options_tooltip();dslc_module_options_font();dslc_module_options_icon();dslc_module_options_icon_returnid();dslc_module_options_text_align();dslc_module_options_checkbox();dslc_module_options_box_shadow();dslc_module_options_text_shadow();var b="";b+=".dslca-module-edit-field-colorpicker";
3
+ b+=", .dslca-modules-section-edit-field-colorpicker";b+=", .dslca-module-edit-option-box-shadow-color";b+=", .dslca-module-edit-option-text-shadow-color";jQuery(document).on("click",b,function(){dslc_module_options_color(this);var a=jQuery(this).closest(".dslca-color-option");var b=jQuery(".dslca-module-edit-options-inner");var c=a.find(".wp-picker-holder");var d=a.offset();var e=d.left+15;var f=window.innerWidth;var g=260;if(f<e+g){e=f-g}c.css("left",e+"px");jQuery(b).on("scroll",function(b){d=a.offset();var e=d.left+15;var f=window.innerWidth;var g=260;if(f<e+g){e=f-g}c.css("left",e+"px")})});jQuery(".dslca-container").on("mouseenter",".dslca-module-edit-option-slider",function(){dslc_module_options_numeric(this)});jQuery(".dslca-container").on("mouseenter",".dslca-modules-section-edit-option-slider",function(){dslc_module_options_numeric(this)});jQuery(".dslca-module-edit-form").submit(function(a){a.preventDefault();dslc_module_output_altered()});a(document).on("click",".dslca-module-edit-options-tab-hook",function(b){b.preventDefault();dslc_module_options_tab_filter(a(this))});a(document).on("click",".dslca-options-filter-hook",function(b){b.preventDefault();var c=jQuery(".dslca-options-filter-hook.dslca-active").data("section");var d=jQuery(this).data("section");a(".dslca-options-filter-hook.dslca-active").removeClass("dslca-active");a(this).addClass("dslca-active");dslc_module_options_section_filter(d);if(c=="responsive"){jQuery(".dslca-container-loader").show();LiveComposer.Builder.PreviewAreaWindow.dslc_responsive_classes();dslc_module_output_altered(function(){jQuery(".dslca-container-loader").hide()});jQuery("#page-builder-preview-area").resizable("destroy").attr("style","")}if(d=="responsive"){jQuery("#page-builder-preview-area").resizable()}});jQuery(document).on("click",".dslca-module-edit-save",function(a){a.preventDefault();dslc_module_options_confirm_changes(function(){LiveComposer.Builder.UI.initInlineEditors({withRemove:true});LiveComposer.Builder.UI.unloadOptionsDeps();LiveComposer.Builder.Flags.panelOpened=false;jQuery("body",LiveComposer.Builder.PreviewAreaDocument).removeClass("module-editing-in-progress")});jQuery(".dslca-options-filter-hook.dslca-active").removeClass("dslca-active");dslc_disable_responsive_view()});jQuery(document).on("click",".dslca-module-edit-cancel",function(a){a.preventDefault();dslc_module_options_cancel_changes(function(){LiveComposer.Builder.UI.initInlineEditors({withRemove:true});LiveComposer.Builder.UI.unloadOptionsDeps();LiveComposer.Builder.Flags.panelOpened=false;jQuery("body",LiveComposer.Builder.PreviewAreaDocument).removeClass("module-editing-in-progress")});jQuery(".dslca-options-filter-hook.dslca-active").removeClass("dslca-active");dslc_disable_responsive_view()})});(function(){var a=jQuery;var b=LiveComposer.Builder;LiveComposer.Builder.Helpers.colorpickers=[];LiveComposer.Builder.UI.initInlineEditors=function(a){a=a||{};if(a.withRemove==true){try{LiveComposer.Builder.PreviewAreaWindow.tinyMCE.remove()}catch(b){console.info("No tinyMCE code found. Error code: 10181116.")}}LiveComposer.Builder.PreviewAreaWindow.tinyMCE.init({selector:".inline-editor.dslca-editable-content",editor_deselector:"mce-content-body",menubar:false,inline:true,plugins:"wordpress wplink lists paste",paste_as_text:true,paste_block_drop:true,style_formats:[{title:"Paragraph",format:"p"},{title:"Header 1",format:"h1"},{title:"Header 2",format:"h2"},{title:"Header 3",format:"h3"},{title:"Header 4",format:"h4"},{title:"Header 5",format:"h5"},{title:"Header 6",format:"h6"}],toolbar:"styleselect | bold italic blockquote | removeformat | bullist numlist "})};LiveComposer.Builder.UI.clearUtils=function(){if(dslcDebug)console.log("LiveComposer.Builder.UI.clearUtils");LiveComposer.Builder.UI.clearColorPickers();if(undefined!==LiveComposer.Builder.moduleBackup){LiveComposer.Builder.moduleBackup.remove()}jQuery(".temp-styles-for-module",LiveComposer.Builder.PreviewAreaDocument).remove();jQuery(".mce-tinymce",LiveComposer.Builder.PreviewAreaDocument).hide()};LiveComposer.Builder.UI.clearColorPickers=function(){if(Array.isArray(b.Helpers.colorpickers)){b.Helpers.colorpickers.forEach(function(a){if(!jQuery(a).hasClass("dslca-modules-section-edit-field")){jQuery(a).remove()}});b.Helpers.colorpickers=[]}jQuery("body").off("click.wpcolorpicker")};LiveComposer.Builder.Helpers.depsHandlers=[];LiveComposer.Builder.UI.loadOptionsDeps=function(){var b=this;a(".dslca-module-edit-option").each(function(){var b=this;var c=true;try{var d=JSON.parse(LiveComposer.Utils.b64_to_utf8(a(this).data("dep")))}catch(e){c=false}if(c){var f=function(){var b=this;var c={};if((b.type=="radio"||b.type=="checkbox")&&d[b.value]==undefined){return false}if(b.type=="checkbox"&&d[b.value]!=undefined){c[b.value]=d[b.value]}else{c=d}Object.keys(c).forEach(function(d){c[d].split(",").forEach(function(c){var e=a(".dslca-module-edit-option-"+c.trim()).closest(".dslca-module-edit-option");var f=true;if(b.type=="radio"||b.type=="checkbox"){f=a(b).is(":checked")}if(b.value==d&&f){e.show()}else{e.hide()}})})};a(document).on("change dslc-init-deps",'.dslca-module-edit-option *[data-id="'+a(this).data("id")+'"]',f);LiveComposer.Builder.Helpers.depsHandlers.push(f)}});a(".dslca-module-edit-option input, .dslca-module-edit-option select").trigger("dslc-init-deps")};LiveComposer.Builder.UI.unloadOptionsDeps=function(){LiveComposer.Builder.Helpers.depsHandlers.forEach(function(b){a(document).unbind("change",b);a(document).unbind("dslc-init-deps",b)});LiveComposer.Builder.Helpers.depsHandlers=[]};LiveComposer.Builder.Helpers.processInlineStyleTag=function(a){if(typeof a!="object")return false;var b="",c="";if(a.context.closest(".dslca-module-edit-option").data("tab")=="tablet_responsive"){b="@media only screen and (max-width: 1024px) and (min-width: 768px) {";c="}"}else if(a.context.closest(".dslca-module-edit-option").data("tab")=="phone_responsive"){b="@media only screen and (max-width: 767px) {";c="}"}a.styleContent=b+a.styleContent+c;var d=b+a.rule+a.elems;d=d.replace(/ /gi,"");if(LiveComposer.Builder.PreviewAreaDocument[0].getElementById(d)==null){var e=document.createElement("style");e.innerHTML=a.styleContent;e.id=d;e.className="temp-styles-for-module";LiveComposer.Builder.PreviewAreaDocument[0].body.appendChild(e)}else{LiveComposer.Builder.PreviewAreaDocument[0].getElementById(d).innerHTML=a.styleContent}};LiveComposer.Builder.UI.shakePanelConfirmButton=function(){jQuery(".dslca-module-edit-save").addClass("lc-shake-effect active");setTimeout(function(){jQuery(".dslca-module-edit-save").removeClass("lc-shake-effect active")},1e3)}})();function dslc_module_options_section_filter(a){if(dslcDebug)console.log("dslc_module_options_section_filter");jQuery(".dslca-module-edit-option").hide();jQuery('.dslca-module-edit-option[data-section="'+a+'"]').show();dslc_module_options_tab_filter()}function dslc_module_options_tab_filter(a){if(dslcDebug)console.log("dslc_module_options_tab_filter");var b=jQuery(".dslca-options-filter-hook.dslca-active").data("section");a=typeof a!=="undefined"?a:jQuery('.dslca-module-edit-options-tab-hook[data-section="'+b+'"]:first');var c=a.data("id");jQuery(".dslca-module-edit-options-tab-hook").removeClass("dslca-active");a.addClass("dslca-active");jQuery(".dslca-module-edit-options-tabs").show();jQuery(".dslca-module-edit-options-tab-hook").hide();jQuery('.dslca-module-edit-options-tab-hook[data-section="'+b+'"]').show();if(c){jQuery(".dslca-module-edit-option").hide();jQuery('.dslca-module-edit-option[data-tab="'+c+'"]').show();dslc_module_options_hideshow_tabs();if(jQuery(".dslca-module-edit-options-tab-hook:visible").length<2){jQuery(".dslca-module-edit-options-tabs").hide()}else{jQuery(".dslca-module-edit-options-tabs").show()}dslc_disable_responsive_view();if(c==DSLCString.str_res_tablet.toLowerCase()+"_responsive"){jQuery("body").removeClass("dslc-res-big dslc-res-smaller-monitor dslc-res-phone dslc-res-tablet");jQuery("body").addClass("dslc-res-tablet");jQuery("html").addClass("dslc-responsive-preview")}if(c==DSLCString.str_res_phone.toLowerCase()+"_responsive"){jQuery("body").removeClass("dslc-res-big dslc-res-smaller-monitor dslc-res-phone dslc-res-tablet");jQuery("body").addClass("dslc-res-phone");jQuery("html").addClass("dslc-responsive-preview")}if(c==DSLCString.str_res_tablet.toLowerCase()+"_responsive"||c==DSLCString.str_res_phone.toLowerCase()+"_responsive"){jQuery(".dslca-container-loader").show();dslc_module_output_altered(function(){jQuery(".dslca-container-loader").hide()})}}}function dslc_module_options_hideshow_tabs(){if(dslcDebug)console.log("dslc_module_options_hideshow_tabs");var a=jQuery(".dslca-options-filter-hook.dslca-active").data("section");if(a=="styling"){var b=jQuery(".dslca-module-edit"),c=true,d=true,e=true,f=true,g=true,h=true,i=true,j=true,k=true,l=true,m=true,n=true,o=true,p=true,q=true,r=true,s=true,t=true,u=true,v=true,w=true,x=true,y=true,z=true,A=true,B=true;if(!jQuery('.dslca-module-edit-field[value="main_heading"]').is(":checked"))c=false;if(!jQuery('.dslca-module-edit-field[value="filters"]').is(":checked"))d=false;if(!jQuery('.dslca-module-edit-field[value="arrows"]').is(":checked"))e=false;if(!jQuery('.dslca-module-edit-field[value="circles"]').is(":checked"))f=false;if(jQuery('.dslca-module-edit-field[data-id="type"]').val()!="carousel"){e=false;f=false}if(jQuery('.dslca-module-edit-field[data-id="pagination_type"]').val()=="disabled"){g=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="thumbnail"]').is(":checked")){h=false}if(jQuery('.dslca-module-edit-field[data-id*="elements"][value="content"]').length&&!jQuery('.dslca-module-edit-field[data-id*="elements"][value="title"]').is(":checked")){i=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="excerpt"]').is(":checked")){j=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="meta"]').is(":checked")){k=false}if(jQuery('.dslca-module-edit-field[data-id*="elements"][value="button"]').length&&!jQuery('.dslca-module-edit-field[data-id*="elements"][value="button"]').is(":checked")){l=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="categories"]').is(":checked")){m=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="separator"]').is(":checked")){o=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="count"]').is(":checked")){n=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="tags"]').is(":checked")){p=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="social"]').is(":checked")){q=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="position"]').is(":checked")){r=false}if(jQuery('.dslca-module-edit-field[data-id*="elements"][value="icon"]').length&&!jQuery('.dslca-module-edit-field[data-id*="elements"][value="icon"]').is(":checked")){s=false}if(jQuery('.dslca-module-edit-field[data-id*="elements"][value="content"]').length&&!jQuery('.dslca-module-edit-field[data-id*="elements"][value="content"]').is(":checked")){t=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="price"]').is(":checked")){u=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="price_2"]').is(":checked")){v=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="addtocart"]').is(":checked")){w=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="details"]').is(":checked")){x=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="quote"]').is(":checked")){y=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="author_name"]').is(":checked")){z=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="author_position"]').is(":checked")){A=false}if(!jQuery('.dslca-module-edit-field[data-id*="elements"][value="image"]').is(":checked")){B=false}if(c)jQuery('.dslca-module-edit-options-tab-hook[data-id="heading_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="heading_styling"]').hide();if(d)jQuery('.dslca-module-edit-options-tab-hook[data-id="filters_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="filters_styling"]').hide();if(e)jQuery('.dslca-module-edit-options-tab-hook[data-id="carousel_arrows_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="carousel_arrows_styling"]').hide();if(f)jQuery('.dslca-module-edit-options-tab-hook[data-id="carousel_circles_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="carousel_circles_styling"]').hide();if(g)jQuery('.dslca-module-edit-options-tab-hook[data-id="pagination_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="pagination_styling"]').hide();if(h)jQuery('.dslca-module-edit-options-tab-hook[data-id="thumbnail_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="thumbnail_styling"]').hide();if(i)jQuery('.dslca-module-edit-options-tab-hook[data-id="title_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="title_styling"]').hide();if(j)jQuery('.dslca-module-edit-options-tab-hook[data-id="excerpt_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="excerpt_styling"]').hide();if(k)jQuery('.dslca-module-edit-options-tab-hook[data-id="meta_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="meta_styling"]').hide();if(l)jQuery('.dslca-module-edit-options-tab-hook[data-id="button_styling"], .dslca-module-edit-options-tab-hook[data-id="primary_button_styling"],'+' .dslca-module-edit-options-tab-hook[data-id="secondary_button_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="button_styling"], .dslca-module-edit-options-tab-hook[data-id="primary_button_styling"],'+' .dslca-module-edit-options-tab-hook[data-id="secondary_button_styling"]').hide();if(m)jQuery('.dslca-module-edit-options-tab-hook[data-id="categories_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="categories_styling"]').hide();if(o)jQuery('.dslca-module-edit-options-tab-hook[data-id="separator_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="separator_styling"]').hide();if(n)jQuery('.dslca-module-edit-options-tab-hook[data-id="count_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="count_styling"]').hide();if(p)jQuery('.dslca-module-edit-options-tab-hook[data-id="tags_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="tags_styling"]').hide();if(r)jQuery('.dslca-module-edit-options-tab-hook[data-id="position_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="position_styling"]').hide();if(q)jQuery('.dslca-module-edit-options-tab-hook[data-id="social_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="social_styling"]').hide();if(s)jQuery('.dslca-module-edit-options-tab-hook[data-id="icon_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="icon_styling"]').hide();if(t)jQuery('.dslca-module-edit-options-tab-hook[data-id="content_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="content_styling"]').hide();if(u)jQuery('.dslca-module-edit-options-tab-hook[data-id="price_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="price_styling"]').hide();if(v)jQuery('.dslca-module-edit-options-tab-hook[data-id="price_secondary_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="price_secondary_styling"]').hide();if(w||x)jQuery('.dslca-module-edit-options-tab-hook[data-id="other_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="other_styling"]').hide();if(y)jQuery('.dslca-module-edit-options-tab-hook[data-id="quote_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="quote_styling"]').hide();if(z)jQuery('.dslca-module-edit-options-tab-hook[data-id="author_name_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="author_name_styling"]').hide();if(A)jQuery('.dslca-module-edit-options-tab-hook[data-id="author_position_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="author_position_styling"]').hide();if(B)jQuery('.dslca-module-edit-options-tab-hook[data-id="image_styling"]').show();else jQuery('.dslca-module-edit-options-tab-hook[data-id="image_styling"]').hide()}if(jQuery('.dslca-options-filter-hook[data-section="styling"]').hasClass("dslca-active")){if(jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).data("dslc-module-id")=="DSLC_Text_Simple"||jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).data("dslc-module-id")=="DSLC_TP_Content"||jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).data("dslc-module-id")=="DSLC_Html"||jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).data("dslc-module-id")=="DSLC_Shortcode"){var C=jQuery('.dslca-module-edit-option[data-id="css_custom"]'),D=C.find("select").val();if(D=="enabled"){jQuery('.dslca-module-edit-option[data-section="styling"]').css({visibility:"visible"});jQuery(".dslca-module-edit-option[data-tab]").css("visibility","visible");jQuery(".dslca-module-edit-options-tabs").show()}else{jQuery('.dslca-module-edit-option[data-section="styling"]').css({visibility:"hidden"});jQuery(".dslca-module-control-group.dslca-module-edit-option").css("visibility","hidden");jQuery(".dslca-module-edit-options-tabs").hide();C.css({visibility:"visible"})}}}else{jQuery(".dslca-module-edit-options-tabs").show()}if(jQuery('select.dslca-module-edit-field[data-id="css_res_t"]').val()=="disabled"){jQuery('.dslca-module-edit-option[data-id*="css_res_t"]').css("visibility","hidden");jQuery('.dslca-module-edit-option[data-tab="tablet_responsive"]').css("visibility","hidden")}else{jQuery('.dslca-module-edit-option[data-id*="css_res_t"]').css("visibility","visible");jQuery('.dslca-module-edit-option[data-tab="tablet_responsive"]').css("visibility","visible")}if(jQuery('select.dslca-module-edit-field[data-id="css_res_p"]').val()=="disabled"){jQuery('.dslca-module-edit-option[data-id*="css_res_p"]').css("visibility","hidden");jQuery('.dslca-module-edit-option[data-tab="phone_responsive"]').css("visibility","hidden")}else{jQuery('.dslca-module-edit-option[data-id*="css_res_p"]').css("visibility","visible");jQuery('.dslca-module-edit-option[data-tab="phone_responsive"]').css("visibility","visible")}jQuery('.dslca-module-edit-option[data-id="css_res_p"], .dslca-module-edit-option[data-id="css_res_t"]').css("visibility","visible")}function dslc_module_options_confirm_changes(a){if(dslcDebug)console.log("dslc_module_options_confirm_changes");a=typeof a!=="undefined"?a:false;if(jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).hasClass("dslc-module-DSLC_Sliders")){jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-module-being-edited")}else{jQuery("body").addClass("dslca-module-saving-in-progress");dslc_module_output_altered(function(){dslc_update_preset();dslc_generate_code();jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-module-being-edited");jQuery("body").removeClass("dslca-module-saving-in-progress");jQuery(".dslca-module-edit-options-inner").html("");jQuery(".dslca-module-edit-options-tabs").html("");LiveComposer.Builder.UI.clearUtils();if(a){a()}})}dslc_show_section(".dslca-modules");jQuery(".dslca-header .dslca-options-filter-hook").hide();jQuery(".dslca-module-edit-actions").hide();jQuery(".dslca-header .dslca-go-to-section-hook").show();dslc_show_publish_button()}function dslc_module_options_cancel_changes(a){if(dslcDebug)console.log("dslc_module_options_cancel_changes");a=typeof a!=="undefined"?a:false;var b=jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument);jQuery(".dslca-module-options-front",b).html("").append(LiveComposer.Builder.moduleBackup);dslc_module_output_altered(function(){dslc_generate_code();jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-module-being-edited");jQuery(".dslca-module-edit-options-inner").html("");jQuery(".dslca-module-edit-options-tabs").html("");LiveComposer.Builder.UI.clearUtils();if(a){a()}});dslc_show_section(".dslca-modules");jQuery(".dslca-header .dslca-options-filter-hook").hide();jQuery(".dslca-module-edit-actions").hide();jQuery(".dslca-header .dslca-go-to-section-hook").show();dslc_show_publish_button();LiveComposer.Builder.UI.clearUtils()}function dslc_module_options_tooltip(){jQuery(document).on("click",".dslca-module-edit-field-ttip-close",function(){jQuery(".dslca-module-edit-field-ttip, .dslca-module-edit-field-icon-ttip").hide()});jQuery(document).on("click",".dslca-module-edit-field-ttip-hook",function(){var a=jQuery(".dslca-module-edit-field-ttip"),b=a.find(".dslca-module-edit-field-ttip-inner"),c=jQuery(this),d,e;e=c.parent();if(e.parent().hasClass("dslca-modules-section-edit-option")){d=c.closest(".dslca-modules-section-edit-option").find(".dslca-module-edit-field-ttip-content").html()}else{d=c.closest(".dslca-module-edit-option").find(".dslca-module-edit-field-ttip-content").html()}if(a.is(":visible")){jQuery(".dslca-module-edit-field-ttip").hide()}else{b.html(d);var f=c.offset();var g=a.outerHeight();var h=a.outerWidth();var i=f.left-h/2+6;var j="50%";if(i<0){j=h/2+i+"px";i=0}jQuery(".dslca-module-edit-field-ttip").show().css({top:f.top-g-20,left:i});jQuery("head").append(jQuery("<style>.dslca-module-edit-field-ttip:after, .dslca-module-edit-field-ttip:before { left: "+j+" }</style>"))}});jQuery(document).on("click",".dslca-module-edit-field-icon-ttip-hook",function(){var a=jQuery(".dslca-module-edit-field-icon-ttip");var b=jQuery(this);if(a.is(":visible")){jQuery(".dslca-module-edit-field-icon-ttip").hide()}else{var c=b.offset();var d=a.outerHeight();var e=a.outerWidth();var f=c.left-e/2+6;var g="50%";if(f<0){g=e/2+f+"px";f=0}jQuery(".dslca-module-edit-field-icon-ttip").show().css({top:c.top-d-20,left:f});jQuery("head").append(jQuery("<style>.dslca-module-edit-field-icon-ttip:after, .dslca-module-edit-field-icon-ttip:before { left: "+g+" }</style>"))}})}function dslc_module_options_font(){jQuery(document).on("click",".dslca-module-edit-field-font-next",function(a){a.preventDefault();if(!jQuery(this).hasClass("dslca-font-loading")&&!jQuery(this).siblings(".dslca-font-loading").length){var b=jQuery(this).closest(".dslca-module-edit-option-font");var c=jQuery(".dslca-module-edit-field-font",b);var d=dslcAllFontsArray.indexOf(c.val());var e=d+1;jQuery(".dslca-module-edit-field-font-suggest",b).text("");c.val(dslcAllFontsArray[e]).trigger("change");jQuery(this).addClass("dslca-font-loading").find(".dslca-icon").removeClass("dslc-icon-chevron-right").addClass("dslc-icon-refresh dslc-icon-spin")}});jQuery(document).on("click",".dslca-module-edit-field-font-prev",function(a){a.preventDefault();if(!jQuery(this).hasClass("dslca-font-loading")&&!jQuery(this).siblings(".dslca-font-loading").length){var b=jQuery(this).closest(".dslca-module-edit-option-font");var c=jQuery(".dslca-module-edit-field-font",b);var d=dslcAllFontsArray.indexOf(c.val());var e=d-1;jQuery(".dslca-module-edit-field-font-suggest",b).text("");if(e<0){e=dslcAllFontsArray.length-1}c.val(dslcAllFontsArray[e]).trigger("change");jQuery(this).addClass("dslca-font-loading").find(".dslca-icon").removeClass("dslc-icon-chevron-left").addClass("dslc-icon-refresh dslc-icon-spin")}});jQuery(document).on("keyup",".dslca-module-edit-field-font",function(a){var b,c,d,e=false,f;b=jQuery(this);c=b.closest(".dslca-module-edit-option");if(a.which==38){jQuery(".dslca-module-edit-field-font-prev",c).click()}if(a.which==40){jQuery(".dslca-module-edit-field-font-next",c).click()}if(a.which!=13&&a.which!=38&&a.which!=40){d=b.val();var g=[];var h=new RegExp("^"+d,"i");var i=dslcAllFontsArray.length;var j=0;do{if(h.test(dslcAllFontsArray[j])){if(!e){var e=dslcAllFontsArray[j]}}j++}while(j<i);if(!e){f=d;jQuery(".dslca-module-edit-field-font-suggest",c).hide()}else{f=e;jQuery(".dslca-module-edit-field-font-suggest",c).show()}jQuery(".dslca-module-edit-field-font-suggest",c).text(f);if(f.length){b.val(f.substring(0,b.val().length))}}});jQuery(document).on("keypress",".dslca-module-edit-field-font",function(a){if(a.which==13){a.preventDefault();var b,c,d,e,f;b=jQuery(this);c=b.closest(".dslca-module-edit-option");jQuery(this).val(jQuery(".dslca-module-edit-field-font-suggest",c).text()).trigger("change");jQuery(".dslca-module-edit-field-font-suggest",c).text("")}})}function dslc_list_icon(a,b){var c=jQuery(a).closest(".dslca-module-edit-option-icon");var d=jQuery(".dslca-module-edit-field-icon",c);var e=dslcIconsCurrentSet.indexOf(d.val());if(b=="previous"){var f=e-1}else{var f=e+1}jQuery(".dslca-module-edit-field-icon-suggest",c).text("");if(f<0){f=dslcIconsCurrentSet.length-1}d.val(dslcIconsCurrentSet[f]).trigger("change")}function dslc_module_options_icon(){jQuery(document).on("keyup",".dslca-module-edit-field-icon",function(a){var b,c,d,e,f;b=jQuery(this);c=b.closest(".dslca-module-edit-option");if(a.which==38){dslc_list_icon(b,"previous")}if(a.which==40){dslc_list_icon(b,"next")}if(a.which!=13&&a.which!=38&&a.which!=40){d=b.val().toLowerCase();b.val(d);e=jQuery.grep(dslcIconsCurrentSet,function(a,b){return a.indexOf(d)==0});f=e[0];jQuery(".dslca-module-edit-field-icon-suggest",c).text(f)}});jQuery(document).on("keypress",".dslca-module-edit-field-icon",function(a){if(a.which==13){a.preventDefault();var b,c,d,e,f;b=jQuery(this);c=b.closest(".dslca-module-edit-option");jQuery(this).val(jQuery(".dslca-module-edit-field-icon-suggest",c).text()).trigger("change");jQuery(".dslca-module-edit-field-icon-suggest",c).text("")}})}function dslc_module_options_icon_returnid(){jQuery(document).on("click",'.dslca-open-modal-hook[data-modal^=".dslc-list-icons"]',function(a){jQuery(this).closest(".dslca-module-edit-option-icon").find("input").addClass("icon-modal-active")});jQuery(document).on("click",".dslca-modal-icons .icon-item",function(a){var b=jQuery(this).find(".icon-item_name").text();jQuery("input.icon-modal-active").val(b).change();dslc_hide_modal("",jQuery(".dslca-modal:visible"));jQuery("input.icon-modal-active").removeClass("icon-modal-active")})}function dslc_module_options_text_align(){jQuery(document).on("click",".dslca-module-edit-option-text-align-hook",function(){var a=jQuery(this),b=jQuery(this).closest(".dslca-module-edit-option-text-align-wrapper").find(".dslca-module-edit-option-text-align-hook"),c=a.data("val"),d=jQuery(this).closest(".dslca-module-edit-option-text-align-wrapper").siblings("input.dslca-module-edit-field");b.removeClass("dslca-active");a.addClass("dslca-active");d.val(c).trigger("change")})}function dslc_module_options_checkbox(){jQuery(document).on("click",".dslca-module-edit-option-checkbox-hook, .dslca-modules-section-edit-option-checkbox-hook",function(){var a=jQuery(this);var b=a.siblings('input[type="checkbox"]');if(b.prop("checked")){b.prop("checked",false);a.find(".dslca-icon").removeClass("dslc-icon-check").addClass("dslc-icon-check-empty")}else{b.prop("checked",true);a.find(".dslca-icon").removeClass("dslc-icon-check-empty").addClass("dslc-icon-check")}b.change()})}function dslc_module_options_box_shadow(){if(dslcDebug)console.log("dslc_module_options_box_shadow");jQuery(document).on("change",".dslca-module-edit-option-box-shadow-hor, "+".dslca-module-edit-option-box-shadow-ver, .dslca-module-edit-option-box-shadow-blur, .dslca-module-edit-option-box-shadow-spread,"+" .dslca-module-edit-option-box-shadow-color, .dslca-module-edit-option-box-shadow-inset",function(){var a=jQuery(this).closest(".dslca-module-edit-option"),b=a.find(".dslca-module-edit-field"),c=a.find(".dslca-module-edit-option-box-shadow-hor").val(),d=a.find(".dslca-module-edit-option-box-shadow-ver").val(),e=a.find(".dslca-module-edit-option-box-shadow-blur").val(),f=a.find(".dslca-module-edit-option-box-shadow-spread").val(),g=a.find(".dslca-module-edit-option-box-shadow-color").val(),h=a.find(".dslca-module-edit-option-box-shadow-inset").is(":checked");if(h){h=" inset"}else{h=""}var i=c+"px "+d+"px "+e+"px "+f+"px "+g+h;b.val(i).trigger("change")})}function dslc_module_options_text_shadow(){if(dslcDebug)console.log("dslc_module_options_text_shadow");jQuery(document).on("change",".dslca-module-edit-option-text-shadow-hor, .dslca-module-edit-option-text-shadow-ver,"+".dslca-module-edit-option-text-shadow-blur, .dslca-module-edit-option-text-shadow-color",function(){var a=jQuery(this).closest(".dslca-module-edit-option"),b=a.find(".dslca-module-edit-field"),c=a.find(".dslca-module-edit-option-text-shadow-hor").val(),d=a.find(".dslca-module-edit-option-text-shadow-ver").val(),e=a.find(".dslca-module-edit-option-text-shadow-blur").val(),f=a.find(".dslca-module-edit-option-text-shadow-color").val();var g=c+"px "+d+"px "+e+"px "+f;b.val(g).trigger("change")})}function dslc_module_options_color(a){if(dslcDebug)console.log("dslc_module_options_color");var b,c,d,e,f,g,h;var i=[],j,k;var l="dslcColors-"+document.domain;if(undefined!==localStorage[l]){j=JSON.parse(localStorage[l]);i=j}if(1>i.length){i.push("#78b")}if(2>i.length){i.push("#ab0")}if(3>i.length){i.push("#de3")}i.push("#fff");i.push("#000");i.push("rgba(0,0,0,0)");var m=a;jQuery(m).each(function(){var a=jQuery(this).closest(".dslca-color-option");var j=jQuery(this);h=jQuery(this).val();j.wpColorPicker({mode:"hsl",palettes:i,change:function(a,h){b=j;var i=j.wpColorPicker("color");if(i==null){e=""}else{e=i}b.val(e).trigger("change");b.css("background",e);c=b.data("affect-on-change-el");d=b.data("affect-on-change-rule");if(null!=c){jQuery(c,".dslca-module-being-edited").css(d,e)}f=jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument);g=b.data("id");jQuery('.dslca-module-option-front[data-id="'+g+'"]',f).val(e);f.addClass("dslca-module-change-made")}});var k=a.find(".wp-picker-holder .iris-picker");k.append('<button type="button" class="dslca-colorpicker-apply">Apply</button>');var m=a.find(".dslca-colorpicker-apply");j.wpColorPicker("open");jQuery(m).on("click",function(){if("#fff"!==e&&"#ffffff"!==e&&"#000"!==e&&"#000000"!==e&&"rgba(0,0,0,0)"!==e){if(undefined===localStorage[l]){var a=[e];localStorage[l]=JSON.stringify(a)}else{var a=JSON.parse(localStorage[l]);if(a.indexOf(e)==-1){a.unshift(e);if(3<a.length){a.pop()}}localStorage[l]=JSON.stringify(a)}}j.wpColorPicker("close")});LiveComposer.Builder.Helpers.colorpickers.push(jQuery(this))})}function dslc_module_options_numeric(a){if(dslcDebug)console.log("dslc_module_options_numeric");var b=a;jQuery(b).each(function(){var a=jQuery(this);if(0===jQuery(".dslca-module-edit-field-slider",a).length){a.append('<div class="dslca-module-edit-field-slider"></div>')}var b=true;if(a.hasClass("dslca-modules-section-edit-option")){b=false}else{b=true}if(b){var c=a.find(".dslca-module-edit-field")}else{var c=a.find(".dslca-modules-section-edit-field")}if(a.hasClass("dslca-modules-section-edit-option")){var c=a.find(".dslca-modules-section-edit-field")}else{var c=a.find(".dslca-module-edit-field")}var d="",e=a.find(".dslca-module-edit-field-slider"),f=parseFloat(c.val()),g=parseFloat(c.data("max")),h=parseFloat(c.data("min")),i=parseFloat(c.data("increment")),j=g,k=h;var l=false;if(undefined!==c.data("onlypositive")&&1===c.data("onlypositive")){l=true}if(f>=g){g=f*2}if(!l&&f<=h){h=f*2}e.slider({min:h,max:g,step:i,value:c.val(),slide:function(a,b){c.val(b.value+d);c.trigger("change")},change:function(b,c){if(c.value>=g||c.value<=h){e.slider("destroy");dslc_module_options_numeric(a)}}});e.show();jQuery(a).on("mouseleave",function(){if(undefined!==e.slider("instance")){jQuery(e).slider("destroy")}e.remove()});if(c[0].classList.contains("slider-initiated"))return;
4
+ c[0].classList.add("slider-initiated");c.on("keyup",function(a){if(undefined===a){return false}if(a.shiftKey){if(a.keyCode==38){this.value=(parseInt(this.value)||0)+9;c.trigger("change")}if(a.keyCode==40){this.value=parseInt(this.value)+0-9;c.trigger("change")}}if(a.keyCode==8||a.keyCode==45){c.trigger("change")}if(a.keyCode>=48&&a.keyCode<=57||a.keyCode>=96&&a.keyCode<=105){c.trigger("change")}var b=a.which?a.which:a.keyCode;if((b>=48&&b<=57||b>=96&&b<=105)&&a.keyCode!=8&&a.keyCode!=39&&a.keyCode!=37&&a.keyCode!=46){return false}});c.on("change",function(a){if(l&&this.value<0){this.value=0}var c;if(b){c=jQuery(a.target.closest(".dslca-module-edit-option-slider"))}else{c=jQuery(a.target.closest(".dslca-modules-section-edit-option-slider"))}var d=c.find(".dslca-module-edit-field-slider");if(undefined!==d.slider("instance")){d.slider("value",this.value)}if(b){var e=jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument);e.addClass("dslca-module-change-made")}});return false})}function dslc_disable_responsive_view(){jQuery("html").removeClass("dslc-responsive-preview");jQuery("body").removeClass("dslc-res-big dslc-res-smaller-monitor dslc-res-phone dslc-res-tablet")}function dslc_filter_module_options(a){dslc_module_options_section_filter(a)}function dslc_show_module_options_tab(a){dslc_module_options_tab_filter(a)}function dslc_confirm_changes(a){dslc_module_options_confirm_changes(a)}function dslc_cancel_changes(a){dslc_module_options_cancel_changes(a)}function dslc_init_colorpicker(){dslc_module_options_color()}function dslc_init_options_slider(){dslc_module_options_numeric()}function dslc_module_edit_options_hideshow_tabs(){dslc_module_options_hideshow_tabs()}"use strict";function dslc_template_load(a){if(dslcDebug)console.log("dslc_load_template");var b,c;jQuery.post(DSLCAjax.ajaxurl,{action:"dslc-ajax-load-template",dslc:"active",dslc_template_id:a},function(a){jQuery("#dslc-main",LiveComposer.Builder.PreviewAreaDocument).html(a.output);LiveComposer.Builder.PreviewAreaWindow.dslc_carousel();dslc_drag_and_drop();dslc_show_publish_button();dslc_generate_code()})}function dslc_template_import(){if(dslcDebug)console.log("dslc_import_template");var a,b;jQuery(".dslca-modal-templates-import .dslca-modal-title").css({opacity:0});jQuery(".dslca-modal-templates-import .dslca-loading").show();jQuery.post(DSLCAjax.ajaxurl,{action:"dslc-ajax-import-template",dslc:"active",dslc_template_code:jQuery("#dslca-import-code").val()},function(a){jQuery("#dslc-main",LiveComposer.Builder.PreviewAreaDocument).html(a.output);jQuery(".dslca-modal-templates-import .dslca-loading").hide();jQuery(".dslca-modal-templates-import .dslca-modal-title").css({opacity:1});dslc_hide_modal("",".dslca-modal-templates-import");LiveComposer.Builder.PreviewAreaWindow.dslc_bg_video();dslc_drag_and_drop();dslc_show_publish_button();dslc_generate_code()})}function dslc_template_save(){if(dslcDebug)console.log("dslc_save_template");jQuery.post(DSLCAjax.ajaxurl,{action:"dslc-ajax-save-template",dslc:"active",dslc_template_code:jQuery("#dslca-code").val(),dslc_template_title:jQuery("#dslca-save-template-title").val()},function(a){dslc_hide_modal("",".dslca-modal-templates-save")})}function dslc_template_delete(a){if(dslcDebug)console.log("dslc_delete_template");jQuery.post(DSLCAjax.ajaxurl,{action:"dslc-ajax-delete-template",dslc:"active",dslc_template_id:a},function(b){jQuery('.dslca-template[data-id="'+a+'"]').fadeOut(200,function(){jQuery(this).remove()})})}function dslc_load_template(a){dslc_template_load(a)}function dslc_import_template(){dslc_template_import()}function dslc_save_template(){dslc_template_save()}function dslc_delete_template(a){dslc_template_delete(a)}jQuery(document).ready(function(a){jQuery(document).on("click",".dslca-template",function(a){a.preventDefault();dslc_template_load(jQuery(this).data("id"))});a(".dslca-template-import-form").submit(function(a){a.preventDefault();dslc_template_import()});a(".dslca-template-save-form").submit(function(a){a.preventDefault();dslc_template_save()});a(document).on("click",".dslca-delete-template-hook",function(b){b.stopPropagation();dslc_template_delete(a(this).data("id"))})});"use strict";window.onerror=function(a,b,c,d){dslca_generate_error_report(a,b,c,d)};jQuery(document).on("click",".dslca-show-js-error-hook",function(a){a.preventDefault();var b=document.getElementById("dslca-js-errors-report");if(!jQuery("body").hasClass("dslca-saving-in-progress")){LiveComposer.Builder.UI.CModalWindow({title:'<a href="https://livecomposerplugin.com/support/support-request/" target="_blank"><span class="dslca-icon dslc-icon-comment"></span> &nbsp; Open Support Ticket</a>',content:'<span class="dslca-error-report">'+b.value+"</span>"})}});jQuery(document).ready(function(a){jQuery("#page-builder-frame")[0].contentWindow.onerror=function(a,b,c,d){dslca_generate_error_report(a,b,c,d)};dslca_update_report_log();jQuery("body").addClass("dslca-enabled dslca-drag-not-in-progress");jQuery(".dslca-invisible-overlay").hide();jQuery(".dslca-section").eq(0).show();window.previewAreaTinyMCELoaded=function(){var a=this;LiveComposer.Builder.PreviewAreaWindow=this;LiveComposer.Builder.PreviewAreaDocument=jQuery(this.document);jQuery("#wpadminbar",LiveComposer.Builder.PreviewAreaDocument).remove();LiveComposer.Builder.UI.initInlineEditors();dslc_fix_contenteditable();var b=LiveComposer.Builder.PreviewAreaDocument.find("#dslc-main").eq(0)[0];new LiveComposer.Builder.Elements.CSectionsContainer(b);jQuery(document).trigger("editorFrameLoaded");dslc_drag_and_drop();dslc_generate_code();dslc_keypress_events();LiveComposer.Builder.UI.initPreviewAreaScroller()}});jQuery(document).on("click",".dslca-currently-editing",function(){var a=false,b=false,c;if(jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).length){a=jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument);c="#5890e5"}else if(jQuery(".dslca-modules-section-being-edited",LiveComposer.Builder.PreviewAreaDocument).length){a=jQuery(".dslca-modules-section-being-edited",LiveComposer.Builder.PreviewAreaDocument);c="#eabba9"}if(a){b=a.offset().top-100;if(b<0){b=0}var d=[];jQuery("html, body",LiveComposer.Builder.PreviewAreaDocument).animate({scrollTop:b},300,function(){a.removeAttr("style")})}});jQuery(window).keypress(function(a){if((a.metaKey||a.ctrlKey)&&a.keyCode==83){dslc_ajax_save_composer();a.preventDefault();return false}});jQuery(document).on("click",".dslca-hide-composer-hook",function(a){a.preventDefault();dslc_hide_composer()});jQuery(document).on("click",".dslca-show-composer-hook",function(a){a.preventDefault();dslc_show_composer()});jQuery(document).on("click",".dslca-go-to-modules-hook",function(a){a.preventDefault();dslc_show_section(".dslca-modules")});jQuery(document).on("click",".dslca-go-to-section-hook",function(a){a.preventDefault();if(jQuery(this).hasClass("dslca-active")){return}var b=jQuery(this).data("section");dslc_show_section(b);if(jQuery(this).hasClass("dslca-go-to-section-modules")||jQuery(this).hasClass("dslca-go-to-section-templates")){jQuery(this).addClass("dslca-active").siblings(".dslca-go-to-section-hook").removeClass("dslca-active")}});jQuery(document).on("click",".dslca-close-composer-hook",function(a){a.preventDefault();var b=jQuery(this).attr("href");if(!jQuery("body").hasClass("dslca-saving-in-progress")){LiveComposer.Builder.UI.CModalWindow({title:DSLCString.str_exit_title,content:DSLCString.str_exit_descr,confirm:function(){window.location=b}})}});jQuery(document).on("click",".dslca-submit",function(){jQuery(this).closest("form").submit()});jQuery(document).on("click",".dslca-section-title",function(a){a.stopPropagation();if(jQuery(".dslca-section-title-filter",this).length){dslc_generate_filters();jQuery(".dslca-section-title-filter-options").slideToggle(300)}});jQuery(document).on("click",".dslca-section-title-filter-options a",function(a){a.preventDefault();a.stopPropagation();var b=jQuery(this).data("origin");var c=jQuery(this).closest(".dslca-section");if(c.hasClass("dslca-templates-load")){jQuery(".dslca-section-title-filter-curr",c).text(jQuery(this).text())}else{jQuery(".dslca-section-title-filter-curr",c).text(jQuery(this).text())}jQuery(".dslca-section-scroller-inner").css({left:0});dslc_filter_origin(b,c);jQuery(".dslca-section-title-filter-options").slideToggle(300)});function dslc_hide_composer(){if(dslcDebug)console.log("dslc_hide_composer");jQuery(".dslca-hide-composer-hook").hide();jQuery(".dslca-show-composer-hook").show();jQuery("body").addClass("dslca-composer-hidden");jQuery("body",LiveComposer.Builder.PreviewAreaDocument).addClass("dslca-composer-hidden");jQuery(".dslca-container").css({bottom:jQuery(".dslca-container").outerHeight()*-1});jQuery(".dslca-header").hide()}function dslc_show_composer(){if(dslcDebug)console.log("dslc_show_composer");jQuery(".dslca-show-composer-hook").hide();jQuery(".dslca-hide-composer-hook").show();jQuery("body").removeClass("dslca-composer-hidden");jQuery("body",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-composer-hidden");jQuery(".dslca-container").css({bottom:0});jQuery(".dslca-header").show()}function dslc_show_publish_button(){if(dslcDebug)console.log("dslc_show_publish_button");jQuery(".dslca-save-composer").show().addClass("dslca-init-animation");jQuery(".dslca-save-draft-composer").show().addClass("dslca-init-animation")}function dslc_hide_publish_button(){if(dslcDebug)console.log("dslc_hide_publish_button");jQuery(".dslca-save-composer").hide();jQuery(".dslca-save-draft-composer").hide()}function dslc_show_section(a){if(dslcDebug)console.log("dslc_show_section");var b=jQuery(a).data("title"),c=jQuery(a).data("bg");jQuery(".dslca-container").css({bottom:-500});jQuery(".dslca-section").hide();jQuery(a).show();if(a==".dslca-module-edit"){jQuery(".dslca-currently-editing").show().find("strong").text(jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).attr("title")+" element")}else if(a==".dslca-modules-section-edit"){jQuery(".dslca-currently-editing").show().css("background-color","#e5855f").find("strong").text("Row")}else{jQuery(".dslca-currently-editing").hide().find("strong").text("")}dslc_module_options_tab_filter();jQuery(".dslca-container").css({bottom:0});jQuery(a).find("input.dslca-module-edit-field-colorpicker").each(function(a){jQuery(this).css("background",jQuery(this).val())})}function dslc_generate_filters(){if(dslcDebug)console.log("dslc_generate_filters");var a,b=[],c='<a html="#" data-origin="">Show All</a>',d=jQuery(".dslca-section:visible .dslca-origin");d.each(function(){a=jQuery(this);if(jQuery.inArray(a.data("origin"),b)==-1){b.push(a.data("origin"));c+='<a href="#" data-origin="'+a.data("origin")+'">'+a.data("origin")+"</a>"}});jQuery(".dslca-section:visible .dslca-section-title-filter-options").html(c).css("background",jQuery(".dslca-section:visible").data("bg"))}function dslc_filter_origin(a,b){if(dslcDebug)console.log("dslc_filter_origin");jQuery(".dslca-origin",b).attr("data-display-module","false");jQuery('.dslca-origin[data-origin="'+a+'"]',b).attr("data-display-module","true");if(a==""){jQuery(".dslca-origin",b).attr("data-display-module","true");jQuery(".dslca-origin.dslca-exclude",b).attr("data-display-module","false")}}function dslc_drag_and_drop(){if(dslcDebug)console.log("dslc_drag_and_drop");var a,b,c,d;var e=jQuery(".dslca-modules .dslca-section-scroller-content");if(e.length==0){e=[document.createElement("div")]}var f=Sortable.create(e[0],{sort:false,group:{name:"modules",pull:"clone",put:false},animation:150,handle:".dslca-module",draggable:".dslca-module",chosenClass:"dslca-module-dragging",scroll:true,scrollSensitivity:150,scrollSpeed:15,setData:function(a,b){a.setData(LiveComposer.Utils.msieversion()!==false?"Text":"text/html",b.innerHTML)},onStart:function(a){a.oldIndex;jQuery("body").removeClass("dslca-new-module-drag-not-in-progress").addClass("dslca-new-module-drag-in-progress");jQuery("body",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-new-module-drag-not-in-progress").addClass("dslca-new-module-drag-in-progress");jQuery("#dslc-header").addClass("dslca-header-low-z-index")},onEnd:function(a){a.oldIndex;a.newIndex;var e=a.item;a.preventDefault();if(jQuery(e).closest(".dslca-section-scroller-content").length>0)return false;jQuery(".dslca-options-hovered",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-options-hovered");b=jQuery(e.parentNode);c=e.dataset.id;dslc_generate_code();if(c=="DSLC_M_A"||jQuery("body").hasClass("dslca-module-drop-in-progress")||b.closest("#dslc-header").length||b.closest("#dslc-footer").length){}else{jQuery("body").addClass("dslca-module-drop-in-progress");dslc_module_output_default(c,function(a){d=a.output;var c=LiveComposer.Builder.Helpers.insertModule(d,jQuery(".dslca-module",b));setTimeout(function(){LiveComposer.Builder.PreviewAreaWindow.dslc_masonry();jQuery("body").removeClass("dslca-module-drop-in-progress")},700);jQuery(".dslca-no-content-primary",b).css({opacity:1});jQuery(".dslca-modules-area-manage",b).css({visibility:"visible"});LiveComposer.Builder.PreviewAreaWindow.dslc_carousel();LiveComposer.Builder.PreviewAreaWindow.dslc_tabs();LiveComposer.Builder.PreviewAreaWindow.dslc_init_accordion();dslc_generate_code();dslc_show_publish_button();LiveComposer.Builder.UI.initInlineEditors()});jQuery(e).find(".dslca-icon").attr("class","").attr("class","dslca-icon dslc-icon-refresh dslc-icon-spin");jQuery(".dslca-no-content-primary",b).css({opacity:0});jQuery(".dslca-modules-area-manage",b).css({visibility:"hidden"})}LiveComposer.Builder.UI.stopScroller();jQuery("body").removeClass("dslca-new-module-drag-in-progress").addClass("dslca-new-module-drag-not-in-progress");jQuery("body",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-new-module-drag-in-progress").addClass("dslca-new-module-drag-not-in-progress");jQuery("#dslc-header").removeClass("dslca-header-low-z-index")},onAdd:function(a){var b=a.item;a.from},onUpdate:function(a){var b=a.item;dslc_show_publish_button()},onSort:function(a){a.preventDefault()},onRemove:function(a){},onFilter:function(a){var b=a.item},onMove:function(a){a.dragged;a.draggedRect;a.related;a.relatedRect;jQuery(a.to).addClass("dslca-options-hovered")}})}function dslc_option_changed(){dslc_show_publish_button()}function dslc_module_dragdrop_init(){dslc_drag_and_drop()}function dslc_fix_contenteditable(){LiveComposer.Builder.PreviewAreaDocument.on("dragstart",".dslca-module, .dslc-module-front, .dslc-modules-area, .dslc-modules-section",function(a){jQuery("[contenteditable]",LiveComposer.Builder.PreviewAreaDocument).attr("contenteditable",false)});LiveComposer.Builder.PreviewAreaDocument.on("dragend mousedown",".dslca-module, .dslc-module-front, .dslc-modules-area, .dslc-modules-section",function(a){jQuery("[contenteditable]",LiveComposer.Builder.PreviewAreaDocument).attr("contenteditable",true)})}function dslc_toogle_control(a){if(a===undefined)a=false;if(!a)return;var b=jQuery(".dslca-module-edit-option-"+a);var c=b.find(".dslca-module-edit-field");var d=jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument);var e=d[0].id;var f="";if("tablet_responsive"===b.data("tab")){f="body.dslc-res-tablet "}else if("phone_responsive"===b.data("tab")){f="body.dslc-res-phone "}var g=c.data("affect-on-change-el");if(g===undefined)return;var h=g.split(",");g="";for(var i=0;i<h.length;i++){if(i>0){g+=", "}g+=f+"#"+e+" "+h[i]}var j=c.data("affect-on-change-rule").replace(/ /g,"");var k=j.split(",");var l;var m=c.data("ext");b.toggleClass("dslca-option-off");if(b.hasClass("dslca-option-off")){l=dslc_get_control_value(a);c.data("val-bckp",l);for(var i=0;i<k.length;i++){jQuery(g,LiveComposer.Builder.PreviewAreaDocument).css(k[i],"");disable_css_rule(g,k[i],e)}c.val("").trigger("change")}else{c.val(c.data("val-bckp")).trigger("change");l=dslc_get_control_value(a);l=dslc_combine_value_and_extension(l,m||"");for(var i=0;i<k.length;i++){var n=g+"{"+k[i]+": "+l+"}";LiveComposer.Builder.Helpers.processInlineStyleTag({context:b,rule:k[i],elems:g.replace(new RegExp("#"+e,"gi"),"").trim(),styleContent:n})}}}jQuery(document).ready(function(a){jQuery(document).on("click",".dslca-module-edit-option .dslc-control-toggle",function(a){a.preventDefault();var b=jQuery(a.target).closest(".dslca-module-edit-option").find(".dslca-module-edit-field").data("id");dslc_toogle_control(b)});jQuery(document).on("mousedown",".dslca-module-edit-option",function(b){var c=a(".dslc-control-toggle");if(!c.is(b.target)&&c.has(b.target).length===0){if(jQuery(b.target).closest(".dslca-module-edit-option").hasClass("dslca-option-off")){var d=a(b.target).closest(".dslca-module-edit-option").find(".dslca-module-edit-field").data("id");dslc_toogle_control(d)}}})});function disable_css_rule(a,b,c){var d;var e="css-for-"+c;var f=document.getElementById("page-builder-frame").contentWindow.document.getElementById(e);a=a.replace(/\s\s+/g," ");if(f){f=f.sheet;if(f["rules"]){d="rules"}else if(f["cssRules"]){d="cssRules"}else{}for(var g=0;g<f[d].length;g++){if(f[d][g].selectorText==a){if(f[d][g].style[b]){f[d][g].style[b]="";break}}}}}function dslc_combine_value_and_extension(a,b){if(""===a||null===a){return a}if(a.indexOf(b)==-1){a=a+b}return a}function dslc_get_control_value(a){var b=jQuery(".dslca-module-edit-option-"+a);var c="text";var d=b.find(".dslca-module-edit-field");var e;e=d.val();return e}function dslc_keypress_events(){jQuery([document,LiveComposer.Builder.PreviewAreaWindow.document]).unbind("keydown").bind("keydown",function(a){dslc_modal_keypress_events(a);dslc_disable_backspace_navigation(a);dslc_notice_on_refresh(a);dslc_save_page(a)})}function dslc_disable_backspace_navigation(a){var b=false;if(a.keyCode===8){var c=a.srcElement||a.target;if(c.tagName.toUpperCase()==="INPUT"&&(c.type.toUpperCase()==="TEXT"||c.type.toUpperCase()==="PASSWORD"||c.type.toUpperCase()==="NUMBER"||c.type.toUpperCase()==="FILE")||c.tagName.toUpperCase()==="TEXTAREA"||jQuery(c).hasClass("dslca-editable-content")||jQuery(c).hasClass("dslc-tabs-nav-hook-title")||jQuery(c).hasClass("dslc-accordion-title")){b=c.readOnly||c.disabled}else{b=true}}if(b){a.preventDefault()}}function dslc_notice_on_refresh(a){if(a.which==116||a.which===82&&a.metaKey){if(jQuery(".dslca-save-composer-hook").offsetParent!==null||jQuery(".dslca-module-edit-save").offsetParent!==null){a.preventDefault();LiveComposer.Builder.UI.CModalWindow({title:DSLCString.str_refresh_title,content:DSLCString.str_refresh_descr,confirm:function(){window.location.reload()}})}}}function dslc_save_page(a){if(a.which==83&&(a.metaKey||a.ctrlKey)){if(jQuery(".dslca-save-composer-hook").css("display")=="block"){dslc_save_composer();a.preventDefault();return false}}}function dslca_generate_error_report(a,b,c,d){var e="JavaScript error detected in a third-party plugin";if(b.match("wp-content/plugins/live-composer-page-builder/js")!=null){e="Live Composer returned JS error"}var f="";f+='<br /><strong style="color:#E55F5F;">'+e+"</strong><br />";f+=a+'<br /> File "'+b+'", line '+c+", char "+d+"<br />";if("undefined"!==typeof Storage){localStorage.setItem("js_errors_report",f)}}function dslca_update_report_log(){var a=document.getElementById("dslca-js-errors-report");var b=localStorage.getItem("js_errors_report");if(null!==b){a.value=b;localStorage.removeItem("js_errors_report");document.querySelector(".dslca-show-js-error-hook").setAttribute("style","visibility:visible")}}jQuery(document).on("editorFrameLoaded",function(){var a=jQuery;console.log("editorFrameLoaded");var b=a("div[data-hf]",LiveComposer.Builder.PreviewAreaDocument);var c="";b.each(function(b,d){var e=a(d).data("editing-link");var f=a(d).data("editing-type");var g=a(d).data("editing-label");var h=a(d).data("editing-sublabel");c+='<div class="dslc-hf-block-overlay"><a target="_blank" href="'+e+'" class="dslc-hf-block-overlay-button dslca-link">'+g+"</a>";if(h!==undefined){c+=' <span class="dslc-hf-block-overlay-text">'+h+"</span>"}c+="</div>";var i=document.createElement("div");i.innerHTML=c;d.append(i)})});"use strict";LiveComposer.Utils={addslashes:function(a){a=a.replace(/\\/g,"\\\\");a=a.replace(/\'/g,"\\'");a=a.replace(/\"/g,'\\"');a=a.replace(/\0/g,"\\0");return a},basename:function(a){return a.split(/[\\\/]/).pop()},msieversion:function(){var a=window.navigator.userAgent;var b=a.indexOf("MSIE ");if(b>0||!!navigator.userAgent.match(/Trident.*rv\:11\./)){return parseInt(a.substring(b+5,a.indexOf(".",b)))}else{return false}},checkParams:function(a){if(!Array.isArray(a)){throw"Param is not array"}var b={integer:function(a){return isNaN(parseInt(a))},"float":function(a){return isNaN(parseFloat(a))},string:function(a){return a!=null&&a!=undefined&&typeof a=="string"},array:function(a){return Array.isArray(a)},object:function(a){return typeof a=="object"}};a.map(function(a){if(!b[a[1]](a[0])){throw"Param "+a[0]+" is not "+a[1]}})},utf8_to_b64:function(a){return window.btoa(unescape(encodeURIComponent(a)))},b64_to_utf8:function(a){return decodeURIComponent(escape(window.atob(a)))},get_page_params:function(){return decodeURIComponent(window.location.search.slice(1)).split("&").reduce(function a(b,c){c=c.split("=");b[c[0]]=c[1];return b},{})},get_unique_id:function(){return Math.random().toString(32).slice(2)},update_module_property_raw:function(a,b,c){var d=a.getElementsByClassName("dslca-module-code")[0];var e=a.querySelector('.dslca-module-option-front[data-id="'+b+'"]');var f=d.value;f=JSON.parse(f);f[b]=c;f=JSON.stringify(f);d.value=f;d.innerHTML=f;e.value=c;e.innerHTML=c},update_section_property_raw:function(a,b,c){var d=a.getElementsByClassName("dslca-section-code")[0];var e=a.querySelector('.dslca-modules-section-settings input[data-id="'+b+'"]');var f=d.value;f=JSON.parse(f);f[b]=c;f=JSON.stringify(f);d.value=f;d.innerHTML=f;e.setAttribute("value",c);e.setAttribute("data-def",c)},publish:function(a,b){b=b?b:{};this.checkParams([[a,"string"],[b,"object"]]);jQuery(document).trigger({type:a,message:{details:b}});LiveComposer.Builder.PreviewAreaWindow.dslca_publish_event(a,b)}};"use strict";function dslc_dm_get_defaults(a){if(dslcDebug)console.log("dslc_dm_get_defaults");var b=a.find(".dslca-module-code").val();jQuery.post(DSLCAjax.ajaxurl,{action:"dslc-ajax-dm-module-defaults",dslc:"active",dslc_modules_options:b},function(a){jQuery(".dslca-prompt-modal textarea").val(a.output)})}function dslc_editable_content_gen_code(a){if(dslcDebug)console.log("dslc_editable_content_gen_code");if(undefined===a){return false}var b,c,d;b=a.closest(".dslc-module-front");c=a.html().trim().replace(/<textarea/g,"<lctextarea").replace(/<\/textarea/g,"</lctextarea");d=a.data("id");jQuery('.dslca-module-option-front[data-id="'+d+'"]',b).val(c)}function dslc_filter_textarea(a){if(dslcDebug)console.log("dslc_filter_textarea");if(undefined===a){return false}var b;b=a.trim().replace(/<textarea/g,"<lctextarea").replace(/<\/textarea/g,"</lctextarea");return b}window.onbeforeunload=function(){return};jQuery(document).ready(function(a){jQuery(document).on("change",".dslca-modules-section-edit-field",function(){var b,c,d,e,f,g,h,i,j,k,l;b=a(this);c=b.data("id");f=b.val();g=f;h=f+b.data("ext");i=b.data("css-rule");d=a(".dslca-modules-section-being-edited",LiveComposer.Builder.PreviewAreaDocument);k=d;j=a('.dslca-modules-section-settings input[data-id="'+c+'"]',d);d.addClass("dslca-modules-section-change-made");if(b.hasClass("dslca-modules-section-edit-field-upload")){if(f&&f.length){f=a('.dslca-modules-section-settings input[data-id="dslca-img-url"]',d).val()}}if(i=="background-image"){f='url("'+f+'")';LiveComposer.Builder.PreviewAreaWindow.dslc_bg_video()}if(c=="bg_image_attachment"){d.removeClass("dslc-init-parallax")}if(c=="border-top"||c=="border-right"||c=="border-bottom"||c=="border-left"){var m=a('.dslca-modules-section-settings input[data-id="border_style"]').val();j=a('.dslca-modules-section-settings input[data-id="border"]',d);g="";var n=b.closest(".dslca-modules-section-edit-option-checkbox-wrapper");n.find(".dslca-modules-section-edit-field-checkbox").each(function(){if(a(this).is(":checked")){if(a(this).data("id")=="border-top"){g+="top "}else if(a(this).data("id")=="border-right"){g+="right "}else if(a(this).data("id")=="border-bottom"){g+="bottom "}else if(a(this).data("id")=="border-left"){g+="left "}}});if(b.is(":checked")){if(b.data("id")=="border-top"){d.css({"border-top-style":m})}else if(b.data("id")=="border-right"){d.css({"border-right-style":m})}else if(b.data("id")=="border-bottom"){d.css({"border-bottom-style":m})}else if(b.data("id")=="border-left"){d.css({"border-left-style":m})}}else{if(b.data("id")=="border-top"){d.css({"border-top-style":"hidden"})}else if(b.data("id")=="border-right"){d.css({"border-right-style":"hidden"})}else if(b.data("id")=="border-bottom"){d.css({"border-bottom-style":"hidden"})}else if(b.data("id")=="border-left"){d.css({"border-left-style":"hidden"})}}}else if(b.hasClass("dslca-modules-section-edit-field-checkbox")){var o=a(this).closest(".dslca-modules-section-edit-option-checkbox-wrapper").find(".dslca-modules-section-edit-field-checkbox");var p="";o.each(function(){if(a(this).prop("checked")){p+=a(this).data("val")+" "}});var g=p;if(b.data("id")=="show_on"){if(p.indexOf("desktop")!==-1){a(".dslca-modules-section-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslc-hide-on-desktop")}else{a(".dslca-modules-section-being-edited",LiveComposer.Builder.PreviewAreaDocument).addClass("dslc-hide-on-desktop")}if(p.indexOf("tablet")!==-1){a(".dslca-modules-section-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslc-hide-on-tablet")}else{a(".dslca-modules-section-being-edited",LiveComposer.Builder.PreviewAreaDocument).addClass("dslc-hide-on-tablet")}if(p.indexOf("phone")!==-1){a(".dslca-modules-section-being-edited",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslc-hide-on-phone")}else{a(".dslca-modules-section-being-edited",LiveComposer.Builder.PreviewAreaDocument).addClass("dslc-hide-on-phone")}}}else if(c=="bg_image_attachment"&&f=="parallax"||c=="type"){if(c=="bg_image_attachment"){d.addClass("dslc-init-parallax");LiveComposer.Builder.PreviewAreaWindow.dslc_parallax()}else if(c=="type"){if(f=="full"){d.addClass("dslc-full")}else{d.removeClass("dslc-full")}LiveComposer.Builder.PreviewAreaWindow.dslc_masonry()}}else if(c=="columns_spacing"){if(f=="nospacing"){d.addClass("dslc-no-columns-spacing")}else{d.removeClass("dslc-no-columns-spacing")}}else if(c=="custom_class"){}else if(c=="custom_id"){}else if(c=="bg_video"){jQuery(".dslc-bg-video video",d).remove();if(f&&f.length){var q=f;q=q.replace(".webm","");q=q.replace(".mp4","");jQuery(".dslc-bg-video-inner",d).html('<video><source type="video/mp4" src="'+q+'.mp4" /><source type="video/webm" src="'+q+'.webm" /></video>');LiveComposer.Builder.PreviewAreaWindow.dslc_bg_video()}}else if(c=="bg_image_thumb"){if(g=="enabled"){if(jQuery("#dslca-post-data-thumb").length){var r="url('"+jQuery("#dslca-post-data-thumb").val()+"')";k.css(i,r)}}else if(g=="disabled"){k.css(i,"none")}}else{if(b.data("css-element")){k=jQuery(b.data("css-element"),d)}i=i.replace(/ /g,"").split(",");var s;if(null!=b.data("ext")){s=h}else{s=f}for(var t=0;t<i.length;t++){k.css(i[t],s)}}j.val(g);if(!LiveComposer.Builder.Flags.generate_code_after_row_changed)return false});jQuery(document).on("blur",".dslc-editable-area",function(b){var c=a(this).closest(".dslc-module-front");var d=a(this).data("dslc-option-id");var e=a(this).html();jQuery('.dslca-module-options-front textarea[data-id="'+d+'"]',c).val(e);dslc_module_output_altered()});jQuery(document).on("change",".dslca-module-edit-field",function(){if(dslcDebug)console.log("on change event for .dslca-module-edit-field");var b="",c="",d=jQuery(this),e=d.data("id"),f=d.closest(".dslca-module-edit-option"),g=jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument),h=g.data("dslc-module-id"),i=jQuery(".dslca-module-options-front textarea",g);g.addClass("dslca-module-change-made");if(f.hasClass("dslca-module-edit-option-select")||f.hasClass("dslca-module-edit-option-checkbox")){dslc_module_options_hideshow_tabs()}if(jQuery(this).closest(".dslca-module-edit-option").data("refresh-on-change")=="active"){if(f.find(".dslca-module-edit-option-checkbox-wrapper").length){var j=jQuery('input[type="checkbox"]',f);j.each(function(){if(a(this).prop("checked")){b=b+jQuery(this).val()+" "}})}else if(d.hasClass("dslca-module-edit-option-radio")){var b=jQuery(".dslca-module-edit-field:checked",d).val()}else{var b=d.val();if(e=="orientation"&&b=="horizontal"){var k=jQuery(".dslca-module-edit-option-thumb_width .dslca-module-edit-field");k.val("40").trigger("change")}else if(e=="orientation"&&b=="vertical"){var k=jQuery(".dslca-module-edit-option-thumb_width .dslca-module-edit-field");k.val("100").trigger("change")}}b=dslc_filter_textarea(b);jQuery('.dslca-module-options-front textarea[data-id="'+e+'"]',g).val(b);jQuery(".dslca-container-loader").show();dslc_module_output_altered(function(){jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument).addClass("dslca-module-change-made");if(e=="css_load_preset"&&!jQuery("body").hasClass("dslca-new-preset-added")){dslc_module_options_show(h);jQuery(".dslca-container-loader").hide()}else{jQuery(".dslca-container-loader").hide()}jQuery("body").removeClass("dslca-new-preset-added");LiveComposer.Utils.publish("LC.moduleChange",{moduleId:h,optionID:e,optionVal:d.val()})})}else{if(d.hasClass("dslca-module-edit-field-font")){var l=d.val();l=l+":400,100,200,300,500,600,700,800,900";var m=d.data("affect-on-change-el");var n=d.data("affect-on-change-rule");var o=d.val();var p=o;var q=jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument);if(d.val().length&&dslcGoogleFontsArray.indexOf(d.val())!==-1){document.getElementById("page-builder-frame").contentWindow.WebFont.load({google:{families:[l]},active:function(a,b){if(jQuery(".dslca-font-loading").closest(".dslca-module-edit-field-font-next").length){jQuery(".dslca-font-loading").removeClass("dslca-font-loading").find(".dslca-icon").removeClass("dslc-icon-spin").addClass("dslc-icon-chevron-right")}else{jQuery(".dslca-font-loading").removeClass("dslca-font-loading").find(".dslca-icon").removeClass("dslc-icon-spin").addClass("dslc-icon-chevron-left")}var c=m.split(",");var e="#"+q[0].id+" "+c.join(", #"+q[0].id+" ")+" {"+n+": "+o+"}";LiveComposer.Builder.Helpers.processInlineStyleTag({context:d,rule:n,elems:m,styleContent:e})},inactive:function(a,b){if(jQuery(".dslca-font-loading").closest(".dslca-module-edit-field-font-next").length){jQuery(".dslca-font-loading").removeClass("dslca-font-loading").find(".dslca-icon").removeClass("dslc-icon-spin").addClass("dslc-icon-chevron-right")}else{jQuery(".dslca-font-loading").removeClass("dslca-font-loading").find(".dslca-icon").removeClass("dslc-icon-spin").addClass("dslc-icon-chevron-left")}}})}else{setTimeout(function(){if(jQuery(".dslca-font-loading.dslca-module-edit-field-font-next").length){jQuery(".dslca-font-loading").removeClass("dslca-font-loading").find(".dslca-icon").removeClass("dslc-icon-spin").addClass("dslc-icon-chevron-right")}else{jQuery(".dslca-font-loading").removeClass("dslca-font-loading").find(".dslca-icon").removeClass("dslc-icon-spin").addClass("dslc-icon-chevron-left")}var a=m.split(",");var b="#"+q[0].id+" "+a.join(", #"+q[0].id+" ")+" {"+n+": "+o+"}";LiveComposer.Builder.Helpers.processInlineStyleTag({context:d,rule:n,elems:m,styleContent:b})},100)}}else if(d.hasClass("dslca-module-edit-field-checkbox")){var j=jQuery('input[type="checkbox"]',f);j.each(function(){if(jQuery(this).prop("checked")){b=b+"solid ";c=c+a(this).val()+" "}else{b=b+"none "}})}if(!d.hasClass("dslca-module-edit-field-font")&&d.data("affect-on-change-el")!=null&&d.data("affect-on-change-rule")!=null){var r=d.data("ext")||"";var m=d.data("affect-on-change-el");
5
+ var n=d.data("affect-on-change-rule");var o=d.val();var p=o;if(d.hasClass("dslca-module-edit-field-checkbox")){o=b;p=c}if(d.hasClass("dslca-module-edit-field-image")){o='url("'+o+'")'}if(null!==o&&o.length<1&&(n=="background-color"||n=="background")){o="transparent"}n.split(",").forEach(function(a){a=a.replace(/\s+/g,"");var b=jQuery(".dslca-module-being-edited",LiveComposer.Builder.PreviewAreaDocument);var c=m.split(",");var e="#"+b[0].id+" "+c.join(", #"+b[0].id+" ")+" {"+a+": "+o+r+"}";LiveComposer.Builder.Helpers.processInlineStyleTag({context:d,rule:a,elems:m,styleContent:e})})}var s="";if(e.indexOf("css_")!==-1){s=p}else{s=d.val()}jQuery('.dslca-module-option-front[data-id="'+e+'"]',g).val(s);LiveComposer.Utils.publish("LC.moduleChange",{moduleId:g[0].id,optionID:e,optionVal:p||d.val()})}})});jQuery(document).ready(function(a){var b;jQuery(document).on("click",".dslca-module-edit-field-image-add-hook, .dslca-modules-section-edit-field-image-add-hook",function(){var a=jQuery(this);if(a.hasClass("dslca-module-edit-field-image-add-hook")){var c=a.siblings(".dslca-module-edit-field-image");var d=a.siblings(".dslca-module-edit-field-image-remove-hook")}else{var c=a.siblings(".dslca-modules-section-edit-field-upload");var d=a.siblings(".dslca-modules-section-edit-field-image-remove-hook")}var e=false;b=wp.media.frames.file_frame=wp.media({title:"Choose Image",button:{text:"Confirm"},multiple:e});b.on("select",function(){var e=b.state().get("selection").first().toJSON();c.val(e.id);var f=a.parent().attr("data-id");if(e.alt!=""&&f=="image"){jQuery('.dslca-module-edit-option-image_alt input[data-id="image_alt"]').val(e.alt)}if(e.title!=""&&f=="image"){jQuery('.dslca-module-edit-option-image_title input[data-id="image_title"]').val(e.title)}jQuery(".dslca-modules-section-being-edited",LiveComposer.Builder.PreviewAreaDocument).find('.dslca-modules-section-settings input[data-id="dslca-img-url"]').val(e.url);c.trigger("change");a.hide();d.show()});b.open()});jQuery(document).on("click",".dslca-module-edit-field-image-remove-hook, .dslca-modules-section-edit-field-image-remove-hook",function(){var a=jQuery(this);if(a.hasClass("dslca-module-edit-field-image-remove-hook")){var b=a.siblings(".dslca-module-edit-field-image");var c=a.siblings(".dslca-module-edit-field-image-add-hook")}else{var b=a.siblings(".dslca-modules-section-edit-field-upload");var c=a.siblings(".dslca-modules-section-edit-field-image-add-hook")}b.val("").trigger("change");var d=a.parent().attr("data-id");if(d=="image"){jQuery(".dslca-module-edit-option-image_alt input").attr("value","").trigger("change");jQuery(".dslca-module-edit-option-image_alt input").attr("data-val-bckp","").trigger("change");jQuery(".dslca-module-edit-option-image_title input").attr("value","").trigger("change");jQuery(".dslca-module-edit-option-image_title input").attr("data-val-bckp","").trigger("change")}a.hide();c.show()});jQuery(document).on("click",".dslca-wp-editor-save-hook",function(){var a=jQuery(".dslca-wysiwyg-active",LiveComposer.Builder.PreviewAreaDocument).closest(".dslc-module-front");if(typeof tinymce!="undefined"){if(jQuery("#wp-dslcawpeditor-wrap").hasClass("tmce-active")){var b=tinymce.get("dslcawpeditor");var c=b.getContent()}else{var c=jQuery("#dslcawpeditor").val()}jQuery(".dslca-wp-editor").hide();jQuery(".dslca-wysiwyg-active",LiveComposer.Builder.PreviewAreaDocument).html(c);if(a.hasClass("dslc-module-handle-like-accordion")){jQuery(".dslca-wysiwyg-active",LiveComposer.Builder.PreviewAreaDocument).siblings(".dslca-accordion-plain-content").val(c);var d=a.find(".dslc-accordion");LiveComposer.Builder.PreviewAreaWindow.dslc_accordion_generate_code(d)}else if(a.hasClass("dslc-module-handle-like-tabs")){jQuery(".dslca-wysiwyg-active",LiveComposer.Builder.PreviewAreaDocument).siblings(".dslca-tab-plain-content").val(c);var e=a.find(".dslc-tabs");LiveComposer.Builder.PreviewAreaWindow.dslc_tabs_generate_code(e)}dslc_editable_content_gen_code(jQuery(".dslca-wysiwyg-active",LiveComposer.Builder.PreviewAreaDocument));jQuery(".dslca-wysiwyg-active",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-wysiwyg-active")}else{console.info("Live Composer: TinyMCE is undefined.")}});jQuery(document).on("click",".dslca-wp-editor-cancel-hook",function(){a(".dslca-wp-editor").hide();a(".dslca-wysiwyg-active",LiveComposer.Builder.PreviewAreaDocument).removeClass("dslca-wysiwyg-active")})});
js/builder.frontend.all.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).on("click","a:not(.dslca-link)",function(a){a.preventDefault()});function dslca_publish_event(a,b){b=b?b:{};jQuery(document).trigger({type:a,message:{details:b}})}jQuery(window).load(function(a){var b=jQuery("#dslc-main").offset().top;if(b){jQuery("html, body").animate({scrollTop:b},1e3)}});
1
+ jQuery(document).on("click","a:not(.dslca-link)",function(a){a.preventDefault()});function dslca_publish_event(a,b){b=b?b:{};jQuery(document).trigger({type:a,message:{details:b}})}jQuery(window).load(function(a){var b=jQuery("#dslc-main");if(b.length){var c=b.offset().top;if(c){jQuery("html, body").animate({scrollTop:c},1e3)}}});
js/builder.frontend/builder.frontend.main.js CHANGED
@@ -28,11 +28,14 @@ function dslca_publish_event( eventName, eventData ) {
28
  * as we need all styles/images loaded before scrolling.
29
  */
30
  jQuery(window).load(function($) {
31
- var scrollTo = jQuery('#dslc-main').offset().top;
32
- if ( scrollTo ) {
33
- jQuery('html, body').animate({
34
- scrollTop: scrollTo
35
- }, 1000);
 
 
 
 
36
  }
37
-
38
- });
28
  * as we need all styles/images loaded before scrolling.
29
  */
30
  jQuery(window).load(function($) {
31
+ var mainContentBlock = jQuery('#dslc-main');
32
+ // Condition fixes issues/756.
33
+ if ( mainContentBlock.length ) {
34
+ var scrollTo = mainContentBlock.offset().top;
35
+ if ( scrollTo ) {
36
+ jQuery('html, body').animate({
37
+ scrollTop: scrollTo
38
+ }, 1000);
39
+ }
40
  }
41
+ });
 
js/builder/builder.modalwindow.functions.js CHANGED
@@ -296,4 +296,42 @@
296
  jQuery('.dslca-prompt-modal').data( 'id', '' );
297
  });
298
 
299
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
296
  jQuery('.dslca-prompt-modal').data( 'id', '' );
297
  });
298
 
299
+ });
300
+
301
+ /**
302
+ * DON'T MOVE THE FUNCTION BELLOW OUT OF THIS FILE!
303
+ * Hide element when click on another element on the page
304
+ *
305
+ * @author Alexey Petlenko
306
+ */
307
+ jQuery.fn.outerHide = function(params)
308
+ {
309
+ var $ = jQuery;
310
+ params = params ? params : {};
311
+
312
+ var self = this;
313
+
314
+ if ( 'destroy' == params ) {
315
+
316
+ $(document).unbind('click.outer_hide');
317
+ return false;
318
+ }
319
+
320
+ $(document).bind('click.outer_hide', function(e) {
321
+
322
+ if ($(e.target).closest(self).length == 0 &&
323
+ e.target != self &&
324
+ $.inArray($(e.target)[0], $(params.clickObj)) == -1 &&
325
+ $(self).css('display') != 'none'
326
+ )
327
+ {
328
+ if(params.clbk)
329
+ {
330
+ params.clbk();
331
+ }else{
332
+ $(self).hide();
333
+ }
334
+ }
335
+ });
336
+ }
337
+
js/builder/builder.plugins.js CHANGED
@@ -76,40 +76,3 @@ checkSpeed:function(){this.options.duration<this.options.speed+25&&(this.options
76
 
77
  window.mqMutationObserver = observerClass;
78
  }());
79
-
80
-
81
- /**
82
- * Hide element when click on another element on the page
83
- *
84
- * @author Alexey Petlenko
85
- */
86
- jQuery.fn.outerHide = function(params)
87
- {
88
- var $ = jQuery;
89
- params = params ? params : {};
90
-
91
- var self = this;
92
-
93
- if ( 'destroy' == params ) {
94
-
95
- $(document).unbind('click.outer_hide');
96
- return false;
97
- }
98
-
99
- $(document).bind('click.outer_hide', function(e) {
100
-
101
- if ($(e.target).closest(self).length == 0 &&
102
- e.target != self &&
103
- $.inArray($(e.target)[0], $(params.clickObj)) == -1 &&
104
- $(self).css('display') != 'none'
105
- )
106
- {
107
- if(params.clbk)
108
- {
109
- params.clbk();
110
- }else{
111
- $(self).hide();
112
- }
113
- }
114
- });
115
- }
76
 
77
  window.mqMutationObserver = observerClass;
78
  }());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/builder/builder.uigeneral.functions.js CHANGED
@@ -1043,3 +1043,33 @@ function dslca_update_report_log() {
1043
  document.querySelector( '.dslca-show-js-error-hook' ).setAttribute('style','visibility:visible');
1044
  }
1045
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1043
  document.querySelector( '.dslca-show-js-error-hook' ).setAttribute('style','visibility:visible');
1044
  }
1045
  }
1046
+
1047
+
1048
+ // ============================================================
1049
+ jQuery(document).on('editorFrameLoaded', function(){
1050
+
1051
+ var $ = jQuery;
1052
+ console.log( 'editorFrameLoaded' );
1053
+
1054
+ var headerFooter = $('div[data-hf]', LiveComposer.Builder.PreviewAreaDocument);
1055
+ var overlay = '';
1056
+
1057
+ headerFooter.each(function(index, el) {
1058
+ var linkToEdit = $(el).data('editing-link');
1059
+ var hfType = $(el).data('editing-type');
1060
+ var editingLabel = $(el).data('editing-label');
1061
+ var editingSubLabel = $(el).data('editing-sublabel');
1062
+
1063
+ overlay += '<div class="dslc-hf-block-overlay"><a target="_blank" href="' + linkToEdit + '" class="dslc-hf-block-overlay-button dslca-link">' + editingLabel + '</a>';
1064
+ if ( editingSubLabel !== undefined ) {
1065
+ overlay += ' <span class="dslc-hf-block-overlay-text">' + editingSubLabel + '</span>';
1066
+ }
1067
+ overlay += '</div>';
1068
+
1069
+ var htmlObject = document.createElement('div');
1070
+ htmlObject.innerHTML = overlay;
1071
+
1072
+ el.append( htmlObject );
1073
+ });
1074
+
1075
+ });
modules/blog/module.php CHANGED
@@ -2882,664 +2882,679 @@ class DSLC_Blog extends DSLC_Module {
2882
  * @return void
2883
  */
2884
  function output( $options ) {
 
 
 
 
 
2885
 
2886
- if ( is_feed() ) {
2887
- // Prevent category/tag feeds to stuck in an infinite loop
2888
- return false;
2889
- }
2890
 
 
2891
 
2892
- global $dslc_active;
 
 
 
2893
 
2894
- if ( $dslc_active && is_user_logged_in() && current_user_can( DS_LIVE_COMPOSER_CAPABILITY ) )
2895
- $dslc_is_admin = true;
2896
- else
2897
- $dslc_is_admin = false;
2898
 
2899
- // Fix slashes on apostrophes
2900
- if ( isset( $options['button_text'] ) ) {
2901
- $options['button_text'] = stripslashes( $options['button_text'] );
2902
- }
2903
 
 
 
 
 
2904
 
2905
- /* CUSTOM START */
 
 
 
2906
 
2907
- if ( ! isset( $options['excerpt_length'] ) ) $options['excerpt_length'] = 20;
2908
 
2909
- /**
2910
- * Query
2911
- */
2912
 
2913
- // Fix for pagination
2914
- if ( is_front_page() ) { $paged = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1; } else { $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; }
2915
 
2916
- // Fix for pagination from other modules affecting this one when pag disabled
2917
- if ( $options['pagination_type'] == 'disabled' ) $paged = 1;
 
2918
 
2919
- // Fix for offset braking pagination
2920
- $query_offset = $options['offset'];
2921
- if ( $query_offset > 0 && $paged > 1 ) $query_offset = ( $paged - 1 ) * $options['amount'] + $options['offset'];
2922
 
2923
- // General args
2924
- $args = array(
2925
- 'paged' => $paged,
2926
- 'post_type' => 'post',
2927
- 'posts_per_page' => $options['amount'],
2928
- 'order' => $options['order'],
2929
- 'orderby' => $options['orderby'],
2930
- );
2931
 
2932
- // Add offset
2933
- if ( $query_offset > 0 ) {
2934
- $args['offset'] = $query_offset;
2935
- }
2936
 
2937
- if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
2938
- $args['post_status'] = array('publish', 'private');
2939
- }
 
 
 
 
 
2940
 
2941
- // Category args
2942
- if ( isset( $options['categories'] ) && $options['categories'] != '' ) {
 
 
2943
 
2944
- $cats_array = explode( ' ', trim( $options['categories'] ) );
 
 
2945
 
2946
- $args['tax_query'] = array(
2947
- array(
2948
- 'taxonomy' => 'category',
2949
- 'field' => 'term_id',
2950
- 'terms' => $cats_array,
2951
- 'operator' => $options['categories_operator']
2952
- )
2953
- );
2954
 
2955
- }
2956
 
2957
- // Exlcude and Include arrays
2958
- $exclude = array();
2959
- $include = array();
 
 
 
 
 
2960
 
2961
- // Exclude current post
2962
- if ( is_singular( get_post_type() ) )
2963
- $exclude[] = get_the_ID();
2964
 
2965
- // Exclude posts ( option )
2966
- if ( $options['query_post_not_in'] )
2967
- $exclude = array_merge( $exclude, explode( ' ', $options['query_post_not_in'] ) );
2968
 
2969
- // Include posts ( option )
2970
- if ( $options['query_post_in'] )
2971
- $include = array_merge( $include, explode( ' ', $options['query_post_in'] ) );
2972
 
2973
- // Include query parameter
2974
- if ( ! empty( $include ) )
2975
- $args['post__in'] = $include;
2976
 
2977
- // Exclude query parameter
2978
- if ( ! empty( $exclude ) )
2979
- $args['post__not_in'] = $exclude;
2980
 
2981
- // Author archive page
2982
- if ( is_author() && $options['query_alter'] == 'enabled' ) {
2983
- global $authordata;
2984
- $args['author__in'] = array($authordata->data->ID);
2985
- }
2986
 
2987
- // No paging
2988
- if ( $options['pagination_type'] == 'disabled' )
2989
- $args['no_found_rows'] = true;
2990
 
2991
- // Sticky Posts
2992
- if ( $options['sticky_posts'] == 'disabled' )
2993
- $args['ignore_sticky_posts'] = true;
 
 
2994
 
2995
- // Do the query
2996
- if ( ( is_category() || is_tag() || is_tax() || is_search() || is_date() ) && $options['query_alter'] == 'enabled' ) {
2997
- global $wp_query;
2998
- $dslc_query = $wp_query;
2999
- } else {
3000
- $dslc_query = new WP_Query( $args );
3001
- }
3002
 
3003
- /**
3004
- * Unnamed
3005
- */
3006
 
3007
- $columns_class = 'dslc-col dslc-' . $options['columns'] . '-col ';
3008
- $count = 0;
3009
- $real_count = 0;
3010
- $increment = $options['columns'];
3011
- $max_count = 12;
 
 
3012
 
3013
- /**
3014
- * Elements to show
3015
- */
3016
 
3017
- // Main Elements
3018
- $elements = $options['elements'];
3019
- if ( ! empty( $elements ) )
3020
- $elements = explode( ' ', trim( $elements ) );
3021
- else
3022
- $elements = array();
3023
 
 
 
 
3024
 
3025
- // Post Elements
3026
- $post_elements = $options['post_elements'];
3027
- if ( ! empty( $post_elements ) )
3028
- $post_elements = explode( ' ', trim( $post_elements ) );
3029
- else
3030
- $post_elements = 'all';
3031
 
3032
- // Carousel Elements
3033
- $carousel_elements = $options['carousel_elements'];
3034
- if ( ! empty( $carousel_elements ) )
3035
- $carousel_elements = explode( ' ', trim( $carousel_elements ) );
3036
- else
3037
- $carousel_elements = array();
3038
 
3039
- /**
3040
- * Classes generation
3041
- */
 
 
 
3042
 
3043
- // Posts container
3044
- $container_class = 'dslc-posts dslc-blog-posts dslc-clearfix dslc-blog-posts-type-' . $options['type'] . ' dslc-posts-orientation-' . $options['orientation'] . ' ';
3045
- if ( $options['type'] == 'masonry' )
3046
- $container_class .= 'dslc-init-masonry ';
3047
- elseif ( $options['type'] == 'grid' )
3048
- $container_class .= 'dslc-init-grid ';
3049
 
3050
- // Post
3051
- $element_class = 'dslc-post dslc-blog-post ';
3052
- if ( $options['type'] == 'masonry' )
3053
- $element_class .= 'dslc-masonry-item ';
3054
- elseif ( $options['type'] == 'carousel' )
3055
- $element_class .= 'dslc-carousel-item ';
3056
 
3057
- /**
3058
- * What is shown
3059
- */
 
 
 
3060
 
3061
- $show_header = false;
3062
- $show_heading = false;
3063
- $show_filters = false;
3064
- $show_carousel_arrows = false;
3065
- $show_view_all_link = false;
 
3066
 
3067
- if ( in_array( 'main_heading', $elements ) )
3068
- $show_heading = true;
 
3069
 
3070
- if ( ( $elements == 'all' || in_array( 'filters', $elements ) ) && $options['type'] !== 'carousel' )
3071
- $show_filters = true;
 
 
 
3072
 
3073
- if ( $options['type'] == 'carousel' && in_array( 'arrows', $carousel_elements ) )
3074
- $show_carousel_arrows = true;
3075
 
3076
- if ( $show_heading || $show_filters || $show_carousel_arrows )
3077
- $show_header = true;
3078
 
3079
- /**
3080
- * Carousel Items
3081
- */
3082
 
3083
- switch ( $options['columns'] ) {
3084
- case 12 :
3085
- $carousel_items = 1;
3086
- break;
3087
- case 6 :
3088
- $carousel_items = 2;
3089
- break;
3090
- case 4 :
3091
- $carousel_items = 3;
3092
- break;
3093
- case 3 :
3094
- $carousel_items = 4;
3095
- break;
3096
- case 2 :
3097
- $carousel_items = 6;
3098
- break;
3099
- default:
3100
- $carousel_items = 6;
3101
- break;
3102
- }
3103
 
3104
- /**
3105
- * Heading ( output )
3106
- */
3107
 
3108
- if ( $show_header ) :
3109
- ?>
3110
- <div class="dslc-module-heading">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3111
 
3112
- <!-- Heading -->
 
 
3113
 
3114
- <?php if ( $show_heading ) : ?>
 
 
3115
 
3116
- <h2 class="dslca-editable-content" data-id="main_heading_title" data-type="simple" <?php if ( $dslc_is_admin ) echo 'contenteditable'; ?> ><?php echo stripslashes( $options['main_heading_title'] ); ?></h2>
3117
 
3118
- <!-- View all -->
3119
 
3120
- <?php if ( isset( $options['view_all_link'] ) && $options['view_all_link'] !== '' ) : ?>
3121
 
3122
- <span class="dslc-module-heading-view-all"><a href="<?php echo $options['view_all_link']; ?>" class="dslca-editable-content" data-id="main_heading_link_title" data-type="simple" <?php if ( $dslc_is_admin ) echo 'contenteditable'; ?> ><?php echo $options['main_heading_link_title']; ?></a></span>
3123
 
3124
- <?php endif; ?>
 
 
3125
 
3126
  <?php endif; ?>
3127
 
3128
- <!-- Filters -->
3129
 
3130
- <?php
3131
 
3132
- if ( $show_filters ) {
3133
 
3134
- $cats_array = array();
3135
 
3136
- if ( $dslc_query->have_posts() ) {
3137
 
3138
- while ( $dslc_query->have_posts() ) {
3139
 
3140
- $dslc_query->the_post();
3141
 
3142
- $post_cats = get_the_category( get_the_ID() );
3143
- if ( ! empty( $post_cats ) ) {
3144
- foreach ( $post_cats as $post_cat ) {
3145
- $cats_array[$post_cat->slug] = $post_cat->name;
3146
- }
3147
- }
3148
 
 
 
 
 
 
3149
  }
3150
 
3151
  }
3152
 
3153
- ?>
3154
 
3155
- <div class="dslc-post-filters">
3156
- <span class="dslc-post-filter dslc-active dslca-editable-content" data-filter-id="show-all" <?php if ( $dslc_is_admin ){ echo 'data-id="main_filter_title_all" data-type="simple" contenteditable '; } ?>><?php echo $options['main_filter_title_all']; ?></span>
3157
 
3158
- <?php foreach ( $cats_array as $cat_slug => $cat_name ) : ?>
3159
- <span class="dslc-post-filter dslc-inactive" data-filter-id="<?php echo $cat_slug; ?>"><?php echo $cat_name; ?></span>
3160
- <?php endforeach; ?>
3161
 
3162
- </div><!-- .dslc-post-filters -->
 
 
3163
 
3164
- <?php
3165
 
3166
- }
3167
 
3168
- ?>
3169
 
3170
- <!-- Carousel -->
3171
 
3172
- <?php if ( $show_carousel_arrows ) : ?>
3173
- <span class="dslc-carousel-nav fr">
3174
- <span class="dslc-carousel-nav-inner">
3175
- <a href="#" class="dslc-carousel-nav-prev"><span class="dslc-icon-chevron-left"></span></a>
3176
- <a href="#" class="dslc-carousel-nav-next"><span class="dslc-icon-chevron-right"></span></a>
3177
- </span>
3178
- </span><!-- .carousel-nav -->
3179
- <?php endif; ?>
3180
 
3181
- </div><!-- .dslc-module-heading -->
3182
- <?php
 
 
 
 
 
 
3183
 
3184
- endif;
 
3185
 
3186
- /**
3187
- * Posts ( output )
3188
- */
3189
 
3190
- if ( $dslc_query->have_posts() ) {
 
 
3191
 
3192
- ?><div class="<?php echo $container_class; ?>"><?php
3193
 
3194
- ?><div class="dslc-posts-inner"><?php
3195
 
3196
- if ( $options['type'] == 'carousel' ) :
3197
 
3198
- ?><div class="dslc-loader"></div><div class="dslc-carousel" data-stop-on-hover="<?php echo $options['carousel_autoplay_hover']; ?>" data-autoplay="<?php echo $options['carousel_autoplay']; ?>" data-columns="<?php echo $carousel_items; ?>" data-pagination="<?php if ( in_array( 'circles', $carousel_elements ) ) echo 'true'; else echo 'false'; ?>" data-slide-speed="<?php echo $options['arrows_slide_speed']; ?>" data-pagination-speed="<?php echo $options['circles_slide_speed']; ?>"><?php
3199
 
3200
- endif;
3201
 
3202
- while ( $dslc_query->have_posts() ) : $dslc_query->the_post(); $count += $increment;
3203
 
3204
- if ( ! is_sticky() )
3205
- $real_count++;
3206
 
3207
- if ( $count == $max_count ) {
3208
- $count = 0;
3209
- $extra_class = ' dslc-last-col';
3210
- } elseif ( $count == $increment ) {
3211
- $extra_class = ' dslc-first-col';
3212
- } else {
3213
- $extra_class = '';
3214
- }
3215
 
3216
- if ( ! has_post_thumbnail() )
3217
- $extra_class .= ' dslc-post-no-thumb';
 
 
 
 
 
 
3218
 
3219
- // Post Format Class
3220
- $post_format = get_post_format();
3221
- if ( false === $post_format ) $post_format = 'standard';
3222
- $extra_class .= ' dslc-post-format-' . $post_format;
3223
 
3224
- $post_cats = get_the_category( get_the_ID() );
3225
- $post_cats_data = '';
3226
- if ( ! empty( $post_cats ) ) {
3227
- foreach ( $post_cats as $post_cat ) {
3228
- $post_cats_data .= $post_cat->slug . ' ';
3229
- }
3230
- }
3231
 
3232
- ?>
 
 
 
 
 
 
3233
 
3234
- <div class="<?php echo $element_class . $columns_class . $extra_class; ?>" data-cats="<?php echo $post_cats_data; ?>">
3235
 
3236
- <?php if ( $post_elements == 'all' || in_array( 'thumbnail', $post_elements ) ) : ?>
3237
 
3238
- <?php
3239
 
3240
- /**
3241
- * Manual Resize
3242
- */
3243
 
3244
- $manual_resize = false;
3245
- if ( isset( $options['thumb_resize_height'] ) && ! empty( $options['thumb_resize_height'] ) || isset( $options['thumb_resize_width_manual'] ) && ! empty( $options['thumb_resize_width_manual'] ) ) {
 
3246
 
3247
- $manual_resize = true;
3248
- $thumb_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
3249
- $thumb_url = $thumb_url[0];
3250
 
3251
- $thumb_alt = get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true );
3252
- if ( ! $thumb_alt ) $thumb_alt = '';
 
3253
 
3254
- $resize_width = false;
3255
- $resize_height = false;
3256
 
3257
- if ( isset( $options['thumb_resize_width_manual'] ) && ! empty( $options['thumb_resize_width_manual'] ) ) {
3258
- $resize_width = $options['thumb_resize_width_manual'];
3259
- }
3260
 
3261
- if ( isset( $options['thumb_resize_height'] ) && ! empty( $options['thumb_resize_height'] ) ) {
3262
- $resize_height = $options['thumb_resize_height'];
3263
- }
3264
 
 
 
3265
  }
3266
 
3267
- ?>
3268
 
3269
- <?php if ( has_post_thumbnail() ) : ?>
3270
 
3271
- <div class="dslc-blog-post-thumb dslc-post-thumb dslc-on-hover-anim">
3272
 
3273
- <div class="dslc-blog-post-thumb-inner dslca-post-thumb">
3274
- <?php if ( $manual_resize ) : ?>
3275
- <a href="<?php the_permalink(); ?>"><img src="<?php $res_img = dslc_aq_resize( $thumb_url, $resize_width, $resize_height, true ); echo $res_img; ?>" alt="<?php echo $thumb_alt; ?>" /></a>
3276
- <?php else : ?>
3277
- <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( 'full' ); ?></a>
3278
- <?php endif; ?>
3279
- </div><!-- .dslc-blog-post-thumb-inner -->
3280
 
3281
- <?php if ( ( $options['main_location'] == 'inside' || $options['main_location'] == 'inside_visible' ) && ( $post_elements == 'all' || in_array( 'title', $post_elements ) || in_array( 'meta', $post_elements ) || in_array( 'excerpt', $post_elements ) || in_array( 'button', $post_elements ) ) ) : ?>
 
 
 
 
 
 
3282
 
3283
- <div class="dslc-post-main dslc-blog-post-main dslc-init-<?php echo $options['main_position']; ?> <?php if ( $options['main_location'] == 'inside_visible' ) echo 'dslc-blog-post-main-visible'; ?> dslc-on-hover-anim-target dslc-anim-<?php echo $options['css_anim_hover']; ?>" data-dslc-anim="<?php echo $options['css_anim_hover'] ?>" data-dslc-anim-speed="<?php echo $options['css_anim_speed']; ?>">
3284
 
3285
- <div class="dslc-blog-post-main-inner dslc-init-target">
3286
 
3287
- <?php if ( $post_elements == 'all' || in_array( 'title', $post_elements ) ) : ?>
3288
 
3289
- <div class="dslc-blog-post-title">
3290
- <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
3291
- </div><!-- .dslc-blog-post-title -->
3292
 
3293
- <?php endif; ?>
 
 
3294
 
3295
- <?php if ( $post_elements == 'all' || in_array( 'meta', $post_elements ) ) : ?>
3296
 
3297
- <?php
3298
- // Meta Elements
3299
- $meta_elements = $options['meta_elements'];
3300
- $meta_elements = explode( ' ', trim( $meta_elements ) );
3301
- ?>
3302
 
3303
- <div class="dslc-blog-post-meta">
 
 
 
 
3304
 
3305
- <?php if ( in_array( 'author', $meta_elements ) ) : ?>
3306
- <div class="dslc-blog-post-meta-author">
3307
- <?php _e( 'By', 'live-composer-page-builder' ); ?> <?php the_author_posts_link(); ?>
3308
- </div><!-- .dslc-blog-post-meta-author -->
3309
- <?php endif; ?>
3310
 
3311
- <?php if ( in_array( 'author', $meta_elements ) ) : ?>
3312
- <div class="dslc-blog-post-meta-date">
3313
- <?php the_time( get_option( 'date_format' ) ); ?>
3314
- </div><!-- .dslc-blog-post-meta-date -->
3315
- <?php endif; ?>
 
 
 
 
 
 
3316
 
3317
- </div><!-- .dslc-blog-post-meta -->
3318
 
3319
- <?php endif; ?>
3320
 
3321
- <?php if ( $post_elements == 'all' || in_array( 'excerpt', $post_elements ) ) : ?>
3322
 
3323
- <div class="dslc-blog-post-excerpt">
3324
- <?php if ( $options['excerpt_or_content'] == 'content' ) : ?>
 
 
 
 
 
 
 
 
3325
  <?php
3326
  if ( $options['excerpt_length'] > 0 ) {
3327
- echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
 
 
 
3328
  } else {
3329
- echo get_the_content();
 
 
 
3330
  }
3331
  ?>
3332
- <?php else : ?>
3333
- <?php
3334
- if ( $options['excerpt_length'] > 0 ) {
3335
- if ( has_excerpt() )
3336
- echo wp_trim_words( get_the_excerpt(), $options['excerpt_length'] );
3337
- else
3338
- echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
3339
- } else {
3340
- if ( has_excerpt() )
3341
- echo get_the_excerpt();
3342
- else
3343
- echo get_the_content();
3344
- }
3345
- ?>
3346
- <?php endif; ?>
3347
- </div><!-- .dslc-blog-post-excerpt -->
3348
-
3349
- <?php endif; ?>
3350
 
3351
- <?php if ( $post_elements == 'all' || in_array( 'button', $post_elements ) ) : ?>
3352
 
3353
- <div class="dslc-blog-post-read-more">
3354
- <a href="<?php the_permalink(); ?>">
3355
- <?php if ( isset( $options['button_icon_id'] ) && $options['button_icon_id'] != '' ) : ?>
3356
- <span class="dslc-icon dslc-icon-<?php echo $options['button_icon_id']; ?>"></span>
3357
- <?php endif; ?>
3358
- <?php echo $options['button_text']; ?>
3359
- </a>
3360
- </div><!-- .dslc-blog-post-read-more -->
3361
 
3362
- <?php endif; ?>
 
 
 
 
 
 
 
3363
 
3364
- </div><!-- .blog-post-main-inner -->
3365
 
3366
- <a href="<?php the_permalink(); ?>" class="dslc-post-main-inner-link-cover"></a>
3367
 
3368
- </div><!-- .blog-post-main -->
3369
 
3370
- <?php endif; ?>
3371
 
3372
- </div><!-- .dslc-blog-post-thumb -->
3373
 
3374
- <?php endif; ?>
3375
 
3376
  <?php endif; ?>
3377
 
3378
- <?php if ( $options['main_location'] == 'bellow' && ( $post_elements == 'all' || in_array( 'title', $post_elements ) || in_array( 'meta', $post_elements ) || in_array( 'excerpt', $post_elements ) || in_array( 'button', $post_elements ) ) ) : ?>
3379
 
3380
- <div class="dslc-post-main dslc-blog-post-main">
3381
 
3382
- <?php if ( $post_elements == 'all' || in_array( 'title', $post_elements ) ) : ?>
3383
 
3384
- <div class="dslc-blog-post-title">
3385
- <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
3386
- </div><!-- .dslc-blog-post-title -->
3387
 
3388
- <?php endif; ?>
 
 
3389
 
3390
- <?php if ( $post_elements == 'all' || in_array( 'meta', $post_elements ) ) : ?>
3391
 
3392
- <?php
3393
- // Meta Elements
3394
- $meta_elements = $options['meta_elements'];
3395
- $meta_elements = explode( ' ', trim( $meta_elements ) );
3396
- ?>
3397
 
3398
- <div class="dslc-blog-post-meta">
 
 
 
 
3399
 
3400
- <?php if ( in_array( 'author', $meta_elements ) ) : ?>
3401
- <div class="dslc-blog-post-meta-author">
3402
- <span class="dslc-blog-post-meta-avatar">
3403
- <?php echo get_avatar( get_the_author_meta( 'ID' ), 100 ); ?>
3404
- </span>
3405
- <?php _e( 'By', 'live-composer-page-builder' ); ?> <?php the_author_posts_link(); ?>
3406
- </div><!-- .dslc-blog-post-meta-author -->
3407
- <?php endif; ?>
3408
 
3409
- <?php if ( in_array( 'date', $meta_elements ) ) : ?>
3410
- <div class="dslc-blog-post-meta-date">
3411
- <?php the_time( get_option( 'date_format' ) ); ?>
3412
- </div><!-- .dslc-blog-post-meta-date -->
3413
- <?php endif; ?>
 
 
 
3414
 
3415
- </div><!-- .dslc-blog-post-meta -->
 
 
 
 
3416
 
3417
- <?php endif; ?>
3418
 
3419
- <?php if ( $post_elements == 'all' || in_array( 'excerpt', $post_elements ) ) : ?>
3420
 
3421
- <div class="dslc-blog-post-excerpt">
3422
- <?php if ( $options['excerpt_or_content'] == 'content' ) : ?>
3423
- <?php
3424
- if ( $options['excerpt_length'] > 0 ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
3425
  echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
3426
- } else {
 
 
 
3427
  echo get_the_content();
3428
- }
3429
- ?>
3430
- <?php else : ?>
3431
- <?php
3432
- if ( $options['excerpt_length'] > 0 ) {
3433
- if ( has_excerpt() )
3434
- echo wp_trim_words( get_the_excerpt(), $options['excerpt_length'] );
3435
- else
3436
- echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
3437
- } else {
3438
- if ( has_excerpt() )
3439
- echo get_the_excerpt();
3440
- else
3441
- echo get_the_content();
3442
- }
3443
- ?>
3444
- <?php endif; ?>
3445
- </div><!-- .dslc-blog-post-excerpt -->
3446
-
3447
- <?php endif; ?>
3448
 
3449
- <?php if ( $post_elements == 'all' || in_array( 'button', $post_elements ) ) : ?>
3450
 
3451
- <div class="dslc-blog-post-read-more">
3452
- <a href="<?php the_permalink(); ?>">
3453
- <?php if ( isset( $options['button_icon_id'] ) && $options['button_icon_id'] != '' ) : ?>
3454
- <span class="dslc-icon dslc-icon-<?php echo $options['button_icon_id']; ?>"></span>
3455
- <?php endif; ?>
3456
- <?php echo $options['button_text']; ?>
3457
- </a>
3458
- </div><!-- .dslc-blog-post-read-more -->
3459
 
3460
- <?php endif; ?>
 
 
 
 
 
 
 
3461
 
3462
- </div><!-- .blog-post-main -->
3463
 
3464
- <?php if ( $post_elements == 'all' || in_array( 'social', $post_elements ) ) : ?>
3465
 
3466
- <?php
3467
- $share_info = dslc_get_social_count();
3468
- $social_elements = $options['social_elements'];
3469
- if ( ! empty( $social_elements ) )
3470
- $social_elements = explode( ' ', trim( $social_elements ) );
3471
- else
3472
- $social_elements = array();
3473
- ?>
3474
 
3475
- <div class="dslc-posts-social-share">
 
 
 
 
 
 
 
3476
 
3477
- <?php $post_img = wp_get_attachment_url( get_post_thumbnail_id( get_the_ID() ) ); ?>
3478
- <?php $share_status = esc_attr( get_the_title( get_the_ID() ) . ' ' . get_permalink( get_the_ID() ) ); ?>
3479
 
3480
- <?php if ( in_array( 'facebook', $social_elements ) ) : ?>
3481
- <a href="#" target="_blank" onClick="return dslc_social_share(400, 300, 'http://www.facebook.com/share.php?u=<?php echo get_permalink( get_the_ID() ); ?>')"><span class="dslc-icon dslc-icon-facebook"></span><span class="dslc-posts-social-share-count"><?php if ( $share_info ) { echo esc_html( $share_info['fb'] ); } ?></span></a>
3482
- <?php endif; ?>
3483
 
3484
- <?php if ( in_array( 'twitter', $social_elements ) ) : ?>
3485
- <a href="#" onClick="return dslc_social_share(400, 300, 'https://twitter.com/home?status=<?php echo $share_status; ?>')" ><span class="dslc-icon dslc-icon-twitter"></span><span class="dslc-posts-social-share-count"><?php if ( $share_info ) { echo esc_html( $share_info['twitter'] ); } ?></span></a>
3486
- <?php endif; ?>
3487
 
3488
- <?php if ( in_array( 'pinterest', $social_elements ) ) : ?>
3489
- <a href="#" onClick="return dslc_social_share(400, 300, 'https://pinterest.com/pin/create/button/?url=<?php the_permalink(); ?>&amp;media=<?php echo esc_html( $post_img ); ?>&amp;description=<?php echo esc_attr( get_the_excerpt() ); ?>')"><span class="dslc-icon dslc-icon-pinterest"></span><span class="dslc-posts-social-share-count"><?php if ( $share_info ) { echo esc_html( $share_info['pinterest'] ); } ?></span></a>
3490
- <?php endif; ?>
3491
 
3492
- </div><!-- .dslc-posts-social-share -->
 
 
3493
 
3494
- <?php endif; ?>
3495
 
3496
  <?php endif; ?>
3497
 
3498
- </div><!-- .dslc-blog-post -->
3499
 
3500
- <?php do_action( 'dslc_blog_module_after_post', $real_count ); ?>
3501
 
3502
- <?php
3503
 
3504
- // Row Separator
3505
- if ( $options['type'] == 'grid' && $count == 0 && $real_count != $dslc_query->found_posts && $real_count != $options['amount'] && $options['separator_enabled'] == 'enabled' )
3506
- echo '<div class="dslc-post-separator"></div>';
3507
 
3508
- endwhile;
 
 
3509
 
3510
- if ( $options['type'] == 'carousel' ) :
3511
 
3512
- ?></div><?php
3513
 
3514
- endif;
3515
 
3516
- ?></div><!-- .dslc-posts-inner --><?php
3517
 
3518
- ?></div><!-- .dslc-blog-posts --><?php
3519
 
3520
- } else {
3521
 
3522
- if ( $dslc_is_admin ) :
3523
- ?><div class="dslc-notification dslc-red"><?php _e( 'You do not have any blog posts at the moment. Go to <strong>WP Admin &rarr; Posts</strong> to add some.', 'live-composer-page-builder' ); ?> <span class="dslca-refresh-module-hook dslc-icon dslc-icon-refresh"></span></span></div><?php
3524
- endif;
3525
 
3526
- }
 
 
3527
 
3528
- /**
3529
- * Pagination
3530
- */
 
 
3531
 
3532
- if ( isset( $options['pagination_type'] ) && $options['pagination_type'] != 'disabled' ) {
3533
- $num_pages = $dslc_query->max_num_pages;
3534
- if ( $options['offset'] > 0 ) {
3535
- $num_pages = ceil( ( $dslc_query->found_posts - $options['offset'] ) / $options['amount'] );
3536
- }
3537
- dslc_post_pagination( array('pages' => $num_pages, 'type' => $options['pagination_type']) );
3538
  }
 
 
3539
 
3540
 
3541
- wp_reset_postdata();
3542
 
3543
- }
3544
 
3545
- }
 
 
 
 
 
2882
  * @return void
2883
  */
2884
  function output( $options ) {
2885
+ ?>
2886
+ [dslc_module_blog_output]<?php echo serialize($options); ?>[/dslc_module_blog_output]
2887
+ <?php
2888
+ }
2889
+ }
2890
 
2891
+ function dslc_module_blog_output ( $atts, $content = null ) {
2892
+ // Uncode module options passed as serialized content.
2893
+ $options = unserialize( $content );
 
2894
 
2895
+ ob_start();
2896
 
2897
+ if ( is_feed() ) {
2898
+ // Prevent category/tag feeds to stuck in an infinite loop
2899
+ return false;
2900
+ }
2901
 
 
 
 
 
2902
 
2903
+ global $dslc_active;
 
 
 
2904
 
2905
+ if ( $dslc_active && is_user_logged_in() && current_user_can( DS_LIVE_COMPOSER_CAPABILITY ) )
2906
+ $dslc_is_admin = true;
2907
+ else
2908
+ $dslc_is_admin = false;
2909
 
2910
+ // Fix slashes on apostrophes
2911
+ if ( isset( $options['button_text'] ) ) {
2912
+ $options['button_text'] = stripslashes( $options['button_text'] );
2913
+ }
2914
 
 
2915
 
2916
+ /* CUSTOM START */
 
 
2917
 
2918
+ if ( ! isset( $options['excerpt_length'] ) ) $options['excerpt_length'] = 20;
 
2919
 
2920
+ /**
2921
+ * Query
2922
+ */
2923
 
2924
+ // Fix for pagination
2925
+ if ( is_front_page() ) { $paged = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1; } else { $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; }
 
2926
 
2927
+ // Fix for pagination from other modules affecting this one when pag disabled
2928
+ if ( $options['pagination_type'] == 'disabled' ) $paged = 1;
 
 
 
 
 
 
2929
 
2930
+ // Fix for offset braking pagination
2931
+ $query_offset = $options['offset'];
2932
+ if ( $query_offset > 0 && $paged > 1 ) $query_offset = ( $paged - 1 ) * $options['amount'] + $options['offset'];
 
2933
 
2934
+ // General args
2935
+ $args = array(
2936
+ 'paged' => $paged,
2937
+ 'post_type' => 'post',
2938
+ 'posts_per_page' => $options['amount'],
2939
+ 'order' => $options['order'],
2940
+ 'orderby' => $options['orderby'],
2941
+ );
2942
 
2943
+ // Add offset
2944
+ if ( $query_offset > 0 ) {
2945
+ $args['offset'] = $query_offset;
2946
+ }
2947
 
2948
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
2949
+ $args['post_status'] = array('publish', 'private');
2950
+ }
2951
 
2952
+ // Category args
2953
+ if ( isset( $options['categories'] ) && $options['categories'] != '' ) {
 
 
 
 
 
 
2954
 
2955
+ $cats_array = explode( ' ', trim( $options['categories'] ) );
2956
 
2957
+ $args['tax_query'] = array(
2958
+ array(
2959
+ 'taxonomy' => 'category',
2960
+ 'field' => 'term_id',
2961
+ 'terms' => $cats_array,
2962
+ 'operator' => $options['categories_operator']
2963
+ )
2964
+ );
2965
 
2966
+ }
 
 
2967
 
2968
+ // Exlcude and Include arrays
2969
+ $exclude = array();
2970
+ $include = array();
2971
 
2972
+ // Exclude current post
2973
+ if ( is_singular( get_post_type() ) )
2974
+ $exclude[] = get_the_ID();
2975
 
2976
+ // Exclude posts ( option )
2977
+ if ( $options['query_post_not_in'] )
2978
+ $exclude = array_merge( $exclude, explode( ' ', $options['query_post_not_in'] ) );
2979
 
2980
+ // Include posts ( option )
2981
+ if ( $options['query_post_in'] )
2982
+ $include = array_merge( $include, explode( ' ', $options['query_post_in'] ) );
2983
 
2984
+ // Include query parameter
2985
+ if ( ! empty( $include ) )
2986
+ $args['post__in'] = $include;
 
 
2987
 
2988
+ // Exclude query parameter
2989
+ if ( ! empty( $exclude ) )
2990
+ $args['post__not_in'] = $exclude;
2991
 
2992
+ // Author archive page
2993
+ if ( is_author() && $options['query_alter'] == 'enabled' ) {
2994
+ global $authordata;
2995
+ $args['author__in'] = array($authordata->data->ID);
2996
+ }
2997
 
2998
+ // No paging
2999
+ if ( $options['pagination_type'] == 'disabled' )
3000
+ $args['no_found_rows'] = true;
 
 
 
 
3001
 
3002
+ // Sticky Posts
3003
+ if ( $options['sticky_posts'] == 'disabled' )
3004
+ $args['ignore_sticky_posts'] = true;
3005
 
3006
+ // Do the query
3007
+ if ( ( is_category() || is_tag() || is_tax() || is_search() || is_date() ) && $options['query_alter'] == 'enabled' ) {
3008
+ global $wp_query;
3009
+ $dslc_query = $wp_query;
3010
+ } else {
3011
+ $dslc_query = new WP_Query( $args );
3012
+ }
3013
 
3014
+ /**
3015
+ * Unnamed
3016
+ */
3017
 
3018
+ $columns_class = 'dslc-col dslc-' . $options['columns'] . '-col ';
3019
+ $count = 0;
3020
+ $real_count = 0;
3021
+ $increment = $options['columns'];
3022
+ $max_count = 12;
 
3023
 
3024
+ /**
3025
+ * Elements to show
3026
+ */
3027
 
3028
+ // Main Elements
3029
+ $elements = $options['elements'];
3030
+ if ( ! empty( $elements ) )
3031
+ $elements = explode( ' ', trim( $elements ) );
3032
+ else
3033
+ $elements = array();
3034
 
 
 
 
 
 
 
3035
 
3036
+ // Post Elements
3037
+ $post_elements = $options['post_elements'];
3038
+ if ( ! empty( $post_elements ) )
3039
+ $post_elements = explode( ' ', trim( $post_elements ) );
3040
+ else
3041
+ $post_elements = 'all';
3042
 
3043
+ // Carousel Elements
3044
+ $carousel_elements = $options['carousel_elements'];
3045
+ if ( ! empty( $carousel_elements ) )
3046
+ $carousel_elements = explode( ' ', trim( $carousel_elements ) );
3047
+ else
3048
+ $carousel_elements = array();
3049
 
3050
+ /**
3051
+ * Classes generation
3052
+ */
 
 
 
3053
 
3054
+ // Posts container
3055
+ $container_class = 'dslc-posts dslc-blog-posts dslc-clearfix dslc-blog-posts-type-' . $options['type'] . ' dslc-posts-orientation-' . $options['orientation'] . ' ';
3056
+ if ( $options['type'] == 'masonry' )
3057
+ $container_class .= 'dslc-init-masonry ';
3058
+ elseif ( $options['type'] == 'grid' )
3059
+ $container_class .= 'dslc-init-grid ';
3060
 
3061
+ // Post
3062
+ $element_class = 'dslc-post dslc-blog-post ';
3063
+ if ( $options['type'] == 'masonry' )
3064
+ $element_class .= 'dslc-masonry-item ';
3065
+ elseif ( $options['type'] == 'carousel' )
3066
+ $element_class .= 'dslc-carousel-item ';
3067
 
3068
+ /**
3069
+ * What is shown
3070
+ */
3071
 
3072
+ $show_header = false;
3073
+ $show_heading = false;
3074
+ $show_filters = false;
3075
+ $show_carousel_arrows = false;
3076
+ $show_view_all_link = false;
3077
 
3078
+ if ( in_array( 'main_heading', $elements ) )
3079
+ $show_heading = true;
3080
 
3081
+ if ( ( $elements == 'all' || in_array( 'filters', $elements ) ) && $options['type'] !== 'carousel' )
3082
+ $show_filters = true;
3083
 
3084
+ if ( $options['type'] == 'carousel' && in_array( 'arrows', $carousel_elements ) )
3085
+ $show_carousel_arrows = true;
 
3086
 
3087
+ if ( $show_heading || $show_filters || $show_carousel_arrows )
3088
+ $show_header = true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3089
 
3090
+ /**
3091
+ * Carousel Items
3092
+ */
3093
 
3094
+ switch ( $options['columns'] ) {
3095
+ case 12 :
3096
+ $carousel_items = 1;
3097
+ break;
3098
+ case 6 :
3099
+ $carousel_items = 2;
3100
+ break;
3101
+ case 4 :
3102
+ $carousel_items = 3;
3103
+ break;
3104
+ case 3 :
3105
+ $carousel_items = 4;
3106
+ break;
3107
+ case 2 :
3108
+ $carousel_items = 6;
3109
+ break;
3110
+ default:
3111
+ $carousel_items = 6;
3112
+ break;
3113
+ }
3114
 
3115
+ /**
3116
+ * Heading ( output )
3117
+ */
3118
 
3119
+ if ( $show_header ) :
3120
+ ?>
3121
+ <div class="dslc-module-heading">
3122
 
3123
+ <!-- Heading -->
3124
 
3125
+ <?php if ( $show_heading ) : ?>
3126
 
3127
+ <h2 class="dslca-editable-content" data-id="main_heading_title" data-type="simple" <?php if ( $dslc_is_admin ) echo 'contenteditable'; ?> ><?php echo stripslashes( $options['main_heading_title'] ); ?></h2>
3128
 
3129
+ <!-- View all -->
3130
 
3131
+ <?php if ( isset( $options['view_all_link'] ) && $options['view_all_link'] !== '' ) : ?>
3132
+
3133
+ <span class="dslc-module-heading-view-all"><a href="<?php echo $options['view_all_link']; ?>" class="dslca-editable-content" data-id="main_heading_link_title" data-type="simple" <?php if ( $dslc_is_admin ) echo 'contenteditable'; ?> ><?php echo $options['main_heading_link_title']; ?></a></span>
3134
 
3135
  <?php endif; ?>
3136
 
3137
+ <?php endif; ?>
3138
 
3139
+ <!-- Filters -->
3140
 
3141
+ <?php
3142
 
3143
+ if ( $show_filters ) {
3144
 
3145
+ $cats_array = array();
3146
 
3147
+ if ( $dslc_query->have_posts() ) {
3148
 
3149
+ while ( $dslc_query->have_posts() ) {
3150
 
3151
+ $dslc_query->the_post();
 
 
 
 
 
3152
 
3153
+ $post_cats = get_the_category( get_the_ID() );
3154
+ if ( ! empty( $post_cats ) ) {
3155
+ foreach ( $post_cats as $post_cat ) {
3156
+ $cats_array[$post_cat->slug] = $post_cat->name;
3157
+ }
3158
  }
3159
 
3160
  }
3161
 
3162
+ }
3163
 
3164
+ ?>
 
3165
 
3166
+ <div class="dslc-post-filters">
3167
+ <span class="dslc-post-filter dslc-active dslca-editable-content" data-filter-id="show-all" <?php if ( $dslc_is_admin ){ echo 'data-id="main_filter_title_all" data-type="simple" contenteditable '; } ?>><?php echo $options['main_filter_title_all']; ?></span>
 
3168
 
3169
+ <?php foreach ( $cats_array as $cat_slug => $cat_name ) : ?>
3170
+ <span class="dslc-post-filter dslc-inactive" data-filter-id="<?php echo $cat_slug; ?>"><?php echo $cat_name; ?></span>
3171
+ <?php endforeach; ?>
3172
 
3173
+ </div><!-- .dslc-post-filters -->
3174
 
3175
+ <?php
3176
 
3177
+ }
3178
 
3179
+ ?>
3180
 
3181
+ <!-- Carousel -->
 
 
 
 
 
 
 
3182
 
3183
+ <?php if ( $show_carousel_arrows ) : ?>
3184
+ <span class="dslc-carousel-nav fr">
3185
+ <span class="dslc-carousel-nav-inner">
3186
+ <a href="#" class="dslc-carousel-nav-prev"><span class="dslc-icon-chevron-left"></span></a>
3187
+ <a href="#" class="dslc-carousel-nav-next"><span class="dslc-icon-chevron-right"></span></a>
3188
+ </span>
3189
+ </span><!-- .carousel-nav -->
3190
+ <?php endif; ?>
3191
 
3192
+ </div><!-- .dslc-module-heading -->
3193
+ <?php
3194
 
3195
+ endif;
 
 
3196
 
3197
+ /**
3198
+ * Posts ( output )
3199
+ */
3200
 
3201
+ if ( $dslc_query->have_posts() ) {
3202
 
3203
+ ?><div class="<?php echo $container_class; ?>"><?php
3204
 
3205
+ ?><div class="dslc-posts-inner"><?php
3206
 
3207
+ if ( $options['type'] == 'carousel' ) :
3208
 
3209
+ ?><div class="dslc-loader"></div><div class="dslc-carousel" data-stop-on-hover="<?php echo $options['carousel_autoplay_hover']; ?>" data-autoplay="<?php echo $options['carousel_autoplay']; ?>" data-columns="<?php echo $carousel_items; ?>" data-pagination="<?php if ( in_array( 'circles', $carousel_elements ) ) echo 'true'; else echo 'false'; ?>" data-slide-speed="<?php echo $options['arrows_slide_speed']; ?>" data-pagination-speed="<?php echo $options['circles_slide_speed']; ?>"><?php
3210
 
3211
+ endif;
3212
 
3213
+ while ( $dslc_query->have_posts() ) : $dslc_query->the_post(); $count += $increment;
 
3214
 
3215
+ if ( ! is_sticky() )
3216
+ $real_count++;
 
 
 
 
 
 
3217
 
3218
+ if ( $count == $max_count ) {
3219
+ $count = 0;
3220
+ $extra_class = ' dslc-last-col';
3221
+ } elseif ( $count == $increment ) {
3222
+ $extra_class = ' dslc-first-col';
3223
+ } else {
3224
+ $extra_class = '';
3225
+ }
3226
 
3227
+ if ( ! has_post_thumbnail() )
3228
+ $extra_class .= ' dslc-post-no-thumb';
 
 
3229
 
3230
+ // Post Format Class
3231
+ $post_format = get_post_format();
3232
+ if ( false === $post_format ) $post_format = 'standard';
3233
+ $extra_class .= ' dslc-post-format-' . $post_format;
 
 
 
3234
 
3235
+ $post_cats = get_the_category( get_the_ID() );
3236
+ $post_cats_data = '';
3237
+ if ( ! empty( $post_cats ) ) {
3238
+ foreach ( $post_cats as $post_cat ) {
3239
+ $post_cats_data .= $post_cat->slug . ' ';
3240
+ }
3241
+ }
3242
 
3243
+ ?>
3244
 
3245
+ <div class="<?php echo $element_class . $columns_class . $extra_class; ?>" data-cats="<?php echo $post_cats_data; ?>">
3246
 
3247
+ <?php if ( $post_elements == 'all' || in_array( 'thumbnail', $post_elements ) ) : ?>
3248
 
3249
+ <?php
 
 
3250
 
3251
+ /**
3252
+ * Manual Resize
3253
+ */
3254
 
3255
+ $manual_resize = false;
3256
+ if ( isset( $options['thumb_resize_height'] ) && ! empty( $options['thumb_resize_height'] ) || isset( $options['thumb_resize_width_manual'] ) && ! empty( $options['thumb_resize_width_manual'] ) ) {
 
3257
 
3258
+ $manual_resize = true;
3259
+ $thumb_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
3260
+ $thumb_url = $thumb_url[0];
3261
 
3262
+ $thumb_alt = get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true );
3263
+ if ( ! $thumb_alt ) $thumb_alt = '';
3264
 
3265
+ $resize_width = false;
3266
+ $resize_height = false;
 
3267
 
3268
+ if ( isset( $options['thumb_resize_width_manual'] ) && ! empty( $options['thumb_resize_width_manual'] ) ) {
3269
+ $resize_width = $options['thumb_resize_width_manual'];
3270
+ }
3271
 
3272
+ if ( isset( $options['thumb_resize_height'] ) && ! empty( $options['thumb_resize_height'] ) ) {
3273
+ $resize_height = $options['thumb_resize_height'];
3274
  }
3275
 
3276
+ }
3277
 
3278
+ ?>
3279
 
3280
+ <?php if ( has_post_thumbnail() ) : ?>
3281
 
3282
+ <div class="dslc-blog-post-thumb dslc-post-thumb dslc-on-hover-anim">
 
 
 
 
 
 
3283
 
3284
+ <div class="dslc-blog-post-thumb-inner dslca-post-thumb">
3285
+ <?php if ( $manual_resize ) : ?>
3286
+ <a href="<?php the_permalink(); ?>"><img src="<?php $res_img = dslc_aq_resize( $thumb_url, $resize_width, $resize_height, true ); echo $res_img; ?>" alt="<?php echo $thumb_alt; ?>" /></a>
3287
+ <?php else : ?>
3288
+ <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( 'full' ); ?></a>
3289
+ <?php endif; ?>
3290
+ </div><!-- .dslc-blog-post-thumb-inner -->
3291
 
3292
+ <?php if ( ( $options['main_location'] == 'inside' || $options['main_location'] == 'inside_visible' ) && ( $post_elements == 'all' || in_array( 'title', $post_elements ) || in_array( 'meta', $post_elements ) || in_array( 'excerpt', $post_elements ) || in_array( 'button', $post_elements ) ) ) : ?>
3293
 
3294
+ <div class="dslc-post-main dslc-blog-post-main dslc-init-<?php echo $options['main_position']; ?> <?php if ( $options['main_location'] == 'inside_visible' ) echo 'dslc-blog-post-main-visible'; ?> dslc-on-hover-anim-target dslc-anim-<?php echo $options['css_anim_hover']; ?>" data-dslc-anim="<?php echo $options['css_anim_hover'] ?>" data-dslc-anim-speed="<?php echo $options['css_anim_speed']; ?>">
3295
 
3296
+ <div class="dslc-blog-post-main-inner dslc-init-target">
3297
 
3298
+ <?php if ( $post_elements == 'all' || in_array( 'title', $post_elements ) ) : ?>
 
 
3299
 
3300
+ <div class="dslc-blog-post-title">
3301
+ <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
3302
+ </div><!-- .dslc-blog-post-title -->
3303
 
3304
+ <?php endif; ?>
3305
 
3306
+ <?php if ( $post_elements == 'all' || in_array( 'meta', $post_elements ) ) : ?>
 
 
 
 
3307
 
3308
+ <?php
3309
+ // Meta Elements
3310
+ $meta_elements = $options['meta_elements'];
3311
+ $meta_elements = explode( ' ', trim( $meta_elements ) );
3312
+ ?>
3313
 
3314
+ <div class="dslc-blog-post-meta">
 
 
 
 
3315
 
3316
+ <?php if ( in_array( 'author', $meta_elements ) ) : ?>
3317
+ <div class="dslc-blog-post-meta-author">
3318
+ <?php _e( 'By', 'live-composer-page-builder' ); ?> <?php the_author_posts_link(); ?>
3319
+ </div><!-- .dslc-blog-post-meta-author -->
3320
+ <?php endif; ?>
3321
+
3322
+ <?php if ( in_array( 'author', $meta_elements ) ) : ?>
3323
+ <div class="dslc-blog-post-meta-date">
3324
+ <?php the_time( get_option( 'date_format' ) ); ?>
3325
+ </div><!-- .dslc-blog-post-meta-date -->
3326
+ <?php endif; ?>
3327
 
3328
+ </div><!-- .dslc-blog-post-meta -->
3329
 
3330
+ <?php endif; ?>
3331
 
3332
+ <?php if ( $post_elements == 'all' || in_array( 'excerpt', $post_elements ) ) : ?>
3333
 
3334
+ <div class="dslc-blog-post-excerpt">
3335
+ <?php if ( $options['excerpt_or_content'] == 'content' ) : ?>
3336
+ <?php
3337
+ if ( $options['excerpt_length'] > 0 ) {
3338
+ echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
3339
+ } else {
3340
+ echo get_the_content();
3341
+ }
3342
+ ?>
3343
+ <?php else : ?>
3344
  <?php
3345
  if ( $options['excerpt_length'] > 0 ) {
3346
+ if ( has_excerpt() )
3347
+ echo wp_trim_words( get_the_excerpt(), $options['excerpt_length'] );
3348
+ else
3349
+ echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
3350
  } else {
3351
+ if ( has_excerpt() )
3352
+ echo get_the_excerpt();
3353
+ else
3354
+ echo get_the_content();
3355
  }
3356
  ?>
3357
+ <?php endif; ?>
3358
+ </div><!-- .dslc-blog-post-excerpt -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3359
 
3360
+ <?php endif; ?>
3361
 
3362
+ <?php if ( $post_elements == 'all' || in_array( 'button', $post_elements ) ) : ?>
 
 
 
 
 
 
 
3363
 
3364
+ <div class="dslc-blog-post-read-more">
3365
+ <a href="<?php the_permalink(); ?>">
3366
+ <?php if ( isset( $options['button_icon_id'] ) && $options['button_icon_id'] != '' ) : ?>
3367
+ <span class="dslc-icon dslc-icon-<?php echo $options['button_icon_id']; ?>"></span>
3368
+ <?php endif; ?>
3369
+ <?php echo $options['button_text']; ?>
3370
+ </a>
3371
+ </div><!-- .dslc-blog-post-read-more -->
3372
 
3373
+ <?php endif; ?>
3374
 
3375
+ </div><!-- .blog-post-main-inner -->
3376
 
3377
+ <a href="<?php the_permalink(); ?>" class="dslc-post-main-inner-link-cover"></a>
3378
 
3379
+ </div><!-- .blog-post-main -->
3380
 
3381
+ <?php endif; ?>
3382
 
3383
+ </div><!-- .dslc-blog-post-thumb -->
3384
 
3385
  <?php endif; ?>
3386
 
3387
+ <?php endif; ?>
3388
 
3389
+ <?php if ( $options['main_location'] == 'bellow' && ( $post_elements == 'all' || in_array( 'title', $post_elements ) || in_array( 'meta', $post_elements ) || in_array( 'excerpt', $post_elements ) || in_array( 'button', $post_elements ) ) ) : ?>
3390
 
3391
+ <div class="dslc-post-main dslc-blog-post-main">
3392
 
3393
+ <?php if ( $post_elements == 'all' || in_array( 'title', $post_elements ) ) : ?>
 
 
3394
 
3395
+ <div class="dslc-blog-post-title">
3396
+ <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
3397
+ </div><!-- .dslc-blog-post-title -->
3398
 
3399
+ <?php endif; ?>
3400
 
3401
+ <?php if ( $post_elements == 'all' || in_array( 'meta', $post_elements ) ) : ?>
 
 
 
 
3402
 
3403
+ <?php
3404
+ // Meta Elements
3405
+ $meta_elements = $options['meta_elements'];
3406
+ $meta_elements = explode( ' ', trim( $meta_elements ) );
3407
+ ?>
3408
 
3409
+ <div class="dslc-blog-post-meta">
 
 
 
 
 
 
 
3410
 
3411
+ <?php if ( in_array( 'author', $meta_elements ) ) : ?>
3412
+ <div class="dslc-blog-post-meta-author">
3413
+ <span class="dslc-blog-post-meta-avatar">
3414
+ <?php echo get_avatar( get_the_author_meta( 'ID' ), 100 ); ?>
3415
+ </span>
3416
+ <?php _e( 'By', 'live-composer-page-builder' ); ?> <?php the_author_posts_link(); ?>
3417
+ </div><!-- .dslc-blog-post-meta-author -->
3418
+ <?php endif; ?>
3419
 
3420
+ <?php if ( in_array( 'date', $meta_elements ) ) : ?>
3421
+ <div class="dslc-blog-post-meta-date">
3422
+ <?php the_time( get_option( 'date_format' ) ); ?>
3423
+ </div><!-- .dslc-blog-post-meta-date -->
3424
+ <?php endif; ?>
3425
 
3426
+ </div><!-- .dslc-blog-post-meta -->
3427
 
3428
+ <?php endif; ?>
3429
 
3430
+ <?php if ( $post_elements == 'all' || in_array( 'excerpt', $post_elements ) ) : ?>
3431
+
3432
+ <div class="dslc-blog-post-excerpt">
3433
+ <?php if ( $options['excerpt_or_content'] == 'content' ) : ?>
3434
+ <?php
3435
+ if ( $options['excerpt_length'] > 0 ) {
3436
+ echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
3437
+ } else {
3438
+ echo get_the_content();
3439
+ }
3440
+ ?>
3441
+ <?php else : ?>
3442
+ <?php
3443
+ if ( $options['excerpt_length'] > 0 ) {
3444
+ if ( has_excerpt() )
3445
+ echo wp_trim_words( get_the_excerpt(), $options['excerpt_length'] );
3446
+ else
3447
  echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
3448
+ } else {
3449
+ if ( has_excerpt() )
3450
+ echo get_the_excerpt();
3451
+ else
3452
  echo get_the_content();
3453
+ }
3454
+ ?>
3455
+ <?php endif; ?>
3456
+ </div><!-- .dslc-blog-post-excerpt -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3457
 
3458
+ <?php endif; ?>
3459
 
3460
+ <?php if ( $post_elements == 'all' || in_array( 'button', $post_elements ) ) : ?>
 
 
 
 
 
 
 
3461
 
3462
+ <div class="dslc-blog-post-read-more">
3463
+ <a href="<?php the_permalink(); ?>">
3464
+ <?php if ( isset( $options['button_icon_id'] ) && $options['button_icon_id'] != '' ) : ?>
3465
+ <span class="dslc-icon dslc-icon-<?php echo $options['button_icon_id']; ?>"></span>
3466
+ <?php endif; ?>
3467
+ <?php echo $options['button_text']; ?>
3468
+ </a>
3469
+ </div><!-- .dslc-blog-post-read-more -->
3470
 
3471
+ <?php endif; ?>
3472
 
3473
+ </div><!-- .blog-post-main -->
3474
 
3475
+ <?php if ( $post_elements == 'all' || in_array( 'social', $post_elements ) ) : ?>
 
 
 
 
 
 
 
3476
 
3477
+ <?php
3478
+ $share_info = dslc_get_social_count();
3479
+ $social_elements = $options['social_elements'];
3480
+ if ( ! empty( $social_elements ) )
3481
+ $social_elements = explode( ' ', trim( $social_elements ) );
3482
+ else
3483
+ $social_elements = array();
3484
+ ?>
3485
 
3486
+ <div class="dslc-posts-social-share">
 
3487
 
3488
+ <?php $post_img = wp_get_attachment_url( get_post_thumbnail_id( get_the_ID() ) ); ?>
3489
+ <?php $share_status = esc_attr( get_the_title( get_the_ID() ) . ' ' . get_permalink( get_the_ID() ) ); ?>
 
3490
 
3491
+ <?php if ( in_array( 'facebook', $social_elements ) ) : ?>
3492
+ <a href="#" target="_blank" onClick="return dslc_social_share(400, 300, 'http://www.facebook.com/share.php?u=<?php echo get_permalink( get_the_ID() ); ?>')"><span class="dslc-icon dslc-icon-facebook"></span><span class="dslc-posts-social-share-count"><?php if ( $share_info ) { echo esc_html( $share_info['fb'] ); } ?></span></a>
3493
+ <?php endif; ?>
3494
 
3495
+ <?php if ( in_array( 'twitter', $social_elements ) ) : ?>
3496
+ <a href="#" onClick="return dslc_social_share(400, 300, 'https://twitter.com/home?status=<?php echo $share_status; ?>')" ><span class="dslc-icon dslc-icon-twitter"></span><span class="dslc-posts-social-share-count"><?php if ( $share_info ) { echo esc_html( $share_info['twitter'] ); } ?></span></a>
3497
+ <?php endif; ?>
3498
 
3499
+ <?php if ( in_array( 'pinterest', $social_elements ) ) : ?>
3500
+ <a href="#" onClick="return dslc_social_share(400, 300, 'https://pinterest.com/pin/create/button/?url=<?php the_permalink(); ?>&amp;media=<?php echo esc_html( $post_img ); ?>&amp;description=<?php echo esc_attr( get_the_excerpt() ); ?>')"><span class="dslc-icon dslc-icon-pinterest"></span><span class="dslc-posts-social-share-count"><?php if ( $share_info ) { echo esc_html( $share_info['pinterest'] ); } ?></span></a>
3501
+ <?php endif; ?>
3502
 
3503
+ </div><!-- .dslc-posts-social-share -->
3504
 
3505
  <?php endif; ?>
3506
 
3507
+ <?php endif; ?>
3508
 
3509
+ </div><!-- .dslc-blog-post -->
3510
 
3511
+ <?php do_action( 'dslc_blog_module_after_post', $real_count ); ?>
3512
 
3513
+ <?php
 
 
3514
 
3515
+ // Row Separator
3516
+ if ( $options['type'] == 'grid' && $count == 0 && $real_count != $dslc_query->found_posts && $real_count != $options['amount'] && $options['separator_enabled'] == 'enabled' )
3517
+ echo '<div class="dslc-post-separator"></div>';
3518
 
3519
+ endwhile;
3520
 
3521
+ if ( $options['type'] == 'carousel' ) :
3522
 
3523
+ ?></div><?php
3524
 
3525
+ endif;
3526
 
3527
+ ?></div><!-- .dslc-posts-inner --><?php
3528
 
3529
+ ?></div><!-- .dslc-blog-posts --><?php
3530
 
3531
+ } else {
 
 
3532
 
3533
+ if ( $dslc_is_admin ) :
3534
+ ?><div class="dslc-notification dslc-red"><?php _e( 'You do not have any blog posts at the moment. Go to <strong>WP Admin &rarr; Posts</strong> to add some.', 'live-composer-page-builder' ); ?> <span class="dslca-refresh-module-hook dslc-icon dslc-icon-refresh"></span></span></div><?php
3535
+ endif;
3536
 
3537
+ }
3538
+
3539
+ /**
3540
+ * Pagination
3541
+ */
3542
 
3543
+ if ( isset( $options['pagination_type'] ) && $options['pagination_type'] != 'disabled' ) {
3544
+ $num_pages = $dslc_query->max_num_pages;
3545
+ if ( $options['offset'] > 0 ) {
3546
+ $num_pages = ceil( ( $dslc_query->found_posts - $options['offset'] ) / $options['amount'] );
 
 
3547
  }
3548
+ dslc_post_pagination( array('pages' => $num_pages, 'type' => $options['pagination_type']) );
3549
+ }
3550
 
3551
 
3552
+ wp_reset_postdata();
3553
 
 
3554
 
3555
+ $shortcode_rendered = ob_get_contents();
3556
+ ob_end_clean();
3557
+
3558
+ return $shortcode_rendered;
3559
+
3560
+ } add_shortcode( 'dslc_module_blog_output', 'dslc_module_blog_output' );
modules/downloads/module.php CHANGED
@@ -2323,640 +2323,653 @@ class DSLC_Downloads extends DSLC_Module {
2323
  * @return void
2324
  */
2325
  function output( $options ) {
 
 
 
2326
 
2327
- if ( is_feed() ) {
2328
- // Prevent category/tag feeds to stuck in an infinite loop
2329
- return false;
2330
- }
2331
 
2332
- global $dslc_active;
 
 
2333
 
2334
- if ( $dslc_active && is_user_logged_in() && current_user_can( DS_LIVE_COMPOSER_CAPABILITY ) )
2335
- $dslc_is_admin = true;
2336
- else
2337
- $dslc_is_admin = false;
2338
 
2339
- // Fix slashes on apostrophes
2340
- if ( isset( $options['button_text'] ) ) {
2341
- $options['button_text'] = stripslashes( $options['button_text'] );
2342
- }
2343
 
 
2344
 
2345
- /* Module output stars here */
 
 
 
2346
 
2347
- if ( ! isset( $options['excerpt_length'] ) ) $options['excerpt_length'] = 20;
 
 
 
2348
 
2349
- if ( is_front_page() ) { $paged = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1; } else { $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; }
2350
 
2351
- // Fix for pagination from other modules affecting this one when pag disabled
2352
- if ( $options['pagination_type'] == 'disabled' ) $paged = 1;
2353
 
2354
- // Fix for offset braking pagination
2355
- $query_offset = $options['offset'];
2356
- if ( $query_offset > 0 && $paged > 1 ) $query_offset = ( $paged - 1 ) * $options['amount'] + $options['offset'];
2357
 
2358
- $args = array(
2359
- 'paged' => $paged,
2360
- 'post_type' => 'dslc_downloads',
2361
- 'posts_per_page' => $options['amount'],
2362
- 'order' => $options['order'],
2363
- 'orderby' => $options['orderby'],
2364
- );
2365
 
2366
- // Add offset
2367
- if ( $query_offset > 0 ) {
2368
- $args['offset'] = $query_offset;
2369
- }
2370
 
2371
- if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
2372
- $args['post_status'] = array('publish', 'private');
2373
- }
2374
 
2375
- if ( isset( $options['categories'] ) && $options['categories'] != '' ) {
 
 
 
 
 
 
2376
 
2377
- $cats_array = explode( ' ', trim( $options['categories'] ) );
 
 
 
2378
 
2379
- $args['tax_query'] = array(
2380
- array(
2381
- 'taxonomy' => 'dslc_downloads_cats',
2382
- 'field' => 'slug',
2383
- 'terms' => $cats_array,
2384
- 'operator' => $options['categories_operator']
2385
- )
2386
- );
2387
 
2388
- }
2389
 
2390
- // Exlcude and Include arrays
2391
- $exclude = array();
2392
- $include = array();
2393
 
2394
- // Exclude current post
2395
- if ( is_singular( get_post_type() ) )
2396
- $exclude[] = get_the_ID();
 
 
 
 
 
2397
 
2398
- // Exclude posts ( option )
2399
- if ( $options['query_post_not_in'] )
2400
- $exclude = array_merge( $exclude, explode( ' ', $options['query_post_not_in'] ) );
2401
 
2402
- // Include posts ( option )
2403
- if ( $options['query_post_in'] )
2404
- $include = array_merge( $include, explode( ' ', $options['query_post_in'] ) );
2405
 
2406
- // Include query parameter
2407
- if ( ! empty( $include ) )
2408
- $args['post__in'] = $include;
2409
 
2410
- // Exclude query parameter
2411
- if ( ! empty( $exclude ) )
2412
- $args['post__not_in'] = $exclude;
2413
 
2414
- // Author archive page
2415
- if ( is_author() && $options['query_alter'] == 'enabled' ) {
2416
- global $authordata;
2417
- $args['author__in'] = array($authordata->data->ID);
2418
- }
2419
 
2420
- // Do the query
2421
- if ( ( is_category() || is_tag() || is_tax() || is_search() || is_date() ) && $options['query_alter'] == 'enabled' ) {
2422
- global $wp_query;
2423
- $dslc_query = $wp_query;
2424
- } else {
2425
- $dslc_query = new WP_Query( $args );
2426
- }
2427
 
2428
- $columns_class = 'dslc-col dslc-' . $options['columns'] . '-col ';
2429
- $count = 0;
2430
- $real_count = 0;
2431
- $increment = $options['columns'];
2432
- $max_count = 12;
2433
 
2434
- /**
2435
- * Elements to show
2436
- */
 
 
2437
 
2438
- // Main Elements
2439
- $elements = $options['elements'];
2440
- if ( ! empty( $elements ) )
2441
- $elements = explode( ' ', trim( $elements ) );
2442
- else
2443
- $elements = array();
 
2444
 
 
 
 
 
 
2445
 
2446
- // Post Elements
2447
- $post_elements = $options['post_elements'];
2448
- if ( ! empty( $post_elements ) )
2449
- $post_elements = explode( ' ', trim( $post_elements ) );
2450
- else
2451
- $post_elements = 'all';
2452
 
2453
- // Carousel Elements
2454
- $carousel_elements = $options['carousel_elements'];
2455
- if ( ! empty( $carousel_elements ) )
2456
- $carousel_elements = explode( ' ', trim( $carousel_elements ) );
2457
- else
2458
- $carousel_elements = array();
2459
 
2460
- /* Container Class */
2461
 
2462
- $container_class = 'dslc-posts dslc-downloads dslc-clearfix dslc-posts-orientation-' . $options['orientation'] . ' ';
 
 
 
 
 
2463
 
2464
- if ( $options['type'] == 'masonry' )
2465
- $container_class .= 'dslc-init-masonry ';
2466
- elseif ( $options['type'] == 'carousel' )
2467
- $container_class .= 'dslc-init-carousel ';
2468
- elseif ( $options['type'] == 'grid' )
2469
- $container_class .= 'dslc-init-grid ';
2470
 
2471
- /* Element Class */
2472
 
2473
- $element_class = 'dslc-post dslc-download ';
2474
 
2475
- if ( $options['type'] == 'masonry' )
2476
- $element_class .= 'dslc-masonry-item ';
2477
- elseif ( $options['type'] == 'carousel' )
2478
- $element_class .= 'dslc-carousel-item ';
 
 
2479
 
2480
- /**
2481
- * What is shown
2482
- */
2483
 
2484
- $show_header = false;
2485
- $show_heading = false;
2486
- $show_filters = false;
2487
- $show_carousel_arrows = false;
2488
- $show_view_all_link = false;
2489
 
2490
- if ( in_array( 'main_heading', $elements ) )
2491
- $show_heading = true;
 
 
2492
 
2493
- if ( ( $elements == 'all' || in_array( 'filters', $elements ) ) && $options['type'] !== 'carousel' )
2494
- $show_filters = true;
 
2495
 
2496
- if ( $options['type'] == 'carousel' && in_array( 'arrows', $carousel_elements ) )
2497
- $show_carousel_arrows = true;
 
 
 
2498
 
2499
- if ( $show_heading || $show_filters || $show_carousel_arrows )
2500
- $show_header = true;
2501
 
2502
- /**
2503
- * Carousel Items
2504
- */
2505
 
2506
- switch ( $options['columns'] ) {
2507
- case 12 :
2508
- $carousel_items = 1;
2509
- break;
2510
- case 6 :
2511
- $carousel_items = 2;
2512
- break;
2513
- case 4 :
2514
- $carousel_items = 3;
2515
- break;
2516
- case 3 :
2517
- $carousel_items = 4;
2518
- break;
2519
- case 2 :
2520
- $carousel_items = 6;
2521
- break;
2522
- default:
2523
- $carousel_items = 6;
2524
- break;
2525
- }
2526
 
2527
- /**
2528
- * Heading ( output )
2529
- */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2530
 
2531
- if ( $show_header ) :
2532
- ?>
2533
- <div class="dslc-module-heading">
2534
 
2535
- <!-- Heading -->
 
 
2536
 
2537
- <?php if ( $show_heading ) : ?>
2538
 
2539
- <h2 class="dslca-editable-content" data-id="main_heading_title" data-type="simple" <?php if ( $dslc_is_admin ) echo 'contenteditable'; ?> ><?php echo stripslashes( $options['main_heading_title'] ); ?></h2>
2540
 
2541
- <!-- View all -->
2542
 
2543
- <?php if ( isset( $options['view_all_link'] ) && $options['view_all_link'] !== '' ) : ?>
2544
 
2545
- <span class="dslc-module-heading-view-all"><a href="<?php echo $options['view_all_link']; ?>" class="dslca-editable-content" data-id="main_heading_link_title" data-type="simple" <?php if ( $dslc_is_admin ) echo 'contenteditable'; ?> ><?php echo $options['main_heading_link_title']; ?></a></span>
2546
 
2547
- <?php endif; ?>
2548
 
2549
  <?php endif; ?>
2550
 
2551
- <!-- Filters -->
2552
 
2553
- <?php
2554
 
2555
- if ( $show_filters ) {
2556
 
2557
- $cats_array = array();
2558
 
2559
- if ( $dslc_query->have_posts() ) {
2560
 
2561
- while ( $dslc_query->have_posts() ) {
2562
 
2563
- $dslc_query->the_post();
2564
 
2565
- $post_cats = get_the_terms( get_the_ID(), 'dslc_downloads_cats' );
2566
- if ( ! empty( $post_cats ) ) {
2567
- foreach ( $post_cats as $post_cat ) {
2568
- $cats_array[$post_cat->slug] = $post_cat->name;
2569
- }
2570
- }
2571
 
 
 
 
 
 
2572
  }
2573
 
2574
  }
2575
 
2576
- ?>
2577
 
2578
- <div class="dslc-post-filters">
2579
- <span class="dslc-post-filter dslc-active dslca-editable-content" data-filter-id="show-all" <?php if ( $dslc_is_admin ){ echo 'data-id="main_filter_title_all" data-type="simple" contenteditable '; } ?>><?php echo $options['main_filter_title_all']; ?></span>
2580
 
2581
- <?php foreach ( $cats_array as $cat_slug => $cat_name ) : ?>
2582
- <span class="dslc-post-filter dslc-inactive" data-filter-id="<?php echo $cat_slug; ?>"><?php echo $cat_name; ?></span>
2583
- <?php endforeach; ?>
2584
 
2585
- </div><!-- .dslc-post-filters -->
 
 
2586
 
2587
- <?php
2588
 
2589
- }
2590
 
2591
- ?>
2592
 
2593
- <!-- Carousel -->
2594
 
2595
- <?php if ( $show_carousel_arrows ) : ?>
2596
- <span class="dslc-carousel-nav fr">
2597
- <span class="dslc-carousel-nav-inner">
2598
- <a href="#" class="dslc-carousel-nav-prev"><span class="dslc-icon-chevron-left"></span></a>
2599
- <a href="#" class="dslc-carousel-nav-next"><span class="dslc-icon-chevron-right"></span></a>
2600
- </span>
2601
- </span><!-- .carousel-nav -->
2602
- <?php endif; ?>
2603
 
2604
- </div><!-- .dslc-module-heading -->
2605
- <?php
 
 
 
 
 
 
2606
 
2607
- endif;
 
2608
 
2609
- /**
2610
- * Posts ( output )
2611
- */
2612
 
2613
- if ( $dslc_query->have_posts() ) :
 
 
2614
 
2615
- ?><div class="<?php echo $container_class; ?>"><?php
2616
 
2617
- ?><div class="dslc-posts-inner"><?php
2618
 
2619
- if ( $options['type'] == 'carousel' ) :
2620
 
2621
- ?><div class="dslc-loader"></div><div class="dslc-carousel" data-stop-on-hover="<?php echo $options['carousel_autoplay_hover']; ?>" data-autoplay="<?php echo $options['carousel_autoplay']; ?>" data-columns="<?php echo $carousel_items; ?>" data-pagination="<?php if ( in_array( 'circles', $carousel_elements ) ) echo 'true'; else echo 'false'; ?>" data-slide-speed="<?php echo $options['arrows_slide_speed']; ?>" data-pagination-speed="<?php echo $options['circles_slide_speed']; ?>"><?php
2622
 
2623
- endif;
2624
 
2625
- while ( $dslc_query->have_posts() ) : $dslc_query->the_post(); $count += $increment; $real_count++;
2626
 
2627
- global $product;
2628
 
2629
- if ( $count == $max_count ) {
2630
- $count = 0;
2631
- $extra_class = ' dslc-last-col';
2632
- } elseif ( $count == $increment ) {
2633
- $extra_class = ' dslc-first-col';
2634
- } else {
2635
- $extra_class = '';
2636
- }
2637
 
2638
- if ( ! has_post_thumbnail() )
2639
- $extra_class .= ' dslc-post-no-thumb';
 
 
 
 
 
 
2640
 
2641
- $download_tags_count = 0;
2642
- $download_tags = get_the_terms( get_the_ID(), 'dslc_downloads_tags' );
2643
 
2644
- if ( get_post_meta( get_the_ID(), 'dslc_download_file', true ) )
2645
- $download_link = wp_get_attachment_url( get_post_meta( get_the_ID(), 'dslc_download_file', true ) );
2646
- elseif ( get_post_meta( get_the_ID(), 'dslc_download_url', true ) )
2647
- $download_link = get_post_meta( get_the_ID(), 'dslc_download_url', true );
2648
- else
2649
- $download_link = false;
2650
 
2651
- $download_count = get_post_meta( get_the_ID(), 'dslc_download_count', true );
2652
- if ( ! $download_count ) $download_count = 0;
 
 
 
 
2653
 
2654
- $post_cats = get_the_terms( get_the_ID(), 'dslc_downloads_cats' );
2655
- $post_cats_data = '';
2656
- if ( ! empty( $post_cats ) ) {
2657
- foreach ( $post_cats as $post_cat ) {
2658
- $post_cats_data .= $post_cat->slug . ' ';
2659
- }
2660
- }
2661
 
2662
- /**
2663
- * Link or not
2664
- */
 
 
 
 
2665
 
2666
- $link_to_single = true;
 
 
2667
 
2668
- if ( isset( $options['link'] ) && 'disabled' === $options['link'] ) {
2669
- $link_to_single = false;
2670
- }
2671
 
2672
- ?>
 
 
2673
 
2674
- <div class="<?php echo $element_class . $columns_class . $extra_class; ?>" data-cats="<?php echo $post_cats_data; ?>">
2675
 
2676
- <?php if ( $post_elements == 'all' || in_array( 'thumbnail', $post_elements ) ) : ?>
2677
 
2678
- <?php
2679
- /**
2680
- * Manual Resize
2681
- */
2682
 
2683
- $manual_resize = false;
2684
- if ( isset( $options['thumb_resize_height'] ) && ! empty( $options['thumb_resize_height'] ) || isset( $options['thumb_resize_width_manual'] ) && ! empty( $options['thumb_resize_width_manual'] ) ) {
 
 
2685
 
2686
- $manual_resize = true;
2687
- $thumb_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
2688
- $thumb_url = $thumb_url[0];
2689
 
2690
- $thumb_alt = get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true );
2691
- if ( ! $thumb_alt ) $thumb_alt = '';
 
2692
 
2693
- $resize_width = false;
2694
- $resize_height = false;
2695
 
2696
- if ( isset( $options['thumb_resize_width_manual'] ) && ! empty( $options['thumb_resize_width_manual'] ) ) {
2697
- $resize_width = $options['thumb_resize_width_manual'];
2698
- }
2699
 
2700
- if ( isset( $options['thumb_resize_height'] ) && ! empty( $options['thumb_resize_height'] ) ) {
2701
- $resize_height = $options['thumb_resize_height'];
2702
- }
2703
 
 
 
2704
  }
2705
- ?>
2706
 
2707
- <?php if ( has_post_thumbnail() ) : ?>
 
2708
 
2709
- <div class="dslc-download-thumb dslc-post-thumb dslc-on-hover-anim">
2710
 
2711
- <div class="dslc-download-thumb-inner dslca-post-thumb">
2712
- <?php if ( $manual_resize ) : ?>
2713
- <?php if ( $link_to_single ) : ?>
2714
- <a href="<?php the_permalink(); ?>"><img src="<?php $res_img = dslc_aq_resize( $thumb_url, $resize_width, $resize_height, true ); echo $res_img; ?>" alt="<?php echo $thumb_alt; ?>" /></a>
2715
- <?php else : ?>
2716
- <img src="<?php $res_img = dslc_aq_resize( $thumb_url, $resize_width, $resize_height, true ); echo $res_img; ?>" alt="<?php echo $thumb_alt; ?>" />
2717
- <?php endif; ?>
2718
  <?php else : ?>
2719
- <?php if ( $link_to_single ) : ?>
2720
- <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( 'full' ); ?></a>
2721
- <?php else : ?>
2722
- <?php the_post_thumbnail( 'full' ); ?>
2723
- <?php endif; ?>
2724
  <?php endif; ?>
2725
- </div><!-- .dslc-download-thumb-inner -->
2726
-
2727
- <?php if ( ( $options['main_location'] == 'inside' || $options['main_location'] == 'inside_visible' ) && ( $post_elements == 'all' || in_array( 'title', $post_elements ) || in_array( 'tags', $post_elements ) || in_array( 'excerpt', $post_elements ) || in_array( 'button', $post_elements ) || in_array( 'count', $post_elements ) ) ) : ?>
 
 
 
 
 
2728
 
2729
- <div class="dslc-download-main dslc-init-<?php echo $options['main_position']; ?> <?php if ( $options['main_location'] == 'inside_visible' ) echo 'dslc-download-main-visible'; ?> dslc-on-hover-anim-target dslc-anim-<?php echo $options['css_anim_hover']; ?>" data-dslc-anim="<?php echo $options['css_anim_hover'] ?>" data-dslc-anim-speed="<?php echo $options['css_anim_speed']; ?>">
2730
 
2731
- <div class="dslc-download-main-inner dslc-init-target">
2732
 
2733
- <?php if ( $post_elements == 'all' || in_array( 'title', $post_elements ) ) : ?>
2734
 
2735
- <div class="dslc-download-title">
2736
- <?php if ( $link_to_single ) : ?>
2737
- <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
2738
- <?php else : ?>
2739
- <h2><?php the_title(); ?></h2>
2740
- <?php endif; ?>
2741
- </div><!-- .dslc-download-title -->
2742
 
2743
- <?php endif; ?>
 
 
 
 
 
 
2744
 
2745
- <?php if ( $post_elements == 'all' || in_array( 'tags', $post_elements ) ) : ?>
2746
 
2747
- <?php if ( ! empty( $download_tags ) ) : ?>
2748
 
2749
- <div class="dslc-download-tags">
2750
- In
2751
- <?php foreach ( $download_tags as $download_tag ) : $download_tags_count++; ?>
2752
- <?php if ( $download_tags_count > 1 ) { echo ', '; } ?>
2753
- <a href="<?php echo get_term_link( $download_tag->slug, 'dslc_downloads_tags' ); ?>"><?php echo $download_tag->name; ?></a>
2754
- <?php endforeach; ?>
2755
- </div><!-- .dslc-download-tags -->
2756
 
2757
- <?php endif; ?>
 
 
 
 
 
 
2758
 
2759
  <?php endif; ?>
2760
 
2761
- <?php if ( $post_elements == 'all' || in_array( 'excerpt', $post_elements ) ) : ?>
2762
 
2763
- <div class="dslc-download-excerpt">
2764
- <?php if ( $options['excerpt_or_content'] == 'content' ) : ?>
2765
- <?php
 
 
 
 
 
 
 
 
 
 
2766
  if ( $options['excerpt_length'] > 0 ) {
2767
- echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
 
 
 
2768
  } else {
2769
- echo get_the_content();
 
 
 
2770
  }
2771
- ?>
2772
- <?php else : ?>
2773
- <?php
2774
- if ( $options['excerpt_length'] > 0 ) {
2775
- if ( has_excerpt() )
2776
- echo wp_trim_words( get_the_excerpt(), $options['excerpt_length'] );
2777
- else
2778
- echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2779
- } else {
2780
- if ( has_excerpt() )
2781
- echo get_the_excerpt();
2782
- else
2783
- echo get_the_content();
2784
- }
2785
- ?>
2786
- <?php endif; ?>
2787
- </div><!-- .dslc-download-excerpt -->
2788
-
2789
- <?php endif; ?>
2790
-
2791
- <?php if ( $post_elements == 'all' || in_array( 'button', $post_elements ) ) : ?>
2792
 
2793
- <div class="dslc-download-download">
2794
- <a target="_blank" class="dslc-download-count-hook" data-post-id="<?php echo get_the_ID(); ?>" href="<?php echo $download_link; ?>" download>
2795
- <?php if ( isset( $options['button_icon_id'] ) && $options['button_icon_id'] != '' ) : ?>
2796
- <span class="dslc-icon dslc-icon-<?php echo $options['button_icon_id']; ?>"></span>
2797
- <?php endif; ?>
2798
- <?php echo $options['button_text']; ?>
2799
- </a>
2800
- </div><!-- .dslc-download-download -->
2801
 
2802
- <?php endif; ?>
2803
 
2804
- <?php if ( $post_elements == 'all' || in_array( 'count', $post_elements ) ) : ?>
 
 
 
 
 
 
 
2805
 
2806
- <div class="dslc-download-info">
2807
- <?php printf( __( 'Downloaded %d times.', 'live-composer-page-builder' ), $download_count ); ?>
2808
- </div><!-- .dslc-download-info -->
2809
 
2810
- <?php endif; ?>
2811
 
2812
- </div><!-- .dslc-download-main-inner -->
 
 
2813
 
2814
- <?php if ( $link_to_single ) : ?>
2815
- <a href="<?php the_permalink(); ?>" class="dslc-post-main-inner-link-cover"></a>
2816
  <?php endif; ?>
2817
 
2818
- </div><!-- .dslc-download-main -->
2819
 
2820
- <?php endif; ?>
 
 
2821
 
2822
- </div><!-- .dslc-download-thumb -->
2823
 
2824
- <?php endif; ?>
 
 
2825
 
2826
  <?php endif; ?>
2827
 
2828
- <?php if ( $options['main_location'] == 'bellow' && ( $post_elements == 'all' || in_array( 'title', $post_elements ) || in_array( 'tags', $post_elements ) || in_array( 'excerpt', $post_elements ) || in_array( 'button', $post_elements ) || in_array( 'count', $post_elements ) ) ) : ?>
2829
 
2830
- <div class="dslc-post-main dslc-download-main">
2831
 
2832
- <?php if ( $post_elements == 'all' || in_array( 'title', $post_elements ) ) : ?>
2833
 
2834
- <div class="dslc-download-title">
2835
- <?php if ( $link_to_single ) : ?>
2836
- <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
2837
- <?php else : ?>
2838
- <h2><?php the_title(); ?></h2>
2839
- <?php endif; ?>
2840
- </div><!-- .dslc-download-title -->
2841
 
2842
- <?php endif; ?>
 
 
 
 
 
 
2843
 
2844
- <?php if ( $post_elements == 'all' || in_array( 'tags', $post_elements ) ) : ?>
2845
 
2846
- <?php if ( ! empty( $download_tags ) ) : ?>
2847
 
2848
- <div class="dslc-download-tags">
2849
- In
2850
- <?php foreach ( $download_tags as $download_tag ) : $download_tags_count++; ?>
2851
- <?php if ( $download_tags_count > 1 ) { echo ', '; } ?>
2852
- <a href="<?php echo get_term_link( $download_tag->slug, 'dslc_downloads_tags' ); ?>"><?php echo $download_tag->name; ?></a>
2853
- <?php endforeach; ?>
2854
- </div><!-- .dslc-download-tags -->
2855
 
2856
- <?php endif; ?>
 
 
 
 
 
 
2857
 
2858
  <?php endif; ?>
2859
 
2860
- <?php if ( $post_elements == 'all' || in_array( 'excerpt', $post_elements ) ) : ?>
2861
 
2862
- <div class="dslc-download-excerpt">
2863
- <?php if ( $options['excerpt_or_content'] == 'content' ) : ?>
2864
- <?php
 
 
 
 
 
 
 
 
 
 
2865
  if ( $options['excerpt_length'] > 0 ) {
2866
- echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
 
 
 
2867
  } else {
2868
- echo get_the_content();
 
 
 
2869
  }
2870
- ?>
2871
- <?php else : ?>
2872
- <?php
2873
- if ( $options['excerpt_length'] > 0 ) {
2874
- if ( has_excerpt() )
2875
- echo wp_trim_words( get_the_excerpt(), $options['excerpt_length'] );
2876
- else
2877
- echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2878
- } else {
2879
- if ( has_excerpt() )
2880
- echo get_the_excerpt();
2881
- else
2882
- echo get_the_content();
2883
- }
2884
- ?>
2885
- <?php endif; ?>
2886
- </div><!-- .dslc-download-excerpt -->
2887
-
2888
- <?php endif; ?>
2889
 
2890
- <?php if ( ( $post_elements == 'all' || in_array( 'button', $post_elements ) ) && $download_link ) : ?>
2891
 
2892
- <div class="dslc-download-download">
2893
- <a target="_blank" class="dslc-download-count-hook" data-post-id="<?php echo get_the_ID(); ?>" href="<?php echo $download_link; ?>" download>
2894
- <?php if ( isset( $options['button_icon_id'] ) && $options['button_icon_id'] != '' ) : ?>
2895
- <span class="dslc-icon dslc-icon-<?php echo $options['button_icon_id']; ?>"></span>
2896
- <?php endif; ?>
2897
- <?php echo $options['button_text']; ?>
2898
- </a>
2899
- </div><!-- .dslc-download-download -->
2900
 
2901
- <?php endif; ?>
 
 
 
 
 
 
 
2902
 
2903
- <?php if ( ( $post_elements == 'all' || in_array( 'count', $post_elements ) ) && $download_link ) : ?>
2904
 
2905
- <div class="dslc-download-info">
2906
- <?php printf( __( 'Downloaded %d times.', 'live-composer-page-builder' ), $download_count ); ?>
2907
- </div><!-- .dslc-download-info -->
2908
 
2909
- <?php endif; ?>
 
 
2910
 
2911
- </div><!-- .dslc-download-main -->
2912
 
2913
- <?php endif; ?>
2914
 
2915
- </div><!-- .dslc-download -->
2916
 
2917
- <?php
2918
 
2919
- // Row Separator
2920
- if ( $options['type'] == 'grid' && $count == 0 && $real_count != $dslc_query->found_posts && $real_count != $options['amount'] && $options['separator_enabled'] == 'enabled' ) {
2921
- echo '<div class="dslc-post-separator"></div>';
2922
- }
2923
 
2924
- endwhile;
 
 
 
2925
 
2926
- if ( $options['type'] == 'carousel' ) :
2927
 
2928
- ?></div><?php
2929
 
2930
- endif;
2931
 
2932
- ?></div><!-- .dslc-posts-inner --><?php
2933
 
2934
- ?></div><?php
2935
 
2936
- else :
2937
 
2938
- if ( $dslc_is_admin ) :
2939
- ?><div class="dslc-notification dslc-red"><?php _e( 'You do not have downloads at the moment. Go to <strong>WP Admin &rarr; Downloads</strong> to add some.', 'live-composer-page-builder' ); ?> <span class="dslca-refresh-module-hook dslc-icon dslc-icon-refresh"></span></span></div><?php
2940
- endif;
2941
 
 
 
2942
  endif;
2943
 
2944
- /**
2945
- * Pagination
2946
- */
2947
 
2948
- if ( isset( $options['pagination_type'] ) && $options['pagination_type'] != 'disabled' ) {
2949
- $num_pages = $dslc_query->max_num_pages;
2950
- if ( $options['offset'] > 0 ) {
2951
- $num_pages = ceil( ( $dslc_query->found_posts - $options['offset'] ) / $options['amount'] );
2952
- }
2953
- dslc_post_pagination( array('pages' => $num_pages, 'type' => $options['pagination_type']) );
2954
- }
2955
 
2956
- wp_reset_postdata();
 
 
 
 
 
 
2957
 
 
2958
 
 
 
2959
 
2960
- }
2961
 
2962
- }
2323
  * @return void
2324
  */
2325
  function output( $options ) {
2326
+ ?>
2327
+ [dslc_module_downloads_output]<?php echo serialize($options); ?>[/dslc_module_downloads_output]
2328
+ <?php
2329
 
2330
+ }
2331
+ }
 
 
2332
 
2333
+ function dslc_module_downloads_output ( $atts, $content = null ) {
2334
+ // Uncode module options passed as serialized content.
2335
+ $options = unserialize( $content );
2336
 
2337
+ ob_start();
 
 
 
2338
 
2339
+ if ( is_feed() ) {
2340
+ // Prevent category/tag feeds to stuck in an infinite loop
2341
+ return false;
2342
+ }
2343
 
2344
+ global $dslc_active;
2345
 
2346
+ if ( $dslc_active && is_user_logged_in() && current_user_can( DS_LIVE_COMPOSER_CAPABILITY ) )
2347
+ $dslc_is_admin = true;
2348
+ else
2349
+ $dslc_is_admin = false;
2350
 
2351
+ // Fix slashes on apostrophes
2352
+ if ( isset( $options['button_text'] ) ) {
2353
+ $options['button_text'] = stripslashes( $options['button_text'] );
2354
+ }
2355
 
 
2356
 
2357
+ /* Module output stars here */
 
2358
 
2359
+ if ( ! isset( $options['excerpt_length'] ) ) $options['excerpt_length'] = 20;
 
 
2360
 
2361
+ if ( is_front_page() ) { $paged = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1; } else { $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; }
 
 
 
 
 
 
2362
 
2363
+ // Fix for pagination from other modules affecting this one when pag disabled
2364
+ if ( $options['pagination_type'] == 'disabled' ) $paged = 1;
 
 
2365
 
2366
+ // Fix for offset braking pagination
2367
+ $query_offset = $options['offset'];
2368
+ if ( $query_offset > 0 && $paged > 1 ) $query_offset = ( $paged - 1 ) * $options['amount'] + $options['offset'];
2369
 
2370
+ $args = array(
2371
+ 'paged' => $paged,
2372
+ 'post_type' => 'dslc_downloads',
2373
+ 'posts_per_page' => $options['amount'],
2374
+ 'order' => $options['order'],
2375
+ 'orderby' => $options['orderby'],
2376
+ );
2377
 
2378
+ // Add offset
2379
+ if ( $query_offset > 0 ) {
2380
+ $args['offset'] = $query_offset;
2381
+ }
2382
 
2383
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
2384
+ $args['post_status'] = array('publish', 'private');
2385
+ }
 
 
 
 
 
2386
 
2387
+ if ( isset( $options['categories'] ) && $options['categories'] != '' ) {
2388
 
2389
+ $cats_array = explode( ' ', trim( $options['categories'] ) );
 
 
2390
 
2391
+ $args['tax_query'] = array(
2392
+ array(
2393
+ 'taxonomy' => 'dslc_downloads_cats',
2394
+ 'field' => 'slug',
2395
+ 'terms' => $cats_array,
2396
+ 'operator' => $options['categories_operator']
2397
+ )
2398
+ );
2399
 
2400
+ }
 
 
2401
 
2402
+ // Exlcude and Include arrays
2403
+ $exclude = array();
2404
+ $include = array();
2405
 
2406
+ // Exclude current post
2407
+ if ( is_singular( get_post_type() ) )
2408
+ $exclude[] = get_the_ID();
2409
 
2410
+ // Exclude posts ( option )
2411
+ if ( $options['query_post_not_in'] )
2412
+ $exclude = array_merge( $exclude, explode( ' ', $options['query_post_not_in'] ) );
2413
 
2414
+ // Include posts ( option )
2415
+ if ( $options['query_post_in'] )
2416
+ $include = array_merge( $include, explode( ' ', $options['query_post_in'] ) );
 
 
2417
 
2418
+ // Include query parameter
2419
+ if ( ! empty( $include ) )
2420
+ $args['post__in'] = $include;
 
 
 
 
2421
 
2422
+ // Exclude query parameter
2423
+ if ( ! empty( $exclude ) )
2424
+ $args['post__not_in'] = $exclude;
 
 
2425
 
2426
+ // Author archive page
2427
+ if ( is_author() && $options['query_alter'] == 'enabled' ) {
2428
+ global $authordata;
2429
+ $args['author__in'] = array($authordata->data->ID);
2430
+ }
2431
 
2432
+ // Do the query
2433
+ if ( ( is_category() || is_tag() || is_tax() || is_search() || is_date() ) && $options['query_alter'] == 'enabled' ) {
2434
+ global $wp_query;
2435
+ $dslc_query = $wp_query;
2436
+ } else {
2437
+ $dslc_query = new WP_Query( $args );
2438
+ }
2439
 
2440
+ $columns_class = 'dslc-col dslc-' . $options['columns'] . '-col ';
2441
+ $count = 0;
2442
+ $real_count = 0;
2443
+ $increment = $options['columns'];
2444
+ $max_count = 12;
2445
 
2446
+ /**
2447
+ * Elements to show
2448
+ */
 
 
 
2449
 
2450
+ // Main Elements
2451
+ $elements = $options['elements'];
2452
+ if ( ! empty( $elements ) )
2453
+ $elements = explode( ' ', trim( $elements ) );
2454
+ else
2455
+ $elements = array();
2456
 
 
2457
 
2458
+ // Post Elements
2459
+ $post_elements = $options['post_elements'];
2460
+ if ( ! empty( $post_elements ) )
2461
+ $post_elements = explode( ' ', trim( $post_elements ) );
2462
+ else
2463
+ $post_elements = 'all';
2464
 
2465
+ // Carousel Elements
2466
+ $carousel_elements = $options['carousel_elements'];
2467
+ if ( ! empty( $carousel_elements ) )
2468
+ $carousel_elements = explode( ' ', trim( $carousel_elements ) );
2469
+ else
2470
+ $carousel_elements = array();
2471
 
2472
+ /* Container Class */
2473
 
2474
+ $container_class = 'dslc-posts dslc-downloads dslc-clearfix dslc-posts-orientation-' . $options['orientation'] . ' ';
2475
 
2476
+ if ( $options['type'] == 'masonry' )
2477
+ $container_class .= 'dslc-init-masonry ';
2478
+ elseif ( $options['type'] == 'carousel' )
2479
+ $container_class .= 'dslc-init-carousel ';
2480
+ elseif ( $options['type'] == 'grid' )
2481
+ $container_class .= 'dslc-init-grid ';
2482
 
2483
+ /* Element Class */
 
 
2484
 
2485
+ $element_class = 'dslc-post dslc-download ';
 
 
 
 
2486
 
2487
+ if ( $options['type'] == 'masonry' )
2488
+ $element_class .= 'dslc-masonry-item ';
2489
+ elseif ( $options['type'] == 'carousel' )
2490
+ $element_class .= 'dslc-carousel-item ';
2491
 
2492
+ /**
2493
+ * What is shown
2494
+ */
2495
 
2496
+ $show_header = false;
2497
+ $show_heading = false;
2498
+ $show_filters = false;
2499
+ $show_carousel_arrows = false;
2500
+ $show_view_all_link = false;
2501
 
2502
+ if ( in_array( 'main_heading', $elements ) )
2503
+ $show_heading = true;
2504
 
2505
+ if ( ( $elements == 'all' || in_array( 'filters', $elements ) ) && $options['type'] !== 'carousel' )
2506
+ $show_filters = true;
 
2507
 
2508
+ if ( $options['type'] == 'carousel' && in_array( 'arrows', $carousel_elements ) )
2509
+ $show_carousel_arrows = true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2510
 
2511
+ if ( $show_heading || $show_filters || $show_carousel_arrows )
2512
+ $show_header = true;
2513
+
2514
+ /**
2515
+ * Carousel Items
2516
+ */
2517
+
2518
+ switch ( $options['columns'] ) {
2519
+ case 12 :
2520
+ $carousel_items = 1;
2521
+ break;
2522
+ case 6 :
2523
+ $carousel_items = 2;
2524
+ break;
2525
+ case 4 :
2526
+ $carousel_items = 3;
2527
+ break;
2528
+ case 3 :
2529
+ $carousel_items = 4;
2530
+ break;
2531
+ case 2 :
2532
+ $carousel_items = 6;
2533
+ break;
2534
+ default:
2535
+ $carousel_items = 6;
2536
+ break;
2537
+ }
2538
 
2539
+ /**
2540
+ * Heading ( output )
2541
+ */
2542
 
2543
+ if ( $show_header ) :
2544
+ ?>
2545
+ <div class="dslc-module-heading">
2546
 
2547
+ <!-- Heading -->
2548
 
2549
+ <?php if ( $show_heading ) : ?>
2550
 
2551
+ <h2 class="dslca-editable-content" data-id="main_heading_title" data-type="simple" <?php if ( $dslc_is_admin ) echo 'contenteditable'; ?> ><?php echo stripslashes( $options['main_heading_title'] ); ?></h2>
2552
 
2553
+ <!-- View all -->
2554
 
2555
+ <?php if ( isset( $options['view_all_link'] ) && $options['view_all_link'] !== '' ) : ?>
2556
 
2557
+ <span class="dslc-module-heading-view-all"><a href="<?php echo $options['view_all_link']; ?>" class="dslca-editable-content" data-id="main_heading_link_title" data-type="simple" <?php if ( $dslc_is_admin ) echo 'contenteditable'; ?> ><?php echo $options['main_heading_link_title']; ?></a></span>
2558
 
2559
  <?php endif; ?>
2560
 
2561
+ <?php endif; ?>
2562
 
2563
+ <!-- Filters -->
2564
 
2565
+ <?php
2566
 
2567
+ if ( $show_filters ) {
2568
 
2569
+ $cats_array = array();
2570
 
2571
+ if ( $dslc_query->have_posts() ) {
2572
 
2573
+ while ( $dslc_query->have_posts() ) {
2574
 
2575
+ $dslc_query->the_post();
 
 
 
 
 
2576
 
2577
+ $post_cats = get_the_terms( get_the_ID(), 'dslc_downloads_cats' );
2578
+ if ( ! empty( $post_cats ) ) {
2579
+ foreach ( $post_cats as $post_cat ) {
2580
+ $cats_array[$post_cat->slug] = $post_cat->name;
2581
+ }
2582
  }
2583
 
2584
  }
2585
 
2586
+ }
2587
 
2588
+ ?>
 
2589
 
2590
+ <div class="dslc-post-filters">
2591
+ <span class="dslc-post-filter dslc-active dslca-editable-content" data-filter-id="show-all" <?php if ( $dslc_is_admin ){ echo 'data-id="main_filter_title_all" data-type="simple" contenteditable '; } ?>><?php echo $options['main_filter_title_all']; ?></span>
 
2592
 
2593
+ <?php foreach ( $cats_array as $cat_slug => $cat_name ) : ?>
2594
+ <span class="dslc-post-filter dslc-inactive" data-filter-id="<?php echo $cat_slug; ?>"><?php echo $cat_name; ?></span>
2595
+ <?php endforeach; ?>
2596
 
2597
+ </div><!-- .dslc-post-filters -->
2598
 
2599
+ <?php
2600
 
2601
+ }
2602
 
2603
+ ?>
2604
 
2605
+ <!-- Carousel -->
 
 
 
 
 
 
 
2606
 
2607
+ <?php if ( $show_carousel_arrows ) : ?>
2608
+ <span class="dslc-carousel-nav fr">
2609
+ <span class="dslc-carousel-nav-inner">
2610
+ <a href="#" class="dslc-carousel-nav-prev"><span class="dslc-icon-chevron-left"></span></a>
2611
+ <a href="#" class="dslc-carousel-nav-next"><span class="dslc-icon-chevron-right"></span></a>
2612
+ </span>
2613
+ </span><!-- .carousel-nav -->
2614
+ <?php endif; ?>
2615
 
2616
+ </div><!-- .dslc-module-heading -->
2617
+ <?php
2618
 
2619
+ endif;
 
 
2620
 
2621
+ /**
2622
+ * Posts ( output )
2623
+ */
2624
 
2625
+ if ( $dslc_query->have_posts() ) :
2626
 
2627
+ ?><div class="<?php echo $container_class; ?>"><?php
2628
 
2629
+ ?><div class="dslc-posts-inner"><?php
2630
 
2631
+ if ( $options['type'] == 'carousel' ) :
2632
 
2633
+ ?><div class="dslc-loader"></div><div class="dslc-carousel" data-stop-on-hover="<?php echo $options['carousel_autoplay_hover']; ?>" data-autoplay="<?php echo $options['carousel_autoplay']; ?>" data-columns="<?php echo $carousel_items; ?>" data-pagination="<?php if ( in_array( 'circles', $carousel_elements ) ) echo 'true'; else echo 'false'; ?>" data-slide-speed="<?php echo $options['arrows_slide_speed']; ?>" data-pagination-speed="<?php echo $options['circles_slide_speed']; ?>"><?php
2634
 
2635
+ endif;
2636
 
2637
+ while ( $dslc_query->have_posts() ) : $dslc_query->the_post(); $count += $increment; $real_count++;
2638
 
2639
+ global $product;
 
 
 
 
 
 
 
2640
 
2641
+ if ( $count == $max_count ) {
2642
+ $count = 0;
2643
+ $extra_class = ' dslc-last-col';
2644
+ } elseif ( $count == $increment ) {
2645
+ $extra_class = ' dslc-first-col';
2646
+ } else {
2647
+ $extra_class = '';
2648
+ }
2649
 
2650
+ if ( ! has_post_thumbnail() )
2651
+ $extra_class .= ' dslc-post-no-thumb';
2652
 
2653
+ $download_tags_count = 0;
2654
+ $download_tags = get_the_terms( get_the_ID(), 'dslc_downloads_tags' );
 
 
 
 
2655
 
2656
+ if ( get_post_meta( get_the_ID(), 'dslc_download_file', true ) )
2657
+ $download_link = wp_get_attachment_url( get_post_meta( get_the_ID(), 'dslc_download_file', true ) );
2658
+ elseif ( get_post_meta( get_the_ID(), 'dslc_download_url', true ) )
2659
+ $download_link = get_post_meta( get_the_ID(), 'dslc_download_url', true );
2660
+ else
2661
+ $download_link = false;
2662
 
2663
+ $download_count = get_post_meta( get_the_ID(), 'dslc_download_count', true );
2664
+ if ( ! $download_count ) $download_count = 0;
 
 
 
 
 
2665
 
2666
+ $post_cats = get_the_terms( get_the_ID(), 'dslc_downloads_cats' );
2667
+ $post_cats_data = '';
2668
+ if ( ! empty( $post_cats ) ) {
2669
+ foreach ( $post_cats as $post_cat ) {
2670
+ $post_cats_data .= $post_cat->slug . ' ';
2671
+ }
2672
+ }
2673
 
2674
+ /**
2675
+ * Link or not
2676
+ */
2677
 
2678
+ $link_to_single = true;
 
 
2679
 
2680
+ if ( isset( $options['link'] ) && 'disabled' === $options['link'] ) {
2681
+ $link_to_single = false;
2682
+ }
2683
 
2684
+ ?>
2685
 
2686
+ <div class="<?php echo $element_class . $columns_class . $extra_class; ?>" data-cats="<?php echo $post_cats_data; ?>">
2687
 
2688
+ <?php if ( $post_elements == 'all' || in_array( 'thumbnail', $post_elements ) ) : ?>
 
 
 
2689
 
2690
+ <?php
2691
+ /**
2692
+ * Manual Resize
2693
+ */
2694
 
2695
+ $manual_resize = false;
2696
+ if ( isset( $options['thumb_resize_height'] ) && ! empty( $options['thumb_resize_height'] ) || isset( $options['thumb_resize_width_manual'] ) && ! empty( $options['thumb_resize_width_manual'] ) ) {
 
2697
 
2698
+ $manual_resize = true;
2699
+ $thumb_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
2700
+ $thumb_url = $thumb_url[0];
2701
 
2702
+ $thumb_alt = get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true );
2703
+ if ( ! $thumb_alt ) $thumb_alt = '';
2704
 
2705
+ $resize_width = false;
2706
+ $resize_height = false;
 
2707
 
2708
+ if ( isset( $options['thumb_resize_width_manual'] ) && ! empty( $options['thumb_resize_width_manual'] ) ) {
2709
+ $resize_width = $options['thumb_resize_width_manual'];
2710
+ }
2711
 
2712
+ if ( isset( $options['thumb_resize_height'] ) && ! empty( $options['thumb_resize_height'] ) ) {
2713
+ $resize_height = $options['thumb_resize_height'];
2714
  }
 
2715
 
2716
+ }
2717
+ ?>
2718
 
2719
+ <?php if ( has_post_thumbnail() ) : ?>
2720
 
2721
+ <div class="dslc-download-thumb dslc-post-thumb dslc-on-hover-anim">
2722
+
2723
+ <div class="dslc-download-thumb-inner dslca-post-thumb">
2724
+ <?php if ( $manual_resize ) : ?>
2725
+ <?php if ( $link_to_single ) : ?>
2726
+ <a href="<?php the_permalink(); ?>"><img src="<?php $res_img = dslc_aq_resize( $thumb_url, $resize_width, $resize_height, true ); echo $res_img; ?>" alt="<?php echo $thumb_alt; ?>" /></a>
 
2727
  <?php else : ?>
2728
+ <img src="<?php $res_img = dslc_aq_resize( $thumb_url, $resize_width, $resize_height, true ); echo $res_img; ?>" alt="<?php echo $thumb_alt; ?>" />
 
 
 
 
2729
  <?php endif; ?>
2730
+ <?php else : ?>
2731
+ <?php if ( $link_to_single ) : ?>
2732
+ <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( 'full' ); ?></a>
2733
+ <?php else : ?>
2734
+ <?php the_post_thumbnail( 'full' ); ?>
2735
+ <?php endif; ?>
2736
+ <?php endif; ?>
2737
+ </div><!-- .dslc-download-thumb-inner -->
2738
 
2739
+ <?php if ( ( $options['main_location'] == 'inside' || $options['main_location'] == 'inside_visible' ) && ( $post_elements == 'all' || in_array( 'title', $post_elements ) || in_array( 'tags', $post_elements ) || in_array( 'excerpt', $post_elements ) || in_array( 'button', $post_elements ) || in_array( 'count', $post_elements ) ) ) : ?>
2740
 
2741
+ <div class="dslc-download-main dslc-init-<?php echo $options['main_position']; ?> <?php if ( $options['main_location'] == 'inside_visible' ) echo 'dslc-download-main-visible'; ?> dslc-on-hover-anim-target dslc-anim-<?php echo $options['css_anim_hover']; ?>" data-dslc-anim="<?php echo $options['css_anim_hover'] ?>" data-dslc-anim-speed="<?php echo $options['css_anim_speed']; ?>">
2742
 
2743
+ <div class="dslc-download-main-inner dslc-init-target">
2744
 
2745
+ <?php if ( $post_elements == 'all' || in_array( 'title', $post_elements ) ) : ?>
 
 
 
 
 
 
2746
 
2747
+ <div class="dslc-download-title">
2748
+ <?php if ( $link_to_single ) : ?>
2749
+ <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
2750
+ <?php else : ?>
2751
+ <h2><?php the_title(); ?></h2>
2752
+ <?php endif; ?>
2753
+ </div><!-- .dslc-download-title -->
2754
 
2755
+ <?php endif; ?>
2756
 
2757
+ <?php if ( $post_elements == 'all' || in_array( 'tags', $post_elements ) ) : ?>
2758
 
2759
+ <?php if ( ! empty( $download_tags ) ) : ?>
 
 
 
 
 
 
2760
 
2761
+ <div class="dslc-download-tags">
2762
+ In
2763
+ <?php foreach ( $download_tags as $download_tag ) : $download_tags_count++; ?>
2764
+ <?php if ( $download_tags_count > 1 ) { echo ', '; } ?>
2765
+ <a href="<?php echo get_term_link( $download_tag->slug, 'dslc_downloads_tags' ); ?>"><?php echo $download_tag->name; ?></a>
2766
+ <?php endforeach; ?>
2767
+ </div><!-- .dslc-download-tags -->
2768
 
2769
  <?php endif; ?>
2770
 
2771
+ <?php endif; ?>
2772
 
2773
+ <?php if ( $post_elements == 'all' || in_array( 'excerpt', $post_elements ) ) : ?>
2774
+
2775
+ <div class="dslc-download-excerpt">
2776
+ <?php if ( $options['excerpt_or_content'] == 'content' ) : ?>
2777
+ <?php
2778
+ if ( $options['excerpt_length'] > 0 ) {
2779
+ echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2780
+ } else {
2781
+ echo get_the_content();
2782
+ }
2783
+ ?>
2784
+ <?php else : ?>
2785
+ <?php
2786
  if ( $options['excerpt_length'] > 0 ) {
2787
+ if ( has_excerpt() )
2788
+ echo wp_trim_words( get_the_excerpt(), $options['excerpt_length'] );
2789
+ else
2790
+ echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2791
  } else {
2792
+ if ( has_excerpt() )
2793
+ echo get_the_excerpt();
2794
+ else
2795
+ echo get_the_content();
2796
  }
2797
+ ?>
2798
+ <?php endif; ?>
2799
+ </div><!-- .dslc-download-excerpt -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2800
 
2801
+ <?php endif; ?>
 
 
 
 
 
 
 
2802
 
2803
+ <?php if ( $post_elements == 'all' || in_array( 'button', $post_elements ) ) : ?>
2804
 
2805
+ <div class="dslc-download-download">
2806
+ <a target="_blank" class="dslc-download-count-hook" data-post-id="<?php echo get_the_ID(); ?>" href="<?php echo $download_link; ?>" download>
2807
+ <?php if ( isset( $options['button_icon_id'] ) && $options['button_icon_id'] != '' ) : ?>
2808
+ <span class="dslc-icon dslc-icon-<?php echo $options['button_icon_id']; ?>"></span>
2809
+ <?php endif; ?>
2810
+ <?php echo $options['button_text']; ?>
2811
+ </a>
2812
+ </div><!-- .dslc-download-download -->
2813
 
2814
+ <?php endif; ?>
 
 
2815
 
2816
+ <?php if ( $post_elements == 'all' || in_array( 'count', $post_elements ) ) : ?>
2817
 
2818
+ <div class="dslc-download-info">
2819
+ <?php printf( __( 'Downloaded %d times.', 'live-composer-page-builder' ), $download_count ); ?>
2820
+ </div><!-- .dslc-download-info -->
2821
 
 
 
2822
  <?php endif; ?>
2823
 
2824
+ </div><!-- .dslc-download-main-inner -->
2825
 
2826
+ <?php if ( $link_to_single ) : ?>
2827
+ <a href="<?php the_permalink(); ?>" class="dslc-post-main-inner-link-cover"></a>
2828
+ <?php endif; ?>
2829
 
2830
+ </div><!-- .dslc-download-main -->
2831
 
2832
+ <?php endif; ?>
2833
+
2834
+ </div><!-- .dslc-download-thumb -->
2835
 
2836
  <?php endif; ?>
2837
 
2838
+ <?php endif; ?>
2839
 
2840
+ <?php if ( $options['main_location'] == 'bellow' && ( $post_elements == 'all' || in_array( 'title', $post_elements ) || in_array( 'tags', $post_elements ) || in_array( 'excerpt', $post_elements ) || in_array( 'button', $post_elements ) || in_array( 'count', $post_elements ) ) ) : ?>
2841
 
2842
+ <div class="dslc-post-main dslc-download-main">
2843
 
2844
+ <?php if ( $post_elements == 'all' || in_array( 'title', $post_elements ) ) : ?>
 
 
 
 
 
 
2845
 
2846
+ <div class="dslc-download-title">
2847
+ <?php if ( $link_to_single ) : ?>
2848
+ <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
2849
+ <?php else : ?>
2850
+ <h2><?php the_title(); ?></h2>
2851
+ <?php endif; ?>
2852
+ </div><!-- .dslc-download-title -->
2853
 
2854
+ <?php endif; ?>
2855
 
2856
+ <?php if ( $post_elements == 'all' || in_array( 'tags', $post_elements ) ) : ?>
2857
 
2858
+ <?php if ( ! empty( $download_tags ) ) : ?>
 
 
 
 
 
 
2859
 
2860
+ <div class="dslc-download-tags">
2861
+ In
2862
+ <?php foreach ( $download_tags as $download_tag ) : $download_tags_count++; ?>
2863
+ <?php if ( $download_tags_count > 1 ) { echo ', '; } ?>
2864
+ <a href="<?php echo get_term_link( $download_tag->slug, 'dslc_downloads_tags' ); ?>"><?php echo $download_tag->name; ?></a>
2865
+ <?php endforeach; ?>
2866
+ </div><!-- .dslc-download-tags -->
2867
 
2868
  <?php endif; ?>
2869
 
2870
+ <?php endif; ?>
2871
 
2872
+ <?php if ( $post_elements == 'all' || in_array( 'excerpt', $post_elements ) ) : ?>
2873
+
2874
+ <div class="dslc-download-excerpt">
2875
+ <?php if ( $options['excerpt_or_content'] == 'content' ) : ?>
2876
+ <?php
2877
+ if ( $options['excerpt_length'] > 0 ) {
2878
+ echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2879
+ } else {
2880
+ echo get_the_content();
2881
+ }
2882
+ ?>
2883
+ <?php else : ?>
2884
+ <?php
2885
  if ( $options['excerpt_length'] > 0 ) {
2886
+ if ( has_excerpt() )
2887
+ echo wp_trim_words( get_the_excerpt(), $options['excerpt_length'] );
2888
+ else
2889
+ echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2890
  } else {
2891
+ if ( has_excerpt() )
2892
+ echo get_the_excerpt();
2893
+ else
2894
+ echo get_the_content();
2895
  }
2896
+ ?>
2897
+ <?php endif; ?>
2898
+ </div><!-- .dslc-download-excerpt -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2899
 
2900
+ <?php endif; ?>
2901
 
2902
+ <?php if ( ( $post_elements == 'all' || in_array( 'button', $post_elements ) ) && $download_link ) : ?>
 
 
 
 
 
 
 
2903
 
2904
+ <div class="dslc-download-download">
2905
+ <a target="_blank" class="dslc-download-count-hook" data-post-id="<?php echo get_the_ID(); ?>" href="<?php echo $download_link; ?>" download>
2906
+ <?php if ( isset( $options['button_icon_id'] ) && $options['button_icon_id'] != '' ) : ?>
2907
+ <span class="dslc-icon dslc-icon-<?php echo $options['button_icon_id']; ?>"></span>
2908
+ <?php endif; ?>
2909
+ <?php echo $options['button_text']; ?>
2910
+ </a>
2911
+ </div><!-- .dslc-download-download -->
2912
 
2913
+ <?php endif; ?>
2914
 
2915
+ <?php if ( ( $post_elements == 'all' || in_array( 'count', $post_elements ) ) && $download_link ) : ?>
 
 
2916
 
2917
+ <div class="dslc-download-info">
2918
+ <?php printf( __( 'Downloaded %d times.', 'live-composer-page-builder' ), $download_count ); ?>
2919
+ </div><!-- .dslc-download-info -->
2920
 
2921
+ <?php endif; ?>
2922
 
2923
+ </div><!-- .dslc-download-main -->
2924
 
2925
+ <?php endif; ?>
2926
 
2927
+ </div><!-- .dslc-download -->
2928
 
2929
+ <?php
 
 
 
2930
 
2931
+ // Row Separator
2932
+ if ( $options['type'] == 'grid' && $count == 0 && $real_count != $dslc_query->found_posts && $real_count != $options['amount'] && $options['separator_enabled'] == 'enabled' ) {
2933
+ echo '<div class="dslc-post-separator"></div>';
2934
+ }
2935
 
2936
+ endwhile;
2937
 
2938
+ if ( $options['type'] == 'carousel' ) :
2939
 
2940
+ ?></div><?php
2941
 
2942
+ endif;
2943
 
2944
+ ?></div><!-- .dslc-posts-inner --><?php
2945
 
2946
+ ?></div><?php
2947
 
2948
+ else :
 
 
2949
 
2950
+ if ( $dslc_is_admin ) :
2951
+ ?><div class="dslc-notification dslc-red"><?php _e( 'You do not have downloads at the moment. Go to <strong>WP Admin &rarr; Downloads</strong> to add some.', 'live-composer-page-builder' ); ?> <span class="dslca-refresh-module-hook dslc-icon dslc-icon-refresh"></span></span></div><?php
2952
  endif;
2953
 
2954
+ endif;
 
 
2955
 
2956
+ /**
2957
+ * Pagination
2958
+ */
 
 
 
 
2959
 
2960
+ if ( isset( $options['pagination_type'] ) && $options['pagination_type'] != 'disabled' ) {
2961
+ $num_pages = $dslc_query->max_num_pages;
2962
+ if ( $options['offset'] > 0 ) {
2963
+ $num_pages = ceil( ( $dslc_query->found_posts - $options['offset'] ) / $options['amount'] );
2964
+ }
2965
+ dslc_post_pagination( array('pages' => $num_pages, 'type' => $options['pagination_type']) );
2966
+ }
2967
 
2968
+ wp_reset_postdata();
2969
 
2970
+ $shortcode_rendered = ob_get_contents();
2971
+ ob_end_clean();
2972
 
2973
+ return $shortcode_rendered;
2974
 
2975
+ } add_shortcode( 'dslc_module_downloads_output', 'dslc_module_downloads_output' );
modules/galleries/module.php CHANGED
@@ -2400,624 +2400,637 @@ class DSLC_Galleries extends DSLC_Module {
2400
  * @return void
2401
  */
2402
  function output( $options ) {
 
 
 
2403
 
2404
- if ( is_feed() ) {
2405
- // Prevent category/tag feeds to stuck in an infinite loop
2406
- return false;
2407
- }
2408
 
2409
- global $dslc_active;
 
 
2410
 
2411
- if ( $dslc_active && is_user_logged_in() && current_user_can( DS_LIVE_COMPOSER_CAPABILITY ) )
2412
- $dslc_is_admin = true;
2413
- else
2414
- $dslc_is_admin = false;
2415
 
2416
- // Fix slashes on apostrophes
2417
- if ( isset( $options['button_text'] ) ) {
2418
- $options['button_text'] = stripslashes( $options['button_text'] );
2419
- }
2420
 
 
2421
 
2422
- if ( ! isset( $options['count_pos'] ) )
2423
- $options['count_pos'] = 'center';
 
 
2424
 
2425
- /* Module output stars here */
 
 
 
2426
 
2427
- if ( ! isset( $options['excerpt_length'] ) ) $options['excerpt_length'] = 20;
2428
 
2429
- if ( is_front_page() ) { $paged = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1; } else { $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; }
 
2430
 
2431
- // Fix for pagination from other modules affecting this one when pag disabled
2432
- if ( $options['pagination_type'] == 'disabled' ) $paged = 1;
2433
 
2434
- // Fix for offset braking pagination
2435
- $query_offset = $options['offset'];
2436
- if ( $query_offset > 0 && $paged > 1 ) $query_offset = ( $paged - 1 ) * $options['amount'] + $options['offset'];
2437
 
2438
- $args = array(
2439
- 'paged' => $paged,
2440
- 'post_type' => 'dslc_galleries',
2441
- 'posts_per_page' => $options['amount'],
2442
- 'order' => $options['order'],
2443
- 'orderby' => $options['orderby'],
2444
- );
2445
 
2446
- // Add offset
2447
- if ( $query_offset > 0 ) {
2448
- $args['offset'] = $query_offset;
2449
- }
2450
 
2451
- if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
2452
- $args['post_status'] = array('publish', 'private');
2453
- }
2454
 
2455
- if ( isset( $options['categories'] ) && $options['categories'] != '' ) {
 
 
 
 
 
 
2456
 
2457
- $cats_array = explode( ' ', trim( $options['categories'] ) );
 
 
 
2458
 
2459
- $args['tax_query'] = array(
2460
- array(
2461
- 'taxonomy' => 'dslc_galleries_cats',
2462
- 'field' => 'slug',
2463
- 'terms' => $cats_array,
2464
- 'operator' => $options['categories_operator']
2465
- )
2466
- );
2467
 
2468
- }
2469
 
2470
- // Exlcude and Include arrays
2471
- $exclude = array();
2472
- $include = array();
2473
 
2474
- // Exclude current post
2475
- if ( is_singular( get_post_type() ) )
2476
- $exclude[] = get_the_ID();
 
 
 
 
 
2477
 
2478
- // Exclude posts ( option )
2479
- if ( $options['query_post_not_in'] )
2480
- $exclude = array_merge( $exclude, explode( ' ', $options['query_post_not_in'] ) );
2481
 
2482
- // Include posts ( option )
2483
- if ( $options['query_post_in'] )
2484
- $include = array_merge( $include, explode( ' ', $options['query_post_in'] ) );
2485
 
2486
- // Include query parameter
2487
- if ( ! empty( $include ) )
2488
- $args['post__in'] = $include;
2489
 
2490
- // Exclude query parameter
2491
- if ( ! empty( $exclude ) )
2492
- $args['post__not_in'] = $exclude;
2493
 
2494
- // Author archive page
2495
- if ( is_author() && $options['query_alter'] == 'enabled' ) {
2496
- global $authordata;
2497
- $args['author__in'] = array($authordata->data->ID);
2498
- }
2499
 
2500
- // No paging
2501
- if ( $options['pagination_type'] == 'disabled' )
2502
- $args['no_found_rows'] = true;
2503
 
2504
- // Do the query
2505
- if ( ( is_category() || is_tag() || is_tax() || is_search() || is_date() ) && $options['query_alter'] == 'enabled' ) {
2506
- global $wp_query;
2507
- $dslc_query = $wp_query;
2508
- } else {
2509
- $dslc_query = new WP_Query( $args );
2510
- }
2511
 
2512
- $wrapper_class = '';
2513
- $columns_class = 'dslc-col dslc-' . $options['columns'] . '-col ';
2514
- $count = 0;
2515
- $real_count = 0;
2516
- $increment = $options['columns'];
2517
- $max_count = 12;
2518
 
2519
- /**
2520
- * Elements to show
2521
- */
2522
 
2523
- // Main Elements
2524
- $elements = $options['elements'];
2525
- if ( ! empty( $elements ) )
2526
- $elements = explode( ' ', trim( $elements ) );
2527
- else
2528
- $elements = array();
 
2529
 
 
 
 
 
 
 
2530
 
2531
- // Post Elements
2532
- $post_elements = $options['post_elements'];
2533
- if ( ! empty( $post_elements ) )
2534
- $post_elements = explode( ' ', trim( $post_elements ) );
2535
- else
2536
- $post_elements = 'all';
2537
 
2538
- // Carousel Elements
2539
- $carousel_elements = $options['carousel_elements'];
2540
- if ( ! empty( $carousel_elements ) )
2541
- $carousel_elements = explode( ' ', trim( $carousel_elements ) );
2542
- else
2543
- $carousel_elements = array();
2544
 
2545
- /* Container Class */
2546
 
2547
- $container_class = 'dslc-posts dslc-galleries dslc-clearfix dslc-posts-orientation-' . $options['orientation'] . ' ';
 
 
 
 
 
2548
 
2549
- if ( $options['type'] == 'masonry' )
2550
- $container_class .= 'dslc-init-masonry ';
2551
- elseif ( $options['type'] == 'carousel' )
2552
- $container_class .= 'dslc-init-carousel ';
2553
- elseif ( $options['type'] == 'grid' )
2554
- $container_class .= 'dslc-init-grid ';
2555
 
2556
- /* Element Class */
2557
 
2558
- $element_class = 'dslc-post dslc-gallery ';
2559
 
2560
- if ( $options['type'] == 'masonry' )
2561
- $element_class .= 'dslc-masonry-item ';
2562
- elseif ( $options['type'] == 'carousel' )
2563
- $element_class .= 'dslc-carousel-item ';
 
 
2564
 
2565
- /**
2566
- * What is shown
2567
- */
2568
 
2569
- $show_header = false;
2570
- $show_heading = false;
2571
- $show_filters = false;
2572
- $show_carousel_arrows = false;
2573
- $show_view_all_link = false;
2574
 
2575
- if ( in_array( 'main_heading', $elements ) )
2576
- $show_heading = true;
 
 
2577
 
2578
- if ( ( $elements == 'all' || in_array( 'filters', $elements ) ) && $options['type'] !== 'carousel' )
2579
- $show_filters = true;
 
2580
 
2581
- if ( $options['type'] == 'carousel' && in_array( 'arrows', $carousel_elements ) )
2582
- $show_carousel_arrows = true;
 
 
 
2583
 
2584
- if ( $show_heading || $show_filters || $show_carousel_arrows )
2585
- $show_header = true;
2586
 
2587
- /**
2588
- * Carousel Items
2589
- */
2590
 
2591
- switch ( $options['columns'] ) {
2592
- case 12 :
2593
- $carousel_items = 1;
2594
- break;
2595
- case 6 :
2596
- $carousel_items = 2;
2597
- break;
2598
- case 4 :
2599
- $carousel_items = 3;
2600
- break;
2601
- case 3 :
2602
- $carousel_items = 4;
2603
- break;
2604
- case 2 :
2605
- $carousel_items = 6;
2606
- break;
2607
- default:
2608
- $carousel_items = 6;
2609
- break;
2610
- }
2611
 
2612
- /**
2613
- * Heading ( output )
2614
- */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2615
 
2616
- if ( $show_header ) :
2617
- ?>
2618
- <div class="dslc-module-heading">
2619
 
2620
- <!-- Heading -->
 
 
2621
 
2622
- <?php if ( $show_heading ) : ?>
2623
 
2624
- <h2 class="dslca-editable-content" data-id="main_heading_title" data-type="simple" <?php if ( $dslc_is_admin ) echo 'contenteditable'; ?> ><?php echo stripslashes( $options['main_heading_title'] ); ?></h2>
2625
 
2626
- <!-- View all -->
2627
 
2628
- <?php if ( isset( $options['view_all_link'] ) && $options['view_all_link'] !== '' ) : ?>
2629
 
2630
- <span class="dslc-module-heading-view-all"><a href="<?php echo $options['view_all_link']; ?>" class="dslca-editable-content" data-id="main_heading_link_title" data-type="simple" <?php if ( $dslc_is_admin ) echo 'contenteditable'; ?> ><?php echo $options['main_heading_link_title']; ?></a></span>
2631
 
2632
- <?php endif; ?>
2633
 
2634
  <?php endif; ?>
2635
 
2636
- <!-- Filters -->
2637
 
2638
- <?php
2639
 
2640
- if ( $show_filters ) {
2641
 
2642
- $cats_array = array();
2643
 
2644
- if ( $dslc_query->have_posts() ) {
2645
 
2646
- while ( $dslc_query->have_posts() ) {
2647
 
2648
- $dslc_query->the_post();
2649
 
2650
- $post_cats = get_the_terms( get_the_ID(), 'dslc_galleries_cats' );
2651
- if ( ! empty( $post_cats ) ) {
2652
- foreach ( $post_cats as $post_cat ) {
2653
- $cats_array[$post_cat->slug] = $post_cat->name;
2654
- }
2655
- }
2656
 
 
 
 
 
 
2657
  }
2658
 
2659
  }
2660
 
2661
- ?>
2662
 
2663
- <div class="dslc-post-filters">
2664
- <span class="dslc-post-filter dslc-active dslca-editable-content" data-filter-id="show-all" <?php if ( $dslc_is_admin ){ echo 'data-id="main_filter_title_all" data-type="simple" contenteditable '; } ?>><?php echo $options['main_filter_title_all']; ?></span>
2665
 
2666
- <?php foreach ( $cats_array as $cat_slug => $cat_name ) : ?>
2667
- <span class="dslc-post-filter dslc-inactive" data-filter-id="<?php echo $cat_slug; ?>"><?php echo $cat_name; ?></span>
2668
- <?php endforeach; ?>
2669
 
2670
- </div><!-- .dslc-post-filters -->
 
 
2671
 
2672
- <?php
2673
 
2674
- }
2675
 
2676
- ?>
2677
 
2678
- <!-- Carousel -->
2679
 
2680
- <?php if ( $show_carousel_arrows ) : ?>
2681
- <span class="dslc-carousel-nav fr">
2682
- <span class="dslc-carousel-nav-inner">
2683
- <a href="#" class="dslc-carousel-nav-prev"><span class="dslc-icon-chevron-left"></span></a>
2684
- <a href="#" class="dslc-carousel-nav-next"><span class="dslc-icon-chevron-right"></span></a>
2685
- </span>
2686
- </span><!-- .carousel-nav -->
2687
- <?php endif; ?>
2688
 
2689
- </div><!-- .dslc-module-heading -->
2690
- <?php
 
 
 
 
 
 
2691
 
2692
- endif;
2693
-
2694
- /**
2695
- * Posts ( output )
2696
- */
2697
 
2698
- if ( $dslc_query->have_posts() ) :
2699
 
2700
- ?><div class="<?php echo $container_class; ?>"><?php
 
 
2701
 
2702
- ?><div class="dslc-posts-inner"><?php
2703
 
2704
- if ( $options['type'] == 'carousel' ) :
2705
 
2706
- ?><div class="dslc-loader"></div><div class="dslc-carousel" data-stop-on-hover="<?php echo $options['carousel_autoplay_hover']; ?>" data-autoplay="<?php echo $options['carousel_autoplay']; ?>" data-columns="<?php echo $carousel_items; ?>" data-pagination="<?php if ( in_array( 'circles', $carousel_elements ) ) echo 'true'; else echo 'false'; ?>" data-slide-speed="<?php echo $options['arrows_slide_speed']; ?>" data-pagination-speed="<?php echo $options['circles_slide_speed']; ?>"><?php
2707
 
2708
- endif;
2709
 
2710
- while ( $dslc_query->have_posts() ) : $dslc_query->the_post(); $count += $increment; $real_count++;
2711
 
2712
- if ( $count == $max_count ) {
2713
- $count = 0;
2714
- $extra_class = ' dslc-last-col';
2715
- } elseif ( $count == $increment ) {
2716
- $extra_class = ' dslc-first-col';
2717
- } else {
2718
- $extra_class = '';
2719
- }
2720
 
2721
- if ( ! has_post_thumbnail() )
2722
- $extra_class .= ' dslc-post-no-thumb';
2723
 
2724
- $gallery_images = get_post_meta( get_the_ID(), 'dslc_gallery_images', true );
2725
- $gallery_images_count = 0;
 
 
 
 
 
 
2726
 
2727
- if ( $gallery_images )
2728
- $gallery_images = explode( ' ', trim( $gallery_images ) );
2729
 
2730
- if ( is_array( $gallery_images ) ) {
2731
- $gallery_images_count = count( $gallery_images );
2732
- }
2733
 
2734
- $post_cats = get_the_terms( get_the_ID(), 'dslc_galleries_cats' );
2735
- $post_cats_data = '';
2736
- if ( ! empty( $post_cats ) ) {
2737
- foreach ( $post_cats as $post_cat ) {
2738
- $post_cats_data .= $post_cat->slug . ' ';
2739
- }
2740
- }
2741
 
2742
- $thumb_anchor_class = '';
2743
- $title_anchor_class = '';
 
2744
 
2745
- if ( $options['title_link_behaviour'] == 'lightbox' ) {
2746
- $title_anchor_class = 'dslc-trigger-lightbox-gallery';
 
 
 
2747
  }
 
2748
 
2749
- if ( $options['thumb_link_behaviour'] == 'lightbox' ) {
2750
- $thumb_anchor_class = 'dslc-trigger-lightbox-gallery';
2751
- }
2752
 
2753
- // Custom URL
2754
- $the_permalink = get_permalink();
2755
- if ( get_post_meta( get_the_ID(), 'dslc_custom_url', true ) )
2756
- $the_permalink = get_post_meta( get_the_ID(), 'dslc_custom_url', true );
2757
 
2758
- ?>
 
 
2759
 
2760
- <div class="<?php echo $element_class . $columns_class . $extra_class; ?>" data-cats="<?php echo $post_cats_data; ?>">
 
 
 
2761
 
2762
- <?php if ( $post_elements == 'all' || in_array( 'thumbnail', $post_elements ) ) : ?>
2763
 
2764
- <?php if ( has_post_thumbnail() ) : ?>
2765
 
2766
- <div class="dslc-post-thumb dslc-gallery-thumb dslc-on-hover-anim">
2767
 
2768
- <div class="dslc-gallery-thumb-inner dslca-post-thumb">
2769
 
2770
- <?php
2771
- /**
2772
- * Manual Resize
2773
- */
2774
 
2775
- $manual_resize = false;
2776
- if ( isset( $options['thumb_resize_height'] ) && ! empty( $options['thumb_resize_height'] ) || isset( $options['thumb_resize_width_manual'] ) && ! empty( $options['thumb_resize_width_manual'] ) ) {
2777
 
2778
- $manual_resize = true;
2779
- $thumb_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
2780
- $thumb_url = $thumb_url[0];
 
2781
 
2782
- $thumb_alt = get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true );
2783
- if ( ! $thumb_alt ) $thumb_alt = '';
2784
 
2785
- $resize_width = false;
2786
- $resize_height = false;
 
2787
 
2788
- if ( isset( $options['thumb_resize_width_manual'] ) && ! empty( $options['thumb_resize_width_manual'] ) ) {
2789
- $resize_width = $options['thumb_resize_width_manual'];
2790
- }
2791
 
2792
- if ( isset( $options['thumb_resize_height'] ) && ! empty( $options['thumb_resize_height'] ) ) {
2793
- $resize_height = $options['thumb_resize_height'];
2794
- }
2795
 
 
 
2796
  }
2797
- ?>
2798
 
2799
- <?php if ( $manual_resize ) : ?>
2800
- <a href="<?php echo $the_permalink; ?>" class="<?php echo $thumb_anchor_class; ?>"><img src="<?php $res_img = dslc_aq_resize( $thumb_url, $resize_width, $resize_height, true ); echo $res_img; ?>" alt="<?php echo $thumb_alt; ?>" /></a>
2801
- <?php else : ?>
2802
- <a href="<?php echo $the_permalink; ?>" class="<?php echo $thumb_anchor_class; ?>"><?php the_post_thumbnail( 'full' ); ?></a>
2803
- <?php endif; ?>
2804
 
2805
- <?php if ( $post_elements == 'all' || in_array( 'count', $post_elements ) ) : ?>
2806
- <a href="<?php echo $the_permalink; ?>" class="<?php echo $thumb_anchor_class; ?> dslc-gallery-images-count dslc-init-square dslc-init-<?php echo $options['count_pos']; ?>">
2807
- <span class="dslc-gallery-images-count-main dslc-gallery-images-count-bg dslc-init-target">
2808
- <span class="dslc-gallery-images-count-num"><?php echo $gallery_images_count; ?></span>
2809
- <span class="dslc-gallery-images-count-txt"><?php echo $options['count_text']; ?></span>
2810
- </span>
2811
- </a><!-- .dslc-gallery-images-count -->
2812
- <?php endif; ?>
2813
 
2814
- </div><!-- .dslc-gallery-thumb-inner -->
 
 
 
 
2815
 
2816
- <?php if ( ( $options['main_location'] == 'inside' || $options['main_location'] == 'inside_visible' ) && ( $post_elements == 'all' || in_array( 'title', $post_elements ) || in_array( 'excerpt', $post_elements ) || in_array( 'separator', $post_elements ) ) ) : ?>
 
 
 
 
 
 
 
2817
 
2818
- <div class="dslc-post-main dslc-gallery-main dslc-init-<?php echo $options['main_position']; ?> <?php if ( $options['main_location'] == 'inside_visible' ) echo 'dslc-gallery-main-visible'; ?> dslc-on-hover-anim-target dslc-anim-<?php echo $options['css_anim_hover']; ?>" data-dslc-anim="<?php echo $options['css_anim_hover'] ?>" data-dslc-anim-speed="<?php echo $options['css_anim_speed']; ?>">
2819
 
2820
- <div class="dslc-gallery-main-inner dslc-init-target">
2821
 
2822
- <?php if ( $post_elements == 'all' || in_array( 'title', $post_elements ) ) : ?>
2823
 
2824
- <div class="dslc-gallery-title">
2825
- <h2><a href="<?php echo $the_permalink; ?>" class="<?php echo $title_anchor_class; ?>"><?php the_title(); ?></a></h2>
2826
- </div><!-- .dslc-gallery-title -->
2827
 
2828
- <?php endif; ?>
2829
 
2830
- <?php if ( $post_elements == 'all' || in_array( 'separator', $post_elements ) ) : ?>
2831
- <span class="dslc-gallery-sep"></span>
2832
- <?php endif; ?>
2833
 
2834
- <?php if ( $post_elements == 'all' || in_array( 'excerpt', $post_elements ) ) : ?>
2835
 
2836
- <div class="dslc-gallery-excerpt">
2837
- <?php if ( $options['excerpt_or_content'] == 'content' ) : ?>
2838
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2839
  if ( $options['excerpt_length'] > 0 ) {
2840
- echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
 
 
 
2841
  } else {
2842
- echo get_the_content();
 
 
 
2843
  }
2844
- ?>
2845
- <?php else : ?>
2846
- <?php
2847
- if ( $options['excerpt_length'] > 0 ) {
2848
- if ( has_excerpt() )
2849
- echo wp_trim_words( get_the_excerpt(), $options['excerpt_length'] );
2850
- else
2851
- echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2852
- } else {
2853
- if ( has_excerpt() )
2854
- echo get_the_excerpt();
2855
- else
2856
- echo get_the_content();
2857
- }
2858
- ?>
2859
- <?php endif; ?>
2860
- </div><!-- .dslc-gallery-excerpt -->
2861
-
2862
- <?php endif; ?>
2863
 
2864
- <?php if ( $post_elements == 'all' || in_array( 'button', $post_elements ) ) : ?>
2865
 
2866
- <div class="dslc-gallery-read-more">
2867
- <a href="<?php the_permalink(); ?>">
2868
- <?php if ( isset( $options['button_icon_id'] ) && $options['button_icon_id'] != '' ) : ?>
2869
- <span class="dslc-icon dslc-icon-<?php echo $options['button_icon_id']; ?>"></span>
2870
- <?php endif; ?>
2871
- <?php echo $options['button_text']; ?>
2872
- </a>
2873
- </div><!-- .dslc-gallery-read-more -->
2874
 
2875
- <?php endif; ?>
 
 
 
 
 
 
 
2876
 
2877
- </div><!-- .dslc-gallery-main-inner -->
2878
 
2879
- <a href="<?php the_permalink(); ?>" class="dslc-post-main-inner-link-cover"></a>
2880
 
2881
- </div><!-- .dslc-gallery-main -->
2882
 
2883
- <?php endif; ?>
2884
 
2885
- </div><!-- .dslc-gallery-thumb -->
2886
 
2887
- <?php endif; ?>
2888
 
2889
  <?php endif; ?>
2890
 
2891
- <?php if ( $options['main_location'] == 'bellow' && ( $post_elements == 'all' || in_array( 'title', $post_elements ) || in_array( 'excerpt', $post_elements ) || in_array( 'separator', $post_elements ) ) ) : ?>
2892
 
2893
- <div class="dslc-post-main dslc-gallery-main">
2894
 
2895
- <?php if ( $post_elements == 'all' || in_array( 'title', $post_elements ) ) : ?>
2896
 
2897
- <div class="dslc-gallery-title">
2898
- <h2><a href="<?php echo $the_permalink; ?>" class="<?php echo $title_anchor_class; ?>"><?php the_title(); ?></a></h2>
2899
- </div><!-- .dslc-gallery-title -->
2900
 
2901
- <?php endif; ?>
 
 
2902
 
2903
- <?php if ( $post_elements == 'all' || in_array( 'separator', $post_elements ) ) : ?>
2904
- <span class="dslc-gallery-sep"></span>
2905
- <?php endif; ?>
 
 
2906
 
2907
- <?php if ( $post_elements == 'all' || in_array( 'excerpt', $post_elements ) ) : ?>
2908
 
2909
- <div class="dslc-gallery-excerpt">
2910
- <?php if ( $options['excerpt_or_content'] == 'content' ) : ?>
2911
- <?php
 
 
 
 
 
 
 
 
2912
  if ( $options['excerpt_length'] > 0 ) {
2913
- echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
 
 
 
2914
  } else {
2915
- echo get_the_content();
 
 
 
2916
  }
2917
- ?>
2918
- <?php else : ?>
2919
- <?php
2920
- if ( $options['excerpt_length'] > 0 ) {
2921
- if ( has_excerpt() )
2922
- echo wp_trim_words( get_the_excerpt(), $options['excerpt_length'] );
2923
- else
2924
- echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2925
- } else {
2926
- if ( has_excerpt() )
2927
- echo get_the_excerpt();
2928
- else
2929
- echo get_the_content();
2930
- }
2931
- ?>
2932
- <?php endif; ?>
2933
- </div><!-- .dslc-gallery-excerpt -->
2934
 
2935
- <?php endif; ?>
2936
 
2937
- <?php if ( $post_elements == 'all' || in_array( 'button', $post_elements ) ) : ?>
2938
 
2939
- <div class="dslc-gallery-read-more">
2940
- <a href="<?php the_permalink(); ?>">
2941
- <?php if ( isset( $options['button_icon_id'] ) && $options['button_icon_id'] != '' ) : ?>
2942
- <span class="dslc-icon dslc-icon-<?php echo $options['button_icon_id']; ?>"></span>
2943
- <?php endif; ?>
2944
- <?php echo $options['button_text']; ?>
2945
- </a>
2946
- </div><!-- .dslc-gallery-read-more -->
2947
 
2948
- <?php endif; ?>
2949
 
2950
- </div><!-- .dslc-gallery-main -->
2951
 
2952
- <?php endif; ?>
2953
 
2954
- <?php if ( $gallery_images_count > 0 ) : ?>
2955
 
2956
- <div class="dslc-lightbox-gallery">
2957
 
2958
- <?php foreach ( $gallery_images as $gallery_image ) : ?>
2959
 
2960
- <?php
2961
- $gallery_image_src = wp_get_attachment_image_src( $gallery_image, 'full' );
2962
- $gallery_image_src = $gallery_image_src[0];
2963
 
2964
- $gallery_image_title = get_post_meta( $gallery_image, '_wp_attachment_image_alt', true );
2965
- if ( ! $gallery_image_title ) $gallery_image_title = '';
2966
- ?>
2967
-
2968
- <a href="<?php echo $gallery_image_src; ?>" title="<?php echo esc_attr( $gallery_image_title ); ?>"></a>
2969
 
2970
- <?php endforeach; ?>
2971
 
2972
- </div><!-- .dslc-gallery-lightbox -->
2973
 
2974
- <?php endif; ?>
2975
 
2976
- </div><!-- .dslc-gallery -->
2977
 
2978
- <?php
2979
 
2980
- // Row Separator
2981
- if ( $options['type'] == 'grid' && $count == 0 && $real_count != $dslc_query->found_posts && $real_count != $options['amount'] && $options['separator_enabled'] == 'enabled' ) {
2982
- echo '<div class="dslc-post-separator"></div>';
2983
- }
2984
 
2985
- endwhile;
 
 
 
2986
 
2987
- if ( $options['type'] == 'carousel' ) :
2988
 
2989
- ?></div><?php
2990
 
2991
- endif;
2992
 
2993
- ?></div><!-- .dslc-posts-inner --><?php
2994
 
2995
- ?></div><?php
2996
 
2997
- else :
2998
 
2999
- if ( $dslc_is_admin ) :
3000
- ?><div class="dslc-notification dslc-red"><?php _e( 'You do not have any galleries at the moment. Go to <strong>WP Admin &rarr; Galleries</strong> to add some.', 'live-composer-page-builder' ); ?> <span class="dslca-refresh-module-hook dslc-icon dslc-icon-refresh"></span></span></div><?php
3001
- endif;
3002
 
 
 
3003
  endif;
3004
 
3005
- /**
3006
- * Pagination
3007
- */
3008
 
3009
- if ( isset( $options['pagination_type'] ) && $options['pagination_type'] != 'disabled' ) {
3010
- $num_pages = $dslc_query->max_num_pages;
3011
- if ( $options['offset'] > 0 ) {
3012
- $num_pages = ceil( ( $dslc_query->found_posts - $options['offset'] ) / $options['amount'] );
3013
- }
3014
- dslc_post_pagination( array('pages' => $num_pages, 'type' => $options['pagination_type']) );
3015
- }
3016
 
3017
- wp_reset_postdata();
 
 
 
 
 
 
3018
 
 
3019
 
 
 
3020
 
3021
- }
3022
 
3023
- }
2400
  * @return void
2401
  */
2402
  function output( $options ) {
2403
+ ?>
2404
+ [dslc_module_galleries_output]<?php echo serialize($options); ?>[/dslc_module_galleries_output]
2405
+ <?php
2406
 
2407
+ }
2408
+ }
 
 
2409
 
2410
+ function dslc_module_galleries_output ( $atts, $content = null ) {
2411
+ // Uncode module options passed as serialized content.
2412
+ $options = unserialize( $content );
2413
 
2414
+ ob_start();
 
 
 
2415
 
2416
+ if ( is_feed() ) {
2417
+ // Prevent category/tag feeds to stuck in an infinite loop
2418
+ return false;
2419
+ }
2420
 
2421
+ global $dslc_active;
2422
 
2423
+ if ( $dslc_active && is_user_logged_in() && current_user_can( DS_LIVE_COMPOSER_CAPABILITY ) )
2424
+ $dslc_is_admin = true;
2425
+ else
2426
+ $dslc_is_admin = false;
2427
 
2428
+ // Fix slashes on apostrophes
2429
+ if ( isset( $options['button_text'] ) ) {
2430
+ $options['button_text'] = stripslashes( $options['button_text'] );
2431
+ }
2432
 
 
2433
 
2434
+ if ( ! isset( $options['count_pos'] ) )
2435
+ $options['count_pos'] = 'center';
2436
 
2437
+ /* Module output stars here */
 
2438
 
2439
+ if ( ! isset( $options['excerpt_length'] ) ) $options['excerpt_length'] = 20;
 
 
2440
 
2441
+ if ( is_front_page() ) { $paged = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1; } else { $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; }
 
 
 
 
 
 
2442
 
2443
+ // Fix for pagination from other modules affecting this one when pag disabled
2444
+ if ( $options['pagination_type'] == 'disabled' ) $paged = 1;
 
 
2445
 
2446
+ // Fix for offset braking pagination
2447
+ $query_offset = $options['offset'];
2448
+ if ( $query_offset > 0 && $paged > 1 ) $query_offset = ( $paged - 1 ) * $options['amount'] + $options['offset'];
2449
 
2450
+ $args = array(
2451
+ 'paged' => $paged,
2452
+ 'post_type' => 'dslc_galleries',
2453
+ 'posts_per_page' => $options['amount'],
2454
+ 'order' => $options['order'],
2455
+ 'orderby' => $options['orderby'],
2456
+ );
2457
 
2458
+ // Add offset
2459
+ if ( $query_offset > 0 ) {
2460
+ $args['offset'] = $query_offset;
2461
+ }
2462
 
2463
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
2464
+ $args['post_status'] = array('publish', 'private');
2465
+ }
 
 
 
 
 
2466
 
2467
+ if ( isset( $options['categories'] ) && $options['categories'] != '' ) {
2468
 
2469
+ $cats_array = explode( ' ', trim( $options['categories'] ) );
 
 
2470
 
2471
+ $args['tax_query'] = array(
2472
+ array(
2473
+ 'taxonomy' => 'dslc_galleries_cats',
2474
+ 'field' => 'slug',
2475
+ 'terms' => $cats_array,
2476
+ 'operator' => $options['categories_operator']
2477
+ )
2478
+ );
2479
 
2480
+ }
 
 
2481
 
2482
+ // Exlcude and Include arrays
2483
+ $exclude = array();
2484
+ $include = array();
2485
 
2486
+ // Exclude current post
2487
+ if ( is_singular( get_post_type() ) )
2488
+ $exclude[] = get_the_ID();
2489
 
2490
+ // Exclude posts ( option )
2491
+ if ( $options['query_post_not_in'] )
2492
+ $exclude = array_merge( $exclude, explode( ' ', $options['query_post_not_in'] ) );
2493
 
2494
+ // Include posts ( option )
2495
+ if ( $options['query_post_in'] )
2496
+ $include = array_merge( $include, explode( ' ', $options['query_post_in'] ) );
 
 
2497
 
2498
+ // Include query parameter
2499
+ if ( ! empty( $include ) )
2500
+ $args['post__in'] = $include;
2501
 
2502
+ // Exclude query parameter
2503
+ if ( ! empty( $exclude ) )
2504
+ $args['post__not_in'] = $exclude;
 
 
 
 
2505
 
2506
+ // Author archive page
2507
+ if ( is_author() && $options['query_alter'] == 'enabled' ) {
2508
+ global $authordata;
2509
+ $args['author__in'] = array($authordata->data->ID);
2510
+ }
 
2511
 
2512
+ // No paging
2513
+ if ( $options['pagination_type'] == 'disabled' )
2514
+ $args['no_found_rows'] = true;
2515
 
2516
+ // Do the query
2517
+ if ( ( is_category() || is_tag() || is_tax() || is_search() || is_date() ) && $options['query_alter'] == 'enabled' ) {
2518
+ global $wp_query;
2519
+ $dslc_query = $wp_query;
2520
+ } else {
2521
+ $dslc_query = new WP_Query( $args );
2522
+ }
2523
 
2524
+ $wrapper_class = '';
2525
+ $columns_class = 'dslc-col dslc-' . $options['columns'] . '-col ';
2526
+ $count = 0;
2527
+ $real_count = 0;
2528
+ $increment = $options['columns'];
2529
+ $max_count = 12;
2530
 
2531
+ /**
2532
+ * Elements to show
2533
+ */
 
 
 
2534
 
2535
+ // Main Elements
2536
+ $elements = $options['elements'];
2537
+ if ( ! empty( $elements ) )
2538
+ $elements = explode( ' ', trim( $elements ) );
2539
+ else
2540
+ $elements = array();
2541
 
 
2542
 
2543
+ // Post Elements
2544
+ $post_elements = $options['post_elements'];
2545
+ if ( ! empty( $post_elements ) )
2546
+ $post_elements = explode( ' ', trim( $post_elements ) );
2547
+ else
2548
+ $post_elements = 'all';
2549
 
2550
+ // Carousel Elements
2551
+ $carousel_elements = $options['carousel_elements'];
2552
+ if ( ! empty( $carousel_elements ) )
2553
+ $carousel_elements = explode( ' ', trim( $carousel_elements ) );
2554
+ else
2555
+ $carousel_elements = array();
2556
 
2557
+ /* Container Class */
2558
 
2559
+ $container_class = 'dslc-posts dslc-galleries dslc-clearfix dslc-posts-orientation-' . $options['orientation'] . ' ';
2560
 
2561
+ if ( $options['type'] == 'masonry' )
2562
+ $container_class .= 'dslc-init-masonry ';
2563
+ elseif ( $options['type'] == 'carousel' )
2564
+ $container_class .= 'dslc-init-carousel ';
2565
+ elseif ( $options['type'] == 'grid' )
2566
+ $container_class .= 'dslc-init-grid ';
2567
 
2568
+ /* Element Class */
 
 
2569
 
2570
+ $element_class = 'dslc-post dslc-gallery ';
 
 
 
 
2571
 
2572
+ if ( $options['type'] == 'masonry' )
2573
+ $element_class .= 'dslc-masonry-item ';
2574
+ elseif ( $options['type'] == 'carousel' )
2575
+ $element_class .= 'dslc-carousel-item ';
2576
 
2577
+ /**
2578
+ * What is shown
2579
+ */
2580
 
2581
+ $show_header = false;
2582
+ $show_heading = false;
2583
+ $show_filters = false;
2584
+ $show_carousel_arrows = false;
2585
+ $show_view_all_link = false;
2586
 
2587
+ if ( in_array( 'main_heading', $elements ) )
2588
+ $show_heading = true;
2589
 
2590
+ if ( ( $elements == 'all' || in_array( 'filters', $elements ) ) && $options['type'] !== 'carousel' )
2591
+ $show_filters = true;
 
2592
 
2593
+ if ( $options['type'] == 'carousel' && in_array( 'arrows', $carousel_elements ) )
2594
+ $show_carousel_arrows = true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2595
 
2596
+ if ( $show_heading || $show_filters || $show_carousel_arrows )
2597
+ $show_header = true;
2598
+
2599
+ /**
2600
+ * Carousel Items
2601
+ */
2602
+
2603
+ switch ( $options['columns'] ) {
2604
+ case 12 :
2605
+ $carousel_items = 1;
2606
+ break;
2607
+ case 6 :
2608
+ $carousel_items = 2;
2609
+ break;
2610
+ case 4 :
2611
+ $carousel_items = 3;
2612
+ break;
2613
+ case 3 :
2614
+ $carousel_items = 4;
2615
+ break;
2616
+ case 2 :
2617
+ $carousel_items = 6;
2618
+ break;
2619
+ default:
2620
+ $carousel_items = 6;
2621
+ break;
2622
+ }
2623
 
2624
+ /**
2625
+ * Heading ( output )
2626
+ */
2627
 
2628
+ if ( $show_header ) :
2629
+ ?>
2630
+ <div class="dslc-module-heading">
2631
 
2632
+ <!-- Heading -->
2633
 
2634
+ <?php if ( $show_heading ) : ?>
2635
 
2636
+ <h2 class="dslca-editable-content" data-id="main_heading_title" data-type="simple" <?php if ( $dslc_is_admin ) echo 'contenteditable'; ?> ><?php echo stripslashes( $options['main_heading_title'] ); ?></h2>
2637
 
2638
+ <!-- View all -->
2639
 
2640
+ <?php if ( isset( $options['view_all_link'] ) && $options['view_all_link'] !== '' ) : ?>
2641
 
2642
+ <span class="dslc-module-heading-view-all"><a href="<?php echo $options['view_all_link']; ?>" class="dslca-editable-content" data-id="main_heading_link_title" data-type="simple" <?php if ( $dslc_is_admin ) echo 'contenteditable'; ?> ><?php echo $options['main_heading_link_title']; ?></a></span>
2643
 
2644
  <?php endif; ?>
2645
 
2646
+ <?php endif; ?>
2647
 
2648
+ <!-- Filters -->
2649
 
2650
+ <?php
2651
 
2652
+ if ( $show_filters ) {
2653
 
2654
+ $cats_array = array();
2655
 
2656
+ if ( $dslc_query->have_posts() ) {
2657
 
2658
+ while ( $dslc_query->have_posts() ) {
2659
 
2660
+ $dslc_query->the_post();
 
 
 
 
 
2661
 
2662
+ $post_cats = get_the_terms( get_the_ID(), 'dslc_galleries_cats' );
2663
+ if ( ! empty( $post_cats ) ) {
2664
+ foreach ( $post_cats as $post_cat ) {
2665
+ $cats_array[$post_cat->slug] = $post_cat->name;
2666
+ }
2667
  }
2668
 
2669
  }
2670
 
2671
+ }
2672
 
2673
+ ?>
 
2674
 
2675
+ <div class="dslc-post-filters">
2676
+ <span class="dslc-post-filter dslc-active dslca-editable-content" data-filter-id="show-all" <?php if ( $dslc_is_admin ){ echo 'data-id="main_filter_title_all" data-type="simple" contenteditable '; } ?>><?php echo $options['main_filter_title_all']; ?></span>
 
2677
 
2678
+ <?php foreach ( $cats_array as $cat_slug => $cat_name ) : ?>
2679
+ <span class="dslc-post-filter dslc-inactive" data-filter-id="<?php echo $cat_slug; ?>"><?php echo $cat_name; ?></span>
2680
+ <?php endforeach; ?>
2681
 
2682
+ </div><!-- .dslc-post-filters -->
2683
 
2684
+ <?php
2685
 
2686
+ }
2687
 
2688
+ ?>
2689
 
2690
+ <!-- Carousel -->
 
 
 
 
 
 
 
2691
 
2692
+ <?php if ( $show_carousel_arrows ) : ?>
2693
+ <span class="dslc-carousel-nav fr">
2694
+ <span class="dslc-carousel-nav-inner">
2695
+ <a href="#" class="dslc-carousel-nav-prev"><span class="dslc-icon-chevron-left"></span></a>
2696
+ <a href="#" class="dslc-carousel-nav-next"><span class="dslc-icon-chevron-right"></span></a>
2697
+ </span>
2698
+ </span><!-- .carousel-nav -->
2699
+ <?php endif; ?>
2700
 
2701
+ </div><!-- .dslc-module-heading -->
2702
+ <?php
 
 
 
2703
 
2704
+ endif;
2705
 
2706
+ /**
2707
+ * Posts ( output )
2708
+ */
2709
 
2710
+ if ( $dslc_query->have_posts() ) :
2711
 
2712
+ ?><div class="<?php echo $container_class; ?>"><?php
2713
 
2714
+ ?><div class="dslc-posts-inner"><?php
2715
 
2716
+ if ( $options['type'] == 'carousel' ) :
2717
 
2718
+ ?><div class="dslc-loader"></div><div class="dslc-carousel" data-stop-on-hover="<?php echo $options['carousel_autoplay_hover']; ?>" data-autoplay="<?php echo $options['carousel_autoplay']; ?>" data-columns="<?php echo $carousel_items; ?>" data-pagination="<?php if ( in_array( 'circles', $carousel_elements ) ) echo 'true'; else echo 'false'; ?>" data-slide-speed="<?php echo $options['arrows_slide_speed']; ?>" data-pagination-speed="<?php echo $options['circles_slide_speed']; ?>"><?php
2719
 
2720
+ endif;
 
 
 
 
 
 
 
2721
 
2722
+ while ( $dslc_query->have_posts() ) : $dslc_query->the_post(); $count += $increment; $real_count++;
 
2723
 
2724
+ if ( $count == $max_count ) {
2725
+ $count = 0;
2726
+ $extra_class = ' dslc-last-col';
2727
+ } elseif ( $count == $increment ) {
2728
+ $extra_class = ' dslc-first-col';
2729
+ } else {
2730
+ $extra_class = '';
2731
+ }
2732
 
2733
+ if ( ! has_post_thumbnail() )
2734
+ $extra_class .= ' dslc-post-no-thumb';
2735
 
2736
+ $gallery_images = get_post_meta( get_the_ID(), 'dslc_gallery_images', true );
2737
+ $gallery_images_count = 0;
 
2738
 
2739
+ if ( $gallery_images )
2740
+ $gallery_images = explode( ' ', trim( $gallery_images ) );
 
 
 
 
 
2741
 
2742
+ if ( is_array( $gallery_images ) ) {
2743
+ $gallery_images_count = count( $gallery_images );
2744
+ }
2745
 
2746
+ $post_cats = get_the_terms( get_the_ID(), 'dslc_galleries_cats' );
2747
+ $post_cats_data = '';
2748
+ if ( ! empty( $post_cats ) ) {
2749
+ foreach ( $post_cats as $post_cat ) {
2750
+ $post_cats_data .= $post_cat->slug . ' ';
2751
  }
2752
+ }
2753
 
2754
+ $thumb_anchor_class = '';
2755
+ $title_anchor_class = '';
 
2756
 
2757
+ if ( $options['title_link_behaviour'] == 'lightbox' ) {
2758
+ $title_anchor_class = 'dslc-trigger-lightbox-gallery';
2759
+ }
 
2760
 
2761
+ if ( $options['thumb_link_behaviour'] == 'lightbox' ) {
2762
+ $thumb_anchor_class = 'dslc-trigger-lightbox-gallery';
2763
+ }
2764
 
2765
+ // Custom URL
2766
+ $the_permalink = get_permalink();
2767
+ if ( get_post_meta( get_the_ID(), 'dslc_custom_url', true ) )
2768
+ $the_permalink = get_post_meta( get_the_ID(), 'dslc_custom_url', true );
2769
 
2770
+ ?>
2771
 
2772
+ <div class="<?php echo $element_class . $columns_class . $extra_class; ?>" data-cats="<?php echo $post_cats_data; ?>">
2773
 
2774
+ <?php if ( $post_elements == 'all' || in_array( 'thumbnail', $post_elements ) ) : ?>
2775
 
2776
+ <?php if ( has_post_thumbnail() ) : ?>
2777
 
2778
+ <div class="dslc-post-thumb dslc-gallery-thumb dslc-on-hover-anim">
 
 
 
2779
 
2780
+ <div class="dslc-gallery-thumb-inner dslca-post-thumb">
 
2781
 
2782
+ <?php
2783
+ /**
2784
+ * Manual Resize
2785
+ */
2786
 
2787
+ $manual_resize = false;
2788
+ if ( isset( $options['thumb_resize_height'] ) && ! empty( $options['thumb_resize_height'] ) || isset( $options['thumb_resize_width_manual'] ) && ! empty( $options['thumb_resize_width_manual'] ) ) {
2789
 
2790
+ $manual_resize = true;
2791
+ $thumb_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
2792
+ $thumb_url = $thumb_url[0];
2793
 
2794
+ $thumb_alt = get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true );
2795
+ if ( ! $thumb_alt ) $thumb_alt = '';
 
2796
 
2797
+ $resize_width = false;
2798
+ $resize_height = false;
 
2799
 
2800
+ if ( isset( $options['thumb_resize_width_manual'] ) && ! empty( $options['thumb_resize_width_manual'] ) ) {
2801
+ $resize_width = $options['thumb_resize_width_manual'];
2802
  }
 
2803
 
2804
+ if ( isset( $options['thumb_resize_height'] ) && ! empty( $options['thumb_resize_height'] ) ) {
2805
+ $resize_height = $options['thumb_resize_height'];
2806
+ }
 
 
2807
 
2808
+ }
2809
+ ?>
 
 
 
 
 
 
2810
 
2811
+ <?php if ( $manual_resize ) : ?>
2812
+ <a href="<?php echo $the_permalink; ?>" class="<?php echo $thumb_anchor_class; ?>"><img src="<?php $res_img = dslc_aq_resize( $thumb_url, $resize_width, $resize_height, true ); echo $res_img; ?>" alt="<?php echo $thumb_alt; ?>" /></a>
2813
+ <?php else : ?>
2814
+ <a href="<?php echo $the_permalink; ?>" class="<?php echo $thumb_anchor_class; ?>"><?php the_post_thumbnail( 'full' ); ?></a>
2815
+ <?php endif; ?>
2816
 
2817
+ <?php if ( $post_elements == 'all' || in_array( 'count', $post_elements ) ) : ?>
2818
+ <a href="<?php echo $the_permalink; ?>" class="<?php echo $thumb_anchor_class; ?> dslc-gallery-images-count dslc-init-square dslc-init-<?php echo $options['count_pos']; ?>">
2819
+ <span class="dslc-gallery-images-count-main dslc-gallery-images-count-bg dslc-init-target">
2820
+ <span class="dslc-gallery-images-count-num"><?php echo $gallery_images_count; ?></span>
2821
+ <span class="dslc-gallery-images-count-txt"><?php echo $options['count_text']; ?></span>
2822
+ </span>
2823
+ </a><!-- .dslc-gallery-images-count -->
2824
+ <?php endif; ?>
2825
 
2826
+ </div><!-- .dslc-gallery-thumb-inner -->
2827
 
2828
+ <?php if ( ( $options['main_location'] == 'inside' || $options['main_location'] == 'inside_visible' ) && ( $post_elements == 'all' || in_array( 'title', $post_elements ) || in_array( 'excerpt', $post_elements ) || in_array( 'separator', $post_elements ) ) ) : ?>
2829
 
2830
+ <div class="dslc-post-main dslc-gallery-main dslc-init-<?php echo $options['main_position']; ?> <?php if ( $options['main_location'] == 'inside_visible' ) echo 'dslc-gallery-main-visible'; ?> dslc-on-hover-anim-target dslc-anim-<?php echo $options['css_anim_hover']; ?>" data-dslc-anim="<?php echo $options['css_anim_hover'] ?>" data-dslc-anim-speed="<?php echo $options['css_anim_speed']; ?>">
2831
 
2832
+ <div class="dslc-gallery-main-inner dslc-init-target">
 
 
2833
 
2834
+ <?php if ( $post_elements == 'all' || in_array( 'title', $post_elements ) ) : ?>
2835
 
2836
+ <div class="dslc-gallery-title">
2837
+ <h2><a href="<?php echo $the_permalink; ?>" class="<?php echo $title_anchor_class; ?>"><?php the_title(); ?></a></h2>
2838
+ </div><!-- .dslc-gallery-title -->
2839
 
2840
+ <?php endif; ?>
2841
 
2842
+ <?php if ( $post_elements == 'all' || in_array( 'separator', $post_elements ) ) : ?>
2843
+ <span class="dslc-gallery-sep"></span>
2844
+ <?php endif; ?>
2845
+
2846
+ <?php if ( $post_elements == 'all' || in_array( 'excerpt', $post_elements ) ) : ?>
2847
+
2848
+ <div class="dslc-gallery-excerpt">
2849
+ <?php if ( $options['excerpt_or_content'] == 'content' ) : ?>
2850
+ <?php
2851
+ if ( $options['excerpt_length'] > 0 ) {
2852
+ echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2853
+ } else {
2854
+ echo get_the_content();
2855
+ }
2856
+ ?>
2857
+ <?php else : ?>
2858
+ <?php
2859
  if ( $options['excerpt_length'] > 0 ) {
2860
+ if ( has_excerpt() )
2861
+ echo wp_trim_words( get_the_excerpt(), $options['excerpt_length'] );
2862
+ else
2863
+ echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2864
  } else {
2865
+ if ( has_excerpt() )
2866
+ echo get_the_excerpt();
2867
+ else
2868
+ echo get_the_content();
2869
  }
2870
+ ?>
2871
+ <?php endif; ?>
2872
+ </div><!-- .dslc-gallery-excerpt -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2873
 
2874
+ <?php endif; ?>
2875
 
2876
+ <?php if ( $post_elements == 'all' || in_array( 'button', $post_elements ) ) : ?>
 
 
 
 
 
 
 
2877
 
2878
+ <div class="dslc-gallery-read-more">
2879
+ <a href="<?php the_permalink(); ?>">
2880
+ <?php if ( isset( $options['button_icon_id'] ) && $options['button_icon_id'] != '' ) : ?>
2881
+ <span class="dslc-icon dslc-icon-<?php echo $options['button_icon_id']; ?>"></span>
2882
+ <?php endif; ?>
2883
+ <?php echo $options['button_text']; ?>
2884
+ </a>
2885
+ </div><!-- .dslc-gallery-read-more -->
2886
 
2887
+ <?php endif; ?>
2888
 
2889
+ </div><!-- .dslc-gallery-main-inner -->
2890
 
2891
+ <a href="<?php the_permalink(); ?>" class="dslc-post-main-inner-link-cover"></a>
2892
 
2893
+ </div><!-- .dslc-gallery-main -->
2894
 
2895
+ <?php endif; ?>
2896
 
2897
+ </div><!-- .dslc-gallery-thumb -->
2898
 
2899
  <?php endif; ?>
2900
 
2901
+ <?php endif; ?>
2902
 
2903
+ <?php if ( $options['main_location'] == 'bellow' && ( $post_elements == 'all' || in_array( 'title', $post_elements ) || in_array( 'excerpt', $post_elements ) || in_array( 'separator', $post_elements ) ) ) : ?>
2904
 
2905
+ <div class="dslc-post-main dslc-gallery-main">
2906
 
2907
+ <?php if ( $post_elements == 'all' || in_array( 'title', $post_elements ) ) : ?>
 
 
2908
 
2909
+ <div class="dslc-gallery-title">
2910
+ <h2><a href="<?php echo $the_permalink; ?>" class="<?php echo $title_anchor_class; ?>"><?php the_title(); ?></a></h2>
2911
+ </div><!-- .dslc-gallery-title -->
2912
 
2913
+ <?php endif; ?>
2914
+
2915
+ <?php if ( $post_elements == 'all' || in_array( 'separator', $post_elements ) ) : ?>
2916
+ <span class="dslc-gallery-sep"></span>
2917
+ <?php endif; ?>
2918
 
2919
+ <?php if ( $post_elements == 'all' || in_array( 'excerpt', $post_elements ) ) : ?>
2920
 
2921
+ <div class="dslc-gallery-excerpt">
2922
+ <?php if ( $options['excerpt_or_content'] == 'content' ) : ?>
2923
+ <?php
2924
+ if ( $options['excerpt_length'] > 0 ) {
2925
+ echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2926
+ } else {
2927
+ echo get_the_content();
2928
+ }
2929
+ ?>
2930
+ <?php else : ?>
2931
+ <?php
2932
  if ( $options['excerpt_length'] > 0 ) {
2933
+ if ( has_excerpt() )
2934
+ echo wp_trim_words( get_the_excerpt(), $options['excerpt_length'] );
2935
+ else
2936
+ echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2937
  } else {
2938
+ if ( has_excerpt() )
2939
+ echo get_the_excerpt();
2940
+ else
2941
+ echo get_the_content();
2942
  }
2943
+ ?>
2944
+ <?php endif; ?>
2945
+ </div><!-- .dslc-gallery-excerpt -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2946
 
2947
+ <?php endif; ?>
2948
 
2949
+ <?php if ( $post_elements == 'all' || in_array( 'button', $post_elements ) ) : ?>
2950
 
2951
+ <div class="dslc-gallery-read-more">
2952
+ <a href="<?php the_permalink(); ?>">
2953
+ <?php if ( isset( $options['button_icon_id'] ) && $options['button_icon_id'] != '' ) : ?>
2954
+ <span class="dslc-icon dslc-icon-<?php echo $options['button_icon_id']; ?>"></span>
2955
+ <?php endif; ?>
2956
+ <?php echo $options['button_text']; ?>
2957
+ </a>
2958
+ </div><!-- .dslc-gallery-read-more -->
2959
 
2960
+ <?php endif; ?>
2961
 
2962
+ </div><!-- .dslc-gallery-main -->
2963
 
2964
+ <?php endif; ?>
2965
 
2966
+ <?php if ( $gallery_images_count > 0 ) : ?>
2967
 
2968
+ <div class="dslc-lightbox-gallery">
2969
 
2970
+ <?php foreach ( $gallery_images as $gallery_image ) : ?>
2971
 
2972
+ <?php
2973
+ $gallery_image_src = wp_get_attachment_image_src( $gallery_image, 'full' );
2974
+ $gallery_image_src = $gallery_image_src[0];
2975
 
2976
+ $gallery_image_title = get_post_meta( $gallery_image, '_wp_attachment_image_alt', true );
2977
+ if ( ! $gallery_image_title ) $gallery_image_title = '';
2978
+ ?>
 
 
2979
 
2980
+ <a href="<?php echo $gallery_image_src; ?>" title="<?php echo esc_attr( $gallery_image_title ); ?>"></a>
2981
 
2982
+ <?php endforeach; ?>
2983
 
2984
+ </div><!-- .dslc-gallery-lightbox -->
2985
 
2986
+ <?php endif; ?>
2987
 
2988
+ </div><!-- .dslc-gallery -->
2989
 
2990
+ <?php
 
 
 
2991
 
2992
+ // Row Separator
2993
+ if ( $options['type'] == 'grid' && $count == 0 && $real_count != $dslc_query->found_posts && $real_count != $options['amount'] && $options['separator_enabled'] == 'enabled' ) {
2994
+ echo '<div class="dslc-post-separator"></div>';
2995
+ }
2996
 
2997
+ endwhile;
2998
 
2999
+ if ( $options['type'] == 'carousel' ) :
3000
 
3001
+ ?></div><?php
3002
 
3003
+ endif;
3004
 
3005
+ ?></div><!-- .dslc-posts-inner --><?php
3006
 
3007
+ ?></div><?php
3008
 
3009
+ else :
 
 
3010
 
3011
+ if ( $dslc_is_admin ) :
3012
+ ?><div class="dslc-notification dslc-red"><?php _e( 'You do not have any galleries at the moment. Go to <strong>WP Admin &rarr; Galleries</strong> to add some.', 'live-composer-page-builder' ); ?> <span class="dslca-refresh-module-hook dslc-icon dslc-icon-refresh"></span></span></div><?php
3013
  endif;
3014
 
3015
+ endif;
 
 
3016
 
3017
+ /**
3018
+ * Pagination
3019
+ */
 
 
 
 
3020
 
3021
+ if ( isset( $options['pagination_type'] ) && $options['pagination_type'] != 'disabled' ) {
3022
+ $num_pages = $dslc_query->max_num_pages;
3023
+ if ( $options['offset'] > 0 ) {
3024
+ $num_pages = ceil( ( $dslc_query->found_posts - $options['offset'] ) / $options['amount'] );
3025
+ }
3026
+ dslc_post_pagination( array('pages' => $num_pages, 'type' => $options['pagination_type']) );
3027
+ }
3028
 
3029
+ wp_reset_postdata();
3030
 
3031
+ $shortcode_rendered = ob_get_contents();
3032
+ ob_end_clean();
3033
 
3034
+ return $shortcode_rendered;
3035
 
3036
+ } add_shortcode( 'dslc_module_galleries_output', 'dslc_module_galleries_output' );
modules/navigation/functions.php CHANGED
@@ -48,12 +48,87 @@ function dslc_nav_menus() {
48
 
49
  foreach ( $menus_array as $menu ) {
50
 
51
- $menu_ID = 'dslc_' . strtolower( str_replace( ' ', '_', $menu ) );
 
 
 
 
 
 
52
 
53
- register_nav_menu( $menu_ID, $menu );
 
 
 
 
54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  }
56
 
 
 
57
  }
58
 
59
- } add_action( 'init', 'dslc_nav_menus' );
 
 
 
 
 
48
 
49
  foreach ( $menus_array as $menu ) {
50
 
51
+ $menu_id = 'dslc_' . strtolower( str_replace( ' ', '_', $menu ) );
52
+ register_nav_menu( $menu_id, $menu );
53
+ }
54
+ }
55
+
56
+ } add_action( 'init', 'dslc_nav_menus' );
57
+
58
 
59
+ /**
60
+ * Shortcode needed to render Menu to make sure
61
+ * current menu item highlighted properly even when LC cache enabled.
62
+ */
63
+ function dslc_nav_render_menu ( $atts, $content = null ) {
64
 
65
+ $theme_location = '';
66
+ $menu_class = 'menu';
67
+
68
+ if ( isset( $atts['theme_location'] ) ) {
69
+ $theme_location = $atts['theme_location'];
70
+ }
71
+
72
+ if ( isset( $atts['menu_class'] ) ) {
73
+ $menu_class = $atts['menu_class'];
74
+ }
75
+
76
+ ob_start();
77
+ wp_nav_menu( array( 'theme_location' => $theme_location, 'menu_class' => $menu_class ));
78
+ $shortcode_rendered = ob_get_contents();
79
+ ob_end_clean();
80
+
81
+ return $shortcode_rendered;
82
+
83
+ } add_shortcode( 'dslc_nav_render_menu', 'dslc_nav_render_menu' );
84
+
85
+ /**
86
+ * Shortcode needed to render Menu to make sure
87
+ * current menu item highlighted properly even when LC cache enabled.
88
+ */
89
+ function dslc_nav_render_mobile_menu ( $atts, $content = null ) {
90
+
91
+ $theme_location = '';
92
+
93
+ if ( isset( $atts['theme_location'] ) ) {
94
+ $theme_location = $atts['theme_location'];
95
+ }
96
+
97
+ ob_start();
98
+
99
+ if ( has_nav_menu( $theme_location ) ) {
100
+
101
+ $mobile_nav_output = '';
102
+ $mobile_nav_output .= '<select>';
103
+ $mobile_nav_output .= '<option>' . __( '- Select -', 'live-composer-page-builder' ) . '</option>';
104
+
105
+ if ( has_nav_menu( $theme_location ) ) {
106
+
107
+ $locations = get_nav_menu_locations();
108
+ $menu = wp_get_nav_menu_object( $locations[ $theme_location ] );
109
+ $menu_items = wp_get_nav_menu_items( $menu->term_id );
110
+
111
+ foreach ( $menu_items as $key => $menu_item ) {
112
+
113
+ $title = $menu_item->title;
114
+ $url = $menu_item->url;
115
+ $nav_selected = '';
116
+
117
+ if ( 0 !== $menu_item->post_parent ) {
118
+ $mobile_nav_output .= '<option value="' . $url . '" ' . $nav_selected . '> - ' . $title . '</option>';
119
+ } else {
120
+ $mobile_nav_output .= '<option value="' . $url . '" ' . $nav_selected . '>' . $title . '</option>';
121
+ }
122
+ }
123
  }
124
 
125
+ $mobile_nav_output .= '</select>';
126
+ echo $mobile_nav_output;
127
  }
128
 
129
+ $shortcode_rendered = ob_get_contents();
130
+ ob_end_clean();
131
+
132
+ return $shortcode_rendered;
133
+
134
+ } add_shortcode( 'dslc_nav_render_mobile_menu', 'dslc_nav_render_mobile_menu' );
modules/navigation/module.php CHANGED
@@ -1587,41 +1587,12 @@ class DSLC_Navigation extends DSLC_Module {
1587
  ?>
1588
  <div class="dslc-navigation dslc-navigation-sub-position-<?php echo esc_attr( $options['css_subnav_position'] ); ?> dslc-navigation-res-t-<?php echo esc_attr( $options['css_res_t'] ); ?> dslc-navigation-res-p-<?php echo esc_attr( $options['css_res_p'] ); ?> dslc-navigation-orientation-<?php echo esc_attr( $options['nav_orientation'] ); ?>">
1589
  <div class="dslc-navigation-inner">
1590
- <?php wp_nav_menu( array( 'theme_location' => $options['location'] ) ); ?>
 
1591
  </div>
1592
  </div>
1593
  <div class="dslc-mobile-navigation dslc-navigation-res-t-<?php echo esc_attr( $options['css_res_t'] ); ?> dslc-navigation-res-p-<?php echo esc_attr( $options['css_res_p'] ); ?>">
1594
- <?php
1595
- if ( has_nav_menu( $options['location'] ) ) {
1596
-
1597
- $mobile_nav_output = '';
1598
- $mobile_nav_output .= '<select>';
1599
- $mobile_nav_output .= '<option>' . __( '- Select -', 'live-composer-page-builder' ) . '</option>';
1600
-
1601
- if ( has_nav_menu( $options['location'] ) ) {
1602
-
1603
- $locations = get_nav_menu_locations();
1604
- $menu = wp_get_nav_menu_object( $locations[ $options['location'] ] );
1605
- $menu_items = wp_get_nav_menu_items( $menu->term_id );
1606
-
1607
- foreach ( $menu_items as $key => $menu_item ) {
1608
-
1609
- $title = $menu_item->title;
1610
- $url = $menu_item->url;
1611
- $nav_selected = '';
1612
-
1613
- if ( 0 !== $menu_item->post_parent ) {
1614
- $mobile_nav_output .= '<option value="' . $url . '" ' . $nav_selected . '> - ' . $title . '</option>';
1615
- } else {
1616
- $mobile_nav_output .= '<option value="' . $url . '" ' . $nav_selected . '>' . $title . '</option>';
1617
- }
1618
- }
1619
- }
1620
-
1621
- $mobile_nav_output .= '</select>';
1622
- echo $mobile_nav_output;
1623
- }
1624
- ?>
1625
  <div class="dslc-mobile-navigation-hook"><span class="dslc-icon dslc-icon-reorder"></span></div>
1626
  </div><!-- .dslc-mobile-navigation -->
1627
 
1587
  ?>
1588
  <div class="dslc-navigation dslc-navigation-sub-position-<?php echo esc_attr( $options['css_subnav_position'] ); ?> dslc-navigation-res-t-<?php echo esc_attr( $options['css_res_t'] ); ?> dslc-navigation-res-p-<?php echo esc_attr( $options['css_res_p'] ); ?> dslc-navigation-orientation-<?php echo esc_attr( $options['nav_orientation'] ); ?>">
1589
  <div class="dslc-navigation-inner">
1590
+ [dslc_nav_render_menu theme_location="<?php echo $options['location'] ?>"]
1591
+ <?php // wp_nav_menu( array( 'theme_location' => $options['location'] ) ); ?>
1592
  </div>
1593
  </div>
1594
  <div class="dslc-mobile-navigation dslc-navigation-res-t-<?php echo esc_attr( $options['css_res_t'] ); ?> dslc-navigation-res-p-<?php echo esc_attr( $options['css_res_p'] ); ?>">
1595
+ [dslc_nav_render_mobile_menu theme_location="<?php echo $options['location'] ?>"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1596
  <div class="dslc-mobile-navigation-hook"><span class="dslc-icon dslc-icon-reorder"></span></div>
1597
  </div><!-- .dslc-mobile-navigation -->
1598
 
modules/partners/module.php CHANGED
@@ -1504,554 +1504,568 @@ class DSLC_Partners extends DSLC_Module {
1504
  * @return void
1505
  */
1506
  function output( $options ) {
 
 
 
1507
 
1508
- global $dslc_active;
 
1509
 
1510
- if ( $dslc_active && is_user_logged_in() && current_user_can( DS_LIVE_COMPOSER_CAPABILITY ) )
1511
- $dslc_is_admin = true;
1512
- else
1513
- $dslc_is_admin = false;
1514
 
 
1515
 
1516
- /* Module output stars here */
1517
 
1518
- if ( ! isset( $options['excerpt_length'] ) ) $options['excerpt_length'] = 20;
1519
- if ( ! isset( $options['type'] ) ) $options['type'] = 'grid';
 
 
1520
 
1521
- if ( is_front_page() ) { $paged = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1; } else { $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; }
1522
 
1523
- // Fix for pagination from other modules affecting this one when pag disabled
1524
- if ( $options['pagination_type'] == 'disabled' ) $paged = 1;
1525
 
1526
- // Fix for offset braking pagination
1527
- $query_offset = $options['offset'];
1528
- if ( $query_offset > 0 && $paged > 1 ) $query_offset = ( $paged - 1 ) * $options['amount'] + $options['offset'];
1529
 
1530
- $args = array(
1531
- 'paged' => $paged,
1532
- 'post_type' => 'dslc_partners',
1533
- 'posts_per_page' => $options['amount'],
1534
- 'order' => $options['order'],
1535
- 'orderby' => $options['orderby'],
1536
- );
1537
 
1538
- // Add offset
1539
- if ( $query_offset > 0 ) {
1540
- $args['offset'] = $query_offset;
1541
- }
1542
 
1543
- if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
1544
- $args['post_status'] = array('publish', 'private');
1545
- }
1546
 
1547
- if ( isset( $options['categories'] ) && $options['categories'] != '' ) {
 
 
 
 
 
 
1548
 
1549
- $cats_array = explode( ' ', trim( $options['categories'] ) );
 
 
 
1550
 
1551
- $args['tax_query'] = array(
1552
- array(
1553
- 'taxonomy' => 'dslc_partners_cats',
1554
- 'field' => 'slug',
1555
- 'terms' => $cats_array,
1556
- 'operator' => $options['categories_operator']
1557
- )
1558
- );
1559
 
1560
- }
1561
 
1562
- // Exlcude and Include arrays
1563
- $exclude = array();
1564
- $include = array();
1565
 
1566
- // Exclude current post
1567
- if ( is_singular( get_post_type() ) )
1568
- $exclude[] = get_the_ID();
 
 
 
 
 
1569
 
1570
- // Exclude posts ( option )
1571
- if ( $options['query_post_not_in'] )
1572
- $exclude = array_merge( $exclude, explode( ' ', $options['query_post_not_in'] ) );
1573
 
1574
- // Include posts ( option )
1575
- if ( $options['query_post_in'] )
1576
- $include = array_merge( $include, explode( ' ', $options['query_post_in'] ) );
1577
 
1578
- // Include query parameter
1579
- if ( ! empty( $include ) )
1580
- $args['post__in'] = $include;
1581
 
1582
- // Exclude query parameter
1583
- if ( ! empty( $exclude ) )
1584
- $args['post__not_in'] = $exclude;
1585
 
1586
- // No paging
1587
- if ( $options['pagination_type'] == 'disabled' )
1588
- $args['no_found_rows'] = true;
1589
 
1590
- // Do the query
1591
- if ( is_category() || is_tax() || is_search() ) {
1592
- global $wp_query;
1593
- $dslc_query = $wp_query;
1594
- } else {
1595
- $dslc_query = new WP_Query( $args );
1596
- }
1597
 
1598
- $wrapper_class = '';
1599
- $columns_class = 'dslc-col dslc-' . $options['columns'] . '-col ';
1600
- $count = 0;
1601
- $real_count = 0;
1602
- $increment = $options['columns'];
1603
- $max_count = 12;
1604
 
1605
- /**
1606
- * Elements to show
1607
- */
1608
 
1609
- // Main Elements
1610
- $elements = $options['elements'];
1611
- if ( ! empty( $elements ) )
1612
- $elements = explode( ' ', trim( $elements ) );
1613
- else
1614
- $elements = array();
 
1615
 
 
 
 
 
 
 
1616
 
1617
- // Post Elements
1618
- $post_elements = $options['post_elements'];
1619
- if ( ! empty( $post_elements ) )
1620
- $post_elements = explode( ' ', trim( $post_elements ) );
1621
- else
1622
- $post_elements = 'all';
1623
 
1624
- // Carousel Elements
1625
- $carousel_elements = $options['carousel_elements'];
1626
- if ( ! empty( $carousel_elements ) )
1627
- $carousel_elements = explode( ' ', trim( $carousel_elements ) );
1628
- else
1629
- $carousel_elements = array();
1630
 
1631
- /* Container Class */
1632
 
1633
- $container_class = 'dslc-posts dslc-partners dslc-clearfix dslc-posts-orientation-' . $options['orientation'] . ' ';
 
 
 
 
 
1634
 
1635
- if ( $options['type'] == 'masonry' )
1636
- $container_class .= 'dslc-init-masonry ';
1637
- elseif ( $options['type'] == 'grid' )
1638
- $container_class .= 'dslc-init-grid ';
 
 
1639
 
1640
- /* Element Class */
1641
 
1642
- $element_class = 'dslc-post dslc-partner ';
1643
 
1644
- if ( $options['type'] == 'masonry' )
1645
- $element_class .= 'dslc-masonry-item ';
1646
- elseif ( $options['type'] == 'carousel' )
1647
- $element_class .= 'dslc-carousel-item ';
1648
 
1649
- /**
1650
- * What is shown
1651
- */
1652
 
1653
- $show_header = false;
1654
- $show_heading = false;
1655
- $show_filters = false;
1656
- $show_carousel_arrows = false;
1657
- $show_view_all_link = false;
1658
 
1659
- if ( in_array( 'main_heading', $elements ) )
1660
- $show_heading = true;
 
 
1661
 
1662
- if ( ( $elements == 'all' || in_array( 'filters', $elements ) ) && $options['type'] !== 'carousel' )
1663
- $show_filters = true;
 
1664
 
1665
- if ( $options['type'] == 'carousel' && in_array( 'arrows', $carousel_elements ) )
1666
- $show_carousel_arrows = true;
 
 
 
1667
 
1668
- if ( $show_heading || $show_filters || $show_carousel_arrows )
1669
- $show_header = true;
1670
 
1671
- /**
1672
- * Carousel Items
1673
- */
1674
 
1675
- switch ( $options['columns'] ) {
1676
- case 12 :
1677
- $carousel_items = 1;
1678
- break;
1679
- case 6 :
1680
- $carousel_items = 2;
1681
- break;
1682
- case 4 :
1683
- $carousel_items = 3;
1684
- break;
1685
- case 3 :
1686
- $carousel_items = 4;
1687
- break;
1688
- case 2 :
1689
- $carousel_items = 6;
1690
- break;
1691
- default:
1692
- $carousel_items = 6;
1693
- break;
1694
- }
1695
 
1696
- /**
1697
- * Heading ( output )
1698
- */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1699
 
1700
- if ( $show_header ) :
1701
- ?>
1702
- <div class="dslc-module-heading">
1703
 
1704
- <!-- Heading -->
 
 
1705
 
1706
- <?php if ( $show_heading ) : ?>
1707
 
1708
- <h2 class="dslca-editable-content" data-id="main_heading_title" data-type="simple" <?php if ( $dslc_is_admin ) echo 'contenteditable'; ?> ><?php echo stripslashes( $options['main_heading_title'] ); ?></h2>
1709
 
1710
- <!-- View all -->
1711
 
1712
- <?php if ( isset( $options['view_all_link'] ) && $options['view_all_link'] !== '' ) : ?>
1713
 
1714
- <span class="dslc-module-heading-view-all"><a href="<?php echo $options['view_all_link']; ?>" class="dslca-editable-content" data-id="main_heading_link_title" data-type="simple" <?php if ( $dslc_is_admin ) echo 'contenteditable'; ?> ><?php echo $options['main_heading_link_title']; ?></a></span>
1715
 
1716
- <?php endif; ?>
1717
 
1718
  <?php endif; ?>
1719
 
1720
- <!-- Filters -->
1721
 
1722
- <?php
1723
 
1724
- if ( $show_filters ) {
1725
 
1726
- $cats_array = array();
1727
 
1728
- if ( $dslc_query->have_posts() ) {
1729
 
1730
- while ( $dslc_query->have_posts() ) {
1731
 
1732
- $dslc_query->the_post();
1733
 
1734
- $post_cats = get_the_terms( get_the_ID(), 'dslc_partners_cats' );
1735
- if ( ! empty( $post_cats ) ) {
1736
- foreach ( $post_cats as $post_cat ) {
1737
- $cats_array[$post_cat->slug] = $post_cat->name;
1738
- }
1739
- }
1740
 
 
 
 
 
 
1741
  }
1742
 
1743
  }
1744
 
1745
- ?>
1746
 
1747
- <div class="dslc-post-filters">
1748
- <span class="dslc-post-filter dslc-active dslca-editable-content" data-filter-id="show-all" <?php if ( $dslc_is_admin ){ echo 'data-id="main_filter_title_all" data-type="simple" contenteditable '; } ?>><?php echo $options['main_filter_title_all']; ?></span>
1749
 
1750
- <?php foreach ( $cats_array as $cat_slug => $cat_name ) : ?>
1751
- <span class="dslc-post-filter dslc-inactive" data-filter-id="<?php echo $cat_slug; ?>"><?php echo $cat_name; ?></span>
1752
- <?php endforeach; ?>
1753
 
1754
- </div><!-- .dslc-post-filters -->
 
 
1755
 
1756
- <?php
1757
 
1758
- }
1759
 
1760
- ?>
1761
 
1762
- <!-- Carousel -->
1763
 
1764
- <?php if ( $show_carousel_arrows ) : ?>
1765
- <span class="dslc-carousel-nav fr">
1766
- <span class="dslc-carousel-nav-inner">
1767
- <a href="#" class="dslc-carousel-nav-prev"><span class="dslc-icon-chevron-left"></span></a>
1768
- <a href="#" class="dslc-carousel-nav-next"><span class="dslc-icon-chevron-right"></span></a>
1769
- </span>
1770
- </span><!-- .carousel-nav -->
1771
- <?php endif; ?>
1772
 
1773
- </div><!-- .dslc-module-heading -->
1774
- <?php
 
 
 
 
 
 
1775
 
1776
- endif;
 
1777
 
1778
- /**
1779
- * Posts ( output )
1780
- */
1781
 
1782
- if ( $dslc_query->have_posts() ) :
 
 
1783
 
1784
- ?><div class="<?php echo $container_class; ?>"><?php
1785
 
1786
- ?><div class="dslc-posts-inner"><?php
1787
 
1788
- if ( $options['type'] == 'carousel' ) :
1789
 
1790
- ?><div class="dslc-loader"></div><div class="dslc-carousel" data-stop-on-hover="<?php echo $options['carousel_autoplay_hover']; ?>" data-autoplay="<?php echo $options['carousel_autoplay']; ?>" data-columns="<?php echo $carousel_items; ?>" data-pagination="<?php if ( in_array( 'circles', $carousel_elements ) ) echo 'true'; else echo 'false'; ?>" data-slide-speed="<?php echo $options['arrows_slide_speed']; ?>" data-pagination-speed="<?php echo $options['circles_slide_speed']; ?>"><?php
1791
 
1792
- endif;
1793
 
1794
- while ( $dslc_query->have_posts() ) : $dslc_query->the_post(); $count += $increment; $real_count++;
1795
 
1796
- if ( $count == $max_count ) {
1797
- $count = 0;
1798
- $extra_class = ' dslc-last-col';
1799
- } elseif ( $count == $increment ) {
1800
- $extra_class = ' dslc-first-col';
1801
- } else {
1802
- $extra_class = '';
1803
- }
1804
 
1805
- if ( ! has_post_thumbnail() )
1806
- $extra_class .= ' dslc-post-no-thumb';
 
 
 
 
 
 
1807
 
1808
- $post_cats = get_the_terms( get_the_ID(), 'dslc_partners_cats' );
1809
- $post_cats_data = '';
1810
- if ( ! empty( $post_cats ) ) {
1811
- foreach ( $post_cats as $post_cat ) {
1812
- $post_cats_data .= $post_cat->slug . ' ';
1813
- }
 
 
1814
  }
 
1815
 
1816
- /**
1817
- * Link or not
1818
- */
1819
 
1820
- $link_to_single = true;
1821
 
1822
- if ( isset( $options['link'] ) && 'disabled' === $options['link'] ) {
1823
- $link_to_single = false;
1824
- }
1825
 
1826
- // Project URL
1827
- $the_partner_url = get_permalink();
1828
- if ( $options['link'] == 'custom' ) {
1829
- if ( get_post_meta( get_the_ID(), 'dslc_partner_url', true ) )
1830
- $the_partner_url = get_post_meta( get_the_ID(), 'dslc_partner_url', true );
1831
- else
1832
- $the_partner_url = '#';
1833
- }
1834
 
1835
- $anchor_target = '_self';
1836
 
1837
- if ( 'url_new' === $options['link_type'] ) {
1838
- $anchor_target = '_blank';
1839
- }
1840
-
1841
- ?>
1842
 
1843
- <div class="<?php echo $element_class . $columns_class . $extra_class; ?>" data-cats="<?php echo $post_cats_data; ?>">
1844
 
1845
- <?php if ( $post_elements == 'all' || in_array( 'thumbnail', $post_elements ) ) : ?>
1846
 
1847
- <?php
1848
- /**
1849
- * Manual Resize
1850
- */
1851
 
1852
- $manual_resize = false;
1853
- if ( isset( $options['thumb_resize_height'] ) && ! empty( $options['thumb_resize_height'] ) || isset( $options['thumb_resize_width_manual'] ) && ! empty( $options['thumb_resize_width_manual'] ) ) {
 
 
1854
 
1855
- $manual_resize = true;
1856
- $thumb_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
1857
- $thumb_url = $thumb_url[0];
1858
 
1859
- $thumb_alt = get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true );
1860
- if ( ! $thumb_alt ) $thumb_alt = '';
 
1861
 
1862
- $resize_width = false;
1863
- $resize_height = false;
1864
 
1865
- if ( isset( $options['thumb_resize_width_manual'] ) && ! empty( $options['thumb_resize_width_manual'] ) ) {
1866
- $resize_width = $options['thumb_resize_width_manual'];
1867
- }
1868
 
1869
- if ( isset( $options['thumb_resize_height'] ) && ! empty( $options['thumb_resize_height'] ) ) {
1870
- $resize_height = $options['thumb_resize_height'];
1871
- }
1872
 
 
 
1873
  }
1874
- ?>
1875
 
1876
- <?php if ( has_post_thumbnail() ) : ?>
 
1877
 
1878
- <div class="dslc-post-thumb dslc-partner-thumb dslca-post-thumb dslc-on-hover-anim">
1879
 
1880
- <?php if ( $manual_resize ) : ?>
1881
- <?php if ( $link_to_single ) : ?>
1882
- <a href="<?php echo $the_partner_url; ?>" target="<?php echo $anchor_target; ?>"><img src="<?php $res_img = dslc_aq_resize( $thumb_url, $resize_width, $resize_height, true ); echo $res_img; ?>" alt="<?php echo $thumb_alt; ?>" /></a>
1883
- <?php else : ?>
1884
- <img src="<?php $res_img = dslc_aq_resize( $thumb_url, $resize_width, $resize_height, true ); echo $res_img; ?>" alt="<?php echo $thumb_alt; ?>" />
1885
- <?php endif; ?>
1886
  <?php else : ?>
1887
- <?php if ( $link_to_single ) : ?>
1888
- <a href="<?php echo $the_partner_url; ?>" target="<?php echo $anchor_target; ?>"><?php the_post_thumbnail( 'full' ); ?></a>
1889
- <?php else : ?>
1890
- <?php the_post_thumbnail( 'full' ); ?>
1891
- <?php endif; ?>
1892
  <?php endif; ?>
 
 
 
 
 
 
 
1893
 
1894
- <?php if ( ( $options['main_location'] == 'inside' || $options['main_location'] == 'inside_visible' ) && ( $post_elements == 'all' || in_array( 'title', $post_elements ) || in_array( 'excerpt', $post_elements ) ) ) : ?>
1895
-
1896
- <div class="dslc-post-main dslc-partner-main dslc-init-<?php echo $options['main_position']; ?> <?php if ( $options['main_location'] == 'inside_visible' ) echo 'dslc-partner-main-visible'; ?> dslc-on-hover-anim-target dslc-anim-<?php echo $options['css_anim_hover']; ?>" data-dslc-anim="<?php echo $options['css_anim_hover'] ?>" data-dslc-anim-speed="<?php echo $options['css_anim_speed']; ?>">
1897
 
1898
- <div class="dslc-partner-main-inner dslc-init-target">
1899
 
1900
- <?php if ( $post_elements == 'all' || in_array( 'title', $post_elements ) ) : ?>
1901
 
1902
- <div class="dslc-partner-title">
1903
- <?php if ( $link_to_single ) : ?>
1904
- <h2><a href="<?php echo $the_partner_url; ?>" target="<?php echo $anchor_target; ?>"><?php the_title(); ?></a></h2>
1905
- <?php else : ?>
1906
- <h2><?php the_title(); ?></h2>
1907
- <?php endif; ?>
1908
- </div><!-- .dslc-partner-title -->
1909
 
1910
- <?php endif; ?>
 
 
 
 
 
 
1911
 
1912
- <?php if ( $post_elements == 'all' || in_array( 'excerpt', $post_elements ) ) : ?>
1913
 
1914
- <div class="dslc-partner-excerpt">
1915
- <?php if ( $options['excerpt_or_content'] == 'content' ) : ?>
1916
- <?php
 
 
 
 
 
 
 
 
 
 
1917
  if ( $options['excerpt_length'] > 0 ) {
1918
- echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
 
 
 
1919
  } else {
1920
- echo get_the_content();
 
 
 
1921
  }
1922
- ?>
1923
- <?php else : ?>
1924
- <?php
1925
- if ( $options['excerpt_length'] > 0 ) {
1926
- if ( has_excerpt() )
1927
- echo wp_trim_words( get_the_excerpt(), $options['excerpt_length'] );
1928
- else
1929
- echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
1930
- } else {
1931
- if ( has_excerpt() )
1932
- echo get_the_excerpt();
1933
- else
1934
- echo get_the_content();
1935
- }
1936
- ?>
1937
- <?php endif; ?>
1938
- </div><!-- .dslc-partner-excerpt -->
1939
-
1940
- <?php endif; ?>
1941
-
1942
- </div><!-- .dslc-partner-main -->
1943
-
1944
- <?php if ( $link_to_single ) : ?>
1945
- <a href="<?php echo $the_partner_url; ?>" target="<?php echo $anchor_target; ?>" class="dslc-post-main-inner-link-cover"></a>
1946
  <?php endif; ?>
1947
 
1948
  </div><!-- .dslc-partner-main -->
1949
 
1950
- <?php endif; ?>
 
 
1951
 
1952
- </div><!-- .dslc-partner-thumb -->
1953
 
1954
- <?php endif; ?>
 
 
1955
 
1956
  <?php endif; ?>
1957
 
1958
- <?php if ( $options['main_location'] == 'bellow' && ( $post_elements == 'all' || in_array( 'title', $post_elements ) || in_array( 'excerpt', $post_elements ) ) ) : ?>
1959
 
1960
- <div class="dslc-post-main dslc-partner-main">
1961
 
1962
- <?php if ( $post_elements == 'all' || in_array( 'title', $post_elements ) ) : ?>
1963
 
1964
- <div class="dslc-partner-title">
1965
- <?php if ( $link_to_single ) : ?>
1966
- <h2><a href="<?php echo $the_partner_url; ?>" target="<?php echo $anchor_target; ?>"><?php the_title(); ?></a></h2>
1967
- <?php else : ?>
1968
- <h2><?php the_title(); ?></h2>
1969
- <?php endif; ?>
1970
- </div><!-- .dslc-partner-title -->
1971
 
1972
- <?php endif; ?>
 
 
 
 
 
 
1973
 
1974
- <?php if ( $post_elements == 'all' || in_array( 'excerpt', $post_elements ) ) : ?>
1975
 
1976
- <div class="dslc-partner-excerpt">
1977
- <?php if ( $options['excerpt_or_content'] == 'content' ) : ?>
1978
- <?php
 
 
 
 
 
 
 
 
 
 
1979
  if ( $options['excerpt_length'] > 0 ) {
1980
- echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
 
 
 
1981
  } else {
1982
- echo get_the_content();
 
 
 
1983
  }
1984
- ?>
1985
- <?php else : ?>
1986
- <?php
1987
- if ( $options['excerpt_length'] > 0 ) {
1988
- if ( has_excerpt() )
1989
- echo wp_trim_words( get_the_excerpt(), $options['excerpt_length'] );
1990
- else
1991
- echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
1992
- } else {
1993
- if ( has_excerpt() )
1994
- echo get_the_excerpt();
1995
- else
1996
- echo get_the_content();
1997
- }
1998
- ?>
1999
- <?php endif; ?>
2000
- </div><!-- .dslc-partner-excerpt -->
2001
 
2002
- <?php endif; ?>
2003
 
2004
- </div><!-- .dslc-partner-main -->
2005
 
2006
- <?php endif; ?>
2007
-
2008
- </div><!-- .dslc-partner -->
2009
 
2010
- <?php
2011
 
2012
- // Row Separator
2013
- if ( $options['type'] == 'grid' && $count == 0 && $real_count != $dslc_query->found_posts && $real_count != $options['amount'] && $options['separator_enabled'] == 'enabled' ) {
2014
- echo '<div class="dslc-post-separator"></div>';
2015
- }
2016
 
2017
- endwhile;
 
 
 
2018
 
2019
- if ( $options['type'] == 'carousel' ) :
2020
 
2021
- ?></div><?php
2022
 
2023
- endif;
2024
 
2025
- ?>
2026
 
2027
- </div><!-- .dslc-posts-inner -->
2028
 
2029
- </div><!-- .dslc-partners -->
2030
 
2031
- <?php else :
2032
 
2033
- if ( $dslc_is_admin ) :
2034
- ?><div class="dslc-notification dslc-red"><?php _e( 'You do not have any partners at the moment. Go to <strong>WP Admin &rarr; Partners</strong> to add some.', 'live-composer-page-builder' ); ?> <span class="dslca-refresh-module-hook dslc-icon dslc-icon-refresh"></span></span></div><?php
2035
- endif;
2036
 
 
 
2037
  endif;
2038
 
2039
- /**
2040
- * Pagination
2041
- */
 
 
2042
 
2043
- if ( isset( $options['pagination_type'] ) && $options['pagination_type'] != 'disabled' ) {
2044
- $num_pages = $dslc_query->max_num_pages;
2045
- if ( $options['offset'] > 0 ) {
2046
- $num_pages = ceil( ( $dslc_query->found_posts - $options['offset'] ) / $options['amount'] );
2047
- }
2048
- dslc_post_pagination( array('pages' => $num_pages, 'type' => $options['pagination_type']) );
2049
  }
 
 
2050
 
2051
- wp_reset_postdata();
2052
 
2053
 
 
 
2054
 
2055
- }
2056
 
2057
- }
1504
  * @return void
1505
  */
1506
  function output( $options ) {
1507
+ ?>
1508
+ [dslc_module_partners_output]<?php echo serialize($options); ?>[/dslc_module_partners_output]
1509
+ <?php
1510
 
1511
+ }
1512
+ }
1513
 
1514
+ function dslc_module_partners_output ( $atts, $content = null ) {
1515
+ // Uncode module options passed as serialized content.
1516
+ $options = unserialize( $content );
 
1517
 
1518
+ ob_start();
1519
 
1520
+ global $dslc_active;
1521
 
1522
+ if ( $dslc_active && is_user_logged_in() && current_user_can( DS_LIVE_COMPOSER_CAPABILITY ) )
1523
+ $dslc_is_admin = true;
1524
+ else
1525
+ $dslc_is_admin = false;
1526
 
 
1527
 
1528
+ /* Module output stars here */
 
1529
 
1530
+ if ( ! isset( $options['excerpt_length'] ) ) $options['excerpt_length'] = 20;
1531
+ if ( ! isset( $options['type'] ) ) $options['type'] = 'grid';
 
1532
 
1533
+ if ( is_front_page() ) { $paged = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1; } else { $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; }
 
 
 
 
 
 
1534
 
1535
+ // Fix for pagination from other modules affecting this one when pag disabled
1536
+ if ( $options['pagination_type'] == 'disabled' ) $paged = 1;
 
 
1537
 
1538
+ // Fix for offset braking pagination
1539
+ $query_offset = $options['offset'];
1540
+ if ( $query_offset > 0 && $paged > 1 ) $query_offset = ( $paged - 1 ) * $options['amount'] + $options['offset'];
1541
 
1542
+ $args = array(
1543
+ 'paged' => $paged,
1544
+ 'post_type' => 'dslc_partners',
1545
+ 'posts_per_page' => $options['amount'],
1546
+ 'order' => $options['order'],
1547
+ 'orderby' => $options['orderby'],
1548
+ );
1549
 
1550
+ // Add offset
1551
+ if ( $query_offset > 0 ) {
1552
+ $args['offset'] = $query_offset;
1553
+ }
1554
 
1555
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
1556
+ $args['post_status'] = array('publish', 'private');
1557
+ }
 
 
 
 
 
1558
 
1559
+ if ( isset( $options['categories'] ) && $options['categories'] != '' ) {
1560
 
1561
+ $cats_array = explode( ' ', trim( $options['categories'] ) );
 
 
1562
 
1563
+ $args['tax_query'] = array(
1564
+ array(
1565
+ 'taxonomy' => 'dslc_partners_cats',
1566
+ 'field' => 'slug',
1567
+ 'terms' => $cats_array,
1568
+ 'operator' => $options['categories_operator']
1569
+ )
1570
+ );
1571
 
1572
+ }
 
 
1573
 
1574
+ // Exlcude and Include arrays
1575
+ $exclude = array();
1576
+ $include = array();
1577
 
1578
+ // Exclude current post
1579
+ if ( is_singular( get_post_type() ) )
1580
+ $exclude[] = get_the_ID();
1581
 
1582
+ // Exclude posts ( option )
1583
+ if ( $options['query_post_not_in'] )
1584
+ $exclude = array_merge( $exclude, explode( ' ', $options['query_post_not_in'] ) );
1585
 
1586
+ // Include posts ( option )
1587
+ if ( $options['query_post_in'] )
1588
+ $include = array_merge( $include, explode( ' ', $options['query_post_in'] ) );
1589
 
1590
+ // Include query parameter
1591
+ if ( ! empty( $include ) )
1592
+ $args['post__in'] = $include;
 
 
 
 
1593
 
1594
+ // Exclude query parameter
1595
+ if ( ! empty( $exclude ) )
1596
+ $args['post__not_in'] = $exclude;
 
 
 
1597
 
1598
+ // No paging
1599
+ if ( $options['pagination_type'] == 'disabled' )
1600
+ $args['no_found_rows'] = true;
1601
 
1602
+ // Do the query
1603
+ if ( is_category() || is_tax() || is_search() ) {
1604
+ global $wp_query;
1605
+ $dslc_query = $wp_query;
1606
+ } else {
1607
+ $dslc_query = new WP_Query( $args );
1608
+ }
1609
 
1610
+ $wrapper_class = '';
1611
+ $columns_class = 'dslc-col dslc-' . $options['columns'] . '-col ';
1612
+ $count = 0;
1613
+ $real_count = 0;
1614
+ $increment = $options['columns'];
1615
+ $max_count = 12;
1616
 
1617
+ /**
1618
+ * Elements to show
1619
+ */
 
 
 
1620
 
1621
+ // Main Elements
1622
+ $elements = $options['elements'];
1623
+ if ( ! empty( $elements ) )
1624
+ $elements = explode( ' ', trim( $elements ) );
1625
+ else
1626
+ $elements = array();
1627
 
 
1628
 
1629
+ // Post Elements
1630
+ $post_elements = $options['post_elements'];
1631
+ if ( ! empty( $post_elements ) )
1632
+ $post_elements = explode( ' ', trim( $post_elements ) );
1633
+ else
1634
+ $post_elements = 'all';
1635
 
1636
+ // Carousel Elements
1637
+ $carousel_elements = $options['carousel_elements'];
1638
+ if ( ! empty( $carousel_elements ) )
1639
+ $carousel_elements = explode( ' ', trim( $carousel_elements ) );
1640
+ else
1641
+ $carousel_elements = array();
1642
 
1643
+ /* Container Class */
1644
 
1645
+ $container_class = 'dslc-posts dslc-partners dslc-clearfix dslc-posts-orientation-' . $options['orientation'] . ' ';
1646
 
1647
+ if ( $options['type'] == 'masonry' )
1648
+ $container_class .= 'dslc-init-masonry ';
1649
+ elseif ( $options['type'] == 'grid' )
1650
+ $container_class .= 'dslc-init-grid ';
1651
 
1652
+ /* Element Class */
 
 
1653
 
1654
+ $element_class = 'dslc-post dslc-partner ';
 
 
 
 
1655
 
1656
+ if ( $options['type'] == 'masonry' )
1657
+ $element_class .= 'dslc-masonry-item ';
1658
+ elseif ( $options['type'] == 'carousel' )
1659
+ $element_class .= 'dslc-carousel-item ';
1660
 
1661
+ /**
1662
+ * What is shown
1663
+ */
1664
 
1665
+ $show_header = false;
1666
+ $show_heading = false;
1667
+ $show_filters = false;
1668
+ $show_carousel_arrows = false;
1669
+ $show_view_all_link = false;
1670
 
1671
+ if ( in_array( 'main_heading', $elements ) )
1672
+ $show_heading = true;
1673
 
1674
+ if ( ( $elements == 'all' || in_array( 'filters', $elements ) ) && $options['type'] !== 'carousel' )
1675
+ $show_filters = true;
 
1676
 
1677
+ if ( $options['type'] == 'carousel' && in_array( 'arrows', $carousel_elements ) )
1678
+ $show_carousel_arrows = true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1679
 
1680
+ if ( $show_heading || $show_filters || $show_carousel_arrows )
1681
+ $show_header = true;
1682
+
1683
+ /**
1684
+ * Carousel Items
1685
+ */
1686
+
1687
+ switch ( $options['columns'] ) {
1688
+ case 12 :
1689
+ $carousel_items = 1;
1690
+ break;
1691
+ case 6 :
1692
+ $carousel_items = 2;
1693
+ break;
1694
+ case 4 :
1695
+ $carousel_items = 3;
1696
+ break;
1697
+ case 3 :
1698
+ $carousel_items = 4;
1699
+ break;
1700
+ case 2 :
1701
+ $carousel_items = 6;
1702
+ break;
1703
+ default:
1704
+ $carousel_items = 6;
1705
+ break;
1706
+ }
1707
 
1708
+ /**
1709
+ * Heading ( output )
1710
+ */
1711
 
1712
+ if ( $show_header ) :
1713
+ ?>
1714
+ <div class="dslc-module-heading">
1715
 
1716
+ <!-- Heading -->
1717
 
1718
+ <?php if ( $show_heading ) : ?>
1719
 
1720
+ <h2 class="dslca-editable-content" data-id="main_heading_title" data-type="simple" <?php if ( $dslc_is_admin ) echo 'contenteditable'; ?> ><?php echo stripslashes( $options['main_heading_title'] ); ?></h2>
1721
 
1722
+ <!-- View all -->
1723
 
1724
+ <?php if ( isset( $options['view_all_link'] ) && $options['view_all_link'] !== '' ) : ?>
1725
 
1726
+ <span class="dslc-module-heading-view-all"><a href="<?php echo $options['view_all_link']; ?>" class="dslca-editable-content" data-id="main_heading_link_title" data-type="simple" <?php if ( $dslc_is_admin ) echo 'contenteditable'; ?> ><?php echo $options['main_heading_link_title']; ?></a></span>
1727
 
1728
  <?php endif; ?>
1729
 
1730
+ <?php endif; ?>
1731
 
1732
+ <!-- Filters -->
1733
 
1734
+ <?php
1735
 
1736
+ if ( $show_filters ) {
1737
 
1738
+ $cats_array = array();
1739
 
1740
+ if ( $dslc_query->have_posts() ) {
1741
 
1742
+ while ( $dslc_query->have_posts() ) {
1743
 
1744
+ $dslc_query->the_post();
 
 
 
 
 
1745
 
1746
+ $post_cats = get_the_terms( get_the_ID(), 'dslc_partners_cats' );
1747
+ if ( ! empty( $post_cats ) ) {
1748
+ foreach ( $post_cats as $post_cat ) {
1749
+ $cats_array[$post_cat->slug] = $post_cat->name;
1750
+ }
1751
  }
1752
 
1753
  }
1754
 
1755
+ }
1756
 
1757
+ ?>
 
1758
 
1759
+ <div class="dslc-post-filters">
1760
+ <span class="dslc-post-filter dslc-active dslca-editable-content" data-filter-id="show-all" <?php if ( $dslc_is_admin ){ echo 'data-id="main_filter_title_all" data-type="simple" contenteditable '; } ?>><?php echo $options['main_filter_title_all']; ?></span>
 
1761
 
1762
+ <?php foreach ( $cats_array as $cat_slug => $cat_name ) : ?>
1763
+ <span class="dslc-post-filter dslc-inactive" data-filter-id="<?php echo $cat_slug; ?>"><?php echo $cat_name; ?></span>
1764
+ <?php endforeach; ?>
1765
 
1766
+ </div><!-- .dslc-post-filters -->
1767
 
1768
+ <?php
1769
 
1770
+ }
1771
 
1772
+ ?>
1773
 
1774
+ <!-- Carousel -->
 
 
 
 
 
 
 
1775
 
1776
+ <?php if ( $show_carousel_arrows ) : ?>
1777
+ <span class="dslc-carousel-nav fr">
1778
+ <span class="dslc-carousel-nav-inner">
1779
+ <a href="#" class="dslc-carousel-nav-prev"><span class="dslc-icon-chevron-left"></span></a>
1780
+ <a href="#" class="dslc-carousel-nav-next"><span class="dslc-icon-chevron-right"></span></a>
1781
+ </span>
1782
+ </span><!-- .carousel-nav -->
1783
+ <?php endif; ?>
1784
 
1785
+ </div><!-- .dslc-module-heading -->
1786
+ <?php
1787
 
1788
+ endif;
 
 
1789
 
1790
+ /**
1791
+ * Posts ( output )
1792
+ */
1793
 
1794
+ if ( $dslc_query->have_posts() ) :
1795
 
1796
+ ?><div class="<?php echo $container_class; ?>"><?php
1797
 
1798
+ ?><div class="dslc-posts-inner"><?php
1799
 
1800
+ if ( $options['type'] == 'carousel' ) :
1801
 
1802
+ ?><div class="dslc-loader"></div><div class="dslc-carousel" data-stop-on-hover="<?php echo $options['carousel_autoplay_hover']; ?>" data-autoplay="<?php echo $options['carousel_autoplay']; ?>" data-columns="<?php echo $carousel_items; ?>" data-pagination="<?php if ( in_array( 'circles', $carousel_elements ) ) echo 'true'; else echo 'false'; ?>" data-slide-speed="<?php echo $options['arrows_slide_speed']; ?>" data-pagination-speed="<?php echo $options['circles_slide_speed']; ?>"><?php
1803
 
1804
+ endif;
1805
 
1806
+ while ( $dslc_query->have_posts() ) : $dslc_query->the_post(); $count += $increment; $real_count++;
 
 
 
 
 
 
 
1807
 
1808
+ if ( $count == $max_count ) {
1809
+ $count = 0;
1810
+ $extra_class = ' dslc-last-col';
1811
+ } elseif ( $count == $increment ) {
1812
+ $extra_class = ' dslc-first-col';
1813
+ } else {
1814
+ $extra_class = '';
1815
+ }
1816
 
1817
+ if ( ! has_post_thumbnail() )
1818
+ $extra_class .= ' dslc-post-no-thumb';
1819
+
1820
+ $post_cats = get_the_terms( get_the_ID(), 'dslc_partners_cats' );
1821
+ $post_cats_data = '';
1822
+ if ( ! empty( $post_cats ) ) {
1823
+ foreach ( $post_cats as $post_cat ) {
1824
+ $post_cats_data .= $post_cat->slug . ' ';
1825
  }
1826
+ }
1827
 
1828
+ /**
1829
+ * Link or not
1830
+ */
1831
 
1832
+ $link_to_single = true;
1833
 
1834
+ if ( isset( $options['link'] ) && 'disabled' === $options['link'] ) {
1835
+ $link_to_single = false;
1836
+ }
1837
 
1838
+ // Project URL
1839
+ $the_partner_url = get_permalink();
1840
+ if ( $options['link'] == 'custom' ) {
1841
+ if ( get_post_meta( get_the_ID(), 'dslc_partner_url', true ) )
1842
+ $the_partner_url = get_post_meta( get_the_ID(), 'dslc_partner_url', true );
1843
+ else
1844
+ $the_partner_url = '#';
1845
+ }
1846
 
1847
+ $anchor_target = '_self';
1848
 
1849
+ if ( 'url_new' === $options['link_type'] ) {
1850
+ $anchor_target = '_blank';
1851
+ }
 
 
1852
 
1853
+ ?>
1854
 
1855
+ <div class="<?php echo $element_class . $columns_class . $extra_class; ?>" data-cats="<?php echo $post_cats_data; ?>">
1856
 
1857
+ <?php if ( $post_elements == 'all' || in_array( 'thumbnail', $post_elements ) ) : ?>
 
 
 
1858
 
1859
+ <?php
1860
+ /**
1861
+ * Manual Resize
1862
+ */
1863
 
1864
+ $manual_resize = false;
1865
+ if ( isset( $options['thumb_resize_height'] ) && ! empty( $options['thumb_resize_height'] ) || isset( $options['thumb_resize_width_manual'] ) && ! empty( $options['thumb_resize_width_manual'] ) ) {
 
1866
 
1867
+ $manual_resize = true;
1868
+ $thumb_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
1869
+ $thumb_url = $thumb_url[0];
1870
 
1871
+ $thumb_alt = get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true );
1872
+ if ( ! $thumb_alt ) $thumb_alt = '';
1873
 
1874
+ $resize_width = false;
1875
+ $resize_height = false;
 
1876
 
1877
+ if ( isset( $options['thumb_resize_width_manual'] ) && ! empty( $options['thumb_resize_width_manual'] ) ) {
1878
+ $resize_width = $options['thumb_resize_width_manual'];
1879
+ }
1880
 
1881
+ if ( isset( $options['thumb_resize_height'] ) && ! empty( $options['thumb_resize_height'] ) ) {
1882
+ $resize_height = $options['thumb_resize_height'];
1883
  }
 
1884
 
1885
+ }
1886
+ ?>
1887
 
1888
+ <?php if ( has_post_thumbnail() ) : ?>
1889
 
1890
+ <div class="dslc-post-thumb dslc-partner-thumb dslca-post-thumb dslc-on-hover-anim">
1891
+
1892
+ <?php if ( $manual_resize ) : ?>
1893
+ <?php if ( $link_to_single ) : ?>
1894
+ <a href="<?php echo $the_partner_url; ?>" target="<?php echo $anchor_target; ?>"><img src="<?php $res_img = dslc_aq_resize( $thumb_url, $resize_width, $resize_height, true ); echo $res_img; ?>" alt="<?php echo $thumb_alt; ?>" /></a>
 
1895
  <?php else : ?>
1896
+ <img src="<?php $res_img = dslc_aq_resize( $thumb_url, $resize_width, $resize_height, true ); echo $res_img; ?>" alt="<?php echo $thumb_alt; ?>" />
 
 
 
 
1897
  <?php endif; ?>
1898
+ <?php else : ?>
1899
+ <?php if ( $link_to_single ) : ?>
1900
+ <a href="<?php echo $the_partner_url; ?>" target="<?php echo $anchor_target; ?>"><?php the_post_thumbnail( 'full' ); ?></a>
1901
+ <?php else : ?>
1902
+ <?php the_post_thumbnail( 'full' ); ?>
1903
+ <?php endif; ?>
1904
+ <?php endif; ?>
1905
 
1906
+ <?php if ( ( $options['main_location'] == 'inside' || $options['main_location'] == 'inside_visible' ) && ( $post_elements == 'all' || in_array( 'title', $post_elements ) || in_array( 'excerpt', $post_elements ) ) ) : ?>
 
 
1907
 
1908
+ <div class="dslc-post-main dslc-partner-main dslc-init-<?php echo $options['main_position']; ?> <?php if ( $options['main_location'] == 'inside_visible' ) echo 'dslc-partner-main-visible'; ?> dslc-on-hover-anim-target dslc-anim-<?php echo $options['css_anim_hover']; ?>" data-dslc-anim="<?php echo $options['css_anim_hover'] ?>" data-dslc-anim-speed="<?php echo $options['css_anim_speed']; ?>">
1909
 
1910
+ <div class="dslc-partner-main-inner dslc-init-target">
1911
 
1912
+ <?php if ( $post_elements == 'all' || in_array( 'title', $post_elements ) ) : ?>
 
 
 
 
 
 
1913
 
1914
+ <div class="dslc-partner-title">
1915
+ <?php if ( $link_to_single ) : ?>
1916
+ <h2><a href="<?php echo $the_partner_url; ?>" target="<?php echo $anchor_target; ?>"><?php the_title(); ?></a></h2>
1917
+ <?php else : ?>
1918
+ <h2><?php the_title(); ?></h2>
1919
+ <?php endif; ?>
1920
+ </div><!-- .dslc-partner-title -->
1921
 
1922
+ <?php endif; ?>
1923
 
1924
+ <?php if ( $post_elements == 'all' || in_array( 'excerpt', $post_elements ) ) : ?>
1925
+
1926
+ <div class="dslc-partner-excerpt">
1927
+ <?php if ( $options['excerpt_or_content'] == 'content' ) : ?>
1928
+ <?php
1929
+ if ( $options['excerpt_length'] > 0 ) {
1930
+ echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
1931
+ } else {
1932
+ echo get_the_content();
1933
+ }
1934
+ ?>
1935
+ <?php else : ?>
1936
+ <?php
1937
  if ( $options['excerpt_length'] > 0 ) {
1938
+ if ( has_excerpt() )
1939
+ echo wp_trim_words( get_the_excerpt(), $options['excerpt_length'] );
1940
+ else
1941
+ echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
1942
  } else {
1943
+ if ( has_excerpt() )
1944
+ echo get_the_excerpt();
1945
+ else
1946
+ echo get_the_content();
1947
  }
1948
+ ?>
1949
+ <?php endif; ?>
1950
+ </div><!-- .dslc-partner-excerpt -->
1951
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1952
  <?php endif; ?>
1953
 
1954
  </div><!-- .dslc-partner-main -->
1955
 
1956
+ <?php if ( $link_to_single ) : ?>
1957
+ <a href="<?php echo $the_partner_url; ?>" target="<?php echo $anchor_target; ?>" class="dslc-post-main-inner-link-cover"></a>
1958
+ <?php endif; ?>
1959
 
1960
+ </div><!-- .dslc-partner-main -->
1961
 
1962
+ <?php endif; ?>
1963
+
1964
+ </div><!-- .dslc-partner-thumb -->
1965
 
1966
  <?php endif; ?>
1967
 
1968
+ <?php endif; ?>
1969
 
1970
+ <?php if ( $options['main_location'] == 'bellow' && ( $post_elements == 'all' || in_array( 'title', $post_elements ) || in_array( 'excerpt', $post_elements ) ) ) : ?>
1971
 
1972
+ <div class="dslc-post-main dslc-partner-main">
1973
 
1974
+ <?php if ( $post_elements == 'all' || in_array( 'title', $post_elements ) ) : ?>
 
 
 
 
 
 
1975
 
1976
+ <div class="dslc-partner-title">
1977
+ <?php if ( $link_to_single ) : ?>
1978
+ <h2><a href="<?php echo $the_partner_url; ?>" target="<?php echo $anchor_target; ?>"><?php the_title(); ?></a></h2>
1979
+ <?php else : ?>
1980
+ <h2><?php the_title(); ?></h2>
1981
+ <?php endif; ?>
1982
+ </div><!-- .dslc-partner-title -->
1983
 
1984
+ <?php endif; ?>
1985
 
1986
+ <?php if ( $post_elements == 'all' || in_array( 'excerpt', $post_elements ) ) : ?>
1987
+
1988
+ <div class="dslc-partner-excerpt">
1989
+ <?php if ( $options['excerpt_or_content'] == 'content' ) : ?>
1990
+ <?php
1991
+ if ( $options['excerpt_length'] > 0 ) {
1992
+ echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
1993
+ } else {
1994
+ echo get_the_content();
1995
+ }
1996
+ ?>
1997
+ <?php else : ?>
1998
+ <?php
1999
  if ( $options['excerpt_length'] > 0 ) {
2000
+ if ( has_excerpt() )
2001
+ echo wp_trim_words( get_the_excerpt(), $options['excerpt_length'] );
2002
+ else
2003
+ echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2004
  } else {
2005
+ if ( has_excerpt() )
2006
+ echo get_the_excerpt();
2007
+ else
2008
+ echo get_the_content();
2009
  }
2010
+ ?>
2011
+ <?php endif; ?>
2012
+ </div><!-- .dslc-partner-excerpt -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2013
 
2014
+ <?php endif; ?>
2015
 
2016
+ </div><!-- .dslc-partner-main -->
2017
 
2018
+ <?php endif; ?>
 
 
2019
 
2020
+ </div><!-- .dslc-partner -->
2021
 
2022
+ <?php
 
 
 
2023
 
2024
+ // Row Separator
2025
+ if ( $options['type'] == 'grid' && $count == 0 && $real_count != $dslc_query->found_posts && $real_count != $options['amount'] && $options['separator_enabled'] == 'enabled' ) {
2026
+ echo '<div class="dslc-post-separator"></div>';
2027
+ }
2028
 
2029
+ endwhile;
2030
 
2031
+ if ( $options['type'] == 'carousel' ) :
2032
 
2033
+ ?></div><?php
2034
 
2035
+ endif;
2036
 
2037
+ ?>
2038
 
2039
+ </div><!-- .dslc-posts-inner -->
2040
 
2041
+ </div><!-- .dslc-partners -->
2042
 
2043
+ <?php else :
 
 
2044
 
2045
+ if ( $dslc_is_admin ) :
2046
+ ?><div class="dslc-notification dslc-red"><?php _e( 'You do not have any partners at the moment. Go to <strong>WP Admin &rarr; Partners</strong> to add some.', 'live-composer-page-builder' ); ?> <span class="dslca-refresh-module-hook dslc-icon dslc-icon-refresh"></span></span></div><?php
2047
  endif;
2048
 
2049
+ endif;
2050
+
2051
+ /**
2052
+ * Pagination
2053
+ */
2054
 
2055
+ if ( isset( $options['pagination_type'] ) && $options['pagination_type'] != 'disabled' ) {
2056
+ $num_pages = $dslc_query->max_num_pages;
2057
+ if ( $options['offset'] > 0 ) {
2058
+ $num_pages = ceil( ( $dslc_query->found_posts - $options['offset'] ) / $options['amount'] );
 
 
2059
  }
2060
+ dslc_post_pagination( array('pages' => $num_pages, 'type' => $options['pagination_type']) );
2061
+ }
2062
 
2063
+ wp_reset_postdata();
2064
 
2065
 
2066
+ $shortcode_rendered = ob_get_contents();
2067
+ ob_end_clean();
2068
 
2069
+ return $shortcode_rendered;
2070
 
2071
+ } add_shortcode( 'dslc_module_partners_output', 'dslc_module_partners_output' );
modules/posts/module.php CHANGED
@@ -2460,7 +2460,24 @@ class DSLC_Posts extends DSLC_Module {
2460
  * @return void
2461
  */
2462
  function output( $options ) {
 
 
 
 
 
 
 
 
 
 
 
 
2463
 
 
 
 
 
 
2464
 
2465
  if ( is_feed() ) {
2466
  // Prevent category/tag feeds to stuck in an infinite loop.
@@ -3113,6 +3130,9 @@ class DSLC_Posts extends DSLC_Module {
3113
 
3114
  wp_reset_postdata();
3115
 
3116
- }
 
 
 
3117
 
3118
- }
2460
  * @return void
2461
  */
2462
  function output( $options ) {
2463
+ // Render the module output in the shortcode
2464
+ // to make sure it's not cached in LC and pagination works as expected.
2465
+
2466
+ // @todo: add conditional caching only if pagination used.
2467
+ // if ( 'disabled' === $options['pagination_type'] )
2468
+ // # code...
2469
+ // }
2470
+ ?>
2471
+ [dslc_module_posts_output]<?php echo serialize($options); ?>[/dslc_module_posts_output]
2472
+ <?php
2473
+ }
2474
+ }
2475
 
2476
+ function dslc_module_posts_output ( $atts, $content = null ) {
2477
+ // Uncode module options passed as serialized content.
2478
+ $options = unserialize( $content );
2479
+
2480
+ ob_start();
2481
 
2482
  if ( is_feed() ) {
2483
  // Prevent category/tag feeds to stuck in an infinite loop.
3130
 
3131
  wp_reset_postdata();
3132
 
3133
+ $shortcode_rendered = ob_get_contents();
3134
+ ob_end_clean();
3135
+
3136
+ return $shortcode_rendered;
3137
 
3138
+ } add_shortcode( 'dslc_module_posts_output', 'dslc_module_posts_output' );
modules/projects/module.php CHANGED
@@ -2228,602 +2228,614 @@ class DSLC_Projects extends DSLC_Module {
2228
  * @return void
2229
  */
2230
  function output( $options ) {
 
 
 
 
2231
 
2232
- if ( is_feed() ) {
2233
- // Prevent category/tag feeds to stuck in an infinite loop
2234
- return false;
2235
- }
2236
 
2237
- global $dslc_active;
 
 
2238
 
2239
- if ( $dslc_active && is_user_logged_in() && current_user_can( DS_LIVE_COMPOSER_CAPABILITY ) )
2240
- $dslc_is_admin = true;
2241
- else
2242
- $dslc_is_admin = false;
2243
 
2244
- // Fix slashes on apostrophes
2245
- if ( isset( $options['button_text'] ) ) {
2246
- $options['button_text'] = stripslashes( $options['button_text'] );
2247
- }
2248
 
2249
- $options['module_id'] = $this->module_id;
2250
 
 
 
 
 
2251
 
2252
- /* Module output stars here */
 
 
 
2253
 
2254
- if ( ! isset( $options['excerpt_length'] ) ) $options['excerpt_length'] = 20;
2255
- if ( ! isset( $options['type'] ) ) $options['type'] = 'grid';
2256
 
2257
- if ( is_front_page() ) { $paged = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1; } else { $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; }
2258
 
2259
- // Fix for pagination from other modules affecting this one when pag disabled
2260
- if ( $options['pagination_type'] == 'disabled' ) $paged = 1;
2261
 
2262
- // Fix for offset braking pagination
2263
- $query_offset = $options['offset'];
2264
- if ( $query_offset > 0 && $paged > 1 ) $query_offset = ( $paged - 1 ) * $options['amount'] + $options['offset'];
2265
 
2266
- $args = array(
2267
- 'paged' => $paged,
2268
- 'post_type' => 'dslc_projects',
2269
- 'posts_per_page' => $options['amount'],
2270
- 'order' => $options['order'],
2271
- 'orderby' => $options['orderby'],
2272
- );
2273
 
2274
- // Add offset
2275
- if ( $query_offset > 0 ) {
2276
- $args['offset'] = $query_offset;
2277
- }
2278
 
2279
- if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
2280
- $args['post_status'] = array('publish', 'private');
2281
- }
 
 
 
 
2282
 
2283
- if ( isset( $options['categories'] ) && $options['categories'] != '' ) {
 
 
 
2284
 
2285
- $cats_array = explode( ' ', trim( $options['categories'] ) );
 
 
2286
 
2287
- $args['tax_query'] = array(
2288
- array(
2289
- 'taxonomy' => 'dslc_projects_cats',
2290
- 'field' => 'slug',
2291
- 'terms' => $cats_array,
2292
- 'operator' => $options['categories_operator']
2293
- )
2294
- );
2295
 
2296
- }
2297
 
2298
- // Exlcude and Include arrays
2299
- $exclude = array();
2300
- $include = array();
 
 
 
 
 
2301
 
2302
- // Exclude current post
2303
- if ( is_singular( get_post_type() ) )
2304
- $exclude[] = get_the_ID();
2305
 
2306
- // Exclude posts ( option )
2307
- if ( $options['query_post_not_in'] )
2308
- $exclude = array_merge( $exclude, explode( ' ', $options['query_post_not_in'] ) );
2309
 
2310
- // Include posts ( option )
2311
- if ( $options['query_post_in'] )
2312
- $include = array_merge( $include, explode( ' ', $options['query_post_in'] ) );
2313
 
2314
- // Include query parameter
2315
- if ( ! empty( $include ) )
2316
- $args['post__in'] = $include;
2317
 
2318
- // Exclude query parameter
2319
- if ( ! empty( $exclude ) )
2320
- $args['post__not_in'] = $exclude;
2321
 
2322
- // Author archive page
2323
- if ( is_author() && $options['query_alter'] == 'enabled' ) {
2324
- global $authordata;
2325
- $args['author__in'] = array($authordata->data->ID);
2326
- }
2327
 
2328
- // No paging
2329
- if ( $options['pagination_type'] == 'disabled' )
2330
- $args['no_found_rows'] = true;
2331
 
2332
- // Do the query
2333
- if ( ( is_category() || is_tag() || is_tax() || is_search() || is_date() ) && $options['query_alter'] == 'enabled' ) {
2334
- global $wp_query;
2335
- $dslc_query = $wp_query;
2336
- } else {
2337
- $dslc_query = new WP_Query( $args );
2338
- }
2339
 
2340
- $wrapper_class = '';
2341
- $columns_class = 'dslc-col dslc-' . $options['columns'] . '-col ';
2342
- $count = 0;
2343
- $real_count = 0;
2344
- $increment = $options['columns'];
2345
- $max_count = 12;
2346
 
2347
- /**
2348
- * Elements to show
2349
- */
 
 
 
 
2350
 
2351
- // Main Elements
2352
- $elements = $options['elements'];
2353
- if ( ! empty( $elements ) )
2354
- $elements = explode( ' ', trim( $elements ) );
2355
- else
2356
- $elements = array();
2357
 
 
 
 
2358
 
2359
- // Post Elements
2360
- $post_elements = $options['post_elements'];
2361
- if ( ! empty( $post_elements ) )
2362
- $post_elements = explode( ' ', trim( $post_elements ) );
2363
- else
2364
- $post_elements = 'all';
2365
 
2366
- // Carousel Elements
2367
- $carousel_elements = $options['carousel_elements'];
2368
- if ( ! empty( $carousel_elements ) )
2369
- $carousel_elements = explode( ' ', trim( $carousel_elements ) );
2370
- else
2371
- $carousel_elements = array();
2372
 
2373
- /* Container Class */
 
 
 
 
 
2374
 
2375
- $container_class = 'dslc-posts dslc-projects dslc-clearfix dslc-posts-orientation-' . $options['orientation'] . ' ';
 
 
 
 
 
2376
 
2377
- if ( $options['type'] == 'masonry' )
2378
- $container_class .= 'dslc-init-masonry ';
2379
- elseif ( $options['type'] == 'grid' )
2380
- $container_class .= 'dslc-init-grid ';
2381
 
2382
- /* Element Class */
2383
 
2384
- $element_class = 'dslc-post dslc-project ';
 
 
 
2385
 
2386
- if ( $options['type'] == 'masonry' )
2387
- $element_class .= 'dslc-masonry-item ';
2388
- elseif ( $options['type'] == 'carousel' )
2389
- $element_class .= 'dslc-carousel-item ';
2390
 
2391
- /**
2392
- * What is shown
2393
- */
2394
 
2395
- $show_header = false;
2396
- $show_heading = false;
2397
- $show_filters = false;
2398
- $show_carousel_arrows = false;
2399
- $show_view_all_link = false;
2400
 
2401
- if ( in_array( 'main_heading', $elements ) )
2402
- $show_heading = true;
 
2403
 
2404
- if ( ( $elements == 'all' || in_array( 'filters', $elements ) ) && $options['type'] !== 'carousel' )
2405
- $show_filters = true;
 
 
 
2406
 
2407
- if ( $options['type'] == 'carousel' && in_array( 'arrows', $carousel_elements ) )
2408
- $show_carousel_arrows = true;
2409
 
2410
- if ( $show_heading || $show_filters || $show_carousel_arrows )
2411
- $show_header = true;
2412
 
2413
- /**
2414
- * Carousel Items
2415
- */
2416
 
2417
- switch ( $options['columns'] ) {
2418
- case 12 :
2419
- $carousel_items = 1;
2420
- break;
2421
- case 6 :
2422
- $carousel_items = 2;
2423
- break;
2424
- case 4 :
2425
- $carousel_items = 3;
2426
- break;
2427
- case 3 :
2428
- $carousel_items = 4;
2429
- break;
2430
- case 2 :
2431
- $carousel_items = 6;
2432
- break;
2433
- default:
2434
- $carousel_items = 6;
2435
- break;
2436
- }
2437
 
2438
- /**
2439
- * Heading ( output )
2440
- */
2441
 
2442
- if ( $show_header ) :
2443
- ?>
2444
- <div class="dslc-module-heading">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2445
 
2446
- <!-- Heading -->
 
 
2447
 
2448
- <?php if ( $show_heading ) : ?>
 
 
2449
 
2450
- <h2 class="dslca-editable-content" data-id="main_heading_title" data-type="simple" <?php if ( $dslc_is_admin ) echo 'contenteditable'; ?> ><?php echo stripslashes( $options['main_heading_title'] ); ?></h2>
2451
 
2452
- <!-- View all -->
2453
 
2454
- <?php if ( isset( $options['view_all_link'] ) && $options['view_all_link'] !== '' ) : ?>
2455
 
2456
- <span class="dslc-module-heading-view-all"><a href="<?php echo $options['view_all_link']; ?>" class="dslca-editable-content" data-id="main_heading_link_title" data-type="simple" <?php if ( $dslc_is_admin ) echo 'contenteditable'; ?> ><?php echo $options['main_heading_link_title']; ?></a></span>
2457
 
2458
- <?php endif; ?>
 
 
2459
 
2460
  <?php endif; ?>
2461
 
2462
- <!-- Filters -->
2463
 
2464
- <?php
2465
 
2466
- if ( $show_filters ) {
2467
 
2468
- $cats_array = array();
2469
 
2470
- if ( $dslc_query->have_posts() ) {
2471
 
2472
- while ( $dslc_query->have_posts() ) {
2473
 
2474
- $dslc_query->the_post();
2475
 
2476
- $post_cats = get_the_terms( get_the_ID(), 'dslc_projects_cats' );
2477
- if ( ! empty( $post_cats ) ) {
2478
- foreach ( $post_cats as $post_cat ) {
2479
- $cats_array[$post_cat->slug] = $post_cat->name;
2480
- }
2481
- }
2482
 
 
 
 
 
 
2483
  }
2484
 
2485
  }
2486
 
2487
- ?>
2488
 
2489
- <div class="dslc-post-filters">
2490
- <span class="dslc-post-filter dslc-active dslca-editable-content" data-filter-id="show-all" <?php if ( $dslc_is_admin ){ echo 'data-id="main_filter_title_all" data-type="simple" contenteditable '; } ?>><?php echo $options['main_filter_title_all']; ?></span>
2491
 
2492
- <?php foreach ( $cats_array as $cat_slug => $cat_name ) : ?>
2493
- <span class="dslc-post-filter dslc-inactive" data-filter-id="<?php echo $cat_slug; ?>"><?php echo $cat_name; ?></span>
2494
- <?php endforeach; ?>
2495
 
2496
- </div><!-- .dslc-post-filters -->
 
 
2497
 
2498
- <?php
2499
 
2500
- }
2501
 
2502
- ?>
2503
 
2504
- <!-- Carousel -->
2505
 
2506
- <?php if ( $show_carousel_arrows ) : ?>
2507
- <span class="dslc-carousel-nav fr">
2508
- <span class="dslc-carousel-nav-inner">
2509
- <a href="#" class="dslc-carousel-nav-prev"><span class="dslc-icon-chevron-left"></span></a>
2510
- <a href="#" class="dslc-carousel-nav-next"><span class="dslc-icon-chevron-right"></span></a>
2511
- </span>
2512
- </span><!-- .carousel-nav -->
2513
- <?php endif; ?>
2514
 
2515
- </div><!-- .dslc-module-heading -->
2516
- <?php
 
 
 
 
 
 
2517
 
2518
- endif;
 
2519
 
2520
- /**
2521
- * Posts ( output )
2522
- */
2523
 
2524
- if ( $dslc_query->have_posts() ) :
 
 
2525
 
2526
- ?><div class="<?php echo $container_class; ?>"><?php
2527
 
2528
- ?><div class="dslc-posts-inner"><?php
2529
 
2530
- if ( $options['type'] == 'carousel' ) :
2531
 
2532
- ?><div class="dslc-loader"></div><div class="dslc-carousel" data-stop-on-hover="<?php echo $options['carousel_autoplay_hover']; ?>" data-autoplay="<?php echo $options['carousel_autoplay']; ?>" data-columns="<?php echo $carousel_items; ?>" data-pagination="<?php if ( in_array( 'circles', $carousel_elements ) ) echo 'true'; else echo 'false'; ?>" data-slide-speed="<?php echo $options['arrows_slide_speed']; ?>" data-pagination-speed="<?php echo $options['circles_slide_speed']; ?>"><?php
2533
 
2534
- endif;
2535
 
2536
- while ( $dslc_query->have_posts() ) : $dslc_query->the_post(); $count += $increment; $real_count++;
2537
 
2538
- if ( $count == $max_count ) {
2539
- $count = 0;
2540
- $extra_class = ' dslc-last-col';
2541
- } elseif ( $count == $increment ) {
2542
- $extra_class = ' dslc-first-col';
2543
- } else {
2544
- $extra_class = '';
2545
- }
2546
 
2547
- if ( ! has_post_thumbnail() )
2548
- $extra_class .= ' dslc-post-no-thumb';
 
 
 
 
 
 
2549
 
2550
- $project_cats_count = 0;
2551
- $project_cats = get_the_terms( get_the_ID(), 'dslc_projects_cats' );
2552
 
2553
- $project_cats_data = '';
2554
- if ( ! empty( $project_cats ) ) {
2555
- foreach ( $project_cats as $project_cat ) {
2556
- $project_cats_data .= $project_cat->slug . ' ';
2557
- }
2558
- }
2559
 
2560
- // Project URL
2561
- $the_project_url = get_permalink();
2562
- if ( $options['link'] == 'custom' ) {
2563
- if ( get_post_meta( get_the_ID(), 'dslc_project_url', true ) )
2564
- $the_project_url = get_post_meta( get_the_ID(), 'dslc_project_url', true );
2565
- else
2566
- $the_project_url = '#';
2567
  }
 
2568
 
2569
- // Project URL target
2570
- $the_project_url_target = $options['link_target'];
 
 
 
 
 
 
2571
 
2572
- ?>
 
2573
 
2574
- <div class="<?php echo $element_class . $columns_class . $extra_class; ?>" data-cats="<?php echo $project_cats_data; ?>">
2575
 
2576
- <?php if ( $post_elements == 'all' || in_array( 'thumbnail', $post_elements ) ) : ?>
2577
 
2578
- <?php
2579
- /**
2580
- * Manual Resize
2581
- */
2582
 
2583
- $manual_resize = false;
2584
- if ( isset( $options['thumb_resize_height'] ) && ! empty( $options['thumb_resize_height'] ) || isset( $options['thumb_resize_width_manual'] ) && ! empty( $options['thumb_resize_width_manual'] ) ) {
 
 
2585
 
2586
- $manual_resize = true;
2587
- $thumb_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
2588
- $thumb_url = $thumb_url[0];
2589
 
2590
- $thumb_alt = get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true );
2591
- if ( ! $thumb_alt ) $thumb_alt = '';
 
2592
 
2593
- $resize_width = false;
2594
- $resize_height = false;
2595
 
2596
- if ( isset( $options['thumb_resize_width_manual'] ) && ! empty( $options['thumb_resize_width_manual'] ) ) {
2597
- $resize_width = $options['thumb_resize_width_manual'];
2598
- }
2599
 
2600
- if ( isset( $options['thumb_resize_height'] ) && ! empty( $options['thumb_resize_height'] ) ) {
2601
- $resize_height = $options['thumb_resize_height'];
2602
- }
2603
 
 
 
2604
  }
2605
- ?>
2606
 
2607
- <?php if ( has_post_thumbnail() ) : ?>
 
2608
 
2609
- <div class="dslc-post-thumb dslc-project-thumb dslc-on-hover-anim">
2610
- <div class="dslc-project-thumb-inner dslca-post-thumb">
2611
- <?php if ( $manual_resize ) : ?>
2612
- <a href="<?php echo $the_project_url; ?>" target="<?php echo $the_project_url_target; ?>"><img src="<?php $res_img = dslc_aq_resize( $thumb_url, $resize_width, $resize_height, true ); echo $res_img; ?>" alt="<?php echo $thumb_alt; ?>" /></a>
2613
- <?php else : ?>
2614
- <a href="<?php echo $the_project_url; ?>" target="<?php echo $the_project_url_target; ?>"><?php the_post_thumbnail( 'full' ); ?></a>
2615
- <?php endif; ?>
2616
- </div><!-- .dslc-project-thumb-inner -->
2617
 
2618
- <?php if ( ( $options['main_location'] == 'inside' || $options['main_location'] == 'inside_visible' ) && ( $post_elements == 'all' || in_array( 'title', $post_elements ) || in_array( 'categories', $post_elements ) || in_array( 'excerpt', $post_elements ) || in_array( 'button', $post_elements ) ) ) : ?>
 
 
 
 
 
 
 
2619
 
2620
- <div class="dslc-project-main dslc-init-<?php echo $options['main_position']; ?> <?php if ( $options['main_location'] == 'inside_visible' ) echo 'dslc-project-main-visible'; ?> dslc-on-hover-anim-target dslc-anim-<?php echo $options['css_anim_hover']; ?>" data-dslc-anim="<?php echo $options['css_anim_hover']; ?>" data-dslc-anim-speed="<?php echo $options['css_anim_speed']; ?>">
2621
 
2622
- <div class="dslc-project-main-inner dslc-init-target">
2623
 
2624
- <?php if ( $post_elements == 'all' || in_array( 'title', $post_elements ) ) : ?>
2625
 
2626
- <div class="dslc-project-title">
2627
- <h2><a href="<?php echo $the_project_url; ?>" target="<?php echo $the_project_url_target; ?>"><?php the_title(); ?></a></h2>
2628
- </div><!-- .dslc-project-title -->
2629
 
2630
- <?php endif; ?>
 
 
2631
 
2632
- <?php if ( $post_elements == 'all' || in_array( 'categories', $post_elements ) ) : ?>
2633
-
2634
- <?php if ( ! empty( $project_cats ) ) : ?>
2635
- <div class="dslc-project-cats">
2636
- <?php
2637
- foreach ( $project_cats as $project_cat ) {
2638
- $project_cats_count++;
2639
- if ( $project_cats_count > 1 ) { echo ', '; }
2640
- echo $project_cat->name;
2641
- }
2642
- ?>
2643
- </div><!-- .dslc-project-cats -->
2644
- <?php endif; ?>
2645
 
 
 
 
 
 
 
 
 
 
 
2646
  <?php endif; ?>
2647
 
2648
- <?php if ( $post_elements == 'all' || in_array( 'excerpt', $post_elements ) ) : ?>
2649
 
2650
- <div class="dslc-project-excerpt">
2651
- <?php if ( $options['excerpt_or_content'] == 'content' ) : ?>
2652
- <?php
 
 
 
 
 
 
 
 
 
 
2653
  if ( $options['excerpt_length'] > 0 ) {
2654
- echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
 
 
 
2655
  } else {
2656
- echo get_the_content();
 
 
 
2657
  }
2658
- ?>
2659
- <?php else : ?>
2660
- <?php
2661
- if ( $options['excerpt_length'] > 0 ) {
2662
- if ( has_excerpt() )
2663
- echo wp_trim_words( get_the_excerpt(), $options['excerpt_length'] );
2664
- else
2665
- echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2666
- } else {
2667
- if ( has_excerpt() )
2668
- echo get_the_excerpt();
2669
- else
2670
- echo get_the_content();
2671
- }
2672
- ?>
2673
- <?php endif; ?>
2674
- </div><!-- .dslc-project-excerpt -->
2675
-
2676
- <?php endif; ?>
2677
 
2678
- <?php if ( $post_elements == 'all' || in_array( 'button', $post_elements ) ) : ?>
2679
 
2680
- <div class="dslc-project-read-more">
2681
- <a href="<?php echo $the_project_url; ?>" target="<?php echo $the_project_url_target; ?>">
2682
- <?php if ( isset( $options['button_icon_id'] ) && $options['button_icon_id'] != '' ) : ?>
2683
- <span class="dslc-icon dslc-icon-<?php echo $options['button_icon_id']; ?>"></span>
2684
- <?php endif; ?>
2685
- <?php echo $options['button_text']; ?>
2686
- </a>
2687
- </div><!-- .dslc-project-read-more -->
2688
 
2689
- <?php endif; ?>
 
 
 
 
 
 
 
2690
 
2691
- </div>
2692
 
2693
- <a href="<?php echo $the_project_url; ?>" class="dslc-post-main-inner-link-cover"></a>
2694
 
2695
- </div><!-- .dslc-project-main -->
2696
 
2697
- <?php endif; ?>
2698
 
2699
- </div><!-- .dslc-project-thumb -->
2700
 
2701
- <?php endif; ?>
2702
 
2703
  <?php endif; ?>
2704
 
2705
- <?php if ( $options['main_location'] == 'bellow' && ( $post_elements == 'all' || in_array( 'title', $post_elements ) || in_array( 'categories', $post_elements ) || in_array( 'excerpt', $post_elements ) || in_array( 'button', $post_elements ) ) ) : ?>
2706
 
2707
- <div class="dslc-post-main dslc-project-main">
2708
 
2709
- <?php if ( $post_elements == 'all' || in_array( 'title', $post_elements ) ) : ?>
2710
 
2711
- <div class="dslc-project-title">
2712
- <h2><a href="<?php echo $the_project_url; ?>" target="<?php echo $the_project_url_target; ?>"><?php the_title(); ?></a></h2>
2713
- </div><!-- .dslc-project-title -->
2714
 
2715
- <?php endif; ?>
 
 
2716
 
2717
- <?php if ( $post_elements == 'all' || in_array( 'categories', $post_elements ) ) : ?>
2718
-
2719
- <?php if ( ! empty( $project_cats ) ) : ?>
2720
- <div class="dslc-project-cats">
2721
- <?php
2722
- foreach ( $project_cats as $project_cat ) {
2723
- $project_cats_count++;
2724
- if ( $project_cats_count > 1 ) { echo ', '; }
2725
- echo $project_cat->name;
2726
- }
2727
- ?>
2728
- </div><!-- .dslc-project-cats -->
2729
- <?php endif; ?>
2730
 
 
 
 
 
 
 
 
 
 
 
 
 
2731
  <?php endif; ?>
2732
 
2733
- <?php if ( $post_elements == 'all' || in_array( 'excerpt', $post_elements ) ) : ?>
2734
 
2735
- <div class="dslc-project-excerpt">
2736
- <?php if ( $options['excerpt_or_content'] == 'content' ) : ?>
2737
- <?php
 
 
 
 
 
 
 
 
 
 
2738
  if ( $options['excerpt_length'] > 0 ) {
2739
- echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
 
 
 
2740
  } else {
2741
- echo get_the_content();
 
 
 
2742
  }
2743
- ?>
2744
- <?php else : ?>
2745
- <?php
2746
- if ( $options['excerpt_length'] > 0 ) {
2747
- if ( has_excerpt() )
2748
- echo wp_trim_words( get_the_excerpt(), $options['excerpt_length'] );
2749
- else
2750
- echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2751
- } else {
2752
- if ( has_excerpt() )
2753
- echo get_the_excerpt();
2754
- else
2755
- echo get_the_content();
2756
- }
2757
- ?>
2758
- <?php endif; ?>
2759
- </div><!-- .dslc-project-excerpt -->
2760
 
2761
- <?php endif; ?>
2762
 
2763
- <?php if ( $post_elements == 'all' || in_array( 'button', $post_elements ) ) : ?>
2764
 
2765
- <div class="dslc-project-read-more">
2766
- <a href="<?php echo $the_project_url; ?>" target="<?php echo $the_project_url_target; ?>">
2767
- <?php if ( isset( $options['button_icon_id'] ) && $options['button_icon_id'] != '' ) : ?>
2768
- <span class="dslc-icon dslc-icon-<?php echo $options['button_icon_id']; ?>"></span>
2769
- <?php endif; ?>
2770
- <?php echo $options['button_text']; ?>
2771
- </a>
2772
- </div><!-- .dslc-project-read-more -->
2773
-
2774
- <?php endif; ?>
2775
 
2776
- </div><!-- .dslc-project-main -->
2777
 
2778
- <?php endif; ?>
2779
 
2780
- </div><!-- .dslc-project -->
2781
 
2782
- <?php
2783
 
2784
- // Row Separator
2785
- if ( $options['type'] == 'grid' && $count == 0 && $real_count != $dslc_query->found_posts && $real_count != $options['amount'] && $options['separator_enabled'] == 'enabled' ) {
2786
- echo '<div class="dslc-post-separator"></div>';
2787
- }
2788
 
2789
- endwhile;
 
 
 
2790
 
2791
- if ( $options['type'] == 'carousel' ) :
2792
 
2793
- ?></div><?php
2794
 
2795
- endif;
2796
 
2797
- ?>
2798
 
2799
- </div><!-- .dslc-posts-inner -->
2800
 
2801
- </div><!-- .dslc-projects -->
2802
 
2803
- <?php else :
2804
 
2805
- if ( $dslc_is_admin ) :
2806
- ?><div class="dslc-notification dslc-red"><?php _e( 'You do not have any projects at the moment. Go to <strong>WP Admin &rarr; Projects</strong> to add some.', 'live-composer-page-builder' ); ?> <span class="dslca-refresh-module-hook dslc-icon dslc-icon-refresh"></span></span></div><?php
2807
- endif;
2808
 
 
 
2809
  endif;
2810
 
2811
- /**
2812
- * Pagination
2813
- */
2814
 
2815
- if ( isset( $options['pagination_type'] ) && $options['pagination_type'] != 'disabled' ) {
2816
- $num_pages = $dslc_query->max_num_pages;
2817
- if ( $options['offset'] > 0 ) {
2818
- $num_pages = ceil( ( $dslc_query->found_posts - $options['offset'] ) / $options['amount'] );
2819
- }
2820
- dslc_post_pagination( array('pages' => $num_pages, 'type' => $options['pagination_type']) );
2821
- }
2822
 
2823
- wp_reset_postdata();
 
 
 
 
 
 
2824
 
 
2825
 
 
 
2826
 
2827
- }
2828
 
2829
- }
2228
  * @return void
2229
  */
2230
  function output( $options ) {
2231
+ $options['module_id'] = $this->module_id;
2232
+ ?>
2233
+ [dslc_module_projects_output]<?php echo serialize($options); ?>[/dslc_module_projects_output]
2234
+ <?php
2235
 
2236
+ }
2237
+ }
 
 
2238
 
2239
+ function dslc_module_projects_output ( $atts, $content = null ) {
2240
+ // Uncode module options passed as serialized content.
2241
+ $options = unserialize( $content );
2242
 
2243
+ ob_start();
 
 
 
2244
 
2245
+ if ( is_feed() ) {
2246
+ // Prevent category/tag feeds to stuck in an infinite loop
2247
+ return false;
2248
+ }
2249
 
2250
+ global $dslc_active;
2251
 
2252
+ if ( $dslc_active && is_user_logged_in() && current_user_can( DS_LIVE_COMPOSER_CAPABILITY ) )
2253
+ $dslc_is_admin = true;
2254
+ else
2255
+ $dslc_is_admin = false;
2256
 
2257
+ // Fix slashes on apostrophes
2258
+ if ( isset( $options['button_text'] ) ) {
2259
+ $options['button_text'] = stripslashes( $options['button_text'] );
2260
+ }
2261
 
 
 
2262
 
2263
+ /* Module output stars here */
2264
 
2265
+ if ( ! isset( $options['excerpt_length'] ) ) $options['excerpt_length'] = 20;
2266
+ if ( ! isset( $options['type'] ) ) $options['type'] = 'grid';
2267
 
2268
+ if ( is_front_page() ) { $paged = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1; } else { $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; }
 
 
2269
 
2270
+ // Fix for pagination from other modules affecting this one when pag disabled
2271
+ if ( $options['pagination_type'] == 'disabled' ) $paged = 1;
 
 
 
 
 
2272
 
2273
+ // Fix for offset braking pagination
2274
+ $query_offset = $options['offset'];
2275
+ if ( $query_offset > 0 && $paged > 1 ) $query_offset = ( $paged - 1 ) * $options['amount'] + $options['offset'];
 
2276
 
2277
+ $args = array(
2278
+ 'paged' => $paged,
2279
+ 'post_type' => 'dslc_projects',
2280
+ 'posts_per_page' => $options['amount'],
2281
+ 'order' => $options['order'],
2282
+ 'orderby' => $options['orderby'],
2283
+ );
2284
 
2285
+ // Add offset
2286
+ if ( $query_offset > 0 ) {
2287
+ $args['offset'] = $query_offset;
2288
+ }
2289
 
2290
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
2291
+ $args['post_status'] = array('publish', 'private');
2292
+ }
2293
 
2294
+ if ( isset( $options['categories'] ) && $options['categories'] != '' ) {
 
 
 
 
 
 
 
2295
 
2296
+ $cats_array = explode( ' ', trim( $options['categories'] ) );
2297
 
2298
+ $args['tax_query'] = array(
2299
+ array(
2300
+ 'taxonomy' => 'dslc_projects_cats',
2301
+ 'field' => 'slug',
2302
+ 'terms' => $cats_array,
2303
+ 'operator' => $options['categories_operator']
2304
+ )
2305
+ );
2306
 
2307
+ }
 
 
2308
 
2309
+ // Exlcude and Include arrays
2310
+ $exclude = array();
2311
+ $include = array();
2312
 
2313
+ // Exclude current post
2314
+ if ( is_singular( get_post_type() ) )
2315
+ $exclude[] = get_the_ID();
2316
 
2317
+ // Exclude posts ( option )
2318
+ if ( $options['query_post_not_in'] )
2319
+ $exclude = array_merge( $exclude, explode( ' ', $options['query_post_not_in'] ) );
2320
 
2321
+ // Include posts ( option )
2322
+ if ( $options['query_post_in'] )
2323
+ $include = array_merge( $include, explode( ' ', $options['query_post_in'] ) );
2324
 
2325
+ // Include query parameter
2326
+ if ( ! empty( $include ) )
2327
+ $args['post__in'] = $include;
 
 
2328
 
2329
+ // Exclude query parameter
2330
+ if ( ! empty( $exclude ) )
2331
+ $args['post__not_in'] = $exclude;
2332
 
2333
+ // Author archive page
2334
+ if ( is_author() && $options['query_alter'] == 'enabled' ) {
2335
+ global $authordata;
2336
+ $args['author__in'] = array($authordata->data->ID);
2337
+ }
 
 
2338
 
2339
+ // No paging
2340
+ if ( $options['pagination_type'] == 'disabled' )
2341
+ $args['no_found_rows'] = true;
 
 
 
2342
 
2343
+ // Do the query
2344
+ if ( ( is_category() || is_tag() || is_tax() || is_search() || is_date() ) && $options['query_alter'] == 'enabled' ) {
2345
+ global $wp_query;
2346
+ $dslc_query = $wp_query;
2347
+ } else {
2348
+ $dslc_query = new WP_Query( $args );
2349
+ }
2350
 
2351
+ $wrapper_class = '';
2352
+ $columns_class = 'dslc-col dslc-' . $options['columns'] . '-col ';
2353
+ $count = 0;
2354
+ $real_count = 0;
2355
+ $increment = $options['columns'];
2356
+ $max_count = 12;
2357
 
2358
+ /**
2359
+ * Elements to show
2360
+ */
2361
 
2362
+ // Main Elements
2363
+ $elements = $options['elements'];
2364
+ if ( ! empty( $elements ) )
2365
+ $elements = explode( ' ', trim( $elements ) );
2366
+ else
2367
+ $elements = array();
2368
 
 
 
 
 
 
 
2369
 
2370
+ // Post Elements
2371
+ $post_elements = $options['post_elements'];
2372
+ if ( ! empty( $post_elements ) )
2373
+ $post_elements = explode( ' ', trim( $post_elements ) );
2374
+ else
2375
+ $post_elements = 'all';
2376
 
2377
+ // Carousel Elements
2378
+ $carousel_elements = $options['carousel_elements'];
2379
+ if ( ! empty( $carousel_elements ) )
2380
+ $carousel_elements = explode( ' ', trim( $carousel_elements ) );
2381
+ else
2382
+ $carousel_elements = array();
2383
 
2384
+ /* Container Class */
 
 
 
2385
 
2386
+ $container_class = 'dslc-posts dslc-projects dslc-clearfix dslc-posts-orientation-' . $options['orientation'] . ' ';
2387
 
2388
+ if ( $options['type'] == 'masonry' )
2389
+ $container_class .= 'dslc-init-masonry ';
2390
+ elseif ( $options['type'] == 'grid' )
2391
+ $container_class .= 'dslc-init-grid ';
2392
 
2393
+ /* Element Class */
 
 
 
2394
 
2395
+ $element_class = 'dslc-post dslc-project ';
 
 
2396
 
2397
+ if ( $options['type'] == 'masonry' )
2398
+ $element_class .= 'dslc-masonry-item ';
2399
+ elseif ( $options['type'] == 'carousel' )
2400
+ $element_class .= 'dslc-carousel-item ';
 
2401
 
2402
+ /**
2403
+ * What is shown
2404
+ */
2405
 
2406
+ $show_header = false;
2407
+ $show_heading = false;
2408
+ $show_filters = false;
2409
+ $show_carousel_arrows = false;
2410
+ $show_view_all_link = false;
2411
 
2412
+ if ( in_array( 'main_heading', $elements ) )
2413
+ $show_heading = true;
2414
 
2415
+ if ( ( $elements == 'all' || in_array( 'filters', $elements ) ) && $options['type'] !== 'carousel' )
2416
+ $show_filters = true;
2417
 
2418
+ if ( $options['type'] == 'carousel' && in_array( 'arrows', $carousel_elements ) )
2419
+ $show_carousel_arrows = true;
 
2420
 
2421
+ if ( $show_heading || $show_filters || $show_carousel_arrows )
2422
+ $show_header = true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2423
 
2424
+ /**
2425
+ * Carousel Items
2426
+ */
2427
 
2428
+ switch ( $options['columns'] ) {
2429
+ case 12 :
2430
+ $carousel_items = 1;
2431
+ break;
2432
+ case 6 :
2433
+ $carousel_items = 2;
2434
+ break;
2435
+ case 4 :
2436
+ $carousel_items = 3;
2437
+ break;
2438
+ case 3 :
2439
+ $carousel_items = 4;
2440
+ break;
2441
+ case 2 :
2442
+ $carousel_items = 6;
2443
+ break;
2444
+ default:
2445
+ $carousel_items = 6;
2446
+ break;
2447
+ }
2448
 
2449
+ /**
2450
+ * Heading ( output )
2451
+ */
2452
 
2453
+ if ( $show_header ) :
2454
+ ?>
2455
+ <div class="dslc-module-heading">
2456
 
2457
+ <!-- Heading -->
2458
 
2459
+ <?php if ( $show_heading ) : ?>
2460
 
2461
+ <h2 class="dslca-editable-content" data-id="main_heading_title" data-type="simple" <?php if ( $dslc_is_admin ) echo 'contenteditable'; ?> ><?php echo stripslashes( $options['main_heading_title'] ); ?></h2>
2462
 
2463
+ <!-- View all -->
2464
 
2465
+ <?php if ( isset( $options['view_all_link'] ) && $options['view_all_link'] !== '' ) : ?>
2466
+
2467
+ <span class="dslc-module-heading-view-all"><a href="<?php echo $options['view_all_link']; ?>" class="dslca-editable-content" data-id="main_heading_link_title" data-type="simple" <?php if ( $dslc_is_admin ) echo 'contenteditable'; ?> ><?php echo $options['main_heading_link_title']; ?></a></span>
2468
 
2469
  <?php endif; ?>
2470
 
2471
+ <?php endif; ?>
2472
 
2473
+ <!-- Filters -->
2474
 
2475
+ <?php
2476
 
2477
+ if ( $show_filters ) {
2478
 
2479
+ $cats_array = array();
2480
 
2481
+ if ( $dslc_query->have_posts() ) {
2482
 
2483
+ while ( $dslc_query->have_posts() ) {
2484
 
2485
+ $dslc_query->the_post();
 
 
 
 
 
2486
 
2487
+ $post_cats = get_the_terms( get_the_ID(), 'dslc_projects_cats' );
2488
+ if ( ! empty( $post_cats ) ) {
2489
+ foreach ( $post_cats as $post_cat ) {
2490
+ $cats_array[$post_cat->slug] = $post_cat->name;
2491
+ }
2492
  }
2493
 
2494
  }
2495
 
2496
+ }
2497
 
2498
+ ?>
 
2499
 
2500
+ <div class="dslc-post-filters">
2501
+ <span class="dslc-post-filter dslc-active dslca-editable-content" data-filter-id="show-all" <?php if ( $dslc_is_admin ){ echo 'data-id="main_filter_title_all" data-type="simple" contenteditable '; } ?>><?php echo $options['main_filter_title_all']; ?></span>
 
2502
 
2503
+ <?php foreach ( $cats_array as $cat_slug => $cat_name ) : ?>
2504
+ <span class="dslc-post-filter dslc-inactive" data-filter-id="<?php echo $cat_slug; ?>"><?php echo $cat_name; ?></span>
2505
+ <?php endforeach; ?>
2506
 
2507
+ </div><!-- .dslc-post-filters -->
2508
 
2509
+ <?php
2510
 
2511
+ }
2512
 
2513
+ ?>
2514
 
2515
+ <!-- Carousel -->
 
 
 
 
 
 
 
2516
 
2517
+ <?php if ( $show_carousel_arrows ) : ?>
2518
+ <span class="dslc-carousel-nav fr">
2519
+ <span class="dslc-carousel-nav-inner">
2520
+ <a href="#" class="dslc-carousel-nav-prev"><span class="dslc-icon-chevron-left"></span></a>
2521
+ <a href="#" class="dslc-carousel-nav-next"><span class="dslc-icon-chevron-right"></span></a>
2522
+ </span>
2523
+ </span><!-- .carousel-nav -->
2524
+ <?php endif; ?>
2525
 
2526
+ </div><!-- .dslc-module-heading -->
2527
+ <?php
2528
 
2529
+ endif;
 
 
2530
 
2531
+ /**
2532
+ * Posts ( output )
2533
+ */
2534
 
2535
+ if ( $dslc_query->have_posts() ) :
2536
 
2537
+ ?><div class="<?php echo $container_class; ?>"><?php
2538
 
2539
+ ?><div class="dslc-posts-inner"><?php
2540
 
2541
+ if ( $options['type'] == 'carousel' ) :
2542
 
2543
+ ?><div class="dslc-loader"></div><div class="dslc-carousel" data-stop-on-hover="<?php echo $options['carousel_autoplay_hover']; ?>" data-autoplay="<?php echo $options['carousel_autoplay']; ?>" data-columns="<?php echo $carousel_items; ?>" data-pagination="<?php if ( in_array( 'circles', $carousel_elements ) ) echo 'true'; else echo 'false'; ?>" data-slide-speed="<?php echo $options['arrows_slide_speed']; ?>" data-pagination-speed="<?php echo $options['circles_slide_speed']; ?>"><?php
2544
 
2545
+ endif;
2546
 
2547
+ while ( $dslc_query->have_posts() ) : $dslc_query->the_post(); $count += $increment; $real_count++;
 
 
 
 
 
 
 
2548
 
2549
+ if ( $count == $max_count ) {
2550
+ $count = 0;
2551
+ $extra_class = ' dslc-last-col';
2552
+ } elseif ( $count == $increment ) {
2553
+ $extra_class = ' dslc-first-col';
2554
+ } else {
2555
+ $extra_class = '';
2556
+ }
2557
 
2558
+ if ( ! has_post_thumbnail() )
2559
+ $extra_class .= ' dslc-post-no-thumb';
2560
 
2561
+ $project_cats_count = 0;
2562
+ $project_cats = get_the_terms( get_the_ID(), 'dslc_projects_cats' );
 
 
 
 
2563
 
2564
+ $project_cats_data = '';
2565
+ if ( ! empty( $project_cats ) ) {
2566
+ foreach ( $project_cats as $project_cat ) {
2567
+ $project_cats_data .= $project_cat->slug . ' ';
 
 
 
2568
  }
2569
+ }
2570
 
2571
+ // Project URL
2572
+ $the_project_url = get_permalink();
2573
+ if ( $options['link'] == 'custom' ) {
2574
+ if ( get_post_meta( get_the_ID(), 'dslc_project_url', true ) )
2575
+ $the_project_url = get_post_meta( get_the_ID(), 'dslc_project_url', true );
2576
+ else
2577
+ $the_project_url = '#';
2578
+ }
2579
 
2580
+ // Project URL target
2581
+ $the_project_url_target = $options['link_target'];
2582
 
2583
+ ?>
2584
 
2585
+ <div class="<?php echo $element_class . $columns_class . $extra_class; ?>" data-cats="<?php echo $project_cats_data; ?>">
2586
 
2587
+ <?php if ( $post_elements == 'all' || in_array( 'thumbnail', $post_elements ) ) : ?>
 
 
 
2588
 
2589
+ <?php
2590
+ /**
2591
+ * Manual Resize
2592
+ */
2593
 
2594
+ $manual_resize = false;
2595
+ if ( isset( $options['thumb_resize_height'] ) && ! empty( $options['thumb_resize_height'] ) || isset( $options['thumb_resize_width_manual'] ) && ! empty( $options['thumb_resize_width_manual'] ) ) {
 
2596
 
2597
+ $manual_resize = true;
2598
+ $thumb_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
2599
+ $thumb_url = $thumb_url[0];
2600
 
2601
+ $thumb_alt = get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true );
2602
+ if ( ! $thumb_alt ) $thumb_alt = '';
2603
 
2604
+ $resize_width = false;
2605
+ $resize_height = false;
 
2606
 
2607
+ if ( isset( $options['thumb_resize_width_manual'] ) && ! empty( $options['thumb_resize_width_manual'] ) ) {
2608
+ $resize_width = $options['thumb_resize_width_manual'];
2609
+ }
2610
 
2611
+ if ( isset( $options['thumb_resize_height'] ) && ! empty( $options['thumb_resize_height'] ) ) {
2612
+ $resize_height = $options['thumb_resize_height'];
2613
  }
 
2614
 
2615
+ }
2616
+ ?>
2617
 
2618
+ <?php if ( has_post_thumbnail() ) : ?>
 
 
 
 
 
 
 
2619
 
2620
+ <div class="dslc-post-thumb dslc-project-thumb dslc-on-hover-anim">
2621
+ <div class="dslc-project-thumb-inner dslca-post-thumb">
2622
+ <?php if ( $manual_resize ) : ?>
2623
+ <a href="<?php echo $the_project_url; ?>" target="<?php echo $the_project_url_target; ?>"><img src="<?php $res_img = dslc_aq_resize( $thumb_url, $resize_width, $resize_height, true ); echo $res_img; ?>" alt="<?php echo $thumb_alt; ?>" /></a>
2624
+ <?php else : ?>
2625
+ <a href="<?php echo $the_project_url; ?>" target="<?php echo $the_project_url_target; ?>"><?php the_post_thumbnail( 'full' ); ?></a>
2626
+ <?php endif; ?>
2627
+ </div><!-- .dslc-project-thumb-inner -->
2628
 
2629
+ <?php if ( ( $options['main_location'] == 'inside' || $options['main_location'] == 'inside_visible' ) && ( $post_elements == 'all' || in_array( 'title', $post_elements ) || in_array( 'categories', $post_elements ) || in_array( 'excerpt', $post_elements ) || in_array( 'button', $post_elements ) ) ) : ?>
2630
 
2631
+ <div class="dslc-project-main dslc-init-<?php echo $options['main_position']; ?> <?php if ( $options['main_location'] == 'inside_visible' ) echo 'dslc-project-main-visible'; ?> dslc-on-hover-anim-target dslc-anim-<?php echo $options['css_anim_hover']; ?>" data-dslc-anim="<?php echo $options['css_anim_hover']; ?>" data-dslc-anim-speed="<?php echo $options['css_anim_speed']; ?>">
2632
 
2633
+ <div class="dslc-project-main-inner dslc-init-target">
2634
 
2635
+ <?php if ( $post_elements == 'all' || in_array( 'title', $post_elements ) ) : ?>
 
 
2636
 
2637
+ <div class="dslc-project-title">
2638
+ <h2><a href="<?php echo $the_project_url; ?>" target="<?php echo $the_project_url_target; ?>"><?php the_title(); ?></a></h2>
2639
+ </div><!-- .dslc-project-title -->
2640
 
2641
+ <?php endif; ?>
2642
+
2643
+ <?php if ( $post_elements == 'all' || in_array( 'categories', $post_elements ) ) : ?>
 
 
 
 
 
 
 
 
 
 
2644
 
2645
+ <?php if ( ! empty( $project_cats ) ) : ?>
2646
+ <div class="dslc-project-cats">
2647
+ <?php
2648
+ foreach ( $project_cats as $project_cat ) {
2649
+ $project_cats_count++;
2650
+ if ( $project_cats_count > 1 ) { echo ', '; }
2651
+ echo $project_cat->name;
2652
+ }
2653
+ ?>
2654
+ </div><!-- .dslc-project-cats -->
2655
  <?php endif; ?>
2656
 
2657
+ <?php endif; ?>
2658
 
2659
+ <?php if ( $post_elements == 'all' || in_array( 'excerpt', $post_elements ) ) : ?>
2660
+
2661
+ <div class="dslc-project-excerpt">
2662
+ <?php if ( $options['excerpt_or_content'] == 'content' ) : ?>
2663
+ <?php
2664
+ if ( $options['excerpt_length'] > 0 ) {
2665
+ echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2666
+ } else {
2667
+ echo get_the_content();
2668
+ }
2669
+ ?>
2670
+ <?php else : ?>
2671
+ <?php
2672
  if ( $options['excerpt_length'] > 0 ) {
2673
+ if ( has_excerpt() )
2674
+ echo wp_trim_words( get_the_excerpt(), $options['excerpt_length'] );
2675
+ else
2676
+ echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2677
  } else {
2678
+ if ( has_excerpt() )
2679
+ echo get_the_excerpt();
2680
+ else
2681
+ echo get_the_content();
2682
  }
2683
+ ?>
2684
+ <?php endif; ?>
2685
+ </div><!-- .dslc-project-excerpt -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2686
 
2687
+ <?php endif; ?>
2688
 
2689
+ <?php if ( $post_elements == 'all' || in_array( 'button', $post_elements ) ) : ?>
 
 
 
 
 
 
 
2690
 
2691
+ <div class="dslc-project-read-more">
2692
+ <a href="<?php echo $the_project_url; ?>" target="<?php echo $the_project_url_target; ?>">
2693
+ <?php if ( isset( $options['button_icon_id'] ) && $options['button_icon_id'] != '' ) : ?>
2694
+ <span class="dslc-icon dslc-icon-<?php echo $options['button_icon_id']; ?>"></span>
2695
+ <?php endif; ?>
2696
+ <?php echo $options['button_text']; ?>
2697
+ </a>
2698
+ </div><!-- .dslc-project-read-more -->
2699
 
2700
+ <?php endif; ?>
2701
 
2702
+ </div>
2703
 
2704
+ <a href="<?php echo $the_project_url; ?>" class="dslc-post-main-inner-link-cover"></a>
2705
 
2706
+ </div><!-- .dslc-project-main -->
2707
 
2708
+ <?php endif; ?>
2709
 
2710
+ </div><!-- .dslc-project-thumb -->
2711
 
2712
  <?php endif; ?>
2713
 
2714
+ <?php endif; ?>
2715
 
2716
+ <?php if ( $options['main_location'] == 'bellow' && ( $post_elements == 'all' || in_array( 'title', $post_elements ) || in_array( 'categories', $post_elements ) || in_array( 'excerpt', $post_elements ) || in_array( 'button', $post_elements ) ) ) : ?>
2717
 
2718
+ <div class="dslc-post-main dslc-project-main">
2719
 
2720
+ <?php if ( $post_elements == 'all' || in_array( 'title', $post_elements ) ) : ?>
 
 
2721
 
2722
+ <div class="dslc-project-title">
2723
+ <h2><a href="<?php echo $the_project_url; ?>" target="<?php echo $the_project_url_target; ?>"><?php the_title(); ?></a></h2>
2724
+ </div><!-- .dslc-project-title -->
2725
 
2726
+ <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
2727
 
2728
+ <?php if ( $post_elements == 'all' || in_array( 'categories', $post_elements ) ) : ?>
2729
+
2730
+ <?php if ( ! empty( $project_cats ) ) : ?>
2731
+ <div class="dslc-project-cats">
2732
+ <?php
2733
+ foreach ( $project_cats as $project_cat ) {
2734
+ $project_cats_count++;
2735
+ if ( $project_cats_count > 1 ) { echo ', '; }
2736
+ echo $project_cat->name;
2737
+ }
2738
+ ?>
2739
+ </div><!-- .dslc-project-cats -->
2740
  <?php endif; ?>
2741
 
2742
+ <?php endif; ?>
2743
 
2744
+ <?php if ( $post_elements == 'all' || in_array( 'excerpt', $post_elements ) ) : ?>
2745
+
2746
+ <div class="dslc-project-excerpt">
2747
+ <?php if ( $options['excerpt_or_content'] == 'content' ) : ?>
2748
+ <?php
2749
+ if ( $options['excerpt_length'] > 0 ) {
2750
+ echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2751
+ } else {
2752
+ echo get_the_content();
2753
+ }
2754
+ ?>
2755
+ <?php else : ?>
2756
+ <?php
2757
  if ( $options['excerpt_length'] > 0 ) {
2758
+ if ( has_excerpt() )
2759
+ echo wp_trim_words( get_the_excerpt(), $options['excerpt_length'] );
2760
+ else
2761
+ echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2762
  } else {
2763
+ if ( has_excerpt() )
2764
+ echo get_the_excerpt();
2765
+ else
2766
+ echo get_the_content();
2767
  }
2768
+ ?>
2769
+ <?php endif; ?>
2770
+ </div><!-- .dslc-project-excerpt -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2771
 
2772
+ <?php endif; ?>
2773
 
2774
+ <?php if ( $post_elements == 'all' || in_array( 'button', $post_elements ) ) : ?>
2775
 
2776
+ <div class="dslc-project-read-more">
2777
+ <a href="<?php echo $the_project_url; ?>" target="<?php echo $the_project_url_target; ?>">
2778
+ <?php if ( isset( $options['button_icon_id'] ) && $options['button_icon_id'] != '' ) : ?>
2779
+ <span class="dslc-icon dslc-icon-<?php echo $options['button_icon_id']; ?>"></span>
2780
+ <?php endif; ?>
2781
+ <?php echo $options['button_text']; ?>
2782
+ </a>
2783
+ </div><!-- .dslc-project-read-more -->
 
 
2784
 
2785
+ <?php endif; ?>
2786
 
2787
+ </div><!-- .dslc-project-main -->
2788
 
2789
+ <?php endif; ?>
2790
 
2791
+ </div><!-- .dslc-project -->
2792
 
2793
+ <?php
 
 
 
2794
 
2795
+ // Row Separator
2796
+ if ( $options['type'] == 'grid' && $count == 0 && $real_count != $dslc_query->found_posts && $real_count != $options['amount'] && $options['separator_enabled'] == 'enabled' ) {
2797
+ echo '<div class="dslc-post-separator"></div>';
2798
+ }
2799
 
2800
+ endwhile;
2801
 
2802
+ if ( $options['type'] == 'carousel' ) :
2803
 
2804
+ ?></div><?php
2805
 
2806
+ endif;
2807
 
2808
+ ?>
2809
 
2810
+ </div><!-- .dslc-posts-inner -->
2811
 
2812
+ </div><!-- .dslc-projects -->
2813
 
2814
+ <?php else :
 
 
2815
 
2816
+ if ( $dslc_is_admin ) :
2817
+ ?><div class="dslc-notification dslc-red"><?php _e( 'You do not have any projects at the moment. Go to <strong>WP Admin &rarr; Projects</strong> to add some.', 'live-composer-page-builder' ); ?> <span class="dslca-refresh-module-hook dslc-icon dslc-icon-refresh"></span></span></div><?php
2818
  endif;
2819
 
2820
+ endif;
 
 
2821
 
2822
+ /**
2823
+ * Pagination
2824
+ */
 
 
 
 
2825
 
2826
+ if ( isset( $options['pagination_type'] ) && $options['pagination_type'] != 'disabled' ) {
2827
+ $num_pages = $dslc_query->max_num_pages;
2828
+ if ( $options['offset'] > 0 ) {
2829
+ $num_pages = ceil( ( $dslc_query->found_posts - $options['offset'] ) / $options['amount'] );
2830
+ }
2831
+ dslc_post_pagination( array('pages' => $num_pages, 'type' => $options['pagination_type']) );
2832
+ }
2833
 
2834
+ wp_reset_postdata();
2835
 
2836
+ $shortcode_rendered = ob_get_contents();
2837
+ ob_end_clean();
2838
 
2839
+ return $shortcode_rendered;
2840
 
2841
+ } add_shortcode( 'dslc_module_projects_output', 'dslc_module_projects_output' );
modules/staff/module.php CHANGED
@@ -2064,595 +2064,610 @@ class DSLC_Staff extends DSLC_Module {
2064
  * @return void
2065
  */
2066
  function output( $options ) {
 
 
 
2067
 
2068
- global $dslc_active;
 
2069
 
2070
- if ( $dslc_active && is_user_logged_in() && current_user_can( DS_LIVE_COMPOSER_CAPABILITY ) )
2071
- $dslc_is_admin = true;
2072
- else
2073
- $dslc_is_admin = false;
2074
 
 
2075
 
2076
- /* Module output stars here */
2077
 
2078
- if ( ! isset( $options['excerpt_length'] ) ) $options['excerpt_length'] = 20;
 
 
 
2079
 
2080
- if ( is_front_page() ) { $paged = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1; } else { $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; }
2081
 
2082
- // Fix for pagination from other modules affecting this one when pag disabled.
2083
- if ( $options['pagination_type'] == 'disabled' ) $paged = 1;
2084
 
2085
- // Fix for offset braking pagination.
2086
- $query_offset = $options['offset'];
2087
- if ( $query_offset > 0 && $paged > 1 ) $query_offset = ( $paged - 1 ) * $options['amount'] + $options['offset'];
2088
 
2089
- $args = array(
2090
- 'paged' => $paged,
2091
- 'post_type' => 'dslc_staff',
2092
- 'posts_per_page' => $options['amount'],
2093
- 'order' => $options['order'],
2094
- 'orderby' => $options['orderby'],
2095
- );
2096
 
2097
- // Add offset.
2098
- if ( $query_offset > 0 ) {
2099
- $args['offset'] = $query_offset;
2100
- }
2101
 
2102
- if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
2103
- $args['post_status'] = array('publish', 'private');
2104
- }
2105
 
2106
- if ( isset( $options['categories'] ) && $options['categories'] != '' ) {
 
 
 
 
 
 
2107
 
2108
- $cats_array = explode( ' ', trim( $options['categories'] ) );
 
 
 
2109
 
2110
- $args['tax_query'] = array(
2111
- array(
2112
- 'taxonomy' => 'dslc_staff_cats',
2113
- 'field' => 'slug',
2114
- 'terms' => $cats_array,
2115
- 'operator' => $options['categories_operator'],
2116
- ),
2117
- );
2118
 
2119
- }
2120
 
2121
- // Exlcude and Include arrays.
2122
- $exclude = array();
2123
- $include = array();
2124
 
2125
- // Exclude current post.
2126
- if ( is_singular( get_post_type() ) )
2127
- $exclude[] = get_the_ID();
 
 
 
 
 
2128
 
2129
- // Exclude posts ( option ).
2130
- if ( $options['query_post_not_in'] )
2131
- $exclude = array_merge( $exclude, explode( ' ', $options['query_post_not_in'] ) );
2132
 
2133
- // Include posts ( option ).
2134
- if ( $options['query_post_in'] )
2135
- $include = array_merge( $include, explode( ' ', $options['query_post_in'] ) );
2136
 
2137
- // Include query parameter.
2138
- if ( ! empty( $include ) )
2139
- $args['post__in'] = $include;
2140
 
2141
- // Exclude query parameter.
2142
- if ( ! empty( $exclude ) )
2143
- $args['post__not_in'] = $exclude;
2144
 
2145
- // No paging.
2146
- if ( 'disabled' === $options['pagination_type'] )
2147
- $args['no_found_rows'] = true;
2148
 
2149
- // Do the query.
2150
- if ( is_category() || is_tax() || is_search() ) {
2151
- global $wp_query;
2152
- $dslc_query = $wp_query;
2153
- } else {
2154
- $dslc_query = new WP_Query( $args );
2155
- }
2156
 
2157
- $columns_class = 'dslc-col dslc-' . $options['columns'] . '-col ';
2158
- $count = 0;
2159
- $real_count = 0;
2160
- $increment = $options['columns'];
2161
- $max_count = 12;
2162
 
2163
- /**
2164
- * Elements to show
2165
- */
2166
 
2167
- // Main Elements.
2168
- $elements = $options['elements'];
2169
- if ( ! empty( $elements ) )
2170
- $elements = explode( ' ', trim( $elements ) );
2171
- else
2172
- $elements = array();
 
2173
 
 
 
 
 
 
2174
 
2175
- // Post Elements.
2176
- $post_elements = $options['post_elements'];
2177
- if ( ! empty( $post_elements ) )
2178
- $post_elements = explode( ' ', trim( $post_elements ) );
2179
- else
2180
- $post_elements = 'all';
2181
 
2182
- // Carousel Elements.
2183
- $carousel_elements = $options['carousel_elements'];
2184
- if ( ! empty( $carousel_elements ) )
2185
- $carousel_elements = explode( ' ', trim( $carousel_elements ) );
2186
- else
2187
- $carousel_elements = array();
2188
 
2189
- /* Container Class */
2190
 
2191
- $container_class = 'dslc-posts dslc-staff dslc-clearfix ';
 
 
 
 
 
2192
 
2193
- if ( $options['type'] == 'masonry' )
2194
- $container_class .= 'dslc-init-masonry ';
2195
- elseif ( $options['type'] == 'carousel' )
2196
- $container_class .= 'dslc-init-carousel ';
2197
- elseif ( $options['type'] == 'grid' )
2198
- $container_class .= 'dslc-init-grid ';
2199
 
2200
- /* Element Class */
2201
 
2202
- $element_class = 'dslc-post dslc-staff-member ';
2203
 
2204
- if ( $options['type'] == 'masonry' )
2205
- $element_class .= 'dslc-masonry-item ';
2206
- elseif ( $options['type'] == 'carousel' )
2207
- $element_class .= 'dslc-carousel-item ';
 
 
2208
 
2209
- /**
2210
- * What is shown
2211
- */
2212
 
2213
- $show_header = false;
2214
- $show_heading = false;
2215
- $show_filters = false;
2216
- $show_carousel_arrows = false;
2217
- $show_view_all_link = false;
2218
 
2219
- if ( in_array( 'main_heading', $elements ) )
2220
- $show_heading = true;
 
 
2221
 
2222
- if ( ( $elements == 'all' || in_array( 'filters', $elements ) ) && $options['type'] !== 'carousel' )
2223
- $show_filters = true;
 
2224
 
2225
- if ( $options['type'] == 'carousel' && in_array( 'arrows', $carousel_elements ) )
2226
- $show_carousel_arrows = true;
 
 
 
2227
 
2228
- if ( $show_heading || $show_filters || $show_carousel_arrows )
2229
- $show_header = true;
2230
 
2231
- /**
2232
- * Link or not
2233
- */
2234
 
2235
- $link_to_single = true;
2236
- if ( $options['link'] == 'disabled' )
2237
- $link_to_single = false;
2238
 
2239
- /**
2240
- * Carousel Items
2241
- */
2242
 
2243
- switch ( $options['columns'] ) {
2244
- case 12 :
2245
- $carousel_items = 1;
2246
- break;
2247
- case 6 :
2248
- $carousel_items = 2;
2249
- break;
2250
- case 4 :
2251
- $carousel_items = 3;
2252
- break;
2253
- case 3 :
2254
- $carousel_items = 4;
2255
- break;
2256
- case 2 :
2257
- $carousel_items = 6;
2258
- break;
2259
- default:
2260
- $carousel_items = 6;
2261
- break;
2262
- }
2263
 
2264
- /**
2265
- * Heading ( output )
2266
- */
2267
 
2268
- if ( $show_header ) :
2269
- ?>
2270
- <div class="dslc-module-heading">
2271
 
2272
- <!-- Heading -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2273
 
2274
- <?php if ( $show_heading ) : ?>
 
 
2275
 
2276
- <h2 class="dslca-editable-content" data-id="main_heading_title" data-type="simple" <?php if ( $dslc_is_admin ) echo 'contenteditable'; ?> ><?php echo stripslashes( $options['main_heading_title'] ); ?></h2>
 
 
2277
 
2278
- <!-- View all -->
2279
 
2280
- <?php if ( isset( $options['view_all_link'] ) && $options['view_all_link'] !== '' ) : ?>
2281
 
2282
- <span class="dslc-module-heading-view-all"><a href="<?php echo $options['view_all_link']; ?>" class="dslca-editable-content" data-id="main_heading_link_title" data-type="simple" <?php if ( $dslc_is_admin ) echo 'contenteditable'; ?> ><?php echo $options['main_heading_link_title']; ?></a></span>
2283
 
2284
- <?php endif; ?>
 
 
 
 
2285
 
2286
  <?php endif; ?>
2287
 
2288
- <!-- Filters -->
2289
 
2290
- <?php
2291
 
2292
- if ( $show_filters ) {
2293
 
2294
- $cats_array = array();
2295
 
2296
- if ( $dslc_query->have_posts() ) {
2297
 
2298
- while ( $dslc_query->have_posts() ) {
2299
 
2300
- $dslc_query->the_post();
2301
 
2302
- $post_cats = get_the_terms( get_the_ID(), 'dslc_staff_cats' );
2303
- if ( ! empty( $post_cats ) ) {
2304
- foreach ( $post_cats as $post_cat ) {
2305
- $cats_array[$post_cat->slug] = $post_cat->name;
2306
- }
2307
- }
2308
 
 
 
 
 
 
2309
  }
2310
 
2311
  }
2312
 
2313
- ?>
2314
 
2315
- <div class="dslc-post-filters">
2316
- <span class="dslc-post-filter dslc-active dslca-editable-content" data-filter-id="show-all" <?php if ( $dslc_is_admin ){ echo 'data-id="main_filter_title_all" data-type="simple" contenteditable '; } ?>><?php echo $options['main_filter_title_all']; ?></span>
2317
 
2318
- <?php foreach ( $cats_array as $cat_slug => $cat_name ) : ?>
2319
- <span class="dslc-post-filter dslc-inactive" data-filter-id="<?php echo $cat_slug; ?>"><?php echo $cat_name; ?></span>
2320
- <?php endforeach; ?>
2321
 
2322
- </div><!-- .dslc-post-filters -->
 
 
2323
 
2324
- <?php
2325
 
2326
- }
2327
 
2328
- ?>
2329
 
2330
- <!-- Carousel -->
2331
 
2332
- <?php if ( $show_carousel_arrows ) : ?>
2333
- <span class="dslc-carousel-nav fr">
2334
- <span class="dslc-carousel-nav-inner">
2335
- <a href="#" class="dslc-carousel-nav-prev"><span class="dslc-icon-chevron-left"></span></a>
2336
- <a href="#" class="dslc-carousel-nav-next"><span class="dslc-icon-chevron-right"></span></a>
2337
- </span>
2338
- </span><!-- .carousel-nav -->
2339
- <?php endif; ?>
2340
 
2341
- </div><!-- .dslc-module-heading -->
2342
- <?php
 
 
 
 
 
 
2343
 
2344
- endif;
 
2345
 
2346
- /**
2347
- * Posts ( output )
2348
- */
2349
 
2350
- if ( $dslc_query->have_posts() ) :
 
 
2351
 
2352
- ?><div class="<?php echo $container_class; ?>"><?php
2353
 
2354
- ?><div class="dslc-posts-inner"><?php
2355
 
2356
- if ( $options['type'] == 'carousel' ) :
2357
 
2358
- ?><div class="dslc-loader"></div><div class="dslc-carousel" data-stop-on-hover="<?php echo $options['carousel_autoplay_hover']; ?>" data-autoplay="<?php echo $options['carousel_autoplay']; ?>" data-columns="<?php echo $carousel_items; ?>" data-pagination="<?php if ( in_array( 'circles', $carousel_elements ) ) echo 'true'; else echo 'false'; ?>" data-slide-speed="<?php echo $options['arrows_slide_speed']; ?>" data-pagination-speed="<?php echo $options['circles_slide_speed']; ?>"><?php
2359
 
2360
- endif;
2361
 
2362
- while ( $dslc_query->have_posts() ) : $dslc_query->the_post(); $count += $increment; $real_count++;
2363
 
2364
- if ( $count == $max_count ) {
2365
- $count = 0;
2366
- $extra_class = ' dslc-last-col';
2367
- } elseif ( $count == $increment ) {
2368
- $extra_class = ' dslc-first-col';
2369
- } else {
2370
- $extra_class = '';
2371
- }
2372
 
2373
- if ( ! has_post_thumbnail() )
2374
- $extra_class .= ' dslc-post-no-thumb';
2375
-
2376
- $position = get_post_meta( get_the_ID(), 'dslc_staff_position', true );
2377
- $social_twitter = get_post_meta( get_the_ID(), 'dslc_staff_social_twitter', true );
2378
- $social_instagram = get_post_meta( get_the_ID(), 'dslc_staff_social_instagram', true );
2379
- $social_facebook = get_post_meta( get_the_ID(), 'dslc_staff_social_facebook', true );
2380
- $social_googleplus = get_post_meta( get_the_ID(), 'dslc_staff_social_googleplus', true );
2381
- $social_linkedin = get_post_meta( get_the_ID(), 'dslc_staff_social_linkedin', true );
2382
- $social_email = get_post_meta( get_the_ID(), 'dslc_staff_social_email', true );
2383
-
2384
- $post_cats = get_the_terms( get_the_ID(), 'dslc_staff_cats' );
2385
- $post_cats_data = '';
2386
- if ( ! empty( $post_cats ) ) {
2387
- foreach ( $post_cats as $post_cat ) {
2388
- $post_cats_data .= $post_cat->slug . ' ';
2389
- }
2390
- }
2391
 
2392
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2393
 
2394
- <div class="<?php echo $element_class . $columns_class . $extra_class; ?>" data-cats="<?php echo $post_cats_data; ?>">
2395
 
2396
- <?php if ( $post_elements == 'all' || in_array( 'thumbnail', $post_elements ) ) : ?>
2397
 
2398
- <?php
2399
- /**
2400
- * Manual Resize
2401
- */
2402
 
2403
- $manual_resize = false;
2404
- if ( isset( $options['thumb_resize_height'] ) && ! empty( $options['thumb_resize_height'] ) || isset( $options['thumb_resize_width_manual'] ) && ! empty( $options['thumb_resize_width_manual'] ) ) {
 
 
2405
 
2406
- $manual_resize = true;
2407
- $thumb_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
2408
- $thumb_url = $thumb_url[0];
2409
 
2410
- $thumb_alt = get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true );
2411
- if ( ! $thumb_alt ) $thumb_alt = '';
 
2412
 
2413
- $resize_width = false;
2414
- $resize_height = false;
2415
 
2416
- if ( isset( $options['thumb_resize_width_manual'] ) && ! empty( $options['thumb_resize_width_manual'] ) ) {
2417
- $resize_width = $options['thumb_resize_width_manual'];
2418
- }
2419
 
2420
- if ( isset( $options['thumb_resize_height'] ) && ! empty( $options['thumb_resize_height'] ) ) {
2421
- $resize_height = $options['thumb_resize_height'];
2422
- }
2423
 
 
 
2424
  }
2425
- ?>
2426
 
2427
- <?php if ( has_post_thumbnail() ) : ?>
 
2428
 
2429
- <div class="dslc-post-thumb dslc-staff-member-thumb dslc-on-hover-anim">
2430
 
2431
- <div class="dslc-staff-member-thumb-inner dslca-post-thumb">
2432
- <?php if ( $manual_resize ) : ?>
2433
- <?php if ( $link_to_single ) : ?>
2434
- <a href="<?php the_permalink(); ?>"><img src="<?php $res_img = dslc_aq_resize( $thumb_url, $resize_width, $resize_height, true ); echo $res_img; ?>" alt="<?php echo $thumb_alt; ?>" /></a>
2435
- <?php else : ?>
2436
- <img src="<?php $res_img = dslc_aq_resize( $thumb_url, $resize_width, $resize_height, true ); echo $res_img; ?>" alt="<?php echo $thumb_alt; ?>" />
2437
- <?php endif; ?>
2438
  <?php else : ?>
2439
- <?php if ( $link_to_single ) : ?>
2440
- <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( 'full' ); ?></a>
2441
- <?php else : ?>
2442
- <?php the_post_thumbnail( 'full' ); ?>
2443
- <?php endif; ?>
2444
  <?php endif; ?>
2445
- </div>
2446
-
2447
- <?php if ( ( $options['main_location'] == 'inside' || $options['main_location'] == 'inside_visible' ) && ( $post_elements == 'all' || in_array( 'title', $post_elements ) || in_array( 'position', $post_elements ) || in_array( 'excerpt', $post_elements ) ) ) : ?>
 
 
 
 
 
2448
 
2449
- <div class="dslc-staff-member-main dslc-init-<?php echo $options['main_position']; ?> <?php if ( $options['main_location'] == 'inside_visible' ) echo 'dslc-staff-member-main-visible'; ?> dslc-on-hover-anim-target dslc-anim-<?php echo $options['css_anim_hover']; ?>" data-dslc-anim="<?php echo $options['css_anim_hover'] ?>" data-dslc-anim-speed="<?php echo $options['css_anim_speed']; ?>">
2450
 
2451
- <div class="dslc-staff-member-main-inner dslc-init-target">
2452
 
2453
- <?php if ( $post_elements == 'all' || in_array( 'title', $post_elements ) ) : ?>
2454
 
2455
- <div class="dslc-staff-member-title">
2456
- <?php if ( $link_to_single ) : ?>
2457
- <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
2458
- <?php else : ?>
2459
- <h2><?php the_title(); ?></h2>
2460
- <?php endif; ?>
2461
- </div><!-- .dslc-staff-member-title -->
2462
 
2463
- <?php endif; ?>
 
 
 
 
 
 
2464
 
2465
- <?php if ( $post_elements == 'all' || in_array( 'position', $post_elements ) ) : ?>
2466
 
2467
- <div class="dslc-staff-member-position">
2468
- <?php echo $position; ?>
2469
- </div><!-- .dslc-staff-member-position -->
2470
 
2471
- <?php endif; ?>
 
 
2472
 
2473
- <?php if ( $post_elements == 'all' || in_array( 'excerpt', $post_elements ) ) : ?>
2474
 
2475
- <div class="dslc-staff-member-excerpt">
2476
- <?php if ( $options['excerpt_or_content'] == 'content' ) : ?>
2477
- <?php
 
 
 
 
 
 
 
 
 
 
2478
  if ( $options['excerpt_length'] > 0 ) {
2479
- echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
 
 
 
2480
  } else {
2481
- echo get_the_content();
 
 
 
2482
  }
2483
- ?>
2484
- <?php else : ?>
2485
- <?php
2486
- if ( $options['excerpt_length'] > 0 ) {
2487
- if ( has_excerpt() )
2488
- echo wp_trim_words( get_the_excerpt(), $options['excerpt_length'] );
2489
- else
2490
- echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2491
- } else {
2492
- if ( has_excerpt() )
2493
- echo get_the_excerpt();
2494
- else
2495
- echo get_the_content();
2496
- }
2497
- ?>
2498
- <?php endif; ?>
2499
- </div><!-- .dslc-staff-member-excerpt -->
2500
-
2501
- <?php endif; ?>
2502
-
2503
- </div><!-- .dslc-staff-member-main -->
2504
-
2505
- <?php if ( $link_to_single ) : ?>
2506
- <a href="<?php the_permalink(); ?>" class="dslc-post-main-inner-link-cover"></a>
2507
  <?php endif; ?>
2508
 
2509
  </div><!-- .dslc-staff-member-main -->
2510
 
2511
- <?php endif; ?>
 
 
2512
 
2513
- </div><!-- .dslc-staff-member-thumb -->
2514
 
2515
- <?php endif; ?>
 
 
2516
 
2517
  <?php endif; ?>
2518
 
2519
- <?php if ( $post_elements == 'all' || in_array( 'social', $post_elements ) ) : ?>
2520
 
2521
- <?php if ( $social_twitter || $social_instagram || $social_facebook || $social_googleplus || $social_linkedin || $social_email ) : ?>
2522
 
2523
- <div class="dslc-staff-member-social">
2524
 
2525
- <?php if ( $social_twitter ) : ?>
2526
- <a target="<?php echo $options['social_link_target']; ?>" href="<?php echo $social_twitter; ?>"><span class="dslc-icon dslc-icon-twitter"></span></a>
2527
- <?php endif; ?>
2528
 
2529
- <?php if ( $social_instagram ) : ?>
2530
- <a target="<?php echo $options['social_link_target']; ?>" href="<?php echo $social_instagram; ?>"><span class="dslc-icon dslc-icon-instagram"></span></a>
2531
- <?php endif; ?>
2532
 
2533
- <?php if ( $social_facebook ) : ?>
2534
- <a target="<?php echo $options['social_link_target']; ?>" href="<?php echo $social_facebook; ?>"><span class="dslc-icon dslc-icon-facebook"></span></a>
2535
- <?php endif; ?>
2536
 
2537
- <?php if ( $social_googleplus ) : ?>
2538
- <a target="<?php echo $options['social_link_target']; ?>" href="<?php echo $social_googleplus; ?>"><span class="dslc-icon dslc-icon-google-plus"></span></a>
2539
- <?php endif; ?>
2540
 
2541
- <?php if ( $social_linkedin ) : ?>
2542
- <a target="<?php echo $options['social_link_target']; ?>" href="<?php echo $social_linkedin; ?>"><span class="dslc-icon dslc-icon-linkedin"></span></a>
2543
- <?php endif; ?>
2544
 
2545
- <?php if ( $social_email ) : ?>
2546
- <a target="<?php echo $options['social_link_target']; ?>" href="<?php echo $social_email; ?>"><span class="dslc-icon dslc-icon-envelope"></span></a>
2547
- <?php endif; ?>
2548
 
2549
- </div><!-- .dslc-staff-member-social -->
 
 
2550
 
2551
- <?php endif; ?>
2552
 
2553
  <?php endif; ?>
2554
 
2555
- <?php if ( $options['main_location'] == 'bellow' && ( $post_elements == 'all' || in_array( 'title', $post_elements ) || in_array( 'position', $post_elements ) || in_array( 'excerpt', $post_elements ) ) ) : ?>
2556
 
2557
- <div class="dslc-staff-member-main">
2558
 
2559
- <?php if ( $post_elements == 'all' || in_array( 'title', $post_elements ) ) : ?>
2560
 
2561
- <div class="dslc-staff-member-title">
2562
- <?php if ( $link_to_single ) : ?>
2563
- <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
2564
- <?php else : ?>
2565
- <h2><?php the_title(); ?></h2>
2566
- <?php endif; ?>
2567
- </div><!-- .dslc-staff-member-title -->
2568
 
2569
- <?php endif; ?>
 
 
 
 
 
 
2570
 
2571
- <?php if ( $post_elements == 'all' || in_array( 'position', $post_elements ) ) : ?>
2572
 
2573
- <div class="dslc-staff-member-position">
2574
- <?php echo $position; ?>
2575
- </div><!-- .dslc-staff-member-position -->
2576
 
2577
- <?php endif; ?>
 
 
2578
 
2579
- <?php if ( $post_elements == 'all' || in_array( 'excerpt', $post_elements ) ) : ?>
2580
 
2581
- <div class="dslc-staff-member-excerpt">
2582
- <?php if ( $options['excerpt_or_content'] == 'content' ) : ?>
2583
- <?php
 
 
 
 
 
 
 
 
 
 
2584
  if ( $options['excerpt_length'] > 0 ) {
2585
- echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
 
 
 
2586
  } else {
2587
- echo get_the_content();
 
 
 
2588
  }
2589
- ?>
2590
- <?php else : ?>
2591
- <?php
2592
- if ( $options['excerpt_length'] > 0 ) {
2593
- if ( has_excerpt() )
2594
- echo wp_trim_words( get_the_excerpt(), $options['excerpt_length'] );
2595
- else
2596
- echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2597
- } else {
2598
- if ( has_excerpt() )
2599
- echo get_the_excerpt();
2600
- else
2601
- echo get_the_content();
2602
- }
2603
- ?>
2604
- <?php endif; ?>
2605
- </div><!-- .dslc-staff-member-excerpt -->
2606
-
2607
- <?php endif; ?>
2608
 
2609
- </div><!-- .dslc-staff-member-main -->
2610
 
2611
- <?php endif; ?>
2612
 
2613
- </div><!-- .dslc-staff-member -->
2614
 
2615
- <?php
2616
 
2617
- // Row Separator.
2618
- if ( 'grid' === $options['type'] && $count == 0 && $real_count != $dslc_query->found_posts && $real_count != $options['amount'] && $options['separator_enabled'] == 'enabled' ) {
2619
- echo '<div class="dslc-post-separator"></div>';
2620
- }
2621
 
2622
- endwhile;
 
 
 
2623
 
2624
- if ( 'carousel' === $options['type'] ) :
2625
 
2626
- ?></div><?php
2627
 
2628
- endif;
2629
 
2630
- ?></div><!-- .dslc-posts-inner --><?php
2631
 
2632
- ?></div><?php
2633
 
2634
- else :
2635
 
2636
- if ( $dslc_is_admin ) :
2637
- ?><div class="dslc-notification dslc-red"><?php _e( 'You do not have staff at the moment. Go to <strong>WP Admin &rarr; Staff</strong> to add some.', 'live-composer-page-builder' ); ?> <span class="dslca-refresh-module-hook dslc-icon dslc-icon-refresh"></span></span></div><?php
2638
- endif;
2639
 
 
 
2640
  endif;
2641
 
2642
- /**
2643
- * Pagination
2644
- */
 
 
2645
 
2646
- if ( isset( $options['pagination_type'] ) && $options['pagination_type'] != 'disabled' ) {
2647
- $num_pages = $dslc_query->max_num_pages;
2648
- if ( $options['offset'] > 0 ) {
2649
- $num_pages = ceil( ( $dslc_query->found_posts - $options['offset'] ) / $options['amount'] );
2650
- }
2651
- dslc_post_pagination( array('pages' => $num_pages, 'type' => $options['pagination_type']) );
2652
  }
 
 
2653
 
2654
- wp_reset_postdata();
2655
 
 
 
2656
 
2657
- }
2658
- }
 
2064
  * @return void
2065
  */
2066
  function output( $options ) {
2067
+ ?>
2068
+ [dslc_module_staff_output]<?php echo serialize($options); ?>[/dslc_module_staff_output]
2069
+ <?php
2070
 
2071
+ }
2072
+ }
2073
 
2074
+ function dslc_module_staff_output ( $atts, $content = null ) {
2075
+ // Uncode module options passed as serialized content.
2076
+ $options = unserialize( $content );
 
2077
 
2078
+ ob_start();
2079
 
2080
+ global $dslc_active;
2081
 
2082
+ if ( $dslc_active && is_user_logged_in() && current_user_can( DS_LIVE_COMPOSER_CAPABILITY ) )
2083
+ $dslc_is_admin = true;
2084
+ else
2085
+ $dslc_is_admin = false;
2086
 
 
2087
 
2088
+ /* Module output stars here */
 
2089
 
2090
+ if ( ! isset( $options['excerpt_length'] ) ) $options['excerpt_length'] = 20;
 
 
2091
 
2092
+ if ( is_front_page() ) { $paged = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1; } else { $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; }
 
 
 
 
 
 
2093
 
2094
+ // Fix for pagination from other modules affecting this one when pag disabled.
2095
+ if ( $options['pagination_type'] == 'disabled' ) $paged = 1;
 
 
2096
 
2097
+ // Fix for offset braking pagination.
2098
+ $query_offset = $options['offset'];
2099
+ if ( $query_offset > 0 && $paged > 1 ) $query_offset = ( $paged - 1 ) * $options['amount'] + $options['offset'];
2100
 
2101
+ $args = array(
2102
+ 'paged' => $paged,
2103
+ 'post_type' => 'dslc_staff',
2104
+ 'posts_per_page' => $options['amount'],
2105
+ 'order' => $options['order'],
2106
+ 'orderby' => $options['orderby'],
2107
+ );
2108
 
2109
+ // Add offset.
2110
+ if ( $query_offset > 0 ) {
2111
+ $args['offset'] = $query_offset;
2112
+ }
2113
 
2114
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
2115
+ $args['post_status'] = array('publish', 'private');
2116
+ }
 
 
 
 
 
2117
 
2118
+ if ( isset( $options['categories'] ) && $options['categories'] != '' ) {
2119
 
2120
+ $cats_array = explode( ' ', trim( $options['categories'] ) );
 
 
2121
 
2122
+ $args['tax_query'] = array(
2123
+ array(
2124
+ 'taxonomy' => 'dslc_staff_cats',
2125
+ 'field' => 'slug',
2126
+ 'terms' => $cats_array,
2127
+ 'operator' => $options['categories_operator'],
2128
+ ),
2129
+ );
2130
 
2131
+ }
 
 
2132
 
2133
+ // Exlcude and Include arrays.
2134
+ $exclude = array();
2135
+ $include = array();
2136
 
2137
+ // Exclude current post.
2138
+ if ( is_singular( get_post_type() ) )
2139
+ $exclude[] = get_the_ID();
2140
 
2141
+ // Exclude posts ( option ).
2142
+ if ( $options['query_post_not_in'] )
2143
+ $exclude = array_merge( $exclude, explode( ' ', $options['query_post_not_in'] ) );
2144
 
2145
+ // Include posts ( option ).
2146
+ if ( $options['query_post_in'] )
2147
+ $include = array_merge( $include, explode( ' ', $options['query_post_in'] ) );
2148
 
2149
+ // Include query parameter.
2150
+ if ( ! empty( $include ) )
2151
+ $args['post__in'] = $include;
 
 
 
 
2152
 
2153
+ // Exclude query parameter.
2154
+ if ( ! empty( $exclude ) )
2155
+ $args['post__not_in'] = $exclude;
 
 
2156
 
2157
+ // No paging.
2158
+ if ( 'disabled' === $options['pagination_type'] )
2159
+ $args['no_found_rows'] = true;
2160
 
2161
+ // Do the query.
2162
+ if ( is_category() || is_tax() || is_search() ) {
2163
+ global $wp_query;
2164
+ $dslc_query = $wp_query;
2165
+ } else {
2166
+ $dslc_query = new WP_Query( $args );
2167
+ }
2168
 
2169
+ $columns_class = 'dslc-col dslc-' . $options['columns'] . '-col ';
2170
+ $count = 0;
2171
+ $real_count = 0;
2172
+ $increment = $options['columns'];
2173
+ $max_count = 12;
2174
 
2175
+ /**
2176
+ * Elements to show
2177
+ */
 
 
 
2178
 
2179
+ // Main Elements.
2180
+ $elements = $options['elements'];
2181
+ if ( ! empty( $elements ) )
2182
+ $elements = explode( ' ', trim( $elements ) );
2183
+ else
2184
+ $elements = array();
2185
 
 
2186
 
2187
+ // Post Elements.
2188
+ $post_elements = $options['post_elements'];
2189
+ if ( ! empty( $post_elements ) )
2190
+ $post_elements = explode( ' ', trim( $post_elements ) );
2191
+ else
2192
+ $post_elements = 'all';
2193
 
2194
+ // Carousel Elements.
2195
+ $carousel_elements = $options['carousel_elements'];
2196
+ if ( ! empty( $carousel_elements ) )
2197
+ $carousel_elements = explode( ' ', trim( $carousel_elements ) );
2198
+ else
2199
+ $carousel_elements = array();
2200
 
2201
+ /* Container Class */
2202
 
2203
+ $container_class = 'dslc-posts dslc-staff dslc-clearfix ';
2204
 
2205
+ if ( $options['type'] == 'masonry' )
2206
+ $container_class .= 'dslc-init-masonry ';
2207
+ elseif ( $options['type'] == 'carousel' )
2208
+ $container_class .= 'dslc-init-carousel ';
2209
+ elseif ( $options['type'] == 'grid' )
2210
+ $container_class .= 'dslc-init-grid ';
2211
 
2212
+ /* Element Class */
 
 
2213
 
2214
+ $element_class = 'dslc-post dslc-staff-member ';
 
 
 
 
2215
 
2216
+ if ( $options['type'] == 'masonry' )
2217
+ $element_class .= 'dslc-masonry-item ';
2218
+ elseif ( $options['type'] == 'carousel' )
2219
+ $element_class .= 'dslc-carousel-item ';
2220
 
2221
+ /**
2222
+ * What is shown
2223
+ */
2224
 
2225
+ $show_header = false;
2226
+ $show_heading = false;
2227
+ $show_filters = false;
2228
+ $show_carousel_arrows = false;
2229
+ $show_view_all_link = false;
2230
 
2231
+ if ( in_array( 'main_heading', $elements ) )
2232
+ $show_heading = true;
2233
 
2234
+ if ( ( $elements == 'all' || in_array( 'filters', $elements ) ) && $options['type'] !== 'carousel' )
2235
+ $show_filters = true;
 
2236
 
2237
+ if ( $options['type'] == 'carousel' && in_array( 'arrows', $carousel_elements ) )
2238
+ $show_carousel_arrows = true;
 
2239
 
2240
+ if ( $show_heading || $show_filters || $show_carousel_arrows )
2241
+ $show_header = true;
 
2242
 
2243
+ /**
2244
+ * Link or not
2245
+ */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2246
 
2247
+ $link_to_single = true;
2248
+ if ( $options['link'] == 'disabled' )
2249
+ $link_to_single = false;
2250
 
2251
+ /**
2252
+ * Carousel Items
2253
+ */
2254
 
2255
+ switch ( $options['columns'] ) {
2256
+ case 12 :
2257
+ $carousel_items = 1;
2258
+ break;
2259
+ case 6 :
2260
+ $carousel_items = 2;
2261
+ break;
2262
+ case 4 :
2263
+ $carousel_items = 3;
2264
+ break;
2265
+ case 3 :
2266
+ $carousel_items = 4;
2267
+ break;
2268
+ case 2 :
2269
+ $carousel_items = 6;
2270
+ break;
2271
+ default:
2272
+ $carousel_items = 6;
2273
+ break;
2274
+ }
2275
 
2276
+ /**
2277
+ * Heading ( output )
2278
+ */
2279
 
2280
+ if ( $show_header ) :
2281
+ ?>
2282
+ <div class="dslc-module-heading">
2283
 
2284
+ <!-- Heading -->
2285
 
2286
+ <?php if ( $show_heading ) : ?>
2287
 
2288
+ <h2 class="dslca-editable-content" data-id="main_heading_title" data-type="simple" <?php if ( $dslc_is_admin ) echo 'contenteditable'; ?> ><?php echo stripslashes( $options['main_heading_title'] ); ?></h2>
2289
 
2290
+ <!-- View all -->
2291
+
2292
+ <?php if ( isset( $options['view_all_link'] ) && $options['view_all_link'] !== '' ) : ?>
2293
+
2294
+ <span class="dslc-module-heading-view-all"><a href="<?php echo $options['view_all_link']; ?>" class="dslca-editable-content" data-id="main_heading_link_title" data-type="simple" <?php if ( $dslc_is_admin ) echo 'contenteditable'; ?> ><?php echo $options['main_heading_link_title']; ?></a></span>
2295
 
2296
  <?php endif; ?>
2297
 
2298
+ <?php endif; ?>
2299
 
2300
+ <!-- Filters -->
2301
 
2302
+ <?php
2303
 
2304
+ if ( $show_filters ) {
2305
 
2306
+ $cats_array = array();
2307
 
2308
+ if ( $dslc_query->have_posts() ) {
2309
 
2310
+ while ( $dslc_query->have_posts() ) {
2311
 
2312
+ $dslc_query->the_post();
 
 
 
 
 
2313
 
2314
+ $post_cats = get_the_terms( get_the_ID(), 'dslc_staff_cats' );
2315
+ if ( ! empty( $post_cats ) ) {
2316
+ foreach ( $post_cats as $post_cat ) {
2317
+ $cats_array[$post_cat->slug] = $post_cat->name;
2318
+ }
2319
  }
2320
 
2321
  }
2322
 
2323
+ }
2324
 
2325
+ ?>
 
2326
 
2327
+ <div class="dslc-post-filters">
2328
+ <span class="dslc-post-filter dslc-active dslca-editable-content" data-filter-id="show-all" <?php if ( $dslc_is_admin ){ echo 'data-id="main_filter_title_all" data-type="simple" contenteditable '; } ?>><?php echo $options['main_filter_title_all']; ?></span>
 
2329
 
2330
+ <?php foreach ( $cats_array as $cat_slug => $cat_name ) : ?>
2331
+ <span class="dslc-post-filter dslc-inactive" data-filter-id="<?php echo $cat_slug; ?>"><?php echo $cat_name; ?></span>
2332
+ <?php endforeach; ?>
2333
 
2334
+ </div><!-- .dslc-post-filters -->
2335
 
2336
+ <?php
2337
 
2338
+ }
2339
 
2340
+ ?>
2341
 
2342
+ <!-- Carousel -->
 
 
 
 
 
 
 
2343
 
2344
+ <?php if ( $show_carousel_arrows ) : ?>
2345
+ <span class="dslc-carousel-nav fr">
2346
+ <span class="dslc-carousel-nav-inner">
2347
+ <a href="#" class="dslc-carousel-nav-prev"><span class="dslc-icon-chevron-left"></span></a>
2348
+ <a href="#" class="dslc-carousel-nav-next"><span class="dslc-icon-chevron-right"></span></a>
2349
+ </span>
2350
+ </span><!-- .carousel-nav -->
2351
+ <?php endif; ?>
2352
 
2353
+ </div><!-- .dslc-module-heading -->
2354
+ <?php
2355
 
2356
+ endif;
 
 
2357
 
2358
+ /**
2359
+ * Posts ( output )
2360
+ */
2361
 
2362
+ if ( $dslc_query->have_posts() ) :
2363
 
2364
+ ?><div class="<?php echo $container_class; ?>"><?php
2365
 
2366
+ ?><div class="dslc-posts-inner"><?php
2367
 
2368
+ if ( $options['type'] == 'carousel' ) :
2369
 
2370
+ ?><div class="dslc-loader"></div><div class="dslc-carousel" data-stop-on-hover="<?php echo $options['carousel_autoplay_hover']; ?>" data-autoplay="<?php echo $options['carousel_autoplay']; ?>" data-columns="<?php echo $carousel_items; ?>" data-pagination="<?php if ( in_array( 'circles', $carousel_elements ) ) echo 'true'; else echo 'false'; ?>" data-slide-speed="<?php echo $options['arrows_slide_speed']; ?>" data-pagination-speed="<?php echo $options['circles_slide_speed']; ?>"><?php
2371
 
2372
+ endif;
2373
 
2374
+ while ( $dslc_query->have_posts() ) : $dslc_query->the_post(); $count += $increment; $real_count++;
 
 
 
 
 
 
 
2375
 
2376
+ if ( $count == $max_count ) {
2377
+ $count = 0;
2378
+ $extra_class = ' dslc-last-col';
2379
+ } elseif ( $count == $increment ) {
2380
+ $extra_class = ' dslc-first-col';
2381
+ } else {
2382
+ $extra_class = '';
2383
+ }
 
 
 
 
 
 
 
 
 
 
2384
 
2385
+ if ( ! has_post_thumbnail() )
2386
+ $extra_class .= ' dslc-post-no-thumb';
2387
+
2388
+ $position = get_post_meta( get_the_ID(), 'dslc_staff_position', true );
2389
+ $social_twitter = get_post_meta( get_the_ID(), 'dslc_staff_social_twitter', true );
2390
+ $social_instagram = get_post_meta( get_the_ID(), 'dslc_staff_social_instagram', true );
2391
+ $social_facebook = get_post_meta( get_the_ID(), 'dslc_staff_social_facebook', true );
2392
+ $social_googleplus = get_post_meta( get_the_ID(), 'dslc_staff_social_googleplus', true );
2393
+ $social_linkedin = get_post_meta( get_the_ID(), 'dslc_staff_social_linkedin', true );
2394
+ $social_email = get_post_meta( get_the_ID(), 'dslc_staff_social_email', true );
2395
+
2396
+ $post_cats = get_the_terms( get_the_ID(), 'dslc_staff_cats' );
2397
+ $post_cats_data = '';
2398
+ if ( ! empty( $post_cats ) ) {
2399
+ foreach ( $post_cats as $post_cat ) {
2400
+ $post_cats_data .= $post_cat->slug . ' ';
2401
+ }
2402
+ }
2403
 
2404
+ ?>
2405
 
2406
+ <div class="<?php echo $element_class . $columns_class . $extra_class; ?>" data-cats="<?php echo $post_cats_data; ?>">
2407
 
2408
+ <?php if ( $post_elements == 'all' || in_array( 'thumbnail', $post_elements ) ) : ?>
 
 
 
2409
 
2410
+ <?php
2411
+ /**
2412
+ * Manual Resize
2413
+ */
2414
 
2415
+ $manual_resize = false;
2416
+ if ( isset( $options['thumb_resize_height'] ) && ! empty( $options['thumb_resize_height'] ) || isset( $options['thumb_resize_width_manual'] ) && ! empty( $options['thumb_resize_width_manual'] ) ) {
 
2417
 
2418
+ $manual_resize = true;
2419
+ $thumb_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
2420
+ $thumb_url = $thumb_url[0];
2421
 
2422
+ $thumb_alt = get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true );
2423
+ if ( ! $thumb_alt ) $thumb_alt = '';
2424
 
2425
+ $resize_width = false;
2426
+ $resize_height = false;
 
2427
 
2428
+ if ( isset( $options['thumb_resize_width_manual'] ) && ! empty( $options['thumb_resize_width_manual'] ) ) {
2429
+ $resize_width = $options['thumb_resize_width_manual'];
2430
+ }
2431
 
2432
+ if ( isset( $options['thumb_resize_height'] ) && ! empty( $options['thumb_resize_height'] ) ) {
2433
+ $resize_height = $options['thumb_resize_height'];
2434
  }
 
2435
 
2436
+ }
2437
+ ?>
2438
 
2439
+ <?php if ( has_post_thumbnail() ) : ?>
2440
 
2441
+ <div class="dslc-post-thumb dslc-staff-member-thumb dslc-on-hover-anim">
2442
+
2443
+ <div class="dslc-staff-member-thumb-inner dslca-post-thumb">
2444
+ <?php if ( $manual_resize ) : ?>
2445
+ <?php if ( $link_to_single ) : ?>
2446
+ <a href="<?php the_permalink(); ?>"><img src="<?php $res_img = dslc_aq_resize( $thumb_url, $resize_width, $resize_height, true ); echo $res_img; ?>" alt="<?php echo $thumb_alt; ?>" /></a>
 
2447
  <?php else : ?>
2448
+ <img src="<?php $res_img = dslc_aq_resize( $thumb_url, $resize_width, $resize_height, true ); echo $res_img; ?>" alt="<?php echo $thumb_alt; ?>" />
 
 
 
 
2449
  <?php endif; ?>
2450
+ <?php else : ?>
2451
+ <?php if ( $link_to_single ) : ?>
2452
+ <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( 'full' ); ?></a>
2453
+ <?php else : ?>
2454
+ <?php the_post_thumbnail( 'full' ); ?>
2455
+ <?php endif; ?>
2456
+ <?php endif; ?>
2457
+ </div>
2458
 
2459
+ <?php if ( ( $options['main_location'] == 'inside' || $options['main_location'] == 'inside_visible' ) && ( $post_elements == 'all' || in_array( 'title', $post_elements ) || in_array( 'position', $post_elements ) || in_array( 'excerpt', $post_elements ) ) ) : ?>
2460
 
2461
+ <div class="dslc-staff-member-main dslc-init-<?php echo $options['main_position']; ?> <?php if ( $options['main_location'] == 'inside_visible' ) echo 'dslc-staff-member-main-visible'; ?> dslc-on-hover-anim-target dslc-anim-<?php echo $options['css_anim_hover']; ?>" data-dslc-anim="<?php echo $options['css_anim_hover'] ?>" data-dslc-anim-speed="<?php echo $options['css_anim_speed']; ?>">
2462
 
2463
+ <div class="dslc-staff-member-main-inner dslc-init-target">
2464
 
2465
+ <?php if ( $post_elements == 'all' || in_array( 'title', $post_elements ) ) : ?>
 
 
 
 
 
 
2466
 
2467
+ <div class="dslc-staff-member-title">
2468
+ <?php if ( $link_to_single ) : ?>
2469
+ <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
2470
+ <?php else : ?>
2471
+ <h2><?php the_title(); ?></h2>
2472
+ <?php endif; ?>
2473
+ </div><!-- .dslc-staff-member-title -->
2474
 
2475
+ <?php endif; ?>
2476
 
2477
+ <?php if ( $post_elements == 'all' || in_array( 'position', $post_elements ) ) : ?>
 
 
2478
 
2479
+ <div class="dslc-staff-member-position">
2480
+ <?php echo $position; ?>
2481
+ </div><!-- .dslc-staff-member-position -->
2482
 
2483
+ <?php endif; ?>
2484
 
2485
+ <?php if ( $post_elements == 'all' || in_array( 'excerpt', $post_elements ) ) : ?>
2486
+
2487
+ <div class="dslc-staff-member-excerpt">
2488
+ <?php if ( $options['excerpt_or_content'] == 'content' ) : ?>
2489
+ <?php
2490
+ if ( $options['excerpt_length'] > 0 ) {
2491
+ echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2492
+ } else {
2493
+ echo get_the_content();
2494
+ }
2495
+ ?>
2496
+ <?php else : ?>
2497
+ <?php
2498
  if ( $options['excerpt_length'] > 0 ) {
2499
+ if ( has_excerpt() )
2500
+ echo wp_trim_words( get_the_excerpt(), $options['excerpt_length'] );
2501
+ else
2502
+ echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2503
  } else {
2504
+ if ( has_excerpt() )
2505
+ echo get_the_excerpt();
2506
+ else
2507
+ echo get_the_content();
2508
  }
2509
+ ?>
2510
+ <?php endif; ?>
2511
+ </div><!-- .dslc-staff-member-excerpt -->
2512
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2513
  <?php endif; ?>
2514
 
2515
  </div><!-- .dslc-staff-member-main -->
2516
 
2517
+ <?php if ( $link_to_single ) : ?>
2518
+ <a href="<?php the_permalink(); ?>" class="dslc-post-main-inner-link-cover"></a>
2519
+ <?php endif; ?>
2520
 
2521
+ </div><!-- .dslc-staff-member-main -->
2522
 
2523
+ <?php endif; ?>
2524
+
2525
+ </div><!-- .dslc-staff-member-thumb -->
2526
 
2527
  <?php endif; ?>
2528
 
2529
+ <?php endif; ?>
2530
 
2531
+ <?php if ( $post_elements == 'all' || in_array( 'social', $post_elements ) ) : ?>
2532
 
2533
+ <?php if ( $social_twitter || $social_instagram || $social_facebook || $social_googleplus || $social_linkedin || $social_email ) : ?>
2534
 
2535
+ <div class="dslc-staff-member-social">
 
 
2536
 
2537
+ <?php if ( $social_twitter ) : ?>
2538
+ <a target="<?php echo $options['social_link_target']; ?>" href="<?php echo $social_twitter; ?>"><span class="dslc-icon dslc-icon-twitter"></span></a>
2539
+ <?php endif; ?>
2540
 
2541
+ <?php if ( $social_instagram ) : ?>
2542
+ <a target="<?php echo $options['social_link_target']; ?>" href="<?php echo $social_instagram; ?>"><span class="dslc-icon dslc-icon-instagram"></span></a>
2543
+ <?php endif; ?>
2544
 
2545
+ <?php if ( $social_facebook ) : ?>
2546
+ <a target="<?php echo $options['social_link_target']; ?>" href="<?php echo $social_facebook; ?>"><span class="dslc-icon dslc-icon-facebook"></span></a>
2547
+ <?php endif; ?>
2548
 
2549
+ <?php if ( $social_googleplus ) : ?>
2550
+ <a target="<?php echo $options['social_link_target']; ?>" href="<?php echo $social_googleplus; ?>"><span class="dslc-icon dslc-icon-google-plus"></span></a>
2551
+ <?php endif; ?>
2552
 
2553
+ <?php if ( $social_linkedin ) : ?>
2554
+ <a target="<?php echo $options['social_link_target']; ?>" href="<?php echo $social_linkedin; ?>"><span class="dslc-icon dslc-icon-linkedin"></span></a>
2555
+ <?php endif; ?>
2556
 
2557
+ <?php if ( $social_email ) : ?>
2558
+ <a target="<?php echo $options['social_link_target']; ?>" href="<?php echo $social_email; ?>"><span class="dslc-icon dslc-icon-envelope"></span></a>
2559
+ <?php endif; ?>
2560
 
2561
+ </div><!-- .dslc-staff-member-social -->
2562
 
2563
  <?php endif; ?>
2564
 
2565
+ <?php endif; ?>
2566
 
2567
+ <?php if ( $options['main_location'] == 'bellow' && ( $post_elements == 'all' || in_array( 'title', $post_elements ) || in_array( 'position', $post_elements ) || in_array( 'excerpt', $post_elements ) ) ) : ?>
2568
 
2569
+ <div class="dslc-staff-member-main">
2570
 
2571
+ <?php if ( $post_elements == 'all' || in_array( 'title', $post_elements ) ) : ?>
 
 
 
 
 
 
2572
 
2573
+ <div class="dslc-staff-member-title">
2574
+ <?php if ( $link_to_single ) : ?>
2575
+ <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
2576
+ <?php else : ?>
2577
+ <h2><?php the_title(); ?></h2>
2578
+ <?php endif; ?>
2579
+ </div><!-- .dslc-staff-member-title -->
2580
 
2581
+ <?php endif; ?>
2582
 
2583
+ <?php if ( $post_elements == 'all' || in_array( 'position', $post_elements ) ) : ?>
 
 
2584
 
2585
+ <div class="dslc-staff-member-position">
2586
+ <?php echo $position; ?>
2587
+ </div><!-- .dslc-staff-member-position -->
2588
 
2589
+ <?php endif; ?>
2590
 
2591
+ <?php if ( $post_elements == 'all' || in_array( 'excerpt', $post_elements ) ) : ?>
2592
+
2593
+ <div class="dslc-staff-member-excerpt">
2594
+ <?php if ( $options['excerpt_or_content'] == 'content' ) : ?>
2595
+ <?php
2596
+ if ( $options['excerpt_length'] > 0 ) {
2597
+ echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2598
+ } else {
2599
+ echo get_the_content();
2600
+ }
2601
+ ?>
2602
+ <?php else : ?>
2603
+ <?php
2604
  if ( $options['excerpt_length'] > 0 ) {
2605
+ if ( has_excerpt() )
2606
+ echo wp_trim_words( get_the_excerpt(), $options['excerpt_length'] );
2607
+ else
2608
+ echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2609
  } else {
2610
+ if ( has_excerpt() )
2611
+ echo get_the_excerpt();
2612
+ else
2613
+ echo get_the_content();
2614
  }
2615
+ ?>
2616
+ <?php endif; ?>
2617
+ </div><!-- .dslc-staff-member-excerpt -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2618
 
2619
+ <?php endif; ?>
2620
 
2621
+ </div><!-- .dslc-staff-member-main -->
2622
 
2623
+ <?php endif; ?>
2624
 
2625
+ </div><!-- .dslc-staff-member -->
2626
 
2627
+ <?php
 
 
 
2628
 
2629
+ // Row Separator.
2630
+ if ( 'grid' === $options['type'] && $count == 0 && $real_count != $dslc_query->found_posts && $real_count != $options['amount'] && $options['separator_enabled'] == 'enabled' ) {
2631
+ echo '<div class="dslc-post-separator"></div>';
2632
+ }
2633
 
2634
+ endwhile;
2635
 
2636
+ if ( 'carousel' === $options['type'] ) :
2637
 
2638
+ ?></div><?php
2639
 
2640
+ endif;
2641
 
2642
+ ?></div><!-- .dslc-posts-inner --><?php
2643
 
2644
+ ?></div><?php
2645
 
2646
+ else :
 
 
2647
 
2648
+ if ( $dslc_is_admin ) :
2649
+ ?><div class="dslc-notification dslc-red"><?php _e( 'You do not have staff at the moment. Go to <strong>WP Admin &rarr; Staff</strong> to add some.', 'live-composer-page-builder' ); ?> <span class="dslca-refresh-module-hook dslc-icon dslc-icon-refresh"></span></span></div><?php
2650
  endif;
2651
 
2652
+ endif;
2653
+
2654
+ /**
2655
+ * Pagination
2656
+ */
2657
 
2658
+ if ( isset( $options['pagination_type'] ) && $options['pagination_type'] != 'disabled' ) {
2659
+ $num_pages = $dslc_query->max_num_pages;
2660
+ if ( $options['offset'] > 0 ) {
2661
+ $num_pages = ceil( ( $dslc_query->found_posts - $options['offset'] ) / $options['amount'] );
 
 
2662
  }
2663
+ dslc_post_pagination( array('pages' => $num_pages, 'type' => $options['pagination_type']) );
2664
+ }
2665
 
2666
+ wp_reset_postdata();
2667
 
2668
+ $shortcode_rendered = ob_get_contents();
2669
+ ob_end_clean();
2670
 
2671
+ return $shortcode_rendered;
2672
+
2673
+ } add_shortcode( 'dslc_module_staff_output', 'dslc_module_staff_output' );
modules/testimonials/module.php CHANGED
@@ -1845,6 +1845,18 @@ class DSLC_Testimonials extends DSLC_Module {
1845
  * @return void
1846
  */
1847
  function output( $options ) {
 
 
 
 
 
 
 
 
 
 
 
 
1848
 
1849
  global $dslc_active;
1850
 
@@ -2258,5 +2270,10 @@ class DSLC_Testimonials extends DSLC_Module {
2258
  }
2259
 
2260
  wp_reset_postdata();
2261
- }
2262
- }
 
 
 
 
 
1845
  * @return void
1846
  */
1847
  function output( $options ) {
1848
+ ?>
1849
+ [dslc_module_testimonials_output]<?php echo serialize($options); ?>[/dslc_module_testimonials_output]
1850
+ <?php
1851
+
1852
+ }
1853
+ }
1854
+
1855
+ function dslc_module_testimonials_output ( $atts, $content = null ) {
1856
+ // Uncode module options passed as serialized content.
1857
+ $options = unserialize( $content );
1858
+
1859
+ ob_start();
1860
 
1861
  global $dslc_active;
1862
 
2270
  }
2271
 
2272
  wp_reset_postdata();
2273
+
2274
+ $shortcode_rendered = ob_get_contents();
2275
+ ob_end_clean();
2276
+
2277
+ return $shortcode_rendered;
2278
+
2279
+ } add_shortcode( 'dslc_module_testimonials_output', 'dslc_module_testimonials_output' );
modules/woocommerce/module.php CHANGED
@@ -2450,617 +2450,632 @@ class DSLC_WooCommerce_Products extends DSLC_Module {
2450
  * @return void
2451
  */
2452
  function output( $options ) {
 
 
 
2453
 
2454
- if ( is_feed() ) {
2455
- // Prevent category/tag feeds to stuck in an infinite loop
2456
- return false;
2457
- }
2458
 
2459
- global $dslc_active;
 
 
2460
 
2461
- if ( $dslc_active && is_user_logged_in() && current_user_can( DS_LIVE_COMPOSER_CAPABILITY ) )
2462
- $dslc_is_admin = true;
2463
- else
2464
- $dslc_is_admin = false;
2465
 
2466
- // Fix slashes on apostrophes
2467
- if ( isset( $options['addtocart_text'] ) ) {
2468
- $options['addtocart_text'] = stripslashes( $options['addtocart_text'] );
2469
- }
2470
-
2471
- // Fix slashes on apostrophes
2472
- if ( isset( $options['details_text'] ) ) {
2473
- $options['details_text'] = stripslashes( $options['details_text'] );
2474
- }
2475
 
 
2476
 
2477
- if ( ! isset( $options['price_pos'] ) )
2478
- $options['price_pos'] = 'center';
 
 
2479
 
2480
- if ( class_exists( 'Woocommerce' ) ) :
 
 
 
2481
 
2482
- /* Module output stars here */
 
 
 
2483
 
2484
- if ( is_front_page() ) { $paged = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1; } else { $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; }
2485
 
2486
- // Fix for pagination from other modules affecting this one when pag disabled
2487
- if ( $options['pagination_type'] == 'disabled' ) $paged = 1;
2488
 
2489
- // Fix for offset braking pagination
2490
- $query_offset = $options['offset'];
2491
- if ( $query_offset > 0 && $paged > 1 ) $query_offset = ( $paged - 1 ) * $options['amount'] + $options['offset'];
2492
 
2493
- $args = array(
2494
- 'paged' => $paged,
2495
- 'post_type' => 'product',
2496
- 'posts_per_page' => $options['amount'],
2497
- 'order' => $options['order'],
2498
- 'orderby' => $options['orderby'],
2499
- );
2500
 
2501
- // Add offset
2502
- if ( $query_offset > 0 ) {
2503
- $args['offset'] = $query_offset;
2504
- }
2505
-
2506
- if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
2507
- $args['post_status'] = array('publish', 'private');
2508
- }
2509
-
2510
- if ( isset( $options['categories'] ) && $options['categories'] != '' ) {
2511
-
2512
- $cats_array = explode( ' ', trim( $options['categories'] ) );
2513
-
2514
- $args['tax_query'] = array(
2515
- array(
2516
- 'taxonomy' => 'product_cat',
2517
- 'field' => 'slug',
2518
- 'terms' => $cats_array,
2519
- 'operator' => $options['categories_operator']
2520
- )
2521
- );
2522
-
2523
- }
2524
-
2525
- if ( $options['orderby'] == 'meta_value_num' ) {
2526
- $args['meta_key'] = '_price';
2527
- }
2528
-
2529
- // Exlcude and Include arrays
2530
- $exclude = array();
2531
- $include = array();
2532
-
2533
- // Exclude current post
2534
- if ( is_singular( get_post_type() ) )
2535
- $exclude[] = get_the_ID();
2536
-
2537
- // Exclude posts ( option )
2538
- if ( $options['query_post_not_in'] )
2539
- $exclude = array_merge( $exclude, explode( ' ', $options['query_post_not_in'] ) );
2540
-
2541
- // Include posts ( option )
2542
- if ( $options['query_post_in'] )
2543
- $include = array_merge( $include, explode( ' ', $options['query_post_in'] ) );
2544
-
2545
- // Include query parameter
2546
- if ( ! empty( $include ) )
2547
- $args['post__in'] = $include;
2548
-
2549
- // Exclude query parameter
2550
- if ( ! empty( $exclude ) )
2551
- $args['post__not_in'] = $exclude;
2552
-
2553
- // Author archive page
2554
- if ( is_author() && $options['query_alter'] == 'enabled' ) {
2555
- global $authordata;
2556
- $args['author__in'] = array($authordata->data->ID);
2557
- }
2558
-
2559
- // No paging
2560
- if ( $options['pagination_type'] == 'disabled' )
2561
- $args['no_found_rows'] = true;
2562
-
2563
- // Out of stock ( show/hide )
2564
- if ( $options['outofstock'] == 'disabled' ) {
2565
- $args['meta_query'] = array(
2566
- array(
2567
- 'key' => '_stock_status',
2568
- 'value' => 'outofstock',
2569
- 'compare' => '!=',
2570
- ),
2571
- );
2572
- }
2573
-
2574
- // Do the query
2575
- if ( ( is_category() || is_tag() || is_tax() || is_search() || is_date() ) && $options['query_alter'] == 'enabled' ) {
2576
- global $wp_query;
2577
- $dslc_query = $wp_query;
2578
- } else {
2579
- $dslc_query = new WP_Query( $args );
2580
- }
2581
-
2582
- $columns_class = 'dslc-col dslc-' . $options['columns'] . '-col ';
2583
- $count = 0;
2584
- $real_count = 0;
2585
- $increment = $options['columns'];
2586
- $max_count = 12;
2587
 
2588
- /**
2589
- * Elements to show
2590
- */
2591
 
2592
- // Main Elements
2593
- $elements = $options['elements'];
2594
- if ( ! empty( $elements ) )
2595
- $elements = explode( ' ', trim( $elements ) );
2596
- else
2597
- $elements = array();
2598
 
 
 
 
 
 
 
 
2599
 
2600
- // Post Elements
2601
- $post_elements = $options['post_elements'];
2602
- if ( ! empty( $post_elements ) )
2603
- $post_elements = explode( ' ', trim( $post_elements ) );
2604
- else
2605
- $post_elements = 'all';
2606
 
2607
- // Carousel Elements
2608
- $carousel_elements = $options['carousel_elements'];
2609
- if ( ! empty( $carousel_elements ) )
2610
- $carousel_elements = explode( ' ', trim( $carousel_elements ) );
2611
- else
2612
- $carousel_elements = array();
2613
 
2614
- /* Container Class */
2615
 
2616
- $container_class = 'dslc-posts dslc-products dslc-clearfix dslc-products-type-' . $options['type'] . ' dslc-posts-orientation-' . $options['orientation'] . ' ';
2617
 
2618
- if ( $options['type'] == 'masonry' )
2619
- $container_class .= 'dslc-init-masonry ';
2620
- elseif ( $options['type'] == 'grid' )
2621
- $container_class .= 'dslc-init-grid ';
 
 
 
 
2622
 
2623
- /* Element Class */
2624
 
2625
- $element_class = 'dslc-post dslc-product ';
 
 
2626
 
2627
- if ( $options['type'] == 'masonry' )
2628
- $element_class .= 'dslc-masonry-item ';
2629
- elseif ( $options['type'] == 'carousel' )
2630
- $element_class .= 'dslc-carousel-item ';
2631
 
2632
- // Responsive
2633
- //$element_class .= 'dslc-res-sm-' . $options['res_sm_columns'] . ' ';
2634
- //$element_class .= 'dslc-res-tp-' . $options['res_tp_columns'] . ' ';
2635
 
2636
- /**
2637
- * What is shown
2638
- */
2639
 
2640
- $show_header = false;
2641
- $show_heading = false;
2642
- $show_filters = false;
2643
- $show_carousel_arrows = false;
2644
- $show_view_all_link = false;
2645
 
2646
- if ( in_array( 'main_heading', $elements ) )
2647
- $show_heading = true;
 
2648
 
2649
- if ( ( $elements == 'all' || in_array( 'filters', $elements ) ) && $options['type'] !== 'carousel' )
2650
- $show_filters = true;
 
2651
 
2652
- if ( $options['type'] == 'carousel' && in_array( 'arrows', $carousel_elements ) )
2653
- $show_carousel_arrows = true;
 
 
 
2654
 
2655
- if ( $show_heading || $show_filters || $show_carousel_arrows )
2656
- $show_header = true;
 
2657
 
2658
- /**
2659
- * Carousel Items
2660
- */
 
 
 
 
 
 
 
2661
 
2662
- switch ( $options['columns'] ) {
2663
- case 12 :
2664
- $carousel_items = 1;
2665
- break;
2666
- case 6 :
2667
- $carousel_items = 2;
2668
- break;
2669
- case 4 :
2670
- $carousel_items = 3;
2671
- break;
2672
- case 3 :
2673
- $carousel_items = 4;
2674
- break;
2675
- case 2 :
2676
- $carousel_items = 6;
2677
- break;
2678
- default:
2679
- $carousel_items = 6;
2680
- break;
2681
- }
2682
 
2683
- /**
2684
- * Heading ( output )
2685
- */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2686
 
2687
- if ( $show_header ) :
2688
- ?>
2689
- <div class="dslc-module-heading">
2690
 
2691
- <!-- Heading -->
 
 
2692
 
2693
- <?php if ( $show_heading ) : ?>
2694
 
2695
- <h2 class="dslca-editable-content" data-id="main_heading_title" data-type="simple" <?php if ( $dslc_is_admin ) echo 'contenteditable'; ?> ><?php echo stripslashes( $options['main_heading_title'] ); ?></h2>
2696
 
2697
- <!-- View all -->
2698
 
2699
- <?php if ( isset( $options['view_all_link'] ) && $options['view_all_link'] !== '' ) : ?>
2700
 
2701
- <span class="dslc-module-heading-view-all"><a href="<?php echo $options['view_all_link']; ?>" class="dslca-editable-content" data-id="main_heading_link_title" data-type="simple" <?php if ( $dslc_is_admin ) echo 'contenteditable'; ?> ><?php echo $options['main_heading_link_title']; ?></a></span>
2702
 
2703
- <?php endif; ?>
2704
 
2705
  <?php endif; ?>
2706
 
2707
- <!-- Filters -->
2708
 
2709
- <?php
2710
 
2711
- if ( $show_filters ) {
2712
 
2713
- $cats_array = array();
2714
 
2715
- if ( $dslc_query->have_posts() ) {
2716
 
2717
- while ( $dslc_query->have_posts() ) {
2718
 
2719
- $dslc_query->the_post();
2720
 
2721
- $post_cats = get_the_terms( get_the_ID(), 'product_cat' );
2722
- if ( ! empty( $post_cats ) ) {
2723
- foreach ( $post_cats as $post_cat ) {
2724
- $cats_array[$post_cat->slug] = $post_cat->name;
2725
- }
2726
- }
2727
 
 
 
 
 
 
2728
  }
2729
 
2730
  }
2731
 
2732
- ?>
2733
 
2734
- <div class="dslc-post-filters">
2735
- <span class="dslc-post-filter dslc-active dslca-editable-content" data-filter-id="show-all" <?php if ( $dslc_is_admin ){ echo 'data-id="main_filter_title_all" data-type="simple" contenteditable '; } ?>><?php echo $options['main_filter_title_all']; ?></span>
2736
 
2737
- <?php foreach ( $cats_array as $cat_slug => $cat_name ) : ?>
2738
- <span class="dslc-post-filter dslc-inactive" data-filter-id="<?php echo $cat_slug; ?>"><?php echo $cat_name; ?></span>
2739
- <?php endforeach; ?>
2740
 
2741
- </div><!-- .dslc-post-filters -->
 
 
2742
 
2743
- <?php
2744
 
2745
- }
2746
 
2747
- ?>
2748
 
2749
- <!-- Carousel -->
2750
 
2751
- <?php if ( $show_carousel_arrows ) : ?>
2752
- <span class="dslc-carousel-nav fr">
2753
- <span class="dslc-carousel-nav-inner">
2754
- <a href="#" class="dslc-carousel-nav-prev"><span class="dslc-icon-chevron-left"></span></a>
2755
- <a href="#" class="dslc-carousel-nav-next"><span class="dslc-icon-chevron-right"></span></a>
2756
- </span>
2757
- </span><!-- .carousel-nav -->
2758
- <?php endif; ?>
2759
 
2760
- </div><!-- .dslc-module-heading -->
2761
- <?php
 
 
 
 
 
 
2762
 
2763
- endif;
 
2764
 
2765
- /**
2766
- * Posts ( output )
2767
- */
2768
 
2769
- if ( $dslc_query->have_posts() ) :
 
 
2770
 
2771
- ?><div class="<?php echo $container_class; ?>"><?php
2772
 
2773
- ?><div class="dslc-posts-inner"><?php
2774
 
2775
- if ( 'carousel' === $options['type'] ) :
2776
 
2777
- ?><div class="dslc-loader"></div><div class="dslc-carousel" data-stop-on-hover="<?php echo $options['carousel_autoplay_hover']; ?>" data-autoplay="<?php echo $options['carousel_autoplay']; ?>" data-columns="<?php echo $carousel_items; ?>" data-pagination="<?php if ( in_array( 'circles', $carousel_elements ) ) echo 'true'; else echo 'false'; ?>" data-slide-speed="<?php echo $options['arrows_slide_speed']; ?>" data-pagination-speed="<?php echo $options['circles_slide_speed']; ?>"><?php
2778
 
2779
- endif;
2780
 
2781
- while ( $dslc_query->have_posts() ) : $dslc_query->the_post(); $count += $increment; $real_count++;
2782
 
2783
- global $product;
2784
 
2785
- if ( $count == $max_count ) {
2786
- $count = 0;
2787
- $extra_class = ' dslc-last-col';
2788
- } elseif ( $count == $increment ) {
2789
- $extra_class = ' dslc-first-col';
2790
- } else {
2791
- $extra_class = '';
2792
- }
2793
 
2794
- if ( ! has_post_thumbnail() ) {
2795
- $extra_class .= ' dslc-post-no-thumb';
2796
- }
 
 
 
 
 
2797
 
2798
- $post_cats = get_the_terms( get_the_ID(), 'product_cat' );
2799
- $post_cats_data = '';
 
2800
 
2801
- if ( ! empty( $post_cats ) ) {
2802
- foreach ( $post_cats as $post_cat ) {
2803
- $post_cats_data .= $post_cat->slug . ' ';
2804
- }
 
 
2805
  }
 
2806
 
2807
- ?>
2808
 
2809
- <div class="<?php echo $element_class . $columns_class . $extra_class; ?>" data-cats="<?php echo $post_cats_data; ?>">
2810
 
2811
- <?php if ( $post_elements == 'all' || in_array( 'thumbnail', $post_elements ) ) : ?>
2812
 
2813
- <?php if ( has_post_thumbnail() ) : ?>
2814
 
2815
- <div class="dslc-post-thumb dslc-product-thumb dslc-on-hover-anim">
2816
 
2817
- <?php
2818
- /**
2819
- * Manual Resize
2820
- */
2821
 
2822
- $manual_resize = false;
2823
- if ( isset( $options['thumb_resize_height'] ) && ! empty( $options['thumb_resize_height'] ) || isset( $options['thumb_resize_width_manual'] ) && ! empty( $options['thumb_resize_width_manual'] ) ) {
2824
 
2825
- $manual_resize = true;
2826
- $thumb_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
2827
- $thumb_url = $thumb_url[0];
2828
 
2829
- $thumb_alt = get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true );
2830
 
2831
- if ( ! $thumb_alt ) {
2832
- $thumb_alt = '';
2833
- }
2834
 
2835
- $resize_width = false;
2836
- $resize_height = false;
2837
 
2838
- if ( isset( $options['thumb_resize_width_manual'] ) && ! empty( $options['thumb_resize_width_manual'] ) ) {
2839
- $resize_width = $options['thumb_resize_width_manual'];
2840
- }
2841
 
2842
- if ( isset( $options['thumb_resize_height'] ) && ! empty( $options['thumb_resize_height'] ) ) {
2843
- $resize_height = $options['thumb_resize_height'];
2844
- }
2845
  }
2846
- ?>
 
2847
 
2848
 
2849
- <div class="dslc-product-thumb-inner dslca-post-thumb">
2850
 
2851
- <?php if ( $manual_resize ) : ?>
2852
- <a href="<?php the_permalink(); ?>"><img src="<?php $res_img = dslc_aq_resize( $thumb_url, $resize_width, $resize_height, true ); echo $res_img; ?>" alt="<?php echo $thumb_alt; ?>" /></a>
2853
- <?php else : ?>
2854
- <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( 'full' ); ?></a>
2855
- <?php endif; ?>
2856
 
2857
- <?php if ( $post_elements == 'all' || in_array( 'price', $post_elements ) ) : ?>
2858
- <a href="<?php echo '[add_to_cart_url id=\'' . get_the_ID() . '\']'; ?>" class="dslc-product-price dslc-init-<?php echo $options['price_pos']; ?>"><span class="dslc-product-price-main dslc-product-price-bg dslc-init-target"><?php echo $product->get_price_html(); ?></span></a>
2859
- <?php endif; ?>
2860
 
2861
- </div><!-- .dslc-product-thumb-inner -->
2862
 
2863
- <?php if ( ( $options['main_location'] == 'inside' || $options['main_location'] == 'inside_visible' ) && ( $post_elements == 'all' || in_array( 'title', $post_elements ) || in_array( 'excerpt', $post_elements ) || in_array( 'addtocart', $post_elements ) || in_array( 'details', $post_elements ) ) ) : ?>
2864
 
2865
- <div class="dslc-post-main dslc-init-<?php echo $options['main_position']; ?> dslc-product-main <?php if ( $options['main_location'] == 'inside_visible' ) echo 'dslc-product-main-visible'; ?> dslc-on-hover-anim-target dslc-anim-<?php echo $options['css_anim_hover']; ?>" data-dslc-anim="<?php echo $options['css_anim_hover'] ?>" data-dslc-anim-speed="<?php echo $options['css_anim_speed']; ?>">
2866
 
2867
- <div class="dslc-product-main-inner dslc-init-target">
2868
 
2869
- <?php if ( $post_elements == 'all' || in_array( 'title', $post_elements ) ) : ?>
2870
 
2871
- <div class="dslc-product-title dslc-clearfix">
2872
- <?php if ( $post_elements == 'all' || in_array( 'price_2', $post_elements ) ) : ?>
2873
- <span class="dslc-product-price-secondary"><?php echo $product->get_price_html(); ?></span>
2874
- <?php endif; ?>
2875
- <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
2876
- </div><!-- .dslc-product-title -->
2877
 
2878
- <?php endif; ?>
2879
 
2880
- <?php if ( $post_elements == 'all' || in_array( 'separator', $post_elements ) ) : ?>
2881
 
2882
- <span class="dslc-product-sep"></span>
2883
 
2884
- <?php endif; ?>
2885
 
2886
- <?php if ( $post_elements == 'all' || in_array( 'excerpt', $post_elements ) ) : ?>
2887
-
2888
- <div class="dslc-product-excerpt">
2889
- <?php if ( $options['excerpt_or_content'] == 'content' ) : ?>
2890
- <?php
2891
- if ( $options['excerpt_length'] > 0 ) {
2892
- echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2893
- } else {
2894
- echo get_the_content();
2895
- }
2896
- ?>
2897
- <?php else : ?>
2898
- <?php
2899
- if ( $options['excerpt_length'] > 0 ) {
2900
 
2901
- if ( has_excerpt() ) {
2902
- echo wp_trim_words( get_the_excerpt(), $options['excerpt_length'] );
2903
- } else {
2904
- echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2905
- }
2906
  } else {
 
 
 
 
 
 
2907
 
2908
- if ( has_excerpt() ) {
2909
- echo get_the_excerpt();
2910
- } else {
2911
- echo get_the_content();
2912
- }
2913
  }
2914
- ?>
2915
- <?php endif; ?>
2916
- </div><!-- .dslc-product-excerpt -->
2917
 
2918
- <?php endif; ?>
 
 
 
 
 
 
 
 
2919
 
2920
- <div class="dslc-product-extra dslc-clearfix">
2921
 
2922
- <?php if ( $post_elements == 'all' || in_array( 'addtocart', $post_elements ) ) : ?>
2923
- <a href="<?php echo '[add_to_cart_url id=\'' . get_the_ID() . '\']'; ?>" class="dslc-product-add-to-cart"><span class="dslc-icon dslc-icon-shopping-cart"></span><?php echo $options['addtocart_text']; ?></a>
2924
- <?php endif; ?>
2925
 
2926
- <?php if ( $post_elements == 'all' || in_array( 'details', $post_elements ) ) : ?>
2927
- <a href="<?php the_permalink(); ?>" class="dslc-product-details"><span class="dslc-icon dslc-icon-file-text"></span><?php echo $options['details_text']; ?></a>
2928
- <?php endif; ?>
2929
 
2930
- </div><!-- .dslc-product-extra -->
 
 
2931
 
2932
- </div><!-- .dslc-product-main-inner -->
2933
 
2934
- <a href="<?php the_permalink(); ?>" class="dslc-post-main-inner-link-cover"></a>
2935
 
2936
- </div><!-- .dslc-product-main -->
2937
 
2938
- <?php endif; ?>
2939
 
2940
- </div><!-- .dslc-product-thumb -->
2941
 
2942
- <?php endif; ?>
2943
 
2944
  <?php endif; ?>
2945
 
2946
- <?php if ( $options['main_location'] == 'bellow' && ( $post_elements == 'all' || in_array( 'title', $post_elements ) || in_array( 'separator', $post_elements ) || in_array( 'excerpt', $post_elements ) || in_array( 'addtocart', $post_elements ) || in_array( 'details', $post_elements ) ) ) : ?>
2947
 
2948
- <div class="dslc-post-main dslc-product-main">
2949
 
2950
- <?php if ( $post_elements == 'all' || in_array( 'title', $post_elements ) ) : ?>
2951
 
2952
- <div class="dslc-product-title dslc-clearfix">
2953
- <?php if ( $post_elements == 'all' || in_array( 'price_2', $post_elements ) ) : ?>
2954
- <span class="dslc-product-price-secondary"><?php echo $product->get_price_html(); ?></span>
2955
- <?php endif; ?>
2956
- <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
2957
- </div><!-- .dslc-product-title -->
2958
 
2959
- <?php endif; ?>
 
 
 
 
 
2960
 
2961
- <?php if ( $post_elements == 'all' || in_array( 'separator', $post_elements ) ) : ?>
2962
 
2963
- <span class="dslc-product-sep"></span>
2964
 
2965
- <?php endif; ?>
2966
 
2967
- <?php if ( $post_elements == 'all' || in_array( 'excerpt', $post_elements ) ) : ?>
2968
 
2969
- <div class="dslc-product-excerpt">
2970
- <?php if ( $options['excerpt_or_content'] == 'content' ) : ?>
2971
- <?php
 
 
 
 
 
 
 
 
 
 
2972
  if ( $options['excerpt_length'] > 0 ) {
2973
- echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
 
 
 
2974
  } else {
2975
- echo get_the_content();
 
 
 
2976
  }
2977
- ?>
2978
- <?php else : ?>
2979
- <?php
2980
- if ( $options['excerpt_length'] > 0 ) {
2981
- if ( has_excerpt() )
2982
- echo wp_trim_words( get_the_excerpt(), $options['excerpt_length'] );
2983
- else
2984
- echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2985
- } else {
2986
- if ( has_excerpt() )
2987
- echo get_the_excerpt();
2988
- else
2989
- echo get_the_content();
2990
- }
2991
- ?>
2992
- <?php endif; ?>
2993
- </div><!-- .dslc-product-excerpt -->
2994
-
2995
- <?php endif; ?>
2996
-
2997
- <div class="dslc-product-extra dslc-clearfix">
2998
-
2999
- <?php if ( $post_elements == 'all' || in_array( 'addtocart', $post_elements ) ) : ?>
3000
- <a href="<?php echo '[add_to_cart_url id=\'' . get_the_ID() . '\']'; ?>" class="dslc-product-add-to-cart"><span class="dslc-icon dslc-icon-shopping-cart"></span><?php echo $options['addtocart_text']; ?></a>
3001
  <?php endif; ?>
 
3002
 
3003
- <?php if ( $post_elements == 'all' || in_array( 'details', $post_elements ) ) : ?>
3004
- <a href="<?php the_permalink(); ?>" class="dslc-product-details"><span class="dslc-icon dslc-icon-file-text"></span><?php echo $options['details_text']; ?></a>
3005
- <?php endif; ?>
3006
 
3007
- </div><!-- .dslc-product-extra -->
3008
 
3009
- </div><!-- .dslc-product-main -->
 
 
3010
 
3011
- <?php endif; ?>
 
 
3012
 
3013
- </div><!-- .dslc-product -->
3014
 
3015
- <?php
3016
 
3017
- // Row Separator
3018
- if ( $options['type'] == 'grid' && $count == 0 && $real_count != $dslc_query->found_posts && $real_count != $options['amount'] && $options['separator_enabled'] == 'enabled' ) {
3019
- echo '<div class="dslc-post-separator"></div>';
3020
- }
3021
 
3022
- endwhile;
3023
 
3024
- if ( $options['type'] == 'carousel' ) :
3025
 
3026
- ?></div><?php
 
 
 
3027
 
3028
- endif;
3029
 
3030
- ?></div><!-- .dslc-posts-inner --><?php
3031
 
3032
- ?></div><?php
3033
 
3034
- else :
3035
 
3036
- if ( $dslc_is_admin ) :
3037
- ?><div class="dslc-notification dslc-red"><?php _e( 'You do not have products at the moment. Go to <strong>WP Admin &rarr; Products</strong> to add some.', 'live-composer-page-builder' ); ?> <span class="dslca-refresh-module-hook dslc-icon dslc-icon-refresh"></span></span></div><?php
3038
- endif;
3039
 
3040
- endif;
3041
 
3042
  else :
3043
 
3044
  if ( $dslc_is_admin ) :
3045
- ?><div class="dslc-notification dslc-red"><?php _e( 'You do not have WooCommerce installed at the moment. You need to install it to use this module.', 'live-composer-page-builder' ); ?> <span class="dslca-refresh-module-hook dslc-icon dslc-icon-refresh"></span></span></div><?php
3046
  endif;
3047
 
3048
  endif;
3049
 
3050
- /**
3051
- * Pagination
3052
- */
3053
 
3054
- if ( isset( $options['pagination_type'] ) && $options['pagination_type'] != 'disabled' ) {
3055
- $num_pages = $dslc_query->max_num_pages;
3056
- if ( $options['offset'] > 0 ) {
3057
- $num_pages = ceil( ( $dslc_query->found_posts - $options['offset'] ) / $options['amount'] );
3058
- }
3059
- dslc_post_pagination( array('pages' => $num_pages, 'type' => $options['pagination_type']) );
 
 
 
 
 
 
 
 
3060
  }
 
 
3061
 
3062
- wp_reset_postdata();
3063
 
3064
- }
 
 
 
3065
 
3066
- }
2450
  * @return void
2451
  */
2452
  function output( $options ) {
2453
+ ?>
2454
+ [dslc_module_woocommerce_output]<?php echo serialize($options); ?>[/dslc_module_woocommerce_output]
2455
+ <?php
2456
 
2457
+ }
2458
+ }
 
 
2459
 
2460
+ function dslc_module_woocommerce_output ( $atts, $content = null ) {
2461
+ // Uncode module options passed as serialized content.
2462
+ $options = unserialize( $content );
2463
 
2464
+ ob_start();
 
 
 
2465
 
2466
+ if ( is_feed() ) {
2467
+ // Prevent category/tag feeds to stuck in an infinite loop
2468
+ return false;
2469
+ }
 
 
 
 
 
2470
 
2471
+ global $dslc_active;
2472
 
2473
+ if ( $dslc_active && is_user_logged_in() && current_user_can( DS_LIVE_COMPOSER_CAPABILITY ) )
2474
+ $dslc_is_admin = true;
2475
+ else
2476
+ $dslc_is_admin = false;
2477
 
2478
+ // Fix slashes on apostrophes
2479
+ if ( isset( $options['addtocart_text'] ) ) {
2480
+ $options['addtocart_text'] = stripslashes( $options['addtocart_text'] );
2481
+ }
2482
 
2483
+ // Fix slashes on apostrophes
2484
+ if ( isset( $options['details_text'] ) ) {
2485
+ $options['details_text'] = stripslashes( $options['details_text'] );
2486
+ }
2487
 
 
2488
 
2489
+ if ( ! isset( $options['price_pos'] ) )
2490
+ $options['price_pos'] = 'center';
2491
 
2492
+ if ( class_exists( 'Woocommerce' ) ) :
 
 
2493
 
2494
+ /* Module output stars here */
 
 
 
 
 
 
2495
 
2496
+ if ( is_front_page() ) { $paged = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1; } else { $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2497
 
2498
+ // Fix for pagination from other modules affecting this one when pag disabled
2499
+ if ( $options['pagination_type'] == 'disabled' ) $paged = 1;
 
2500
 
2501
+ // Fix for offset braking pagination
2502
+ $query_offset = $options['offset'];
2503
+ if ( $query_offset > 0 && $paged > 1 ) $query_offset = ( $paged - 1 ) * $options['amount'] + $options['offset'];
 
 
 
2504
 
2505
+ $args = array(
2506
+ 'paged' => $paged,
2507
+ 'post_type' => 'product',
2508
+ 'posts_per_page' => $options['amount'],
2509
+ 'order' => $options['order'],
2510
+ 'orderby' => $options['orderby'],
2511
+ );
2512
 
2513
+ // Add offset
2514
+ if ( $query_offset > 0 ) {
2515
+ $args['offset'] = $query_offset;
2516
+ }
 
 
2517
 
2518
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
2519
+ $args['post_status'] = array('publish', 'private');
2520
+ }
 
 
 
2521
 
2522
+ if ( isset( $options['categories'] ) && $options['categories'] != '' ) {
2523
 
2524
+ $cats_array = explode( ' ', trim( $options['categories'] ) );
2525
 
2526
+ $args['tax_query'] = array(
2527
+ array(
2528
+ 'taxonomy' => 'product_cat',
2529
+ 'field' => 'slug',
2530
+ 'terms' => $cats_array,
2531
+ 'operator' => $options['categories_operator']
2532
+ )
2533
+ );
2534
 
2535
+ }
2536
 
2537
+ if ( $options['orderby'] == 'meta_value_num' ) {
2538
+ $args['meta_key'] = '_price';
2539
+ }
2540
 
2541
+ // Exlcude and Include arrays
2542
+ $exclude = array();
2543
+ $include = array();
 
2544
 
2545
+ // Exclude current post
2546
+ if ( is_singular( get_post_type() ) )
2547
+ $exclude[] = get_the_ID();
2548
 
2549
+ // Exclude posts ( option )
2550
+ if ( $options['query_post_not_in'] )
2551
+ $exclude = array_merge( $exclude, explode( ' ', $options['query_post_not_in'] ) );
2552
 
2553
+ // Include posts ( option )
2554
+ if ( $options['query_post_in'] )
2555
+ $include = array_merge( $include, explode( ' ', $options['query_post_in'] ) );
 
 
2556
 
2557
+ // Include query parameter
2558
+ if ( ! empty( $include ) )
2559
+ $args['post__in'] = $include;
2560
 
2561
+ // Exclude query parameter
2562
+ if ( ! empty( $exclude ) )
2563
+ $args['post__not_in'] = $exclude;
2564
 
2565
+ // Author archive page
2566
+ if ( is_author() && $options['query_alter'] == 'enabled' ) {
2567
+ global $authordata;
2568
+ $args['author__in'] = array($authordata->data->ID);
2569
+ }
2570
 
2571
+ // No paging
2572
+ if ( $options['pagination_type'] == 'disabled' )
2573
+ $args['no_found_rows'] = true;
2574
 
2575
+ // Out of stock ( show/hide )
2576
+ if ( $options['outofstock'] == 'disabled' ) {
2577
+ $args['meta_query'] = array(
2578
+ array(
2579
+ 'key' => '_stock_status',
2580
+ 'value' => 'outofstock',
2581
+ 'compare' => '!=',
2582
+ ),
2583
+ );
2584
+ }
2585
 
2586
+ // Do the query
2587
+ if ( ( is_category() || is_tag() || is_tax() || is_search() || is_date() ) && $options['query_alter'] == 'enabled' ) {
2588
+ global $wp_query;
2589
+ $dslc_query = $wp_query;
2590
+ } else {
2591
+ $dslc_query = new WP_Query( $args );
2592
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
2593
 
2594
+ $columns_class = 'dslc-col dslc-' . $options['columns'] . '-col ';
2595
+ $count = 0;
2596
+ $real_count = 0;
2597
+ $increment = $options['columns'];
2598
+ $max_count = 12;
2599
+
2600
+ /**
2601
+ * Elements to show
2602
+ */
2603
+
2604
+ // Main Elements
2605
+ $elements = $options['elements'];
2606
+ if ( ! empty( $elements ) )
2607
+ $elements = explode( ' ', trim( $elements ) );
2608
+ else
2609
+ $elements = array();
2610
+
2611
+
2612
+ // Post Elements
2613
+ $post_elements = $options['post_elements'];
2614
+ if ( ! empty( $post_elements ) )
2615
+ $post_elements = explode( ' ', trim( $post_elements ) );
2616
+ else
2617
+ $post_elements = 'all';
2618
+
2619
+ // Carousel Elements
2620
+ $carousel_elements = $options['carousel_elements'];
2621
+ if ( ! empty( $carousel_elements ) )
2622
+ $carousel_elements = explode( ' ', trim( $carousel_elements ) );
2623
+ else
2624
+ $carousel_elements = array();
2625
+
2626
+ /* Container Class */
2627
+
2628
+ $container_class = 'dslc-posts dslc-products dslc-clearfix dslc-products-type-' . $options['type'] . ' dslc-posts-orientation-' . $options['orientation'] . ' ';
2629
+
2630
+ if ( $options['type'] == 'masonry' )
2631
+ $container_class .= 'dslc-init-masonry ';
2632
+ elseif ( $options['type'] == 'grid' )
2633
+ $container_class .= 'dslc-init-grid ';
2634
+
2635
+ /* Element Class */
2636
+
2637
+ $element_class = 'dslc-post dslc-product ';
2638
+
2639
+ if ( $options['type'] == 'masonry' )
2640
+ $element_class .= 'dslc-masonry-item ';
2641
+ elseif ( $options['type'] == 'carousel' )
2642
+ $element_class .= 'dslc-carousel-item ';
2643
+
2644
+ // Responsive
2645
+ //$element_class .= 'dslc-res-sm-' . $options['res_sm_columns'] . ' ';
2646
+ //$element_class .= 'dslc-res-tp-' . $options['res_tp_columns'] . ' ';
2647
+
2648
+ /**
2649
+ * What is shown
2650
+ */
2651
+
2652
+ $show_header = false;
2653
+ $show_heading = false;
2654
+ $show_filters = false;
2655
+ $show_carousel_arrows = false;
2656
+ $show_view_all_link = false;
2657
+
2658
+ if ( in_array( 'main_heading', $elements ) )
2659
+ $show_heading = true;
2660
+
2661
+ if ( ( $elements == 'all' || in_array( 'filters', $elements ) ) && $options['type'] !== 'carousel' )
2662
+ $show_filters = true;
2663
+
2664
+ if ( $options['type'] == 'carousel' && in_array( 'arrows', $carousel_elements ) )
2665
+ $show_carousel_arrows = true;
2666
+
2667
+ if ( $show_heading || $show_filters || $show_carousel_arrows )
2668
+ $show_header = true;
2669
+
2670
+ /**
2671
+ * Carousel Items
2672
+ */
2673
+
2674
+ switch ( $options['columns'] ) {
2675
+ case 12 :
2676
+ $carousel_items = 1;
2677
+ break;
2678
+ case 6 :
2679
+ $carousel_items = 2;
2680
+ break;
2681
+ case 4 :
2682
+ $carousel_items = 3;
2683
+ break;
2684
+ case 3 :
2685
+ $carousel_items = 4;
2686
+ break;
2687
+ case 2 :
2688
+ $carousel_items = 6;
2689
+ break;
2690
+ default:
2691
+ $carousel_items = 6;
2692
+ break;
2693
+ }
2694
 
2695
+ /**
2696
+ * Heading ( output )
2697
+ */
2698
 
2699
+ if ( $show_header ) :
2700
+ ?>
2701
+ <div class="dslc-module-heading">
2702
 
2703
+ <!-- Heading -->
2704
 
2705
+ <?php if ( $show_heading ) : ?>
2706
 
2707
+ <h2 class="dslca-editable-content" data-id="main_heading_title" data-type="simple" <?php if ( $dslc_is_admin ) echo 'contenteditable'; ?> ><?php echo stripslashes( $options['main_heading_title'] ); ?></h2>
2708
 
2709
+ <!-- View all -->
2710
 
2711
+ <?php if ( isset( $options['view_all_link'] ) && $options['view_all_link'] !== '' ) : ?>
2712
 
2713
+ <span class="dslc-module-heading-view-all"><a href="<?php echo $options['view_all_link']; ?>" class="dslca-editable-content" data-id="main_heading_link_title" data-type="simple" <?php if ( $dslc_is_admin ) echo 'contenteditable'; ?> ><?php echo $options['main_heading_link_title']; ?></a></span>
2714
 
2715
  <?php endif; ?>
2716
 
2717
+ <?php endif; ?>
2718
 
2719
+ <!-- Filters -->
2720
 
2721
+ <?php
2722
 
2723
+ if ( $show_filters ) {
2724
 
2725
+ $cats_array = array();
2726
 
2727
+ if ( $dslc_query->have_posts() ) {
2728
 
2729
+ while ( $dslc_query->have_posts() ) {
2730
 
2731
+ $dslc_query->the_post();
 
 
 
 
 
2732
 
2733
+ $post_cats = get_the_terms( get_the_ID(), 'product_cat' );
2734
+ if ( ! empty( $post_cats ) ) {
2735
+ foreach ( $post_cats as $post_cat ) {
2736
+ $cats_array[$post_cat->slug] = $post_cat->name;
2737
+ }
2738
  }
2739
 
2740
  }
2741
 
2742
+ }
2743
 
2744
+ ?>
 
2745
 
2746
+ <div class="dslc-post-filters">
2747
+ <span class="dslc-post-filter dslc-active dslca-editable-content" data-filter-id="show-all" <?php if ( $dslc_is_admin ){ echo 'data-id="main_filter_title_all" data-type="simple" contenteditable '; } ?>><?php echo $options['main_filter_title_all']; ?></span>
 
2748
 
2749
+ <?php foreach ( $cats_array as $cat_slug => $cat_name ) : ?>
2750
+ <span class="dslc-post-filter dslc-inactive" data-filter-id="<?php echo $cat_slug; ?>"><?php echo $cat_name; ?></span>
2751
+ <?php endforeach; ?>
2752
 
2753
+ </div><!-- .dslc-post-filters -->
2754
 
2755
+ <?php
2756
 
2757
+ }
2758
 
2759
+ ?>
2760
 
2761
+ <!-- Carousel -->
 
 
 
 
 
 
 
2762
 
2763
+ <?php if ( $show_carousel_arrows ) : ?>
2764
+ <span class="dslc-carousel-nav fr">
2765
+ <span class="dslc-carousel-nav-inner">
2766
+ <a href="#" class="dslc-carousel-nav-prev"><span class="dslc-icon-chevron-left"></span></a>
2767
+ <a href="#" class="dslc-carousel-nav-next"><span class="dslc-icon-chevron-right"></span></a>
2768
+ </span>
2769
+ </span><!-- .carousel-nav -->
2770
+ <?php endif; ?>
2771
 
2772
+ </div><!-- .dslc-module-heading -->
2773
+ <?php
2774
 
2775
+ endif;
 
 
2776
 
2777
+ /**
2778
+ * Posts ( output )
2779
+ */
2780
 
2781
+ if ( $dslc_query->have_posts() ) :
2782
 
2783
+ ?><div class="<?php echo $container_class; ?>"><?php
2784
 
2785
+ ?><div class="dslc-posts-inner"><?php
2786
 
2787
+ if ( 'carousel' === $options['type'] ) :
2788
 
2789
+ ?><div class="dslc-loader"></div><div class="dslc-carousel" data-stop-on-hover="<?php echo $options['carousel_autoplay_hover']; ?>" data-autoplay="<?php echo $options['carousel_autoplay']; ?>" data-columns="<?php echo $carousel_items; ?>" data-pagination="<?php if ( in_array( 'circles', $carousel_elements ) ) echo 'true'; else echo 'false'; ?>" data-slide-speed="<?php echo $options['arrows_slide_speed']; ?>" data-pagination-speed="<?php echo $options['circles_slide_speed']; ?>"><?php
2790
 
2791
+ endif;
2792
 
2793
+ while ( $dslc_query->have_posts() ) : $dslc_query->the_post(); $count += $increment; $real_count++;
2794
 
2795
+ global $product;
 
 
 
 
 
 
 
2796
 
2797
+ if ( $count == $max_count ) {
2798
+ $count = 0;
2799
+ $extra_class = ' dslc-last-col';
2800
+ } elseif ( $count == $increment ) {
2801
+ $extra_class = ' dslc-first-col';
2802
+ } else {
2803
+ $extra_class = '';
2804
+ }
2805
 
2806
+ if ( ! has_post_thumbnail() ) {
2807
+ $extra_class .= ' dslc-post-no-thumb';
2808
+ }
2809
 
2810
+ $post_cats = get_the_terms( get_the_ID(), 'product_cat' );
2811
+ $post_cats_data = '';
2812
+
2813
+ if ( ! empty( $post_cats ) ) {
2814
+ foreach ( $post_cats as $post_cat ) {
2815
+ $post_cats_data .= $post_cat->slug . ' ';
2816
  }
2817
+ }
2818
 
2819
+ ?>
2820
 
2821
+ <div class="<?php echo $element_class . $columns_class . $extra_class; ?>" data-cats="<?php echo $post_cats_data; ?>">
2822
 
2823
+ <?php if ( $post_elements == 'all' || in_array( 'thumbnail', $post_elements ) ) : ?>
2824
 
2825
+ <?php if ( has_post_thumbnail() ) : ?>
2826
 
2827
+ <div class="dslc-post-thumb dslc-product-thumb dslc-on-hover-anim">
2828
 
2829
+ <?php
2830
+ /**
2831
+ * Manual Resize
2832
+ */
2833
 
2834
+ $manual_resize = false;
2835
+ if ( isset( $options['thumb_resize_height'] ) && ! empty( $options['thumb_resize_height'] ) || isset( $options['thumb_resize_width_manual'] ) && ! empty( $options['thumb_resize_width_manual'] ) ) {
2836
 
2837
+ $manual_resize = true;
2838
+ $thumb_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
2839
+ $thumb_url = $thumb_url[0];
2840
 
2841
+ $thumb_alt = get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true );
2842
 
2843
+ if ( ! $thumb_alt ) {
2844
+ $thumb_alt = '';
2845
+ }
2846
 
2847
+ $resize_width = false;
2848
+ $resize_height = false;
2849
 
2850
+ if ( isset( $options['thumb_resize_width_manual'] ) && ! empty( $options['thumb_resize_width_manual'] ) ) {
2851
+ $resize_width = $options['thumb_resize_width_manual'];
2852
+ }
2853
 
2854
+ if ( isset( $options['thumb_resize_height'] ) && ! empty( $options['thumb_resize_height'] ) ) {
2855
+ $resize_height = $options['thumb_resize_height'];
 
2856
  }
2857
+ }
2858
+ ?>
2859
 
2860
 
2861
+ <div class="dslc-product-thumb-inner dslca-post-thumb">
2862
 
2863
+ <?php if ( $manual_resize ) : ?>
2864
+ <a href="<?php the_permalink(); ?>"><img src="<?php $res_img = dslc_aq_resize( $thumb_url, $resize_width, $resize_height, true ); echo $res_img; ?>" alt="<?php echo $thumb_alt; ?>" /></a>
2865
+ <?php else : ?>
2866
+ <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( 'full' ); ?></a>
2867
+ <?php endif; ?>
2868
 
2869
+ <?php if ( $post_elements == 'all' || in_array( 'price', $post_elements ) ) : ?>
2870
+ <a href="<?php echo '[add_to_cart_url id=\'' . get_the_ID() . '\']'; ?>" class="dslc-product-price dslc-init-<?php echo $options['price_pos']; ?>"><span class="dslc-product-price-main dslc-product-price-bg dslc-init-target"><?php echo $product->get_price_html(); ?></span></a>
2871
+ <?php endif; ?>
2872
 
2873
+ </div><!-- .dslc-product-thumb-inner -->
2874
 
2875
+ <?php if ( ( $options['main_location'] == 'inside' || $options['main_location'] == 'inside_visible' ) && ( $post_elements == 'all' || in_array( 'title', $post_elements ) || in_array( 'excerpt', $post_elements ) || in_array( 'addtocart', $post_elements ) || in_array( 'details', $post_elements ) ) ) : ?>
2876
 
2877
+ <div class="dslc-post-main dslc-init-<?php echo $options['main_position']; ?> dslc-product-main <?php if ( $options['main_location'] == 'inside_visible' ) echo 'dslc-product-main-visible'; ?> dslc-on-hover-anim-target dslc-anim-<?php echo $options['css_anim_hover']; ?>" data-dslc-anim="<?php echo $options['css_anim_hover'] ?>" data-dslc-anim-speed="<?php echo $options['css_anim_speed']; ?>">
2878
 
2879
+ <div class="dslc-product-main-inner dslc-init-target">
2880
 
2881
+ <?php if ( $post_elements == 'all' || in_array( 'title', $post_elements ) ) : ?>
2882
 
2883
+ <div class="dslc-product-title dslc-clearfix">
2884
+ <?php if ( $post_elements == 'all' || in_array( 'price_2', $post_elements ) ) : ?>
2885
+ <span class="dslc-product-price-secondary"><?php echo $product->get_price_html(); ?></span>
2886
+ <?php endif; ?>
2887
+ <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
2888
+ </div><!-- .dslc-product-title -->
2889
 
2890
+ <?php endif; ?>
2891
 
2892
+ <?php if ( $post_elements == 'all' || in_array( 'separator', $post_elements ) ) : ?>
2893
 
2894
+ <span class="dslc-product-sep"></span>
2895
 
2896
+ <?php endif; ?>
2897
 
2898
+ <?php if ( $post_elements == 'all' || in_array( 'excerpt', $post_elements ) ) : ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
2899
 
2900
+ <div class="dslc-product-excerpt">
2901
+ <?php if ( $options['excerpt_or_content'] == 'content' ) : ?>
2902
+ <?php
2903
+ if ( $options['excerpt_length'] > 0 ) {
2904
+ echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2905
  } else {
2906
+ echo get_the_content();
2907
+ }
2908
+ ?>
2909
+ <?php else : ?>
2910
+ <?php
2911
+ if ( $options['excerpt_length'] > 0 ) {
2912
 
2913
+ if ( has_excerpt() ) {
2914
+ echo wp_trim_words( get_the_excerpt(), $options['excerpt_length'] );
2915
+ } else {
2916
+ echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
 
2917
  }
2918
+ } else {
 
 
2919
 
2920
+ if ( has_excerpt() ) {
2921
+ echo get_the_excerpt();
2922
+ } else {
2923
+ echo get_the_content();
2924
+ }
2925
+ }
2926
+ ?>
2927
+ <?php endif; ?>
2928
+ </div><!-- .dslc-product-excerpt -->
2929
 
2930
+ <?php endif; ?>
2931
 
2932
+ <div class="dslc-product-extra dslc-clearfix">
 
 
2933
 
2934
+ <?php if ( $post_elements == 'all' || in_array( 'addtocart', $post_elements ) ) : ?>
2935
+ <a href="<?php echo '[add_to_cart_url id=\'' . get_the_ID() . '\']'; ?>" class="dslc-product-add-to-cart"><span class="dslc-icon dslc-icon-shopping-cart"></span><?php echo $options['addtocart_text']; ?></a>
2936
+ <?php endif; ?>
2937
 
2938
+ <?php if ( $post_elements == 'all' || in_array( 'details', $post_elements ) ) : ?>
2939
+ <a href="<?php the_permalink(); ?>" class="dslc-product-details"><span class="dslc-icon dslc-icon-file-text"></span><?php echo $options['details_text']; ?></a>
2940
+ <?php endif; ?>
2941
 
2942
+ </div><!-- .dslc-product-extra -->
2943
 
2944
+ </div><!-- .dslc-product-main-inner -->
2945
 
2946
+ <a href="<?php the_permalink(); ?>" class="dslc-post-main-inner-link-cover"></a>
2947
 
2948
+ </div><!-- .dslc-product-main -->
2949
 
2950
+ <?php endif; ?>
2951
 
2952
+ </div><!-- .dslc-product-thumb -->
2953
 
2954
  <?php endif; ?>
2955
 
2956
+ <?php endif; ?>
2957
 
2958
+ <?php if ( $options['main_location'] == 'bellow' && ( $post_elements == 'all' || in_array( 'title', $post_elements ) || in_array( 'separator', $post_elements ) || in_array( 'excerpt', $post_elements ) || in_array( 'addtocart', $post_elements ) || in_array( 'details', $post_elements ) ) ) : ?>
2959
 
2960
+ <div class="dslc-post-main dslc-product-main">
2961
 
2962
+ <?php if ( $post_elements == 'all' || in_array( 'title', $post_elements ) ) : ?>
 
 
 
 
 
2963
 
2964
+ <div class="dslc-product-title dslc-clearfix">
2965
+ <?php if ( $post_elements == 'all' || in_array( 'price_2', $post_elements ) ) : ?>
2966
+ <span class="dslc-product-price-secondary"><?php echo $product->get_price_html(); ?></span>
2967
+ <?php endif; ?>
2968
+ <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
2969
+ </div><!-- .dslc-product-title -->
2970
 
2971
+ <?php endif; ?>
2972
 
2973
+ <?php if ( $post_elements == 'all' || in_array( 'separator', $post_elements ) ) : ?>
2974
 
2975
+ <span class="dslc-product-sep"></span>
2976
 
2977
+ <?php endif; ?>
2978
 
2979
+ <?php if ( $post_elements == 'all' || in_array( 'excerpt', $post_elements ) ) : ?>
2980
+
2981
+ <div class="dslc-product-excerpt">
2982
+ <?php if ( $options['excerpt_or_content'] == 'content' ) : ?>
2983
+ <?php
2984
+ if ( $options['excerpt_length'] > 0 ) {
2985
+ echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2986
+ } else {
2987
+ echo get_the_content();
2988
+ }
2989
+ ?>
2990
+ <?php else : ?>
2991
+ <?php
2992
  if ( $options['excerpt_length'] > 0 ) {
2993
+ if ( has_excerpt() )
2994
+ echo wp_trim_words( get_the_excerpt(), $options['excerpt_length'] );
2995
+ else
2996
+ echo wp_trim_words( get_the_content(), $options['excerpt_length'] );
2997
  } else {
2998
+ if ( has_excerpt() )
2999
+ echo get_the_excerpt();
3000
+ else
3001
+ echo get_the_content();
3002
  }
3003
+ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3004
  <?php endif; ?>
3005
+ </div><!-- .dslc-product-excerpt -->
3006
 
3007
+ <?php endif; ?>
 
 
3008
 
3009
+ <div class="dslc-product-extra dslc-clearfix">
3010
 
3011
+ <?php if ( $post_elements == 'all' || in_array( 'addtocart', $post_elements ) ) : ?>
3012
+ <a href="<?php echo '[add_to_cart_url id=\'' . get_the_ID() . '\']'; ?>" class="dslc-product-add-to-cart"><span class="dslc-icon dslc-icon-shopping-cart"></span><?php echo $options['addtocart_text']; ?></a>
3013
+ <?php endif; ?>
3014
 
3015
+ <?php if ( $post_elements == 'all' || in_array( 'details', $post_elements ) ) : ?>
3016
+ <a href="<?php the_permalink(); ?>" class="dslc-product-details"><span class="dslc-icon dslc-icon-file-text"></span><?php echo $options['details_text']; ?></a>
3017
+ <?php endif; ?>
3018
 
3019
+ </div><!-- .dslc-product-extra -->
3020
 
3021
+ </div><!-- .dslc-product-main -->
3022
 
3023
+ <?php endif; ?>
 
 
 
3024
 
3025
+ </div><!-- .dslc-product -->
3026
 
3027
+ <?php
3028
 
3029
+ // Row Separator
3030
+ if ( $options['type'] == 'grid' && $count == 0 && $real_count != $dslc_query->found_posts && $real_count != $options['amount'] && $options['separator_enabled'] == 'enabled' ) {
3031
+ echo '<div class="dslc-post-separator"></div>';
3032
+ }
3033
 
3034
+ endwhile;
3035
 
3036
+ if ( $options['type'] == 'carousel' ) :
3037
 
3038
+ ?></div><?php
3039
 
3040
+ endif;
3041
 
3042
+ ?></div><!-- .dslc-posts-inner --><?php
 
 
3043
 
3044
+ ?></div><?php
3045
 
3046
  else :
3047
 
3048
  if ( $dslc_is_admin ) :
3049
+ ?><div class="dslc-notification dslc-red"><?php _e( 'You do not have products at the moment. Go to <strong>WP Admin &rarr; Products</strong> to add some.', 'live-composer-page-builder' ); ?> <span class="dslca-refresh-module-hook dslc-icon dslc-icon-refresh"></span></span></div><?php
3050
  endif;
3051
 
3052
  endif;
3053
 
3054
+ else :
 
 
3055
 
3056
+ if ( $dslc_is_admin ) :
3057
+ ?><div class="dslc-notification dslc-red"><?php _e( 'You do not have WooCommerce installed at the moment. You need to install it to use this module.', 'live-composer-page-builder' ); ?> <span class="dslca-refresh-module-hook dslc-icon dslc-icon-refresh"></span></span></div><?php
3058
+ endif;
3059
+
3060
+ endif;
3061
+
3062
+ /**
3063
+ * Pagination
3064
+ */
3065
+
3066
+ if ( isset( $options['pagination_type'] ) && $options['pagination_type'] != 'disabled' ) {
3067
+ $num_pages = $dslc_query->max_num_pages;
3068
+ if ( $options['offset'] > 0 ) {
3069
+ $num_pages = ceil( ( $dslc_query->found_posts - $options['offset'] ) / $options['amount'] );
3070
  }
3071
+ dslc_post_pagination( array('pages' => $num_pages, 'type' => $options['pagination_type']) );
3072
+ }
3073
 
3074
+ wp_reset_postdata();
3075
 
3076
+ $shortcode_rendered = ob_get_contents();
3077
+ ob_end_clean();
3078
+
3079
+ return $shortcode_rendered;
3080
 
3081
+ } add_shortcode( 'dslc_module_woocommerce_output', 'dslc_module_woocommerce_output' );
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: LiveComposer
3
  Tags: page builder, visual composer, visual editor, visual builder, drag and drop builder, landing page builder, frontend editor, frontend builder, landing pages, landing page, website builder, theme builder, site-builder, layout builder, drag-and-drop, builder, editor, responsive, mobile, layout, front end, frontend, Page Layout, squeeze page, page builder plugin, drag-n-drop page builder
4
  Requires at least: 4.3
5
- Tested up to: 4.8
6
- Stable tag: 1.3.2.1
7
  License: GPLv3
8
 
9
  Front-end page builder for WordPress with drag and drop editing. Build PRO responsive websites and landing pages. Visually customize any page element.
@@ -134,6 +134,28 @@ Upcoming Releases:
134
  * [Please, report any bugs on GitHub](https://github.com/livecomposer/live-composer-page-builder/issues/)
135
  * [You can download any previous version here](https://wordpress.org/plugins/live-composer-page-builder/developers/)
136
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  = 1.3.2.1 - July 25th 2017 =
138
 
139
  = New: =
2
  Contributors: LiveComposer
3
  Tags: page builder, visual composer, visual editor, visual builder, drag and drop builder, landing page builder, frontend editor, frontend builder, landing pages, landing page, website builder, theme builder, site-builder, layout builder, drag-and-drop, builder, editor, responsive, mobile, layout, front end, frontend, Page Layout, squeeze page, page builder plugin, drag-n-drop page builder
4
  Requires at least: 4.3
5
+ Tested up to: 4.8.1
6
+ Stable tag: 1.3.3
7
  License: GPLv3
8
 
9
  Front-end page builder for WordPress with drag and drop editing. Build PRO responsive websites and landing pages. Visually customize any page element.
134
  * [Please, report any bugs on GitHub](https://github.com/livecomposer/live-composer-page-builder/issues/)
135
  * [You can download any previous version here](https://wordpress.org/plugins/live-composer-page-builder/developers/)
136
 
137
+ = 1.3.3 - August 9th 2017 =
138
+
139
+ = Bug Fixes: =
140
+ * Fixes the broken div wrappers in header/footers introduced in the previous version
141
+ * Fixes a JS error that appears in the Menu Pro (no outerHide function)
142
+ * Issue [#753](https://github.com/livecomposer/live-composer-page-builder/issues/753): Fixes a bug of pagination when the LC caching is active
143
+ * Issue [#754](https://github.com/livecomposer/live-composer-page-builder/issues/754): Fixes a bug with the active menu style when the LC caching is active
144
+ * Issue [#755](https://github.com/livecomposer/live-composer-page-builder/issues/755): Fixes the broken google map when the LC caching is active
145
+ * Issue [#756](https://github.com/livecomposer/live-composer-page-builder/issues/756): Fixes a bug in builder.frontend.main.js
146
+ * Issue [#757](https://github.com/livecomposer/live-composer-page-builder/issues/757): Fixes a bug with the header/footer editing overlay
147
+
148
+ = Information about cache: =
149
+
150
+ If have problems with the cache, you can disable the Live Composer caching feature from WP Admin > Live Composer > Settings > Performance > HTML/CSS caching.
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
  = 1.3.2.1 - July 25th 2017 =
160
 
161
  = New: =