Current Path : /var/www/ooareogundevinitiative/wp-content/plugins/foogallery/js/ |
Current File : /var/www/ooareogundevinitiative/wp-content/plugins/foogallery/js/foogallery.admin.min.js |
/* * FooGallery - The Most Intuitive and Extensible Gallery Creation and Management Tool Ever Created for WordPress * @version 1.4.24 * @link * @copyright Steven Usher & Brad Vincent 2015 * @license Released under the GPLv3 license. */ !function(a,b,c,d,e){b.Settings=c.Class.extend({construct:function(c,f){var g=this;g.$el=d.jq(c)?c:a(c),g.opt=e.extend({},b.Settings.defaults,f),g.mqlMobile=window.matchMedia("(max-width: "+g.opt.mobile+"px)"),g.isMobile=g.mqlMobile.matches,g.mqlHover=window.matchMedia("(hover: hover)"),g.canHover=g.mqlHover.matches,g.tabs=new b.Settings.VerticalTabs(g),g.onMqlMobileChanged=g.onMqlMobileChanged.bind(g),g.onMqlHoverChanged=g.onMqlHoverChanged.bind(g)},init:function(){var a=this;a.tabs.init(),a.isMobile&&a.setupMobile(),a.canHover&&a.setupHover(),a.mqlMobile.addListener(a.onMqlMobileChanged),a.mqlHover.addListener(a.onMqlHoverChanged)},destroy:function(){var a=this;a.tabs.destroy(),a.mqlMobile.removeListener(a.onMqlMobileChanged),a.mqlMobile.removeListener(a.onMqlHoverChanged)},setupMobile:function(){var a=this;a.$el.addClass("is-mobile"),a.tabs.setupMobile()},teardownMobile:function(){var a=this;a.$el.removeClass("is-mobile"),a.tabs.teardownMobile()},setupHover:function(){var a=this;a.$el.addClass("can-hover"),a.tabs.setupHover()},teardownHover:function(){var a=this;a.$el.removeClass("can-hover"),a.tabs.teardownHover()},onMqlMobileChanged:function(a){var b=this;(b.isMobile=a.matches)?b.setupMobile():b.teardownMobile()},onMqlHoverChanged:function(a){var b=this;(b.canHover=a.matches)?b.setupHover():b.teardownHover()}}),b.Settings.defaults={mobile:960},a(function(){b.settings=new b.Settings(".foogallery-settings",{mobile:960}),b.settings.init()})}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.obj),function(a,b,c,d,e){b.Settings.VerticalTabs=c.Class.extend({construct:function(a){var b=this;b.settings=a,b.$tabs=null,b.$contents=null,b.children=[]},init:function(){var a=this,c=a.settings.$el;a.$tabs=c.children(".foogallery-vertical-tabs"),a.$contents=c.children(".foogallery-tab-contents"),a.children=a.$tabs.children(".foogallery-vertical-tab").map(function(c,d){var e=new b.Settings.VerticalTabs.Tab(a,d);return e.init(),e}).get()},destroy:function(){this.children.forEach(function(a){a.destroy()})},setupMobile:function(){this.children.forEach(function(a){a.setupMobile()})},teardownMobile:function(){this.children.forEach(function(a){a.teardownMobile()})},setupHover:function(){this.children.forEach(function(a){a.setupHover()})},teardownHover:function(){this.children.forEach(function(a){a.teardownHover()})},hideMenu:function(){this.children.forEach(function(a){a.toggleMenu(!1)})},showMenu:function(a){this.children.forEach(function(b){b.toggleMenu(b.name===a)})}}),b.Settings.VerticalTabs.Tab=c.Class.extend({construct:function(b,c){var e=this;e.vt=b,e.$el=d.jq(c)?c:a(c),e.name=null,e.selector=null,e.$content=null,e.$tabs=null,e.$header=null,e.children=[],e.target=null,e.hasChildren=!1,e._enter=null,e._leave=null,e.onClick=e.onClick.bind(e),e.onDocumentClick=e.onDocumentClick.bind(e),e.onMouseEnter=e.onMouseEnter.bind(e),e.onMouseLeave=e.onMouseLeave.bind(e)},init:function(){var c=this;c.name=c.$el.data("name"),c.selector='[data-name="'+c.name+'"]',c.$content=c.vt.$contents.find(c.selector),c.$tabs=c.$el.children(".foogallery-vertical-child-tabs"),c.children=c.$tabs.children(".foogallery-vertical-child-tab").map(function(a,d){var e=new b.Settings.VerticalTabs.Tab(c.vt,d);return e.init(),e}).get(),c.hasChildren=c.children.length>0,c.target=c.children.find(function(a){return a.name===c.name})||null,c.$header=a("<div/>",{class:"foogallery-vertical-child-header"}).append(a("<span/>",{class:"foogallery-tab-text",text:c.$el.children(".foogallery-tab-text").first().text()})),c.$el.on("click",c.onClick)},destroy:function(){var a=this;a.$el.off("click",a.onClick)},setupMobile:function(){var a=this;a.$tabs.prepend(a.$header)},teardownMobile:function(){this.$header.remove()},setupHover:function(){var a=this;a.$el.on({mouseenter:a.onMouseEnter,mouseleave:a.onMouseLeave})},teardownHover:function(){var a=this;a.$el.off({mouseenter:a.onMouseEnter,mouseleave:a.onMouseLeave})},activate:function(){var a=this;if(a.target instanceof b.Settings.VerticalTabs.Tab)a.target.activate();else{a.vt.$tabs.add(a.vt.$contents).find(".foogallery-tab-active").removeClass("foogallery-tab-active");a.$el.closest(".foogallery-vertical-tab").add(a.$el).add(a.$content).addClass("foogallery-tab-active"),a.vt.hideMenu()}},toggleMenu:function(b){var c=this,e=c.$el.closest(".foogallery-vertical-tab");b=d.undef(b)?!e.hasClass("foogallery-show-child-menu"):!!b,e.toggleClass("foogallery-show-child-menu",b),b?a(document).on("click",c.onDocumentClick):a(document).off("click",c.onDocumentClick)},onMouseEnter:function(a){var b=this;b.hasChildren&&(clearTimeout(b._leave),b._leave=null,null===b._enter&&(b._enter=setTimeout(function(){b.$el.addClass("foogallery-show-child-menu"),b._enter=null},300)))},onMouseLeave:function(a){var b=this;b.hasChildren&&(clearTimeout(b._enter),b._enter=null,null===b._leave&&(b._leave=setTimeout(function(){b.$el.removeClass("foogallery-show-child-menu"),b._leave=null},300)))},onClick:function(a){a.preventDefault(),a.stopPropagation();var b=this;b.hasChildren&&b.vt.settings.isMobile&&!b.vt.settings.canHover?b.toggleMenu():b.activate()},onDocumentClick:function(a){a.preventDefault(),this.toggleMenu(!1)}})}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.obj);