index of
/
home
/
thefkyzp
/
www
/
wp-content
/
plugins
/
ocean-extra
/
includes
/
wizard
/
assets
/
js
/
File: /home/thefkyzp/www/wp-content/plugins/ocean-extra/includes/wizard/assets/js/wizard.min.js
var sucessRequests=0,totalRequests=0,name="";!function(l){"use strict";l(document).ready(function(){e.init(),t.init()});var e={importData:{},allowPopupClosing:!0,init:function(){var o=this;this.categoriesFilter(),l(".owp-search-input").on("keyup",function(){0<l(this).val().length?(l(".owp-demo-wrap .themes").find(".theme-wrap").hide(),l(".owp-demo-wrap .themes").find('.theme-wrap[data-name*="'+l(this).val().toLowerCase()+'"]').show()):l(".owp-demo-wrap .themes").find(".theme-wrap").show()}),l(".owp-demo-wrap .theme-actions a.button").on("click",function(e){e.stopPropagation()}),l(".owp-open-popup").click(function(e){l(this).hasClass("active")?(l(this).removeClass("active"),l(".install-demos-button").addClass("disabled"),l(".install-demos-button").attr("disabled",!0)):(l(".owp-open-popup").removeClass("active"),l(this).addClass("active"),l(".install-demos-button").removeClass("disabled"),l(".install-demos-button").attr("disabled",!1))}),l(".install-demos-button").click(function(e){var t;e.preventDefault(),0<l(".owp-open-popup.active").length?(t=l(".owp-open-popup.active:first").data("demo-id"),e=l(".owp-open-popup.active:first").data("demo-type"),l(".preview-"+t),l(".preview-all-"+t),l(".demo-import-loader").show(),o.getDemoData(t,e)):window.location.href=l(this).attr("data-next_step")}),l(document).on("click",".install-now",this.installNow),l(document).on("click",".activate-now",this.activatePlugins),l(document).on("wp-plugin-install-success",this.installSuccess),l(document).on("wp-plugin-installing",this.pluginInstalling),l(document).on("wp-plugin-install-error",this.installError),l(".owp-elementor-link").on("click",function(e){e.preventDefault(),l(this).parent().addClass("active"),l(".owp-gutenberg-link").parent().removeClass("active"),l(".owp-navigation .elementor-demos").show(),l(".owp-navigation .gutenberg-demos").hide(),l(".owp-demo-wrap .themes.elementor-items").show(),l(".owp-demo-wrap .themes.gutenberg-items").hide()}),l(".owp-gutenberg-link").on("click",function(e){e.preventDefault(),l(this).parent().addClass("active"),l(".owp-elementor-link").parent().removeClass("active"),l(".owp-navigation .gutenberg-demos").show(),l(".owp-navigation .elementor-demos").hide(),l(".owp-demo-wrap .themes.gutenberg-items").show(),l(".owp-demo-wrap .themes.elementor-items").hide()}),this.categoriesFilter(".elementor-items",".elementor-demos"),this.categoriesFilter(".gutenberg-items",".gutenberg-demos")},categoriesFilter:function(o,e){function a(e){var t,o=l.Deferred();return(t=l.Deferred(),i.addClass(n),setTimeout(function(){i.removeClass(n).hide(),t.resolve()},p),t.promise()).done(function(){!function(e,t){e="all"!==e&&e?'[data-categories*="'+e+'"]':"div";i.filter(e).show().addClass("owp-is-fadein"),setTimeout(function(){i.removeClass(s),t.resolve()},p)}(e,o)}),o}var i=l(".owp-demo-wrap .themes"+o).find(".theme-wrap"),n="owp-is-fadeout",s="owp-is-fadein",p=200;l(e+" .owp-navigation-link").on("click",function(e){e.preventDefault(),l(this).parent().siblings().removeClass("active"),l(this).parent().addClass("active");var e=this.hash.slice(1),t=l(".owp-demo-wrap .themes"+o);t.css("min-width",t.outerHeight()),a(e).done(function(){t.removeAttr("style")})})},getDemoData:function(e,t){var o=this;l.ajax({url:owpDemos.ajaxurl,type:"get",data:{action:"owp_ajax_get_import_data",demo_name:e,demo_type:t,security:owpDemos.owp_import_data_nonce},complete:function(e){l(".demo-import-loader").hide(),o.importData=l.parseJSON(e.responseText)}}),l.ajax({url:owpDemos.ajaxurl,type:"get",data:{action:"owp_wizard_ajax_get_demo_data",demo_name:e,demo_type:t,demo_data_nonce:owpDemos.demo_data_nonce},complete:function(e){l(".owp-demo-wrap").html(e.responseText),l("html,body").animate({scrollTop:l("#owp-demo-plugins").offset().top},500),o.runPopup(e)}})},runPopup:function(e){var i=this;l(".owp-demo-popup-close, .owp-demo-popup-overlay").on("click",function(e){e.preventDefault(),!0===i.allowPopupClosing&&i.closePopup()}),l(".owp-plugins-next").on("click",function(e){e.preventDefault(),l("#owp-demo-plugins").hide(),l("#owp-demo-import-form").show()}),l("#owp-demo-import-form").submit(function(e){e.preventDefault();var t=l(this).find('[name="owp_import_demo"]').val(),o=l(this).find('[name="owp_import_demo"]').data("demo-type"),e=l(this).find('[name="owp_import_demo_data_nonce"]').val(),a=[];l(this).find('input[type="checkbox"]').each(function(){!0===l(this).is(":checked")&&a.push(l(this).attr("name"))}),l(this).hide(),l(".owp-loader").show(),i.importContent({demo:t,demoType:o,nonce:e,contentToImport:a,isXML:l("#owp_import_xml").is(":checked")})})},importContent:function(n){var e,t,s=this,o=(Date.now(),{owp_import_demo:n.demo,owp_import_demo_type:n.demoType,owp_import_demo_data_nonce:n.nonce});if(this.allowPopupClosing=!1,l(".owp-demo-popup-close").fadeOut(),0===n.contentToImport.length)return setTimeout(function(){l(".owp-loader").hide(),l(".owp-last").show(),window.location.href=l(".wizard-install-demos-buttons-wrapper.final-step .skip-btn").attr("href")},1e3),l.ajax({url:owpDemos.ajaxurl,type:"post",data:{action:"owp_after_import",owp_import_demo:n.demo,owp_import_demo_type:n.demoType,owp_import_demo_data_nonce:n.nonce,owp_import_is_xml:n.isXML},complete:function(e){}}),this.allowPopupClosing=!0,void l(".owp-demo-popup-close").fadeIn();for(t in this.importData){var a=l.inArray(this.importData[t].input_name,n.contentToImport);if(-1!==a){e=t,n.contentToImport.splice(a,1),o.action=this.importData[t].action;break}}l(".owp-import-status").append('<p class="owp-importing">'+this.importData[e].loader+"</p>");var i=l.ajax({url:owpDemos.ajaxurl,type:"post",data:o,complete:function(e){clearTimeout(p);var t=!0;if(500===e.status||502===e.status||503===e.status)l(".owp-importing").addClass("owp-importing-failed").removeClass("owp-importing").text(owpDemos.content_importing_error+" "+e.status);else if(-1!==e.responseText.indexOf("successful import"))l(".owp-importing").addClass("owp-imported").removeClass("owp-importing"),sucessRequests++;else{var o,a=l.parseJSON(e.responseText),i="";for(o in a)i+=a[o],"xml_import_error"===o&&(t=!1);l(".owp-importing").addClass("owp-importing-failed").removeClass("owp-importing").text(i),s.allowPopupClosing=!0,l(".owp-demo-popup-close").fadeIn()}!0===t&&s.importContent(n)}}),p=setTimeout(function(){i.abort(),s.allowPopupClosing=!0,l(".owp-demo-popup-close").fadeIn(),l(".owp-importing").addClass("owp-importing-failed").removeClass("owp-importing").text(owpDemos.content_importing_error)},9e5)},closePopup:function(){l("html").css({overflow:"","margin-right":""}),l(".preview-icon").hide(),l(".preview-all").hide(),l("#owp-demo-popup-wrap").fadeOut(),setTimeout(function(){l("#owp-demo-popup-content").html("")},600)},installNow:function(e){e.preventDefault();var t=l(e.target),o=l(document);t.hasClass("updating-message")||t.hasClass("button-disabled")||(wp.updates.shouldRequestFilesystemCredentials&&!wp.updates.ajaxLocked&&(wp.updates.requestFilesystemCredentials(e),o.on("credential-modal-cancel",function(){l(".install-now.updating-message").removeClass("updating-message").text(wp.updates.l10n.installNow),wp.a11y.speak(wp.updates.l10n.updateCancel,"polite")})),wp.updates.installPlugin({slug:t.data("slug")}))},activatePlugins:function(e){e.preventDefault();var t=l(e.target),e=t.data("init");t.data("slug");t.hasClass("updating-message")||t.hasClass("button-disabled")||(t.addClass("updating-message button-primary").html(owpDemos.button_activating),l.ajax({url:owpDemos.ajaxurl,type:"POST",data:{action:"owp_ajax_required_plugins_activate",init:e}}).done(function(e){e.success&&t.removeClass("button-primary install-now activate-now updating-message").attr("disabled","disabled").addClass("disabled").text(owpDemos.button_active)}))},installSuccess:function(e,t){e.preventDefault();var o=l(".owp-plugin-"+t.slug).find(".button"),a=o.data("init");o.removeClass("install-now installed button-disabled updated-message").addClass("updating-message").html(owpDemos.button_activating),setTimeout(function(){l.ajax({url:owpDemos.ajaxurl,type:"POST",data:{action:"owp_ajax_required_plugins_activate",init:a}}).done(function(e){e.success?o.removeClass("button-primary install-now activate-now updating-message").attr("disabled","disabled").addClass("disabled").text(owpDemos.button_active):o.removeClass("updating-message")})},1200)},pluginInstalling:function(e,t){e.preventDefault(),l(".owp-plugin-"+t.slug).find(".button").addClass("updating-message")},installError:function(e,t){e.preventDefault(),l(".owp-plugin-"+t.slug).removeClass("button-primary").addClass("disabled").html(wp.updates.l10n.installFailedShort)}},t={init:function(){var t;l(".upload_image_button").on("click",function(e){e.preventDefault();e=l(this);name=e.attr("data-name"),t||(t=wp.media.frames.file_frame=wp.media({title:"Choose Image",button:{text:"Choose Image"},multiple:!1})).on("select",function(){var e=t.state().get("selection").first().toJSON();console.log(e),l("#"+name).val(e.id),l("#"+name+"-img").attr("src",e.url).show(),l('.remove_image_button[data-name="'+name+'"]').show()}),t.open()}),l(".remove_image_button").on("click",function(e){e.preventDefault();var t=l(this),e=t.attr("data-name");return l("#"+e).val(""),l("#"+e+"-img").attr("src","").hide(),t.hide(),!1}),0<l(".color-picker-field").length&&l(".color-picker-field").each(function(){l(this).wpColorPicker()})}}}(jQuery);