Premium Addons for Elementor - Version 3.1.1

Version Description

  • Tweak: Added Metro Layout for Grid widget.
  • Tweak: Show Gallery Images on lightbox option added to Grid widget.
  • Tweak: Added Start Number option for Counter widget.
  • Tweak: Icon Animation while scrolling enhanced for Counter widget.
  • Tweak: JS code refactor to improve performance speed.
  • Fixed: Images overlap issue after page reload in Grid widget.
  • Fixed: Description not showing with Effect 4 in Banner widget.
Download this release

Release Info

Developer leap13
Plugin Icon 128x128 Premium Addons for Elementor
Version 3.1.1
Comparing to
See all releases

Code changes from version 3.1.0 to 3.1.1

assets/css/premium-addons.css CHANGED
@@ -241,6 +241,7 @@
241
  }
242
  .premium_banner_animation2:hover .premium_addons-banner-ib-content,
243
  .premium_banner_animation2.active .premium_addons-banner-ib-content {
 
244
  -webkit-transform: translate3d(0, -30px, 0);
245
  transform: translate3d(0, -30px, 0);
246
  }
@@ -3117,16 +3118,16 @@ button.premium-modal-box-modal-close {
3117
  align-items: center;
3118
  justify-content: center;
3119
  }
3120
- .premium-grid-50 .premium-gallery-item:nth-child(2n+1) {
3121
  clear: left;
3122
- }
3123
- .premium-grid-33330 .premium-gallery-item:nth-child(3n+1) {
3124
  clear: left;
3125
- }
3126
- .premium-grid-25 .premium-gallery-item:nth-child(4n+1) {
3127
  clear: left;
3128
- }
3129
- .premium-grid-20 .premium-gallery-item:nth-child(5n+1) {
3130
  clear: left;
3131
  }
3132
  .premium-grid-1666 .premium-gallery-item:nth-child(6n+1) {
@@ -3134,14 +3135,17 @@ button.premium-modal-box-modal-close {
3134
  }
3135
  .premium-grid-8333 .premium-gallery-item:nth-child(12n+1) {
3136
  clear: left;
3137
- }
3138
  .premium-img-gallery {
3139
  clear: both;
3140
  overflow: hidden;
3141
  }
3142
  .premium-gallery-container .premium-gallery-item {
3143
  padding: 10px;
3144
- float: left;
 
 
 
3145
  }
3146
  .premium-img-gallery-filter .premium-gallery-cats-container li a.category {
3147
  border-radius: 75px;
@@ -3190,6 +3194,10 @@ button.premium-modal-box-modal-close {
3190
  -webkit-transform: translateX(-15px) scale(1.1);
3191
  transform: translateX(-15px) scale(1.1);
3192
  }
 
 
 
 
3193
  .pa-gallery-img .pa-gallery-magnific-image span,
3194
  .pa-gallery-img .pa-gallery-img-link span {
3195
  line-height: 1;
241
  }
242
  .premium_banner_animation2:hover .premium_addons-banner-ib-content,
243
  .premium_banner_animation2.active .premium_addons-banner-ib-content {
244
+ opacity: 1;
245
  -webkit-transform: translate3d(0, -30px, 0);
246
  transform: translate3d(0, -30px, 0);
247
  }
3118
  align-items: center;
3119
  justify-content: center;
3120
  }
3121
+ /*.premium-grid-50 .premium-gallery-item:nth-child(2n+1) {
3122
  clear: left;
3123
+ }*/
3124
+ /*.premium-grid-33330 .premium-gallery-item:nth-child(3n+1) {
3125
  clear: left;
3126
+ }*/
3127
+ /*.premium-grid-25 .premium-gallery-item:nth-child(4n+1) {
3128
  clear: left;
3129
+ }*/
3130
+ /*.premium-grid-20 .premium-gallery-item:nth-child(5n+1) {
3131
  clear: left;
3132
  }
3133
  .premium-grid-1666 .premium-gallery-item:nth-child(6n+1) {
3135
  }
3136
  .premium-grid-8333 .premium-gallery-item:nth-child(12n+1) {
3137
  clear: left;
3138
+ }*/
3139
  .premium-img-gallery {
3140
  clear: both;
3141
  overflow: hidden;
3142
  }
3143
  .premium-gallery-container .premium-gallery-item {
3144
  padding: 10px;
3145
+ /* float: left;*/
3146
+ }
3147
+ .premium-gallery-container .grid-sizer {
3148
+ width: 25%;
3149
  }
3150
  .premium-img-gallery-filter .premium-gallery-cats-container li a.category {
3151
  border-radius: 75px;
3194
  -webkit-transform: translateX(-15px) scale(1.1);
3195
  transform: translateX(-15px) scale(1.1);
3196
  }
3197
+ .pa-gallery-img .pa-gallery-magnific-image,
3198
+ .pa-gallery-img .pa-gallery-img-link {
3199
+ outline: none;
3200
+ }
3201
  .pa-gallery-img .pa-gallery-magnific-image span,
3202
  .pa-gallery-img .pa-gallery-img-link span {
3203
  line-height: 1;
assets/js/lib/countUpmin.js DELETED
@@ -1 +0,0 @@
1
- !function(a,e){"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=e(require,exports,module):a.CountUp=e()}(this,function(a,e,n){var t=function(a,e,n,t,i,r){function o(a){a=a.toFixed(s.decimals),a+="";var e,n,t,i;if(e=a.split("."),n=e[0],t=e.length>1?s.options.decimal+e[1]:"",i=/(\d+)(\d{3})/,s.options.useGrouping)for(;i.test(n);)n=n.replace(i,"$1"+s.options.separator+"$2");return s.options.numerals.length&&(n=n.replace(/[0-9]/g,function(a){return s.options.numerals[+a]}),t=t.replace(/[0-9]/g,function(a){return s.options.numerals[+a]})),s.options.prefix+n+t+s.options.suffix}function u(a,e,n,t){return n*(-Math.pow(2,-10*a/t)+1)*1024/1023+e}function l(a){return"number"==typeof a&&!isNaN(a)}var s=this;if(s.version=function(){return"1.9.1"},s.options={useEasing:!0,useGrouping:!0,separator:",",decimal:".",easingFn:u,formattingFn:o,prefix:"",suffix:"",numerals:[]},r&&"object"==typeof r)for(var m in s.options)r.hasOwnProperty(m)&&null!==r[m]&&(s.options[m]=r[m]);""===s.options.separator&&(s.options.useGrouping=!1);for(var d=0,c=["webkit","moz","ms","o"],f=0;f<c.length&&!window.requestAnimationFrame;++f)window.requestAnimationFrame=window[c[f]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[c[f]+"CancelAnimationFrame"]||window[c[f]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(a,e){var n=(new Date).getTime(),t=Math.max(0,16-(n-d)),i=window.setTimeout(function(){a(n+t)},t);return d=n+t,i}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(a){clearTimeout(a)}),s.initialize=function(){return!!s.initialized||(s.error="",s.d="string"==typeof a?document.getElementById(a):a,s.d?(s.startVal=Number(e),s.endVal=Number(n),l(s.startVal)&&l(s.endVal)?(s.decimals=Math.max(0,t||0),s.dec=Math.pow(10,s.decimals),s.duration=1e3*Number(i)||2e3,s.countDown=s.startVal>s.endVal,s.frameVal=s.startVal,s.initialized=!0,!0):(s.error="[CountUp] startVal ("+e+") or endVal ("+n+") is not a number",!1)):(s.error="[CountUp] target is null or undefined",!1))},s.printValue=function(a){var e=s.options.formattingFn(a);"INPUT"===s.d.tagName?this.d.value=e:"text"===s.d.tagName||"tspan"===s.d.tagName?this.d.textContent=e:this.d.innerHTML=e},s.count=function(a){s.startTime||(s.startTime=a),s.timestamp=a;var e=a-s.startTime;s.remaining=s.duration-e,s.options.useEasing?s.countDown?s.frameVal=s.startVal-s.options.easingFn(e,0,s.startVal-s.endVal,s.duration):s.frameVal=s.options.easingFn(e,s.startVal,s.endVal-s.startVal,s.duration):s.countDown?s.frameVal=s.startVal-(s.startVal-s.endVal)*(e/s.duration):s.frameVal=s.startVal+(s.endVal-s.startVal)*(e/s.duration),s.countDown?s.frameVal=s.frameVal<s.endVal?s.endVal:s.frameVal:s.frameVal=s.frameVal>s.endVal?s.endVal:s.frameVal,s.frameVal=Math.round(s.frameVal*s.dec)/s.dec,s.printValue(s.frameVal),e<s.duration?s.rAF=requestAnimationFrame(s.count):s.callback&&s.callback()},s.start=function(a){s.initialize()&&(s.callback=a,s.rAF=requestAnimationFrame(s.count))},s.pauseResume=function(){s.paused?(s.paused=!1,delete s.startTime,s.duration=s.remaining,s.startVal=s.frameVal,requestAnimationFrame(s.count)):(s.paused=!0,cancelAnimationFrame(s.rAF))},s.reset=function(){s.paused=!1,delete s.startTime,s.initialized=!1,s.initialize()&&(cancelAnimationFrame(s.rAF),s.printValue(s.startVal))},s.update=function(a){if(s.initialize()){if(a=Number(a),!l(a))return void(s.error="[CountUp] update() - new endVal is not a number: "+a);s.error="",a!==s.frameVal&&(cancelAnimationFrame(s.rAF),s.paused=!1,delete s.startTime,s.startVal=s.frameVal,s.endVal=a,s.countDown=s.startVal>s.endVal,s.rAF=requestAnimationFrame(s.count))}},s.initialize()&&s.printValue(s.startVal)};return t});
 
assets/js/premium-addons.js CHANGED
@@ -62,61 +62,30 @@
62
 
63
  /****** Premium Grid Handler ******/
64
  var PremiumGridWidgetHandler = function($scope, $) {
65
- if ($().isotope === undefined) {
66
- return;
 
 
 
 
 
 
67
  }
68
- var gridElement = $scope.find(".premium-img-gallery");
69
- if (gridElement.length === 0) {
70
- return;
71
- }
72
- var htmlContent = $scope.find(".premium-gallery-container");
73
- var isotopeOptions = htmlContent.data("settings");
74
- if (isotopeOptions["img_size"] === "original") {
75
- htmlContent.isotope({
76
- // options
77
- itemSelector: ".premium-gallery-item",
78
- percentPosition: true,
79
- animationOptions: {
80
- duration: 750,
81
- easing: "linear",
82
- queue: false
83
- }
84
- });
85
- htmlContent.imagesLoaded(function() {
86
- setTimeout(function() {
87
- htmlContent.isotope({
88
- layoutMode: "masonry",
89
- filter: isotopeOptions["active_cat"]
90
- });
91
- }, 1000);
92
- });
93
- } else if (isotopeOptions["img_size"] === "one_size") {
94
- htmlContent.isotope({
95
- // options
96
- itemSelector: ".premium-gallery-item",
97
- percentPosition: true,
98
- animationOptions: {
99
- duration: 750,
100
- easing: "linear",
101
- queue: false
102
- }
103
- });
104
- setTimeout(function() {
105
- htmlContent.isotope({
106
- layoutMode: "fitRows",
107
- filter: isotopeOptions["active_cat"]
108
  });
109
- }, 1000);
110
- // htmlContent.isotope({layoutMode: 'fitRows'});
111
- $(window).on("load", function() {
112
- setTimeout(function() {
113
- htmlContent.isotope({
114
- layoutMode: "fitRows",
115
- filter: isotopeOptions["active_cat"]
116
- });
117
- }, 1000);
118
- });
119
- }
120
 
121
  $scope.find(".premium-gallery-cats-container li a").click(function(e) {
122
  e.preventDefault();
@@ -125,7 +94,7 @@
125
  .removeClass("active");
126
  $(this).addClass("active");
127
  var selector = $(this).attr("data-filter");
128
- htmlContent.isotope({ filter: selector });
129
  return false;
130
  });
131
 
@@ -135,7 +104,7 @@
135
  opacity: 0.7,
136
  show_title: false,
137
  deeplinking: false,
138
- overlay_gallery: false,
139
  custom_markup: "",
140
  default_width: 900,
141
  default_height: 506,
@@ -145,61 +114,13 @@
145
 
146
  /****** Premium Counter Handler ******/
147
  var PremiumCounterHandler = function($scope, $) {
148
- var counterElement = $scope.find(".premium-counter").each(function() {
149
- var counterSettings = $(this).data("settings");
150
-
151
- var counter_offset = $(this).offset().top;
152
- var counter = new CountUp(
153
- "counter-" + counterSettings["id"],
154
- 0,
155
- counterSettings["value"],
156
- counterSettings["d_after"],
157
- counterSettings["speed"],
158
- {
159
- useEasing: true,
160
- separator: counterSettings["separator"],
161
- decimal: counterSettings["decimal"]
162
- }
163
- );
164
- if (counter_offset < $(window).outerHeight() - 150) {
165
- counter.start();
166
- }
167
- function start_counter() {
168
- if ($(window).scrollTop() > counter_offset - 600) {
169
- counter.start();
170
- }
171
- }
172
- function isScrolledIntoView(elem) {
173
- var docViewTop = $(window).scrollTop();
174
- var docViewBottom = docViewTop + $(window).height();
175
- var elemTop = elem.offset().top;
176
- var elemBottom = elemTop + elem.height();
177
- return elemBottom <= docViewBottom && elemTop >= docViewTop;
178
- }
179
- function addAnimation() {
180
- $(".premium-counter-init").each(function() {
181
- var $this = $(this),
182
- parentId = $this.parents(".premium-counter-area").attr("id"),
183
- iconClass = $("#" + parentId).find(".icon"),
184
- animation = iconClass.data("animation");
185
- if (iconClass.length) {
186
- if (isScrolledIntoView(iconClass)) {
187
- if (!iconClass.hasClass("animated")) {
188
- $("#" + parentId)
189
- .find(".icon")
190
- .addClass("animated " + animation);
191
- }
192
- }
193
- }
194
- });
195
- }
196
- addAnimation();
197
- $(document).ready(function() {
198
- $(window).on("scroll", function() {
199
- addAnimation();
200
- start_counter();
201
- });
202
- });
203
  });
204
  };
205
 
62
 
63
  /****** Premium Grid Handler ******/
64
  var PremiumGridWidgetHandler = function($scope, $) {
65
+ var galleryElement = $scope.find(".premium-gallery-container"),
66
+ isotopeOptions = galleryElement.data("settings"),
67
+ layout = isotopeOptions['img_size'],
68
+ columnWidth = null;
69
+
70
+ if( layout === 'metro' ) {
71
+ layout = 'masonry';
72
+ columnWidth = ".grid-sizer";
73
  }
74
+ var grid = galleryElement.imagesLoaded(function() {
75
+ grid.isotope({
76
+ itemSelector: ".premium-gallery-item",
77
+ percentPosition: true,
78
+ animationOptions: {
79
+ duration: 750,
80
+ easing: "linear"
81
+ },
82
+ filter: isotopeOptions["active_cat"],
83
+ layoutMode: layout,
84
+ masonry: {
85
+ columnWidth: columnWidth
86
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  });
88
+ });
 
 
 
 
 
 
 
 
 
 
89
 
90
  $scope.find(".premium-gallery-cats-container li a").click(function(e) {
91
  e.preventDefault();
94
  .removeClass("active");
95
  $(this).addClass("active");
96
  var selector = $(this).attr("data-filter");
97
+ galleryElement.isotope({ filter: selector });
98
  return false;
99
  });
100
 
104
  opacity: 0.7,
105
  show_title: false,
106
  deeplinking: false,
107
+ overlay_gallery: isotopeOptions['overlay_gallery'],
108
  custom_markup: "",
109
  default_width: 900,
110
  default_height: 506,
114
 
115
  /****** Premium Counter Handler ******/
116
  var PremiumCounterHandler = function($scope, $) {
117
+ var counterElement = $scope.find(".premium-counter");
118
+ elementorFrontend.waypoint(counterElement, function () {
119
+ var counterSettings = counterElement.data(),
120
+ incrementElement = counterElement.find(".premium-counter-init"),
121
+ iconElement = counterElement.find(".icon");
122
+ $(incrementElement).numerator(counterSettings);
123
+ $(iconElement).addClass( "animated " + iconElement.data("animation") );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  });
125
  };
126
 
includes/class-addons-integration.php CHANGED
@@ -140,13 +140,13 @@ class Premium_Addons_Integration {
140
  true
141
  );
142
 
143
- wp_register_script(
144
- 'counter-up-js',
145
- PREMIUM_ADDONS_URL . 'assets/js/lib/countUpmin.js',
146
- array('jquery'),
147
- PREMIUM_ADDONS_VERSION,
148
- true
149
- );
150
 
151
  wp_register_script(
152
  'isotope-js',
140
  true
141
  );
142
 
143
+ // wp_register_script(
144
+ // 'counter-up-js',
145
+ // PREMIUM_ADDONS_URL . 'assets/js/lib/countUpmin.js',
146
+ // array('jquery'),
147
+ // PREMIUM_ADDONS_VERSION,
148
+ // true
149
+ // );
150
 
151
  wp_register_script(
152
  'isotope-js',
premium-addons-for-elementor.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Premium Addons for Elementor
4
  Description: Premium Addons Plugin Includes 21+ premium widgets for Elementor Page Builder.
5
  Plugin URI: https://premiumaddons.com
6
- Version: 3.1.0
7
  Author: Leap13
8
  Author URI: http://leap13.com/
9
  Text Domain: premium-addons-for-elementor
@@ -23,12 +23,12 @@ if ( ! defined('ABSPATH') ) exit; // No access of directly access
23
 
24
 
25
  // Define Constants
26
- define('PREMIUM_ADDONS_VERSION', '3.1.0');
27
  define('PREMIUM_ADDONS_URL', plugins_url('/', __FILE__));
28
  define('PREMIUM_ADDONS_PATH', plugin_dir_path(__FILE__));
29
  define('PREMIUM_ADDONS_FILE', __FILE__);
30
  define('PREMIUM_ADDONS_BASENAME', plugin_basename(__FILE__));
31
- define('PREMIUM_ADDONS_STABLE_VERSION', '3.0.9');
32
 
33
  if( ! class_exists('Premium_Addons_Elementor') ) {
34
  /*
3
  Plugin Name: Premium Addons for Elementor
4
  Description: Premium Addons Plugin Includes 21+ premium widgets for Elementor Page Builder.
5
  Plugin URI: https://premiumaddons.com
6
+ Version: 3.1.1
7
  Author: Leap13
8
  Author URI: http://leap13.com/
9
  Text Domain: premium-addons-for-elementor
23
 
24
 
25
  // Define Constants
26
+ define('PREMIUM_ADDONS_VERSION', '3.1.1');
27
  define('PREMIUM_ADDONS_URL', plugins_url('/', __FILE__));
28
  define('PREMIUM_ADDONS_PATH', plugin_dir_path(__FILE__));
29
  define('PREMIUM_ADDONS_FILE', __FILE__);
30
  define('PREMIUM_ADDONS_BASENAME', plugin_basename(__FILE__));
31
+ define('PREMIUM_ADDONS_STABLE_VERSION', '3.1.0');
32
 
33
  if( ! class_exists('Premium_Addons_Elementor') ) {
34
  /*
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: http://premiumaddons.com
5
  Requires at least: 4.5
6
  Tested up to: 5.0.3
7
  Requires PHP: 5.4
8
- Stable tag: 3.1.0
9
  License: GPL v3.0
10
  License URI: https://opensource.org/licenses/GPL-3.0
11
 
@@ -138,6 +138,16 @@ Premium Addons for Elementor is 100% Ads Free, Ads can only be detected from You
138
 
139
  == Changelog ==
140
 
 
 
 
 
 
 
 
 
 
 
141
  = 3.1.0 =
142
 
143
  - Tweak: Added `Carousel` option for Blog widget.
5
  Requires at least: 4.5
6
  Tested up to: 5.0.3
7
  Requires PHP: 5.4
8
+ Stable tag: 3.1.1
9
  License: GPL v3.0
10
  License URI: https://opensource.org/licenses/GPL-3.0
11
 
138
 
139
  == Changelog ==
140
 
141
+ = 3.1.1 =
142
+
143
+ - Tweak: Added `Metro Layout` for Grid widget.
144
+ - Tweak: `Show Gallery Images` on lightbox option added to Grid widget.
145
+ - Tweak: Added `Start Number` option for Counter widget.
146
+ - Tweak: Icon Animation while scrolling enhanced for Counter widget.
147
+ - Tweak: JS code refactor to improve performance speed.
148
+ - Fixed: Images overlap issue after page reload in Grid widget.
149
+ - Fixed: Description not showing with `Effect 4` in Banner widget.
150
+
151
  = 3.1.0 =
152
 
153
  - Tweak: Added `Carousel` option for Blog widget.
widgets/premium-counter.php CHANGED
@@ -19,7 +19,8 @@ class Premium_Counter extends Widget_Base {
19
 
20
  public function get_script_depends() {
21
  return [
22
- 'counter-up-js',
 
23
  'premium-addons-js',
24
  ];
25
  }
@@ -46,11 +47,18 @@ class Premium_Counter extends Widget_Base {
46
  ]
47
  );
48
 
49
- $this->add_control('premium_counter_value',
50
  [
51
- 'label' => __( 'Value', 'premium-addons-for-elementor' ),
 
 
 
 
 
 
 
 
52
  'type' => Controls_Manager::NUMBER,
53
- 'description' => __( 'Enter Counter Value', 'premium-addons-for-elementor' ),
54
  'default' => 500
55
  ]
56
  );
@@ -65,16 +73,16 @@ class Premium_Counter extends Widget_Base {
65
  ]
66
  );
67
 
68
- $this->add_control('premium_counter_d_separator',
69
- [
70
- 'label' => __( 'Decimal Point', 'premium-addons-for-elementor' ),
71
- 'type' => Controls_Manager::TEXT,
72
- 'dynamic' => [ 'active' => true ],
73
- 'description' => __( 'Set a decimal number (Eg - 12.76). The decimal point '.' will be replaced with the value that you will enter above', 'premium-addons-for-elementor' ),
74
- 'default' => '.'
75
- ]
76
- );
77
-
78
  $this->add_control('premium_counter_d_after',
79
  [
80
  'label' => __( 'Digits After Decimal Point', 'premium-addons-for-elementor' ),
@@ -486,28 +494,38 @@ class Premium_Counter extends Widget_Base {
486
 
487
  public function get_counter_content($settings, $direction) {
488
 
489
- $d_after = intval( $settings['premium_counter_d_after'] );
490
- $d_s = $settings['premium_counter_d_separator'];
491
- $t_s = $settings['premium_counter_t_separator'];
492
- $exact_value = number_format( $settings['premium_counter_value'] , $d_after, $d_s, $t_s );
493
 
494
  ?>
495
 
496
  <div class="premium-init-wrapper <?php echo $direction; ?>">
497
 
498
- <?php if ( ! empty( $settings['premium_counter_preffix'] ) ) : ?><span id="prefix" class="counter-su-pre"><?php echo $settings['premium_counter_preffix']; ?></span><?php endif; ?>
 
 
499
 
500
- <span class="premium-counter-init" id="counter-<?php echo esc_attr($this->get_id()); ?>"><?php echo $exact_value; ?></span>
501
 
502
- <?php if (!empty( $settings['premium_counter_suffix'] ) ) : ?><span id="suffix" class="counter-su-pre"><?php echo $settings['premium_counter_suffix']; ?></span><?php endif; ?>
 
 
503
 
504
- <?php if ( ! empty( $settings['premium_counter_title'] ) ) : ?><h4 class="premium-counter-title"><div <?php echo $this->get_render_attribute_string('premium_counter_title'); ?>><?php echo $settings['premium_counter_title'];?></div></h4><?php endif; ?>
 
 
 
 
 
 
505
  </div>
506
 
507
  <?php
508
  }
509
 
510
- public function get_counter_icon($settings, $direction) {
511
 
512
  $icon_style = $settings['premium_counter_icon_style'] != 'simple' ? ' icon-bg ' . $settings['premium_counter_icon_style'] : '';
513
 
@@ -538,9 +556,9 @@ class Premium_Counter extends Widget_Base {
538
 
539
  $this->add_inline_editing_attributes('premium_counter_title');
540
 
541
- $separator = $settings['premium_counter_t_separator'];
542
-
543
- $decimal = $settings['premium_counter_d_separator'];
544
 
545
  if( $settings['premium_counter_icon_image'] == 'icon' ) {
546
  $icon_image = '<i class="' . $settings['premium_counter_icon'] .'"></i>';
@@ -555,28 +573,33 @@ class Premium_Counter extends Widget_Base {
555
 
556
  $left = $position == 'left' ? ' left' : '';
557
 
558
-
559
- $d_after = intval( $settings['premium_counter_d_after'] );
560
-
561
  $flex_width = '';
562
  if( $settings['premium_counter_icon_image'] == 'custom' && $settings['premium_counter_icon_style'] == 'simple' ) {
563
  $flex_width = ' flex-width ';
564
  }
565
 
566
- $counter_settings = [
567
- 'id' => $this->get_id(),
568
- 'value' => $settings['premium_counter_value'],
569
- 'digits_after' => $d_after,
570
- 'speed' => $settings['premium_counter_speed'],
571
- 'separator' => $separator,
572
- 'decimal' => $decimal,
573
- ];
574
 
575
- $this->add_render_attribute( 'counter', 'id', 'counter-wrapper-'. $this->get_id() );
576
 
577
- $this->add_render_attribute( 'counter', 'class', [ 'premium-counter', 'premium-counter-area' . $center ] );
578
 
579
- $this->add_render_attribute( 'counter', 'data-settings', wp_json_encode( $counter_settings ) );
 
 
 
 
 
 
 
 
 
580
 
581
  ?>
582
 
19
 
20
  public function get_script_depends() {
21
  return [
22
+ 'jquery-numerator',
23
+ 'elementor-waypoints',
24
  'premium-addons-js',
25
  ];
26
  }
47
  ]
48
  );
49
 
50
+ $this->add_control('premium_counter_start_value',
51
  [
52
+ 'label' => __( 'Start Number', 'premium-addons-for-elementor' ),
53
+ 'type' => Controls_Manager::NUMBER,
54
+ 'default' => 0
55
+ ]
56
+ );
57
+
58
+ $this->add_control('premium_counter_end_value',
59
+ [
60
+ 'label' => __( 'End Number', 'premium-addons-for-elementor' ),
61
  'type' => Controls_Manager::NUMBER,
 
62
  'default' => 500
63
  ]
64
  );
73
  ]
74
  );
75
 
76
+ // $this->add_control('premium_counter_d_separator',
77
+ // [
78
+ // 'label' => __( 'Decimal Point', 'premium-addons-for-elementor' ),
79
+ // 'type' => Controls_Manager::TEXT,
80
+ // 'dynamic' => [ 'active' => true ],
81
+ // 'description' => __( 'Set a decimal number (Eg - 12.76). The decimal point '.' will be replaced with the value that you will enter above', 'premium-addons-for-elementor' ),
82
+ // 'default' => '.'
83
+ // ]
84
+ // );
85
+ //
86
  $this->add_control('premium_counter_d_after',
87
  [
88
  'label' => __( 'Digits After Decimal Point', 'premium-addons-for-elementor' ),
494
 
495
  public function get_counter_content($settings, $direction) {
496
 
497
+ // $d_after = intval( $settings['premium_counter_d_after'] );
498
+ // $d_s = $settings['premium_counter_d_separator'];
499
+ // $t_s = $settings['premium_counter_t_separator'];
500
+ $start_value = $settings['premium_counter_start_value'];
501
 
502
  ?>
503
 
504
  <div class="premium-init-wrapper <?php echo $direction; ?>">
505
 
506
+ <?php if ( ! empty( $settings['premium_counter_preffix'] ) ) : ?>
507
+ <span id="prefix" class="counter-su-pre"><?php echo $settings['premium_counter_preffix']; ?></span>
508
+ <?php endif; ?>
509
 
510
+ <span class="premium-counter-init" id="counter-<?php echo esc_attr($this->get_id()); ?>"><?php echo $start_value; ?></span>
511
 
512
+ <?php if ( ! empty( $settings['premium_counter_suffix'] ) ) : ?>
513
+ <span id="suffix" class="counter-su-pre"><?php echo $settings['premium_counter_suffix']; ?></span>
514
+ <?php endif; ?>
515
 
516
+ <?php if ( ! empty( $settings['premium_counter_title'] ) ) : ?>
517
+ <h4 class="premium-counter-title">
518
+ <div <?php echo $this->get_render_attribute_string('premium_counter_title'); ?>>
519
+ <?php echo $settings['premium_counter_title'];?>
520
+ </div>
521
+ </h4>
522
+ <?php endif; ?>
523
  </div>
524
 
525
  <?php
526
  }
527
 
528
+ public function get_counter_icon( $settings, $direction ) {
529
 
530
  $icon_style = $settings['premium_counter_icon_style'] != 'simple' ? ' icon-bg ' . $settings['premium_counter_icon_style'] : '';
531
 
556
 
557
  $this->add_inline_editing_attributes('premium_counter_title');
558
 
559
+ // $separator = $settings['premium_counter_t_separator'];
560
+ //
561
+ // $decimal = $settings['premium_counter_d_separator'];
562
 
563
  if( $settings['premium_counter_icon_image'] == 'icon' ) {
564
  $icon_image = '<i class="' . $settings['premium_counter_icon'] .'"></i>';
573
 
574
  $left = $position == 'left' ? ' left' : '';
575
 
 
 
 
576
  $flex_width = '';
577
  if( $settings['premium_counter_icon_image'] == 'custom' && $settings['premium_counter_icon_style'] == 'simple' ) {
578
  $flex_width = ' flex-width ';
579
  }
580
 
581
+ // $counter_settings = [
582
+ // 'id' => $this->get_id(),
583
+ // 'toValue' => $settings['premium_counter_end_value'],
584
+ // 'speed' => $settings['premium_counter_speed'],
585
+ // 'separator' => $separator,
586
+ // 'decimal' => $decimal,
587
+ // ];
 
588
 
589
+ //$this->add_render_attribute( 'counter', 'id', 'counter-wrapper-'. $this->get_id() );
590
 
591
+ //$this->add_render_attribute( 'counter', 'class', [ 'premium-counter', 'premium-counter-area' . $center ] );
592
 
593
+ //$this->add_render_attribute( 'counter', 'data-settings', wp_json_encode( $counter_settings ) );
594
+
595
+ $this->add_render_attribute( 'counter', [
596
+ 'class' => [ 'premium-counter', 'premium-counter-area' . $center ],
597
+ 'data-duration' => $settings['premium_counter_speed'] * 1000,
598
+ 'data-to-value' => $settings['premium_counter_end_value'],
599
+ 'data-delimiter'=> empty( $settings['premium_counter_t_separator'] ) ? ',' : $settings['premium_counter_t_separator'],
600
+ 'data-rounding' => empty ( $settings['premium_counter_d_after'] ) ? 0 : $settings['premium_counter_d_after']
601
+ ]
602
+ );
603
 
604
  ?>
605
 
widgets/premium-grid.php CHANGED
@@ -46,6 +46,65 @@ class Premium_Grid extends Widget_Base {
46
 
47
  protected function _register_controls(){
48
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  $this->start_controls_section('premium_gallery_cats',
50
  [
51
  'label' => __('Categories','premium-addons-for-elementor'),
@@ -147,6 +206,32 @@ class Premium_Grid extends Widget_Base {
147
  ],
148
  ]);
149
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  $img_repeater->add_control('premium_gallery_img_name',
151
  [
152
  'label' => __( 'Name', 'premium-addons-for-elementor' ),
@@ -247,53 +332,6 @@ class Premium_Grid extends Widget_Base {
247
 
248
  ]);
249
 
250
- $this->add_responsive_control('premium_gallery_column_number',
251
- [
252
- 'label' => __( 'Columns', 'premium-addons-for-elementor' ),
253
- 'label_block' => true,
254
- 'type' => Controls_Manager::SELECT,
255
- 'desktop_default' => '50%',
256
- 'tablet_default' => '100%',
257
- 'mobile_default' => '100%',
258
- 'options' => [
259
- '100%' => __( '1 Column', 'premium-addons-for-elementor' ),
260
- '50%' => __( '2 Columns', 'premium-addons-for-elementor' ),
261
- '33.330%' => __( '3 Columns', 'premium-addons-for-elementor' ),
262
- '25%' => __( '4 Columns', 'premium-addons-for-elementor' ),
263
- '20%' => __( '5 Columns', 'premium-addons-for-elementor' ),
264
- '16.66%' => __( '6 Columns', 'premium-addons-for-elementor' ),
265
- '8.33%' => __( '12 Columns', 'premium-addons-for-elementor' ),
266
- ],
267
- 'selectors' => [
268
- '{{WRAPPER}} .premium-gallery-container .premium-gallery-item' => 'width: {{VALUE}};',
269
- ],
270
- 'render_type' => 'template'
271
- ]
272
- );
273
-
274
- $this->add_control('premium_gallery_img_size_select',
275
- [
276
- 'label' => __('Grid Layout', 'premium-addons-for-elementor'),
277
- 'type' => Controls_Manager::SELECT,
278
- 'options' => [
279
- 'one_size' => __('Even', 'premium-addons-for-elementor'),
280
- 'original' => __('Masonry', 'premium-addons-for-elementor'),
281
- ],
282
- 'default' => 'one_size',
283
- ]
284
- );
285
-
286
- $this->add_group_control(
287
- Group_Control_Image_Size::get_type(),
288
- [
289
- 'name' => 'thumbnail', // Actually its `image_size`.
290
- 'default' => 'full',
291
- 'condition' => [
292
- 'premium_gallery_img_size_select' => 'one_size'
293
- ]
294
- ]
295
- );
296
-
297
  $this->add_responsive_control('premium_gallery_gap',
298
  [
299
  'label' => __('Image Gap', 'premium-addons-for-elementor'),
@@ -375,6 +413,16 @@ class Premium_Grid extends Widget_Base {
375
  ]
376
  );
377
 
 
 
 
 
 
 
 
 
 
 
378
  $this->add_responsive_control('premium_gallery_content_align',
379
  [
380
  'label' => __( 'Content Alignment', 'premium-addons-for-elementor' ),
@@ -1086,6 +1134,7 @@ class Premium_Grid extends Widget_Base {
1086
  return $cat_filtered;
1087
  }
1088
 
 
1089
  protected function render(){
1090
  $settings = $this->get_settings_for_display();
1091
  $filter = $settings['premium_gallery_filter'];
@@ -1104,10 +1153,17 @@ class Premium_Grid extends Widget_Base {
1104
  $category_formatted = "." . $this->filter_cats($active_category);
1105
  }
1106
 
 
 
 
 
 
 
1107
  $grid_settings = [
1108
  'img_size' => $settings['premium_gallery_img_size_select'],
1109
  'filter' => $settings['premium_gallery_filter'],
1110
  'light_box' => $settings['premium_gallery_light_box'],
 
1111
  'active_cat'=> $category_formatted
1112
  ];
1113
 
@@ -1126,7 +1182,11 @@ class Premium_Grid extends Widget_Base {
1126
  <div class="premium-img-gallery-filter">
1127
  <ul class="premium-gallery-cats-container">
1128
  <?php if( 'yes' == $settings['premium_gallery_first_cat_switcher'] ) : ?>
1129
- <li><a href="javascript:;" class="category <?php echo $is_all_active; ?>" data-filter="*"><span><?php echo $settings['premium_gallery_first_cat_label']; ?></span></a></li>
 
 
 
 
1130
  <?php endif;
1131
  foreach( $settings['premium_gallery_cats_content'] as $index => $category ) {
1132
  if( ! empty( $category['premium_gallery_img_cat'] ) ) {
@@ -1140,27 +1200,46 @@ class Premium_Grid extends Widget_Base {
1140
  }
1141
 
1142
  $this->add_render_attribute($cat_list_key,
1143
- 'class',
1144
- array(
1145
  'category',
1146
  'elementor-repeater-item-' . $category['_id']
1147
- )
1148
  );
1149
  ?>
1150
- <li><a href="javascript:;" <?php echo $this->get_render_attribute_string($cat_list_key); ?> data-filter=".<?php echo esc_attr( $cat_filtered ); ?>"><span><?php echo $category['premium_gallery_img_cat']; ?></span></a></li>
 
 
 
 
1151
  <?php }
1152
  } ?>
1153
- </ul>
1154
- </div>
1155
  <?php endif; ?>
 
1156
  <div class="premium-gallery-container js-isotope <?php echo esc_attr( $number_columns ); ?>" data-settings='<?php echo wp_json_encode($grid_settings); ?>'>
1157
- <?php foreach( $settings['premium_gallery_img_content'] as $image ) :
 
 
 
1158
  $alt = esc_attr( Control_Media::get_image_alt( $image['premium_gallery_img'] ) );
 
 
 
 
 
 
 
 
 
 
 
 
1159
  ?>
1160
- <div class="premium-gallery-item <?php echo esc_attr( $this->filter_cats( $image['premium_gallery_img_category'] ) ); ?>">
1161
  <div class="pa-gallery-img <?php echo esc_attr($layout); ?>" onclick="">
1162
  <div class="pa-gallery-img-container <?php echo esc_attr($settings['premium_gallery_img_effect']); ?>">
1163
- <?php if($settings['premium_gallery_img_size_select'] == 'one_size') :
1164
  $image_src = $image['premium_gallery_img'];
1165
  $image_src_size = Group_Control_Image_Size::get_attachment_image_src( $image_src['id'], 'thumbnail', $settings );
1166
  if( empty( $image_src_size ) ) : $image_src_size = $image_src['url']; else: $image_src_size = $image_src_size; endif;
46
 
47
  protected function _register_controls(){
48
 
49
+ $this->start_controls_section('premium_gallery_general',
50
+ [
51
+ 'label' => __('Layout','premium-addons-for-elementor'),
52
+
53
+ ]);
54
+
55
+ $this->add_control('premium_gallery_img_size_select',
56
+ [
57
+ 'label' => __('Grid Layout', 'premium-addons-for-elementor'),
58
+ 'type' => Controls_Manager::SELECT,
59
+ 'options' => [
60
+ 'fitRows' => __('Even', 'premium-addons-for-elementor'),
61
+ 'masonry' => __('Masonry', 'premium-addons-for-elementor'),
62
+ 'metro' => __('Metro', 'premium-addons-for-elementor'),
63
+ ],
64
+ 'default' => 'fitRows',
65
+ ]
66
+ );
67
+
68
+ $this->add_group_control(
69
+ Group_Control_Image_Size::get_type(),
70
+ [
71
+ 'name' => 'thumbnail', // Actually its `image_size`.
72
+ 'default' => 'full',
73
+ 'condition' => [
74
+ 'premium_gallery_img_size_select' => 'fitRows'
75
+ ]
76
+ ]
77
+ );
78
+
79
+ $this->add_responsive_control('premium_gallery_column_number',
80
+ [
81
+ 'label' => __( 'Columns', 'premium-addons-for-elementor' ),
82
+ 'label_block' => true,
83
+ 'type' => Controls_Manager::SELECT,
84
+ 'desktop_default' => '50%',
85
+ 'tablet_default' => '100%',
86
+ 'mobile_default' => '100%',
87
+ 'options' => [
88
+ '100%' => __( '1 Column', 'premium-addons-for-elementor' ),
89
+ '50%' => __( '2 Columns', 'premium-addons-for-elementor' ),
90
+ '33.330%' => __( '3 Columns', 'premium-addons-for-elementor' ),
91
+ '25%' => __( '4 Columns', 'premium-addons-for-elementor' ),
92
+ '20%' => __( '5 Columns', 'premium-addons-for-elementor' ),
93
+ '16.66%' => __( '6 Columns', 'premium-addons-for-elementor' ),
94
+ '8.33%' => __( '12 Columns', 'premium-addons-for-elementor' ),
95
+ ],
96
+ 'selectors' => [
97
+ '{{WRAPPER}} .premium-gallery-container div.premium-gallery-item' => 'width: {{VALUE}};',
98
+ ],
99
+ 'condition' => [
100
+ 'premium_gallery_img_size_select!' => 'metro'
101
+ ],
102
+ 'render_type' => 'template'
103
+ ]
104
+ );
105
+
106
+ $this->end_controls_section();
107
+
108
  $this->start_controls_section('premium_gallery_cats',
109
  [
110
  'label' => __('Categories','premium-addons-for-elementor'),
206
  ],
207
  ]);
208
 
209
+ $img_repeater->add_responsive_control('premium_gallery_image_width',
210
+ [
211
+ 'label' => __( 'Width', 'premium-addons-for-elementor' ),
212
+ 'description' => __('Works only when layout set to \'Metro\'', 'premium-addons-for-elementor'),
213
+ 'label_block' => true,
214
+ 'type' => Controls_Manager::SELECT,
215
+ 'desktop_default' => '50%',
216
+ 'tablet_default' => '100%',
217
+ 'mobile_default' => '100%',
218
+ 'options' => [
219
+ '100%' => __( 'Full Column', 'premium-addons-for-elementor' ),
220
+ '75%' => __( '3/4 Column', 'premium-addons-for-elementor' ),
221
+ '50%' => __( '1/2 Column', 'premium-addons-for-elementor' ),
222
+ '33.330%' => __( '1/3 Column', 'premium-addons-for-elementor' ),
223
+ '25%' => __( '1/4 Column', 'premium-addons-for-elementor' ),
224
+ '20%' => __( '1/5 Column', 'premium-addons-for-elementor' ),
225
+ '16.66%' => __( '1/6 Column', 'premium-addons-for-elementor' ),
226
+ '8.33%' => __( '1/12 Column', 'premium-addons-for-elementor' ),
227
+ ],
228
+ 'selectors' => [
229
+ '{{WRAPPER}} .premium-gallery-container {{CURRENT_ITEM}}' => 'width: {{VALUE}};',
230
+ ],
231
+ 'render_type' => 'template'
232
+ ]
233
+ );
234
+
235
  $img_repeater->add_control('premium_gallery_img_name',
236
  [
237
  'label' => __( 'Name', 'premium-addons-for-elementor' ),
332
 
333
  ]);
334
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
335
  $this->add_responsive_control('premium_gallery_gap',
336
  [
337
  'label' => __('Image Gap', 'premium-addons-for-elementor'),
413
  ]
414
  );
415
 
416
+ $this->add_control('premium_gallery_overlay_gallery',
417
+ [
418
+ 'label' => __( 'Overlay Gallery Images', 'premium-addons-for-elementor' ),
419
+ 'type' => Controls_Manager::SWITCHER,
420
+ 'condition' => [
421
+ 'premium_gallery_light_box' => 'yes'
422
+ ]
423
+ ]
424
+ );
425
+
426
  $this->add_responsive_control('premium_gallery_content_align',
427
  [
428
  'label' => __( 'Content Alignment', 'premium-addons-for-elementor' ),
1134
  return $cat_filtered;
1135
  }
1136
 
1137
+
1138
  protected function render(){
1139
  $settings = $this->get_settings_for_display();
1140
  $filter = $settings['premium_gallery_filter'];
1153
  $category_formatted = "." . $this->filter_cats($active_category);
1154
  }
1155
 
1156
+ if ( 'original' == $settings['premium_gallery_img_size_select'] ) {
1157
+ $settings['premium_gallery_img_size_select'] = 'masonry';
1158
+ } else if ( 'one_size' == $settings['premium_gallery_img_size_select'] ) {
1159
+ $settings['premium_gallery_img_size_select'] = 'fitRows';
1160
+ }
1161
+
1162
  $grid_settings = [
1163
  'img_size' => $settings['premium_gallery_img_size_select'],
1164
  'filter' => $settings['premium_gallery_filter'],
1165
  'light_box' => $settings['premium_gallery_light_box'],
1166
+ 'overlay_gallery' => 'yes' == $settings['premium_gallery_overlay_gallery'] ? true : false,
1167
  'active_cat'=> $category_formatted
1168
  ];
1169
 
1182
  <div class="premium-img-gallery-filter">
1183
  <ul class="premium-gallery-cats-container">
1184
  <?php if( 'yes' == $settings['premium_gallery_first_cat_switcher'] ) : ?>
1185
+ <li>
1186
+ <a href="javascript:;" class="category <?php echo $is_all_active; ?>" data-filter="*">
1187
+ <span><?php echo $settings['premium_gallery_first_cat_label']; ?></span>
1188
+ </a>
1189
+ </li>
1190
  <?php endif;
1191
  foreach( $settings['premium_gallery_cats_content'] as $index => $category ) {
1192
  if( ! empty( $category['premium_gallery_img_cat'] ) ) {
1200
  }
1201
 
1202
  $this->add_render_attribute($cat_list_key,
1203
+ 'class', [
 
1204
  'category',
1205
  'elementor-repeater-item-' . $category['_id']
1206
+ ]
1207
  );
1208
  ?>
1209
+ <li>
1210
+ <a href="javascript:;" <?php echo $this->get_render_attribute_string($cat_list_key); ?> data-filter=".<?php echo esc_attr( $cat_filtered ); ?>"
1211
+ ><span><?php echo $category['premium_gallery_img_cat']; ?></span>
1212
+ </a>
1213
+ </li>
1214
  <?php }
1215
  } ?>
1216
+ </ul>
1217
+ </div>
1218
  <?php endif; ?>
1219
+
1220
  <div class="premium-gallery-container js-isotope <?php echo esc_attr( $number_columns ); ?>" data-settings='<?php echo wp_json_encode($grid_settings); ?>'>
1221
+ <?php if ( 'metro' === $settings['premium_gallery_img_size_select'] ) : ?>
1222
+ <div class="grid-sizer"></div>
1223
+ <?php endif;
1224
+ foreach( $settings['premium_gallery_img_content'] as $index => $image ) :
1225
  $alt = esc_attr( Control_Media::get_image_alt( $image['premium_gallery_img'] ) );
1226
+
1227
+ $key = 'gallery_item_' . $index;
1228
+
1229
+ $this->add_render_attribute($key, [
1230
+ 'class' => [
1231
+ 'premium-gallery-item',
1232
+ 'elementor-repeater-item-' . $image['_id'],
1233
+ $this->filter_cats( $image['premium_gallery_img_category'] )
1234
+ ]
1235
+ ]
1236
+ );
1237
+
1238
  ?>
1239
+ <div <?php echo $this->get_render_attribute_string($key); ?>>
1240
  <div class="pa-gallery-img <?php echo esc_attr($layout); ?>" onclick="">
1241
  <div class="pa-gallery-img-container <?php echo esc_attr($settings['premium_gallery_img_effect']); ?>">
1242
+ <?php if($settings['premium_gallery_img_size_select'] == 'fitRows') :
1243
  $image_src = $image['premium_gallery_img'];
1244
  $image_src_size = Group_Control_Image_Size::get_attachment_image_src( $image_src['id'], 'thumbnail', $settings );
1245
  if( empty( $image_src_size ) ) : $image_src_size = $image_src['url']; else: $image_src_size = $image_src_size; endif;