0byt3m1n1
Path:
/
home1
/
aserty
/
public_html
/
bonniescraftygifts.com
/
iFzj4
/
configCHM
/
Jump
/
0-aserty
/
natureultra.com
/
wp-content
/
plugins
/
thrive-visual-editor
/
editor
/
js
/
[
Home
]
File: thrive_content_builder_frontend.min.js
/*! Thrive Content Builder - 2015-04-15 * http://www.thrivethemes.com/ * Copyright (c) 2015 Thrive Themes */ var TVE_jQFn={};ThriveGlobal.$j(document).ready(function(){function a(){ThriveGlobal.$j(".tve-m-trigger:visible").length?ThriveGlobal.$j(".tve-m-trigger").each(function(){var a=ThriveGlobal.$j(this).parent().find("> ul");if(!a.data("tve-colors-added")&&a.find("ul a").attr("data-tve-custom-colour")){var b=a.find("ul a").attr("data-tve-custom-colour");a.find("> li > a").each(function(){var a=ThriveGlobal.$j(this);a.attr("data-tve-custom-colour")&&(a.attr("data-o-color",a.attr("data-tve-custom-colour")),a.attr("data-tve-custom-colour",b))})}a.data("tve-colors-added",!0)}):(ThriveGlobal.$j(".tve-m-expanded").removeClass("tve-m-expanded"),ThriveGlobal.$j(".tve-m-trigger").each(function(){var a=ThriveGlobal.$j(this).parent().find("> ul");if(!a.data("tve-colors-added")&&a.find("> li > a").attr("data-o-color")){var b=a.find("> li > a"),c=b.attr("data-o-color");b.attr("data-tve-custom-colour",c).removeAttr("data-o-color")}a.data("tve-colors-added",!1)}))}var b=ThriveGlobal.$j(tve_frontend_options.is_editor_page?"#tve_editor":"body"),c=[];b.on("click",".tve_scT > ul li",function(a){var b=ThriveGlobal.$j(this),c=b.parents(".tve_scT").first(),d=c.find("> .tve_scTC").eq(b.index()),e=c.find("> ul .tve_tS"),f=e.attr("data-tve-custom-colour"),g=b.attr("data-tve-custom-colour");return b.attr("data-tve-custom-colour","undefined"!=typeof f&&f!==!1?f:""),e.attr("data-tve-custom-colour","undefined"!=typeof g&&g!==!1?g:""),c.find("> ul .tve_tS").removeClass("tve_tS"),c.find("> .tve_scTC").hide(),b.addClass("tve_tS"),d.show(),d.find("iframe").each(function(){var a=ThriveGlobal.$j(this);a.attr("src",a.attr("data-src")),a.attr("data-src",""),a.removeClass("tcb-dr-done")}),c.find("> .tve_scTC").each(function(a){if(a!==b.index()){var c=ThriveGlobal.$j(this);c.find("iframe").not(".tcb-dr-done").each(function(){var a=ThriveGlobal.$j(this);a.attr("data-src",a.attr("src")),a.attr("src",""),a.addClass("tcb-dr-done")})}}),a.preventDefault(),!1}),b.on("click",".tve_faqB",function(){var a=ThriveGlobal.$j(this).parents(".tve_faq"),b=ThriveGlobal.$j(this),c=ThriveGlobal.$j(b).siblings(".tve_faqC");c.is(":visible")?(c.find("iframe").not(".tcb-dr-done").each(function(){var a=ThriveGlobal.$j(this);a.addClass("tcb-dr-done"),a.attr("data-src",a.attr("src")),a.attr("src","")}),c.slideUp("fast"),a.removeClass("tve_oFaq")):(c.find("iframe").each(function(){var a=ThriveGlobal.$j(this);a.removeClass("tcb-dr-done"),a.attr("src",a.attr("data-src")),a.attr("data-src","")}),c.slideDown("fast"),a.addClass("tve_oFaq"))}),tve_frontend_options.is_editor_page||(b.on("mouseenter",".tve_w_menu.tve_horizontal li",function(){var a=ThriveGlobal.$j(this);a.parents(".tve-m-expanded").length||a.hasClass("menu-item-has-children")&&a.find("> ul").stop().fadeIn("fast")}).on("mouseleave",".tve_w_menu.tve_horizontal li",function(){var a=ThriveGlobal.$j(this);a.parents(".tve-m-expanded").length||a.hasClass("menu-item-has-children")&&a.find("> ul").stop().fadeOut("fast")}),b.on("click",".tve-m-trigger",function(){var a=ThriveGlobal.$j(this).parent().find("> ul");return a.toggleClass("tve-m-expanded"),!1}),"undefined"!=typeof TVE_Event_Manager_Registered_Callbacks&&(TCB_Front.event_triggers(b),ThriveGlobal.$j.each(tve_frontend_options.page_events,function(a,b){TVE_Event_Manager_Registered_Callbacks[b.a]&&ThriveGlobal.$j(document).on("tve-page-event-"+b.t,function(){return TVE_Event_Manager_Registered_Callbacks[b.a].call(document,b.t,b.a,b.config?b.config:{})})})),c.push(TCB_Front.postGridLayout),c.push(a),TCB_Front.postGridLayout(),a()),TCB_Front.onDOMReady(),"undefined"==typeof ThriveApp&&(TCB_Front.pageSectionHeight(),c.push(TCB_Front.pageSectionHeight)),ThriveGlobal.$j(window).resize(function(){ThriveGlobal.$j.each(c,function(a,b){b.call(null)})})});var TCB_Front={postGridLayout:function(){var a=ThriveGlobal.$j(".tve_post_grid_masonry");if(a.length>0)try{a.masonry()}catch(b){console.log(b)}var c=ThriveGlobal.$j(".tve_post_grid_grid");c.length<=0||c.find(".tve_pg_row").each(function(){var a=0,b=ThriveGlobal.$j(this).css("height","");b.find(".tve_post").each(function(){var b=ThriveGlobal.$j(this),c=parseInt(b.css("height"));c>a&&(a=c),b.css("height","100%")}),b.css("height",a+"px")})},isValidUrl:function(a){var b=/(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return b.test(a)},pageSectionHeight:function(){var a=ThriveGlobal.$j(window);ThriveGlobal.$j(".pdfbg.pdwbg").css({"box-sizing":"border-box",height:a.height()+"px"}),ThriveGlobal.$j(".pddbg").css("max-width",a.width()+"px"),ThriveGlobal.$j(".pddbg.pdfbg").each(function(){var a=ThriveGlobal.$j(this).css("height",""),b=a.attr("data-height"),c=a.attr("data-width");if(void 0!==b&&void 0!==c){var d=a.parent().width(),e=d*b/c;c>=d?a.css("min-height",e+"px"):a.css({"min-height":b+"px"})}})},getBrowserScrollSize:function(){var a=ThriveGlobal.$j,b={border:"none",height:"200px",margin:"0",padding:"0",width:"200px"},c=a("<div>").css(a.extend({},b)),d=a("<div>").css(a.extend({left:"-1000px",overflow:"scroll",position:"absolute",top:"-1000px"},b)).append(c).appendTo("body").scrollLeft(1e3).scrollTop(1e3),e={height:d.offset().top-c.offset().top||0,width:d.offset().left-c.offset().left||0};return d.remove(),e},openLightbox:function(a,b){function c(a,b){a.find("iframe").not(".tcb-dr-done").each(function(){var a=ThriveGlobal.$j(this).addClass("tcb-dr-done");a.attr("data-src",a.attr("src")),a.attr("src","")}),a.removeClass("tve_lb_open tve_lb_opening").addClass("tve_lb_closing"),"undefined"==typeof b&&(d.removeClass(f).css("padding-right",""),e.removeClass(f)),setTimeout(function(){a.attr("class","").css("display","none").find("tve_p_lb_content").trigger("tve.lightbox-close")},300)}var d=ThriveGlobal.$j("body"),e=ThriveGlobal.$j("html"),f="tve-o-hidden tve-l-open tve-hide-overflow",g=this.getBrowserScrollSize().width,h=parseInt(d.css("padding-right"));a.off().on("click",".tve_p_lb_close",function(){c(a)}),d.off("keyup.tve_lb_close").on("keyup.tve_lb_close",function(b){27==b.which&&c(a)}),a.children(".tve_p_lb_overlay").off("click.tve_lb_close").on("click.tve_lb_close",function(){c(a)}),c(ThriveGlobal.$j(".tve_p_lb_background.tve_lb_open"),!0),a.addClass("tve_p_lb_background tve_lb_anim_"+b),d.addClass(f),e.addClass(f);var i=ThriveGlobal.$j(window).height(),j=i<ThriveGlobal.$j(document).height();j&&d.css("padding-right",h+g+"px"),a.find(".tve_scT").length?a.find(".tve_scT").each(function(){var a=ThriveGlobal.$j(this),b=parseInt(a.attr("data-selected"));tve_frontend_options.is_editor_page||a.find("> ul li").eq(isNaN(b)?0:b).click()}):a.find("iframe").each(function(){var a=ThriveGlobal.$j(this);a.attr("data-src")&&(a.attr("src",a.attr("data-src")),a.removeClass("tcb-dr-done"))}),setTimeout(function(){a.addClass("tve_lb_opening"),setTimeout(function(){var b=a.find(".tve_p_lb_content"),c=b.outerHeight(!0),d=(i-c)/2;a.find(".tve_p_lb_overlay").css({height:c+80+"px","min-height":i+"px"}),b.css("top",(40>d?40:d)+"px"),c+40>i&&a.addClass("tve-scroll")},0)},20),setTimeout(function(){a.removeClass("tve_lb_opening").addClass("tve_lb_open").find(".tve_p_lb_content").trigger("tve.lightbox-open")},300)},event_triggers:function(a){window.TVE_Event_Manager_Registered_Callbacks&&a.find(".tve_evt_manager_listen").each(function(){var a=ThriveGlobal.$j(this),b=a.attr("data-tcb-events");return b||(b=a.closest(".thrv_wrapper").attr("data-tcb-events")),b?(b=ThriveGlobal.$j.parseJSON(b.replace("__TCB_EVENT_","").replace("_TNEVE_BCT__","")),void ThriveGlobal.$j.each(b,function(b,c){TVE_Event_Manager_Registered_Callbacks[c.a]&&a.off(c.t+".tcbevt").on(c.t+".tcbevt",function(){return TVE_Event_Manager_Registered_Callbacks[c.a].call(a[0],c.t,c.a,c.config?c.config:{})})})):!0})},onDOMReady:function(){ThriveGlobal.$j.each(TVE_jQFn,function(a,b){ThriveGlobal.$j.fn[a]=b}),ThriveGlobal.$j(".tve_scT").each(function(){var a=ThriveGlobal.$j(this),b=parseInt(a.attr("data-selected"));a.find("iframe").not(".tcb-dr-done").each(function(){var a=ThriveGlobal.$j(this);a.addClass("tcb-dr-done"),a.attr("data-src",a.attr("src")),a.attr("src","")}),tve_frontend_options.is_editor_page||a.find("> ul li").eq(isNaN(b)?0:b).click()}),ThriveGlobal.$j(".thrv_toggle_shortcode").each(function(){var a=ThriveGlobal.$j(this);a.find("iframe").not(".tcb-dr-done").each(function(){var a=ThriveGlobal.$j(this);a.addClass("tcb-dr-done"),a.attr("data-src",a.attr("src")),a.attr("src","")})}),tve_frontend_options.is_editor_page||(ThriveGlobal.$j(".tve_p_lb_content iframe").not(".tcb-dr-done").each(function(){var a=ThriveGlobal.$j(this).addClass("tcb-dr-done");a.attr("data-src",a.attr("src")),a.attr("src","")}),ThriveGlobal.$j(".thrv_content_reveal").not(".tcb-dr-done").each(function(){var a=ThriveGlobal.$j(this).addClass("tcb-dr-done"),b=parseInt(a.attr("data-after")),c=a.parents(".tve_p_lb_content");b=isNaN(b)?0:b,a.find("iframe").not(".tcb-dr-done").each(function(){var a=ThriveGlobal.$j(this);a.addClass("tcb-dr-done"),a.attr("data-src",a.attr("src")),a.attr("src","")});var d=function(){setTimeout(function(){a.slideDown(200),"1"===tve_frontend_options.is_single&&"string"==typeof a.attr("data-redirect-url")&&a.attr("data-redirect-url").length&&TCB_Front.isValidUrl(a.attr("data-redirect-url"))&&(window.location=a.attr("data-redirect-url")),a.find("iframe").each(function(){var a=ThriveGlobal.$j(this);a.removeClass("tcb-dr-done"),a.attr("src",a.attr("data-src")),a.attr("data-src","")})},1e3*b)};c.length?c.bind("tve.lightbox-open",d):d()}),ThriveGlobal.$j(".thrv_tw_qs").tve_front_tw_qs(),ThriveGlobal.$j(".tve_countdown_timer_evergreen").thrive_tcb_timer(),ThriveGlobal.$j(".thrv_countdown_timer").not(".tve_countdown_timer_evergreen").thrive_tcb_timer(),ThriveGlobal.$j(".thrv_lead_generation").tve_front_lead_generation())}};TVE_jQFn.tve_front_tw_qs=function(){return this.each(function(){var a=ThriveGlobal.$j(this);if(a.data("tve_front_tw_qs_done"))return this;a.data("tve_front_tw_qs_done",!0),a.click(function(){window.open(b(),"_blank")});var b=function(){var b=a.attr("data-use_custom_url")&&a.attr("data-custom_url"),c=b?a.attr("data-custom_url"):window.location.href,d=a.data("url")+"?text="+encodeURIComponent(a.find("p").text())+"&url="+encodeURIComponent(c);return a.data("via").length>0&&(d+="&via="+a.data("via")),d}})},TVE_jQFn.tve_front_lead_generation=function(){return this.each(function(){var a=ThriveGlobal.$j(this),b=a.find("form");if(a.data("tve_lg_done"))return this;a.data("tve_lg_done",!0);var c={errClass:"tve-lg-error",init:function(){this.container=ThriveGlobal.$j("#tve-lg-error-container"),this.container.length||(this.container=ThriveGlobal.$j('<div id="tve-lg-error-container"></div>').appendTo("body"),this.container.on("click",".tve-lg-err-close",ThriveGlobal.$j.proxy(this.close,this))),this.container.empty().hide(),this.clear()},close:function(){this.container.fadeOut(200);var a=b.find("."+this.errClass);return a.length||(a=b.find("input,select,textarea")),a.first().focus(),!1},clear:function(){b.find("input,select,textarea").removeClass(this.errClass)},_markError:function(a,b,c){a.addClass(this.errClass),"required"===c&&this.container.find(".tve-lg-required").length||this.container.append('<div class="tve-lg-err-item tve-lg-'+c+'">'+b+"</div>")},show:function(){this.container.append('<a href="javascript:void(0)" class="tve-lg-err-close" title="Close"><span class="thrv-icon thrv-icon-cross"></span></a>');var a=this;setTimeout(function(){var c=b.offset(),d=parseInt(b.css("margin-top")),e=parseInt(b.css("margin-left")),f=c.top-10-a.container.outerHeight(!0)-(isNaN(d)?0:d);b.parents(".thrv-ribbon").length&&("bottom"==b.parents(".tve-leads-ribbon").attr("data-position")?f+=7:f=c.top+b.outerHeight()),a.container.css({top:f+"px",left:c.left-(isNaN(e)?0:e),width:b.outerWidth()}).fadeIn(200)},50)},phone:function(a,b){return a.val().replace(/[0-9]+/,"").length?(this._markError(a,b,"phone"),!1):!0},required:function(a,b){var c=!0;return c="radio"===a.attr("type")?ThriveGlobal.$j('input[name="'+a.attr("name")+'"]').is(":checked"):"checkbox"===a.attr("type")?a.is(":checked"):ThriveGlobal.$j.trim(a.val()).length>0,c?!0:(this._markError(a,b,"required"),!1)},email:function(a,b){var c=/\S+@\S+\.\S+/;return c.test(a.val())?!0:(this._markError(a,b,"email"),!1)},getErrors:function(a){var b=new RegExp("__CONFIG_lead_generation__","g");try{return JSON.parse(a.find(".thrv_lead_generation_errors").html().replace(b,""))}catch(c){return{required:"Please fill in all of the required fields",phone:"The phone number is not valid",email:"The email address is not valid"}}}},d=function(){a.find("form").attr("target",a.data("form-target"))},e=function(){var d=c.getErrors(a);b.submit(function(){var a=!0,e=ThriveGlobal.$j(this);return c.init(),e.find("input, select, textarea").each(function(){var b=ThriveGlobal.$j(this),e=b.data("validation"),f=b.data("required");1===f&&(c.required(b,d.required)||(a=!1)),"undefined"!=typeof e&&"none"!==e&&c[e]&&(c[e](b,d[e])||(a=!1))}),a||(c.show(),b.find("."+c.errClass).first().focus()),a})};d(),a.find(".thrv_lead_generation_errors").length&&e()})},TVE_jQFn.thrive_tcb_timer=function(){return this.each(function(){var a,b=ThriveGlobal.$j(this),c=new Date,d=new Date(b.attr("data-date")+"T"+b.attr("data-hour")+":"+b.attr("data-min")+":00"+b.attr("data-timezone")),e=0,f=0,g=0,h=0,i=2,j=b.attr("data-text"),k=b.hasClass("tve_countdown_timer_evergreen"),l=parseInt(b.attr("data-day")),m=parseInt(b.attr("data-hour")),n=parseInt(b.attr("data-min")),o=parseInt(b.attr("data-sec"));if(b.data("tcb_timer_done"))return this;if(b.data("tcb_timer_done",!0),k){d=new Date;var p=ThriveGlobal.$j.cookie(b.attr("data-id"));p&&(p=p.split("-"),l=parseInt(p[0]),m=parseInt(p[1]),n=parseInt(p[2]),o=parseInt(p[3])),d.setTime(c.getTime()+24*l*3600*1e3+3600*m*1e3+60*n*1e3+1e3*o)}var q=function(){var a=function(a,b){return ThriveGlobal.$j('<span class="part-'+a+'">'+b+"</span>")};b.find(".tve_t_sec .t-digits").empty().append(a(2,Math.floor(h/10))).append(a(1,h%10)),b.find(".tve_t_min .t-digits").empty().append(a(2,Math.floor(g/10))).append(a(1,g%10)),b.find(".tve_t_hour .t-digits").empty().append(a(2,Math.floor(f/10))).append(a(1,f%10));for(var c=b.find(".tve_t_day .t-digits").empty(),d=e,j=1;i>=j;j++)c.append(a(j,d%10)),d=Math.floor(d/10);s(c.css("min-width",b.find(".tve_t_sec .t-digits > span").outerWidth()*i+"px"),e,i)},r=function(a,b){if(a.html()==b)return a;a.removeClass("next");var c=a.clone().removeClass("go-down").addClass("next").html(b);return a.before(c).next(".go-down").remove(),a.addClass("go-down"),setTimeout(function(){c.addClass("go-down")},20),a},s=function(a,b,c){"undefined"==typeof c&&(c=!1);var d=0;if(99>=b)r(a.find(".part-1").first(),b%10),r(a.find(".part-2").first(),Math.floor(b/10)),d=2;else for(;b;)d++,r(a.find(".part-"+d).first(),b%10),b=Math.floor(b/10);if(c!==!1&&c>d)for(var e=d+1;c>=e;e++)r(a.find(".part-"+e).first(),0)},t=function(){h--,0>h&&(h=59,g--),0>g&&(g=59,f--),0>f&&(f=23,e--),s(b.find(".tve_t_sec .t-digits"),h),s(b.find(".tve_t_min .t-digits"),g),s(b.find(".tve_t_hour .t-digits"),f),s(b.find(".tve_t_day .t-digits"),e,i),0>=e&&0>=f&&0>=g&&0>=h&&(clearInterval(a),v()),k&&u(e,f,g,h)},u=function(a,c,d,e){var f=ThriveGlobal.$j.makeArray(arguments).join("-"),g=new Date;g.setTime(g.getTime()+24*parseInt(b.attr("data-expday"))*3600*1e3+3600*parseInt(b.attr("data-exphour"))*1e3),ThriveGlobal.$j.cookie(b.attr("data-id"),f,{expires:g})},v=function(){j&&(b.find(".tve_t_part").addClass("ct_finished"),b.find(".tve_t_text").html(j).fadeIn(200))};c>=d?v():(h=Math.floor((d.getTime()-c.getTime())/1e3),g=Math.floor(h/60),h%=60,f=Math.floor(g/60),g%=60,e=Math.floor(f/24),f%=24,e>99&&(i=e.toString().length),q(),b.addClass("init_done"),a=setInterval(t,1e3))})};