index of
/
home
/
thefkyzp
/
public_html
/
wp-content
/
plugins
/
ocean-extra
/
includes
/
panel
/
assets
/
js
/
File: /home/thefkyzp/public_html/wp-content/plugins/ocean-extra/includes/panel/assets/js/demos.min.js
!function(r){"use strict";r(document).ready(function(){window.owpDemoImport.init()}),window.owpDemoImport={importData:{},allowPopupClosing:!0,init:function(){var n=this;r(".owp-search-input").on("keyup",function(){0<r(this).val().length?(r(".owp-demo-wrap .themes").find(".theme-wrap").hide(),r(".owp-demo-wrap .themes").find('.theme-wrap[data-name*="'+r(this).val().toLowerCase()+'"]').show()):r(".owp-demo-wrap .themes").find(".theme-wrap").show()}),r(".owp-demo-wrap .theme-actions a.button").on("click",function(e){e.stopPropagation()}),r(".owp-open-popup").click(function(e){var t,o,a;r(e.target).hasClass("owp-live-preview")||(e.preventDefault(),t=r(this).data("demo-id"),o=r(this).data("demo-type"),a=r(".preview-"+t),e=r(".preview-all-"+t),a.show(),e.show(),n.getDemoData(t,o))}),r(document).on("click",".install-now",this.installNow),r(document).on("click",".activate-now",this.activatePlugins),r(document).on("wp-plugin-install-success",this.installSuccess),r(document).on("wp-plugin-installing",this.pluginInstalling),r(document).on("wp-plugin-install-error",this.installError),r(".owp-elementor-link").on("click",function(e){e.preventDefault(),r(this).parent().addClass("active"),r(".owp-gutenberg-link").parent().removeClass("active"),r(".owp-navigation .elementor-demos").show(),r(".owp-navigation .gutenberg-demos").hide(),r(".owp-demo-wrap .themes.elementor-items").show(),r(".owp-demo-wrap .themes.gutenberg-items").hide()}),r(".owp-gutenberg-link").on("click",function(e){e.preventDefault(),r(this).parent().addClass("active"),r(".owp-elementor-link").parent().removeClass("active"),r(".owp-navigation .gutenberg-demos").show(),r(".owp-navigation .elementor-demos").hide(),r(".owp-demo-wrap .themes.gutenberg-items").show(),r(".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=r.Deferred();return(t=r.Deferred(),n.addClass(i),setTimeout(function(){n.removeClass(i).hide(),t.resolve()},p),t.promise()).done(function(){!function(e,t){e="all"!==e&&e?'[data-categories*="'+e+'"]':"div";n.filter(e).show().addClass("owp-is-fadein"),setTimeout(function(){n.removeClass(s),t.resolve()},p)}(e,o)}),o}var n=r(".owp-demo-wrap .themes"+o).find(".theme-wrap"),i="owp-is-fadeout",s="owp-is-fadein",p=200;r(e+" .owp-navigation-link").on("click",function(e){e.preventDefault(),r(this).parent().siblings().removeClass("active"),r(this).parent().addClass("active");var e=this.hash.slice(1),t=r(".owp-demo-wrap .themes"+o);t.css("min-width",t.outerHeight()),a(e).done(function(){t.removeAttr("style")})})},getDemoData:function(o,e){var a=this;r.ajax({url:owpDemos.ajaxurl,type:"get",data:{action:"owp_ajax_get_import_data",demo_name:o,demo_type:e,security:owpDemos.owp_import_data_nonce},complete:function(e){a.importData=r.parseJSON(e.responseText)}}),r.ajax({url:owpDemos.ajaxurl,type:"get",data:{action:"owp_ajax_get_demo_data",demo_name:o,demo_type:e,demo_data_nonce:owpDemos.demo_data_nonce},complete:function(e){a.runPopup(e);var t=r(".preview-"+o),e=r(".preview-all-"+o);t.hide(),e.hide()}})},runPopup:function(e){var n=this,t=r("html").innerWidth();r("html").css("overflow","hidden");var o=r("html").innerWidth();r("html").css("margin-right",o-t),r("#owp-demo-popup-wrap").fadeIn(),r(e.responseText).appendTo(r("#owp-demo-popup-content")),r(".owp-demo-popup-close, .owp-demo-popup-overlay").on("click",function(e){e.preventDefault(),!0===n.allowPopupClosing&&n.closePopup()}),r(".owp-plugins-next").on("click",function(e){e.preventDefault(),r("#owp-demo-plugins").hide(),r("#owp-demo-import-form").show()}),r("#owp-demo-import-form").submit(function(e){e.preventDefault();var t=r(this).find('[name="owp_import_demo"]').val(),o=r(this).find('[name="owp_import_demo"]').data("demo-type"),e=r(this).find('[name="owp_import_demo_data_nonce"]').val(),a=[];r(this).find('input[type="checkbox"]').each(function(){!0===r(this).is(":checked")&&a.push(r(this).attr("name"))}),r(this).hide(),r(".owp-loader").show(),n.importContent({demo:t,demoType:o,nonce:e,contentToImport:a,isXML:r("#owp_import_xml").is(":checked")})})},importContent:function(i){var e,t,s=this,o=(Date.now(),{owp_import_demo:i.demo,owp_import_demo_type:i.demoType,owp_import_demo_data_nonce:i.nonce});if(this.allowPopupClosing=!1,r(".owp-demo-popup-close").fadeOut(),0===i.contentToImport.length)return setTimeout(function(){r(".owp-loader").hide(),r(".owp-last").show()},1e3),r.ajax({url:owpDemos.ajaxurl,type:"post",data:{action:"owp_after_import",owp_import_demo:i.demo,owp_import_demo_type:i.demoType,owp_import_demo_data_nonce:i.nonce,owp_import_is_xml:i.isXML},complete:function(e){}}),this.allowPopupClosing=!0,void r(".owp-demo-popup-close").fadeIn();for(t in this.importData){var a=r.inArray(this.importData[t].input_name,i.contentToImport);if(-1!==a){e=t,i.contentToImport.splice(a,1),o.action=this.importData[t].action;break}}r(".owp-import-status").append('<p class="owp-importing">'+this.importData[e].loader+"</p>");var n=r.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)r(".owp-importing").addClass("owp-importing-failed").removeClass("owp-importing").text(owpDemos.content_importing_error+" "+e.status);else if(-1!==e.responseText.indexOf("successful import"))r(".owp-importing").addClass("owp-imported").removeClass("owp-importing");else{var o,a=r.parseJSON(e.responseText),n="";for(o in a)n+=a[o],"xml_import_error"===o&&(t=!1);r(".owp-importing").addClass("owp-importing-failed").removeClass("owp-importing").text(n),s.allowPopupClosing=!0,r(".owp-demo-popup-close").fadeIn()}!0===t&&s.importContent(i)}}),p=setTimeout(function(){n.abort(),s.allowPopupClosing=!0,r(".owp-demo-popup-close").fadeIn(),r(".owp-importing").addClass("owp-importing-failed").removeClass("owp-importing").text(owpDemos.content_importing_error)},9e5)},closePopup:function(){r("html").css({overflow:"","margin-right":""}),r(".preview-icon").hide(),r(".preview-all").hide(),r("#owp-demo-popup-wrap").fadeOut(),setTimeout(function(){r("#owp-demo-popup-content").html("")},600)},installNow:function(e){e.preventDefault();var t=r(e.target),o=r(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(){r(".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=r(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),r.ajax({url:owpDemos.ajaxurl,type:"POST",data:{action:"owp_ajax_required_plugins_activate",_wpnonce:owpDemos.demo_plugins_activate_nonce,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=r(".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(){r.ajax({url:owpDemos.ajaxurl,type:"POST",data:{action:"owp_ajax_required_plugins_activate",_wpnonce:owpDemos.demo_plugins_activate_nonce,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(),r(".owp-plugin-"+t.slug).find(".button").addClass("updating-message")},installError:function(e,t){e.preventDefault(),r(".owp-plugin-"+t.slug).removeClass("button-primary").addClass("disabled").html(wp.updates.l10n.installFailedShort)}}}(jQuery);