File Editor
Directories:
.. (Back)
admin
src
Files:
parallax.min.js
script.min.js
setup-wizard.min.js
Create New File
Create
Edit File: setup-wizard.min.js
jQuery(document).ready(function(r){var a="#hestiawizard";r(a).smartWizard({autoAdjustHeight:!1,transition:{animation:"fade",speed:"400"},keyboard:{keyNavigation:!1},anchor:{enableNavigation:!1,enableNavigationAlways:!1}});var i,t,o=function(){var e=r(".step-progress-bar:visible li.active").next("li");0!==e.length?e.addClass("trigger-next").click():r(a).smartWizard("next")},s=function(e,a){var i=r(".tab-pane:visible .hestia-card-box:visible");if(""!==e){var t=i.find(".attachment-media-view");t.hasClass("hestia-preview-icon")?t.find(".favicon img, .app-icon-preview").attr("src",e):(t.find(".attachment-thumb").attr("src",e),t.removeClass("hidden"),t.next(".hestia-drag-drop-area").addClass("hidden"),i.find(".hestia-drag-drop-area.hidden").next("p").addClass("hidden"))}i.find(".hestia-btn.disabled").removeClass("disabled"),0<a&&i.find("input:hidden").val(a)},l=function(e){e?r(".hestia-wizard__footer .left, .hestia-wizard__footer .right").addClass("disabled"):r(".hestia-wizard__footer .left, .hestia-wizard__footer .right").removeClass("disabled")};if(r(a).on("leaveStep showStep",function(e,a,i,t,s){r(".hestia-hide-skip-btn .hestia-wizard__footer .right").addClass("hidden"),r(".step-progress-bar li").removeClass("trigger-next trigger-prev"),!window.location.hash||"#step-1"!==window.location.hash&&"#step-7"!==window.location.hash?(r(".hestia-dashboard-link").addClass("hidden"),r(".step-progress-bar:visible li:first-child").trigger("click")):(r(".hestia-dashboard-link").removeClass("hidden"),"#step-7"===window.location.hash&&(r(".gif-animation").addClass("show"),setTimeout(function(){r(".gif-animation").removeClass("show")},6e3)))}),r(".prev-wizard").on("click",function(){var e;return 0!==(e=r(".step-progress-bar:visible li.active").prev("li")).length?e.addClass("trigger-prev").click():r(a).smartWizard("prev"),!0}),r(".next-wizard").on("click",function(){return o(),!0}),r(".hestia-accordion .hestia-accordion-item .hestia-accordion-item__button").on("click",function(){var i=r(this).parents();r(".hestia-accordion .hestia-accordion-item .hestia-accordion-item__content").each(function(e,a){r(a).parent().is(i)?(r(a).prev().toggleClass("is-active"),r(a).slideToggle(),r(this).toggleClass("is-active")):(r(a).prev().removeClass("is-active"),r(a).slideUp(),r(this).removeClass("is-active"))})}),r(document).on("click","[data-sub_tab]",function(){var e=r(this).data("sub_tab");r(this).parents(".tab-pane").find(".hestia-card-box:not(.hidden)").addClass("hidden"),r(".hestia-"+e).removeClass("hidden"),r(this).is(":first-child")||r(".hestia-wizard__footer .right").removeClass("hidden"),function(e){var a=r(".step-progress-bar:visible");if(e.is(":first-child"))return e.addClass("active").removeClass("done"),a.find("li").not(e).removeClass("done").removeClass("active");e.hasClass("trigger-next")?(e.prev("li").addClass("done").removeClass("active"),e.addClass("active")):(e.next("li.active").removeClass("done").removeClass("active"),e.removeClass("done").addClass("active")),e.removeClass("trigger-next trigger-prev")}(r(this))}),r(document).on("click",".hestia-card-box button:not(.hestia-btn,.add-new,.add-btn,.hestia-accordion-item__button)",function(){o()}),r(document).on("input",'input[name="wizard[email]"]',function(){""!==r(this).val()?r(this).parents(".hestia-card-box").find(".hestia-btn").removeClass("disabled"):r(this).parents(".hestia-card-box").find(".hestia-btn").addClass("disabled")}),r(document).on("click",".hestia-card-box .form-footer button",function(){var a=r(this),i=a.parents("div.tab-pane"),e=a.data("action");if("hestia_newsletter_subscribe"===e){var t=r('input[name="wizard[email]"]');t.next(".hestia-field-error").remove();var s=t.val(),d="";if(""===s?d=hestiaSetupWizardData.errorMessages.requiredEmail:/^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/.test(s)||(d=hestiaSetupWizardData.errorMessages.invalidEmail),""!==d)return void r('<span class="hestia-field-error">'+d+"</span>").insertAfter(t)}var n="action=hestia_wizard_step_process&security="+hestiaSetupWizardData.ajax.security+"&_action="+e+"&"+jQuery("input, select").serialize();i.find(".spinner").addClass("is-active"),i.find(".hestia-card-box .hestia-error-notice").addClass("hidden"),a.addClass("disabled"),l(!0),r.post(hestiaSetupWizardData.ajax.url,n,function(e){l(!1),i.find(".spinner").removeClass("is-active"),a.removeClass("disabled"),1===e.status?o():0===e.status&&""!==e.message&&i.find(".hestia-card-box .hestia-error-notice").html("<p>"+e.message+"</p>").removeClass("hidden")},"json").fail(function(e){l(!1),i.find(".spinner").removeClass("is-active"),i.find("button.hestia-btn").removeClass("disabled")})}),r(document).on("click",".hestia-reset-media",function(){var e=r(".tab-pane:visible .hestia-card-box:visible");e.find(".attachment-media-view").addClass("hidden"),e.find(".hestia-drag-drop-area.hidden").next("p").removeClass("hidden"),e.find(".attachment-media-view").next(".hestia-drag-drop-area").removeClass("hidden"),e.find(".form-footer .hestia-btn").addClass("disabled"),e.find("input:hidden").val(0)}),"object"==typeof hestiaSetupWizardData.pluploadData){var d=new plupload.Uploader(hestiaSetupWizardData.pluploadData);d.bind("Init",function(e){var a=r(".hestia-upload-ui");e.features.dragdrop?(a.addClass("drag-drop"),r("#drag-drop-area, #icon-drag-drop-area").bind("dragover.wp-uploader",function(){a.addClass("drag-over")}).bind("dragleave.wp-uploader, drop.wp-uploader",function(){a.removeClass("drag-over")})):(a.removeClass("drag-drop"),r("#drag-drop-area, #icon-drag-drop-area").unbind(".wp-uploader"))}),d.init(),d.bind("FilesAdded",function(e,a){void 0===a.url&&(e.refresh(),e.start())}),d.bind("FileUploaded",function(e,a,i){if(void 0===a.url){var t=r.parseJSON(i.response);1===t.status?s(t.attachment_url,t.attachment_id):r(".tab-pane:visible").find(".hestia-card-box:visible").find(".hestia-error-notice").html("<p>"+t.message+"</p>").removeClass("hidden")}else s(a.url,a.id);l(!1),r(".tab-pane:visible").find(".hestia-card-box:visible").find("span.spinner").removeClass("is-active")}),d.bind("Error",function(e,a){l(!1),r(".tab-pane:visible").find(".hestia-card-box:visible").find(".hestia-error-notice").html("<p>"+a.message+"</p>").removeClass("hidden"),r(".tab-pane:visible").find(".hestia-card-box:visible").find("span.spinner").removeClass("is-active")}),d.bind("UploadProgress",function(e,a){l(!0),r(".tab-pane:visible").find(".hestia-card-box:visible").find(".hestia-error-notice").addClass("hidden"),r(".tab-pane:visible").find(".hestia-card-box:visible").find("span.spinner").addClass("is-active")});t=wp.media.controller.Library.extend({defaults:_.defaults({id:"hestia-media-state",allowLocalEdits:!0,displaySettings:!0,displayUserSettings:!0,multiple:!1,library:wp.media.query({type:"image"})},wp.media.controller.Library.prototype.defaults)}),r(document).on("click",".hestia-choose-media",function(e){r(this),e.preventDefault(),i||(i=wp.media({multiple:!1,state:"hestia-media-state",states:[new t]})).on("select",function(){var e=i.state().get("selection").first().toJSON();window.EditImageData={url:e.url,id:e.id},d.trigger("FileUploaded",window.EditImageData)}),i.open()}),r(document).on("click","[data-default_img]",function(){var e=r(this).data("default_img"),a=r(this).data("ajax_nonce");""!==e&&(d.trigger("UploadProgress",{}),r.post(hestiaSetupWizardData.ajax.url,{action:"hestia_set_logo_and_icon",_ajax_nonce:a,default_img:e},function(e){1===e.status?d.trigger("FileUploaded",{url:e.attachment_url,id:e.attachment_id}):d.trigger("Error",{message:e.message})},"json").fail(function(e){d.trigger("Error",{message:e.statusText})}))})}r(document).on("change",'input[name="wizard[show_on_front]"]',function(){"page"===r(this).val()?(r(".select-page-option").removeClass("hidden"),r("#page_on_front").trigger("change")):(r(".select-page-option").addClass("hidden"),r(this).parents(".hestia-card-box").find(".hestia-btn").removeClass("disabled"))}),r(document).on("click",".add-new",function(){return r(this).hasClass("disabled")?(r(this).parent(".add-new-page").prev(".add-new-option-box").addClass("hidden"),r(this).removeClass("disabled")):(r(this).parent(".add-new-page").prev(".add-new-option-box").removeClass("hidden"),r(this).addClass("disabled"),r(this).parents(".hestia-card-box").find(".hestia-btn").addClass("disabled"),r('input[name="hestia_page_title"]').val("")),!1}),r(document).on("change","#page_on_front",function(){var e=r(this).parents(".hestia-card-box").find(".hestia-btn");"0"===r(this).val()?e.addClass("disabled"):e.removeClass("disabled"),r(".add-new.disabled").trigger("click")}),r(document).on("change",'input[name="wizard[install_plugin][]"]',function(){var e=r('input[name="wizard[install_plugin][]"]').filter(":checked"),a=r(this).parents(".hestia-card-box").find(".hestia-btn");0<e.length?a.removeClass("disabled"):a.addClass("disabled")}),r(document).on("click",".hestia-card-box .add-btn",function(){var a=r(this),e=r('input[name="hestia_page_title"]').val(),i=a.parents("div.tab-pane");""===e||a.hasClass("disabled")||(i.find(".spinner").addClass("is-active"),a.addClass("disabled"),l(!0),r.post(hestiaSetupWizardData.ajax.url,{action:"hestia_add_new_page",nonce:hestiaSetupWizardData.ajax.security,page_title:e},function(e){l(!1),1===e.status?r("#page_on_front").append(e.option).trigger("change"):2===e.status&&0<e.page_id?r("#page_on_front").val(e.page_id).trigger("change"):""!==e.message&&i.find(".hestia-card-box .hestia-error-notice").html("<p>"+e.message+"</p>").removeClass("hidden"),i.find(".spinner").removeClass("is-active"),a.removeClass("disabled"),r('input[name="hestia_page_title"]').val("")},"json").fail(function(){l(!1),i.find(".spinner").removeClass("is-active"),a.removeClass("disabled")}))}),r(document).on("input",'input[name="wizard[site_title]"]',function(){r("span.browser-title").text(r(this).val())}),r(".hestia-color-picker").wpColorPicker()});
Save Changes
Rename File
Rename