1
2
|
/* Do not modify this file directly. It is compiled from other files. */
jQuery(document).ready(function(t){var a={default:function(a){var e='<div class="jitm-card jitm-banner '+(a.CTA.message?"has-call-to-action":"")+" is-upgrade-premium "+a.content.classes+'" data-stats_url="'+a.jitm_stats_url+'">';return e+='<div class="jitm-banner__icon-plan">'+a.content.icon+"</div>",e+='<div class="jitm-banner__content">',e+='<div class="jitm-banner__info">',e+='<div class="jitm-banner__title">'+a.content.message+"</div>",a.content.description&&""!==a.content.description&&(e+='<div class="jitm-banner__description">'+a.content.description+"</div>"),e+="</div>",a.CTA.message&&(e+='<div class="jitm-banner__action">',e+='<a href="'+a.url+'" target="_blank" title="'+a.CTA.message+'" data-module="'+a.feature_class+'" type="button" class="jitm-button is-compact '+(a.CTA.primary?"is-primary":"")+' jptracks" data-jptracks-name="nudge_click" data-jptracks-prop="jitm-'+a.id+'">'+a.CTA.message+"</a>",e+="</div>"),e+='<a href="#" data-module="'+a.feature_class+'" class="jitm-banner__dismiss"></a>',e+="</div>",e+="</div>",t(e)}},e=function(e,i){var n;(n=i.template)&&a[n]||(n="default");var s=a[n](i);s.find(".jitm-banner__dismiss").click(function(a){return function(e){e.preventDefault(),a.hide(),t.ajax({url:window.jitm_config.api_root+"jetpack/v4/jitm",method:"POST",data:{id:i.id,feature_class:i.feature_class}})}}(s)),e.replaceWith(s)};t(".jetpack-jitm-message").each(function(){var a=t(this),i=a.data("message-path"),n=a.data("query");t.get(window.jitm_config.api_root+"jetpack/v4/jitm",{message_path:i,query:n,_wpnonce:a.data("nonce")}).then(function(t){0!==t.length&&t[0].content&&e(a,t[0])})})});
|