Initial commit
This commit is contained in:
commit
22a1006598
1816 files changed
+410742
No files matched your search
@@ -0,0 +1 @@
|
||||
!function(t){if(t&&t.blocks&&t.blockEditor&&t.components&&t.element&&t.i18n){var n,e=t.blocks.registerBlockType,i=t.blockEditor,o=t.components,l=t.element,s=t.i18n,r=i.InspectorControls,a=i.InnerBlocks,c=i.useBlockProps,u=o.PanelBody,_=o.SelectControl,f=o.FormTokenField,d=o.Notice,g=l.createElement,h=l.Fragment,m=l.useMemo,w=l.useEffect,p=s.__,x=window.fcrmConditionalContentConfig||{},v=!!x.hasPro,y=g("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},g("rect",{x:1,y:1,width:22,height:22,rx:5,fill:"#6E41E2"}),g("path",{d:"M6 9.8L18.4 6.4L17.6 9.3L7.8 12L6 9.8Z",fill:"#FFFFFF"}),g("path",{d:"M7.5 14.2L16.5 11.8L15.8 14.6L9.3 16.4L7.5 14.2Z",fill:"#FFFFFF"})),b=(n=x.tags||[],Array.isArray(n)?n.map(function(t){return{id:String(t.id||""),title:String(t.title||"").trim()}}).filter(function(t){return!!t.id&&!!t.title}):[]);e("fluent-crm/conditional-content",{apiVersion:3,title:p("Conditional Content","fluent-crm"),description:p("Show or hide content based on contact tags or visitor login state.","fluent-crm"),category:"widgets",icon:y,keywords:[p("conditional","fluent-crm"),p("visibility","fluent-crm"),p("fluentcrm","fluent-crm")],supports:{align:["wide","full"],anchor:!0,html:!1},attributes:{condition_type:{type:"string",default:"show_if_tag_exist"},tag_ids:{type:"array",default:[]}},edit:function(t){var n,e,i=t.attributes,o=t.setAttributes,l=(n=i.condition_type||"show_if_tag_exist",(e=String(n).trim())?{show_if_logged_in:"show_if_user_logged_in",show_if_public_users:"show_if_user_not_logged_in",show_if_tag_exists:"show_if_tag_exist",show_if_tag_not_exists:"show_if_tag_not_exist"}[e]||e:"show_if_tag_exist"),s=Array.isArray(i.tag_ids)?i.tag_ids.map(String):[],x="show_if_tag_exist"===l||"show_if_tag_not_exist"===l;w(function(){(i.condition_type||"")!==l&&o({condition_type:l})},[i.condition_type,l]);var y=m(function(){var t={};return b.forEach(function(n){t[n.id]=n.title}),t},[]),S=m(function(){var t={};return b.forEach(function(n){t[n.title]=n.id}),t},[]),F=m(function(){return s.map(function(t){return y[t]||t})},[s,y]),C=m(function(){return b.map(function(t){return t.title})},[]),k=c({className:"fc-cond-section",style:{backgroundColor:"#fff8d9",border:"1px solid #f1d676",borderRadius:"6px",padding:"12px"}});return g(h,null,g(r,null,g(u,{title:p("Conditional Settings","fluent-crm")},g(_,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:p("Condition Type","fluent-crm"),value:l,onChange:function(t){var n=t||"show_if_tag_exist";o({condition_type:n,tag_ids:"show_if_tag_exist"===n||"show_if_tag_not_exist"===n?s:[]})},options:[{value:"show_if_tag_exist",label:p("Show if in selected tags","fluent-crm")},{value:"show_if_tag_not_exist",label:p("Show if not in selected tags","fluent-crm")},{value:"show_if_user_logged_in",label:p("Show if user is logged in","fluent-crm")},{value:"show_if_user_not_logged_in",label:p("Show if user is not logged in","fluent-crm")}]}),v?x?g(f,{label:p("Tags","fluent-crm"),value:F,suggestions:C,onChange:function(t){if(v){var n=t.map(function(t){return S[t]}).filter(Boolean);o({tag_ids:n})}},__experimentalExpandOnFocus:!0,__experimentalAutoSelectFirstMatch:!0,__experimentalShowHowTo:!1,__next40pxDefaultSize:!0}):null:g(d,{status:"warning",isDismissible:!1},p("Conditional Content requires FluentCRM Pro.","fluent-crm")),g("div",{className:"components-base-control__help",style:{marginTop:"12px"}},g("strong",null,p("How conditions work","fluent-crm")),g("ul",{style:{margin:"8px 0 0 16px"}},g("li",null,p("Show if in selected tags: visible when contact has any selected tag.","fluent-crm")),g("li",null,p("Show if not in selected tags: hidden when contact has any selected tag.","fluent-crm")),g("li",null,p("Show if user is logged in: visible for logged-in visitors only.","fluent-crm")),g("li",null,p("Show if user is not logged in: visible for logged-out visitors only.","fluent-crm"))),g("p",{style:{margin:"8px 0 0"}},p("Yellow background is editor-only to identify conditional content.","fluent-crm"))))),g("div",k,g("div",{className:"fc-cond-blocks"},g(a,null))))},save:function(){var t=c.save({className:"fc-cond-section"});return g("div",t,g("div",{className:"fc-cond-blocks"},g(a.Content,null)))}})}}(window.wp);
|
||||
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
// Silence is golden.
|
||||
@@ -0,0 +1 @@
|
||||
body.fc_unsub{background-color:#eee!important}.fluentcrm_unsubscribe_wrapper{max-width:600px;margin:0 auto;padding:100px 0 0}.fluentcrm_unsubscribe_wrapper .fluentcrm_un_title{text-align:center;margin-bottom:20px}.fluentcrm_unsubscribe_wrapper .fluentcrm_un_title img{max-height:100px;margin:0 auto}.fluentcrm_unsubscribe_wrapper .fluentcrm_un_title h3{margin:0}.fluentcrm_unsubscribe_wrapper .fluentcrm_un_form_wrapper{line-height:150%;font-size:14px;color:#333;padding:20px;border-radius:6px;background-color:#fff}.fluentcrm_unsubscribe_wrapper .fluentcrm_un_form_wrapper h3{margin:0 0 5px;padding:0;font-size:28px}.fluentcrm_unsubscribe_wrapper .fluentcrm_un_form_wrapper .hide_wrap{display:none}.fluentcrm_unsubscribe_wrapper h4.mainling_list_group_title{font-size:17px;margin:10px 0}.fluentcrm_unsubscribe_wrapper .fluentcrm_form_item{margin-bottom:20px}.fluentcrm_unsubscribe_wrapper .fluentcrm_form_item>label{font-weight:700;margin-bottom:5px;display:block}.fluentcrm_unsubscribe_wrapper .fluentcrm_form_item .fluentcrm_form_control{display:block;width:100%}.fluentcrm_unsubscribe_wrapper .fluentcrm_radio_group>label{display:block}.fluentcrm_error{color:#ff5722;border:1px solid #FF5722;padding:10px;border-radius:10px}.fluentcrm_success{margin-top:20px;font-size:16px;text-align:center;padding:20px 0}.fc_pref_form_wrap{width:100%;margin:auto!important;overflow:hidden;box-sizing:border-box}@media (max-width: 550px){.fc_pref_form_wrap{padding:30px}}.fc_pref_form_wrap *{box-sizing:border-box}.fc_pref_form_wrap .fluentcrm_success{background:#222530;color:#fff}.fluentcrm_web_body{padding:0;margin:0;background-color:#ebebeb}.fluentcrm_web_body .fluentcrm_web_view_header{display:flex;width:100%;margin:0;text-align:center;justify-content:center;align-items:center;background:#fff;padding:10px 0}.fluentcrm_web_body .fluentcrm_web_view_header .fluentcrm_web_logo{display:inline-block;margin-right:20px}.fluentcrm_web_body .fluentcrm_web_view_header .fluentcrm_web_logo img{max-height:44px}.fluentcrm_web_body .fluentcrm_web_view_header .fluentcrm_web_heading{display:inline-block}.fluentcrm_web_body .fluentcrm_web_view_header .fluentcrm_web_heading h1{font-size:22px;margin:0;padding:0}.fluentcrm_web_body .fluentcrm_email_wrapper{max-width:800px;margin:20px auto;padding:0;background:#fff}.fluentcrm_web_body .fluentcrm_email_wrapper .templateContainer{margin:0 auto}.fluentcrm_web_body .fluentcrm_email_footer{padding-top:20px;text-align:center}form.fc_public_form *:before,form.fc_public_form *:after,form.fc_public_form *{box-sizing:border-box}form.fc_public_form .fc_checkboxes .fc_list_items input[type=checkbox]:checked:before{background:#222530!important;border-color:#222530!important}form.fc_public_form .fc_field{display:block;width:100%;margin-bottom:25px;overflow:hidden}form.fc_public_form .fc_field>label{display:block;width:100%;font-weight:500;color:#1c1c1c;opacity:.9;font-size:15px;line-height:1;margin-bottom:10px}form.fc_public_form .fc_field #fc_name_prefix,form.fc_public_form .fc_field .fc_input_control{margin:0;background:#fff;width:100%;border:1px solid rgba(16,24,40,.2);font-size:16px;border-radius:5px;padding:8px 15px;display:block}form.fc_public_form .fc_field #fc_name_prefix:read-only,form.fc_public_form .fc_field .fc_input_control:read-only{background:#e9ecef;cursor:no-drop}form.fc_public_form .fc_field #fc_name_prefix:focus,form.fc_public_form .fc_field .fc_input_control:focus{border-color:#7756e6!important;outline:none}form.fc_public_form .fc_field.fc_field_date_of_birth .fc_date_dropdowns{display:flex;align-items:center;gap:8px}form.fc_public_form .fc_field.fc_field_date_of_birth .fc_date_dropdowns .fc_date_dropdown{flex:1;background:#fff;border:1px solid rgba(16,24,40,.2);border-radius:5px;font-size:16px;padding:8px 10px;height:auto;margin:0;-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}form.fc_public_form .fc_field.fc_field_date_of_birth .fc_date_dropdowns .fc_date_dropdown:focus{border-color:#7756e6!important;outline:none}form.fc_public_form .fc_field.fc_pref_submit{margin-bottom:0}form.fc_public_form .fc_2_col{display:flex;flex-wrap:wrap}form.fc_public_form .fc_2_col.fc_email_phone_date{flex-wrap:nowrap;gap:20px}@media (max-width: 767px){form.fc_public_form .fc_2_col.fc_email_phone_date{display:grid;grid-template-columns:1fr 1fr;flex-wrap:wrap}form.fc_public_form .fc_2_col.fc_email_phone_date .fc_field{margin-bottom:0}}@media (max-width: 550px){form.fc_public_form .fc_2_col.fc_email_phone_date{grid-template-columns:1fr}}form.fc_public_form .fc_field_lists>label,form.fc_public_form .fc_address_info_heading{margin:15px 0 20px;font-size:22px;font-weight:600;border-top:1px solid rgba(28,28,28,.2);padding-top:20px}@media (max-width: 550px){form.fc_public_form .fc_field_lists>label,form.fc_public_form .fc_address_info_heading{margin-top:30px}}form.fc_public_form .fc_custom_fields_heading{width:100%;margin:15px 0 20px;border-top:1px solid rgba(28,28,28,.2)}form.fc_public_form .fc_input_control.fc_multiplLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
jQuery(document).ready(function(e){var r=e(".fluentcrm_public_pref_form");r.length&&(r.find("input[name=reason]").on("change",function(){"other"===r.find("input[name=reason]:checked").val()?r.find("#fluentcrm_other_reason_wrapper").show():r.find("#fluentcrm_other_reason_wrapper").hide()}),r.on("submit",function(r){r.preventDefault();var s=e(this).serialize();e(".fluentcrm_form_responses").html(""),e.post(window.fluentcrm_public_pref.ajaxurl,s).then(r=>{e(".fluentcrm_un_form_wrapper").html('<div class="fluentcrm_success">'+r.data.message+"</div>"),r.data.redirect_url&&(window.location.href=r.data.redirect_url)}).fail(r=>{let s="Sorry! Something is wrong. Please try again";r.responseJSON&&r.responseJSON.data&&r.responseJSON.data.message&&(s=r.responseJSON.data.message),e(".fluentcrm_form_responses").html('<div class="fluentcrm_error">'+s+"</div>")}).always(()=>{})}),"yes"==window.fluentcrm_public_pref.auto_unsubscribe&&setTimeout(function(){e("#fluentcrm_unsubscribe_submit").click()},500));var s=e("#pref_unsubscribe");if(s.length){var a=!1;s.on("click",function(r){if(r.preventDefault(),!a){a=!0,s.css("pointer-events","none").attr("aria-disabled","true");var n={action:"fluentcrm_unsubscribe_ajax",secure_hash:e("#fluentcrm_preferences_form").find('input[name="_secure_hash"]').val()};e(".fluentcrm_form_responses").html(""),e.post(window.fluentcrm_public_pref.ajaxurl,n).then(r=>{e(".fc_manage_sub_form").html('<div class="fluentcrm_success">'+r.data.message+"</div>"),r.data.redirect_url&&(window.location.href=r.data.redirect_url)}).fail(r=>{let s="Sorry! Something went wrong. Please try again";r.responseJSON&&r.responseJSON.data&&r.responseJSON.data.message&&(s=r.responseJSON.data.message),e(".fluentcrm_form_responses").html('<div class="fluentcrm_error">'+s+"</div>")}).always(()=>{a=!1,s.css("pointer-events","").removeAttr("aria-disabled")})}})}var n=e("#fc_pref_form");n.length&&n.on("submit",function(r){r.preventDefault();var s=e(this).serialize(),a=e("#fluentcrm_preferences_submit");e(".fluentcrm_form_responses").html(""),a.attr("disabled",!0).addClass("fc_btn_loading"),e.post(window.fluentcrm_sub_pref.ajaxurl,s).then(r=>{e(".fluentcrm_form_responses").html('<div class="fluentcrm_success">'+r.data.message+"</div>")}).fail(r=>{let s="Sorry! Something is wrong. Please try again";r.responseJSON&&r.responseJSON.data&&r.responseJSON.data.message&&(s=r.responseJSON.data.message),e(".fluentcrm_form_responses").html('<div class="fluentcrm_error">'+s+"</div>")}).always(()=>{a.attr("disabled",!1).removeClass("fc_btn_loading")})})});
|
||||
Reference in new issue
Block a user