File "yit-plugin-panel.min.js"
Full Path: /home/siazco/grocery.siazco.se/wp-content/plugins/yith-woocommerce-wishlist/plugin-fw/assets/js/yit-plugin-panel.min.js
File size: 7.12 KB
MIME-type: text/plain
Charset: utf-8
jQuery(function(e){function i(){e("[data-dep-target]:not( .deps-initialized )").each(function(){var i=e(this);if(!i.closest(".metaboxes-tab").length){i.addClass("deps-initialized");var n="#"+i.data("dep-target"),t="#"+i.data("dep-id"),a=i.data("dep-value"),l=i.data("dep-type");e(t).on("change",function(){!function(i,n,t,a){var l=!0;if("string"==typeof n){":radio"===n.substr(0,6)&&(n+=":checked");var o=e(n),s=o.attr("type"),d=o.val();switch(s){case"checkbox":d=o.is(":checked")?"yes":"no";break;case"radio":d=o.find('input[type="radio"]').filter(":checked").val()}t=t.split(",");for(var r=0;r<t.length;r++){if(d==t[r]){l=!0;break}l=!1}}var c=e(i),u=e(i+"-container").closest("tr");u.length<1&&(u=c.closest(".yith-plugin-fw__panel__option, .yith-plugin-fw-panel-wc-row, .yith-toggle-content-row"));var p,f=a.split("-");for(p in f){var h=f[p];if(l)switch(h){case"disable":u.removeClass("yith-disabled"),c.attr("disabled",!1);break;case"hide":case"hideNow":u.show();break;case"hideme":c.show();break;case"fadeOut":u.show();break;case"fadeInOut":case"fadeIn":default:u.show(500)}else switch(h){case"disable":u.addClass("yith-disabled"),c.attr("disabled",!0);break;case"hide":case"hideNow":u.hide();break;case"hideme":c.hide();break;case"fadeInOut":case"fadeOut":u.hide(500);break;case"fadeIn":default:u.hide()}}}(n,t,a.toString(),l)}).trigger("change")}})}var n,t,a;i(),e(document).on("yith-plugin-fw-panel-init-deps",i),e(document).on("yith-add-box-button-toggle",i),e(".rm_connectedlist").each(function(){var i=e(this).find("ul"),n=e(this).find(":hidden");i.sortable({connectWith:i,update:function(t,a){var l={};i.each(function(){var i={};e(this).children().each(function(){i[e(this).data("option")]=e(this).text()}),l[e(this).data("list")]=i}),n.val(JSON.stringify(l).replace(/[\\"']/g,"\\$&").replace(/\u0000/g,"\\0"))}}).disableSelection()}),e(function(){e(".google-analytic-generate").click(function(){var i=e("#"+e(this).data("textarea")).data("codemirrorInstance"),n="(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n";n+="(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement( o ),\n",n+="m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n",n+="})(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n",n+="ga('create', '"+e("#"+e(this).data("input")).val()+"', '"+e(this).data("basename")+"');\n",n+="ga('send', 'pageview');\n",i.replaceRange(n,i.getCursor("start"),i.getCursor("end"))})}),e(".yith-plugin-fw-panel .woo-nav-tab-wrapper").removeClass("woo-nav-tab-wrapper").addClass("yith-nav-tab-wrapper"),n=e("#yith-plugin-fw__panel__notices"),t=e(".wrap.yith-plugin-ui, .yith-plugin-fw-wp-page-wrapper").first(),(a=e("div.updated, div.error, div.notice, .yith-plugin-fw__notice, .yith-plugin-fw__notice-banner").not(".inline, .yith-plugin-fw--inline")).addClass("inline"),n.length?n.append(a):t.length&&t.prepend(a),function(){var i=e(".yith-nav-sub-tab.nav-tab-active"),n=e(".yith-plugin-fw-wp-page__sub-tab-wrap");if(i.length&&!n.length){var t=e(".yith-plugin-fw-wp-page-wrapper");if(t.length||(t=e("#wpbody-content > .yith-plugin-ui")),t){var a=t.find(".yit-admin-panel-content-wrap");a.length?a.addClass("has-subnav"):t.find(".wrap").wrap('<div class="yith-plugin-fw-wp-page__sub-tab-wrap"></div>')}}}(),function(){var i=e("#yith-plugin-fw-float-save-button"),n=e("#plugin-fw-wc"),t=!!n.length&&n.get(0),a=document.querySelector("#main-save-button");function l(){var e,n;e=a.getBoundingClientRect(),n={width:window.innerWidth||document.documentElement.clientWidth,height:window.innerHeight||document.documentElement.clientHeight},e.top>=0&&e.left>=0&&e.top<=n.height&&e.left<=n.width?i.removeClass("visible"):i.addClass("visible")}i.length>0&&n.length>0&&(l(),document.addEventListener("scroll",l,{passive:!0}),e(document).on("click","#yith-plugin-fw-float-save-button",function(a){a.preventDefault(),"tinyMCE"in window&&"triggerSave"in window.tinyMCE&&window.tinyMCE.triggerSave(),e(".codemirror.codemirror--initialized").each(function(){var i=e(this).data("codemirrorInstance")||!1;i&&"codemirror"in i&&i.codemirror.save()}),!t||t.checkValidity()?(i.block({message:null,overlayCSS:{background:"transparent",opacity:.6}}),e.post(document.location.href,n.serialize()).done(function(n){i.unblock().addClass("green").fadeOut(300).html(i.data("saved-label")).fadeIn(300).delay(2500).queue(function(n){i.fadeOut(500,function(){e(this).removeClass("green"),e(this).html(e(this).data("default-label")).fadeIn(500)}),n()}),window.onbeforeunload=null,e(document).trigger("yith-plugin-fw-float-save-button-after-saving",[n])})):t.reportValidity()}))}(),e(document).on("click","#yith-plugin-fw__panel__content__save",function(){window.onbeforeunload=null;var i=e("form#yith-plugin-fw-panel, form#plugin-fw-wc");if(i.length){var n=i.get(0);n.checkValidity()?i.submit():n.reportValidity()}}),e(document).on("click","#yith-plugin-fw__panel__content__reset",function(){window.onbeforeunload=null,e("form#yith-plugin-fw-panel-reset, form#plugin-fw-wc-reset").submit()}),e(document).on("submit","form#yith-plugin-fw-panel-reset, form#plugin-fw-wc-reset",function(i){var n=e(this);if("yes"!==n.data("confirmed")){i.preventDefault();var t={title:yithFwPluginPanel.i18n.resetConfirmTitle,message:yithFwPluginPanel.i18n.resetConfirmMessage,closeAfterConfirm:!1,onConfirm:function(){n.data("confirmed","yes"),n.submit()}};yith.ui.confirm(t)}}),function(){function i(){if(!(this.__sidebar&&"node"in this.__sidebar&&"hasClass"in this.__sidebar.node&&this.__sidebar.node.hasClass("yith-plugin-fw__panel__sidebar--initialized"))){var i={};i.node=e(".yith-plugin-fw__panel__sidebar"),i.node.addClass("yith-plugin-fw__panel__sidebar--initialized"),i.isCollapsed=function(){return i.node.hasClass("yith-plugin-fw__panel__sidebar--collapsed")},i.isFixed=function(){return"fixed"!==i.node.css("position")},i.setCollapsed=function(e){e?(i.node.addClass("yith-plugin-fw__panel__sidebar--collapsed"),setUserSetting("yithFwSidebarFold","f")):(i.node.removeClass("yith-plugin-fw__panel__sidebar--collapsed"),setUserSetting("yithFwSidebarFold","o"))},i.setOpen=function(e){var n=document.body.classList.contains("rtl")?"yith-plugin-fw-animate__appear-from-right-full":"yith-plugin-fw-animate__appear-from-left-full";e?i.node.addClass(["yith-plugin-fw--open",n]):i.node.removeClass(["yith-plugin-fw--open",n])},this.__sidebar=i}return this.__sidebar}e(document).on("click",".yith-plugin-fw__panel__mobile__header__toggle",function(){i().setOpen(!0),e(document.body).append(e('<div id="yith-plugin-fw__panel__sidebar__mobile-backdrop"></div>'))}),e(document).on("click","#yith-plugin-fw__panel__sidebar__mobile-backdrop",function(){i().setOpen(!1),e(this).remove()}),e(document).on("click",".yith-plugin-fw__panel__sidebar__collapse",function(){var e=i();e.setCollapsed(!e.isCollapsed())}),e(document).on("click",".yith-plugin-fw__panel__menu-item.yith-plugin-fw--has-submenu a.yith-plugin-fw__panel__menu-item__content",function(n){n.preventDefault();var t=i();if(!t.isCollapsed()||!t.isFixed()){var a=e(n.target).closest(".yith-plugin-fw__panel__menu-item"),l=a.find(".yith-plugin-fw__panel__submenu");a.is(".yith-plugin-fw--open")?l.slideUp(200):l.slideDown(200),a.toggleClass("yith-plugin-fw--open")}})}()});