File "yith-ui.min.js"

Full Path: /home/siazco/grocery.siazco.se/wp-content/plugins/yith-woocommerce-wishlist/plugin-fw/assets/js/yith-ui.min.js
File size: 4.92 KB
MIME-type: text/plain
Charset: utf-8

window.yith=window.yith||{},function(n,o){o.ui=o.ui||{};var e=function(n){if("string"==typeof n)return n;var o=[];for(var t of n)t&&o.indexOf(t)<0&&o.push(e(t));return o.join(" ")};o.ui.confirm=function(t){var l={title:!1,message:!1,onCreate:!1,onConfirm:!1,onCancel:!1,onClose:!1,classes:{wrap:"",content:"",title:"",message:"",footer:"",cancel:"",confirm:""},confirmButtonType:"confirm",cancelButton:yith_plugin_fw_ui.i18n.cancel,confirmButton:yith_plugin_fw_ui.i18n.confirm,width:350,closeAfterConfirm:!0,allowWpMenu:!1,allowWpMenuInMobile:!1,showClose:!0,confirmButtonLoadingAfterConfirm:!1,closeWhenClickingOnOverlay:!1},i={};t=void 0!==t?t:{},(t=n.extend({},l,t)).classes=n.extend({},l.classes,t.classes);var s={wrap:e(["yith-plugin-fw__confirm__wrap",t.classes.wrap]),content:e(["yith-plugin-fw__confirm__content",t.classes.content]),title:e(["yith-plugin-fw__confirm__title",t.classes.title]),message:e(["yith-plugin-fw__confirm__message",t.classes.message]),footer:e(["yith-plugin-fw__confirm__footer",t.classes.footer]),cancel:e(["yith-plugin-fw__confirm__button","yith-plugin-fw__confirm__button--cancel",t.classes.cancel]),confirm:e(["yith-plugin-fw__confirm__button","yith-plugin-fw__confirm__button--"+t.confirmButtonType,t.classes.confirm])},c={message:!1,footer:!1,cancel:!1,confirm:!1},a=!1,f=function(){a&&a.close(),a=!1},r=function(){"function"==typeof t.onCancel&&t.onCancel(),f()},p=function(){c.confirm.hasClass("yith-plugin-fw__confirm__button--is-loading")||("function"==typeof t.onConfirm&&t.onConfirm(),t.confirmButtonLoadingAfterConfirm&&c.confirm.addClass("yith-plugin-fw__confirm__button--is-loading"),t.closeAfterConfirm&&f())},m=function(){c.cancel.on("click",r),c.confirm.on("click",p)};(function(){c.message=n('<div class="'+s.message+'">'),c.footer=n('<div class="'+s.footer+'">'),c.cancel=n('<span class="'+s.cancel+'">'+t.cancelButton+"</span>"),c.confirm=n('<span class="'+s.confirm+'">'+t.confirmButton+"</span>"),t.message&&c.message.html(t.message),c.footer.append(c.cancel),c.footer.append(c.confirm),a=o.ui.modal({classes:{wrap:s.wrap,title:s.title,content:s.content},title:t.title,content:[c.message,c.footer],width:t.width,allowWpMenu:t.allowWpMenu,allowWpMenuInMobile:t.allowWpMenuInMobile,showClose:t.showClose,onCreate:t.onCreate,onClose:t.onClose,closeWhenClickingOnOverlay:t.closeWhenClickingOnOverlay})})(),m(),i.elements=n.extend({},c),i.modal=n.extend({},a),i.close=f,i.cancel=r},o.ui.modal=function(o){var t={allowWpMenu:!0,allowWpMenuInMobile:!1,title:!1,content:!1,footer:!1,showClose:!0,closeSelector:!1,classes:{wrap:"",main:"",close:"",title:"",content:"",footer:""},width:500,allowClosingWithEsc:!0,closeWhenClickingOnOverlay:!1,scrollContent:!0,onCreate:!1,onClose:!1},l={};o=void 0!==o?o:{},(o=n.extend({},t,o)).classes=n.extend({},t.classes,o.classes);var i=n("#wpwrap"),s={wrap:["yith-plugin-ui","yith-plugin-fw__modal__wrap",o.classes.wrap],main:["yith-plugin-fw__modal__main",o.classes.main],close:["yith-plugin-fw__modal__close","yith-icon","yith-icon-close",o.classes.close],title:["yith-plugin-fw__modal__title",o.classes.title],content:["yith-plugin-fw__modal__content",o.classes.content],footer:["yith-plugin-fw__modal__footer",o.classes.footer]},c={wrap:!1,main:!1,close:!1,title:!1,content:!1,footer:!1},a=function(){n(".yith-plugin-fw__modal__wrap").remove(),i.removeClass("yith-plugin-fw__modal--opened"),i.removeClass("yith-plugin-fw__modal--allow-wp-menu"),i.removeClass("yith-plugin-fw__modal--allow-wp-menu-in-mobile"),_()},f=function(){a(),"function"==typeof o.onClose&&o.onClose()},r=function(){c.wrap=n('<div class="'+e(s.wrap)+'">'),c.main=n('<div class="'+e(s.main)+'">'),c.close=n('<span class="'+e(s.close)+'">'),c.title=n('<div class="'+e(s.title)+'">'),c.content=n('<div class="'+e(s.content)+'">'),c.footer=n('<div class="'+e(s.footer)+'">'),c.main.css({width:o.width}),o.title&&("string"==typeof o.title?c.title.html(o.title):c.title.append(o.title)),o.content&&("string"==typeof o.content?c.content.html(o.content):c.content.append(o.content)),o.showClose&&c.main.append(c.close),!1!==o.title?c.main.append(c.title):i.addClass("yith-plugin-fw__modal--no-title"),c.main.append(c.content),o.footer&&("string"==typeof o.footer?c.footer.html(o.footer):c.footer.append(o.footer),c.main.append(c.footer)),c.wrap.append(c.main),o.scrollContent&&c.wrap.addClass("yith-plugin-fw__modal__wrap--scroll-content"),i.append(c.wrap),i.addClass("yith-plugin-fw__modal--opened"),o.allowWpMenu&&i.addClass("yith-plugin-fw__modal--allow-wp-menu"),o.allowWpMenuInMobile&&i.addClass("yith-plugin-fw__modal--allow-wp-menu-in-mobile"),"function"==typeof o.onCreate&&o.onCreate()},p=function(e){n(e.target).is(c.wrap)&&o.closeWhenClickingOnOverlay&&f()},m=function(){c.close.on("click",f),o.closeSelector&&i.on("click",o.closeSelector,f),c.wrap.on("click",p),n(document).on("keydown",u)},_=function(){n(document).off("keydown",u)},u=function(n){o.allowClosingWithEsc&&27===n.keyCode&&f()};return a(),r(),m(),l.elements=n.extend({},c),l.close=f,l}}(window.jQuery,window.yith);