From bfe4274231836a997a0189c64867961a3c355ce9 Mon Sep 17 00:00:00 2001 From: TeoAlex Date: Tue, 13 Aug 2024 16:14:14 +0300 Subject: [PATCH 1/3] [ #1018 ] PHP warning: undefined key. --- changelog.txt | 3 +++ includes/admin/class-modula-cpt.php | 5 ++--- readme.txt | 3 +++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/changelog.txt b/changelog.txt index edd37e77..2b167b91 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,6 @@ += 2.9.1 - 13.08.2024 = +Fixed: PHP warning: undefined key. + = 2.9.0 - 12.08.2024 = Added: bnb like gallery layout upsell setting. Fixed: Error with Elementor theme builder. diff --git a/includes/admin/class-modula-cpt.php b/includes/admin/class-modula-cpt.php index 8a0db339..2a0ee96b 100644 --- a/includes/admin/class-modula-cpt.php +++ b/includes/admin/class-modula-cpt.php @@ -971,10 +971,9 @@ private function get_gallery_types(){ */ public function search_by_gallery_id( $query ) { global $pagenow; - - if ( is_admin() && $pagenow == 'edit.php' && $query->query_vars['post_type'] == 'modula-gallery' ) { - + if ( is_admin() && $pagenow == 'edit.php' && isset( $query->query_vars ) && isset( $query->query_vars['post_type'] ) && $query->query_vars['post_type'] == 'modula-gallery' ) { + // search by ID if( isset( $query->query_vars['s'] ) ){ $search_term = $query->query_vars['s']; diff --git a/readme.txt b/readme.txt index a2ef06d4..a1850741 100644 --- a/readme.txt +++ b/readme.txt @@ -154,6 +154,9 @@ Free support is included only with a PRO license: [Buy Modula PRO](https://wp-mo 4. Responsive galleries created with Modula == Changelog == += 2.9.1 - 13.08.2024 = +Fixed: PHP warning: undefined key. ( [#1018]( https://github.com/WPChill/modula-lite/issues/1018) ) + = 2.9.0 - 12.08.2024 = Added: bnb like gallery layout upsell setting. ( [#1002]( https://github.com/WPChill/modula-lite/issues/1002) ) Fixed: Error with Elementor theme builder. ( [#1014]( https://github.com/WPChill/modula-lite/issues/1014) ) From 60a690717d496304a2c50a331b30e9f346c75fc5 Mon Sep 17 00:00:00 2001 From: TeoAlex Date: Wed, 14 Aug 2024 10:19:00 +0300 Subject: [PATCH 2/3] [ #987 ] RTL elements orientation option added to isotope script. --- assets/js/admin/modula-media.min.js | 2 +- assets/js/admin/wp-modula-items.min.js | 2 +- assets/js/admin/wp-modula-upload.min.js | 2 +- assets/js/front/jquery-modula.js | 5 +++++ assets/js/front/jquery-modula.min.js | 2 +- changelog.txt | 5 +++-- readme.txt | 5 +++-- 7 files changed, 15 insertions(+), 8 deletions(-) diff --git a/assets/js/admin/modula-media.min.js b/assets/js/admin/modula-media.min.js index be7b4e3a..29fcb155 100644 --- a/assets/js/admin/modula-media.min.js +++ b/assets/js/admin/modula-media.min.js @@ -1 +1 @@ -function ModulaMakeItem(e){return new_item={id:"",title:"",description:"",alt:"",link:"",halign:"center",valign:"middle",target:"",togglelightbox:"",src:"",type:"image",width:2,height:2,full:"",thumbnail:"",resize:!1,index:"",orientation:"landscape"},new_item.id=e.attributes.id,new_item.title=e.attributes.name,new_item.description=e.attributes.caption,new_item.alt=e.attributes.alt,new_item.width=e.attributes.width,new_item.width=e.attributes.height,new_item.type=e.attributes.type,new_item}jQuery(document).ready((function(e){var t=e("#bulk-action-selector-top"),l=e("#bulk-action-selector-bottom"),i=wp.template("modula-gallery-selector");void 0!==modulaGalleries.posts&&0!=modulaGalleries.posts.length&&(void 0!==t[0]&&(modulaGalleries.pos="top",t.after(i(modulaGalleries))),void 0!==l[0]&&(modulaGalleries.pos="bottom",l.after(i(modulaGalleries)))),e(document).on("change","#bulk-action-selector-top, #bulk-action-selector-bottom",(function(){"modula_add_to_gallery"==e(this).val()?e("#modula_gallery_select_top, #modula_gallery_select_bottom").show():e("#modula_gallery_select_top, #modula_gallery_select_bottom").hide()}));var o,a=wp.media.view.Button;o=a.extend({initialize:function(){a.prototype.initialize.apply(this,arguments),this.options.filters&&this.options.filters.model.on("change",this.filterChange,this),this.controller.on("selection:toggle",this.toggleDisabled,this),this.controller.on("select:activate",this.toggleDisabled,this)},toggleDisabled:function(){this.model.set("disabled",!this.controller.state().get("selection").length)},render:function(){return a.prototype.render.apply(this,arguments),this.controller.isModeActive("select")?this.$el.addClass("delete-selected-button"):this.$el.addClass("delete-selected-button hidden"),this.toggleDisabled(),this}}),ModulaGallerySelector=wp.media.View.extend({className:"view-switch wp-modula-gallery-selector",template:wp.template("modula-gallery-selector"),initialize:function(){this.controller.on("selection:toggle",this.toggleDisabled,this),this.controller.on("select:activate",this.toggleDisabled,this),this.controller.on("select:deactivate",this.toggleDisabled,this)},toggleDisabled:function(){this.controller.isModeActive("select")?this.$el.show():this.$el.hide(),0==this.controller.state().get("selection").length?this.$el.find("select").prop("disabled",!0):this.$el.find("select").prop("disabled",!1)},render:function(){return this.$el.html(this.template(modulaGalleries.posts)),this.controller.isModeActive("select")?this.$el.addClass("view-switch wp-modula-gallery-selector"):this.$el.addClass("view-switch wp-modula-gallery-selector hidden"),this.toggleDisabled(),this}}),wp.media.view.modulaGallerySelector=ModulaGallerySelector,wp.media.view.addToGalleryBtn=o;var s=wp.media.view.AttachmentsBrowser;wp.media.view.AttachmentsBrowser=s.extend({createToolbar:function(){if(s.prototype.createToolbar.apply(this,arguments),void 0!==modulaGalleries.posts&&0!=modulaGalleries.posts.length){var t=this.toolbar,l=this.toolbar.get("filters");t.set("modulaGallerySelector",new ModulaGallerySelector({filters:l,style:"primary",controller:this.controller,priority:-181}).render()),t.set("addToGalleryBtn",new wp.media.view.addToGalleryBtn({filters:l,style:"primary",text:"Add to Modula Gallery",controller:this.controller,priority:-180,click:function(){var t=[],l=this.controller.state().get("selection"),i=this.controller.state().get("library");if(l.length)if(l.each((function(e){"trash"!==e.get("status")&&t.push(ModulaMakeItem(e))})),t.length){var o=e("#modula_gallery_select").val(),a=modulaGalleries.nonce;e.ajax({url:modulaGalleries.ajax_url,type:"POST",dataType:"json",data:{action:"add_images_to_gallery",selected:JSON.stringify(t),gallery_id:o,nonce:a},success:function(t){t.success?(i._requery(!0),e(document).trigger("modula:media:insert:done",t.data),this.controller.trigger("selection:action:done")):alert(modulaGalleries.l10n.ajax_failed+t.data)}.bind(this),error:function(e,t,l){alert(modulaGalleries.l10n.ajax_failed+l)}})}else this.controller.trigger("selection:action:done")}}).render())}}})})),jQuery(document).on("modula:media:insert:done",(function(e,t){var l=jQuery("
",{text:t,class:"notice notice-success is-dismissible",css:{padding:"10px",margin:"5px 0 0 0"}});jQuery(".attachments-browser").prepend(l),setTimeout((function(){l.fadeOut((function(){jQuery(this).remove()}))}),5e3)})); \ No newline at end of file +function ModulaMakeItem(e){return new_item={id:"",title:"",description:"",alt:"",link:"",halign:"center",valign:"middle",target:"",togglelightbox:"",hide_title:"",src:"",type:"image",width:2,height:2,full:"",thumbnail:"",resize:!1,index:"",orientation:"landscape"},new_item.id=e.attributes.id,new_item.title=e.attributes.name,new_item.description=e.attributes.caption,new_item.alt=e.attributes.alt,new_item.width=e.attributes.width,new_item.width=e.attributes.height,new_item.type=e.attributes.type,new_item}jQuery(document).ready((function(e){var t=e("#bulk-action-selector-top"),l=e("#bulk-action-selector-bottom"),i=wp.template("modula-gallery-selector");void 0!==modulaGalleries.posts&&0!=modulaGalleries.posts.length&&(void 0!==t[0]&&(modulaGalleries.pos="top",t.after(i(modulaGalleries))),void 0!==l[0]&&(modulaGalleries.pos="bottom",l.after(i(modulaGalleries)))),e(document).on("change","#bulk-action-selector-top, #bulk-action-selector-bottom",(function(){"modula_add_to_gallery"==e(this).val()?e("#modula_gallery_select_top, #modula_gallery_select_bottom").show():e("#modula_gallery_select_top, #modula_gallery_select_bottom").hide()}));var o,a=wp.media.view.Button;o=a.extend({initialize:function(){a.prototype.initialize.apply(this,arguments),this.options.filters&&this.options.filters.model.on("change",this.filterChange,this),this.controller.on("selection:toggle",this.toggleDisabled,this),this.controller.on("select:activate",this.toggleDisabled,this)},toggleDisabled:function(){this.model.set("disabled",!this.controller.state().get("selection").length)},render:function(){return a.prototype.render.apply(this,arguments),this.controller.isModeActive("select")?this.$el.addClass("delete-selected-button"):this.$el.addClass("delete-selected-button hidden"),this.toggleDisabled(),this}}),ModulaGallerySelector=wp.media.View.extend({className:"view-switch wp-modula-gallery-selector",template:wp.template("modula-gallery-selector"),initialize:function(){this.controller.on("selection:toggle",this.toggleDisabled,this),this.controller.on("select:activate",this.toggleDisabled,this),this.controller.on("select:deactivate",this.toggleDisabled,this)},toggleDisabled:function(){this.controller.isModeActive("select")?this.$el.show():this.$el.hide(),0==this.controller.state().get("selection").length?this.$el.find("select").prop("disabled",!0):this.$el.find("select").prop("disabled",!1)},render:function(){return this.$el.html(this.template(modulaGalleries.posts)),this.controller.isModeActive("select")?this.$el.addClass("view-switch wp-modula-gallery-selector"):this.$el.addClass("view-switch wp-modula-gallery-selector hidden"),this.toggleDisabled(),this}}),wp.media.view.modulaGallerySelector=ModulaGallerySelector,wp.media.view.addToGalleryBtn=o;var s=wp.media.view.AttachmentsBrowser;wp.media.view.AttachmentsBrowser=s.extend({createToolbar:function(){if(s.prototype.createToolbar.apply(this,arguments),void 0!==modulaGalleries.posts&&0!=modulaGalleries.posts.length){var t=this.toolbar,l=this.toolbar.get("filters");t.set("modulaGallerySelector",new ModulaGallerySelector({filters:l,style:"primary",controller:this.controller,priority:-181}).render()),t.set("addToGalleryBtn",new wp.media.view.addToGalleryBtn({filters:l,style:"primary",text:"Add to Modula Gallery",controller:this.controller,priority:-180,click:function(){var t=[],l=this.controller.state().get("selection"),i=this.controller.state().get("library");if(l.length)if(l.each((function(e){"trash"!==e.get("status")&&t.push(ModulaMakeItem(e))})),t.length){var o=e("#modula_gallery_select").val(),a=modulaGalleries.nonce;e.ajax({url:modulaGalleries.ajax_url,type:"POST",dataType:"json",data:{action:"add_images_to_gallery",selected:JSON.stringify(t),gallery_id:o,nonce:a},success:function(t){t.success?(i._requery(!0),e(document).trigger("modula:media:insert:done",t.data),this.controller.trigger("selection:action:done")):alert(modulaGalleries.l10n.ajax_failed+t.data)}.bind(this),error:function(e,t,l){alert(modulaGalleries.l10n.ajax_failed+l)}})}else this.controller.trigger("selection:action:done")}}).render())}}})})),jQuery(document).on("modula:media:insert:done",(function(e,t){var l=jQuery("
",{text:t,class:"notice notice-success is-dismissible",css:{padding:"10px",margin:"5px 0 0 0"}});jQuery(".attachments-browser").prepend(l),setTimeout((function(){l.fadeOut((function(){jQuery(this).remove()}))}),5e3)})); \ No newline at end of file diff --git a/assets/js/admin/wp-modula-items.min.js b/assets/js/admin/wp-modula-items.min.js index bef87f24..58464f4a 100644 --- a/assets/js/admin/wp-modula-items.min.js +++ b/assets/js/admin/wp-modula-items.min.js @@ -1 +1 @@ -wp.Modula=void 0===wp.Modula?{}:wp.Modula,function(e,t){var i=Backbone.Collection.extend({updateInterval:!1,initialize:function(){this.listenTo(this,"remove",e.proxy(wp.Modula.Save.checkSave,wp.Modula.Save)),this.listenTo(this,"add",e.proxy(wp.Modula.Save.checkSave,wp.Modula.Save))},modelId:function(e){return e.id},moveItem:function(e,t){this.indexOf(e)!=t&&(this.remove(e,{silent:!0}),this.add(e,{at:t-1}))},addItem:function(e){this.add(e)}}),s=Backbone.Model.extend({defaults:{id:"",title:"",description:"",alt:"",link:"",halign:"",valign:"",target:"",togglelightbox:"",src:"",type:"image",width:2,height:2,full:"",thumbnail:"",resize:!1,index:"",orientation:"landscape"},updateInterval:!1,initialize:function(e){t.Items=void 0===t.Items?new t.items.collection:t.Items,t.Items.addItem(this),this.set("index",t.Items.indexOf(this));var i=new t.items.view({model:this,id:"modula-item-"+this.get("id")});this.set("view",i),"custom-grid"==t.Settings.get("type")&&(this.set("resize",!0),this.resize())},getAttributes:function(){var e=this.toJSON(),t={};return jQuery.each(e,(function(e,i){"object"!=typeof i&&(t[e]=i)})),t},resize:function(){var e,i,s=t.Resizer.get("size"),l=t.Resizer.get("gutter"),a=t.Resizer.get("columns"),n=this.get("width"),d=this.get("height"),r=this.get("view");parseInt(n)>parseInt(a)&&(this.set("width",a),n=a),"custom-grid"==t.Settings.get("type")&&(e=s*n+(n-1)*l,i=s*d+(d-1)*l,r.$el.width(e),r.$el.height(i)),this.get("view").render()},delete:function(){this.trigger("destroy",this,this.collection,{}),this.get("view").remove(),"custom-grid"==t.Settings.get("type")&&t.GalleryView.resetPackary()}}),l=Backbone.View.extend({tagName:"div",className:"modula-single-image",fitTimeout:!1,id:"",template:wp.template("modula-image"),events:{"click .modula-edit-image":"editImage","click .modula-delete-image":"deleteImage",resize:"resizeImage",resizestop:"resizeStop","modula:updateIndex":"updateIndex"},initialize:function(e){t.GalleryView.container.append(this.render().$el),this.listenTo(t.Settings,"change:type",this.checkSettingsType),this.listenTo(t.Items,"remove",this.actualizeIndex),this.checkGalleryType(t.Settings.get("type")),this.model.get("resize")&&(t.GalleryView.container.packery("appended",this.$el),t.GalleryView.container.packery())},editImage:function(e){e.preventDefault(),t.EditModal.open(this.model)},deleteImage:function(e){e.preventDefault(),this.model.delete()},checkSettingsType:function(e,t){this.checkGalleryType(t)},checkGalleryType:function(e){var i=this.model.get("resize"),s=this;if("custom-grid"!=e||i)"custom-grid"!=e&&i&&this.destroyResizible();else{var l,a,n=t.Resizer.get("size"),d=t.Resizer.get("gutter"),r=(t.Resizer.get("columns"),this.model.get("width")),h=this.model.get("height");s.model.set("resize",!0),l=n*r+(r-1)*d,a=n*h+(h-1)*d,this.$el.draggable(),this.initResizable(),this.$el.height(a),this.$el.width(l),t.GalleryView.bindDraggabillyEvents(s.$el),t.GalleryView.resetPackary()}s.render()},initResizable:function(){var e=t.Resizer.get("size");this.$el.resizable({handles:{se:this.$(".segrip")},minHeight:e,minWidth:e,maxWidth:t.Resizer.get("containerSize"),helper:"ui-resizable-helper"})},resizeImage:function(i,s){e(i.target).css("z-index","999");var l=t.Resizer.calculateSize(s.size.width),a=t.Resizer.calculateSize(s.size.height);s.helper.width(l),s.helper.height(a),s.element.width(s.size.width),s.element.height(s.size.height)},resizeStop:function(i,s){e(i.target).css("z-index","auto");var l=s.size.width,a=s.size.height,n=t.Resizer.calculateSize(l),d=t.Resizer.calculateSize(a);this.$el.width(n),this.$el.height(d),this.model.set("width",t.Resizer.getSizeColumns(l)),this.model.set("height",t.Resizer.getSizeColumns(a)),this.render(),wp.Modula.Save.saveImages(),t.GalleryView.resetPackary()},destroyResizible:function(){this.model.set("resize",!1),this.$el.draggable("destroy"),this.$el.resizable("destroy"),this.$el.removeAttr("style")},updateIndex:function(e,i){this.model.set("index",i.index),t.Items.moveItem(this.model,i.index),this.render()},actualizeIndex:function(e,i){var s=this.model.get("index"),l=t.Items.indexOf(this.model);-1!=l&&s!=l&&(this.model.set("index",l),this.render())},render:function(){return this.$el.is(".ui-resizable")&&this.$el.resizable("destroy"),this.$el.html(this.template(this.model.attributes)),this.model.get("resize")&&this.initResizable(),this}});t.items={collection:i,model:s,view:l}}(jQuery,wp.Modula); \ No newline at end of file +wp.Modula=void 0===wp.Modula?{}:wp.Modula,function(e,t){var i=Backbone.Collection.extend({updateInterval:!1,initialize:function(){this.listenTo(this,"remove",e.proxy(wp.Modula.Save.checkSave,wp.Modula.Save)),this.listenTo(this,"add",e.proxy(wp.Modula.Save.checkSave,wp.Modula.Save))},modelId:function(e){return e.id},moveItem:function(e,t){this.indexOf(e)!=t&&(this.remove(e,{silent:!0}),this.add(e,{at:t-1}))},addItem:function(e){this.add(e)}}),s=Backbone.Model.extend({defaults:{id:"",title:"",description:"",alt:"",link:"",halign:"",valign:"",target:"",togglelightbox:"",hide_title:"",src:"",type:"image",width:2,height:2,full:"",thumbnail:"",resize:!1,index:"",orientation:"landscape"},updateInterval:!1,initialize:function(e){t.Items=void 0===t.Items?new t.items.collection:t.Items,t.Items.addItem(this),this.set("index",t.Items.indexOf(this));var i=new t.items.view({model:this,id:"modula-item-"+this.get("id")});this.set("view",i),"custom-grid"==t.Settings.get("type")&&(this.set("resize",!0),this.resize())},getAttributes:function(){var e=this.toJSON(),t={};return jQuery.each(e,(function(e,i){"object"!=typeof i&&(t[e]=i)})),t},resize:function(){var e,i,s=t.Resizer.get("size"),l=t.Resizer.get("gutter"),a=t.Resizer.get("columns"),n=this.get("width"),d=this.get("height"),r=this.get("view");parseInt(n)>parseInt(a)&&(this.set("width",a),n=a),"custom-grid"==t.Settings.get("type")&&(e=s*n+(n-1)*l,i=s*d+(d-1)*l,r.$el.width(e),r.$el.height(i)),this.get("view").render()},delete:function(){this.trigger("destroy",this,this.collection,{}),this.get("view").remove(),"custom-grid"==t.Settings.get("type")&&t.GalleryView.resetPackary()}}),l=Backbone.View.extend({tagName:"div",className:"modula-single-image",fitTimeout:!1,id:"",template:wp.template("modula-image"),events:{"click .modula-edit-image":"editImage","click .modula-delete-image":"deleteImage",resize:"resizeImage",resizestop:"resizeStop","modula:updateIndex":"updateIndex"},initialize:function(e){t.GalleryView.container.append(this.render().$el),this.listenTo(t.Settings,"change:type",this.checkSettingsType),this.listenTo(t.Items,"remove",this.actualizeIndex),this.checkGalleryType(t.Settings.get("type")),this.model.get("resize")&&(t.GalleryView.container.packery("appended",this.$el),t.GalleryView.container.packery())},editImage:function(e){e.preventDefault(),t.EditModal.open(this.model)},deleteImage:function(e){e.preventDefault(),this.model.delete()},checkSettingsType:function(e,t){this.checkGalleryType(t)},checkGalleryType:function(e){var i=this.model.get("resize"),s=this;if("custom-grid"!=e||i)"custom-grid"!=e&&i&&this.destroyResizible();else{var l,a,n=t.Resizer.get("size"),d=t.Resizer.get("gutter"),r=(t.Resizer.get("columns"),this.model.get("width")),h=this.model.get("height");s.model.set("resize",!0),l=n*r+(r-1)*d,a=n*h+(h-1)*d,this.$el.draggable(),this.initResizable(),this.$el.height(a),this.$el.width(l),t.GalleryView.bindDraggabillyEvents(s.$el),t.GalleryView.resetPackary()}s.render()},initResizable:function(){var e=t.Resizer.get("size");this.$el.resizable({handles:{se:this.$(".segrip")},minHeight:e,minWidth:e,maxWidth:t.Resizer.get("containerSize"),helper:"ui-resizable-helper"})},resizeImage:function(i,s){e(i.target).css("z-index","999");var l=t.Resizer.calculateSize(s.size.width),a=t.Resizer.calculateSize(s.size.height);s.helper.width(l),s.helper.height(a),s.element.width(s.size.width),s.element.height(s.size.height)},resizeStop:function(i,s){e(i.target).css("z-index","auto");var l=s.size.width,a=s.size.height,n=t.Resizer.calculateSize(l),d=t.Resizer.calculateSize(a);this.$el.width(n),this.$el.height(d),this.model.set("width",t.Resizer.getSizeColumns(l)),this.model.set("height",t.Resizer.getSizeColumns(a)),this.render(),wp.Modula.Save.saveImages(),t.GalleryView.resetPackary()},destroyResizible:function(){this.model.set("resize",!1),this.$el.draggable("destroy"),this.$el.resizable("destroy"),this.$el.removeAttr("style")},updateIndex:function(e,i){this.model.set("index",i.index),t.Items.moveItem(this.model,i.index),this.render()},actualizeIndex:function(e,i){var s=this.model.get("index"),l=t.Items.indexOf(this.model);-1!=l&&s!=l&&(this.model.set("index",l),this.render())},render:function(){return this.$el.is(".ui-resizable")&&this.$el.resizable("destroy"),this.$el.html(this.template(this.model.attributes)),this.model.get("resize")&&this.initResizable(),this}});t.items={collection:i,model:s,view:l}}(jQuery,wp.Modula); \ No newline at end of file diff --git a/assets/js/admin/wp-modula-upload.min.js b/assets/js/admin/wp-modula-upload.min.js index e3e2ad6d..d4a5ea26 100644 --- a/assets/js/admin/wp-modula-upload.min.js +++ b/assets/js/admin/wp-modula-upload.min.js @@ -1 +1 @@ -wp.Modula=void 0===wp.Modula?{}:wp.Modula,function(e,t){var i=wp.media.view.Toolbar.Select.extend({clickSelect:function(){var e=this.controller,t=e.state(),i=t.get("selection");e.close(),t.trigger("insert",i).reset()}}),o=wp.media.view.AttachmentsBrowser.extend({createToolbar:function(){wp.media.view.AttachmentsBrowser.prototype.createToolbar.call(this),this.toolbar.set("modula-error",new t.upload.errorview({controller:this.controller,priority:-80}))}}),a=wp.media.view.MediaFrame.Select.extend({className:"media-frame modula-media-modal",createStates:function(){var e=this.options;e.library.type="image",this.options.states||this.states.add([new t.upload.library({library:wp.media.query(e.library),multiple:e.multiple,title:e.title,priority:20})])},createSelectToolbar:function(e,i){(i=i||this.options.button||{}).controller=this,e.view=new t.upload.toolbar(i)},browseContent:function(e){var i=this.state();e.view=new t.upload.attachmentsbrowser({controller:this,collection:i.get("library"),selection:i.get("selection"),model:i,sortable:i.get("sortable"),search:i.get("searchable"),filters:i.get("filterable"),date:i.get("date"),display:i.has("display")?i.get("display"):i.get("displaySettings"),dragInfo:i.get("dragInfo"),idealColumnWidth:i.get("idealColumnWidth"),suggestedWidth:i.get("suggestedWidth"),suggestedHeight:i.get("suggestedHeight"),AttachmentView:i.get("AttachmentView")})}}),l=wp.media.model.Selection.extend({add:function(e,t){var i,o;return this.multiple||this.remove(this.models),this.length>=20?(e=[],wp.media.frames.modula.trigger("modula:show-error",{message:modulaHelper.strings.limitExceeded})):(i=20-this.length,Array.isArray(e)&&e.length>1&&(o=_.difference(_.pluck(e,"cid"),_.pluck(this.models,"cid"))).length>i&&(e=(e=_.filter(e,(function(e){return _.contains(o,e.cid)}))).slice(0,i),wp.media.frames.modula.trigger("modula:show-error",{message:modulaHelper.strings.limitExceeded}))),wp.media.model.Attachments.prototype.add.call(this,e,t)},single:function(e){var t=this._single;return e&&(this._single=e),this._single&&!this.get(this._single.cid)&&delete this._single,this._single=this._single||this.last(),this._single!==t&&(t&&(t.trigger("selection:unsingle",t,this),this.get(t.cid)||this.trigger("selection:unsingle",t,this)),this._single&&this._single.trigger("selection:single",this._single,this)),this.length<20&&wp.media.frames.modula.trigger("modula:hide-error",{message:modulaHelper.strings.limitExceeded}),this._single}}),r=wp.media.controller.Library.extend({initialize:function(){var e,t=this.get("selection");this.get("library")||this.set("library",wp.media.query()),t||((e=t)||(e=this.get("library").props.toJSON(),e=_.omit(e,"orderby","query")),this.set("selection",new wp.media.model.Selection(null,{multiple:this.get("multiple"),props:e}))),this.resetDisplays()}}),n=wp.media.View.extend({tagName:"div",className:"modula-error-container hide",errorTimeout:!1,delay:400,message:"",initialize:function(){this.controller.on("modula:show-error",this.show,this),this.controller.on("modula:hide-error",this.hide,this),this.render()},show:function(e){void 0!==e.message&&(this.message=e.message),""!=this.message&&(this.render(),this.$el.removeClass("hide"))},hide:function(){this.$el.addClass("hide")},render:function(){var e='
'+this.message+"
";this.$el.html(e)}}),s=Backbone.Model.extend({uploaderOptions:{container:e("#modula-uploader-container"),browser:e("#modula-uploader-browser"),dropzone:e("#modula-uploader-container")},dropzone:e("#modula-dropzone-container"),progressBar:e(".modula-progress-bar"),containerUploader:e(".modula-upload-actions"),errorContainer:e(".modula-error-container"),galleryCotainer:e("#modula-uploader-container .modula-uploader-inline-content"),modula_files_count:0,limitExceeded:!1,initialize:function(){var i,o,a=this;(i=new wp.Uploader(a.uploaderOptions)).uploader.bind("FilesAdded",e.proxy(a.filesadded,a)),i.uploader.bind("UploadProgress",e.proxy(a.fileuploading,a)),i.uploader.bind("FileUploaded",e.proxy(a.fileupload,a)),i.uploader.bind("UploadComplete",e.proxy(a.filesuploaded,a)),i.uploader.bind("Error",(function(e,t){a.errorContainer.html('

'+t.file.name+": "+t.message+"

"),e.refresh()})),(o=i.dropzone).on("dropzone:enter",a.show),o.on("dropzone:leave",a.hide),a.galleryCotainer.on("click",".modula-delete-image",(function(t){t.preventDefault(),e(this).parents(".modula-single-image").remove()})),wp.media.frames.modula=new t.upload.frame({frame:"select",reset:!1,title:wp.media.view.l10n.addToGalleryTitle,button:{text:wp.media.view.l10n.addToGallery},multiple:"add"}),wp.media.frames.modula.on("open",(function(){var e=wp.media.frames.modula.state().get("selection");e.reset(),wp.Modula.Items.each((function(t){var i=wp.media.attachment(t.get("id"));e.add(i?[i]:[])})),e.single(e.last())})),wp.media.frames.modula.on("close",(function(){wp.media.frames.modula.trigger("modula:hide-error",{message:modulaHelper.strings.limitExceeded})})),wp.media.frames.modula.on("insert",(function(e){wp.media.frames.modula.state();var i=wp.Modula.Items;for(t.Items=new t.items.collection,e.each((function(e){var t=e.toJSON(),o=i.get(t.id);o?(wp.Modula.Items.addItem(o),i.remove(o)):a.generateSingleImage(t)}),this);model=i.first();)model.delete()})),e("#modula-wp-gallery").click((function(t){t.preventDefault(),setUserSetting("libraryContent","browse");var i=e("body .media-modal");i.length>0&&i.find("#menu-item-browse").click(),wp.media.frames.modula.open()})),e("#modula_gallery_add_action_button").click((function(t){t.preventDefault(),e("#modula_gallery_add_action").hasClass("open")?e("#modula_gallery_add_action").hide().removeClass("open"):e("#modula_gallery_add_action").show().addClass("open")})),e("#modula_gallery_add_action li").click((function(t){e("#modula_gallery_add_action").hide().removeClass("open")}))},filesadded:function(t,i){var o=this;o.errorContainer.html(""),o.modula_files_count=i.length,e(".modula-upload-numbers .modula-current",o.containerUploader).text("1"),e(".modula-upload-numbers .modula-total",o.containerUploader).text(o.modula_files_count),o.containerUploader.addClass("show-progress")},fileuploading:function(t,i){var o=this;e(".modula-upload-numbers .modula-current",o.containerUploader).text(o.modula_files_count-t.total.queued+1),e(".modula-progress-bar-inner",o.progressBar).css({width:t.total.percent+"%"})},fileupload:function(e,t,i){var o=JSON.parse(i.response);this.generateSingleImage(o.data)},filesuploaded:function(){var e=this;setTimeout((function(){e.containerUploader.removeClass("show-progress")}),1e3)},show:function(){var t=e("#modula-dropzone-container").show();_.defer((function(){t.css({opacity:1})}))},hide:function(){var t=e("#modula-dropzone-container").css({opacity:0});wp.media.transition(t).done((function(){"0"===t.css("opacity")&&t.hide()})),_.delay((function(){"0"===t.css("opacity")&&t.is(":visible")&&t.hide()}),500)},generateSingleImage:function(e){var i={halign:"center",valign:"middle",link:"",target:"",togglelightbox:""};void 0!==e.sizes?(i.full=e.sizes.full.url,void 0!==e.sizes.large?i.thumbnail=e.sizes.large.url:i.thumbnail=i.full):(i.full=e.url,i.thumbnail=i.full),i.id=e.id,i.alt=e.alt,i.orientation=e.orientation,i.title=e.title,i.description=e.caption,new t.items.model(i)}});t.upload={toolbar:i,attachmentsbrowser:o,frame:a,selection:l,library:r,errorview:n,uploadHandler:s}}(jQuery,wp.Modula); \ No newline at end of file +wp.Modula=void 0===wp.Modula?{}:wp.Modula,function(e,t){var i=wp.media.view.Toolbar.Select.extend({clickSelect:function(){var e=this.controller,t=e.state(),i=t.get("selection");e.close(),t.trigger("insert",i).reset()}}),o=wp.media.view.AttachmentsBrowser.extend({createToolbar:function(){wp.media.view.AttachmentsBrowser.prototype.createToolbar.call(this),this.toolbar.set("modula-error",new t.upload.errorview({controller:this.controller,priority:-80}))}}),a=wp.media.view.MediaFrame.Select.extend({className:"media-frame modula-media-modal",createStates:function(){var e=this.options;e.library.type="image",this.options.states||this.states.add([new t.upload.library({library:wp.media.query(e.library),multiple:e.multiple,title:e.title,priority:20})])},createSelectToolbar:function(e,i){(i=i||this.options.button||{}).controller=this,e.view=new t.upload.toolbar(i)},browseContent:function(e){var i=this.state();e.view=new t.upload.attachmentsbrowser({controller:this,collection:i.get("library"),selection:i.get("selection"),model:i,sortable:i.get("sortable"),search:i.get("searchable"),filters:i.get("filterable"),date:i.get("date"),display:i.has("display")?i.get("display"):i.get("displaySettings"),dragInfo:i.get("dragInfo"),idealColumnWidth:i.get("idealColumnWidth"),suggestedWidth:i.get("suggestedWidth"),suggestedHeight:i.get("suggestedHeight"),AttachmentView:i.get("AttachmentView")})}}),l=wp.media.model.Selection.extend({add:function(e,t){var i,o;return this.multiple||this.remove(this.models),this.length>=20?(e=[],wp.media.frames.modula.trigger("modula:show-error",{message:modulaHelper.strings.limitExceeded})):(i=20-this.length,Array.isArray(e)&&e.length>1&&(o=_.difference(_.pluck(e,"cid"),_.pluck(this.models,"cid"))).length>i&&(e=(e=_.filter(e,(function(e){return _.contains(o,e.cid)}))).slice(0,i),wp.media.frames.modula.trigger("modula:show-error",{message:modulaHelper.strings.limitExceeded}))),wp.media.model.Attachments.prototype.add.call(this,e,t)},single:function(e){var t=this._single;return e&&(this._single=e),this._single&&!this.get(this._single.cid)&&delete this._single,this._single=this._single||this.last(),this._single!==t&&(t&&(t.trigger("selection:unsingle",t,this),this.get(t.cid)||this.trigger("selection:unsingle",t,this)),this._single&&this._single.trigger("selection:single",this._single,this)),this.length<20&&wp.media.frames.modula.trigger("modula:hide-error",{message:modulaHelper.strings.limitExceeded}),this._single}}),r=wp.media.controller.Library.extend({initialize:function(){var e,t=this.get("selection");this.get("library")||this.set("library",wp.media.query()),t||((e=t)||(e=this.get("library").props.toJSON(),e=_.omit(e,"orderby","query")),this.set("selection",new wp.media.model.Selection(null,{multiple:this.get("multiple"),props:e}))),this.resetDisplays()}}),n=wp.media.View.extend({tagName:"div",className:"modula-error-container hide",errorTimeout:!1,delay:400,message:"",initialize:function(){this.controller.on("modula:show-error",this.show,this),this.controller.on("modula:hide-error",this.hide,this),this.render()},show:function(e){void 0!==e.message&&(this.message=e.message),""!=this.message&&(this.render(),this.$el.removeClass("hide"))},hide:function(){this.$el.addClass("hide")},render:function(){var e='
'+this.message+"
";this.$el.html(e)}}),s=Backbone.Model.extend({uploaderOptions:{container:e("#modula-uploader-container"),browser:e("#modula-uploader-browser"),dropzone:e("#modula-uploader-container")},dropzone:e("#modula-dropzone-container"),progressBar:e(".modula-progress-bar"),containerUploader:e(".modula-upload-actions"),errorContainer:e(".modula-error-container"),galleryCotainer:e("#modula-uploader-container .modula-uploader-inline-content"),modula_files_count:0,limitExceeded:!1,initialize:function(){var i,o,a=this;(i=new wp.Uploader(a.uploaderOptions)).uploader.bind("FilesAdded",e.proxy(a.filesadded,a)),i.uploader.bind("UploadProgress",e.proxy(a.fileuploading,a)),i.uploader.bind("FileUploaded",e.proxy(a.fileupload,a)),i.uploader.bind("UploadComplete",e.proxy(a.filesuploaded,a)),i.uploader.bind("Error",(function(e,t){a.errorContainer.html('

'+t.file.name+": "+t.message+"

"),e.refresh()})),(o=i.dropzone).on("dropzone:enter",a.show),o.on("dropzone:leave",a.hide),a.galleryCotainer.on("click",".modula-delete-image",(function(t){t.preventDefault(),e(this).parents(".modula-single-image").remove()})),wp.media.frames.modula=new t.upload.frame({frame:"select",reset:!1,title:wp.media.view.l10n.addToGalleryTitle,button:{text:wp.media.view.l10n.addToGallery},multiple:"add"}),wp.media.frames.modula.on("open",(function(){var e=wp.media.frames.modula.state().get("selection");e.reset(),wp.Modula.Items.each((function(t){var i=wp.media.attachment(t.get("id"));e.add(i?[i]:[])})),e.single(e.last())})),wp.media.frames.modula.on("close",(function(){wp.media.frames.modula.trigger("modula:hide-error",{message:modulaHelper.strings.limitExceeded})})),wp.media.frames.modula.on("insert",(function(e){wp.media.frames.modula.state();var i=wp.Modula.Items;for(t.Items=new t.items.collection,e.each((function(e){var t=e.toJSON(),o=i.get(t.id);o?(wp.Modula.Items.addItem(o),i.remove(o)):a.generateSingleImage(t)}),this);model=i.first();)model.delete()})),e("#modula-wp-gallery").click((function(t){t.preventDefault(),setUserSetting("libraryContent","browse");var i=e("body .media-modal");i.length>0&&i.find("#menu-item-browse").click(),wp.media.frames.modula.open()})),e("#modula_gallery_add_action_button").click((function(t){t.preventDefault(),e("#modula_gallery_add_action").hasClass("open")?e("#modula_gallery_add_action").hide().removeClass("open"):e("#modula_gallery_add_action").show().addClass("open")})),e("#modula_gallery_add_action li").click((function(t){e("#modula_gallery_add_action").hide().removeClass("open")}))},filesadded:function(t,i){var o=this;o.errorContainer.html(""),o.modula_files_count=i.length,e(".modula-upload-numbers .modula-current",o.containerUploader).text("1"),e(".modula-upload-numbers .modula-total",o.containerUploader).text(o.modula_files_count),o.containerUploader.addClass("show-progress")},fileuploading:function(t,i){var o=this;e(".modula-upload-numbers .modula-current",o.containerUploader).text(o.modula_files_count-t.total.queued+1),e(".modula-progress-bar-inner",o.progressBar).css({width:t.total.percent+"%"})},fileupload:function(e,t,i){var o=JSON.parse(i.response);this.generateSingleImage(o.data)},filesuploaded:function(){var e=this;setTimeout((function(){e.containerUploader.removeClass("show-progress")}),1e3)},show:function(){var t=e("#modula-dropzone-container").show();_.defer((function(){t.css({opacity:1})}))},hide:function(){var t=e("#modula-dropzone-container").css({opacity:0});wp.media.transition(t).done((function(){"0"===t.css("opacity")&&t.hide()})),_.delay((function(){"0"===t.css("opacity")&&t.is(":visible")&&t.hide()}),500)},generateSingleImage:function(e){var i={halign:"center",valign:"middle",link:"",target:"",togglelightbox:"",hideTitle:""};void 0!==e.sizes?(i.full=e.sizes.full.url,void 0!==e.sizes.large?i.thumbnail=e.sizes.large.url:i.thumbnail=i.full):(i.full=e.url,i.thumbnail=i.full),i.id=e.id,i.alt=e.alt,i.orientation=e.orientation,i.title=e.title,i.description=e.caption,new t.items.model(i)}});t.upload={toolbar:i,attachmentsbrowser:o,frame:a,selection:l,library:r,errorview:n,uploadHandler:s}}(jQuery,wp.Modula); \ No newline at end of file diff --git a/assets/js/front/jquery-modula.js b/assets/js/front/jquery-modula.js index 3261f611..fa733dcf 100644 --- a/assets/js/front/jquery-modula.js +++ b/assets/js/front/jquery-modula.js @@ -56,6 +56,7 @@ jQuery(window).on('elementor/frontend/init', function () { lightbox : 'fancybox', lightboxOpts : {}, inView : false, + originLeft : true, }; // The actual plugin constructor @@ -360,6 +361,7 @@ jQuery(window).on('elementor/frontend/init', function () { var packery_args = { itemSelector: '.modula-item', layoutMode : 'packery', + originLeft : plugin.options.originLeft, packery : { gutter: parseInt(plugin.options.gutter), }, @@ -433,6 +435,7 @@ jQuery(window).on('elementor/frontend/init', function () { resizesContainer: false, itemSelector : '.modula-item', layoutMode : 'packery', + originLeft : instance.options.originLeft, packery : { gutter: parseInt(instance.options.gutter), }, @@ -468,6 +471,7 @@ jQuery(window).on('elementor/frontend/init', function () { itemSelector: '.modula-item', // percentPosition: true, layoutMode: 'packery', + originLeft: this.options.originLeft, packery : { // use element for option gutter: parseInt(this.options.gutter), @@ -610,6 +614,7 @@ jQuery(window).on('elementor/frontend/init', function () { instance.$itemsCnt .modulaisotope({ packery: { + originLeft: instance.options.originLeft, gutter: parseInt(instance.options.gutter), }, }) diff --git a/assets/js/front/jquery-modula.min.js b/assets/js/front/jquery-modula.min.js index ea788d2b..b7bbf66e 100644 --- a/assets/js/front/jquery-modula.min.js +++ b/assets/js/front/jquery-modula.min.js @@ -1 +1 @@ -function modulaInViewport(t){"function"==typeof jQuery&&t instanceof jQuery&&(t=t[0]);var e=t.getBoundingClientRect();return e.top-jQuery(window).height()<=-100&&e.top-jQuery(window).height()>=-400||e.bottom<=jQuery(window).height()}jQuery(document).on("vc-full-width-row-single vc-full-width-row",(function(t,e){jQuery("body").find(".modula").length>0&&jQuery(window).trigger("modula-update")})),jQuery(window).on("elementor/frontend/init",(function(){window.elementorFrontend&&window.elementorFrontend.hooks.addAction("frontend/element_ready/global",(function(t){jQuery("body").find(".modula").length}))})),function(t,e,i,o){var a="modulaGallery",n={resizer:"/",keepArea:!0,type:"creative-gallery",columns:12,height:800,desktopHeight:800,mobileHeight:800,tabletHeight:800,gutter:10,desktopGutter:10,mobileGutter:10,tabletGutter:10,enableTwitter:!1,enableFacebook:!1,enableWhatsapp:!1,enablePinterest:!1,enableLinkedin:!1,enableEmail:!1,lazyLoad:0,initLightbox:!1,lightbox:"fancybox",lightboxOpts:{},inView:!1};function s(e,i){this.element=e,this.$element=t(e),this.$itemsCnt=this.$element.find(".modula-items"),this.$items=this.$itemsCnt.find(".modula-item"),this.options=t.extend({},n,i),this._defaults=n,this._name=a,this.tiles=[],this.$tilesCnt=null,this.completed=!1,this.lastWidth=0,this.resizeTO=0,this.isIsotope=!1,this.isLazyLoaded=!0,this.init()}s.prototype.init=function(){var o=this,a=i.documentElement.clientWidth;this.options.gutter=a<=568?this.options.mobileGutter:a<=768?this.options.tabletGutter:this.options.desktopGutter,t(i).trigger("modula_api_before_init",[o]),"custom-grid"===this.options.type?this.createCustomGallery():"creative-gallery"==this.options.type?this.createGrid():"grid"==this.options.type&&("automatic"==this.options.grid_type?this.createAutoGrid():this.createColumnsGrid()),"custom-grid"===this.options.type&&t(e).height(){o.onResize(o)})).observe(o.$element[0]),t(e).on("modula-update",(function(){o.onResize(o)})),t(i).on("lazyloaded",(function(e){var i,a,n=t(e.target);"modula"==n.data("source")&&(n.data("size",{width:n.width(),height:n.height()}),(i=n.parents(".modula-item")).addClass("tg-loaded"),a=o.$items.not(".jtg-hidden").index(i),o.placeImage(a),o.isIsotope&&void 0!==o.$itemsCnt.data("modulaisotope")&&o.$itemsCnt.modulaisotope("layout"),"grid"==o.options.type&&"automatic"==o.options.grid_type&&o.$itemsCnt.justifiedGallery())})),o.options.inView&&jQuery(e).on("DOMContentLoaded load resize scroll",(function(){modulaInViewport(o.$element)&&o.$element.addClass("modula-loaded-scale")})),this.setupSocial(),jQuery(o.$element).addClass("modula-gallery-initialized"),this.options.onComplete&&this.options.onComplete(),"fancybox"!=o.options.lightbox||o.options.initLightbox||this.initLightbox(),t(i).trigger("modula_api_after_init",[o])},s.prototype.initLightbox=function(){var e=this;e.$element.on("click",".modula-no-follow",(function(t){t.preventDefault()})),e.$element.on("click keypress",".modula-item-link:not( .modula-simple-link )",(function(i){if(13===i.which||"click"===i.type){i.preventDefault();var o=jQuery(this),a=t.map(e.$items,(function(t){if(jQuery(t).find(".modula-item-link:not( .modula-no-follow )").length>0){var e=jQuery(t).find(".modula-item-link:not( .modula-simple-link )"),i=jQuery(t).find(".pic");return{src:i.data("full"),opts:{$thumb:i.parents(".modula-item"),caption:e.data("caption"),alt:i.attr("alt"),image_id:e.attr("data-image-id"),title:i.attr("title")},current:jQuery(t).is(o.parents(".modula-item"))}}})),n=t.map(a,(function(t,e){if(t.current)return e}))[0];jQuery.modulaFancybox.open(a,e.options.lightboxOpts,n)}}))},s.prototype.trunc=function(t){return Math.trunc?Math.trunc(t):(t=+t,isFinite(t)?t-t%1||(t<0?-0:0===t?t:0):t)},s.prototype.createCustomGallery=function(){var e,o=this,a=this.$element.find(".modula-items").width(),n=this,s=this.options.columns,r=i.documentElement.clientWidth;"1"==this.options.enableResponsive&&(r<=568?s=this.options.mobileColumns:r<=768&&(s=this.options.tabletColumns)),e=this.options.gutter>0?(a-this.options.gutter*(s-1))/s:Math.floor(a/s*1e3)/1e3,this.$items.not(".jtg-hidden").each((function(i,a){var r,d,l,h,m={};r=t(a).data("width"),d=t(a).data("height"),r>12&&(r=12),"1"==n.options.enableResponsive&&(l=r,h=d,1==s?d=(r=1)*h/l:((r=Math.round(s*l/12))<1&&(r=1),(d=Math.round(r*h/l))<1&&(d=1))),m.width=e*r+n.options.gutter*(r-1),m.height=Math.round(e)*d+n.options.gutter*(d-1),t(a).data("size",m).addClass("tiled").addClass(m.width>m.height?"tile-h":"tile-v").data("position"),t(a).css(t(a).data("size")),t(a).find(".figc").css({width:t(a).data("size").width,height:t(a).data("size").height}),o.loadImage(i)}));var d={itemSelector:".modula-item",layoutMode:"packery",packery:{gutter:parseInt(n.options.gutter)}};this.$itemsCnt.modulaisotope(d),this.isIsotope=!0},s.prototype.createGrid=function(){var e=this,o=i.documentElement.clientWidth;e.options.height=o<=568?e.options.mobileHeight:o<=768?e.options.tabletHeight:e.options.desktopHeight,this.$itemsCnt.data("area",this.$itemsCnt.width()*this.options.height),this.lastWidth=this.$itemsCnt.width();for(var a=0;aa.height?"tile-h":"tile-v").data("position"),t(o).css({width:a.width,height:a.height}),t(o).find(".figc").css({width:a.width,height:a.height}),e.loadImage(i)})),!this.isIsotope){var n={resizesContainer:!1,itemSelector:".modula-item",layoutMode:"packery",packery:{gutter:parseInt(e.options.gutter)}};this.$itemsCnt.modulaisotope(n),this.isIsotope=!0}},s.prototype.createAutoGrid=function(){this.$itemsCnt.justifiedGallery({rowHeight:this.options.rowHeight,margins:this.options.gutter,lastRow:this.options.lastRow,captions:!1,border:0,imgSelector:"img.pic",cssAnimation:!0,imagesAnimationDuration:700})},s.prototype.createColumnsGrid=function(){var t=this;this.$itemsCnt.modulaisotope({itemSelector:".modula-item",layoutMode:"packery",packery:{gutter:parseInt(this.options.gutter)}}),this.$items.each((function(e,i){t.loadImage(e)})),this.isIsotope=!0},s.prototype.getSlot=function(){if(0==this.tiles.length)return i={top:0,left:0,width:this.$itemsCnt.width(),height:this.options.height,area:this.$itemsCnt.width()*this.options.height,position:0};for(var t=0,e=0;ethis.tiles[t].area&&(t=e)}var i={},o=this.tiles[t];if(o.width>o.height){var a=o.width/2*this.options.randomFactor;o.prevWidth=o.width,o.width=Math.floor(o.width/2+a*(Math.random()-.5)),i={top:o.top,left:o.left+o.width+this.options.gutter,width:o.prevWidth-o.width-this.options.gutter,height:o.height}}else{a=o.height/2*this.options.randomFactor;o.prevHeight=o.height,o.height=Math.floor(o.height/2+a*(Math.random()-.5)),i={left:o.left,top:o.top+o.height+this.options.gutter,width:o.width,height:o.prevHeight-o.height-this.options.gutter}}return i.area=i.width*i.height,i.position=1e3*i.top+i.left,o.position=1e3*o.top+o.left,this.tiles[t]=o,this.tiles[t].area=o.width*o.height,i},s.prototype.reset=function(){var e=this;e.tiles=[],"custom-grid"===this.options.type?this.createCustomGallery():"creative-gallery"==this.options.type?this.createGrid():"grid"==this.options.type&&("automatic"==this.options.grid_type?this.createAutoGrid():this.createColumnsGrid()),e.lastWidth=e.$itemsCnt.width(),t(i).trigger("modula_api_reset",[e])},s.prototype.onResize=function(t){if(t.lastWidth!=t.$itemsCnt.width()){var e=i.documentElement.clientWidth;t.options.gutter=e<=568?t.options.mobileGutter:e<=768?t.options.tabletGutter:this.options.desktopGutter,clearTimeout(t.resizeTO),t.resizeTO=setTimeout((function(){if(t.options.keepArea){var e=t.$itemsCnt.data("area");t.$itemsCnt.height(e/t.$itemsCnt.width())}t.reset(),t.isIsotope&&t.$itemsCnt.modulaisotope({packery:{gutter:parseInt(t.options.gutter)}}).modulaisotope("layout")}),100)}},s.prototype.loadImage=function(t){var e=this,i=e.$items.not(".jtg-hidden").eq(t).find(".pic"),o={};if("0"==e.options.lazyLoad){var a=new Image;a.onload=function(){o={width:this.width,height:this.height},i.data("size",o),e.placeImage(t)},"undefined"!=i.attr("src")?a.src=i.attr("src"):a.src=i.data("src")}else e.placeImage(t)},s.prototype.placeImage=function(t){if("grid"!=this.options.type){var e=this.$items.not(".jtg-hidden").eq(t),i=e.find(".pic"),o=e.data("size"),a=i.data("size");if(void 0!==o&&void 0!==a){o.width,o.height;var n=a.width/a.height,s=i.data("valign")?i.data("valign"):"middle",r=i.data("halign")?i.data("halign"):"center",d={top:"auto",bottom:"auto",left:"auto",right:"auto",width:"auto",height:"auto",margin:"0",maxWidth:"999em"};if(o.width*a.height/a.width>o.height)switch(d.width=o.width,d.left=0,s){case"top":d.top=0;break;case"middle":d.top=0-(o.width*(1/n)-o.height)/2;break;case"bottom":d.bottom=0}else switch(d.height=o.height,d.top=0,r){case"left":d.left=0;break;case"center":d.left=0-(o.height*n-o.width)/2;break;case"right":d.right=0}e.hasClass("effect-under")&&(d.top=d.top-e.find(".modula-item-content").height()),i.css(d),this.$items.not(".jtg-hidden").eq(t).addClass("tg-loaded")}}},s.prototype.setupSocial=function(){(this.options.enableTwitter||this.options.enableFacebook||this.options.enablePinterest||this.options.enableLinkedin||this.options.enableWhatsapp||this.options.enableEmail)&&c(this.$items),this.options.enableTwitter&&r(this.$items,this),this.options.enableFacebook&&d(this.$items,this),this.options.enablePinterest&&h(this.$items,this),this.options.enableLinkedin&&m(this.$items,this),this.options.enableWhatsapp&&l(this.$items,this),this.options.enableEmail&&u(this.$items,this)},s.prototype.destroy=function(){this.isPackeryActive&&(this.$itemsCnt.packery("destroy"),this.isPackeryActive=!1)};var r=function(o,a){o.find(".modula-icon-twitter").click((function(o){o.preventDefault();let a=t(this),n=t(this).parents(".modula-item").find("img.pic"),s=(a.data("modula-image-src"),e.location.href),r=a.data("modula-item-id"),d=a.data("modula-gallery-id");var l=n.data("caption"),h=n.attr("title"),m=i.title;const u=new URL(s),c=new URLSearchParams(u.search);if(void 0!==d&&c.set("modula_gallery_id",encodeURIComponent(d)),void 0!==r&&c.set("modula_image_id",encodeURIComponent(r)),"object"==typeof modulaMetaVars&&0!==Object.keys(modulaMetaVars).length)for(const[t,e]of Object.entries(modulaMetaVars)){let t=a.data(e);void 0!==t&&c.set(e,t)}i.dispatchEvent(new CustomEvent("modula_social_url_params",{detail:{url:u,params:c,meta:modulaMetaVars}}));const p=u.origin+u.pathname+"?"+decodeURIComponent(c.toString());return h.length>0&&l.length>0?m=t.trim(h)+" - "+t.trim(l):h.length>0?m=t.trim(h):l.length>0&&(m=t.trim(l)),e.open("https://twitter.com/intent/tweet?url="+encodeURIComponent(p)+"&text="+encodeURI(m),"ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1}))},d=function(o,a){o.find(".modula-icon-facebook").click((function(o){o.preventDefault();let a=t(this),n=(t(this).parents(".modula-item").find("img.pic"),a.data("modula-image-src"),e.location.href),s=a.data("modula-item-id"),r=a.data("modula-gallery-id");const d=new URL(n),l=new URLSearchParams(d.search);if(void 0!==r&&l.set("modula_gallery_id",encodeURIComponent(r)),void 0!==s&&l.set("modula_image_id",encodeURIComponent(s)),"object"==typeof modulaMetaVars&&0!==Object.keys(modulaMetaVars).length)for(const[t,e]of Object.entries(modulaMetaVars)){let t=a.data(e);void 0!==t&&l.set(e,t)}i.dispatchEvent(new CustomEvent("modula_social_url_params",{detail:{url:d,params:l,meta:modulaMetaVars}}));const h=d.origin+d.pathname+"?"+decodeURIComponent(l.toString());var m="//www.facebook.com/sharer.php?u="+encodeURIComponent(h);return e.open(m,"ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1}))},l=function(o,a){o.find(".modula-icon-whatsapp").click((function(o){o.preventDefault();let a=t(this),n=(t(this).parents(".modula-item").find("img.pic"),a.data("modula-image-src"),e.location.href),s=a.data("modula-item-id"),r=a.data("modula-gallery-id");const d=new URL(n),l=new URLSearchParams(d.search);if(void 0!==r&&l.set("modula_gallery_id",encodeURIComponent(r)),void 0!==s&&l.set("modula_image_id",encodeURIComponent(s)),"object"==typeof modulaMetaVars&&0!==Object.keys(modulaMetaVars).length)for(const[t,e]of Object.entries(modulaMetaVars)){let t=a.data(e);void 0!==t&&l.set(e,t)}i.dispatchEvent(new CustomEvent("modula_social_url_params",{detail:{url:d,params:l,meta:modulaMetaVars}}));const h=d.origin+d.pathname+"?"+decodeURIComponent(l.toString());return e.open("https://api.whatsapp.com/send?text="+encodeURIComponent(h)+"&preview_url=true","ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1}))},h=function(o,a){o.find(".modula-icon-pinterest").click((function(o){o.preventDefault();let a=t(this),n=t(this).parents(".modula-item").find("img.pic"),s=a.data("modula-image-src"),r=e.location.href,d=a.data("modula-item-id"),l=a.data("modula-gallery-id");var h=n.data("caption"),m=n.attr("title");const u=new URL(r),c=new URLSearchParams(u.search);if(void 0!==l&&c.set("modula_gallery_id",encodeURIComponent(l)),void 0!==d&&c.set("modula_image_id",encodeURIComponent(d)),"object"==typeof modulaMetaVars&&0!==Object.keys(modulaMetaVars).length)for(const[t,e]of Object.entries(modulaMetaVars)){let t=a.data(e);void 0!==t&&c.set(e,t)}i.dispatchEvent(new CustomEvent("modula_social_url_params",{detail:{url:u,params:c,meta:modulaMetaVars}}));const p=u.origin+u.pathname+"?"+decodeURIComponent(c.toString());var g=i.title;m.length>0?g=t.trim(m):h.length>0&&(g=t.trim(h));var f="http://pinterest.com/pin/create/button/?url="+encodeURIComponent(p)+"&description="+encodeURI(g);return void 0!==s&&s.length>0&&(f+="&media="+function(t){var e=i.createElement("img");return e.src=t,t=e.src,e.src=null,t}(s)),e.open(f,"ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1}))},m=function(o,a){o.find(".modula-icon-linkedin").click((function(o){o.preventDefault();let a=t(this),n=(t(this).parents(".modula-item").find("img.pic"),a.data("modula-image-src"),e.location.href),s=a.data("modula-item-id"),r=a.data("modula-gallery-id");const d=new URL(n),l=new URLSearchParams(d.search);if(void 0!==r&&l.set("modula_gallery_id",encodeURIComponent(r)),void 0!==s&&l.set("modula_image_id",encodeURIComponent(s)),"object"==typeof modulaMetaVars&&0!==Object.keys(modulaMetaVars).length)for(const[t,e]of Object.entries(modulaMetaVars)){let t=a.data(e);void 0!==t&&l.set(e,t)}i.dispatchEvent(new CustomEvent("modula_social_url_params",{detail:{url:d,params:l,meta:modulaMetaVars}}));const h=d.origin+d.pathname+"?"+decodeURIComponent(l.toString());var m="//linkedin.com/shareArticle?mini=true&url="+encodeURIComponent(h);return e.open(m,"ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1}))},u=function(o,a){o.find(".modula-icon-email").click((function(o){var n=a.options.email_subject;let s=t(this),r=(t(this).parents(".modula-item").find("img.pic"),s.data("modula-image-src")),d=e.location.href,l=s.data("modula-item-id"),h=s.data("modula-gallery-id");const m=new URL(d),u=new URLSearchParams(m.search);if(void 0!==h&&u.set("modula_gallery_id",encodeURIComponent(h)),void 0!==l&&u.set("modula_image_id",encodeURIComponent(l)),"object"==typeof modulaMetaVars&&0!==Object.keys(modulaMetaVars).length)for(const[t,e]of Object.entries(modulaMetaVars)){let t=s.data(e);void 0!==t&&u.set(e,t)}i.dispatchEvent(new CustomEvent("modula_social_url_params",{detail:{url:m,params:u,meta:modulaMetaVars}}));const c=m.origin+m.pathname+"?"+decodeURIComponent(u.toString());var p=a.options.email_message.replace("%%image_link%%",r).replace("%%gallery_link%%",c),g="mailto:?subject="+encodeURIComponent(n)+"&body="+encodeURIComponent(p);return e.open(g,"ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1}))},c=function(e){e.find(".jtg-social-mobile").click((function(e){e.preventDefault(),t(".jtg-social-mobile").not(this).removeClass("modula-show-socials"),t(this).toggleClass("modula-show-socials"),p(t(this).find(".jtg-social-mobile-icons"))&&t(this).addClass("modula-socials-right")}))},p=function(t){var o=t[0].getBoundingClientRect(),a=e.innerWidth||i.documentElement.clientWidth;return o.left<0||o.right>a};t.fn[a]=function(e){var i,n=arguments;return e===o||"object"==typeof e?this.each((function(){t.data(this,"plugin_"+a)||t.data(this,"plugin_"+a,new s(this,e))})):"string"==typeof e&&"_"!==e[0]&&"init"!==e?(this.each((function(){var o=t.data(this,"plugin_"+a);o instanceof s&&"function"==typeof o[e]&&(i=o[e].apply(o,Array.prototype.slice.call(n,1))),"destroy"===e&&t.data(this,"plugin_"+a,null)})),i!==o?i:this):void 0}}(jQuery,window,document),jQuery(document).ready((function(){var t=jQuery(".modula.modula-gallery");jQuery("body").hasClass("modula-best-grid-gallery")||jQuery("body").addClass("modula-best-grid-gallery"),jQuery.each(t,(function(){var t=jQuery(this).data("config");jQuery(this).modulaGallery(t)}))})),jQuery(document).on("elementor/popup/show",((t,e,i)=>{var o=jQuery("#elementor-popup-modal-"+e).find(".modula.modula-gallery");jQuery("body").hasClass("modula-best-grid-gallery")||jQuery("body").addClass("modula-best-grid-gallery"),jQuery.each(o,(function(){var t=jQuery(this).data("config");jQuery(this).modulaGallery(t)}))})); \ No newline at end of file +function modulaInViewport(t){"function"==typeof jQuery&&t instanceof jQuery&&(t=t[0]);var e=t.getBoundingClientRect();return e.top-jQuery(window).height()<=-100&&e.top-jQuery(window).height()>=-400||e.bottom<=jQuery(window).height()}jQuery(document).on("vc-full-width-row-single vc-full-width-row",(function(t,e){jQuery("body").find(".modula").length>0&&jQuery(window).trigger("modula-update")})),jQuery(window).on("elementor/frontend/init",(function(){window.elementorFrontend&&window.elementorFrontend.hooks.addAction("frontend/element_ready/global",(function(t){jQuery("body").find(".modula").length}))})),function(t,e,i,o){var a="modulaGallery",n={resizer:"/",keepArea:!0,type:"creative-gallery",columns:12,height:800,desktopHeight:800,mobileHeight:800,tabletHeight:800,gutter:10,desktopGutter:10,mobileGutter:10,tabletGutter:10,enableTwitter:!1,enableFacebook:!1,enableWhatsapp:!1,enablePinterest:!1,enableLinkedin:!1,enableEmail:!1,lazyLoad:0,initLightbox:!1,lightbox:"fancybox",lightboxOpts:{},inView:!1,originLeft:!0};function s(e,i){this.element=e,this.$element=t(e),this.$itemsCnt=this.$element.find(".modula-items"),this.$items=this.$itemsCnt.find(".modula-item"),this.options=t.extend({},n,i),this._defaults=n,this._name=a,this.tiles=[],this.$tilesCnt=null,this.completed=!1,this.lastWidth=0,this.resizeTO=0,this.isIsotope=!1,this.isLazyLoaded=!0,this.init()}s.prototype.init=function(){var o=this,a=i.documentElement.clientWidth;this.options.gutter=a<=568?this.options.mobileGutter:a<=768?this.options.tabletGutter:this.options.desktopGutter,t(i).trigger("modula_api_before_init",[o]),"custom-grid"===this.options.type?this.createCustomGallery():"creative-gallery"==this.options.type?this.createGrid():"grid"==this.options.type&&("automatic"==this.options.grid_type?this.createAutoGrid():this.createColumnsGrid()),"custom-grid"===this.options.type&&t(e).height(){o.onResize(o)})).observe(o.$element[0]),t(e).on("modula-update",(function(){o.onResize(o)})),t(i).on("lazyloaded",(function(e){var i,a,n=t(e.target);"modula"==n.data("source")&&(n.data("size",{width:n.width(),height:n.height()}),(i=n.parents(".modula-item")).addClass("tg-loaded"),a=o.$items.not(".jtg-hidden").index(i),o.placeImage(a),o.isIsotope&&void 0!==o.$itemsCnt.data("modulaisotope")&&o.$itemsCnt.modulaisotope("layout"),"grid"==o.options.type&&"automatic"==o.options.grid_type&&o.$itemsCnt.justifiedGallery())})),o.options.inView&&jQuery(e).on("DOMContentLoaded load resize scroll",(function(){modulaInViewport(o.$element)&&o.$element.addClass("modula-loaded-scale")})),this.setupSocial(),jQuery(o.$element).addClass("modula-gallery-initialized"),this.options.onComplete&&this.options.onComplete(),"fancybox"!=o.options.lightbox||o.options.initLightbox||this.initLightbox(),t(i).trigger("modula_api_after_init",[o])},s.prototype.initLightbox=function(){var e=this;e.$element.on("click",".modula-no-follow",(function(t){t.preventDefault()})),e.$element.on("click keypress",".modula-item-link:not( .modula-simple-link )",(function(i){if(13===i.which||"click"===i.type){i.preventDefault();var o=jQuery(this),a=t.map(e.$items,(function(t){if(jQuery(t).find(".modula-item-link:not( .modula-no-follow )").length>0){var e=jQuery(t).find(".modula-item-link:not( .modula-simple-link )"),i=jQuery(t).find(".pic");return{src:i.data("full"),opts:{$thumb:i.parents(".modula-item"),caption:e.data("caption"),alt:i.attr("alt"),image_id:e.attr("data-image-id"),title:i.attr("title")},current:jQuery(t).is(o.parents(".modula-item"))}}})),n=t.map(a,(function(t,e){if(t.current)return e}))[0];jQuery.modulaFancybox.open(a,e.options.lightboxOpts,n)}}))},s.prototype.trunc=function(t){return Math.trunc?Math.trunc(t):(t=+t,isFinite(t)?t-t%1||(t<0?-0:0===t?t:0):t)},s.prototype.createCustomGallery=function(){var e,o=this,a=this.$element.find(".modula-items").width(),n=this,s=this.options.columns,r=i.documentElement.clientWidth;"1"==this.options.enableResponsive&&(r<=568?s=this.options.mobileColumns:r<=768&&(s=this.options.tabletColumns)),e=this.options.gutter>0?(a-this.options.gutter*(s-1))/s:Math.floor(a/s*1e3)/1e3,this.$items.not(".jtg-hidden").each((function(i,a){var r,d,l,h,m={};r=t(a).data("width"),d=t(a).data("height"),r>12&&(r=12),"1"==n.options.enableResponsive&&(l=r,h=d,1==s?d=(r=1)*h/l:((r=Math.round(s*l/12))<1&&(r=1),(d=Math.round(r*h/l))<1&&(d=1))),m.width=e*r+n.options.gutter*(r-1),m.height=Math.round(e)*d+n.options.gutter*(d-1),t(a).data("size",m).addClass("tiled").addClass(m.width>m.height?"tile-h":"tile-v").data("position"),t(a).css(t(a).data("size")),t(a).find(".figc").css({width:t(a).data("size").width,height:t(a).data("size").height}),o.loadImage(i)}));var d={itemSelector:".modula-item",layoutMode:"packery",originLeft:n.options.originLeft,packery:{gutter:parseInt(n.options.gutter)}};this.$itemsCnt.modulaisotope(d),this.isIsotope=!0},s.prototype.createGrid=function(){var e=this,o=i.documentElement.clientWidth;e.options.height=o<=568?e.options.mobileHeight:o<=768?e.options.tabletHeight:e.options.desktopHeight,this.$itemsCnt.data("area",this.$itemsCnt.width()*this.options.height),this.lastWidth=this.$itemsCnt.width();for(var a=0;aa.height?"tile-h":"tile-v").data("position"),t(o).css({width:a.width,height:a.height}),t(o).find(".figc").css({width:a.width,height:a.height}),e.loadImage(i)})),!this.isIsotope){var n={resizesContainer:!1,itemSelector:".modula-item",layoutMode:"packery",originLeft:e.options.originLeft,packery:{gutter:parseInt(e.options.gutter)}};this.$itemsCnt.modulaisotope(n),this.isIsotope=!0}},s.prototype.createAutoGrid=function(){this.$itemsCnt.justifiedGallery({rowHeight:this.options.rowHeight,margins:this.options.gutter,lastRow:this.options.lastRow,captions:!1,border:0,imgSelector:"img.pic",cssAnimation:!0,imagesAnimationDuration:700})},s.prototype.createColumnsGrid=function(){var t=this;this.$itemsCnt.modulaisotope({itemSelector:".modula-item",layoutMode:"packery",originLeft:this.options.originLeft,packery:{gutter:parseInt(this.options.gutter)}}),this.$items.each((function(e,i){t.loadImage(e)})),this.isIsotope=!0},s.prototype.getSlot=function(){if(0==this.tiles.length)return i={top:0,left:0,width:this.$itemsCnt.width(),height:this.options.height,area:this.$itemsCnt.width()*this.options.height,position:0};for(var t=0,e=0;ethis.tiles[t].area&&(t=e)}var i={},o=this.tiles[t];if(o.width>o.height){var a=o.width/2*this.options.randomFactor;o.prevWidth=o.width,o.width=Math.floor(o.width/2+a*(Math.random()-.5)),i={top:o.top,left:o.left+o.width+this.options.gutter,width:o.prevWidth-o.width-this.options.gutter,height:o.height}}else{a=o.height/2*this.options.randomFactor;o.prevHeight=o.height,o.height=Math.floor(o.height/2+a*(Math.random()-.5)),i={left:o.left,top:o.top+o.height+this.options.gutter,width:o.width,height:o.prevHeight-o.height-this.options.gutter}}return i.area=i.width*i.height,i.position=1e3*i.top+i.left,o.position=1e3*o.top+o.left,this.tiles[t]=o,this.tiles[t].area=o.width*o.height,i},s.prototype.reset=function(){var e=this;e.tiles=[],"custom-grid"===this.options.type?this.createCustomGallery():"creative-gallery"==this.options.type?this.createGrid():"grid"==this.options.type&&("automatic"==this.options.grid_type?this.createAutoGrid():this.createColumnsGrid()),e.lastWidth=e.$itemsCnt.width(),t(i).trigger("modula_api_reset",[e])},s.prototype.onResize=function(t){if(t.lastWidth!=t.$itemsCnt.width()){var e=i.documentElement.clientWidth;t.options.gutter=e<=568?t.options.mobileGutter:e<=768?t.options.tabletGutter:this.options.desktopGutter,clearTimeout(t.resizeTO),t.resizeTO=setTimeout((function(){if(t.options.keepArea){var e=t.$itemsCnt.data("area");t.$itemsCnt.height(e/t.$itemsCnt.width())}t.reset(),t.isIsotope&&t.$itemsCnt.modulaisotope({packery:{originLeft:t.options.originLeft,gutter:parseInt(t.options.gutter)}}).modulaisotope("layout")}),100)}},s.prototype.loadImage=function(t){var e=this,i=e.$items.not(".jtg-hidden").eq(t).find(".pic"),o={};if("0"==e.options.lazyLoad){var a=new Image;a.onload=function(){o={width:this.width,height:this.height},i.data("size",o),e.placeImage(t)},"undefined"!=i.attr("src")?a.src=i.attr("src"):a.src=i.data("src")}else e.placeImage(t)},s.prototype.placeImage=function(t){if("grid"!=this.options.type){var e=this.$items.not(".jtg-hidden").eq(t),i=e.find(".pic"),o=e.data("size"),a=i.data("size");if(void 0!==o&&void 0!==a){o.width,o.height;var n=a.width/a.height,s=i.data("valign")?i.data("valign"):"middle",r=i.data("halign")?i.data("halign"):"center",d={top:"auto",bottom:"auto",left:"auto",right:"auto",width:"auto",height:"auto",margin:"0",maxWidth:"999em"};if(o.width*a.height/a.width>o.height)switch(d.width=o.width,d.left=0,s){case"top":d.top=0;break;case"middle":d.top=0-(o.width*(1/n)-o.height)/2;break;case"bottom":d.bottom=0}else switch(d.height=o.height,d.top=0,r){case"left":d.left=0;break;case"center":d.left=0-(o.height*n-o.width)/2;break;case"right":d.right=0}e.hasClass("effect-under")&&(d.top=d.top-e.find(".modula-item-content").height()),i.css(d),this.$items.not(".jtg-hidden").eq(t).addClass("tg-loaded")}}},s.prototype.setupSocial=function(){(this.options.enableTwitter||this.options.enableFacebook||this.options.enablePinterest||this.options.enableLinkedin||this.options.enableWhatsapp||this.options.enableEmail)&&c(this.$items),this.options.enableTwitter&&r(this.$items,this),this.options.enableFacebook&&d(this.$items,this),this.options.enablePinterest&&h(this.$items,this),this.options.enableLinkedin&&m(this.$items,this),this.options.enableWhatsapp&&l(this.$items,this),this.options.enableEmail&&u(this.$items,this)},s.prototype.destroy=function(){this.isPackeryActive&&(this.$itemsCnt.packery("destroy"),this.isPackeryActive=!1)};var r=function(o,a){o.find(".modula-icon-twitter").click((function(o){o.preventDefault();let a=t(this),n=t(this).parents(".modula-item").find("img.pic"),s=(a.data("modula-image-src"),e.location.href),r=a.data("modula-item-id"),d=a.data("modula-gallery-id");var l=n.data("caption"),h=n.attr("title"),m=i.title;const u=new URL(s),c=new URLSearchParams(u.search);if(void 0!==d&&c.set("modula_gallery_id",encodeURIComponent(d)),void 0!==r&&c.set("modula_image_id",encodeURIComponent(r)),"object"==typeof modulaMetaVars&&0!==Object.keys(modulaMetaVars).length)for(const[t,e]of Object.entries(modulaMetaVars)){let t=a.data(e);void 0!==t&&c.set(e,t)}i.dispatchEvent(new CustomEvent("modula_social_url_params",{detail:{url:u,params:c,meta:modulaMetaVars}}));const p=u.origin+u.pathname+"?"+decodeURIComponent(c.toString());return h.length>0&&l.length>0?m=t.trim(h)+" - "+t.trim(l):h.length>0?m=t.trim(h):l.length>0&&(m=t.trim(l)),e.open("https://twitter.com/intent/tweet?url="+encodeURIComponent(p)+"&text="+encodeURI(m),"ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1}))},d=function(o,a){o.find(".modula-icon-facebook").click((function(o){o.preventDefault();let a=t(this),n=(t(this).parents(".modula-item").find("img.pic"),a.data("modula-image-src"),e.location.href),s=a.data("modula-item-id"),r=a.data("modula-gallery-id");const d=new URL(n),l=new URLSearchParams(d.search);if(void 0!==r&&l.set("modula_gallery_id",encodeURIComponent(r)),void 0!==s&&l.set("modula_image_id",encodeURIComponent(s)),"object"==typeof modulaMetaVars&&0!==Object.keys(modulaMetaVars).length)for(const[t,e]of Object.entries(modulaMetaVars)){let t=a.data(e);void 0!==t&&l.set(e,t)}i.dispatchEvent(new CustomEvent("modula_social_url_params",{detail:{url:d,params:l,meta:modulaMetaVars}}));const h=d.origin+d.pathname+"?"+decodeURIComponent(l.toString());var m="//www.facebook.com/sharer.php?u="+encodeURIComponent(h);return e.open(m,"ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1}))},l=function(o,a){o.find(".modula-icon-whatsapp").click((function(o){o.preventDefault();let a=t(this),n=(t(this).parents(".modula-item").find("img.pic"),a.data("modula-image-src"),e.location.href),s=a.data("modula-item-id"),r=a.data("modula-gallery-id");const d=new URL(n),l=new URLSearchParams(d.search);if(void 0!==r&&l.set("modula_gallery_id",encodeURIComponent(r)),void 0!==s&&l.set("modula_image_id",encodeURIComponent(s)),"object"==typeof modulaMetaVars&&0!==Object.keys(modulaMetaVars).length)for(const[t,e]of Object.entries(modulaMetaVars)){let t=a.data(e);void 0!==t&&l.set(e,t)}i.dispatchEvent(new CustomEvent("modula_social_url_params",{detail:{url:d,params:l,meta:modulaMetaVars}}));const h=d.origin+d.pathname+"?"+decodeURIComponent(l.toString());return e.open("https://api.whatsapp.com/send?text="+encodeURIComponent(h)+"&preview_url=true","ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1}))},h=function(o,a){o.find(".modula-icon-pinterest").click((function(o){o.preventDefault();let a=t(this),n=t(this).parents(".modula-item").find("img.pic"),s=a.data("modula-image-src"),r=e.location.href,d=a.data("modula-item-id"),l=a.data("modula-gallery-id");var h=n.data("caption"),m=n.attr("title");const u=new URL(r),c=new URLSearchParams(u.search);if(void 0!==l&&c.set("modula_gallery_id",encodeURIComponent(l)),void 0!==d&&c.set("modula_image_id",encodeURIComponent(d)),"object"==typeof modulaMetaVars&&0!==Object.keys(modulaMetaVars).length)for(const[t,e]of Object.entries(modulaMetaVars)){let t=a.data(e);void 0!==t&&c.set(e,t)}i.dispatchEvent(new CustomEvent("modula_social_url_params",{detail:{url:u,params:c,meta:modulaMetaVars}}));const p=u.origin+u.pathname+"?"+decodeURIComponent(c.toString());var g=i.title;m.length>0?g=t.trim(m):h.length>0&&(g=t.trim(h));var f="http://pinterest.com/pin/create/button/?url="+encodeURIComponent(p)+"&description="+encodeURI(g);return void 0!==s&&s.length>0&&(f+="&media="+function(t){var e=i.createElement("img");return e.src=t,t=e.src,e.src=null,t}(s)),e.open(f,"ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1}))},m=function(o,a){o.find(".modula-icon-linkedin").click((function(o){o.preventDefault();let a=t(this),n=(t(this).parents(".modula-item").find("img.pic"),a.data("modula-image-src"),e.location.href),s=a.data("modula-item-id"),r=a.data("modula-gallery-id");const d=new URL(n),l=new URLSearchParams(d.search);if(void 0!==r&&l.set("modula_gallery_id",encodeURIComponent(r)),void 0!==s&&l.set("modula_image_id",encodeURIComponent(s)),"object"==typeof modulaMetaVars&&0!==Object.keys(modulaMetaVars).length)for(const[t,e]of Object.entries(modulaMetaVars)){let t=a.data(e);void 0!==t&&l.set(e,t)}i.dispatchEvent(new CustomEvent("modula_social_url_params",{detail:{url:d,params:l,meta:modulaMetaVars}}));const h=d.origin+d.pathname+"?"+decodeURIComponent(l.toString());var m="//linkedin.com/shareArticle?mini=true&url="+encodeURIComponent(h);return e.open(m,"ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1}))},u=function(o,a){o.find(".modula-icon-email").click((function(o){var n=a.options.email_subject;let s=t(this),r=(t(this).parents(".modula-item").find("img.pic"),s.data("modula-image-src")),d=e.location.href,l=s.data("modula-item-id"),h=s.data("modula-gallery-id");const m=new URL(d),u=new URLSearchParams(m.search);if(void 0!==h&&u.set("modula_gallery_id",encodeURIComponent(h)),void 0!==l&&u.set("modula_image_id",encodeURIComponent(l)),"object"==typeof modulaMetaVars&&0!==Object.keys(modulaMetaVars).length)for(const[t,e]of Object.entries(modulaMetaVars)){let t=s.data(e);void 0!==t&&u.set(e,t)}i.dispatchEvent(new CustomEvent("modula_social_url_params",{detail:{url:m,params:u,meta:modulaMetaVars}}));const c=m.origin+m.pathname+"?"+decodeURIComponent(u.toString());var p=a.options.email_message.replace("%%image_link%%",r).replace("%%gallery_link%%",c),g="mailto:?subject="+encodeURIComponent(n)+"&body="+encodeURIComponent(p);return e.open(g,"ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1}))},c=function(e){e.find(".jtg-social-mobile").click((function(e){e.preventDefault(),t(".jtg-social-mobile").not(this).removeClass("modula-show-socials"),t(this).toggleClass("modula-show-socials"),p(t(this).find(".jtg-social-mobile-icons"))&&t(this).addClass("modula-socials-right")}))},p=function(t){var o=t[0].getBoundingClientRect(),a=e.innerWidth||i.documentElement.clientWidth;return o.left<0||o.right>a};t.fn[a]=function(e){var i,n=arguments;return e===o||"object"==typeof e?this.each((function(){t.data(this,"plugin_"+a)||t.data(this,"plugin_"+a,new s(this,e))})):"string"==typeof e&&"_"!==e[0]&&"init"!==e?(this.each((function(){var o=t.data(this,"plugin_"+a);o instanceof s&&"function"==typeof o[e]&&(i=o[e].apply(o,Array.prototype.slice.call(n,1))),"destroy"===e&&t.data(this,"plugin_"+a,null)})),i!==o?i:this):void 0}}(jQuery,window,document),jQuery(document).ready((function(){var t=jQuery(".modula.modula-gallery");jQuery("body").hasClass("modula-best-grid-gallery")||jQuery("body").addClass("modula-best-grid-gallery"),jQuery.each(t,(function(){var t=jQuery(this).data("config");jQuery(this).modulaGallery(t)}))})),jQuery(document).on("elementor/popup/show",((t,e,i)=>{var o=jQuery("#elementor-popup-modal-"+e).find(".modula.modula-gallery");jQuery("body").hasClass("modula-best-grid-gallery")||jQuery("body").addClass("modula-best-grid-gallery"),jQuery.each(o,(function(){var t=jQuery(this).data("config");jQuery(this).modulaGallery(t)}))})); \ No newline at end of file diff --git a/changelog.txt b/changelog.txt index 2b167b91..ace13877 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,6 @@ -= 2.9.1 - 13.08.2024 = -Fixed: PHP warning: undefined key. += 2.9.1 - TBD = +Fixed: PHP warning: undefined key. ( [#1018]( https://github.com/WPChill/modula-lite/issues/1018) ) +Added: RTL elements orientation option added to isotope script. ( [#987]( https://github.com/WPChill/modula-lite/issues/987) ) = 2.9.0 - 12.08.2024 = Added: bnb like gallery layout upsell setting. diff --git a/readme.txt b/readme.txt index a1850741..a9290149 100644 --- a/readme.txt +++ b/readme.txt @@ -154,8 +154,9 @@ Free support is included only with a PRO license: [Buy Modula PRO](https://wp-mo 4. Responsive galleries created with Modula == Changelog == -= 2.9.1 - 13.08.2024 = -Fixed: PHP warning: undefined key. ( [#1018]( https://github.com/WPChill/modula-lite/issues/1018) ) += 2.9.1 - TBD = +Fixed: PHP warning: undefined key. ( [#1018]( https://github.com/WPChill/modula-lite/issues/1018) ) +Added: RTL elements orientation option added to isotope script. ( [#987]( https://github.com/WPChill/modula-lite/issues/987) ) = 2.9.0 - 12.08.2024 = Added: bnb like gallery layout upsell setting. ( [#1002]( https://github.com/WPChill/modula-lite/issues/1002) ) From 812c85e55567fc204c0beca68f8c533b9bda1dfe Mon Sep 17 00:00:00 2001 From: TeoAlex Date: Wed, 14 Aug 2024 15:37:49 +0300 Subject: [PATCH 3/3] vbump 2.9.1 --- Modula.php | 4 ++-- changelog.txt | 2 +- package.json | 2 +- readme.txt | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Modula.php b/Modula.php index d8023f1e..d3f6fda3 100644 --- a/Modula.php +++ b/Modula.php @@ -4,7 +4,7 @@ * Plugin URI: https://wp-modula.com/ * Description: Modula is the most powerful, user-friendly WordPress gallery plugin. Add galleries, masonry grids and more in a few clicks. * Author: WPChill -* Version: 2.9.0 +* Version: 2.9.1 * Author URI: https://www.wpchill.com/ * License: GPLv3 or later * License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -47,7 +47,7 @@ * @since 2.0.2 */ -define( 'MODULA_LITE_VERSION', '2.9.0' ); +define( 'MODULA_LITE_VERSION', '2.9.1' ); define( 'MODULA_PATH', plugin_dir_path( __FILE__ ) ); define( 'MODULA_URL', plugin_dir_url( __FILE__ ) ); defined( 'MODULA_PRO_STORE_URL' ) || define( 'MODULA_PRO_STORE_URL', 'https://wp-modula.com' ); diff --git a/changelog.txt b/changelog.txt index ace13877..918811e3 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,4 @@ -= 2.9.1 - TBD = += 2.9.1 - 14.08.2024 = Fixed: PHP warning: undefined key. ( [#1018]( https://github.com/WPChill/modula-lite/issues/1018) ) Added: RTL elements orientation option added to isotope script. ( [#987]( https://github.com/WPChill/modula-lite/issues/987) ) diff --git a/package.json b/package.json index 94569d5f..2913cfcf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "modula-best-grid-gallery", - "version": "2.9.0", + "version": "2.9.1", "description": "Modula Image Gallery build tools", "author": "WPChill", "license": "GPL-2.0-or-later", diff --git a/readme.txt b/readme.txt index a9290149..06610b59 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: best gallery plugin, image gallery, video gallery, free gallery, wordpress Requires at least: 5.3 Tested up to: 6.6 Requires PHP: 5.6 -Stable tag: 2.9.0 +Stable tag: 2.9.1 License: GNU General Public License v3.0 or later The WordPress gallery plugin that's highly customizable & you can use to impress your clients. Create beautiful image galleries in minutes. @@ -154,7 +154,7 @@ Free support is included only with a PRO license: [Buy Modula PRO](https://wp-mo 4. Responsive galleries created with Modula == Changelog == -= 2.9.1 - TBD = += 2.9.1 - 14.08.2024 = Fixed: PHP warning: undefined key. ( [#1018]( https://github.com/WPChill/modula-lite/issues/1018) ) Added: RTL elements orientation option added to isotope script. ( [#987]( https://github.com/WPChill/modula-lite/issues/987) )