Gallery – Photo Gallery – Image Gallery - Version 2.2.7

Version Description

Download this release

Release Info

Developer giucu91
Plugin Icon wp plugin Gallery – Photo Gallery – Image Gallery
Version 2.2.7
Comparing to
See all releases

Code changes from version 2.2.6 to 2.2.7

Modula.php CHANGED
@@ -4,7 +4,7 @@
4
* Plugin URI: https://wp-modula.com/
5
* Description: Modula is the most powerful, user-friendly WordPress gallery plugin. Add galleries, masonry grids and more in a few clicks.
6
* Author: MachoThemes
7
- * Version: 2.2.6
8
* Author URI: https://www.machothemes.com/
9
* License: GPLv3 or later
10
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -43,7 +43,7 @@
43
*
44
* @since 2.0.2
45
*/
46
- define( 'MODULA_LITE_VERSION' , '2.2.6' );
47
define( 'MODULA_PATH' , plugin_dir_path( __FILE__ ) );
48
define( 'MODULA_URL' , plugin_dir_url( __FILE__ ) );
49
defined( 'MODULA_PRO_STORE_URL' ) || define( 'MODULA_PRO_STORE_URL' , 'https://wp-modula.com' );
4
* Plugin URI: https://wp-modula.com/
5
* Description: Modula is the most powerful, user-friendly WordPress gallery plugin. Add galleries, masonry grids and more in a few clicks.
6
* Author: MachoThemes
7
+ * Version: 2.2.7
8
* Author URI: https://www.machothemes.com/
9
* License: GPLv3 or later
10
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
43
*
44
* @since 2.0.2
45
*/
46
+ define( 'MODULA_LITE_VERSION' , '2.2.7' );
47
define( 'MODULA_PATH' , plugin_dir_path( __FILE__ ) );
48
define( 'MODULA_URL' , plugin_dir_url( __FILE__ ) );
49
defined( 'MODULA_PRO_STORE_URL' ) || define( 'MODULA_PRO_STORE_URL' , 'https://wp-modula.com' );
README.txt CHANGED
@@ -4,7 +4,7 @@ Tags: best gallery plugin, image gallery, photo gallery, responsive gallery, wor
4
Requires at least: 4.6
5
Tested up to: 5.3
6
Requires PHP: 5.6
7
- Stable tag: 2.2.6
8
License: GPLv3 or later
9
License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
4
Requires at least: 4.6
5
Tested up to: 5.3
6
Requires PHP: 5.6
7
+ Stable tag: 2.2.7
8
License: GPLv3 or later
9
License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
assets/css/modula-cpt.css CHANGED
@@ -17,7 +17,7 @@
17
color: #9c9c9c;
18
cursor: pointer;
19
position: relative;
20
- width: 165px;
21
position: relative;
22
}
23
.modula-settings-container .modula-tabs .modula-tab sup {
@@ -71,10 +71,10 @@
71
.modula-settings-container .modula-tabs .modula-tab.active-tab:before {
72
content: "";
73
position: absolute;
74
- left: 0;
75
- top: 0;
76
width: 3px;
77
- height: 100%;
78
background-color: #57a7c9;
79
}
80
.modula-settings-container .modula-tabs .modula-tab.active-tab:after {
@@ -1321,3 +1321,11 @@ Ups-sells carousel
1321
#modula-albums-upsell h2 {
1322
margin: 0 !important;
1323
}
17
color: #9c9c9c;
18
cursor: pointer;
19
position: relative;
20
+ width: 190px;
21
position: relative;
22
}
23
.modula-settings-container .modula-tabs .modula-tab sup {
71
.modula-settings-container .modula-tabs .modula-tab.active-tab:before {
72
content: "";
73
position: absolute;
74
+ left: -2px;
75
+ top: -1px;
76
width: 3px;
77
+ height: calc( 100% + 2px);
78
background-color: #57a7c9;
79
}
80
.modula-settings-container .modula-tabs .modula-tab.active-tab:after {
1321
#modula-albums-upsell h2 {
1322
margin: 0 !important;
1323
}
1324
+
1325
+ .modula-settings-container input[type="number"] {
1326
+ max-width: 80px;
1327
+ }
1328
+
1329
+ .modula-after-input {
1330
+ margin-left: 5px;
1331
+ }
assets/css/modula-cpt.min.css CHANGED
@@ -1 +1 @@
1
- #modula-settings .inside{padding:0;margin:0}.modula-settings-container{display:flex}.modula-settings-container .modula-tabs{background-color:#f8f8f8}.modula-settings-container .modula-tabs .modula-tab{margin:0 10px 0 0;padding:15px 0;color:#9c9c9c;cursor:pointer;position:relative;width:165px;position:relative}.modula-settings-container .modula-tabs .modula-tab sup{margin-left:5px;padding:2px 5px;border-radius:5px;color:#fff;font-size:8px;background:#9c9c9c;display:inline-block;line-height:1;position:relative;top:-2px}.modula-settings-container .modula-tabs .modula-tab.active-tab sup,.modula-settings-container .modula-tabs .modula-tab:hover sup{background-color:#57a7c9}.modula-settings-container .modula-tabs .modula-tab.modula-responsive.active-tab sup,.modula-settings-container .modula-tabs .modula-tab.modula-responsive:hover sup{background:#dc3232}.modula-settings-container .modula-tabs .modula-tab>i{margin-right:10px;margin-left:15px}.modula-settings-container .modula-tabs .modula-tab:after{position:absolute;content:"";width:1px;height:100%;background-color:transparent;top:0;right:-1px}.modula-settings-container .modula-tabs .modula-tab.active-tab:first-child{border-top:0 none}.modula-settings-container .modula-tabs .modula-tab:hover{color:#333}.modula-settings-container .modula-tabs .modula-tab.active-tab{margin:0;padding:15px 10px 15px 0;background-color:#fff;border-bottom:1px solid #ddd;border-top:1px solid #ddd;color:#333}.modula-settings-container .modula-tabs .modula-tab.active-tab:before{content:"";position:absolute;left:0;top:0;width:3px;height:100%;background-color:#57a7c9}.modula-settings-container .modula-tabs .modula-tab.active-tab:after{background-color:#fff}tr label.th-label{color:#23282d;font-weight:600;margin-bottom:10px}.postbox .modula-settings-container table.form-table{margin:0}.postbox .modula-settings-container .form-table-wrapper{padding:0 0 0 20px;box-sizing:border-box}.modula-settings-container .modula-tabs-content{padding:10px 20px;border-left:1px solid #eee;flex-grow:1}.modula-tabs-content>div:not(.active-tab){display:none}.modula-settings-container .modula-tabs-content .tab-content-header{width:100%;padding-bottom:12px;margin-bottom:10px;border-bottom:1px solid #eee;padding-left:20px;padding-right:0;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between}.modula-settings-container .modula-tabs-content .tab-content-header .tab-content-header-actions{display:flex;align-items:center}.modula-settings-container .modula-tabs-content .tab-content-header .tab-content-header-actions>span{margin:0 10px;font-style:italic}.modula-settings-container .modula-tabs-content .tab-content-header .tab-content-header-actions a.button>span{height:auto;line-height:26px;margin-right:10px}#poststuff .modula-settings-container .modula-tabs-content .tab-content-header .tab-content-header-title>h2{font-weight:700;padding:0;display:inline-block}#poststuff .modula-settings-container .modula-tabs-content .tab-content-header .tab-header-description p{margin:0}.modula-settings-container .form-table td p.description{font-size:13px}.modula-settings-container .slider-container{position:relative;height:2px;padding:10px 0;width:25em;box-sizing:border-box;margin-bottom:10px;display:flex;display:flex;justify-content:space-between;align-items:center}.modula-settings-container .slider-container input[type=text]{border:none;text-align:center;padding:2px;margin:0 20px 0 0;font-size:12px;color:#333;border-radius:10px;background-color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.16);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.16);box-shadow:inset 0 1px 1px rgba(0,0,0,.16);width:40px;height:22px;cursor:default}.modula-settings-container .slider-container .ui-slider{position:relative;text-align:left;height:2px;border-radius:3px;border:none;display:block;width:100%;background:#d6d6d6;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.modula-settings-container .slider-container .ui-slider .ui-slider-handle{position:absolute;z-index:2;top:-10px;cursor:default;-ms-touch-action:none;touch-action:none;width:18px;height:18px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px;background-color:#fff;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.1);-moz-box-shadow:0 1px 1px rgba(0,0,0,.1);box-shadow:0 1px 1px rgba(0,0,0,.1);border:solid 1px #d7d7d7;transform:translateX(-50%)}.modula-settings-container .slider-container .ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0;background:#57a7c9;top:0;bottom:0}.modula-effects-preview{margin-top:20px}.modula-effects-preview .modula-item{width:400px;height:300px;overflow:hidden;position:relative}.modula-effects-preview .modula-item img{position:absolute;min-height:100%;min-width:100%}.modula-effects-preview .modula-item .figc{display:flex;align-items:center;justify-content:center;color:#fff;font-size:11px;text-align:center;position:absolute;left:0;width:100%;height:100%;padding:0}.modula-effects-preview .modula-item .figc h2{font-size:21px!important;color:#fff}.modula-effects-preview .modula-item .figc p{color:#fff;font-size:15px;font-style:normal}.modula .modula-items .modula-item h2{margin:0}.modula .modula-items .modula-item p{margin:0;padding:0}.modula .figc{color:#000;text-align:center;position:absolute;left:0;width:100%;padding:2em}.modula .modula-item .jtg-social a{text-decoration:none;color:#fff;display:inline-block;margin:0 10px 0 0;width:20px;padding:6px 4px;border:0;opacity:0;transition:opacity .3s}.modula .modula-item .jtg-social svg{width:20px;height:16px}.modula .modula-item:hover .jtg-social a{opacity:1}.modula .modula-items .jtg-social{opacity:0;transition:opacity .1s;right:30px;position:absolute;bottom:20px;text-align:right;transition:all .3s}.modula .modula-items .jtg-social{opacity:1}.modula .modula-items .jtg-social a:last-of-type{margin-right:0}.modula .modula-item.effect-pufrobo p.description{margin-bottom:2em}.modula .modula-item.effect-pufrobo .figc{text-align:right}.modula .modula-item.effect-pufrobo h2,.modula .modula-item.effect-pufrobo p{position:absolute;right:30px;left:30px;padding:10px 0}.modula .modula-item:hover img{opacity:.8}.modula .modula-item{background-color:#000}.modula .modula-item.effect-pufrobo p{bottom:20%;line-height:1.5;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0);letter-spacing:1px}.modula .modula-item.effect-pufrobo h2{top:10%;-webkit-transition:-webkit-transform .35s;transition:transform .35s;-webkit-transform:translate3d(0,20px,0);transform:translate3d(0,20px,0)}.modula .modula-item.effect-pufrobo:hover h2{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.modula .modula-item.effect-pufrobo h2::after{position:absolute;top:80%;left:0;width:100%;height:4px;background:#fff;content:'';-webkit-transform:translate3d(0,40px,0);transform:translate3d(0,40px,0)}.modula .modula-item.effect-pufrobo h2::after,.modula .modula-item.effect-pufrobo p{opacity:0;-webkit-transition:opacity .35s,-webkit-transform .35s;transition:opacity .35s,transform .35s}.modula .modula-item.effect-pufrobo:hover h2::after,.modula .modula-item.effect-pufrobo:hover p{margin-top:10px;margin-bottom:5px;opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.modula-upsell{background:#f1f1f1;border:0;padding:15px;margin-top:30px}.form-table-wrapper .modula-upsell{border:1px solid #ddd;text-align:center}#poststuff .modula-upsell h2{margin:0 0 20px 0;font-size:16px;font-weight:700;background:#fff;left:-15px;top:-15px;padding:8px 12px;position:relative;width:calc(100% + 6px);border-bottom:1px solid #ddd}.modula-upsell p{margin:0}.modula-upsell p.modula-upsell-description{font-size:13px;line-height:1.5;color:#333;opacity:.8;margin-top:0;margin-bottom:10px;padding:0 10px}.modula-upsell .button{height:31px;line-height:31px;font-weight:700}.modula-upsell .button:first-child{margin-right:10px}.modula-upsell .action-link,.modula-upsell .action-link:hover{background:#51ad31;border-color:#51ad31;color:#fff;font-weight:700}#modula-uploader-container{position:relative;padding-left:10px;padding-right:10px}#modula-uploader-container.modula-resizer-enabled{margin-bottom:20px}.modula-upload-actions{padding:15px 20px;background-color:#f8fcfd;border-bottom:1px solid #ecf6f9;margin-bottom:20px;display:flex;align-items:center;justify-content:space-between;width:100%;box-sizing:border-box}.modula-upload-actions .buttons{flex-shrink:0;width:275px;display:flex}.modula-sources-dropdown{position:relative;border-top:1px solid rgba(255,255,255,0);border-right:1px solid rgba(255,255,255,0);border-left:1px solid rgba(255,255,255,0)}.modula-sources-dropdown:hover{border-color:#ddd;background:#f5f5f5}.modula-sources-dropdown>span{width:28px;height:32px;text-align:center;line-height:28px;cursor:pointer;display:inline-block;font-size:25px;font-weight:700}.modula-sources-dropdown .modula-sources-dropdown-content{position:absolute;right:-1px;bottom:0;transform:translateY(100%);display:none;padding:15px;background-color:#f5f5f5;box-shadow:0 1px 1px rgba(0,0,0,.04);box-sizing:border-box;border:1px solid #ddd}.modula-sources-dropdown:hover .modula-sources-dropdown-content{display:block}.modula-sources-dropdown:hover .modula-sources-dropdown-content:before{content:"";height:1px;width:28px;background-color:#f5f5f5;position:absolute;top:-1px;right:0}.segrip.ui-resizable-se{width:30px;height:30px;background:url(../images/resize-se.svg) no-repeat;background-size:contain;display:none;z-index:100;opacity:1}.modula-resizer-enabled .segrip.ui-resizable-se{display:block}.modula-upload-actions #modula-uploader-browser{border-bottom-right-radius:0;border-top-right-radius:0}.modula-upload-actions #modula-wp-gallery{border-bottom-left-radius:0;border-top-left-radius:0}.wp-core-ui .modula-upload-actions>a{margin:0 5px}#modula-dropzone-container{position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(0,86,132,.9);z-index:250000;display:none;text-align:center;opacity:0;transition:opacity 250ms}#modula-dropzone-container .modula-uploader-window-content{position:absolute;top:10px;left:10px;right:10px;bottom:10px;border:1px dashed #fff}#poststuff #modula-dropzone-container .modula-uploader-window-content h1{margin:-.5em 0 0;position:absolute;top:50%;left:0;right:0;-webkit-transform:translateY(-50%);transform:translateY(-50%);font-size:20px;line-height:28px;font-weight:400;color:#fff;padding:0}.modula-uploader-inline-content{position:relative;min-height:300px;width:100%}.modula-resizer-enabled .modula-uploader-inline-content{min-height:initial}.modula-uploader-inline-content h2{text-align:center;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}#poststuff .modula-upload-message{font-size:43px;line-height:1;font-weight:400;margin:0;display:none;color:#ebebeb}#poststuff .modula-upload-message .dashicons,#poststuff .modula-upload-message .dashicons-before:before{font-size:43px;width:43px;height:43px}.modula-uploader-inline p{font-size:12px;margin:.5em 0}#poststuff .modula-uploader-inline .modula-upload-instructions{font-size:14px;color:#444;font-weight:400;padding:0}.modula-uploader-footer .max-upload-size{float:left}.modula-uploader-footer .modula-upload-numbers{float:right;opacity:0}.modula-uploader-footer:after{display:block;content:"";clear:both}.upload-progress .modula-upload-numbers{margin:0;line-height:1.4em}.modula-progress-bar{width:100%;max-width:400px;position:relative;height:2px;margin:8px 0 0;border-radius:10px;background:#e5e5e5}.upload-info-container{position:relative;overflow:hidden;flex-grow:1}.upload-info-container .upload-info{padding:5px 0}.upload-info-container .upload-progress{position:absolute;background-color:#f8fcfd;height:100%;display:flex;top:0;left:0;width:100%;flex-direction:column;transition:transform .5s;transform:translateY(100%)}.modula-upload-actions.show-progress .upload-info-container .upload-progress{transform:translateY(0)}.modula-progress-bar .modula-progress-bar-inner{height:2px;min-width:20px;width:0;background:#0085ba;-webkit-transition:width .3s;-moz-transition:width .3s;-ms-transition:width .3s;-o-transition:width .3s;transition:width .3s;border-radius:5px}.modula-uploader-footer.show-progress .modula-progress-bar,.modula-uploader-footer.show-progress .modula-upload-numbers{opacity:1}.modula-uploader-inline-content .modula-single-image,.modula-uploader-inline-content .modula-single-image-placeholder{cursor:move;display:inline-block;padding:0 10px 20px 0;box-sizing:border-box;width:16.66%}.modula-uploader-inline-content .modula-single-image-placeholder:after{width:100%;height:100%;display:inline-block;content:"";position:relative;border:3px dashed #444;padding-top:calc(100% - 6px);box-sizing:border-box}.modula-uploader-inline-content .modula-single-image .modula-single-image-content{position:relative;border:1px solid #d6d6d6;box-sizing:border-box;background-position:center;background-size:cover}.modula-uploader-inline-content .modula-single-image .modula-single-image-content img{display:block;width:100%}#poststuff .modula-uploader-inline-content>.modula-upload-message:only-child{display:block}.modula-uploader-inline-content .modula-single-image .actions{position:absolute;z-index:99;font-size:0;width:100%;height:100%;top:0;left:0;background:rgba(0,0,0,.4);padding:5px;box-sizing:border-box;display:none}.modula-uploader-inline-content .modula-single-image:hover .actions{display:block}.modula-uploader-inline-content .modula-single-image .actions a{width:20px;height:20px;border-radius:100%;border:1px solid #000;background-color:rgba(255,255,255,.8);color:#000;display:block;text-decoration:none;text-align:center;line-height:20px;margin-bottom:5px}.modula-uploader-inline-content .modula-single-image .actions a:hover{background-color:#000;color:#fff}.modula-uploader-inline-content .modula-single-image .actions a span{font-size:16px;width:20px;height:20px;line-height:20px}.modula-uploader-inline-content .modula-single-image .actions a.modula-delete-image{color:#a00a00}.modula-uploader-inline-content .modula-single-image .actions a.modula-delete-image:hover{background-color:#a00a00;color:#fff}.modula-uploader-inline-content:after{content:"";display:block;clear:both}.media-modal .modula-edit-popup.edit-attachment-frame .edit-media-header button.right{border-right:1px solid #ddd}.media-modal .modula-edit-popup .attachment-details .attachment-info .settings .setting{margin:0 0 20px 0;padding:0 0 20px 0;border-bottom:1px solid #ddd}.media-modal .modula-edit-popup .attachment-details .attachment-info .settings .setting span.name{display:block;width:100%;min-width:100%;margin:0;padding:0;text-align:left;font-weight:700;font-size:14px}.media-modal .modula-edit-popup .attachment-details .attachment-info .settings .setting input[type=text],.media-modal .modula-edit-popup .attachment-details .attachment-info .settings .setting textarea{display:block;width:100%;min-width:100%;margin:0}.media-modal .modula-edit-popup .attachment-details .attachment-info .settings .setting div.description{clear:both;float:left;margin:5px 0 0 0;text-align:left;font-size:13px;font-style:italic;color:#666}.media-modal .modula-edit-popup .attachment-details .attachment-info .settings{margin:0;padding:0;border:none}.media-modal .attachment-info .actions a{display:inline-block}.inline-input{display:inline}.ui-draggable.ui-resizable>.segrip{width:10px;height:10px;background:red;position:absolute;bottom:0;right:0}.ui-draggable.ui-resizable .modula-single-image-content img{display:none}.ui-draggable.ui-resizable .modula-single-image-content{width:100%;height:100%}.ui-draggable.ui-resizable.modula-single-image{padding:0}.packery-drop-placeholder{outline:3px dashed #444;outline-offset:-6px;-webkit-transition:-webkit-transform .2s;transition:transform .2s}.ui-resizable-helper{border:3px dashed #444;box-sizing:border-box}#poststuff #modula-preview-gallery h2.hndle,#poststuff #modula-settings h2.hndle{padding-left:20px}#poststuff #modula-preview-gallery .inside{margin-top:0;padding:0}.modula-edit-popup .attachment-details .setting span.description>span{display:inline-block;float:none;width:auto;min-width:unset;line-height:16px;min-height:16px;margin-top:8px;padding:0;vertical-align:middle;margin-right:0}.modula-edit-popup .attachment-details .setting span.description{text-align:left;vertical-align:middle}.modula-media-modal .attachments-browser .media-toolbar .media-toolbar-secondary{width:100%}.modula-error-container{display:block}.modula-error-container.hide{display:none}.modula-error-container .modula-error{padding:12px;margin-bottom:12px;background:#fff;border-left:4px solid #dc3232;box-shadow:0 0 4px 0 rgba(0,0,0,.1);font-weight:600;margin-top:5px;position:relative;background-color:#dc3232;color:#fff}.modula-error-container .modula-error a{color:#fff}.modula-error-container .modula-error .upload-dismiss-errors{position:absolute;top:50%;right:-5px;padding:10px;transition:none;display:block;text-decoration:none;margin-top:-18px}.modula-error-container .modula-error .upload-dismiss-errors:before{content:"\f153";display:block;font:400 16px/1 dashicons;color:#fff}a.modula-tab-link{text-decoration:none}.modula-tab-link span.dashicons{width:16px;height:16px;line-height:16px;margin-right:3px;vertical-align:text-bottom;font-size:16px;text-decoration:none}#modula-grid{height:100%;position:absolute;overflow:hidden;top:0;left:0;width:100%}#modula-grid .modula-grid-item{background-color:#fafafa;float:left}#modula-grid .modula-grid-item:nth-child(12n){margin-right:0!important}#modula-grid:after{content:"";display:block;clear:both}.modula-tooltip{position:relative;display:inline-block}.modula-tooltip>span{cursor:pointer;color:#0073aa;text-decoration:underline;margin-left:5px}.modula-tooltip .modula-tooltip-content{display:none;position:absolute;top:50%;right:-10px;transform:translate(100% ,-50%);width:300px;background:#000;color:#fff;padding:10px;box-sizing:border-box;z-index:99}.modula-tooltip .modula-tooltip-content:before{content:'';width:0;height:0;border-style:solid;border-width:8px 8px 8px 0;border-color:transparent #000 transparent transparent;display:block;position:absolute;top:50%;left:-8px;transform:translateY(-50%)}.modula-tooltip:hover .modula-tooltip-content{display:block}.modula-helper-guidelines-container{padding:15px 20px;background-color:#f8fcfd;display:flex;align-items:center;border-top:1px solid #ecf6f9}.modula-helper-guidelines-container .onoffswitch{margin-top:0}.modula-helper-guidelines-wrapper .modula-helper-guidelines-label{margin-left:5px}.modula-creative-gallery.modula-uploader-inline-content .modula-single-image .modula-single-image-content{background:#eee!important;position:relative;overflow:hidden}.modula-creative-gallery.modula-uploader-inline-content .modula-single-image-content:before{content:"";display:block;padding-top:100%}.modula-creative-gallery.modula-uploader-inline-content .modula-single-image-content img{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.modula-creative-gallery.modula-uploader-inline-content .modula-single-image-content.landscape img{max-height:100%}.modula-creative-gallery.modula-uploader-inline-content .modula-single-image-content.portrait img{max-width:100%}.modula-toggle{position:relative;position:relative;user-select:none;display:inline-block}.modula-toggle__items{box-sizing:border-box;display:inline-block;position:relative}.modula-toggle__items>*{box-sizing:inherit}.modula-toggle__input[type=checkbox]{border-radius:2px;border:2px solid #6c7781;margin-right:12px;transition:none;height:100%;left:0;top:0;margin:0;padding:0;opacity:0;position:absolute;width:100%;z-index:1}.modula-toggle__track{background-color:#fff;border:2px solid #6c7781;border-radius:9px;display:inline-block;height:18px;width:36px;vertical-align:top;transition:background .2s ease}.modula-toggle__thumb{background-color:#6c7781;border:5px solid #6c7781;border-radius:50%;display:block;height:10px;width:10px;position:absolute;left:4px;top:4px;transition:transform .2s ease}.modula-toggle__off{position:absolute;right:6px;top:6px;color:#6c7781;fill:currentColor}.modula-toggle__on{position:absolute;top:6px;left:8px;border:1px solid #fff;outline:1px solid transparent;outline-offset:-1px;display:none}.modula-toggle__input[type=checkbox]:checked+.modula-toggle__items .modula-toggle__track{background-color:#11a0d2;border:9px solid transparent}.modula-toggle__input[type=checkbox]:checked+.modula-toggle__items .modula-toggle__thumb{background-color:#fff;border-width:0;transform:translateX(18px)}.modula-toggle__input[type=checkbox]:checked+.modula-toggle__items .modula-toggle__off{display:none}.modula-toggle__input[type=checkbox]:checked+.modula-toggle__items .modula-toggle__on{display:inline-block}p.description.alert{color:red}tr.troubleshoot-subfield.hide{display:none}.modula-copy-shortcode{display:flex;align-items:center;flex-wrap:wrap}.modula-copy-shortcode input{margin:0;border-top-right-radius:0;border-bottom-right-radius:0;flex-grow:1}.modula-copy-shortcode span{width:100%}.wp-core-ui .modula-copy-shortcode a.button-primary{height:30px;border-top-left-radius:0;border-bottom-left-radius:0}@keyframes carousel{0%{transform:translateX(0);opacity:1!important}50%{transform:translateX(0);opacity:1!important}51%{transform:translateX(-100%);opacity:1!important}99%{transform:translateX(-100%);opacity:1!important}100%{transform:translateX(-200%);opacity:1!important}}.modula-upsells-carousel-wrapper{position:relative;display:flex;overflow:hidden}.modula-upsells-carousel{flex-shrink:0;position:relative;display:block;width:100%}.modula-upsells-carousel .modula-upsell-item{position:relative;width:100%;flex-shrink:0;margin-top:0;left:-15px}.modula-upsells-carousel .modula-upsell-item{text-align:center}.modula-upsells-carousel .modula-upsell-item ul.modula-upsells-list{padding-left:40px}.modula-upsells-carousel .modula-upsell-item ul li{position:relative;list-style-type:none!important;text-align:left}#modula-albums-upsell .modula-upsells-carousel .modula-upsell-item ul li{display:inline-block;margin:0 15px 15px 35px}.modula-upsells-carousel .modula-upsell-item ul li:before{font-family:Dashicons;content:"\f147";position:absolute;left:-30px;font-size:14px;color:green;background-color:#fff;padding:0 3px;border-radius:50%;border:1px solid #ddd;top:-1px}#modula-albums-upsell>button.handlediv,#modula-albums-upsell>h2.hndle.ui-sortable-handle,#modula-sorting-upsell>button.handlediv,#modula-sorting-upsell>h2.hndle.ui-sortable-handle{display:none}#modula-albums-upsell>.inside,#modula-sorting-upsell>.inside{padding:0;margin:0 auto}#modula_troubleshooting_option .modula-select label{margin-right:10px}#modula_troubleshooting_option .modula-select label:last-child{margin-right:0}#modula-albums-upsell h2{margin:0!important}
1
+ #modula-settings .inside{padding:0;margin:0}.modula-settings-container{display:flex}.modula-settings-container .modula-tabs{background-color:#f8f8f8}.modula-settings-container .modula-tabs .modula-tab{margin:0 10px 0 0;padding:15px 0;color:#9c9c9c;cursor:pointer;position:relative;width:165px;position:relative}.modula-settings-container .modula-tabs .modula-tab sup{margin-left:5px;padding:2px 5px;border-radius:5px;color:#fff;font-size:8px;background:#9c9c9c;display:inline-block;line-height:1;position:relative;top:-2px}.modula-settings-container .modula-tabs .modula-tab.active-tab sup,.modula-settings-container .modula-tabs .modula-tab:hover sup{background-color:#57a7c9}.modula-settings-container .modula-tabs .modula-tab.modula-responsive.active-tab sup,.modula-settings-container .modula-tabs .modula-tab.modula-responsive:hover sup{background:#dc3232}.modula-settings-container .modula-tabs .modula-tab>i{margin-right:10px;margin-left:15px}.modula-settings-container .modula-tabs .modula-tab:after{position:absolute;content:"";width:1px;height:100%;background-color:transparent;top:0;right:-1px}.modula-settings-container .modula-tabs .modula-tab.active-tab:first-child{border-top:0 none}.modula-settings-container .modula-tabs .modula-tab:hover{color:#333}.modula-settings-container .modula-tabs .modula-tab.active-tab{margin:0;padding:15px 10px 15px 0;background-color:#fff;border-bottom:1px solid #ddd;border-top:1px solid #ddd;color:#333}.modula-settings-container .modula-tabs .modula-tab.active-tab:before{content:"";position:absolute;left:-2px;top:-1px;width:3px;height:calc(100% + 2px);background-color:#57a7c9}.modula-settings-container .modula-tabs .modula-tab.active-tab:after{background-color:#fff}tr label.th-label{color:#23282d;font-weight:600;margin-bottom:10px}.postbox .modula-settings-container table.form-table{margin:0}.postbox .modula-settings-container .form-table-wrapper{padding:0 0 0 20px;box-sizing:border-box}.modula-settings-container .modula-tabs-content{padding:10px 20px;border-left:1px solid #eee;flex-grow:1}.modula-tabs-content>div:not(.active-tab){display:none}.modula-settings-container .modula-tabs-content .tab-content-header{width:100%;padding-bottom:12px;margin-bottom:10px;border-bottom:1px solid #eee;padding-left:20px;padding-right:0;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between}.modula-settings-container .modula-tabs-content .tab-content-header .tab-content-header-actions{display:flex;align-items:center}.modula-settings-container .modula-tabs-content .tab-content-header .tab-content-header-actions>span{margin:0 10px;font-style:italic}.modula-settings-container .modula-tabs-content .tab-content-header .tab-content-header-actions a.button>span{height:auto;line-height:26px;margin-right:10px}#poststuff .modula-settings-container .modula-tabs-content .tab-content-header .tab-content-header-title>h2{font-weight:700;padding:0;display:inline-block}#poststuff .modula-settings-container .modula-tabs-content .tab-content-header .tab-header-description p{margin:0}.modula-settings-container .form-table td p.description{font-size:13px}.modula-settings-container .slider-container{position:relative;height:2px;padding:10px 0;width:25em;box-sizing:border-box;margin-bottom:10px;display:flex;display:flex;justify-content:space-between;align-items:center}.modula-settings-container .slider-container input[type=text]{border:none;text-align:center;padding:2px;margin:0 20px 0 0;font-size:12px;color:#333;border-radius:10px;background-color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.16);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.16);box-shadow:inset 0 1px 1px rgba(0,0,0,.16);width:40px;height:22px;cursor:default}.modula-settings-container .slider-container .ui-slider{position:relative;text-align:left;height:2px;border-radius:3px;border:none;display:block;width:100%;background:#d6d6d6;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.modula-settings-container .slider-container .ui-slider .ui-slider-handle{position:absolute;z-index:2;top:-10px;cursor:default;-ms-touch-action:none;touch-action:none;width:18px;height:18px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px;background-color:#fff;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.1);-moz-box-shadow:0 1px 1px rgba(0,0,0,.1);box-shadow:0 1px 1px rgba(0,0,0,.1);border:solid 1px #d7d7d7;transform:translateX(-50%)}.modula-settings-container .slider-container .ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0;background:#57a7c9;top:0;bottom:0}.modula-effects-preview{margin-top:20px}.modula-effects-preview .modula-item{width:400px;height:300px;overflow:hidden;position:relative}.modula-effects-preview .modula-item img{position:absolute;min-height:100%;min-width:100%}.modula-effects-preview .modula-item .figc{display:flex;align-items:center;justify-content:center;color:#fff;font-size:11px;text-align:center;position:absolute;left:0;width:100%;height:100%;padding:0}.modula-effects-preview .modula-item .figc h2{font-size:21px!important;color:#fff}.modula-effects-preview .modula-item .figc p{color:#fff;font-size:15px;font-style:normal}.modula .modula-items .modula-item h2{margin:0}.modula .modula-items .modula-item p{margin:0;padding:0}.modula .figc{color:#000;text-align:center;position:absolute;left:0;width:100%;padding:2em}.modula .modula-item .jtg-social a{text-decoration:none;color:#fff;display:inline-block;margin:0 10px 0 0;width:20px;padding:6px 4px;border:0;opacity:0;transition:opacity .3s}.modula .modula-item .jtg-social svg{width:20px;height:16px}.modula .modula-item:hover .jtg-social a{opacity:1}.modula .modula-items .jtg-social{opacity:0;transition:opacity .1s;right:30px;position:absolute;bottom:20px;text-align:right;transition:all .3s}.modula .modula-items .jtg-social{opacity:1}.modula .modula-items .jtg-social a:last-of-type{margin-right:0}.modula .modula-item.effect-pufrobo p.description{margin-bottom:2em}.modula .modula-item.effect-pufrobo .figc{text-align:right}.modula .modula-item.effect-pufrobo h2,.modula .modula-item.effect-pufrobo p{position:absolute;right:30px;left:30px;padding:10px 0}.modula .modula-item:hover img{opacity:.8}.modula .modula-item{background-color:#000}.modula .modula-item.effect-pufrobo p{bottom:20%;line-height:1.5;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0);letter-spacing:1px}.modula .modula-item.effect-pufrobo h2{top:10%;-webkit-transition:-webkit-transform .35s;transition:transform .35s;-webkit-transform:translate3d(0,20px,0);transform:translate3d(0,20px,0)}.modula .modula-item.effect-pufrobo:hover h2{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.modula .modula-item.effect-pufrobo h2::after{position:absolute;top:80%;left:0;width:100%;height:4px;background:#fff;content:'';-webkit-transform:translate3d(0,40px,0);transform:translate3d(0,40px,0)}.modula .modula-item.effect-pufrobo h2::after,.modula .modula-item.effect-pufrobo p{opacity:0;-webkit-transition:opacity .35s,-webkit-transform .35s;transition:opacity .35s,transform .35s}.modula .modula-item.effect-pufrobo:hover h2::after,.modula .modula-item.effect-pufrobo:hover p{margin-top:10px;margin-bottom:5px;opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.modula-upsell{background:#f1f1f1;border:0;padding:15px;margin-top:30px}.form-table-wrapper .modula-upsell{border:1px solid #ddd;text-align:center}#poststuff .modula-upsell h2{margin:0 0 20px 0;font-size:16px;font-weight:700;background:#fff;left:-15px;top:-15px;padding:8px 12px;position:relative;width:calc(100% + 6px);border-bottom:1px solid #ddd}.modula-upsell p{margin:0}.modula-upsell p.modula-upsell-description{font-size:13px;line-height:1.5;color:#333;opacity:.8;margin-top:0;margin-bottom:10px;padding:0 10px}.modula-upsell .button{height:31px;line-height:31px;font-weight:700}.modula-upsell .button:first-child{margin-right:10px}.modula-upsell .action-link,.modula-upsell .action-link:hover{background:#51ad31;border-color:#51ad31;color:#fff;font-weight:700}#modula-uploader-container{position:relative;padding-left:10px;padding-right:10px}#modula-uploader-container.modula-resizer-enabled{margin-bottom:20px}.modula-upload-actions{padding:15px 20px;background-color:#f8fcfd;border-bottom:1px solid #ecf6f9;margin-bottom:20px;display:flex;align-items:center;justify-content:space-between;width:100%;box-sizing:border-box}.modula-upload-actions .buttons{flex-shrink:0;width:275px;display:flex}.modula-sources-dropdown{position:relative;border-top:1px solid rgba(255,255,255,0);border-right:1px solid rgba(255,255,255,0);border-left:1px solid rgba(255,255,255,0)}.modula-sources-dropdown:hover{border-color:#ddd;background:#f5f5f5}.modula-sources-dropdown>span{width:28px;height:32px;text-align:center;line-height:28px;cursor:pointer;display:inline-block;font-size:25px;font-weight:700}.modula-sources-dropdown .modula-sources-dropdown-content{position:absolute;right:-1px;bottom:0;transform:translateY(100%);display:none;padding:15px;background-color:#f5f5f5;box-shadow:0 1px 1px rgba(0,0,0,.04);box-sizing:border-box;border:1px solid #ddd}.modula-sources-dropdown:hover .modula-sources-dropdown-content{display:block}.modula-sources-dropdown:hover .modula-sources-dropdown-content:before{content:"";height:1px;width:28px;background-color:#f5f5f5;position:absolute;top:-1px;right:0}.segrip.ui-resizable-se{width:30px;height:30px;background:url(../images/resize-se.svg) no-repeat;background-size:contain;display:none;z-index:100;opacity:1}.modula-resizer-enabled .segrip.ui-resizable-se{display:block}.modula-upload-actions #modula-uploader-browser{border-bottom-right-radius:0;border-top-right-radius:0}.modula-upload-actions #modula-wp-gallery{border-bottom-left-radius:0;border-top-left-radius:0}.wp-core-ui .modula-upload-actions>a{margin:0 5px}#modula-dropzone-container{position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(0,86,132,.9);z-index:250000;display:none;text-align:center;opacity:0;transition:opacity 250ms}#modula-dropzone-container .modula-uploader-window-content{position:absolute;top:10px;left:10px;right:10px;bottom:10px;border:1px dashed #fff}#poststuff #modula-dropzone-container .modula-uploader-window-content h1{margin:-.5em 0 0;position:absolute;top:50%;left:0;right:0;-webkit-transform:translateY(-50%);transform:translateY(-50%);font-size:20px;line-height:28px;font-weight:400;color:#fff;padding:0}.modula-uploader-inline-content{position:relative;min-height:300px;width:100%}.modula-resizer-enabled .modula-uploader-inline-content{min-height:initial}.modula-uploader-inline-content h2{text-align:center;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}#poststuff .modula-upload-message{font-size:43px;line-height:1;font-weight:400;margin:0;display:none;color:#ebebeb}#poststuff .modula-upload-message .dashicons,#poststuff .modula-upload-message .dashicons-before:before{font-size:43px;width:43px;height:43px}.modula-uploader-inline p{font-size:12px;margin:.5em 0}#poststuff .modula-uploader-inline .modula-upload-instructions{font-size:14px;color:#444;font-weight:400;padding:0}.modula-uploader-footer .max-upload-size{float:left}.modula-uploader-footer .modula-upload-numbers{float:right;opacity:0}.modula-uploader-footer:after{display:block;content:"";clear:both}.upload-progress .modula-upload-numbers{margin:0;line-height:1.4em}.modula-progress-bar{width:100%;max-width:400px;position:relative;height:2px;margin:8px 0 0;border-radius:10px;background:#e5e5e5}.upload-info-container{position:relative;overflow:hidden;flex-grow:1}.upload-info-container .upload-info{padding:5px 0}.upload-info-container .upload-progress{position:absolute;background-color:#f8fcfd;height:100%;display:flex;top:0;left:0;width:100%;flex-direction:column;transition:transform .5s;transform:translateY(100%)}.modula-upload-actions.show-progress .upload-info-container .upload-progress{transform:translateY(0)}.modula-progress-bar .modula-progress-bar-inner{height:2px;min-width:20px;width:0;background:#0085ba;-webkit-transition:width .3s;-moz-transition:width .3s;-ms-transition:width .3s;-o-transition:width .3s;transition:width .3s;border-radius:5px}.modula-uploader-footer.show-progress .modula-progress-bar,.modula-uploader-footer.show-progress .modula-upload-numbers{opacity:1}.modula-uploader-inline-content .modula-single-image,.modula-uploader-inline-content .modula-single-image-placeholder{cursor:move;display:inline-block;padding:0 10px 20px 0;box-sizing:border-box;width:16.66%}.modula-uploader-inline-content .modula-single-image-placeholder:after{width:100%;height:100%;display:inline-block;content:"";position:relative;border:3px dashed #444;padding-top:calc(100% - 6px);box-sizing:border-box}.modula-uploader-inline-content .modula-single-image .modula-single-image-content{position:relative;border:1px solid #d6d6d6;box-sizing:border-box;background-position:center;background-size:cover}.modula-uploader-inline-content .modula-single-image .modula-single-image-content img{display:block;width:100%}#poststuff .modula-uploader-inline-content>.modula-upload-message:only-child{display:block}.modula-uploader-inline-content .modula-single-image .actions{position:absolute;z-index:99;font-size:0;width:100%;height:100%;top:0;left:0;background:rgba(0,0,0,.4);padding:5px;box-sizing:border-box;display:none}.modula-uploader-inline-content .modula-single-image:hover .actions{display:block}.modula-uploader-inline-content .modula-single-image .actions a{width:20px;height:20px;border-radius:100%;border:1px solid #000;background-color:rgba(255,255,255,.8);color:#000;display:block;text-decoration:none;text-align:center;line-height:20px;margin-bottom:5px}.modula-uploader-inline-content .modula-single-image .actions a:hover{background-color:#000;color:#fff}.modula-uploader-inline-content .modula-single-image .actions a span{font-size:16px;width:20px;height:20px;line-height:20px}.modula-uploader-inline-content .modula-single-image .actions a.modula-delete-image{color:#a00a00}.modula-uploader-inline-content .modula-single-image .actions a.modula-delete-image:hover{background-color:#a00a00;color:#fff}.modula-uploader-inline-content:after{content:"";display:block;clear:both}.media-modal .modula-edit-popup.edit-attachment-frame .edit-media-header button.right{border-right:1px solid #ddd}.media-modal .modula-edit-popup .attachment-details .attachment-info .settings .setting{margin:0 0 20px 0;padding:0 0 20px 0;border-bottom:1px solid #ddd}.media-modal .modula-edit-popup .attachment-details .attachment-info .settings .setting span.name{display:block;width:100%;min-width:100%;margin:0;padding:0;text-align:left;font-weight:700;font-size:14px}.media-modal .modula-edit-popup .attachment-details .attachment-info .settings .setting input[type=text],.media-modal .modula-edit-popup .attachment-details .attachment-info .settings .setting textarea{display:block;width:100%;min-width:100%;margin:0}.media-modal .modula-edit-popup .attachment-details .attachment-info .settings .setting div.description{clear:both;float:left;margin:5px 0 0 0;text-align:left;font-size:13px;font-style:italic;color:#666}.media-modal .modula-edit-popup .attachment-details .attachment-info .settings{margin:0;padding:0;border:none}.media-modal .attachment-info .actions a{display:inline-block}.inline-input{display:inline}.ui-draggable.ui-resizable>.segrip{width:10px;height:10px;background:red;position:absolute;bottom:0;right:0}.ui-draggable.ui-resizable .modula-single-image-content img{display:none}.ui-draggable.ui-resizable .modula-single-image-content{width:100%;height:100%}.ui-draggable.ui-resizable.modula-single-image{padding:0}.packery-drop-placeholder{outline:3px dashed #444;outline-offset:-6px;-webkit-transition:-webkit-transform .2s;transition:transform .2s}.ui-resizable-helper{border:3px dashed #444;box-sizing:border-box}#poststuff #modula-preview-gallery h2.hndle,#poststuff #modula-settings h2.hndle{padding-left:20px}#poststuff #modula-preview-gallery .inside{margin-top:0;padding:0}.modula-edit-popup .attachment-details .setting span.description>span{display:inline-block;float:none;width:auto;min-width:unset;line-height:16px;min-height:16px;margin-top:8px;padding:0;vertical-align:middle;margin-right:0}.modula-edit-popup .attachment-details .setting span.description{text-align:left;vertical-align:middle}.modula-media-modal .attachments-browser .media-toolbar .media-toolbar-secondary{width:100%}.modula-error-container{display:block}.modula-error-container.hide{display:none}.modula-error-container .modula-error{padding:12px;margin-bottom:12px;background:#fff;border-left:4px solid #dc3232;box-shadow:0 0 4px 0 rgba(0,0,0,.1);font-weight:600;margin-top:5px;position:relative;background-color:#dc3232;color:#fff}.modula-error-container .modula-error a{color:#fff}.modula-error-container .modula-error .upload-dismiss-errors{position:absolute;top:50%;right:-5px;padding:10px;transition:none;display:block;text-decoration:none;margin-top:-18px}.modula-error-container .modula-error .upload-dismiss-errors:before{content:"\f153";display:block;font:400 16px/1 dashicons;color:#fff}a.modula-tab-link{text-decoration:none}.modula-tab-link span.dashicons{width:16px;height:16px;line-height:16px;margin-right:3px;vertical-align:text-bottom;font-size:16px;text-decoration:none}#modula-grid{height:100%;position:absolute;overflow:hidden;top:0;left:0;width:100%}#modula-grid .modula-grid-item{background-color:#fafafa;float:left}#modula-grid .modula-grid-item:nth-child(12n){margin-right:0!important}#modula-grid:after{content:"";display:block;clear:both}.modula-tooltip{position:relative;display:inline-block}.modula-tooltip>span{cursor:pointer;color:#0073aa;text-decoration:underline;margin-left:5px}.modula-tooltip .modula-tooltip-content{display:none;position:absolute;top:50%;right:-10px;transform:translate(100% ,-50%);width:300px;background:#000;color:#fff;padding:10px;box-sizing:border-box;z-index:99}.modula-tooltip .modula-tooltip-content:before{content:'';width:0;height:0;border-style:solid;border-width:8px 8px 8px 0;border-color:transparent #000 transparent transparent;display:block;position:absolute;top:50%;left:-8px;transform:translateY(-50%)}.modula-tooltip:hover .modula-tooltip-content{display:block}.modula-helper-guidelines-container{padding:15px 20px;background-color:#f8fcfd;display:flex;align-items:center;border-top:1px solid #ecf6f9}.modula-helper-guidelines-container .onoffswitch{margin-top:0}.modula-helper-guidelines-wrapper .modula-helper-guidelines-label{margin-left:5px}.modula-creative-gallery.modula-uploader-inline-content .modula-single-image .modula-single-image-content{background:#eee!important;position:relative;overflow:hidden}.modula-creative-gallery.modula-uploader-inline-content .modula-single-image-content:before{content:"";display:block;padding-top:100%}.modula-creative-gallery.modula-uploader-inline-content .modula-single-image-content img{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.modula-creative-gallery.modula-uploader-inline-content .modula-single-image-content.landscape img{max-height:100%}.modula-creative-gallery.modula-uploader-inline-content .modula-single-image-content.portrait img{max-width:100%}.modula-toggle{position:relative;position:relative;user-select:none;display:inline-block}.modula-toggle__items{box-sizing:border-box;display:inline-block;position:relative}.modula-toggle__items>*{box-sizing:inherit}.modula-toggle__input[type=checkbox]{border-radius:2px;border:2px solid #6c7781;margin-right:12px;transition:none;height:100%;left:0;top:0;margin:0;padding:0;opacity:0;position:absolute;width:100%;z-index:1}.modula-toggle__track{background-color:#fff;border:2px solid #6c7781;border-radius:9px;display:inline-block;height:18px;width:36px;vertical-align:top;transition:background .2s ease}.modula-toggle__thumb{background-color:#6c7781;border:5px solid #6c7781;border-radius:50%;display:block;height:10px;width:10px;position:absolute;left:4px;top:4px;transition:transform .2s ease}.modula-toggle__off{position:absolute;right:6px;top:6px;color:#6c7781;fill:currentColor}.modula-toggle__on{position:absolute;top:6px;left:8px;border:1px solid #fff;outline:1px solid transparent;outline-offset:-1px;display:none}.modula-toggle__input[type=checkbox]:checked+.modula-toggle__items .modula-toggle__track{background-color:#11a0d2;border:9px solid transparent}.modula-toggle__input[type=checkbox]:checked+.modula-toggle__items .modula-toggle__thumb{background-color:#fff;border-width:0;transform:translateX(18px)}.modula-toggle__input[type=checkbox]:checked+.modula-toggle__items .modula-toggle__off{display:none}.modula-toggle__input[type=checkbox]:checked+.modula-toggle__items .modula-toggle__on{display:inline-block}p.description.alert{color:red}tr.troubleshoot-subfield.hide{display:none}.modula-copy-shortcode{display:flex;align-items:center;flex-wrap:wrap}.modula-copy-shortcode input{margin:0;border-top-right-radius:0;border-bottom-right-radius:0;flex-grow:1}.modula-copy-shortcode span{width:100%}.wp-core-ui .modula-copy-shortcode a.button-primary{height:30px;border-top-left-radius:0;border-bottom-left-radius:0}@keyframes carousel{0%{transform:translateX(0);opacity:1!important}50%{transform:translateX(0);opacity:1!important}51%{transform:translateX(-100%);opacity:1!important}99%{transform:translateX(-100%);opacity:1!important}100%{transform:translateX(-200%);opacity:1!important}}.modula-upsells-carousel-wrapper{position:relative;display:flex;overflow:hidden}.modula-upsells-carousel{flex-shrink:0;position:relative;display:block;width:100%}.modula-upsells-carousel .modula-upsell-item{position:relative;width:100%;flex-shrink:0;margin-top:0;left:-15px}.modula-upsells-carousel .modula-upsell-item{text-align:center}.modula-upsells-carousel .modula-upsell-item ul.modula-upsells-list{padding-left:40px}.modula-upsells-carousel .modula-upsell-item ul li{position:relative;list-style-type:none!important;text-align:left}#modula-albums-upsell .modula-upsells-carousel .modula-upsell-item ul li{display:inline-block;margin:0 15px 15px 35px}.modula-upsells-carousel .modula-upsell-item ul li:before{font-family:Dashicons;content:"\f147";position:absolute;left:-30px;font-size:14px;color:green;background-color:#fff;padding:0 3px;border-radius:50%;border:1px solid #ddd;top:-1px}#modula-albums-upsell>button.handlediv,#modula-albums-upsell>h2.hndle.ui-sortable-handle,#modula-sorting-upsell>button.handlediv,#modula-sorting-upsell>h2.hndle.ui-sortable-handle{display:none}#modula-albums-upsell>.inside,#modula-sorting-upsell>.inside{padding:0;margin:0 auto}.cm-s-dracula .CodeMirror-gutters,.cm-s-dracula.CodeMirror{background-color:#282a36!important;color:#f8f8f2!important;border:none}.cm-s-dracula .CodeMirror-gutters{color:#282a36}.cm-s-dracula .CodeMirror-cursor{border-left:solid thin #f8f8f0}.cm-s-dracula .CodeMirror-linenumber{color:#6d8a88}.cm-s-dracula .CodeMirror-selected{background:rgba(255,255,255,.1)}.cm-s-dracula .CodeMirror-line::selection,.cm-s-dracula .CodeMirror-line>span::selection,.cm-s-dracula .CodeMirror-line>span>span::selection{background:rgba(255,255,255,.1)}.cm-s-dracula .CodeMirror-line::-moz-selection,.cm-s-dracula .CodeMirror-line>span::-moz-selection,.cm-s-dracula .CodeMirror-line>span>span::-moz-selection{background:rgba(255,255,255,.1)}.cm-s-dracula span.cm-comment{color:#6272a4}.cm-s-dracula span.cm-string,.cm-s-dracula span.cm-string-2{color:#f1fa8c}.cm-s-dracula span.cm-number{color:#bd93f9}.cm-s-dracula span.cm-variable{color:#50fa7b}.cm-s-dracula span.cm-variable-2{color:#fff}.cm-s-dracula span.cm-def{color:#50fa7b}.cm-s-dracula span.cm-operator{color:#ff79c6}.cm-s-dracula span.cm-keyword{color:#ff79c6}.cm-s-dracula span.cm-atom{color:#bd93f9}.cm-s-dracula span.cm-meta{color:#f8f8f2}.cm-s-dracula span.cm-tag{color:#ff79c6}.cm-s-dracula span.cm-attribute{color:#50fa7b}.cm-s-dracula span.cm-qualifier{color:#50fa7b}.cm-s-dracula span.cm-property{color:#66d9ef}.cm-s-dracula span.cm-builtin{color:#50fa7b}.cm-s-dracula span.cm-type,.cm-s-dracula span.cm-variable-3{color:#ffb86c}.cm-s-dracula .CodeMirror-activeline-background{background:rgba(255,255,255,.1)}.cm-s-dracula .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}#modula_troubleshooting_option .modula-select label{margin-right:10px}#modula_troubleshooting_option .modula-select label:last-child{margin-right:0}#modula-albums-upsell h2{margin:0!important}.modula-settings-container input[type=number]{max-width:80px}.modula-after-input{margin-left:5px}
assets/css/modula-importer.css ADDED
@@ -0,0 +1,46 @@
1
+ .modula .modula-importer-row.hide,
2
+ .modula .select-all-wrapper.hide,
3
+ .modula label[data-id="delete-old-entries"].hide,
4
+ .modula input[type="submit"].hide,
5
+ .modula .select-all-checkbox.hide,
6
+ .modula .select-all-checkbox-wrapper.hide,
7
+ .modula-importer-upsell-wrapper.hide{
8
+ display: none;
9
+ }
10
+
11
+ .imported-check {
12
+ display:inline-block;
13
+ margin-left:10px;
14
+ }
15
+
16
+
17
+ .imported-check:before {
18
+ font-size: 20px;
19
+ color: #00b894;
20
+ }
21
+
22
+ .modula-importer-checkbox-wrapper {
23
+ margin-bottom:10px;
24
+ }
25
+
26
+ .modula-importer-gallery-status {
27
+ color:blue;
28
+ }
29
+
30
+ .modula-importer-upsell-wrapper {
31
+ background:#fff;
32
+ border:1px solid #dddddd;
33
+ padding:15px;
34
+ margin-bottom:25px;
35
+ }
36
+
37
+ .modula-importer-upsell-wrapper .modula-importer-upsell-buttons {
38
+ margin-top:25px;
39
+ }
40
+ .modula-importer-upsell-wrapper .modula-importer-upsell-buttons a {
41
+ margin-right:15px;
42
+ }
43
+
44
+ .modula-importer-checkbox-wrapper .modula-tooltip span {
45
+ color:red !important;
46
+ }
assets/css/modula.css CHANGED
@@ -42,9 +42,9 @@
42
display: block;
43
}
44
45
- .modula .modula-items .modula-item .description {
46
font-size:14px;
47
- }
48
.modula .modula-items .modula-item .caption .icon {
49
font-size:14px;
50
position:absolute;
@@ -54,7 +54,6 @@
54
}
55
.modula .modula-items .modula-item .figc {
56
color: #fff;
57
- font-size:11px;
58
text-align: center;
59
position: absolute;
60
left: 0;
@@ -321,7 +320,6 @@ body .modula .filters.vertical-filters.both-vertical + .modula-items {
321
color: #fff;
322
display: inline-block;
323
margin:0 10px 0 0;
324
- width: 20px;
325
padding: 6px 4px;
326
border: 0;
327
opacity: 0;
42
display: block;
43
}
44
45
+ /*.modula .modula-items .modula-item .description {
46
font-size:14px;
47
+ }*/
48
.modula .modula-items .modula-item .caption .icon {
49
font-size:14px;
50
position:absolute;
54
}
55
.modula .modula-items .modula-item .figc {
56
color: #fff;
57
text-align: center;
58
position: absolute;
59
left: 0;
320
color: #fff;
321
display: inline-block;
322
margin:0 10px 0 0;
323
padding: 6px 4px;
324
border: 0;
325
opacity: 0;
assets/css/modula.min.css CHANGED
@@ -1 +1 @@
1
- .modula .modula-items .modula-item{position:absolute;overflow:hidden;transition:transform .3s ease-out,opacity .2s linear,top .3s,left .6s;opacity:0;box-sizing:border-box}.modula .modula-items .modula-item>a{display:block;position:absolute;top:0;left:0;width:100%;height:100%;z-index:10;background:0 0}.modula .modula-items .modula-item .jtg-social{z-index:10}.modula .modula-items .modula-item.tg-loaded{transform:scale(1) translate(0,0) rotate(0)!important;opacity:1}.modula .modula-items .modula-item.tg-loaded img.pic{display:block;opacity:1}.modula .modula-items .modula-item img.pic{font-size:12px;position:absolute;display:none;opacity:0;max-width:999em!important;transition:width .3s,height .3s,transform .3s linear,opacity .2s linear}.modula .modula-items .modula-item img.pic.lazyload,.modula .modula-items .modula-item img.pic.lazyloaded{display:block}.modula .modula-items .modula-item .description{font-size:14px}.modula .modula-items .modula-item .caption .icon{font-size:14px;position:absolute;left:50%;top:50%;margin:-12px 0 0 -8px}.modula .modula-items .modula-item .figc{color:#fff;font-size:11px;text-align:center;position:absolute;left:0;width:100%;padding:0}.modula .modula-items .hidden .figc{display:none}.modula .modula-items .hidden:hover .figc{display:block}.modula .modula-items .visible .figc{display:block}.modula .modula-items .always-visible .figc{display:block}.modula .modula-items .visible:hover .figc{display:none}.modula .modula-items .caption span.text{display:block;padding:10px}.modula .modula-items .caption span.title{font-size:14px;font-weight:700}.modula .filters{margin:20px 0 20px 0}.modula .filters.vertical-filters{margin-top:0}.modula .filters a{text-decoration:none;display:inline-block;color:#333;outline:0;transition:350ms ease-in}.modula .filters.menu--dfefault a{border-bottom:2px solid transparent}.modula .filters.colored a{border:0;color:#fff}.modula .filters:not(.styled-menu) a.selected,.modula .filters:not(.styled-menu) a:hover{border-bottom-color:#333;border-bottom:1px solid}body .modula .modula-item{width:100%}body .modula.vertical-filters .modula-items{width:80%;float:left}body .modula:after{content:"";display:block;clear:both}.modula.vertical-filters .filters{width:20%;float:left}body .modula .filters.vertical-filters.both-vertical+.modula-items{width:60%}.modula .filters.vertical-filters a{display:block;margin-bottom:15px}.modula .filters.vertical-filters.colored a{border-radius:5px;text-align:center;background:#fff;border:1px solid #3498db;color:#3498db}.modula .filters.vertical-filters.colored a.selected,.modula .filters.vertical-filters.colored a:hover{background:#fff;color:#8e44ad;border-color:#8e44ad}.modula .filters.horizontal-filters.colored a{display:inline-block;padding:0 30px;margin-right:2px;background:#3498db;position:relative;border:0}.modula .filters.horizontal-filters.colored a.selected,.modula .filters.horizontal-filters.colored a:hover{background:#8e44ad}.modula .filters.horizontal-filters.colored a:before{position:absolute;content:'';left:0;top:0;width:0;height:0;border:none;border-bottom-color:currentcolor;border-bottom-style:none;border-bottom-width:medium;border-left-color:currentcolor;border-left-style:none;border-left-width:medium;border-left:solid 17px #fff;border-bottom:solid 41px transparent;z-index:1;transition:.4s}.modula .filters.horizontal-filters.colored a:after{position:absolute;content:'';right:0;top:0;width:0;height:0;border:none;border-bottom-color:currentcolor;border-bottom-style:none;border-bottom-width:medium;border-left-color:currentcolor;border-left-style:none;border-left-width:medium;border-left:solid 17px transparent;border-bottom:solid 41px #fff;z-index:1;transition:.4s}.filter-by-wrapper{text-align:center;margin-bottom:25px;text-transform:uppercase}.filter-by-wrapper span{cursor:pointer}.filter-by-wrapper span:after{content:"";margin-left:15px;width:0;height:0;border-style:solid;border-width:15px 10px 0 10px;border-color:#0470e3 transparent transparent transparent;display:inline-block}.filter-by-wrapper.opened span:after{content:"";width:0;height:0;border-style:solid;border-width:0 10px 15px 10px;border-color:transparent transparent #d500ff transparent;display:inline-block}.modula .filters.vertical-filters a{margin-bottom:0}.menu__list li.menu__item{margin:15px}@media all and (min-width:1025px){.filter-by-wrapper{display:none!important}.modula-gallery .filters{display:block!important}}@media all and (max-width:1024px){.modula .filters.vertical-filters.both-vertical+.modula-items,.modula.vertical-filters .filters,.modula.vertical-filters .modula-items{width:100%!important;float:none}.menu__list{padding:0}.menu__list li.menu__item{margin:0}}.modula .jtg-social a{box-shadow:none}.lightbox .lb-image{max-width:999em}.modula .jtg-social svg{width:20px;height:16px}.modula .modula-items .modula-item .jtg-title{margin:0}.modula .modula-items .modula-item p{margin:0;padding:0}.modula .figc{color:#000;text-align:center;position:absolute;left:0;width:100%;padding:2em}.modula .modula-item .jtg-social a{text-decoration:none;color:#fff;display:inline-block;margin:0 10px 0 0;width:20px;padding:6px 4px;border:0;opacity:0;transition:opacity .3s}.modula .modula-item:hover .jtg-social a{opacity:1}.modula .modula-items .jtg-social{opacity:0;transition:opacity .1s;right:30px;position:absolute;bottom:20px;text-align:right;transition:all .3s}.modula .modula-items .jtg-social{opacity:1}.modula .modula-items .jtg-social a:last-of-type{margin-right:0}.modula .modula-item.effect-pufrobo p.description{margin-bottom:2em}.modula .modula-item.effect-pufrobo .figc{text-align:right}.modula .modula-item.effect-pufrobo .jtg-title,.modula .modula-item.effect-pufrobo p{position:absolute;right:30px;left:30px;padding:10px 0}.modula .modula-item:hover img,.modula .modula-items .modula-item.tg-loaded:hover img.pic{opacity:.8}.modula .modula-item{background-color:#000}.modula .modula-item.effect-pufrobo p{bottom:20%;line-height:1.5;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0);letter-spacing:1px}.modula .modula-item.effect-pufrobo .jtg-title{top:10%;-webkit-transition:-webkit-transform .35s;transition:transform .35s;-webkit-transform:translate3d(0,20px,0);transform:translate3d(0,20px,0)}.modula .modula-item.effect-pufrobo:hover .jtg-title{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.modula .modula-item.effect-pufrobo .jtg-title::after{position:absolute;top:80%;left:0;width:100%;height:4px;background:#fff;content:'';-webkit-transform:translate3d(0,40px,0);transform:translate3d(0,40px,0)}.modula .modula-item.effect-pufrobo .jtg-title::after,.modula .modula-item.effect-pufrobo p{opacity:0;-webkit-transition:opacity .35s,-webkit-transform .35s;transition:opacity .35s,transform .35s}.modula .modula-item.effect-pufrobo:hover .jtg-title::after,.modula .modula-item.effect-pufrobo:hover p{margin-top:10px;margin-bottom:5px;opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.modula .modula-items .modula-item.effect-pufrobo .figc.no-title.no-description .jtg-title:after{display:none}.modula .modula-items .modula-item.effect-appear .figc .jtg-title:before,.modula .modula-items .modula-item.effect-comodo .figc .jtg-title:before,.modula .modula-items .modula-item.effect-crafty .figc .jtg-title:before,.modula .modula-items .modula-item.effect-curtain .figc .jtg-title:before,.modula .modula-items .modula-item.effect-fluid-up .figc .jtg-title:before,.modula .modula-items .modula-item.effect-hide .figc .jtg-title:before,.modula .modula-items .modula-item.effect-lens .figc .jtg-title:before,.modula .modula-items .modula-item.effect-pufrobo .figc .jtg-title:before,.modula .modula-items .modula-item.effect-quiet .figc .jtg-title:before,.modula .modula-items .modula-item.effect-reflex .figc .jtg-title:before,.modula .modula-items .modula-item.effect-seemo .figc .jtg-title:before{display:none}#lightbox.lightbox{position:fixed;top:50%!important;transform:translateY(-50%)}@media all and (max-height:680px){#lightbox.lightbox .lb-image,.lb-container,.lb-outerContainer{max-height:80vh;width:auto!important;display:inline-block}}.modula .modula-items .modula-item>a{cursor:zoom-in}
1
+ .modula .modula-items .modula-item{position:absolute;overflow:hidden;transition:transform .3s ease-out,opacity .2s linear,top .3s,left .6s;opacity:0;box-sizing:border-box}.modula .modula-items .modula-item>a{display:block;position:absolute;top:0;left:0;width:100%;height:100%;z-index:10;background:0 0}.modula .modula-items .modula-item .jtg-social{z-index:10}.modula .modula-items .modula-item.tg-loaded{transform:scale(1) translate(0,0) rotate(0)!important;opacity:1}.modula .modula-items .modula-item.tg-loaded img.pic{display:block;opacity:1}.modula .modula-items .modula-item img.pic{font-size:12px;position:absolute;display:none;opacity:0;max-width:999em!important;transition:width .3s,height .3s,transform .3s linear,opacity .2s linear}.modula .modula-items .modula-item img.pic.lazyload,.modula .modula-items .modula-item img.pic.lazyloaded{display:block}.modula .modula-items .modula-item .caption .icon{font-size:14px;position:absolute;left:50%;top:50%;margin:-12px 0 0 -8px}.modula .modula-items .modula-item .figc{color:#fff;text-align:center;position:absolute;left:0;width:100%;padding:0}.modula .modula-items .hidden .figc{display:none}.modula .modula-items .hidden:hover .figc{display:block}.modula .modula-items .visible .figc{display:block}.modula .modula-items .always-visible .figc{display:block}.modula .modula-items .visible:hover .figc{display:none}.modula .modula-items .caption span.text{display:block;padding:10px}.modula .modula-items .caption span.title{font-size:14px;font-weight:700}.modula .filters{margin:20px 0 20px 0}.modula .filters.vertical-filters{margin-top:0}.modula .filters a{text-decoration:none;display:inline-block;color:#333;outline:0;transition:350ms ease-in}.modula .filters.menu--dfefault a{border-bottom:2px solid transparent}.modula .filters.colored a{border:0;color:#fff}.modula .filters:not(.styled-menu) a.selected,.modula .filters:not(.styled-menu) a:hover{border-bottom-color:#333;border-bottom:1px solid}body .modula .modula-item{width:100%}body .modula.vertical-filters .modula-items{width:80%;float:left}body .modula:after{content:"";display:block;clear:both}.modula.vertical-filters .filters{width:20%;float:left}body .modula .filters.vertical-filters.both-vertical+.modula-items{width:60%}.modula .filters.vertical-filters a{display:block;margin-bottom:15px}.modula .filters.vertical-filters.colored a{border-radius:5px;text-align:center;background:#fff;border:1px solid #3498db;color:#3498db}.modula .filters.vertical-filters.colored a.selected,.modula .filters.vertical-filters.colored a:hover{background:#fff;color:#8e44ad;border-color:#8e44ad}.modula .filters.horizontal-filters.colored a{display:inline-block;padding:0 30px;margin-right:2px;background:#3498db;position:relative;border:0}.modula .filters.horizontal-filters.colored a.selected,.modula .filters.horizontal-filters.colored a:hover{background:#8e44ad}.modula .filters.horizontal-filters.colored a:before{position:absolute;content:'';left:0;top:0;width:0;height:0;border:none;border-bottom-color:currentcolor;border-bottom-style:none;border-bottom-width:medium;border-left-color:currentcolor;border-left-style:none;border-left-width:medium;border-left:solid 17px #fff;border-bottom:solid 41px transparent;z-index:1;transition:.4s}.modula .filters.horizontal-filters.colored a:after{position:absolute;content:'';right:0;top:0;width:0;height:0;border:none;border-bottom-color:currentcolor;border-bottom-style:none;border-bottom-width:medium;border-left-color:currentcolor;border-left-style:none;border-left-width:medium;border-left:solid 17px transparent;border-bottom:solid 41px #fff;z-index:1;transition:.4s}.filter-by-wrapper{text-align:center;margin-bottom:25px;text-transform:uppercase}.filter-by-wrapper span{cursor:pointer}.filter-by-wrapper span:after{content:"";margin-left:15px;width:0;height:0;border-style:solid;border-width:15px 10px 0 10px;border-color:#0470e3 transparent transparent transparent;display:inline-block}.filter-by-wrapper.opened span:after{content:"";width:0;height:0;border-style:solid;border-width:0 10px 15px 10px;border-color:transparent transparent #d500ff transparent;display:inline-block}.modula .filters.vertical-filters a{margin-bottom:0}.menu__list li.menu__item{margin:15px}@media all and (min-width:1025px){.filter-by-wrapper{display:none!important}.modula-gallery .filters{display:block!important}}@media all and (max-width:1024px){.modula .filters.vertical-filters.both-vertical+.modula-items,.modula.vertical-filters .filters,.modula.vertical-filters .modula-items{width:100%!important;float:none}.menu__list{padding:0}.menu__list li.menu__item{margin:0}}.modula .jtg-social a{box-shadow:none}.lightbox .lb-image{max-width:999em}.modula .jtg-social svg{width:20px;height:16px}.modula .modula-items .modula-item .jtg-title{margin:0}.modula .modula-items .modula-item p{margin:0;padding:0}.modula .figc{color:#000;text-align:center;position:absolute;left:0;width:100%;padding:2em}.modula .modula-item .jtg-social a{text-decoration:none;color:#fff;display:inline-block;margin:0 10px 0 0;padding:6px 4px;border:0;opacity:0;transition:opacity .3s}.modula .modula-item:hover .jtg-social a{opacity:1}.modula .modula-items .jtg-social{opacity:0;transition:opacity .1s;right:30px;position:absolute;bottom:20px;text-align:right;transition:all .3s}.modula .modula-items .jtg-social{opacity:1}.modula .modula-items .jtg-social a:last-of-type{margin-right:0}.modula .modula-item.effect-pufrobo p.description{margin-bottom:2em}.modula .modula-item.effect-pufrobo .figc{text-align:right}.modula .modula-item.effect-pufrobo .jtg-title,.modula .modula-item.effect-pufrobo p{position:absolute;right:30px;left:30px;padding:10px 0}.modula .modula-item:hover img,.modula .modula-items .modula-item.tg-loaded:hover img.pic{opacity:.8}.modula .modula-item{background-color:#000}.modula .modula-item.effect-pufrobo p{bottom:20%;line-height:1.5;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0);letter-spacing:1px}.modula .modula-item.effect-pufrobo .jtg-title{top:10%;-webkit-transition:-webkit-transform .35s;transition:transform .35s;-webkit-transform:translate3d(0,20px,0);transform:translate3d(0,20px,0)}.modula .modula-item.effect-pufrobo:hover .jtg-title{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.modula .modula-item.effect-pufrobo .jtg-title::after{position:absolute;top:80%;left:0;width:100%;height:4px;background:#fff;content:'';-webkit-transform:translate3d(0,40px,0);transform:translate3d(0,40px,0)}.modula .modula-item.effect-pufrobo .jtg-title::after,.modula .modula-item.effect-pufrobo p{opacity:0;-webkit-transition:opacity .35s,-webkit-transform .35s;transition:opacity .35s,transform .35s}.modula .modula-item.effect-pufrobo:hover .jtg-title::after,.modula .modula-item.effect-pufrobo:hover p{margin-top:10px;margin-bottom:5px;opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.modula .modula-items .modula-item.effect-pufrobo .figc.no-title.no-description .jtg-title:after{display:none}.modula .modula-items .modula-item.effect-appear .figc .jtg-title:before,.modula .modula-items .modula-item.effect-comodo .figc .jtg-title:before,.modula .modula-items .modula-item.effect-crafty .figc .jtg-title:before,.modula .modula-items .modula-item.effect-curtain .figc .jtg-title:before,.modula .modula-items .modula-item.effect-fluid-up .figc .jtg-title:before,.modula .modula-items .modula-item.effect-hide .figc .jtg-title:before,.modula .modula-items .modula-item.effect-lens .figc .jtg-title:before,.modula .modula-items .modula-item.effect-pufrobo .figc .jtg-title:before,.modula .modula-items .modula-item.effect-quiet .figc .jtg-title:before,.modula .modula-items .modula-item.effect-reflex .figc .jtg-title:before,.modula .modula-items .modula-item.effect-seemo .figc .jtg-title:before{display:none}#lightbox.lightbox{position:fixed;top:50%!important;transform:translateY(-50%)}@media all and (max-height:680px){#lightbox.lightbox .lb-image,.lb-container,.lb-outerContainer{max-height:80vh;width:auto!important;display:inline-block}}.modula .modula-items .modula-item>a{cursor:zoom-in}
assets/js/jquery-modula.js CHANGED
@@ -15,6 +15,17 @@ jQuery(document).on( 'vc-full-width-row-single vc-full-width-row', function( eve
15
}
16
});
17
18
; (function ($, window, document, undefined) {
19
20
@@ -634,16 +645,5 @@ jQuery( document ).ready( function($){
634
$( '#' + modulaID ).modulaGallery( modulaSettings );
635
636
});
637
- });
638
639
- /* Remove this after migration to Fancybox */
640
- jQuery('.modula-item').on('click', function(e){
641
- window.location.hash = "#";
642
- window.addEventListener('popstate', onBackDown, false);
643
- window.addEventListener('backbutton', onBackDown, false);
644
- function onBackDown() {
645
- this.event.preventDefault();
646
- jQuery('.lb-close').click();
647
- this.window.location.hash = "";
648
- }
649
- });
15
}
16
});
17
18
+ // Compatibility with Elementor
19
+ jQuery( window ).on( 'elementor/frontend/init', function(){
20
+ if ( window.elementorFrontend ) {
21
+ window.elementorFrontend.hooks.addAction( 'frontend/element_ready/global', function( $scope ) {
22
+ if( jQuery( 'body' ).find( '.modula' ).length > 0 ){
23
+ jQuery( window ).trigger( 'modula-update' );
24
+ }
25
+ });
26
+ }
27
+ });
28
+
29
; (function ($, window, document, undefined) {
30
31
645
$( '#' + modulaID ).modulaGallery( modulaSettings );
646
647
});
648
649
+ });
assets/js/jquery-modula.min.js CHANGED
@@ -1,2 +1,2 @@
1
"use strict";!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.ResizeSensor=t()}("undefined"!=typeof window?window:this,function(){if("undefined"==typeof window)return null;var e=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){return window.setTimeout(e,20)};function t(e,t){var i=Object.prototype.toString.call(e),n="[object Array]"===i||"[object NodeList]"===i||"[object HTMLCollection]"===i||"[object Object]"===i||"undefined"!=typeof jQuery&&e instanceof jQuery||"undefined"!=typeof Elements&&e instanceof Elements,o=0,s=e.length;if(n)for(;o<s;o++)t(e[o]);else t(e)}function i(e){if(!e.getBoundingClientRect)return{width:e.offsetWidth,height:e.offsetHeight};var t=e.getBoundingClientRect();return{width:Math.round(t.width),height:Math.round(t.height)}}var n=function(o,s){function r(){var e,t,i=[];this.add=function(e){i.push(e)},this.call=function(){for(e=0,t=i.length;e<t;e++)i[e].call()},this.remove=function(n){var o=[];for(e=0,t=i.length;e<t;e++)i[e]!==n&&o.push(i[e]);i=o},this.length=function(){return i.length}}t(o,function(t){!function(t,n){if(t)if(t.resizedAttached)t.resizedAttached.add(n);else{t.resizedAttached=new r,t.resizedAttached.add(n),t.resizeSensor=document.createElement("div"),t.resizeSensor.dir="ltr",t.resizeSensor.className="resize-sensor";var o="position: absolute; left: -10px; top: -10px; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;",s="position: absolute; left: 0; top: 0; transition: 0s;";t.resizeSensor.style.cssText=o,t.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="'+o+'"><div style="'+s+'"></div></div><div class="resize-sensor-shrink" style="'+o+'"><div style="'+s+' width: 200%; height: 200%"></div></div>',t.appendChild(t.resizeSensor);var d=window.getComputedStyle(t).getPropertyPriority("position");"absolute"!==d&&"relative"!==d&&"fixed"!==d&&(t.style.position="relative");var c,l,a=t.resizeSensor.childNodes[0],h=a.childNodes[0],f=t.resizeSensor.childNodes[1],u=i(t),v=u.width,p=u.height,z=function(){var e=0===t.offsetWidth&&0===t.offsetHeight;if(e){var i=t.style.display;t.style.display="block"}h.style.width="100000px",h.style.height="100000px",a.scrollLeft=1e5,a.scrollTop=1e5,f.scrollLeft=1e5,f.scrollTop=1e5,e&&(t.style.display=i)};t.resizeSensor.resetSensor=z;var y=function(){l=0,c&&(v=void 0,p=void 0,t.resizedAttached&&t.resizedAttached.call())},w=function(){var n=i(t),o=n.width,s=n.height;(c=o!=v||s!=p)&&!l&&(l=e(y)),z()},g=function(e,t,i){e.attachEvent?e.attachEvent("on"+t,i):e.addEventListener(t,i)};g(a,"scroll",w),g(f,"scroll",w),e(z)}}(t,s)}),this.detach=function(e){n.detach(o,e)},this.reset=function(){o.resizeSensor.resetSensor()}};return n.reset=function(e,i){t(e,function(e){e.resizeSensor.resetSensor()})},n.detach=function(e,i){t(e,function(e){e&&(e.resizedAttached&&"function"==typeof i&&(e.resizedAttached.remove(i),e.resizedAttached.length())||e.resizeSensor&&(e.contains(e.resizeSensor)&&e.removeChild(e.resizeSensor),delete e.resizeSensor,delete e.resizedAttached))})},n});
2
- function tg_getURLParameter(t){return decodeURIComponent((new RegExp("[?|&]"+t+"=([^&;]+?)(&|#|;|$)").exec(location.search)||[,""])[1].replace(/\+/g,"%20"))||null}jQuery(document).on("vc-full-width-row-single vc-full-width-row",function(t,i){0<jQuery("body").find(".modula").length&&jQuery(window).trigger("modula-update")}),function(d,a,c,t){var o="modulaGallery",e={resizer:"/",margin:10,keepArea:!0,type:"creative-gallery",columns:12,gutter:10,enableTwitter:!1,enableFacebook:!1,enableGplus:!1,enablePinterest:!1,enableLinkedin:!1,lazyLoad:0};function s(t,i){this.element=t,this.$element=d(t),this.$itemsCnt=this.$element.find(".modula-items"),this.$items=this.$itemsCnt.find(".modula-item"),this.options=d.extend({},e,i),this._defaults=e,this._name=o,this.tiles=[],this.$tilesCnt=null,this.completed=!1,this.lastWidth=0,this.resizeTO=0,this.isPackeryActive=!1,this.init()}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 h,t=this.$element.width(),r=this,l=this.options.columns,i=c.documentElement.clientWidth;"1"==this.options.enableResponsive&&(i<=568?l=this.options.mobileColumns:i<=768&&(l=this.options.tabletColumns)),h=0<this.options.gutter?(t-this.options.gutter*(l-1))/l:Math.floor(t/l*1e3)/1e3,this.$items.not(".jtg-hidden").each(function(t,i){var e,n,o,s,a={};e=d(i).data("width"),n=d(i).data("height"),12<e&&(e=12),"1"==r.options.enableResponsive&&(o=e,s=n,1==l?n=(e=1)*s/o:((e=Math.round(l*o/12))<1&&(e=1),(n=Math.round(e*s/o))<1&&(n=1))),a.width=h*e+r.options.gutter*(e-1),a.height=Math.round(h)*n+r.options.gutter*(n-1),d(i).data("size",a).addClass("tiled").addClass(a.width>a.height?"tile-h":"tile-v").data("position"),d(i).css(d(i).data("size")),d(i).find(".figc").css({width:d(i).data("size").width,height:d(i).data("size").height})}),this.isPackeryActive&&this.$itemsCnt.packery("destroy"),this.$itemsCnt.packery({itemSelector:".modula-item",gutter:parseInt(r.options.gutter),columnWidth:h,resize:!1}),this.isPackeryActive=!0},s.prototype.createGrid=function(){var n=this;this.options.width&&this.$itemsCnt.width(this.options.width),this.options.height&&this.$itemsCnt.height(this.options.height),this.$itemsCnt.data("area",this.$itemsCnt.width()*this.$itemsCnt.height()),this.lastWidth=this.$itemsCnt.width();for(var t=0;t<this.$items.not(".jtg-hidden").length;t++)this.tiles.push(n.getSlot());this.tiles.sort(function(t,i){return t.position-i.position}),this.$items.not(".jtg-hidden").each(function(t,i){var e=n.tiles[t];d(i).data("size",e).addClass("tiled").addClass(e.width>e.height?"tile-h":"tile-v").data("position")}),this.$items.each(function(t,i){d(i).css(d(i).data("size")),d(i).find(".figc").css({width:d(i).data("size").width,height:d(i).data("size").height})}),this.completed=!0},s.prototype.getSlot=function(){if(0==this.tiles.length)return e={top:0,left:0,width:this.$itemsCnt.width(),height:this.$itemsCnt.height(),area:this.$itemsCnt.width()*this.$itemsCnt.height(),position:0};for(var t=0,i=0;i<this.tiles.length;i++){(e=this.tiles[i]).area>this.tiles[t].area&&(t=i)}var e={},n=this.tiles[t];if(n.width>n.height){var o=n.width/2*this.options.randomFactor;n.prevWidth=n.width,n.width=Math.floor(n.width/2+o*(Math.random()-.5)),e={top:n.top,left:n.left+n.width+this.options.margin,width:n.prevWidth-n.width-this.options.margin,height:n.height}}else{o=n.height/2*this.options.randomFactor;n.prevHeight=n.height,n.height=Math.floor(n.height/2+o*(Math.random()-.5)),e={left:n.left,top:n.top+n.height+this.options.margin,width:n.width,height:n.prevHeight-n.height-this.options.margin}}return e.area=e.width*e.height,e.position=1e3*e.top+e.left,n.position=1e3*n.top+n.left,this.tiles[t]=n,this.tiles[t].area=n.width*n.height,e},s.prototype.reset=function(){var e=this;e.tiles=[],"custom-grid"===e.options.type?(e.createCustomGallery(),e.$itemsCnt.packery()):"creative-gallery"==this.options.type&&e.createGrid(),e.$itemsCnt.find(".pic").each(function(t,i){e.placeImage(t)}),e.lastWidth=e.$itemsCnt.width()},s.prototype.onResize=function(i){i.lastWidth!=i.$itemsCnt.width()&&(clearTimeout(i.resizeTO),i.resizeTO=setTimeout(function(){if(i.options.keepArea){var t=i.$itemsCnt.data("area");i.$itemsCnt.height(t/i.$itemsCnt.width())}i.reset()},100))},s.prototype.placeImage=function(t){var i=this.$items.eq(t),e=i.find(".pic"),n=i.data("size"),o=e.data("size");if(e.parent()!=i&&(n={width:e.parent().width(),height:e.parent().height()}),void 0!==n&&void 0!==o){var s=n.width/n.height,a=o.width/o.height,h=e.data("valign")?e.data("valign"):"middle",r=e.data("halign")?e.data("halign"):"center",l={top:"auto",bottom:"auto",left:"auto",right:"auto",width:"auto",height:"auto",margin:"0",maxWidth:"999em"};if(a<s)switch(l.width=n.width,l.left=0,h){case"top":l.top=0;break;case"middle":l.top=0-(n.width*(1/a)-n.height)/2;break;case"bottom":l.bottom=0}else switch(l.height=n.height,l.top=0,r){case"left":l.left=0;break;case"center":l.left=0-(n.height*a-n.width)/2;break;case"right":l.right=0}e.css(l)}},s.prototype.loadImage=function(t){var i=this,e=i.$items.eq(t).find(".pic"),n=new Image;n.onerror=function(){console.log("error loading image ["+t+"] : "+this.src),t+1<i.$items.length&&i.loadImage(t+1)},n.onload=function(){e.data("size",{width:this.width,height:this.height}),i.placeImage(t),i.$items.eq(t).addClass("tg-loaded"),t+1<i.$items.length&&i.loadImage(t+1)};var o=e.data("src");n.src=o,e.attr("src",o)},s.prototype.init=function(){var o=this;d(c).trigger("modula_api_before_init",[o]),this.$itemsCnt.css({position:"relative",zIndex:1,"min-height":"10px"}),this.$items.addClass("tile"),this.$items.find(".pic").removeAttr("src"),"custom-grid"===this.options.type?this.createCustomGallery():"creative-gallery"==this.options.type&&this.createGrid(),"1"!=o.options.lazyLoad&&this.loadImage(0),d(a).resize(function(){o.onResize(o)}),d(a).on("modula-update",function(){o.onResize(o)}),d(c).on("lazyloaded",function(t){var i,e,n=d(t.target);"modula"==n.data("source")&&(n.data("size",{width:n.width(),height:n.height()}),(i=n.parents(".modula-item")).addClass("tg-loaded"),e=o.$items.index(i),o.placeImage(e))}),this.setupSocial(),this.options.onComplete&&this.options.onComplete(),d(c).trigger("modula_api_after_init",[o])},s.prototype.setupSocial=function(){this.options.enableTwitter&&i(this.$items,this),this.options.enableFacebook&&n(this.$items,this),this.options.enablePinterest&&r(this.$items,this),this.options.enableLinkedin&&l(this.$items,this),this.options.enableWhatsapp&&h(this.$items,this)},s.prototype.destroy=function(){this.isPackeryActive&&(this.$itemsCnt.packery("destroy"),this.isPackeryActive=!1)};var i=function(t,n){t.find(".modula-icon-twitter").click(function(t){t.preventDefault();var i=d(this).parents(".tile:first").find(".caption"),e=n.options.twitterText||c.title;return!n.options.twitterText&&1==i.length&&0<i.text().length&&(e=d.trim(i.text())),a.open("https://twitter.com/intent/tweet?url="+encodeURI(location.href.split("#")[0])+"&text="+encodeURI(e),"ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1})},n=function(t,o){t.find(".modula-icon-facebook").click(function(t){t.preventDefault();var i=d(this).parents(".tile:first").find(".pic"),e=d(this).parents(".tile:first").find(".caption");o.options.facebookText||c.title;!o.options.facebookText&&1==e.length&&0<e.text().length&&d.trim(e.text());i.attr("src");var n="//www.facebook.com/sharer.php?u="+location.href;return a.open(n,"ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1})},h=function(t,e){t.find(".modula-icon-whatsapp").click(function(t){t.preventDefault();var i=d(this).parents(".tile:first").find(".caption");e.options.whatsappText||c.title;return!e.options.whatsappText&&1==i.length&&0<i.text().length&&d.trim(i.text()),a.open("https://api.whatsapp.com/send?text="+encodeURI(a.location.href.split("#")[0])+"&preview_url=true","ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1})},r=function(t,s){t.find(".modula-icon-pinterest").click(function(t){t.preventDefault();var i=d(this).parents(".tile:first").find(".pic"),e=d(this).parents(".tile:first").find(".caption"),n=s.options.facebookText||c.title;!s.options.facebookText&&1==e.length&&0<e.text().length&&(n=d.trim(e.text()));var o="http://pinterest.com/pin/create/button/?url="+encodeURI(location.href)+"&description="+encodeURI(n);1==i.length&&(o+="&media="+function(t){var i=c.createElement("img");return i.src=t,t=i.src,i.src=null,t}(i.attr("src")));return a.open(o,"ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1})},l=function(t,i){t.find(".modula-icon-linkedin").click(function(t){t.preventDefault();var i="//linkedin.com/shareArticle?mini=true&url="+ +encodeURI(location.href);return a.open(i,"ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1})};d.fn[o]=function(i){var e,n=arguments;return i===t||"object"==typeof i?this.each(function(){d.data(this,"plugin_"+o)||d.data(this,"plugin_"+o,new s(this,i))}):"string"==typeof i&&"_"!==i[0]&&"init"!==i?(this.each(function(){var t=d.data(this,"plugin_"+o);t instanceof s&&"function"==typeof t[i]&&(e=t[i].apply(t,Array.prototype.slice.call(n,1))),"destroy"===i&&d.data(this,"plugin_"+o,null)}),e!==t?e:this):void 0}}(jQuery,window,document),jQuery(document).ready(function(e){var t=e(".modula-gallery");e.each(t,function(){var t=e(this).attr("id"),i=e(this).data("config");e("#"+t).modulaGallery(i)})}),jQuery(".modula-item").on("click",function(t){function i(){this.event.preventDefault(),jQuery(".lb-close").click(),this.window.location.hash=""}window.location.hash="#",window.addEventListener("popstate",i,!1),window.addEventListener("backbutton",i,!1)});
1
"use strict";!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.ResizeSensor=t()}("undefined"!=typeof window?window:this,function(){if("undefined"==typeof window)return null;var e=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){return window.setTimeout(e,20)};function t(e,t){var i=Object.prototype.toString.call(e),n="[object Array]"===i||"[object NodeList]"===i||"[object HTMLCollection]"===i||"[object Object]"===i||"undefined"!=typeof jQuery&&e instanceof jQuery||"undefined"!=typeof Elements&&e instanceof Elements,o=0,s=e.length;if(n)for(;o<s;o++)t(e[o]);else t(e)}function i(e){if(!e.getBoundingClientRect)return{width:e.offsetWidth,height:e.offsetHeight};var t=e.getBoundingClientRect();return{width:Math.round(t.width),height:Math.round(t.height)}}var n=function(o,s){function r(){var e,t,i=[];this.add=function(e){i.push(e)},this.call=function(){for(e=0,t=i.length;e<t;e++)i[e].call()},this.remove=function(n){var o=[];for(e=0,t=i.length;e<t;e++)i[e]!==n&&o.push(i[e]);i=o},this.length=function(){return i.length}}t(o,function(t){!function(t,n){if(t)if(t.resizedAttached)t.resizedAttached.add(n);else{t.resizedAttached=new r,t.resizedAttached.add(n),t.resizeSensor=document.createElement("div"),t.resizeSensor.dir="ltr",t.resizeSensor.className="resize-sensor";var o="position: absolute; left: -10px; top: -10px; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;",s="position: absolute; left: 0; top: 0; transition: 0s;";t.resizeSensor.style.cssText=o,t.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="'+o+'"><div style="'+s+'"></div></div><div class="resize-sensor-shrink" style="'+o+'"><div style="'+s+' width: 200%; height: 200%"></div></div>',t.appendChild(t.resizeSensor);var d=window.getComputedStyle(t).getPropertyPriority("position");"absolute"!==d&&"relative"!==d&&"fixed"!==d&&(t.style.position="relative");var c,l,a=t.resizeSensor.childNodes[0],h=a.childNodes[0],f=t.resizeSensor.childNodes[1],u=i(t),v=u.width,p=u.height,z=function(){var e=0===t.offsetWidth&&0===t.offsetHeight;if(e){var i=t.style.display;t.style.display="block"}h.style.width="100000px",h.style.height="100000px",a.scrollLeft=1e5,a.scrollTop=1e5,f.scrollLeft=1e5,f.scrollTop=1e5,e&&(t.style.display=i)};t.resizeSensor.resetSensor=z;var y=function(){l=0,c&&(v=void 0,p=void 0,t.resizedAttached&&t.resizedAttached.call())},w=function(){var n=i(t),o=n.width,s=n.height;(c=o!=v||s!=p)&&!l&&(l=e(y)),z()},g=function(e,t,i){e.attachEvent?e.attachEvent("on"+t,i):e.addEventListener(t,i)};g(a,"scroll",w),g(f,"scroll",w),e(z)}}(t,s)}),this.detach=function(e){n.detach(o,e)},this.reset=function(){o.resizeSensor.resetSensor()}};return n.reset=function(e,i){t(e,function(e){e.resizeSensor.resetSensor()})},n.detach=function(e,i){t(e,function(e){e&&(e.resizedAttached&&"function"==typeof i&&(e.resizedAttached.remove(i),e.resizedAttached.length())||e.resizeSensor&&(e.contains(e.resizeSensor)&&e.removeChild(e.resizeSensor),delete e.resizeSensor,delete e.resizedAttached))})},n});
2
+ function tg_getURLParameter(t){return decodeURIComponent((new RegExp("[?|&]"+t+"=([^&;]+?)(&|#|;|$)").exec(location.search)||[,""])[1].replace(/\+/g,"%20"))||null}jQuery(document).on("vc-full-width-row-single vc-full-width-row",function(t,i){0<jQuery("body").find(".modula").length&&jQuery(window).trigger("modula-update")}),jQuery(window).on("elementor/frontend/init",function(){window.elementorFrontend&&window.elementorFrontend.hooks.addAction("frontend/element_ready/global",function(t){0<jQuery("body").find(".modula").length&&jQuery(window).trigger("modula-update")})}),function(d,a,c,t){var o="modulaGallery",e={resizer:"/",margin:10,keepArea:!0,type:"creative-gallery",columns:12,gutter:10,enableTwitter:!1,enableFacebook:!1,enableGplus:!1,enablePinterest:!1,enableLinkedin:!1,lazyLoad:0};function s(t,i){this.element=t,this.$element=d(t),this.$itemsCnt=this.$element.find(".modula-items"),this.$items=this.$itemsCnt.find(".modula-item"),this.options=d.extend({},e,i),this._defaults=e,this._name=o,this.tiles=[],this.$tilesCnt=null,this.completed=!1,this.lastWidth=0,this.resizeTO=0,this.isPackeryActive=!1,this.init()}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 h,t=this.$element.width(),r=this,l=this.options.columns,i=c.documentElement.clientWidth;"1"==this.options.enableResponsive&&(i<=568?l=this.options.mobileColumns:i<=768&&(l=this.options.tabletColumns)),h=0<this.options.gutter?(t-this.options.gutter*(l-1))/l:Math.floor(t/l*1e3)/1e3,this.$items.not(".jtg-hidden").each(function(t,i){var e,n,o,s,a={};e=d(i).data("width"),n=d(i).data("height"),12<e&&(e=12),"1"==r.options.enableResponsive&&(o=e,s=n,1==l?n=(e=1)*s/o:((e=Math.round(l*o/12))<1&&(e=1),(n=Math.round(e*s/o))<1&&(n=1))),a.width=h*e+r.options.gutter*(e-1),a.height=Math.round(h)*n+r.options.gutter*(n-1),d(i).data("size",a).addClass("tiled").addClass(a.width>a.height?"tile-h":"tile-v").data("position"),d(i).css(d(i).data("size")),d(i).find(".figc").css({width:d(i).data("size").width,height:d(i).data("size").height})}),this.isPackeryActive&&this.$itemsCnt.packery("destroy"),this.$itemsCnt.packery({itemSelector:".modula-item",gutter:parseInt(r.options.gutter),columnWidth:h,resize:!1}),this.isPackeryActive=!0},s.prototype.createGrid=function(){var n=this;this.options.width&&this.$itemsCnt.width(this.options.width),this.options.height&&this.$itemsCnt.height(this.options.height),this.$itemsCnt.data("area",this.$itemsCnt.width()*this.$itemsCnt.height()),this.lastWidth=this.$itemsCnt.width();for(var t=0;t<this.$items.not(".jtg-hidden").length;t++)this.tiles.push(n.getSlot());this.tiles.sort(function(t,i){return t.position-i.position}),this.$items.not(".jtg-hidden").each(function(t,i){var e=n.tiles[t];d(i).data("size",e).addClass("tiled").addClass(e.width>e.height?"tile-h":"tile-v").data("position")}),this.$items.each(function(t,i){d(i).css(d(i).data("size")),d(i).find(".figc").css({width:d(i).data("size").width,height:d(i).data("size").height})}),this.completed=!0},s.prototype.getSlot=function(){if(0==this.tiles.length)return e={top:0,left:0,width:this.$itemsCnt.width(),height:this.$itemsCnt.height(),area:this.$itemsCnt.width()*this.$itemsCnt.height(),position:0};for(var t=0,i=0;i<this.tiles.length;i++){(e=this.tiles[i]).area>this.tiles[t].area&&(t=i)}var e={},n=this.tiles[t];if(n.width>n.height){var o=n.width/2*this.options.randomFactor;n.prevWidth=n.width,n.width=Math.floor(n.width/2+o*(Math.random()-.5)),e={top:n.top,left:n.left+n.width+this.options.margin,width:n.prevWidth-n.width-this.options.margin,height:n.height}}else{o=n.height/2*this.options.randomFactor;n.prevHeight=n.height,n.height=Math.floor(n.height/2+o*(Math.random()-.5)),e={left:n.left,top:n.top+n.height+this.options.margin,width:n.width,height:n.prevHeight-n.height-this.options.margin}}return e.area=e.width*e.height,e.position=1e3*e.top+e.left,n.position=1e3*n.top+n.left,this.tiles[t]=n,this.tiles[t].area=n.width*n.height,e},s.prototype.reset=function(){var e=this;e.tiles=[],"custom-grid"===e.options.type?(e.createCustomGallery(),e.$itemsCnt.packery()):"creative-gallery"==this.options.type&&e.createGrid(),e.$itemsCnt.find(".pic").each(function(t,i){e.placeImage(t)}),e.lastWidth=e.$itemsCnt.width()},s.prototype.onResize=function(i){i.lastWidth!=i.$itemsCnt.width()&&(clearTimeout(i.resizeTO),i.resizeTO=setTimeout(function(){if(i.options.keepArea){var t=i.$itemsCnt.data("area");i.$itemsCnt.height(t/i.$itemsCnt.width())}i.reset()},100))},s.prototype.placeImage=function(t){var i=this.$items.eq(t),e=i.find(".pic"),n=i.data("size"),o=e.data("size");if(e.parent()!=i&&(n={width:e.parent().width(),height:e.parent().height()}),void 0!==n&&void 0!==o){var s=n.width/n.height,a=o.width/o.height,h=e.data("valign")?e.data("valign"):"middle",r=e.data("halign")?e.data("halign"):"center",l={top:"auto",bottom:"auto",left:"auto",right:"auto",width:"auto",height:"auto",margin:"0",maxWidth:"999em"};if(a<s)switch(l.width=n.width,l.left=0,h){case"top":l.top=0;break;case"middle":l.top=0-(n.width*(1/a)-n.height)/2;break;case"bottom":l.bottom=0}else switch(l.height=n.height,l.top=0,r){case"left":l.left=0;break;case"center":l.left=0-(n.height*a-n.width)/2;break;case"right":l.right=0}e.css(l)}},s.prototype.loadImage=function(t){var i=this,e=i.$items.eq(t).find(".pic"),n=new Image;n.onerror=function(){console.log("error loading image ["+t+"] : "+this.src),t+1<i.$items.length&&i.loadImage(t+1)},n.onload=function(){e.data("size",{width:this.width,height:this.height}),i.placeImage(t),i.$items.eq(t).addClass("tg-loaded"),t+1<i.$items.length&&i.loadImage(t+1)};var o=e.data("src");n.src=o,e.attr("src",o)},s.prototype.init=function(){var o=this;d(c).trigger("modula_api_before_init",[o]),this.$itemsCnt.css({position:"relative",zIndex:1,"min-height":"10px"}),this.$items.addClass("tile"),this.$items.find(".pic").removeAttr("src"),"custom-grid"===this.options.type?this.createCustomGallery():"creative-gallery"==this.options.type&&this.createGrid(),"1"!=o.options.lazyLoad&&this.loadImage(0),d(a).resize(function(){o.onResize(o)}),d(a).on("modula-update",function(){o.onResize(o)}),d(c).on("lazyloaded",function(t){var i,e,n=d(t.target);"modula"==n.data("source")&&(n.data("size",{width:n.width(),height:n.height()}),(i=n.parents(".modula-item")).addClass("tg-loaded"),e=o.$items.index(i),o.placeImage(e))}),this.setupSocial(),this.options.onComplete&&this.options.onComplete(),d(c).trigger("modula_api_after_init",[o])},s.prototype.setupSocial=function(){this.options.enableTwitter&&i(this.$items,this),this.options.enableFacebook&&n(this.$items,this),this.options.enablePinterest&&r(this.$items,this),this.options.enableLinkedin&&l(this.$items,this),this.options.enableWhatsapp&&h(this.$items,this)},s.prototype.destroy=function(){this.isPackeryActive&&(this.$itemsCnt.packery("destroy"),this.isPackeryActive=!1)};var i=function(t,n){t.find(".modula-icon-twitter").click(function(t){t.preventDefault();var i=d(this).parents(".tile:first").find(".caption"),e=n.options.twitterText||c.title;return!n.options.twitterText&&1==i.length&&0<i.text().length&&(e=d.trim(i.text())),a.open("https://twitter.com/intent/tweet?url="+encodeURI(location.href.split("#")[0])+"&text="+encodeURI(e),"ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1})},n=function(t,o){t.find(".modula-icon-facebook").click(function(t){t.preventDefault();var i=d(this).parents(".tile:first").find(".pic"),e=d(this).parents(".tile:first").find(".caption");o.options.facebookText||c.title;!o.options.facebookText&&1==e.length&&0<e.text().length&&d.trim(e.text());i.attr("src");var n="//www.facebook.com/sharer.php?u="+location.href;return a.open(n,"ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1})},h=function(t,e){t.find(".modula-icon-whatsapp").click(function(t){t.preventDefault();var i=d(this).parents(".tile:first").find(".caption");e.options.whatsappText||c.title;return!e.options.whatsappText&&1==i.length&&0<i.text().length&&d.trim(i.text()),a.open("https://api.whatsapp.com/send?text="+encodeURI(a.location.href.split("#")[0])+"&preview_url=true","ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1})},r=function(t,s){t.find(".modula-icon-pinterest").click(function(t){t.preventDefault();var i=d(this).parents(".tile:first").find(".pic"),e=d(this).parents(".tile:first").find(".caption"),n=s.options.facebookText||c.title;!s.options.facebookText&&1==e.length&&0<e.text().length&&(n=d.trim(e.text()));var o="http://pinterest.com/pin/create/button/?url="+encodeURI(location.href)+"&description="+encodeURI(n);1==i.length&&(o+="&media="+function(t){var i=c.createElement("img");return i.src=t,t=i.src,i.src=null,t}(i.attr("src")));return a.open(o,"ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1})},l=function(t,i){t.find(".modula-icon-linkedin").click(function(t){t.preventDefault();var i="//linkedin.com/shareArticle?mini=true&url="+ +encodeURI(location.href);return a.open(i,"ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1})};d.fn[o]=function(i){var e,n=arguments;return i===t||"object"==typeof i?this.each(function(){d.data(this,"plugin_"+o)||d.data(this,"plugin_"+o,new s(this,i))}):"string"==typeof i&&"_"!==i[0]&&"init"!==i?(this.each(function(){var t=d.data(this,"plugin_"+o);t instanceof s&&"function"==typeof t[i]&&(e=t[i].apply(t,Array.prototype.slice.call(n,1))),"destroy"===i&&d.data(this,"plugin_"+o,null)}),e!==t?e:this):void 0}}(jQuery,window,document),jQuery(document).ready(function(e){var t=e(".modula-gallery");e.each(t,function(){var t=e(this).attr("id"),i=e(this).data("config");e("#"+t).modulaGallery(i)})});
assets/js/modula-importer.js ADDED
@@ -0,0 +1,227 @@
1
+ (function ($) {
2
+ "use strict";
3
+
4
+
5
+ /**
6
+ * Modula Importer
7
+ *
8
+ * @type {{init: init, runAjaxs: runAjaxs, ajaxTimeout: null, counts: number, processAjax: processAjax, ajaxRequests: [], completed: number, updateImported: updateImported, ajaxStarted: number, source: string}}
9
+ */
10
+ var modulaImporter = {
11
+ counts: 0,
12
+ completed: 0,
13
+ ajaxRequests: [],
14
+ ajaxStarted: 0,
15
+ ajaxTimeout: null,
16
+ source: '',
17
+ modulaGalleryIds: {},
18
+
19
+
20
+ init: function () {
21
+
22
+ $('.modula-importer-wrapper input[type="submit"]').click(function (e) {
23
+ e.preventDefault();
24
+ modulaImporter.source = $(this).parents('.modula-importer-wrapper').attr('source');
25
+ modulaImporter.completed = 0;
26
+
27
+ // Check if gallery was selected
28
+ var galleries = $('#modula_importer_' + modulaImporter.source + ' input[name=gallery]:checked');
29
+ if ( 0 == galleries.length ) {
30
+ alert(modula_importer.empty_gallery_selection);
31
+ return false;
32
+ }
33
+
34
+ // Disable input
35
+ $('#modula_importer_' + modulaImporter.source + ' :input').prop('disabled', true);
36
+
37
+ // Get array of IDs
38
+ var id_array = [];
39
+ $(galleries).each(function (i) {
40
+ if ( 'wp_core' == modulaImporter.source ) {
41
+ id_array[i] = $(this).attr('data-id');
42
+ } else {
43
+ id_array[i] = $(this).val();
44
+ }
45
+
46
+ });
47
+
48
+ modulaImporter.counts = id_array.length;
49
+ modulaImporter.processAjax(id_array);
50
+
51
+ });
52
+
53
+ },
54
+
55
+ processAjax: function (galleries_ids) {
56
+
57
+ var delete_entries = 'keep';
58
+
59
+ if ( $('#delete-old-entries').prop('checked') ) {
60
+ delete_entries = 'delete';
61
+ }
62
+
63
+ galleries_ids.forEach(function (gallery_id) {
64
+
65
+ var status = $('#modula_importer_' + modulaImporter.source + ' label[data-id=' + gallery_id + ']');
66
+ var id = gallery_id;
67
+ var $gallery_title = false;
68
+ $(status).removeClass().addClass('importing');
69
+ $('span', $(status)).html(modula_importer.importing);
70
+ // For WP core galleries in case we have multiple galleries in same page
71
+ if('wp_core' == modulaImporter.source){
72
+ $gallery_title = $('input#wp_core-galleries-'+id).next('a').text();
73
+ }
74
+
75
+ if ( 'wp_core' == modulaImporter.source ) {
76
+ id = JSON.parse($('#modula_importer_wp_core input[data-id=' + gallery_id + ']').val());
77
+ }
78
+
79
+ var opts = {
80
+ url: modula_importer.ajax,
81
+ type: 'post',
82
+ async: true,
83
+ cache: false,
84
+ dataType: 'json',
85
+ data: {
86
+ action: 'modula_importer_' + modulaImporter.source + '_gallery_import',
87
+ id: id,
88
+ nonce: modula_importer.nonce,
89
+ clean: delete_entries,
90
+ gallery_title : $gallery_title
91
+ },
92
+ success: function (response) {
93
+
94
+ modulaImporter.completed = modulaImporter.completed + 1;
95
+
96
+ if ( !response.success ) {
97
+ status.find('span').text(response.message);
98
+
99
+ // don't need to updateImported for core galleries
100
+ if ( modulaImporter.counts == modulaImporter.completed && 'wp_core' != modulaImporter.source ) {
101
+ modulaImporter.updateImported(false, delete_entries);
102
+
103
+ }
104
+ return;
105
+ }
106
+
107
+ modulaImporter.modulaGalleryIds[gallery_id] = response.modula_gallery_id;
108
+
109
+ // Display result from AJAX call
110
+ status.find('span').html(response.message);
111
+
112
+ // Remove one ajax from queue
113
+ modulaImporter.ajaxStarted = modulaImporter.ajaxStarted - 1;
114
+
115
+ // don't need to updateImported for core galleries
116
+ if ( modulaImporter.counts == modulaImporter.completed && 'wp_core' != modulaImporter.source ) {
117
+ modulaImporter.updateImported(modulaImporter.modulaGalleryIds, delete_entries);
118
+ }
119
+ }
120
+ };
121
+ modulaImporter.ajaxRequests.push(opts);
122
+
123
+ });
124
+ modulaImporter.runAjaxs();
125
+
126
+ },
127
+
128
+ runAjaxs: function () {
129
+ var currentAjax;
130
+
131
+ while ( modulaImporter.ajaxStarted < 5 && modulaImporter.ajaxRequests.length > 0 ) {
132
+ modulaImporter.ajaxStarted = modulaImporter.ajaxStarted + 1;
133
+ currentAjax = modulaImporter.ajaxRequests.shift();
134
+ $.ajax(currentAjax);
135
+
136
+ }
137
+
138
+ if ( modulaImporter.ajaxRequests.length > 0 ) {
139
+ modulaImporter.ajaxTimeout = setTimeout(function () {
140
+ console.log('Delayed 1s');
141
+ modulaImporter.runAjaxs();
142
+ }, 1000);
143
+ } else {
144
+ $('#modula_importer_' + modulaImporter.source + ' :input').prop('disabled', false);
145
+ }
146
+
147
+ },
148
+ // Update imported galleries
149
+ updateImported: function (galleries_obj, delete_entries) {
150
+
151
+ var data = {
152
+ action: 'modula_importer_' + modulaImporter.source + '_gallery_imported_update',
153
+ galleries: galleries_obj,
154
+ clean: delete_entries,
155
+ nonce: modula_importer.nonce,
156
+ };
157
+
158
+ $.post(ajaxurl, data, function (response) {
159
+ window.location.href = response;
160
+ });
161
+ }
162
+
163
+ };
164
+
165
+ $(document).ready(function () {
166
+
167
+ // Get galleries from sources
168
+ $('#modula_select_gallery_source').on('change', function () {
169
+ var targetID = $(this).val();
170
+
171
+ // Hide the response if user goes through sources again
172
+ if ( $('body').find('.update-complete').length ) {
173
+ $('body').find('.update-complete').hide();
174
+ }
175
+
176
+ var data = {
177
+ action: 'modula_importer_get_galleries',
178
+ nonce: modula_importer.nonce,
179
+ source: targetID
180
+ };
181
+
182
+ $.post(ajaxurl, data, function (response) {
183
+
184
+ if ( !response ) {
185
+ return;
186
+ }
187
+
188
+ $('#modula-' + targetID + '-importer').removeClass('hide');
189
+ $('#modula-' + targetID + '-importer').find('.modula-found-galleries').html(response);
190
+ $('.modula-importer-row').not($('#modula-' + targetID + '-importer')).addClass('hide');
191
+ if ( 'none' != targetID && $('#modula-' + targetID + '-importer').find('input[type="checkbox"]').not('#select-all-' + targetID).length > 0 ) {
192
+ $('.select-all-wrapper').removeClass('hide');
193
+ } else {
194
+ $('#modula-' + targetID + '-importer .modula-importer-upsell-wrapper').addClass('hide');
195
+ $('#modula-' + targetID + '-importer .select-all-checkbox,#modula-' + targetID + '-importer .select-all-checkbox-wrapper').addClass('hide');
196
+ $('#modula-' + targetID + '-importer').find('input[type="submit"]').addClass('hide');
197
+ $('.select-all-wrapper').addClass('hide');
198
+ }
199
+ });
200
+
201
+ });
202
+
203
+ // Select all galleries from respective source
204
+ $('body').on('click', '.modula-all-selection', function (e) {
205
+ e.preventDefault();
206
+
207
+ var checkboxes = $(this).parents('td').find('input[type="checkbox"]');
208
+ if ( '#select_all' == $(this).attr('href') ) {
209
+ checkboxes.each(function () {
210
+ if ( $(this).is(':visible') ) {
211
+ checkboxes.prop('checked', true);
212
+ }
213
+ });
214
+ } else {
215
+ checkboxes.each(function () {
216
+ if ( $(this).is(':visible') ) {
217
+ checkboxes.prop('checked', false);
218
+ }
219
+ });
220
+ }
221
+ });
222
+
223
+ // Init importer
224
+ modulaImporter.init();
225
+ });
226
+
227
+ })(jQuery);
assets/js/wp-modula-conditions.js CHANGED
@@ -21,7 +21,9 @@ var modulaGalleryConditions = Backbone.Model.extend({
21
this.listenTo( wp.Modula.Settings, 'change:lightbox', this.changedLightbox );
22
this.listenTo( wp.Modula.Settings, 'change:disableSocial', this.disableSocial );
23
this.listenTo( wp.Modula.Settings, 'change:cursor', this.changedCursor );
24
-
25
},
26
27
initValues: function(){
@@ -31,6 +33,9 @@ var modulaGalleryConditions = Backbone.Model.extend({
31
this.changedCursor( false, wp.Modula.Settings.get( 'cursor' ) );
32
this.changedLightbox( false, wp.Modula.Settings.get( 'lightbox' ) );
33
this.disableSocial (false, wp.Modula.Settings.get('disableSocial') );
34
},
35
36
changedType: function( settings, value ){
@@ -96,6 +101,36 @@ var modulaGalleryConditions = Backbone.Model.extend({
96
rows.filter( '[data-container="enableTwitter"],[data-container="enableWhatsapp"],[data-container="enableFacebook"],[data-container="enableLinkedin"],[data-container="enablePinterest"],[data-container="socialIconColor"],[data-container="socialIconSize"], [data-container="socialIconPadding"]').prop('checked',1).show();
97
98
}
99
}
100
101
})
21
this.listenTo( wp.Modula.Settings, 'change:lightbox', this.changedLightbox );
22
this.listenTo( wp.Modula.Settings, 'change:disableSocial', this.disableSocial );
23
this.listenTo( wp.Modula.Settings, 'change:cursor', this.changedCursor );
24
+ this.listenTo( wp.Modula.Settings, 'change:enable_responsive', this.changedResponsiveness );
25
+ this.listenTo( wp.Modula.Settings, 'change:hide_title', this.hideTitle);
26
+ this.listenTo( wp.Modula.Settings, 'change:hide_description', this.hideCaption);
27
},
28
29
initValues: function(){
33
this.changedCursor( false, wp.Modula.Settings.get( 'cursor' ) );
34
this.changedLightbox( false, wp.Modula.Settings.get( 'lightbox' ) );
35
this.disableSocial (false, wp.Modula.Settings.get('disableSocial') );
36
+ this.changedResponsiveness ( false, wp.Modula.Settings.get('enable_responsive') );
37
+ this.hideTitle ( false, wp.Modula.Settings.get( 'hide_title' ) );
38
+ this.hideCaption ( false, wp.Modula.Settings.get( 'hide_description') );
39
},
40
41
changedType: function( settings, value ){
101
rows.filter( '[data-container="enableTwitter"],[data-container="enableWhatsapp"],[data-container="enableFacebook"],[data-container="enableLinkedin"],[data-container="enablePinterest"],[data-container="socialIconColor"],[data-container="socialIconSize"], [data-container="socialIconPadding"]').prop('checked',1).show();
102
103
}
104
+ },
105
+
106
+ changedResponsiveness: function( settings, value){
107
+ var rows = this.get( 'rows' );
108
+
109
+ if( 1 == value ) {
110
+ rows.filter( '[data-container="tablet_columns"],[data-container="mobile_columns"]').show();
111
+ }else {
112
+ rows.filter( '[data-container="tablet_columns"],[data-container="mobile_columns"]').hide();
113
+ }
114
+ },
115
+
116
+ hideTitle: function( settings, value ) {
117
+ var rows = this.get( 'rows' );
118
+
119
+ if( 1 == value ) {
120
+ rows.filter( '[data-container="titleColor"],[data-container="titleFontSize"],[data-container="mobileTitleFontSize"]').hide();
121
+ }else {
122
+ rows.filter( '[data-container="titleColor"],[data-container="titleFontSize"],[data-container="mobileTitleFontSize"]').show();
123
+ }
124
+ },
125
+
126
+ hideCaption: function( settings, value ) {
127
+ var rows = this.get( 'rows' );
128
+
129
+ if( 1 == value ) {
130
+ rows.filter( '[data-container="captionColor"],[data-container="captionFontSize"],[data-container="mobileCaptionFontSize"]').hide();
131
+ }else {
132
+ rows.filter( '[data-container="captionColor"],[data-container="captionFontSize"],[data-container="mobileCaptionFontSize"]').show();
133
+ }
134
}
135
136
})
changelog.txt CHANGED
@@ -1,3 +1,16 @@
1
= 2.2.6 - 18/02/2020 =
2
Improved Custom CSS textarea
3
Improved how the lightbox closes
1
+ = 2.2.7 - 09/03/2020 =
2
+ Fixed incompatibility with Elementor stretched rows.
3
+ Fixed incompatibility with isotope.js
4
+ Renamed our registered files name
5
+ Fixed title/caption font size to reflect theme default
6
+ Fixed scroll to top when opening lightbox
7
+ If Title/Caption is hidden then hide settings also
8
+ Hide settings if toggle is OFF for custom responsiveness
9
+ Added Migrate functionality. Now it's easier to migrate from another gallery to Modula
10
+ Improved social media icons in preview
11
+ Delete resized images when deleting attachment
12
+ Added Import/Export sub-menu entry and tutorial
13
+
14
= 2.2.6 - 18/02/2020 =
15
Improved Custom CSS textarea
16
Improved how the lightbox closes
includes/admin/class-modula-admin.php CHANGED
@@ -22,6 +22,47 @@ class Modula_Admin {
22
23
add_action( 'wp_ajax_modula_save_images', array( $this, 'save_images' ) );
24
add_action( 'wp_ajax_modula_save_image', array( $this, 'save_image' ) );
25
26
}
27
@@ -38,6 +79,8 @@ class Modula_Admin {
38
39
add_submenu_page( 'edit.php?post_type=modula-gallery', esc_html__( 'Extensions', 'modula-best-grid-gallery' ), esc_html__( 'Extensions', 'modula-best-grid-gallery' ), 'manage_options', 'modula-addons', array( $this, 'show_addons' ) );
40
41
}
42
43
public function show_submenu() {
@@ -259,6 +302,26 @@ class Modula_Admin {
259
260
<?php
261
}
262
}
263
264
new Modula_Admin();
22
23
add_action( 'wp_ajax_modula_save_images', array( $this, 'save_images' ) );
24
add_action( 'wp_ajax_modula_save_image', array( $this, 'save_image' ) );
25
+ add_action( 'delete_attachment', array( $this, 'delete_resized_image') ) ;
26
+
27
+
28
+ }
29
+
30
+ public function delete_resized_image( $post_id ) {
31
+
32
+ $post = get_post( $post_id );
33
+
34
+ if ( 'attachment' !== $post->post_type ) {
35
+ return false;
36
+ }
37
+
38
+ // Get the metadata
39
+ $metadata = wp_get_attachment_metadata( $post_id );
40
+ if ( ! $metadata ) {
41
+ return;
42
+ }
43
+ $info = pathinfo( $metadata['file'] );
44
+ $uploads = wp_upload_dir();
45
+ $filename = $info['filename'];
46
+ $file_dir = $uploads['basedir'] .'/'. $info['dirname'];
47
+ $ext = $info['extension'];
48
+
49
+ if ( ! isset( $metadata['image_meta']['resized_images'] ) ) {
50
+ return;
51
+ }
52
+
53
+ if ( count( $metadata['image_meta']['resized_images'] ) > 0 ) {
54
+
55
+ foreach ( $metadata['image_meta']['resized_images'] as $value ) {
56
+ $size = "-" . $value;
57
+
58
+ // Format the files in the appropriate format
59
+ $file = $file_dir . '/' . $filename . $size . '.' . $ext;
60
+ // Delete found files
61
+ wp_delete_file_from_directory( $file, $file_dir);
62
+
63
+ }
64
+
65
+ }
66
67
}
68
79
80
add_submenu_page( 'edit.php?post_type=modula-gallery', esc_html__( 'Extensions', 'modula-best-grid-gallery' ), esc_html__( 'Extensions', 'modula-best-grid-gallery' ), 'manage_options', 'modula-addons', array( $this, 'show_addons' ) );
81
82
+ add_submenu_page( 'edit.php?post_type=modula-gallery', esc_html__( 'Import/Export', 'modula-best-grid-gallery' ), esc_html__( 'Import/Export', 'modula-best-grid-gallery' ), 'manage_options', 'modula-import-export', array( $this, 'import_export_doc' ) );
83
+
84
}
85
86
public function show_submenu() {
302
303
<?php
304
}
305
+
306
+ /**
307
+ * Add Import/Export tutorial
308
+ *
309
+ * @since 2.2.7
310
+ */
311
+ public function import_export_doc() {
312
+ ?>
313
+ <div class="wrap">
314
+ <h3><?php esc_html_e('Import Galleries','modula-best-grid-gallery'); ?></h3>
315
+ <p><?php esc_html_e('In order to import exported galleries head over to "Tools -> Import" or click','modula-best-grid-gallery'); ?> <a href="<?php echo admin_url('import.php'); ?>"><?php esc_html_e('here.','mdula-best-grid-gallery'); ?></a></p>
316
+ <p><?php echo '<a href="'.esc_url('https://wordpress.org/plugins/wordpress-importer/').'" target="_blank">'.esc_html__('Install Wordpress Importer','modula-best-grid-gallery').'</a>'.esc_html__('( if not installed ). If installed, click on Wordpress "Run importer". After that select the export file you desire and click "Upload file and import".','modula-best-grid-gallery'); ?></p>
317
+ </div>
318
+ <br />
319
+ <h3><?php esc_html_e('Export Galleries','modula-best-grid-gallery'); ?></h3>
320
+ <p><?php esc_html_e('In order to export Modula galleries head over to "Tools -> Export" or click','modula-best-grid-gallery'); ?> <a href="<?php echo admin_url('export.php'); ?>"><?php esc_html_e('here.','mdula-best-grid-gallery'); ?></a></p>
321
+ <p><?php echo esc_html__('Select "Galleries" and click "Download Export File". An export file will be created and downloaded, which will be used to import the galleries somewhere else.','modula-best-grid-gallery'); ?></p>
322
+ </div>
323
+ <?php
324
+ }
325
}
326
327
new Modula_Admin();
includes/admin/class-modula-cpt-fields-helper.php CHANGED
@@ -281,6 +281,14 @@ class Modula_CPT_Fields_Helper {
281
"description" => esc_html__( 'The title font size in pixels (set to 0 to use the theme defaults).', 'modula-best-grid-gallery' ),
282
'priority' => 40,
283
),
284
"hide_description" => array(
285
"name" => esc_html__( 'Hide Caption', 'modula-best-grid-gallery' ),
286
"type" => "toggle",
@@ -303,14 +311,6 @@ class Modula_CPT_Fields_Helper {
303
"description" => esc_html__( 'The caption font size in pixels (set to 0 to use theme defaults).', 'modula-best-grid-gallery' ),
304
'priority' => 80,
305
),
306
- "mobileTitleFontSize" => array(
307
- "name" => esc_html__( 'Mobile Title Font Size', 'modula-best-grid-gallery' ),
308
- "type" => "number",
309
- "after" => 'px',
310
- "default" => 12,
311
- "description" => esc_html__( 'The title font size in pixels (set to 0 to use the theme defaults) for mobile view.', 'modula-best-grid-gallery' ),
312
- 'priority' => 90,
313
- ),
314
"mobileCaptionFontSize" => array(
315
"name" => esc_html__( 'Mobile Caption Font Size', 'modula-best-grid-gallery' ),
316
"type" => "number",
@@ -371,9 +371,8 @@ class Modula_CPT_Fields_Helper {
371
),
372
"socialIconSize" => array(
373
"name" => esc_html__( 'Size of social sharing icons', 'modula-best-grid-gallery' ),
374
- "type" => "ui-slider",
375
- "min" => 10,
376
- "max" => 20,
377
"description" => esc_html__( '16 will be the default value. '),
378
"default" => 16,
379
'priority' => 50,
281
"description" => esc_html__( 'The title font size in pixels (set to 0 to use the theme defaults).', 'modula-best-grid-gallery' ),
282
'priority' => 40,
283
),
284
+ "mobileTitleFontSize" => array(
285
+ "name" => esc_html__( 'Mobile Title Font Size', 'modula-best-grid-gallery' ),
286
+ "type" => "number",
287
+ "after" => 'px',
288
+ "default" => 12,
289
+ "description" => esc_html__( 'The title font size in pixels (set to 0 to use the theme defaults) for mobile view.', 'modula-best-grid-gallery' ),
290
+ 'priority' => 40,
291
+ ),
292
"hide_description" => array(
293
"name" => esc_html__( 'Hide Caption', 'modula-best-grid-gallery' ),
294
"type" => "toggle",
311
"description" => esc_html__( 'The caption font size in pixels (set to 0 to use theme defaults).', 'modula-best-grid-gallery' ),
312
'priority' => 80,
313
),
314
"mobileCaptionFontSize" => array(
315
"name" => esc_html__( 'Mobile Caption Font Size', 'modula-best-grid-gallery' ),
316
"type" => "number",
371
),
372
"socialIconSize" => array(
373
"name" => esc_html__( 'Size of social sharing icons', 'modula-best-grid-gallery' ),
374
+ "type" => "number",
375
+ "after" => "px",
376
"description" => esc_html__( '16 will be the default value. '),
377
"default" => 16,
378
'priority' => 50,
includes/admin/class-modula-cpt.php CHANGED
@@ -65,28 +65,26 @@ class Modula_CPT {
65
'show_in_rest' => true,
66
) );
67
68
- $this->metaboxes = apply_filters( 'modula_cpt_metaboxes', array(
69
'modula-preview-gallery' => array(
70
- 'title' => esc_html__( 'Gallery', 'modula-best-grid-gallery' ),
71
'callback' => 'output_gallery_images',
72
- 'context' => 'normal',
73
),
74
- 'modula-albums-upsell' => array(
75
- 'title' => esc_html__('Albums Upsell', 'modula-best-grid-gallery'),
76
- 'callback' => 'output_upsell_albums',
77
- 'context' => 'normal',
78
- ),
79
'modula-settings' => array(
80
- 'title' => esc_html__( 'Settings', 'modula-best-grid-gallery' ),
81
'callback' => 'output_gallery_settings',
82
- 'context' => 'normal',
83
),
84
'modula-shortcode' => array(
85
- 'title' => esc_html__( 'Shortcode', 'modula-best-grid-gallery' ),
86
'callback' => 'output_gallery_shortcode',
87
- 'context' => 'side',
88
),
89
- ) );
90
91
$this->cpt_name = apply_filters( 'modula_cpt_name', 'modula-gallery' );
92
@@ -95,11 +93,7 @@ class Modula_CPT {
95
/* Fire our meta box setup function on the post editor screen. */
96
add_action( 'load-post.php', array( $this, 'meta_boxes_setup' ) );
97
add_action( 'load-post-new.php', array( $this, 'meta_boxes_setup' ) );
98
-
99
add_action( 'admin_menu', array($this, 'replace_submit_meta_box') );
100
-
101
-
102
-
103
104
add_filter( 'views_edit-modula-gallery', array( $this, 'add_extensions_tab' ), 10, 1 );
105
@@ -143,11 +137,15 @@ class Modula_CPT {
143
public function add_meta_boxes() {
144
145
global $post;
146
147
foreach ( $this->metaboxes as $metabox_id => $metabox ) {
148
149
if ( 'modula-shortcode' == $metabox_id && 'auto-draft' == $post->post_status ) {
150
- break;
151
}
152
153
add_meta_box(
65
'show_in_rest' => true,
66
) );
67
68
+ $this->metaboxes = array(
69
'modula-preview-gallery' => array(
70
+ 'title' => esc_html__( 'Gallery', 'modula-best-grid-gallery' ),
71
'callback' => 'output_gallery_images',
72
+ 'context' => 'normal',
73
+ 'priority' => 10,
74
),
75
'modula-settings' => array(
76
+ 'title' => esc_html__( 'Settings', 'modula-best-grid-gallery' ),
77
'callback' => 'output_gallery_settings',
78
+ 'context' => 'normal',
79
+ 'priority' => 20,
80
),
81
'modula-shortcode' => array(
82
+ 'title' => esc_html__( 'Shortcode', 'modula-best-grid-gallery' ),
83
'callback' => 'output_gallery_shortcode',
84
+ 'context' => 'side',
85
+ 'priority' => 10,
86
),
87
+ );
88
89
$this->cpt_name = apply_filters( 'modula_cpt_name', 'modula-gallery' );
90
93
/* Fire our meta box setup function on the post editor screen. */
94
add_action( 'load-post.php', array( $this, 'meta_boxes_setup' ) );
95
add_action( 'load-post-new.php', array( $this, 'meta_boxes_setup' ) );
96
add_action( 'admin_menu', array($this, 'replace_submit_meta_box') );
97
98
add_filter( 'views_edit-modula-gallery', array( $this, 'add_extensions_tab' ), 10, 1 );
99
137
public function add_meta_boxes() {
138
139
global $post;
140
+ $this->metaboxes = apply_filters( 'modula_cpt_metaboxes', $this->metaboxes );
141
142
+ // Sort tabs based on priority.
143
+ uasort( $this->metaboxes, array( 'Modula_Helper', 'sort_data_by_priority' ) );
144
+
145
foreach ( $this->metaboxes as $metabox_id => $metabox ) {
146
147
if ( 'modula-shortcode' == $metabox_id && 'auto-draft' == $post->post_status ) {
148
+ continue;
149
}
150
151
add_meta_box(
includes/admin/class-modula-field-builder.php CHANGED
@@ -341,7 +341,6 @@ class Modula_Field_Builder {
341
$html .= '</div>';
342
break;
343
case "custom_code":
344
-
345
$html = '<div class="modula-code-editor" data-syntax="' . esc_attr( $field['syntax'] ) . '">';
346
$html .= '<textarea data-setting="' . esc_attr( $field['id'] ) . '" name="modula-settings[' . esc_attr( $field['id'] ) . ']" id="modula-' . esc_attr( $field['id'] ) . '-customcode" class="large-text code modula-custom-editor-field" rows="10" cols="50">' . wp_kses_post($value) . '</textarea>';
347
$html .= '</div>';
@@ -426,7 +425,7 @@ class Modula_Field_Builder {
426
}elseif ( 'pufrobo' == $key ) {
427
// Pufrobo Effect
428
$effect .= '<div class="panel panel-pufrobo modula-items clearfix">';
429
- $effect .= '<div class="modula-item effect-pufrobo"><img src="' . MODULA_URL . '/assets/images/effect.jpg" class="pic"><div class="figc"><div class="figc-inner"><h2>Lorem ipsum</h2><p class="description">Quisque diam erat, mollisvitae enim eget</p><div class="jtg-social"><a class="fa fa-twitter" href="#">' . Modula_Helper::get_icon( 'twitter' ) . '</a><a class="fa fa-facebook" href="#">' . Modula_Helper::get_icon( 'facebook' ) . '</a><a class="fa fa-pinterest" href="#">' . Modula_Helper::get_icon( 'pinterest' ) . '</a></div></div></div></div>';
430
$effect .= '<div class="effect-compatibility">';
431
$effect .= '<p class="description">' . esc_html__( 'This effect is compatible with:', 'modula-best-grid-gallery' );
432
$effect .= '<span><strong> ' . esc_html__( 'Title', 'modula-best-grid-gallery' ) . '</strong></span>,';
@@ -450,7 +449,7 @@ class Modula_Field_Builder {
450
break;
451
}
452
453
- return $html;
454
455
}
456
341
$html .= '</div>';
342
break;
343
case "custom_code":
344
$html = '<div class="modula-code-editor" data-syntax="' . esc_attr( $field['syntax'] ) . '">';
345
$html .= '<textarea data-setting="' . esc_attr( $field['id'] ) . '" name="modula-settings[' . esc_attr( $field['id'] ) . ']" id="modula-' . esc_attr( $field['id'] ) . '-customcode" class="large-text code modula-custom-editor-field" rows="10" cols="50">' . wp_kses_post($value) . '</textarea>';
346
$html .= '</div>';
425
}elseif ( 'pufrobo' == $key ) {
426
// Pufrobo Effect
427
$effect .= '<div class="panel panel-pufrobo modula-items clearfix">';
428
+ $effect .= '<div class="modula-item effect-pufrobo"><img src="' . MODULA_URL . '/assets/images/effect.jpg" class="pic"><div class="figc"><div class="figc-inner"><h2>Lorem ipsum</h2><p class="description">Quisque diam erat, mollisvitae enim eget</p><div class="jtg-social"><a class="fa fa-twitter" href="#">' . Modula_Helper::get_icon( 'twitter' ) . '</a><a class="fa fa-facebook" href="#">' . Modula_Helper::get_icon( 'facebook' ) . '</a><a class="fa fa-pinterest" href="#">' . Modula_Helper::get_icon( 'pinterest' ) . '</a><a class="fa fa-whatsapp" href="#">' . Modula_Helper::get_icon( 'whatsapp' ). '</a><a class="fa fa-linkedin" href="#">' . Modula_Helper::get_icon( 'linkedin' ) .'</a></div></div></div></div>';
429
$effect .= '<div class="effect-compatibility">';
430
$effect .= '<p class="description">' . esc_html__( 'This effect is compatible with:', 'modula-best-grid-gallery' );
431
$effect .= '<span><strong> ' . esc_html__( 'Title', 'modula-best-grid-gallery' ) . '</strong></span>,';
449
break;
450
}
451
452
+ return apply_filters( "modula_render_field_type", $html, $field, $value );
453
454
}
455
includes/admin/class-modula-image.php CHANGED
@@ -50,7 +50,7 @@ class Modula_Image {
50
return $return;
51
break;
52
}
53
-
54
}else{
55
return new WP_Error( 'modula-gallery-error-no-url', esc_html__( 'No image with this ID.', 'modula-best-grid-gallery' ) );
56
}
@@ -183,6 +183,7 @@ class Modula_Image {
183
public function resize_image( $url, $width = null, $height = null, $crop = false, $align = 'c', $quality = 100, $retina = false, $data = array(), $force_overwrite = false ) {
184
185
global $wpdb;
186
187
// Get common vars.
188
$args = array( $url, $width, $height, $crop, $align, $quality, $retina, $data );
@@ -226,11 +227,11 @@ class Modula_Image {
226
}
227
228
229
-
230
// If the file doesn't exist yet, we need to create it.
231
if ( ! file_exists( $dest_file_name ) || ( file_exists( $dest_file_name ) && $force_overwrite ) ) {
232
// We only want to resize Media Library images, so we can be sure they get deleted correctly when appropriate.
233
- $get_attachment = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE guid='%s'", $url ) );
234
235
// Load the WordPress image editor.
236
$editor = wp_get_image_editor( $file_path );
@@ -299,17 +300,18 @@ class Modula_Image {
299
// Add the resized dimensions and alignment to original image metadata, so the images
300
// can be deleted when the original image is delete from the Media Library.
301
if ( $get_attachment ) {
302
- $metadata = wp_get_attachment_metadata( $get_attachment[0]->ID );
303
304
if ( isset( $metadata['image_meta'] ) ) {
305
- $md = $saved['width'] . 'x' . $saved['height'];
306
307
- if ( $crop ) {
308
- $md .= $align ? "_${align}" : "_c";
309
- }
310
311
$metadata['image_meta']['resized_images'][] = $md;
312
- wp_update_attachment_metadata( $get_attachment[0]->ID, $metadata );
313
}
314
}
315
50
return $return;
51
break;
52
}
53
+
54
}else{
55
return new WP_Error( 'modula-gallery-error-no-url', esc_html__( 'No image with this ID.', 'modula-best-grid-gallery' ) );
56
}
183
public function resize_image( $url, $width = null, $height = null, $crop = false, $align = 'c', $quality = 100, $retina = false, $data = array(), $force_overwrite = false ) {
184
185
global $wpdb;
186
+ $upload_dir = wp_upload_dir();
187
188
// Get common vars.
189
$args = array( $url, $width, $height, $crop, $align, $quality, $retina, $data );
227
}
228
229
230
// If the file doesn't exist yet, we need to create it.
231
if ( ! file_exists( $dest_file_name ) || ( file_exists( $dest_file_name ) && $force_overwrite ) ) {
232
// We only want to resize Media Library images, so we can be sure they get deleted correctly when appropriate.
233
+ $_wp_attached_file = str_replace( $upload_dir['baseurl'] . '/' , '', $url );
234
+ $get_attachment = $wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key='_wp_attached_file' AND meta_value='%s'", $_wp_attached_file ) );
235
236
// Load the WordPress image editor.
237
$editor = wp_get_image_editor( $file_path );
300
// Add the resized dimensions and alignment to original image metadata, so the images
301
// can be deleted when the original image is delete from the Media Library.
302
if ( $get_attachment ) {
303
+ $metadata = wp_get_attachment_metadata( $get_attachment );
304
305
if ( isset( $metadata['image_meta'] ) ) {
306
307
+ $md = $suffix;
308
309
+ if( ! isset( $metadata['image_meta']['resized_images'] ) ) {
310
+ $metadata['image_meta']['resized_images'] = array();
311
+ }
312
+
313
$metadata['image_meta']['resized_images'][] = $md;
314
+ wp_update_attachment_metadata( $get_attachment, $metadata );
315
}
316
}
317
includes/admin/class-modula-upsells.php CHANGED
@@ -18,7 +18,7 @@ class Modula_Upsells {
18
add_filter( 'modula_password_protect_tab_content', array( $this, 'password_protect_tab_upsell' ) );
19
add_filter( 'modula_watermark_tab_content', array( $this, 'watermark_tab_upsell' ) );
20
add_filter( 'modula_slideshow_tab_content', array( $this, 'slideshow_tab_upsell' ) );
21
-
22
23
/* Fire our meta box setup function on the post editor screen. */
24
add_action( 'load-post.php', array( $this, 'meta_boxes_setup' ) );
@@ -26,6 +26,26 @@ class Modula_Upsells {
26
27
}
28
29
public function generate_upsell_box( $title, $description, $tab ) {
30
31
$upsell_box = '<div class="modula-upsell">';
18
add_filter( 'modula_password_protect_tab_content', array( $this, 'password_protect_tab_upsell' ) );
19
add_filter( 'modula_watermark_tab_content', array( $this, 'watermark_tab_upsell' ) );
20
add_filter( 'modula_slideshow_tab_content', array( $this, 'slideshow_tab_upsell' ) );
21
+ add_filter( 'modula_cpt_metaboxes',array( $this, 'albums_upsell_meta' ) );
22
23
/* Fire our meta box setup function on the post editor screen. */
24
add_action( 'load-post.php', array( $this, 'meta_boxes_setup' ) );
26
27
}
28
29
+
30
+ /**
31
+ * Add Albums Upsell Metabox
32
+ *
33
+ * @param $met
34
+ * @return mixed
35
+ * @since 2.2.7
36
+ */
37
+ public function albums_upsell_meta( $met ) {
38
+
39
+ $met['modula-albums-upsell'] = array(
40
+ 'title' => esc_html__( 'Albums Upsell', 'modula-best-grid-gallery' ),
41
+ 'callback' => 'output_upsell_albums',
42
+ 'context' => 'normal',
43
+ 'priority' => 5,
44
+ );
45
+
46
+ return $met;
47
+ }
48
+
49
public function generate_upsell_box( $title, $description, $tab ) {
50
51
$upsell_box = '<div class="modula-upsell">';
includes/admin/tabs/about.php CHANGED
@@ -1,12 +1,19 @@
1
<?php
2
$issues = array(
3
'fix' => array(
4
- esc_html__( 'Improved Custom CSS textarea', 'modula-best-grid-gallery' ),
5
- esc_html__( 'Improved how the lightbox closes', 'modula-best-grid-gallery' ),
6
- esc_html__( 'Fixed Custom Gallery with gutter 0', 'modula-best-grid-gallery' ),
7
- esc_html__( 'Removed feature box from extensions', 'modula-best-grid-gallery' ),
8
- esc_html__( 'Changed font size settings', 'modula-best-grid-gallery' ),
9
),
10
);
11
?>
12
<div class="row modula-about-row">
@@ -23,7 +30,7 @@ $issues = array(
23
<div class="modula-about-content">
24
<?php if (!empty($issues)) { ?>
25
26
- <h2><?php printf(esc_html__('Version %s addressed %s bugs', 'modula-best-grid-gallery'), MODULA_LITE_VERSION, count( $issues['fix'] ) ); ?></h2>
27
<ul class="modula-about-list">
28
<?php
29
foreach ($issues as $key => $iss) {
1
<?php
2
$issues = array(
3
'fix' => array(
4
+ esc_html__( 'Fixed incompatibility with isotope.js', 'modula-best-grid-gallery' ),
5
+ esc_html__( 'Renamed our registered files name', 'modula-best-grid-gallery' ),
6
+ esc_html__( 'Fixed title/caption font size to reflect theme default', 'modula-best-grid-gallery' ),
7
+ esc_html__( 'Fixed scroll to top when opening lightbox', 'modula-best-grid-gallery' ),
8
+ esc_html__( 'If Title/Caption is hidden then hide settings also', 'modula-best-grid-gallery' ),
9
+ esc_html__( 'Hide settings if toggle is OFF for custom responsiveness ', 'modula-best-grid-gallery' ),
10
),
11
+ 'feature' => array(
12
+ esc_html__( 'Added Migrate functionality. Now it\'s easier to migrate from another gallery to Modula', 'modula-best-grid-gallery' ),
13
+ esc_html__( 'Improved social media icons in preview', 'modula-best-grid-gallery' ),
14
+ esc_html__( 'Delete resized images when deleting attachment', 'modula-best-grid-gallery' ),
15
+ esc_html__( 'Added Import/Export sub-menu entry and tutorial', 'modula-best-grid-gallery' ),
16
+ )
17
);
18
?>
19
<div class="row modula-about-row">
30
<div class="modula-about-content">
31
<?php if (!empty($issues)) { ?>
32
33
+ <h2><?php printf(esc_html__('Version %s addressed %s bugs and added %s features', 'modula-best-grid-gallery'), MODULA_LITE_VERSION, count( $issues['fix'] ),count( $issues['feature'] ) ); ?></h2>
34
<ul class="modula-about-list">
35
<?php
36
foreach ($issues as $key => $iss) {
includes/class-modula.php CHANGED
@@ -59,6 +59,7 @@ class Modula {
59
require_once MODULA_PATH . 'includes/libraries/class-modula-review.php';
60
require_once MODULA_PATH . 'includes/uninstall/class-modula-uninstall.php';
61
require_once MODULA_PATH . 'includes/update/class-modula-update.php';
62
63
}
64
@@ -90,6 +91,7 @@ class Modula {
90
add_filter('upload_mimes', array($this,'modula_upload_mime_types'));
91
add_filter('file_is_displayable_image', array($this,'modula_webp_display'), 10, 2);
92
93
new Modula_CPT();
94
95
}
@@ -101,8 +103,8 @@ class Modula {
101
}
102
103
if ( apply_filters( 'modula_show_upsells', true ) ) {
104
- new Modula_Upsells();
105
- }
106
107
$upgrades = Modula_Upgrades::get_instance();
108
$upgrades->initialize_admin();
@@ -181,7 +183,7 @@ class Modula {
181
wp_enqueue_style( 'wp-color-picker' );
182
// Enqueue Code Editor for Custom CSS
183
wp_enqueue_code_editor(array('type' => 'text/css'));
184
- wp_enqueue_style( 'jquery-ui', MODULA_URL . 'assets/css/jquery-ui.min.css', null, MODULA_LITE_VERSION );
185
wp_enqueue_style( 'modula-cpt-style', MODULA_URL . 'assets/css/modula-cpt.css', null, MODULA_LITE_VERSION );
186
187
wp_enqueue_script( 'modula-resize-senzor', MODULA_URL . 'assets/js/resizesensor.js', array( 'jquery' ), MODULA_LITE_VERSION, true );
59
require_once MODULA_PATH . 'includes/libraries/class-modula-review.php';
60
require_once MODULA_PATH . 'includes/uninstall/class-modula-uninstall.php';
61
require_once MODULA_PATH . 'includes/update/class-modula-update.php';
62
+ require_once MODULA_PATH . 'includes/migrate/class-modula-importer.php';
63
64
}
65
91
add_filter('upload_mimes', array($this,'modula_upload_mime_types'));
92
add_filter('file_is_displayable_image', array($this,'modula_webp_display'), 10, 2);
93
94
+ // Initiate modula cpts
95
new Modula_CPT();
96
97
}
103
}
104
105
if ( apply_filters( 'modula_show_upsells', true ) ) {
106
+ new Modula_Upsells();
107
+ }
108
109
$upgrades = Modula_Upgrades::get_instance();
110
$upgrades->initialize_admin();
183
wp_enqueue_style( 'wp-color-picker' );
184
// Enqueue Code Editor for Custom CSS
185
wp_enqueue_code_editor(array('type' => 'text/css'));
186
+ wp_enqueue_style( 'modula-jquery-ui', MODULA_URL . 'assets/css/jquery-ui.min.css', null, MODULA_LITE_VERSION );
187
wp_enqueue_style( 'modula-cpt-style', MODULA_URL . 'assets/css/modula-cpt.css', null, MODULA_LITE_VERSION );
188
189
wp_enqueue_script( 'modula-resize-senzor', MODULA_URL . 'assets/js/resizesensor.js', array( 'jquery' ), MODULA_LITE_VERSION, true );
includes/elementor/class-modula-elementor-widget-activation.php CHANGED
@@ -68,7 +68,7 @@ class Modula_Elementor_Widget_Activation {
68
69
do_action( 'modula_elementor_before_enqueue_scripts' );
70
71
- wp_enqueue_script( 'packery' );
72
wp_enqueue_script( 'modula-lazysizes' );
73
wp_enqueue_script( 'modula' );
74
68
69
do_action( 'modula_elementor_before_enqueue_scripts' );
70
71
+ wp_enqueue_script( 'modula-packery' );
72
wp_enqueue_script( 'modula-lazysizes' );
73
wp_enqueue_script( 'modula' );
74
includes/helper/class-modula-helper.php CHANGED
@@ -168,5 +168,28 @@ class Modula_Helper {
168
return 'rgba(' . absint( $red ) . ',' . absint( $green ) . ',' . absint( $blue ) . ',' . floatval( $alpha ) . ')';
169
170
}
171
172
}
168
return 'rgba(' . absint( $red ) . ',' . absint( $green ) . ',' . absint( $blue ) . ',' . floatval( $alpha ) . ')';
169
170
}
171
+
172
+
173
+ /**
174
+ * Function to insert array into array after index
175
+ *
176
+ * @param $key
177
+ * @param array $array
178
+ * @param $new_key
179
+ * @param $new_value
180
+ * @return array
181
+ * @since 2.2.7
182
+ */
183
+ public static function array_insert_after( $key, array &$array, $new_key, $new_value ) {
184
+ $new = array();
185
+ foreach ( $array as $k => $value ) {
186
+ $new[ $k ] = $value;
187
+ if ( $k === $key ) {
188
+ $new[ $new_key ] = $new_value;
189
+ }
190
+ }
191
+ return $new;
192
+
193
+ }
194
195
}
includes/migrate/class-modula-importer.php ADDED
@@ -0,0 +1,471 @@
1
+ <?php
2
+
3
+ // Exit if accessed directly.
4
+ if (!defined('ABSPATH')) {
5
+ exit;
6
+ }
7
+
8
+ class Modula_Importer {
9
+
10
+ /**
11
+ * Holds the class object.
12
+ *
13
+ * @since 2.2.7
14
+ *
15
+ * @var object
16
+ */
17
+ public static $instance;
18
+
19
+ /**
20
+ * Primary class constructor.
21
+ *
22
+ * @since 2.2.7
23
+ */
24
+ public function __construct() {
25
+
26
+ // Add Importer Tab
27
+ add_filter('modula_admin_page_tabs', array($this, 'add_importer_tab'));
28
+
29
+ // Render Importer tab
30
+ add_action('modula_admin_tab_importer', array($this, 'render_importer_tab'));
31
+
32
+ // Include required scripts for import
33
+ add_action('admin_enqueue_scripts', array($this, 'admin_importer_scripts'));
34
+
35
+ add_action('admin_menu',array($this,'migrator_menu'));
36
+
37
+ // Required files
38
+ require_once MODULA_PATH . 'includes/migrate/nextgen/class-modula-nextgen-importer.php';
39
+ require_once MODULA_PATH . 'includes/migrate/envira/class-modula-envira-importer.php';
40
+ require_once MODULA_PATH . 'includes/migrate/final-tiles/class-modula-final-tiles-importer.php';
41
+ require_once MODULA_PATH . 'includes/migrate/photoblocks/class-modula-photoblocks-importer.php';
42
+ require_once MODULA_PATH . 'includes/migrate/wp-core-gallery/class-modula-wp-core-gallery-importer.php';
43
+
44
+ // Load the plugin.
45
+ $this->init();
46
+
47
+ }
48
+
49
+ /**
50
+ * Add sub-menu entry for Migrate
51
+ */
52
+ public function migrator_menu() {
53
+ add_submenu_page( 'edit.php?post_type=modula-gallery', esc_html__( 'Migrate', 'modula-best-grid-gallery' ), esc_html__( 'Migrate', 'modula-best-grid-gallery' ), 'manage_options', 'edit.php?post_type=modula-gallery&page=modula&modula-tab=importer' );
54
+ }
55
+
56
+
57
+ /**
58
+ * Loads the plugin into WordPress.
59
+ *
60
+ * @since 2.2.7
61
+ */
62
+ public function init() {
63
+
64
+ // Load admin only components.
65
+ if (is_admin()) {
66
+ add_filter('modula_uninstall_db_options',array($this,'uninstall_options'),16,1);
67
+ add_action('wp_ajax_modula_importer_get_galleries',array($this,'get_source_galleries'));
68
+ }
69
+
70
+ }
71
+
72
+
73
+ /**
74
+ * Enqueue import script
75
+ *
76
+ * @since 2.2.7
77
+ */
78
+ public function admin_importer_scripts() {
79
+
80
+ $screen = get_current_screen();
81
+
82
+ // only enqueue script if we are in Modula Settings page
83
+ if ('modula-gallery' == $screen->post_type && 'modula-gallery_page_modula' == $screen->base ) {
84
+
85
+ $ajax_url = admin_url('admin-ajax.php');
86
+ $nonce = wp_create_nonce('modula-importer');
87
+ $empty_gallery = esc_html__('Please choose at least one gallery to migrate.', 'modula-best-grid-gallery');
88
+
89
+ wp_enqueue_style('modula-importer', MODULA_URL . 'assets/css/modula-importer.css', array(), MODULA_LITE_VERSION);
90
+ wp_enqueue_script('modula-importer', MODULA_URL . 'assets/js/modula-importer.js', array('jquery'), MODULA_LITE_VERSION, true);
91
+ wp_localize_script(
92
+ 'modula-importer',
93
+ 'modula_importer',
94
+ array(
95
+ 'ajax' => $ajax_url,
96
+ 'nonce' => $nonce,
97
+ 'importing' => '<span style="color:green">' . esc_html__(' Migration started...', 'modula-best-grid-gallery') . '</span>',
98
+ 'empty_gallery_selection' => $empty_gallery,
99
+ )
100
+ );
101
+ }
102
+ }
103
+
104
+
105
+ /**
106
+ * Add Importer tab
107
+ *
108
+ * @param $tabs
109
+ * @return mixed
110
+ *
111
+ * @since 2.2.7
112
+ */
113
+ public function add_importer_tab($tabs) {
114
+ $tabs['importer'] = array(
115
+ 'label' => esc_html__('Migrate galleries', 'modula-best-grid-gallery'),
116
+ 'priority' => 50,
117
+ );
118
+
119
+ return $tabs;
120
+ }
121
+
122
+
123
+ /**
124
+ * Render Importer tab
125
+ *
126
+ * @since 2.2.7
127
+ */
128
+ public function render_importer_tab() {
129
+ include 'tabs/modula-importer-tab.php';
130
+ }
131
+
132
+
133
+ /**
134
+ * Add migrate DB options to uninstall
135
+ *
136
+ * @param $options_array
137
+ * @return mixed
138
+ *
139
+ * @since 2.2.7
140
+ */
141
+ public function uninstall_options($options_array){
142
+ array_push($options_array,'modula_importer');
143
+
144
+ return $options_array;
145
+ }
146
+
147
+ /**
148
+ * Get gallery sources
149
+ *
150
+ * @return mixed
151
+ *
152
+ * @since 2.2.7
153
+ */
154
+ public function get_sources() {
155
+
156
+ global $wpdb;
157
+ $sources = array();
158
+
159
+ // Assume they are none
160
+ $envira = false;
161
+ $nextgen = false;
162
+ $final_tiles = false;
163
+ $photoblolcks = false;
164
+ $wp_core = false;
165
+
166
+ $envira = $wpdb->get_results(" SELECT COUNT(ID) FROM " . $wpdb->prefix . "posts WHERE post_type ='envira'");
167
+
168
+ if ($wpdb->get_var("SHOW TABLES LIKE '" . $wpdb->prefix . "ngg_gallery'")) {
169
+ $nextgen = $wpdb->get_results(" SELECT COUNT(gid) FROM " . $wpdb->prefix . "ngg_gallery");
170
+ }
171
+
172
+ // Seems like on some servers tables are saved lowercase
173
+ if ($wpdb->get_var("SHOW TABLES LIKE '" . $wpdb->prefix . "finaltiles_gallery'")) {
174
+ $final_tiles = $wpdb->get_results(" SELECT COUNT(Id) FROM " . $wpdb->prefix . "finaltiles_gallery");
175
+ }
176
+
177
+ if ($wpdb->get_var("SHOW TABLES LIKE '" . $wpdb->prefix . "FinalTiles_gallery'")) {
178
+ $final_tiles = $wpdb->get_results(" SELECT COUNT(Id) FROM " . $wpdb->prefix . "FinalTiles_gallery");
179
+ }
180
+
181
+ if ($wpdb->get_var("SHOW TABLES LIKE '" . $wpdb->prefix . "photoblocks'")) {
182
+ $photoblolcks = $wpdb->get_results(" SELECT COUNT(id) FROM " . $wpdb->prefix . "photoblocks");
183
+ }
184
+
185
+ $sql = "SELECT COUNT(ID) FROM " . $wpdb->prefix . "posts WHERE `post_content` LIKE '%[galler%' AND `post_status` = 'publish'";
186
+ $wp_core = $wpdb->get_results($sql);
187
+
188
+ // Need to get this so we can handle the object to check if mysql returned 0
189
+ $envira_return = (NULL != $envira) ? get_object_vars($envira[0]) : false;
190
+ $nextgen_return = (NULL != $nextgen) ? get_object_vars($nextgen[0]) : false;
191
+ $final_tiles_return = (NULL != $final_tiles) ? get_object_vars($final_tiles[0]) : false;
192
+ $photoblocks_return = (NULL != $photoblolcks) ? get_object_vars($photoblolcks[0]) : false;
193
+ $wp_core_return = (NULL != $wp_core) ? get_object_vars($wp_core[0]) : false;
194
+
195
+ // Check to see if there are any entries and insert into array
196
+ if ($envira && NULL != $envira && !empty($envira) && $envira_return && '0' != $envira_return['COUNT(ID)']) {
197
+ $sources['envira'] = 'Envira Gallery';
198
+ }
199
+ if ($nextgen && NULL != $nextgen && !empty($nextgen) && $nextgen_return && '0' != $nextgen_return['COUNT(gid)']) {
200
+ $sources['nextgen'] = 'NextGEN Gallery';
201
+ }
202
+ if ($final_tiles && NULL != $final_tiles && !empty($final_tiles) && $final_tiles_return && '0' != $final_tiles_return['COUNT(Id)']) {
203
+ $sources['final_tiles'] = 'Final Tiles Gallery';
204
+ }
205
+ if ($photoblolcks && NULL != $photoblolcks && !empty($photoblolcks) && $photoblocks_return && '0' != $photoblocks_return['COUNT(id)']) {
206
+ $sources['photoblocks'] = 'PhotoBlocks';
207
+ }
208
+ if ($wp_core && NULL != $wp_core && !empty($wp_core) && $wp_core_return && '0' != $wp_core_return['COUNT(ID)'] ) {
209
+ $sources['wp_core'] = 'WP Core Galleries';
210
+ }
211
+
212
+ if (!empty($sources)) {
213
+ return $sources;
214
+ }
215
+
216
+ return false;
217
+ }
218
+
219
+
220
+ /**
221
+ * Get galleries for sources
222
+ *
223
+ * @since 2.2.7
224
+ */
225
+ public function get_source_galleries() {
226
+
227
+ check_ajax_referer('modula-importer', 'nonce');
228
+ $source = isset($_POST['source']) ? $_POST['source'] : false;
229
+
230
+ if (!$source || 'none' == $source) {
231
+ echo esc_html__('There is no source selected', 'modula-best-grid-gallery');
232
+ wp_die();
233
+ }
234
+
235
+ $import_settings = get_option('modula_importer');
236
+ $import_settings = wp_parse_args($import_settings, array('galleries' => array()));
237
+ $galleries = array();
238
+ $html = '';
239
+
240
+ switch ($source) {
241
+ case 'envira' :
242
+ $gal_source = Modula_Envira_Importer::get_instance();
243
+ $galleries = $gal_source->get_galleries();
244
+ break;
245
+ case 'nextgen':
246
+ $gal_source = Modula_Nextgen_Importer::get_instance();
247
+ $galleries = $gal_source->get_galleries();
248
+ break;
249
+ case 'final_tiles' :
250
+ $gal_source = Modula_Final_Tiles_Importer::get_instance();
251
+ $galleries = $gal_source->get_galleries();
252
+ break;
253
+ case 'photoblocks':
254
+ $gal_source = Modula_Photoblocks_Importer::get_instance();
255
+ $galleries = $gal_source->get_galleries();
256
+ break;
257
+ case 'wp_core':
258
+ $gal_source = Modula_WP_Core_Gallery_Importer::get_instance();
259
+ $galleries = $gal_source->get_galleries();
260
+ break;
261
+ }
262
+
263
+
264
+ // Although this isn't necessary, sources have been checked before in tab
265
+ // it is best if we do another check, just to be sure.
266
+ if (!isset($galleries['valid_galleries']) && isset($galleries['empty_galleries']) && count($galleries['empty_galleries']) > 0) {
267
+ printf(esc_html__('While we’ve found %s gallery(ies) we could import , we were unable to find any images associated with it(them). There’s no content for us to import .','modula-best-grid-gallery'),count($galleries['empty_galleries']));
268
+ wp_die();
269
+ }
270
+
271
+ foreach ($galleries['valid_galleries'] as $key => $gallery) {
272
+ $imported = false;
273
+ switch ( $source ) {
274
+ case 'envira':
275
+ $id = $gallery->ID;
276
+ $modula_gallery = get_post_type( $import_settings['galleries'][ $source ][ $id ] );
277
+
278
+ if ( isset( $import_settings['galleries'][$source] ) && 'modula-gallery' == $modula_gallery ) {
279
+ $imported = true;
280
+ }
281
+
282
+ $title = '<a href="' . admin_url( '/post.php?post=' . $gallery->ID . '&action=edit' ) . '" target="_blank">' . esc_html( $gallery->post_title ) . '</a>';
283
+ $count = $gal_source->images_count( $gallery->ID );
284
+ break;
285
+ case 'final_tiles' :
286
+ $id = $gallery->Id;
287
+ $modula_gallery = get_post_type( $import_settings['galleries'][ $source ][ $id ] );
288
+ if ( isset( $import_settings['galleries'][$source] ) && 'modula-gallery' == $modula_gallery ) {
289
+ $imported = true;
290
+ }
291
+
292
+ $ftg_config = json_decode( $gallery->configuration );
293
+ $title = '<a href="' . admin_url( 'admin.php?page=ftg-lite-gallery-admin&id=' . $gallery->Id ) . '" target="_blank"> ' . esc_html( $ftg_config->name ) . '</a>';
294
+ $count = $gal_source->images_count( $gallery->Id );
295
+ break;
296
+ case 'nextgen':
297
+ $id = $gallery->gid;
298
+ $modula_gallery = get_post_type( $import_settings['galleries'][ $source ][ $id ] );
299
+ if ( isset( $import_settings['galleries'][$source] ) && 'modula-gallery' == $modula_gallery ) {
300
+ $imported = true;
301
+ }
302
+ $title = '<a href="' . wp_nonce_url( admin_url( 'admin.php?page=nggallery-manage-gallery&amp;mode=edit&amp;gid=' . $gallery->gid ) ) . '" target="_blank">' . esc_html( $gallery->title ) . '</a>';
303
+ $count = $gal_source->images_count( $gallery->gid );
304
+ break;
305
+ case
306
+ 'photoblocks':
307
+ $id = $gallery->id;
308
+ $modula_gallery = get_post_type( $import_settings['galleries'][ $source ][ $id ] );
309
+ if ( isset( $import_settings['galleries'][$source] ) && 'modula-gallery' == $modula_gallery ) {
310
+ $imported = true;
311
+ }
312
+ $title = '<a href="' . admin_url( 'admin.php?page=photoblocks-edit&id=' . $gallery->id ) . '" target="_blank"> ' . esc_html( $gallery->name ) . '</a>';
313
+ $count = $gal_source->images_count( $gallery->id );
314
+ break;
315
+ case 'wp_core':
316
+ $id = $gallery['page_id'] . '-' . $gallery['gal_nr'];
317
+ $value = json_encode( array( 'id' => $gallery['page_id'], 'shortcode' => $gallery['shortcode'] ) );
318
+ $title = '<a href="' . admin_url( '/post.php?post=' . absint( $gallery['page_id'] ) . '&action=edit' ) . '" target="_blank">' . esc_html( $gallery['title'] ) . '</a>';
319
+ $count = $gallery['images'];
320
+ break;
321
+ default:
322
+ $id = $gallery->ID;
323
+ $modula_gallery = get_post_type( $import_settings['galleries'][ $source ][ $id ] );
324
+
325
+ if ( isset( $import_settings['galleries'][ $source ] ) && 'modula-gallery' == $modula_gallery ) {
326
+ $imported = true;
327
+ }
328
+ $title = $gallery->post_title;
329
+
330
+ }
331
+
332
+ // Small fix for wp_core galleries
333
+ $val = ($value) ? $value : $id;
334
+
335
+ $html .= '<div class="modula-importer-checkbox-wrapper">' .
336
+ '<label for="' . esc_attr( $source ) . '-galleries-' . esc_attr( $id ) . '"' .
337
+ ' data-id="' . esc_attr( $id ) . '" ' . ( $imported ? ' class="imported"' : '' ) . '>' .
338
+ '<input type="checkbox" name="gallery"' .
339
+ ' id="' . esc_attr( $source ) . '-galleries-' . esc_attr( $id ) . '"' .
340
+ ' data-id="'.esc_attr($id).'" value="' . esc_attr( $val ) . '"/>';
341
+ // Title is escaped above
342
+ $html .= $title ;
343
+
344
+
345
+
346
+ if(20 < $count){
347
+ $lite = '<div class="tab-header-tooltip-container modula-tooltip"><span>[?]</span><div class="tab-header-description modula-tooltip-content">';
348
+ $lite .= esc_html__('You currently have ','modula-best-grid-gallery');
349
+ $lite .= absint($count);
350
+ $lite .= esc_html__(' images in your gallery and only 20 will be imported. If you want to import al, please buy the PRO version and import them after that. ','modula-best-grid-gallery');
351
+ $lite .= '</div></div>';
352
+ }
353
+
354
+ // Display text on LITE. On PRO version
355
+ $lite = apply_filters( 'modula_lite_migration_text', $lite );
356
+ $html .= $lite;
357
+
358
+ $html .= '<span class="modula-importer-gallery-status">';
359
+
360
+ if ( $imported ) {
361
+ $html .= '<i class="imported-check dashicons dashicons-yes"></i>';
362
+ }
363
+
364
+ $html .= '</span></label></div>';
365
+
366
+ }
367
+
368
+ echo $html;
369
+ wp_die();
370
+ }
371
+
372
+
373
+ /**
374
+ * Prepare gallery images
375
+ *
376
+ *
377
+ * @param $source
378
+ * @param $data
379
+ * @return 0|array|bool|mixed|object|null
380
+ *
381
+ * @since 2.2.7
382
+ */
383
+ public function prepare_images($source,$data){
384
+
385
+ global $wpdb;
386
+ $images = array();
387
+ $limit = '20';
388
+ $limit = (int)apply_filters('modula_importer_migrate_limit',$limit);
389
+
390
+ switch ($source){
391
+ case 'envira':
392
+ $images = get_post_meta($data, '_eg_gallery_data', true);
393
+ $images = array_slice($images['gallery'],0,$limit,true);
394
+ break;
395
+ case 'nextgen':
396
+ // Get images from NextGEN Gallery
397
+ $sql = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "ngg_pictures
398
+ WHERE galleryid = %d
399
+ ORDER BY sortorder ASC,
400
+ imagedate ASC",
401
+ $data);
402
+
403
+ $images = $wpdb->get_results($sql);
404
+ $images = array_slice($images,0,$limit,true);
405
+ break;
406
+ case 'final_tiles':
407
+ // Seems like on some servers tables are saved lowercase
408
+ if ($wpdb->get_var("SHOW TABLES LIKE '" . $wpdb->prefix . "finaltiles_gallery'")) {
409
+ // Get images from Final Tiles
410
+ $sql = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "finaltiles_gallery_images
411
+ WHERE gid = %d
412
+ ORDER BY 'setOrder' ASC",
413
+ $data);
414
+ $images = $wpdb->get_results($sql);
415
+ $images = array_slice($images,0,$limit,true);
416
+ }
417
+
418
+ if ($wpdb->get_var("SHOW TABLES LIKE '" . $wpdb->prefix . "FinalTiles_gallery'")) {
419
+ // Get images from Final Tiles
420
+ $sql = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "FinalTiles_gallery_images
421
+ WHERE gid = %d
422
+ ORDER BY 'setOrder' ASC",
423
+ $data);
424
+ $images = $wpdb->get_results($sql);
425
+ $images = array_slice($images,0,$limit,true);
426
+ }
427
+ break;
428
+ case 'photoblocks':
429
+ // Get gallery
430
+ $sql = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "photoblocks
431
+ WHERE id = %d LIMIT 1",
432
+ $data);
433
+ $gallery = $wpdb->get_row($sql);
434
+ $blocks = json_decode($gallery->blocks);
435
+ $blocks = array_slice($blocks,0,$limit,true);
436
+ $gallery->blocks = json_encode($blocks);
437
+ $images = $gallery;
438
+ break;
439
+ case 'wp_core':
440
+ $images = explode(',', $data);
441
+ $images = array_slice($images,0,$limit,true);
442
+ break;
443
+
444
+ }
445
+
446
+ if($images){
447
+ return $images;
448
+ }
449
+
450
+ return false;
451
+
452
+ }
453
+
454
+ /**
455
+ * Returns the singleton instance of the class.
456
+ *
457
+ * @return object The Modula_Importer object.
458
+ *
459
+ * @since 2.2.7
460
+ */
461
+ public static function get_instance() {
462
+
463
+ if (!isset(self::$instance) && !(self::$instance instanceof Modula_Importer)) {
464
+ self::$instance = new Modula_Importer();
465
+ }
466
+
467
+ return self::$instance;
468
+ }
469
+ }
470
+
471
+ $modula_importer = Modula_Importer::get_instance();
includes/migrate/envira/class-modula-envira-importer.php ADDED
@@ -0,0 +1,312 @@
1
+ <?php
2
+ // Exit if accessed directly.
3
+ if (!defined('ABSPATH')) {
4
+ exit;
5
+ }
6
+
7
+ class Modula_Envira_Importer {
8
+
9
+ /**
10
+ * Holds the class object.
11
+ *
12
+ * @var object
13
+ *
14
+ * @since 2.2.7
15
+ */
16
+ public static $instance;
17
+
18
+ /**
19
+ * Primary class constructor.
20
+ *
21
+ * @since 1.0.0
22
+ */
23
+ public function __construct() {
24
+
25
+ // Add AJAX
26
+ add_action('wp_ajax_modula_importer_envira_gallery_import', array($this, 'envira_gallery_import'));
27
+ add_action('wp_ajax_modula_importer_envira_gallery_imported_update', array($this, 'update_imported'));
28
+
29
+ }
30
+
31
+
32
+ /**
33
+ * Get all Envira Galleries
34
+ *
35
+ * @return mixed
36
+ *
37
+ * @since 2.2.7
38
+ */
39
+ public function get_galleries() {
40
+
41
+ global $wpdb;
42
+
43
+ $galleries = $wpdb->get_results(" SELECT * FROM " . $wpdb->prefix . "posts WHERE post_type = 'envira' AND post_status = 'publish'");
44
+ $empty_galleries = array();
45
+
46
+ if (count($galleries) != 0) {
47
+ foreach ($galleries as $key => $gallery) {
48
+ $count = $this->images_count($gallery->ID);
49
+
50
+ if ($count == 0) {
51
+ unset($galleries[$key]);
52
+ $empty_galleries[$key] = $gallery;
53
+ }
54
+ }
55
+
56
+ if (count($galleries) != 0) {
57
+ $return_galleries['valid_galleries'] = $galleries;
58
+ }
59
+ if (count($empty_galleries) != 0) {
60
+ $return_galleries['empty_galleries'] = $empty_galleries;
61
+ }
62
+
63
+ if (count($return_galleries) != 0) {
64
+ return $return_galleries;
65
+ }
66
+ }
67
+
68
+ return false;
69
+ }
70
+
71
+
72
+ /**
73
+ * Get gallery image count
74
+ *
75
+ * @param $id
76
+ * @return int
77
+ *
78
+ * @since 2.2.7
79
+ */
80
+ public function images_count($id){
81
+
82
+ $images = get_post_meta($id, '_eg_gallery_data', true);
83
+ $count = count($images['gallery']);
84
+
85
+ return $count;
86
+ }
87
+
88
+ /**
89
+ * Imports a gallery from Envira to Modula
90
+ *
91
+ * @param string $gallery_id
92
+ *
93
+ * @since 2.2.7
94
+ */
95
+ public function envira_gallery_import($gallery_id = '') {
96
+
97
+ global $wpdb;
98
+ $modula_importer = Modula_Importer::get_instance();
99
+
100
+ // Set max execution time so we don't timeout
101
+ ini_set('max_execution_time', 0);
102
+ set_time_limit(0);
103
+
104
+ // If no gallery ID, get from AJAX request
105
+ if (empty($gallery_id)) {
106
+
107
+ // Run a security check first.
108
+ check_ajax_referer('modula-importer', 'nonce');
109
+
110
+ if (!isset($_POST['id'])) {
111
+ $this->modula_import_result(false, esc_html__('No gallery was selected', 'modula-best-grid-gallery'),false);
112
+ }
113
+
114
+ $gallery_id = absint($_POST['id']);
115
+
116
+ }
117
+
118
+ $imported_galleries = get_option('modula_importer');
119
+ // If already migrated don't migrate
120
+
121
+ if ( isset( $imported_galleries['galleries']['envira'][ $gallery_id ] ) ) {
122
+
123
+ $modula_gallery = get_post_type( $imported_galleries['galleries']['envira'][ $gallery_id ] );
124
+
125
+ if ( 'modula-gallery' == $modula_gallery ) {
126
+ // Trigger delete function if option is set to delete
127
+ if ( isset($_POST['clean']) && 'delete' == $_POST['clean'] ) {
128
+ $this->clean_entries( $gallery_id );
129
+ }
130
+ $this->modula_import_result( false, esc_html__( 'Gallery already migrated!', 'modula-best-grid-gallery' ), false );
131
+ }
132
+ }
133
+
134
+
135
+ // Get all images attached to the gallery
136
+ $modula_images = array();
137
+
138
+ // get gallery data so we can get title, description and alt from envira
139
+ $envira_gallery_data = $modula_importer->prepare_images('envira',$gallery_id);
140
+
141
+ if (isset($envira_gallery_data) && count($envira_gallery_data) > 0) {
142
+ foreach ($envira_gallery_data as $imageID => $image) {
143
+
144
+ $envira_image_title = ( !isset( $image['title'] ) || '' != $image['title'] ) ? $image['title'] : '';
145
+
146
+ $envira_image_caption = ( !isset( $image['caption'] ) || '' != $image['caption'] ) ? $image['caption'] : wp_get_attachment_caption( $imageID );
147
+
148
+ $envira_image_alt = ( !isset( $image['alt'] ) || '' != $image['alt'] ) ? $image['alt'] : get_post_meta( $imageID, '_wp_attachment_image_alt', TRUE );
149
+ $envira_image_url = ( !isset( $image['link'] ) || '' != $image['link'] ) ? $image['link'] : '';
150
+ $target = ( isset( $image['link_new_window'] ) && '1' == $image['link_new_window'] ) ? 1 : 0;
151
+
152
+
153
+ $modula_images[] = array(
154
+ 'id' => absint($imageID),
155
+ 'alt' => sanitize_text_field($envira_image_alt),
156
+ 'title' => sanitize_text_field($envira_image_title),
157
+ 'description' => wp_filter_post_kses($envira_image_caption),
158
+ 'halign' => 'center',
159
+ 'valign' => 'middle',
160
+ 'link' => esc_url_raw($envira_image_url),
161
+ 'target' => absint($target),
162
+ 'width' => 2,
163
+ 'height' => 2,
164
+ 'filters' => ''
165
+ );
166
+
167
+ }
168
+ }
169
+
170
+ if (count($modula_images) == 0) {
171
+ // Trigger delete function if option is set to delete
172
+ if(isset($_POST['clean']) && 'delete' == $_POST['clean']){
173
+ $this->clean_entries($gallery_id);
174
+ }
175
+ $this->modula_import_result(false, esc_html__('No images found in gallery. Skipping gallery...', 'modula-best-grid-gallery'),false);
176
+ }
177
+
178
+ // Get Modula Gallery defaults, used to set modula-settings metadata
179
+ $modula_settings = Modula_CPT_Fields_Helper::get_defaults();
180
+
181
+ // Create Modula CPT
182
+ $modula_gallery_id = wp_insert_post(array(
183
+ 'post_type' => 'modula-gallery',
184
+ 'post_status' => 'publish',
185
+ 'post_title' => sanitize_text_field(get_the_title($gallery_id)),
186
+ ));
187
+
188
+ // Attach meta modula-settings to Modula CPT
189
+ update_post_meta($modula_gallery_id, 'modula-settings', $modula_settings);
190
+ // Attach meta modula-images to Modula CPT
191
+ update_post_meta($modula_gallery_id, 'modula-images', $modula_images);
192
+
193
+ $envira_shortcodes = '[envira-gallery id="' . $gallery_id . '"]';
194
+ $envira_slug = get_post_field('post_name',$gallery_id);
195
+ $envira_slug_shortcode = '[envira-gallery slug="' . $envira_slug . '"]';
196
+ $modula_shortcode = '[modula id="' . $modula_gallery_id . '"]';
197
+
198
+ // Replace Envira id shortcode with Modula Shortcode in Posts, Pages and CPTs
199
+ $sql = $wpdb->prepare("UPDATE " . $wpdb->prefix . "posts SET post_content = REPLACE(post_content, '%s', '%s')",
200
+ $envira_shortcodes, $modula_shortcode);
201
+ $wpdb->query($sql);
202
+
203
+ // Replace Envira slug shortcode with Modula Shortcode in Posts, Pages and CPTs
204
+ $sql = $wpdb->prepare("UPDATE " . $wpdb->prefix . "posts SET post_content = REPLACE(post_content, '%s', '%s')",
205
+ $envira_slug_shortcode, $modula_shortcode);
206
+ $wpdb->query($sql);
207
+
208
+ // Trigger delete function if option is set to delete
209
+ if(isset($_POST['clean']) && 'delete' == $_POST['clean']){
210
+ $this->clean_entries($gallery_id);
211
+ }
212
+
213
+ $this->modula_import_result(true, wp_kses_post('<i class="imported-check dashicons dashicons-yes"></i>'),$modula_gallery_id );
214
+ }
215
+
216
+ /**
217
+ * Update imported galleries
218
+ *
219
+ *
220
+ * @since 2.2.7
221
+ */
222
+ public function update_imported() {
223
+
224
+ check_ajax_referer('modula-importer', 'nonce');
225
+
226
+ $galleries = $_POST['galleries'];
227
+
228
+ $importer_settings = get_option('modula_importer');
229
+
230
+ // first check if array
231
+ if(!is_array($importer_settings)){
232
+ $importer_settings = array();
233
+ }
234
+
235
+ if (!isset($importer_settings['galleries']['envira'])) {
236
+ $importer_settings['galleries']['envira'] = array();
237
+ }
238
+
239
+ if ( is_array( $galleries ) && count( $galleries ) > 0 ) {
240
+ foreach ( $galleries as $key => $value ) {
241
+ $importer_settings['galleries']['envira'][ absint($key) ] = absint($value);
242
+ }
243
+ }
244
+
245
+ // Remember that this gallery has been imported
246
+ update_option('modula_importer', $importer_settings);
247
+
248
+ // Set url for migration complete
249
+ $url = admin_url('edit.php?post_type=modula-gallery&page=modula&modula-tab=importer&migration=complete');
250
+
251
+ if(isset($_POST['clean']) && 'delete' == $_POST['clean']){
252
+ // Set url for migration and cleaning complete
253
+ $url = admin_url('edit.php?post_type=modula-gallery&page=modula&modula-tab=importer&migration=complete&delete=complete');
254
+ }
255
+
256
+ echo $url;
257
+ wp_die();
258
+ }
259
+
260
+ /**
261
+ * Returns result
262
+ *
263
+ * @param $success
264
+ * @param $message
265
+ * @param $gallery_id
266
+ *
267
+ * @since 2.2.7
268
+ */
269
+ public function modula_import_result( $success, $message, $gallery_id = false ) {
270
+ echo json_encode( array(
271
+ 'success' => (bool)$success,
272
+ 'message' => (string)$message,
273
+ 'modula_gallery_id' => $gallery_id
274
+ ) );
275
+ die;
276
+ }
277
+
278
+
279
+ /**
280
+ * Returns the singleton instance of the class.
281
+ *
282
+ * @since 2.2.7
283
+ */
284
+ public static function get_instance() {
285
+
286
+ if (!isset(self::$instance) && !(self::$instance instanceof Modula_Envira_Importer)) {
287
+ self::$instance = new Modula_Envira_Importer();
288
+ }
289
+
290
+ return self::$instance;
291
+
292
+ }
293
+
294
+ /**
295
+ * Delete old entries from database
296
+ *
297
+ * @param $gallery_id
298
+ *
299
+ * @since 2.2.7
300
+ */
301
+ public function clean_entries($gallery_id){
302
+ global $wpdb;
303
+ $sql = $wpdb->prepare( "DELETE FROM $wpdb->posts WHERE ID = $gallery_id" );
304
+ $sql_meta = $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE post_id = $gallery_id" );
305
+ $wpdb->query( $sql );
306
+ $wpdb->query( $sql_meta );
307
+ }
308
+
309
+ }
310
+
311
+ // Load the class.
312
+ $modula_envira_importer = Modula_Envira_Importer::get_instance();
includes/migrate/final-tiles/class-modula-final-tiles-importer.php ADDED
@@ -0,0 +1,367 @@