Happy Addons for Elementor (Mega Menu, Post Grid, Woocommerce Product Grid, Table, Event Calendar, Slider Elementor Widget) - Version 2.7.3

Version Description

  • 31 March 2020 =

  • Tweak: Custom attribute output support for all links

  • Tweak: Added pro widgets awarness panel

  • Fix: Missing styles issue on page/post clone

  • Fix: Popup link not working with link issue

  • Fix: Twitter feed issue

Download this release

Release Info

Developer thehappymonster
Plugin Icon 128x128 Happy Addons for Elementor (Mega Menu, Post Grid, Woocommerce Product Grid, Table, Event Calendar, Slider Elementor Widget)
Version 2.7.3
Comparing to
See all releases

Code changes from version 2.7.2 to 2.7.3

assets/admin/css/editor.css CHANGED
@@ -1,3 +1,8 @@
 
 
 
 
 
1
  .elementor-panel #elementor-panel-category-happy_addons_category .elementor-element:hover .icon,
2
  .elementor-panel #elementor-panel-category-happy_addons_category .elementor-element:hover .title,
3
  .elementor-panel #elementor-panel-category-happy_addons_category .elementor-element:focus .icon,
@@ -71,3 +76,7 @@
71
  bottom: calc(100% + 5px);
72
  left: 100%;
73
  }
 
 
 
 
1
+ .elementor-panel .ha-element--promotion > .elementor-element > .eicon-lock {
2
+ right: auto;
3
+ left: 5px;
4
+ }
5
+
6
  .elementor-panel #elementor-panel-category-happy_addons_category .elementor-element:hover .icon,
7
  .elementor-panel #elementor-panel-category-happy_addons_category .elementor-element:hover .title,
8
  .elementor-panel #elementor-panel-category-happy_addons_category .elementor-element:focus .icon,
76
  bottom: calc(100% + 5px);
77
  left: 100%;
78
  }
79
+
80
+ .elementor-button.ha-btn--promotion:not([disabled]) {
81
+ background-color: #e04d8b !important;
82
+ }
assets/admin/css/editor.min.css CHANGED
@@ -1 +1 @@
1
- .elementor-panel #elementor-panel-category-happy_addons_category .elementor-element:focus .icon,.elementor-panel #elementor-panel-category-happy_addons_category .elementor-element:focus .title,.elementor-panel #elementor-panel-category-happy_addons_category .elementor-element:hover .icon,.elementor-panel #elementor-panel-category-happy_addons_category .elementor-element:hover .title,.elementor-panel #elementor-panel-category-happy_addons_pro_category .elementor-element:focus .icon,.elementor-panel #elementor-panel-category-happy_addons_pro_category .elementor-element:focus .title,.elementor-panel #elementor-panel-category-happy_addons_pro_category .elementor-element:hover .icon,.elementor-panel #elementor-panel-category-happy_addons_pro_category .elementor-element:hover .title,.elementor-panel #elementor-panel-category-happy_addons_pro_category .is-ha-widget:focus .icon,.elementor-panel #elementor-panel-category-happy_addons_pro_category .is-ha-widget:focus .title,.elementor-panel #elementor-panel-category-happy_addons_pro_category .is-ha-widget:hover .icon,.elementor-panel #elementor-panel-category-happy_addons_pro_category .is-ha-widget:hover .title{background-image:-webkit-linear-gradient(315deg,#e2498a 25%,#562dd4 100%);background-image:linear-gradient(135deg,#e2498a 25%,#562dd4 100%);-webkit-background-clip:text;-webkit-text-fill-color:transparent}.elementor-panel .elementor-element .icon{position:relative;-webkit-transition:all .2s;transition:all .2s}.elementor-panel .elementor-element .icon .hm:after{position:absolute;top:5px;right:5px;content:"\ead0";font-size:15px;opacity:.3}.elementor-panel .elementor-element:focus .icon .hm:after,.elementor-panel .elementor-element:hover .icon .hm:after{opacity:1;background-image:-webkit-linear-gradient(315deg,#e2498a 25%,#562dd4 100%);background-image:linear-gradient(135deg,#e2498a 25%,#562dd4 100%);-webkit-background-clip:text;-webkit-text-fill-color:transparent}.elementor-panel .elementor-control-_section_happy_effects .elementor-panel-heading-title,.elementor-panel .elementor-control-_section_happy_effects .elementor-panel-heading-toggle{color:#e2498a}.elementor-control-ha_floating_fx_rotate_toggle+.elementor-controls-popover .elementor-control-type-slider--handles-range .elementor-slider .noUi-handle-lower:after,.elementor-control-ha_floating_fx_scale_toggle+.elementor-controls-popover .elementor-control-type-slider--handles-range .elementor-slider .noUi-handle-lower:after,.elementor-control-ha_floating_fx_translate_toggle+.elementor-controls-popover .elementor-control-type-slider--handles-range .elementor-slider .noUi-handle-lower:after{left:-5px;box-shadow:-2px 2px 3px 0 rgba(0,0,0,.1)}.elementor-control-ha_floating_fx_rotate_toggle+.elementor-controls-popover .elementor-control-type-slider--handles-range .elementor-slider .noUi-handle-upper:after,.elementor-control-ha_floating_fx_scale_toggle+.elementor-controls-popover .elementor-control-type-slider--handles-range .elementor-slider .noUi-handle-upper:after,.elementor-control-ha_floating_fx_translate_toggle+.elementor-controls-popover .elementor-control-type-slider--handles-range .elementor-slider .noUi-handle-upper:after{left:5px;box-shadow:2px -2px 3px 0 rgba(0,0,0,.1)}.elementor-control-ha_floating_fx_rotate_toggle+.elementor-controls-popover .elementor-control-type-slider--handles-range .elementor-slider .noUi-handle-upper .noUi-tooltip,.elementor-control-ha_floating_fx_scale_toggle+.elementor-controls-popover .elementor-control-type-slider--handles-range .elementor-slider .noUi-handle-upper .noUi-tooltip,.elementor-control-ha_floating_fx_translate_toggle+.elementor-controls-popover .elementor-control-type-slider--handles-range .elementor-slider .noUi-handle-upper .noUi-tooltip{top:auto;bottom:calc(100% + 5px);left:100%}
1
+ .elementor-panel .ha-element--promotion>.elementor-element>.eicon-lock{right:auto;left:5px}.elementor-panel #elementor-panel-category-happy_addons_category .elementor-element:focus .icon,.elementor-panel #elementor-panel-category-happy_addons_category .elementor-element:focus .title,.elementor-panel #elementor-panel-category-happy_addons_category .elementor-element:hover .icon,.elementor-panel #elementor-panel-category-happy_addons_category .elementor-element:hover .title,.elementor-panel #elementor-panel-category-happy_addons_pro_category .elementor-element:focus .icon,.elementor-panel #elementor-panel-category-happy_addons_pro_category .elementor-element:focus .title,.elementor-panel #elementor-panel-category-happy_addons_pro_category .elementor-element:hover .icon,.elementor-panel #elementor-panel-category-happy_addons_pro_category .elementor-element:hover .title,.elementor-panel #elementor-panel-category-happy_addons_pro_category .is-ha-widget:focus .icon,.elementor-panel #elementor-panel-category-happy_addons_pro_category .is-ha-widget:focus .title,.elementor-panel #elementor-panel-category-happy_addons_pro_category .is-ha-widget:hover .icon,.elementor-panel #elementor-panel-category-happy_addons_pro_category .is-ha-widget:hover .title{background-image:-webkit-linear-gradient(315deg,#e2498a 25%,#562dd4 100%);background-image:linear-gradient(135deg,#e2498a 25%,#562dd4 100%);-webkit-background-clip:text;-webkit-text-fill-color:transparent}.elementor-panel .elementor-element .icon{position:relative;-webkit-transition:all .2s;transition:all .2s}.elementor-panel .elementor-element .icon .hm:after{position:absolute;top:5px;right:5px;content:"\ead0";font-size:15px;opacity:.3}.elementor-panel .elementor-element:focus .icon .hm:after,.elementor-panel .elementor-element:hover .icon .hm:after{opacity:1;background-image:-webkit-linear-gradient(315deg,#e2498a 25%,#562dd4 100%);background-image:linear-gradient(135deg,#e2498a 25%,#562dd4 100%);-webkit-background-clip:text;-webkit-text-fill-color:transparent}.elementor-panel .elementor-control-_section_happy_effects .elementor-panel-heading-title,.elementor-panel .elementor-control-_section_happy_effects .elementor-panel-heading-toggle{color:#e2498a}.elementor-control-ha_floating_fx_rotate_toggle+.elementor-controls-popover .elementor-control-type-slider--handles-range .elementor-slider .noUi-handle-lower:after,.elementor-control-ha_floating_fx_scale_toggle+.elementor-controls-popover .elementor-control-type-slider--handles-range .elementor-slider .noUi-handle-lower:after,.elementor-control-ha_floating_fx_translate_toggle+.elementor-controls-popover .elementor-control-type-slider--handles-range .elementor-slider .noUi-handle-lower:after{left:-5px;box-shadow:-2px 2px 3px 0 rgba(0,0,0,.1)}.elementor-control-ha_floating_fx_rotate_toggle+.elementor-controls-popover .elementor-control-type-slider--handles-range .elementor-slider .noUi-handle-upper:after,.elementor-control-ha_floating_fx_scale_toggle+.elementor-controls-popover .elementor-control-type-slider--handles-range .elementor-slider .noUi-handle-upper:after,.elementor-control-ha_floating_fx_translate_toggle+.elementor-controls-popover .elementor-control-type-slider--handles-range .elementor-slider .noUi-handle-upper:after{left:5px;box-shadow:2px -2px 3px 0 rgba(0,0,0,.1)}.elementor-control-ha_floating_fx_rotate_toggle+.elementor-controls-popover .elementor-control-type-slider--handles-range .elementor-slider .noUi-handle-upper .noUi-tooltip,.elementor-control-ha_floating_fx_scale_toggle+.elementor-controls-popover .elementor-control-type-slider--handles-range .elementor-slider .noUi-handle-upper .noUi-tooltip,.elementor-control-ha_floating_fx_translate_toggle+.elementor-controls-popover .elementor-control-type-slider--handles-range .elementor-slider .noUi-handle-upper .noUi-tooltip{top:auto;bottom:calc(100% + 5px);left:100%}.elementor-button.ha-btn--promotion:not([disabled]){background-color:#e04d8b!important}
assets/admin/js/editor.js CHANGED
@@ -141,10 +141,14 @@
141
  return text.length > 20 ? text.substring(0, 20) + "..." : text;
142
  };
143
 
 
 
 
 
144
  elementor.modules.layouts.panel.pages.menu.Menu.addItem({
145
  name: 'happyaddons-home',
146
  icon: 'hm hm-happyaddons',
147
- title: HappyAddonsEditor.editorPanelHomeLinkTitle,
148
  type: 'link',
149
  link: HappyAddonsEditor.editorPanelHomeLinkURL,
150
  newTab: true
@@ -153,10 +157,103 @@
153
  elementor.modules.layouts.panel.pages.menu.Menu.addItem({
154
  name: 'happyaddons-widgets',
155
  icon: 'hm hm-cross-game',
156
- title: HappyAddonsEditor.editorPanelWidgetsLinkTitle,
157
  type: 'link',
158
  link: HappyAddonsEditor.editorPanelWidgetsLinkURL,
159
  newTab: true
160
  }, 'settings');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
 
162
  }(jQuery));
141
  return text.length > 20 ? text.substring(0, 20) + "..." : text;
142
  };
143
 
144
+ function ha_translate(stringKey, templateArgs) {
145
+ return elementorCommon.translate(stringKey, null, templateArgs, HappyAddonsEditor.i18n);
146
+ }
147
+
148
  elementor.modules.layouts.panel.pages.menu.Menu.addItem({
149
  name: 'happyaddons-home',
150
  icon: 'hm hm-happyaddons',
151
+ title: ha_translate( 'editorPanelHomeLinkTitle' ),
152
  type: 'link',
153
  link: HappyAddonsEditor.editorPanelHomeLinkURL,
154
  newTab: true
157
  elementor.modules.layouts.panel.pages.menu.Menu.addItem({
158
  name: 'happyaddons-widgets',
159
  icon: 'hm hm-cross-game',
160
+ title: ha_translate( 'editorPanelWidgetsLinkTitle' ),
161
  type: 'link',
162
  link: HappyAddonsEditor.editorPanelWidgetsLinkURL,
163
  newTab: true
164
  }, 'settings');
165
+
166
+ /**
167
+ * Add pro widgets placeholder
168
+ */
169
+ elementor.hooks.addFilter( 'panel/elements/regionViews', function( regionViews ) {
170
+ if ( HappyAddonsEditor.hasPro || _.isEmpty( HappyAddonsEditor.proWidgets ) ) {
171
+ return regionViews;
172
+ }
173
+
174
+ var CATEGOERY_NAME = 'happy_addons_pro',
175
+ elementsView = regionViews.elements.view,
176
+ categoriesView = regionViews.categories.view,
177
+ elementsCollection = regionViews.elements.options.collection,
178
+ categoriesCollection = regionViews.categories.options.collection,
179
+ proWidgets = [],
180
+ ElementView,
181
+ freeCategoryIndex;
182
+
183
+ _.each( HappyAddonsEditor.proWidgets, function( widget, name ) {
184
+ elementsCollection.add({
185
+ name: 'ha-' + name,
186
+ title: widget.title,
187
+ icon: widget.icon,
188
+ categories: [ CATEGOERY_NAME ],
189
+ editable: false,
190
+ });
191
+ });
192
+
193
+ elementsCollection.each( function( element ) {
194
+ if ( element.get( 'categories' )[0] === CATEGOERY_NAME ) {
195
+ proWidgets.push( element );
196
+ }
197
+ } );
198
+
199
+ freeCategoryIndex = categoriesCollection.findIndex({ name:'happy_addons_category' });
200
+
201
+ if ( freeCategoryIndex ) {
202
+ categoriesCollection.add( {
203
+ name: 'happy_addons_pro_category',
204
+ title: 'Happy Addons Pro',
205
+ icon: 'hm hm-happyaddons',
206
+ defaultActive: false,
207
+ items: proWidgets,
208
+ }, {
209
+ at: freeCategoryIndex + 1
210
+ });
211
+ }
212
+
213
+ ElementView = {
214
+ className: function() {
215
+ var className = this.constructor.__super__.className.call(this);
216
+ if ( ! this.isEditable() && this.isHappyWidget() ) {
217
+ className += ' ha-element--promotion';
218
+ }
219
+
220
+ return className;
221
+ },
222
+
223
+ isHappyWidget: function() {
224
+ return this.model.get('name').indexOf('ha-') === 0;
225
+ },
226
+
227
+ onMouseDown: function() {
228
+ if ( ! this.isHappyWidget() ) {
229
+ elementor.promotion.dialog.buttons[0].removeClass('ha-btn--promotion');
230
+ this.constructor.__super__.onMouseDown.call(this);
231
+ return;
232
+ }
233
+
234
+ elementor.promotion.dialog.buttons[0].addClass('ha-btn--promotion');
235
+
236
+ elementor.promotion.showDialog( {
237
+ headerMessage: ha_translate( 'promotionDialogHeader', [ this.model.get( 'title' ) ] ),
238
+ message: ha_translate( 'promotionDialogMessage', [ this.model.get( 'title' ) ] ),
239
+ top: '-7',
240
+ element: this.el,
241
+ actionURL: 'https://demo.happyaddons.com/',
242
+ } );
243
+ }
244
+ };
245
+
246
+ regionViews.elements.view = elementsView.extend({
247
+ childView: elementsView.prototype.childView.extend(ElementView)
248
+ });
249
+
250
+ regionViews.categories.view = categoriesView.extend({
251
+ childView: categoriesView.prototype.childView.extend({
252
+ childView: categoriesView.prototype.childView.prototype.childView.extend(ElementView)
253
+ })
254
+ });
255
+
256
+ return regionViews;
257
+ });
258
 
259
  }(jQuery));
assets/admin/js/editor.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){"use strict";function t(){return{translate:["x","y","x_tablet","y_tablet","x_mobile","y_mobile"],skew:["x","y","x_tablet","y_tablet","x_mobile","y_mobile"],scale:["x","y","x_tablet","y_tablet","x_mobile","y_mobile"],rotate:["x","y","z","x_tablet","y_tablet","z_tablet","x_mobile","y_mobile","z_mobile"]}}function n(e,t,n){e="ha_transform_fx_"+e,t="ha_transform_fx_"+t,n.on("change:"+e,function(e,i){if(!i){var a=elementor.getPanelView().getCurrentPageView().children.find(function(e){return e.model.get("name")===t});n.set(t,_.extend({},n.defaults[t])),a&&a.render()}})}function i(e){var i=elementorFrontend.config.elements.data[e.cid];_.each(t(),function(e,t){_.each(e,function(e){n(t+"_toggle",t+"_"+e,i)})}),elementor.getPanelView().getCurrentPageView().model.on("editor:close",function(){_.each(t(),function(e,t){i.off("change:ha_transform_fx_"+t+"_toggle")})})}if(elementor.on("panel:init",function(){if(e("#elementor-panel-elements-search-input").on("keyup",_.debounce(function(){e("#elementor-panel-elements").find(".hm").parents(".elementor-element").addClass("is-ha-widget")},100)),"undefined"!=typeof $e||null!==$e){var t={callback:function(){var e=elementor.settings.page.model.attributes.ha_grid;""===e?elementor.settings.page.model.setExternalChange("ha_grid","yes"):"yes"===e&&elementor.settings.page.model.setExternalChange("ha_grid","")}};$e.shortcuts.register("ctrl+shift+g",t),$e.shortcuts.register("cmd+shift+g",t)}}),elementor.hooks.addAction("panel/open_editor/widget",function(e,t){i(t)}),elementor.modules.controls.Icons){var a=elementor.modules.controls.Icons.extend({getControlValue:function(){var e=this.constructor.__super__.getControlValue.call(this),t=this.model,n=this.getValueToMigrate(),i={value:"",library:"happy-icons"},a=this.container&&this.container.settings||this.elementSettingsModel;if(_.isObject(e)&&!_.isEmpty(e)&&"svg"!==e.library&&0===e.value.indexOf("fashm"))return i.value=e.value.substr(e.value.indexOf("hm hm-")),a.set(t.get("name"),i),i;if(!_.isObject(e)&&n&&0===n.indexOf("hm hm-"))return i.value=n,a.set(t.get("name"),i),i;if(!this.isMigrationAllowed())return n;if(!n)return e;var o=a.get(this.dataKeys.migratedKey),r=t.get("name");return this.cache.migratedFlag[r]?this.cache.migratedFlag[r]:o&&o[r]?e:this.migrateFa4toFa5(n)}});elementor.addControlView("icons",a)}window.ha_has_icon_library=function(){return elementor.helpers&&elementor.helpers.renderIcon},window.ha_get_feature_label=function(e){var t=document.createElement("DIV");return t.innerHTML=e,e=t.textContent||t.innerText||e,e.length>20?e.substring(0,20)+"...":e},elementor.modules.layouts.panel.pages.menu.Menu.addItem({name:"happyaddons-home",icon:"hm hm-happyaddons",title:HappyAddonsEditor.editorPanelHomeLinkTitle,type:"link",link:HappyAddonsEditor.editorPanelHomeLinkURL,newTab:!0},"settings"),elementor.modules.layouts.panel.pages.menu.Menu.addItem({name:"happyaddons-widgets",icon:"hm hm-cross-game",title:HappyAddonsEditor.editorPanelWidgetsLinkTitle,type:"link",link:HappyAddonsEditor.editorPanelWidgetsLinkURL,newTab:!0},"settings")}(jQuery);
1
+ !function(e){"use strict";function t(){return{translate:["x","y","x_tablet","y_tablet","x_mobile","y_mobile"],skew:["x","y","x_tablet","y_tablet","x_mobile","y_mobile"],scale:["x","y","x_tablet","y_tablet","x_mobile","y_mobile"],rotate:["x","y","z","x_tablet","y_tablet","z_tablet","x_mobile","y_mobile","z_mobile"]}}function n(e,t,n){e="ha_transform_fx_"+e,t="ha_transform_fx_"+t,n.on("change:"+e,function(e,o){if(!o){var i=elementor.getPanelView().getCurrentPageView().children.find(function(e){return e.model.get("name")===t});n.set(t,_.extend({},n.defaults[t])),i&&i.render()}})}function o(e){var o=elementorFrontend.config.elements.data[e.cid];_.each(t(),function(e,t){_.each(e,function(e){n(t+"_toggle",t+"_"+e,o)})}),elementor.getPanelView().getCurrentPageView().model.on("editor:close",function(){_.each(t(),function(e,t){o.off("change:ha_transform_fx_"+t+"_toggle")})})}function i(e,t){return elementorCommon.translate(e,null,t,HappyAddonsEditor.i18n)}if(elementor.on("panel:init",function(){if(e("#elementor-panel-elements-search-input").on("keyup",_.debounce(function(){e("#elementor-panel-elements").find(".hm").parents(".elementor-element").addClass("is-ha-widget")},100)),"undefined"!=typeof $e||null!==$e){var t={callback:function(){var e=elementor.settings.page.model.attributes.ha_grid;""===e?elementor.settings.page.model.setExternalChange("ha_grid","yes"):"yes"===e&&elementor.settings.page.model.setExternalChange("ha_grid","")}};$e.shortcuts.register("ctrl+shift+g",t),$e.shortcuts.register("cmd+shift+g",t)}}),elementor.hooks.addAction("panel/open_editor/widget",function(e,t){o(t)}),elementor.modules.controls.Icons){var a=elementor.modules.controls.Icons.extend({getControlValue:function(){var e=this.constructor.__super__.getControlValue.call(this),t=this.model,n=this.getValueToMigrate(),o={value:"",library:"happy-icons"},i=this.container&&this.container.settings||this.elementSettingsModel;if(_.isObject(e)&&!_.isEmpty(e)&&"svg"!==e.library&&0===e.value.indexOf("fashm"))return o.value=e.value.substr(e.value.indexOf("hm hm-")),i.set(t.get("name"),o),o;if(!_.isObject(e)&&n&&0===n.indexOf("hm hm-"))return o.value=n,i.set(t.get("name"),o),o;if(!this.isMigrationAllowed())return n;if(!n)return e;var a=i.get(this.dataKeys.migratedKey),r=t.get("name");return this.cache.migratedFlag[r]?this.cache.migratedFlag[r]:a&&a[r]?e:this.migrateFa4toFa5(n)}});elementor.addControlView("icons",a)}window.ha_has_icon_library=function(){return elementor.helpers&&elementor.helpers.renderIcon},window.ha_get_feature_label=function(e){var t=document.createElement("DIV");return t.innerHTML=e,e=t.textContent||t.innerText||e,e.length>20?e.substring(0,20)+"...":e},elementor.modules.layouts.panel.pages.menu.Menu.addItem({name:"happyaddons-home",icon:"hm hm-happyaddons",title:i("editorPanelHomeLinkTitle"),type:"link",link:HappyAddonsEditor.editorPanelHomeLinkURL,newTab:!0},"settings"),elementor.modules.layouts.panel.pages.menu.Menu.addItem({name:"happyaddons-widgets",icon:"hm hm-cross-game",title:i("editorPanelWidgetsLinkTitle"),type:"link",link:HappyAddonsEditor.editorPanelWidgetsLinkURL,newTab:!0},"settings"),elementor.hooks.addFilter("panel/elements/regionViews",function(e){if(HappyAddonsEditor.hasPro||_.isEmpty(HappyAddonsEditor.proWidgets))return e;var t,n,o=e.elements.view,a=e.categories.view,r=e.elements.options.collection,l=e.categories.options.collection,s=[];return _.each(HappyAddonsEditor.proWidgets,function(e,t){r.add({name:"ha-"+t,title:e.title,icon:e.icon,categories:["happy_addons_pro"],editable:!1})}),r.each(function(e){"happy_addons_pro"===e.get("categories")[0]&&s.push(e)}),n=l.findIndex({name:"happy_addons_category"}),n&&l.add({name:"happy_addons_pro_category",title:"Happy Addons Pro",icon:"hm hm-happyaddons",defaultActive:!1,items:s},{at:n+1}),t={className:function(){var e=this.constructor.__super__.className.call(this);return!this.isEditable()&&this.isHappyWidget()&&(e+=" ha-element--promotion"),e},isHappyWidget:function(){return 0===this.model.get("name").indexOf("ha-")},onMouseDown:function(){if(!this.isHappyWidget())return elementor.promotion.dialog.buttons[0].removeClass("ha-btn--promotion"),void this.constructor.__super__.onMouseDown.call(this);elementor.promotion.dialog.buttons[0].addClass("ha-btn--promotion"),elementor.promotion.showDialog({headerMessage:i("promotionDialogHeader",[this.model.get("title")]),message:i("promotionDialogMessage",[this.model.get("title")]),top:"-7",element:this.el,actionURL:"https://demo.happyaddons.com/"})}},e.elements.view=o.extend({childView:o.prototype.childView.extend(t)}),e.categories.view=a.extend({childView:a.prototype.childView.extend({childView:a.prototype.childView.prototype.childView.extend(t)})}),e})}(jQuery);
assets/js/happy-addons.js CHANGED
@@ -475,11 +475,11 @@
475
  total = $self.data("total"),
476
  items = $scope.find('.ha-tweet-item').length;
477
  $.ajax({
478
- url: HappyTwitterLocalize.ajax_url,
479
  type: 'POST',
480
  data: {
481
  action: "ha_twitter_feed_action",
482
- security: HappyTwitterLocalize.nonce,
483
  query_settings: query_settings,
484
  loaded_item: items,
485
  },
475
  total = $self.data("total"),
476
  items = $scope.find('.ha-tweet-item').length;
477
  $.ajax({
478
+ url: HappyLocalize.ajax_url,
479
  type: 'POST',
480
  data: {
481
  action: "ha_twitter_feed_action",
482
+ security: HappyLocalize.nonce,
483
  query_settings: query_settings,
484
  loaded_item: items,
485
  },
assets/js/happy-addons.min.js CHANGED
@@ -1 +1 @@
1
- "use strict";!function(t,e){function i(t,e,i){var n;return function(){var a=this,s=arguments,o=function(){n=null,i||t.apply(a,s)},r=i&&!n;clearTimeout(n),n=setTimeout(o,e),r&&t.apply(a,s)}}function n(e,i){var n=e.find(".hajs-gallery-filter");n.length&&n.on("click","button",function(e){e.stopPropagation();var n=t(this);n.parent().addClass("ha-filter-active").siblings().removeClass("ha-filter-active"),i(n.data("filter"))})}function a(e,i,n,a){if(t.fn.magnificPopup){if(!n)return void t.magnificPopup.close();e.on("click",i,function(t){t.stopPropagation()}),e.find(i).magnificPopup({key:a,type:"image",image:{titleSrc:function(t){return t.el.attr("title")?t.el.attr("title"):t.el.find("img").attr("alt")}},gallery:{enabled:!0,preload:[1,2]},zoom:{enabled:!0,duration:300,easing:"ease-in-out",opener:function(t){return t.is("img")?t:t.find("img")}}})}}var s=t(e);t.fn.getHappySettings=function(){return this.data("happy-settings")};var o=function(t){var e=t.find(".hajs-image-comparison"),i=e.getHappySettings();i[{on_hover:"move_slider_on_hover",on_swipe:"move_with_handle_only",on_click:"click_to_move"}[i.move_handle||"on_swipe"]]=!0,delete i.move_handle,e.imagesLoaded().done(function(){e.twentytwenty(i);var t=setTimeout(function(){s.trigger("resize.twentytwenty"),clearTimeout(t)},400)})},r=function(e){var i=e.find(".hajs-justified-gallery"),s=i.getHappySettings(),o=s.enable_popup;i.justifiedGallery(t.extend({},{rowHeight:150,lastRow:"justify",margins:10},s)),a(e,".ha-js-popup",o,"justifiedgallery"),n(e,function(t){i.justifiedGallery({lastRow:"*"===t?s.lastRow:"nojustify",filter:t}),a(e,"*"!==t?t:".ha-js-popup",o,"justifiedgallery")})};s.on("elementor/frontend/init",function(){var e=elementorFrontend,s=elementorModules,l=s.frontend.handlers.Base.extend({onInit:function(){s.frontend.handlers.Base.prototype.onInit.apply(this,arguments),this.widgetContainer=this.$element.find(".elementor-widget-container")[0],this.initFloatingEffects(),this.initBackgroundOverlay()},initBackgroundOverlay:function(){this.isEdit&&this.$element.addClass("ha-has-background-overlay")},getDefaultSettings:function(){return{targets:this.widgetContainer,loop:!0,direction:"alternate",easing:"easeInOutSine"}},onElementChange:function(t){-1!==t.indexOf("ha_floating")&&this.runOnElementChange()},runOnElementChange:i(function(){this.animation&&this.animation.restart(),this.initFloatingEffects()},200),getConfig:function(t){return this.getElementSettings("ha_floating_fx_"+t)},initFloatingEffects:function(){var t=this.getDefaultSettings();this.getConfig("translate_toggle")&&((this.getConfig("translate_x.size")||this.getConfig("translate_x.sizes.to"))&&(t.translateX={value:[this.getConfig("translate_x.sizes.from")||0,this.getConfig("translate_x.size")||this.getConfig("translate_x.sizes.to")],duration:this.getConfig("translate_duration.size"),delay:this.getConfig("translate_delay.size")||0}),(this.getConfig("translate_y.size")||this.getConfig("translate_y.sizes.to"))&&(t.translateY={value:[this.getConfig("translate_y.sizes.from")||0,this.getConfig("translate_y.size")||this.getConfig("translate_y.sizes.to")],duration:this.getConfig("translate_duration.size"),delay:this.getConfig("translate_delay.size")||0})),this.getConfig("rotate_toggle")&&((this.getConfig("rotate_x.size")||this.getConfig("rotate_x.sizes.to"))&&(t.rotateX={value:[this.getConfig("rotate_x.sizes.from")||0,this.getConfig("rotate_x.size")||this.getConfig("rotate_x.sizes.to")],duration:this.getConfig("rotate_duration.size"),delay:this.getConfig("rotate_delay.size")||0}),(this.getConfig("rotate_y.size")||this.getConfig("rotate_y.sizes.to"))&&(t.rotateY={value:[this.getConfig("rotate_y.sizes.from")||0,this.getConfig("rotate_y.size")||this.getConfig("rotate_y.sizes.to")],duration:this.getConfig("rotate_duration.size"),delay:this.getConfig("rotate_delay.size")||0}),(this.getConfig("rotate_z.size")||this.getConfig("rotate_z.sizes.to"))&&(t.rotateZ={value:[this.getConfig("rotate_z.sizes.from")||0,this.getConfig("rotate_z.size")||this.getConfig("rotate_z.sizes.to")],duration:this.getConfig("rotate_duration.size"),delay:this.getConfig("rotate_delay.size")||0})),this.getConfig("scale_toggle")&&((this.getConfig("scale_x.size")||this.getConfig("scale_x.sizes.to"))&&(t.scaleX={value:[this.getConfig("scale_x.sizes.from")||0,this.getConfig("scale_x.size")||this.getConfig("scale_x.sizes.to")],duration:this.getConfig("scale_duration.size"),delay:this.getConfig("scale_delay.size")||0}),(this.getConfig("scale_y.size")||this.getConfig("scale_y.sizes.to"))&&(t.scaleY={value:[this.getConfig("scale_y.sizes.from")||0,this.getConfig("scale_y.size")||this.getConfig("scale_y.sizes.to")],duration:this.getConfig("scale_duration.size"),delay:this.getConfig("scale_delay.size")||0})),(this.getConfig("translate_toggle")||this.getConfig("rotate_toggle")||this.getConfig("scale_toggle"))&&(this.widgetContainer.style.setProperty("will-change","transform"),this.animation=anime(t))}}),g=s.frontend.handlers.Base.extend({onInit:function(){s.frontend.handlers.Base.prototype.onInit.apply(this,arguments),this.$container=this.$element.find(".hajs-slick"),this.run()},isCarousel:function(){return this.$element.hasClass("ha-carousel")},getDefaultSettings:function(){return{arrows:!1,dots:!1,checkVisible:!1,infinite:!0,slidesToShow:this.isCarousel()?3:1,rows:0,prevArrow:'<button type="button" class="slick-prev"><i class="fa fa-chevron-left"></i></button>',nextArrow:'<button type="button" class="slick-next"><i class="fa fa-chevron-right"></i></button>'}},onElementChange:function(){this.$container.slick("unslick"),this.run()},getReadySettings:function(){var i={infinite:!!this.getElementSettings("loop"),autoplay:!!this.getElementSettings("autoplay"),autoplaySpeed:this.getElementSettings("autoplay_speed"),speed:this.getElementSettings("animation_speed"),centerMode:!!this.getElementSettings("center"),vertical:!!this.getElementSettings("vertical"),slidesToScroll:1};switch(this.getElementSettings("navigation")){case"arrow":i.arrows=!0;break;case"dots":i.dots=!0;break;case"both":i.arrows=!0,i.dots=!0}return this.isCarousel()&&(i.slidesToShow=this.getElementSettings("slides_to_show")||3,i.responsive=[{breakpoint:e.config.breakpoints.lg,settings:{slidesToShow:this.getElementSettings("slides_to_show_tablet")||i.slidesToShow}},{breakpoint:e.config.breakpoints.md,settings:{slidesToShow:this.getElementSettings("slides_to_show_mobile")||this.getElementSettings("slides_to_show_tablet")||i.slidesToShow}}]),t.extend({},this.getDefaultSettings(),i)},run:function(){this.$container.slick(this.getReadySettings())}}),h=function(t){e.waypoint(t,function(){var e=t.find(".ha-number-text");e.numerator(e.data("animation"))})},f=function(i){e.waypoint(i,function(){i.find(".ha-skill-level").each(function(){var e=t(this),i=e.find(".ha-skill-level-text"),n=e.data("level");e.animate({width:n+"%"},500),i.numerator({toValue:n+"%",duration:1300,onStep:function(){i.append("%")}})})})},d=s.frontend.handlers.Base.extend({onInit:function(){s.frontend.handlers.Base.prototype.onInit.apply(this,arguments),this.$container=this.$element.find(".hajs-isotope"),this.run(),this.runFilter()},getLayoutMode:function(){var t=this.getElementSettings("layout");return"even"===t?"masonry":t},getDefaultSettings:function(){return{itemSelector:".ha-image-grid-item",percentPosition:!0,layoutMode:this.getLayoutMode()}},runFilter:function(){var t=this;n(this.$element,function(e){t.$container.isotope({filter:e});var i="*"!==e?e:".ha-js-popup";a(t.$element,i,t.getElementSettings("enable_popup"),"imagegrid")})},onElementChange:function(t){-1!==["layout","image_height","columns","image_margin","enable_popup"].indexOf(t)&&this.run()},run:function(){var t=this;this.$container.isotope(t.getDefaultSettings()),this.$container.imagesLoaded().progress(function(){t.$container.isotope("layout")}),a(this.$element,".ha-js-popup",this.getElementSettings("enable_popup"),"imagegrid")}}),u=s.frontend.handlers.Base.extend({onInit:function(){s.frontend.handlers.Base.prototype.onInit.apply(this,arguments),this.wrapper=this.$element.find(".ha-news-ticker-wrapper"),this.run()},onElementChange:function(t){"item_space"!==t&&"title_typography_font_size"!==t||this.run()},run:function(){var e=this.wrapper.innerHeight(),i=this.wrapper.innerWidth(),n=this.wrapper.find(".ha-news-ticker-container"),a=n.find(".ha-news-ticker-item"),s=this.wrapper.data("scroll-direction"),o="scroll"+s+e+i,r=this.wrapper.data("duration"),l="normal",g=10,h={transform:"translateX(0"+i+"px)"},f={transform:"translateX(-101%)"};"right"===s&&(l="reverse"),a.each(function(){g+=t(this).outerWidth(!0)}),n.css({width:g,display:"flex"}),t.keyframe.define([{name:o,"0%":h,"100%":f}]),n.playKeyframe({name:o,duration:r+"ms",timingFunction:"linear",delay:"0s",iterationCount:"infinite",direction:l,fillMode:"none",complete:function(){}})}}),c=function(t){e.waypoint(t,function(){var e=t.find(".ha-fun-factor-content-number");e.numerator(e.data("animation"))})},p=function(i){e.waypoint(i,function(){var e=t(this),i=e.find(".ha-bar-chart-container"),n=e.find("#ha-bar-chart"),a=i.data("settings");i.length&&new Chart(n,a)})},m=function(e){var i=e.find(".ha-twitter-load-more"),n=e.find(".ha-tweet-items");i.on("click",function(i){i.preventDefault();var a=t(this),s=a.data("settings"),o=a.data("total"),r=e.find(".ha-tweet-item").length;t.ajax({url:HappyTwitterLocalize.ajax_url,type:"POST",data:{action:"ha_twitter_feed_action",security:HappyTwitterLocalize.nonce,query_settings:s,loaded_item:r},success:function(e){o>r?t(e).appendTo(n):(a.text("All Loaded").addClass("loaded"),setTimeout(function(){a.css({display:"none"})},800))},error:function(t){}})})};t("[data-ha-element-link]").each(function(){var e=t(this).data("ha-element-link");t(this).on("click.haElementOnClick",function(){e.is_external?window.open(e.url):location.href=e.url})});var _={"ha-image-compare.default":o,"ha-justified-gallery.default":r,"ha-number.default":h,"ha-skills.default":f,"ha-fun-factor.default":c,"ha-bar-chart.default":p,"ha-twitter-feed.default":m};t.each(_,function(t,i){e.hooks.addAction("frontend/element_ready/"+t,i)});var y={"ha-slider.default":g,"ha-carousel.default":g,"ha-image-grid.default":d,"ha-news-ticker.default":u,widget:l};t.each(y,function(t,i){e.hooks.addAction("frontend/element_ready/"+t,function(t){e.elementsHandler.addHandler(i,{$element:t})})})})}(jQuery,window);
1
+ "use strict";!function(t,e){function i(t,e,i){var n;return function(){var a=this,s=arguments,o=function(){n=null,i||t.apply(a,s)},r=i&&!n;clearTimeout(n),n=setTimeout(o,e),r&&t.apply(a,s)}}function n(e,i){var n=e.find(".hajs-gallery-filter");n.length&&n.on("click","button",function(e){e.stopPropagation();var n=t(this);n.parent().addClass("ha-filter-active").siblings().removeClass("ha-filter-active"),i(n.data("filter"))})}function a(e,i,n,a){if(t.fn.magnificPopup){if(!n)return void t.magnificPopup.close();e.on("click",i,function(t){t.stopPropagation()}),e.find(i).magnificPopup({key:a,type:"image",image:{titleSrc:function(t){return t.el.attr("title")?t.el.attr("title"):t.el.find("img").attr("alt")}},gallery:{enabled:!0,preload:[1,2]},zoom:{enabled:!0,duration:300,easing:"ease-in-out",opener:function(t){return t.is("img")?t:t.find("img")}}})}}var s=t(e);t.fn.getHappySettings=function(){return this.data("happy-settings")};var o=function(t){var e=t.find(".hajs-image-comparison"),i=e.getHappySettings();i[{on_hover:"move_slider_on_hover",on_swipe:"move_with_handle_only",on_click:"click_to_move"}[i.move_handle||"on_swipe"]]=!0,delete i.move_handle,e.imagesLoaded().done(function(){e.twentytwenty(i);var t=setTimeout(function(){s.trigger("resize.twentytwenty"),clearTimeout(t)},400)})},r=function(e){var i=e.find(".hajs-justified-gallery"),s=i.getHappySettings(),o=s.enable_popup;i.justifiedGallery(t.extend({},{rowHeight:150,lastRow:"justify",margins:10},s)),a(e,".ha-js-popup",o,"justifiedgallery"),n(e,function(t){i.justifiedGallery({lastRow:"*"===t?s.lastRow:"nojustify",filter:t}),a(e,"*"!==t?t:".ha-js-popup",o,"justifiedgallery")})};s.on("elementor/frontend/init",function(){var e=elementorFrontend,s=elementorModules,l=s.frontend.handlers.Base.extend({onInit:function(){s.frontend.handlers.Base.prototype.onInit.apply(this,arguments),this.widgetContainer=this.$element.find(".elementor-widget-container")[0],this.initFloatingEffects(),this.initBackgroundOverlay()},initBackgroundOverlay:function(){this.isEdit&&this.$element.addClass("ha-has-background-overlay")},getDefaultSettings:function(){return{targets:this.widgetContainer,loop:!0,direction:"alternate",easing:"easeInOutSine"}},onElementChange:function(t){-1!==t.indexOf("ha_floating")&&this.runOnElementChange()},runOnElementChange:i(function(){this.animation&&this.animation.restart(),this.initFloatingEffects()},200),getConfig:function(t){return this.getElementSettings("ha_floating_fx_"+t)},initFloatingEffects:function(){var t=this.getDefaultSettings();this.getConfig("translate_toggle")&&((this.getConfig("translate_x.size")||this.getConfig("translate_x.sizes.to"))&&(t.translateX={value:[this.getConfig("translate_x.sizes.from")||0,this.getConfig("translate_x.size")||this.getConfig("translate_x.sizes.to")],duration:this.getConfig("translate_duration.size"),delay:this.getConfig("translate_delay.size")||0}),(this.getConfig("translate_y.size")||this.getConfig("translate_y.sizes.to"))&&(t.translateY={value:[this.getConfig("translate_y.sizes.from")||0,this.getConfig("translate_y.size")||this.getConfig("translate_y.sizes.to")],duration:this.getConfig("translate_duration.size"),delay:this.getConfig("translate_delay.size")||0})),this.getConfig("rotate_toggle")&&((this.getConfig("rotate_x.size")||this.getConfig("rotate_x.sizes.to"))&&(t.rotateX={value:[this.getConfig("rotate_x.sizes.from")||0,this.getConfig("rotate_x.size")||this.getConfig("rotate_x.sizes.to")],duration:this.getConfig("rotate_duration.size"),delay:this.getConfig("rotate_delay.size")||0}),(this.getConfig("rotate_y.size")||this.getConfig("rotate_y.sizes.to"))&&(t.rotateY={value:[this.getConfig("rotate_y.sizes.from")||0,this.getConfig("rotate_y.size")||this.getConfig("rotate_y.sizes.to")],duration:this.getConfig("rotate_duration.size"),delay:this.getConfig("rotate_delay.size")||0}),(this.getConfig("rotate_z.size")||this.getConfig("rotate_z.sizes.to"))&&(t.rotateZ={value:[this.getConfig("rotate_z.sizes.from")||0,this.getConfig("rotate_z.size")||this.getConfig("rotate_z.sizes.to")],duration:this.getConfig("rotate_duration.size"),delay:this.getConfig("rotate_delay.size")||0})),this.getConfig("scale_toggle")&&((this.getConfig("scale_x.size")||this.getConfig("scale_x.sizes.to"))&&(t.scaleX={value:[this.getConfig("scale_x.sizes.from")||0,this.getConfig("scale_x.size")||this.getConfig("scale_x.sizes.to")],duration:this.getConfig("scale_duration.size"),delay:this.getConfig("scale_delay.size")||0}),(this.getConfig("scale_y.size")||this.getConfig("scale_y.sizes.to"))&&(t.scaleY={value:[this.getConfig("scale_y.sizes.from")||0,this.getConfig("scale_y.size")||this.getConfig("scale_y.sizes.to")],duration:this.getConfig("scale_duration.size"),delay:this.getConfig("scale_delay.size")||0})),(this.getConfig("translate_toggle")||this.getConfig("rotate_toggle")||this.getConfig("scale_toggle"))&&(this.widgetContainer.style.setProperty("will-change","transform"),this.animation=anime(t))}}),g=s.frontend.handlers.Base.extend({onInit:function(){s.frontend.handlers.Base.prototype.onInit.apply(this,arguments),this.$container=this.$element.find(".hajs-slick"),this.run()},isCarousel:function(){return this.$element.hasClass("ha-carousel")},getDefaultSettings:function(){return{arrows:!1,dots:!1,checkVisible:!1,infinite:!0,slidesToShow:this.isCarousel()?3:1,rows:0,prevArrow:'<button type="button" class="slick-prev"><i class="fa fa-chevron-left"></i></button>',nextArrow:'<button type="button" class="slick-next"><i class="fa fa-chevron-right"></i></button>'}},onElementChange:function(){this.$container.slick("unslick"),this.run()},getReadySettings:function(){var i={infinite:!!this.getElementSettings("loop"),autoplay:!!this.getElementSettings("autoplay"),autoplaySpeed:this.getElementSettings("autoplay_speed"),speed:this.getElementSettings("animation_speed"),centerMode:!!this.getElementSettings("center"),vertical:!!this.getElementSettings("vertical"),slidesToScroll:1};switch(this.getElementSettings("navigation")){case"arrow":i.arrows=!0;break;case"dots":i.dots=!0;break;case"both":i.arrows=!0,i.dots=!0}return this.isCarousel()&&(i.slidesToShow=this.getElementSettings("slides_to_show")||3,i.responsive=[{breakpoint:e.config.breakpoints.lg,settings:{slidesToShow:this.getElementSettings("slides_to_show_tablet")||i.slidesToShow}},{breakpoint:e.config.breakpoints.md,settings:{slidesToShow:this.getElementSettings("slides_to_show_mobile")||this.getElementSettings("slides_to_show_tablet")||i.slidesToShow}}]),t.extend({},this.getDefaultSettings(),i)},run:function(){this.$container.slick(this.getReadySettings())}}),h=function(t){e.waypoint(t,function(){var e=t.find(".ha-number-text");e.numerator(e.data("animation"))})},f=function(i){e.waypoint(i,function(){i.find(".ha-skill-level").each(function(){var e=t(this),i=e.find(".ha-skill-level-text"),n=e.data("level");e.animate({width:n+"%"},500),i.numerator({toValue:n+"%",duration:1300,onStep:function(){i.append("%")}})})})},d=s.frontend.handlers.Base.extend({onInit:function(){s.frontend.handlers.Base.prototype.onInit.apply(this,arguments),this.$container=this.$element.find(".hajs-isotope"),this.run(),this.runFilter()},getLayoutMode:function(){var t=this.getElementSettings("layout");return"even"===t?"masonry":t},getDefaultSettings:function(){return{itemSelector:".ha-image-grid-item",percentPosition:!0,layoutMode:this.getLayoutMode()}},runFilter:function(){var t=this;n(this.$element,function(e){t.$container.isotope({filter:e});var i="*"!==e?e:".ha-js-popup";a(t.$element,i,t.getElementSettings("enable_popup"),"imagegrid")})},onElementChange:function(t){-1!==["layout","image_height","columns","image_margin","enable_popup"].indexOf(t)&&this.run()},run:function(){var t=this;this.$container.isotope(t.getDefaultSettings()),this.$container.imagesLoaded().progress(function(){t.$container.isotope("layout")}),a(this.$element,".ha-js-popup",this.getElementSettings("enable_popup"),"imagegrid")}}),u=s.frontend.handlers.Base.extend({onInit:function(){s.frontend.handlers.Base.prototype.onInit.apply(this,arguments),this.wrapper=this.$element.find(".ha-news-ticker-wrapper"),this.run()},onElementChange:function(t){"item_space"!==t&&"title_typography_font_size"!==t||this.run()},run:function(){var e=this.wrapper.innerHeight(),i=this.wrapper.innerWidth(),n=this.wrapper.find(".ha-news-ticker-container"),a=n.find(".ha-news-ticker-item"),s=this.wrapper.data("scroll-direction"),o="scroll"+s+e+i,r=this.wrapper.data("duration"),l="normal",g=10,h={transform:"translateX(0"+i+"px)"},f={transform:"translateX(-101%)"};"right"===s&&(l="reverse"),a.each(function(){g+=t(this).outerWidth(!0)}),n.css({width:g,display:"flex"}),t.keyframe.define([{name:o,"0%":h,"100%":f}]),n.playKeyframe({name:o,duration:r+"ms",timingFunction:"linear",delay:"0s",iterationCount:"infinite",direction:l,fillMode:"none",complete:function(){}})}}),c=function(t){e.waypoint(t,function(){var e=t.find(".ha-fun-factor-content-number");e.numerator(e.data("animation"))})},p=function(i){e.waypoint(i,function(){var e=t(this),i=e.find(".ha-bar-chart-container"),n=e.find("#ha-bar-chart"),a=i.data("settings");i.length&&new Chart(n,a)})},m=function(e){var i=e.find(".ha-twitter-load-more"),n=e.find(".ha-tweet-items");i.on("click",function(i){i.preventDefault();var a=t(this),s=a.data("settings"),o=a.data("total"),r=e.find(".ha-tweet-item").length;t.ajax({url:HappyLocalize.ajax_url,type:"POST",data:{action:"ha_twitter_feed_action",security:HappyLocalize.nonce,query_settings:s,loaded_item:r},success:function(e){o>r?t(e).appendTo(n):(a.text("All Loaded").addClass("loaded"),setTimeout(function(){a.css({display:"none"})},800))},error:function(t){}})})};t("[data-ha-element-link]").each(function(){var e=t(this).data("ha-element-link");t(this).on("click.haElementOnClick",function(){e.is_external?window.open(e.url):location.href=e.url})});var _={"ha-image-compare.default":o,"ha-justified-gallery.default":r,"ha-number.default":h,"ha-skills.default":f,"ha-fun-factor.default":c,"ha-bar-chart.default":p,"ha-twitter-feed.default":m};t.each(_,function(t,i){e.hooks.addAction("frontend/element_ready/"+t,i)});var y={"ha-slider.default":g,"ha-carousel.default":g,"ha-image-grid.default":d,"ha-news-ticker.default":u,widget:l};t.each(y,function(t,i){e.hooks.addAction("frontend/element_ready/"+t,function(t){e.elementsHandler.addHandler(i,{$element:t})})})})}(jQuery,window);
base/widget-base.php CHANGED
@@ -7,7 +7,6 @@
7
  namespace Happy_Addons\Elementor\Widget;
8
 
9
  use Elementor\Widget_Base;
10
- use Elementor\Controls_Manager;
11
 
12
  defined( 'ABSPATH' ) || die();
13
 
7
  namespace Happy_Addons\Elementor\Widget;
8
 
9
  use Elementor\Widget_Base;
 
10
 
11
  defined( 'ABSPATH' ) || die();
12
 
changelog.txt CHANGED
@@ -1,3 +1,11 @@
 
 
 
 
 
 
 
 
1
  = 2.7.2 - 2 March 2020 =
2
 
3
  - Fix: Dual Button space between buttons issue
1
+ = 2.7.3 - 31 March 2020 =
2
+
3
+ - Tweak: Custom attribute output support for all links
4
+ - Tweak: Added pro widgets awarness panel
5
+ - Fix: Missing styles issue on page/post clone
6
+ - Fix: Popup link not working with link issue
7
+ - Fix: Twitter feed issue
8
+
9
  = 2.7.2 - 2 March 2020 =
10
 
11
  - Fix: Dual Button space between buttons issue
classes/assets-manager.php CHANGED
@@ -7,198 +7,201 @@ defined('ABSPATH') || die();
7
 
8
  class Assets_Manager {
9
 
10
- /**
11
- * Bind hook and run internal methods here
12
- */
13
- public static function init() {
14
- // Frontend scripts
15
- add_action( 'wp_enqueue_scripts', [ __CLASS__, 'frontend_register' ] );
16
- add_action( 'wp_enqueue_scripts', [ __CLASS__, 'frontend_enqueue' ], 99 );
17
- add_action( 'elementor/css-file/post/enqueue', [ __CLASS__, 'frontend_enqueue_exceptions' ] );
18
-
19
- // Edit and preview enqueue
20
- add_action( 'elementor/preview/enqueue_styles', [ __CLASS__, 'enqueue_preview_style' ] );
21
-
22
- // Enqueue editor scripts
23
- add_action( 'elementor/editor/after_enqueue_scripts', [ __CLASS__, 'enqueue_editor_scripts' ] );
24
-
25
- // Placeholder image replacement
26
- add_filter( 'elementor/utils/get_placeholder_image_src', [ __CLASS__, 'set_placeholder_image' ] );
27
-
28
- // Paragraph toolbar registration
29
- add_filter( 'elementor/editor/localize_settings', [ __CLASS__, 'add_inline_editing_intermediate_toolbar' ] );
30
- }
31
-
32
- /**
33
- * Register inline editing paragraph toolbar
34
- *
35
- * @param array $config
36
- * @return array
37
- */
38
- public static function add_inline_editing_intermediate_toolbar( $config ) {
39
- if ( isset( $config['inlineEditing'] ) ) {
40
- $tools = [
41
- 'bold',
42
- 'underline',
43
- 'italic',
44
- 'createlink',
45
- ];
46
-
47
- if ( isset( $config['inlineEditing']['toolbar'] ) ) {
48
- $config['inlineEditing']['toolbar']['intermediate'] = $tools;
49
- } else {
50
- $config['inlineEditing'] = [
51
- 'toolbar' => [
52
- 'intermediate' => $tools,
53
- ],
54
- ];
55
- }
56
- }
57
- return $config;
58
- }
59
-
60
- public static function set_placeholder_image() {
61
- return HAPPY_ADDONS_ASSETS . 'imgs/placeholder.jpg';
62
- }
63
-
64
- public static function frontend_register() {
65
- $suffix = ha_is_script_debug_enabled() ? '.' : '.min.';
66
-
67
- wp_register_style(
68
- 'happy-icons',
69
- HAPPY_ADDONS_ASSETS . 'fonts/style.min.css',
70
- null,
71
- HAPPY_ADDONS_VERSION
72
- );
73
-
74
- /**
75
- * Image comparasion
76
- */
77
- wp_register_style(
78
- 'twentytwenty',
79
- HAPPY_ADDONS_ASSETS . 'vendor/twentytwenty/css/twentytwenty.css',
80
- null,
81
- HAPPY_ADDONS_VERSION
82
- );
83
-
84
- wp_register_script(
85
- 'jquery-event-move',
86
- HAPPY_ADDONS_ASSETS . 'vendor/twentytwenty/js/jquery.event.move.js',
87
- [ 'jquery' ],
88
- HAPPY_ADDONS_VERSION,
89
- true
90
- );
91
-
92
- wp_register_script(
93
- 'jquery-twentytwenty',
94
- HAPPY_ADDONS_ASSETS . 'vendor/twentytwenty/js/jquery.twentytwenty.js',
95
- [ 'jquery-event-move' ],
96
- HAPPY_ADDONS_VERSION,
97
- true
98
- );
99
-
100
- /**
101
- * Justified Grid
102
- */
103
- wp_register_style(
104
- 'justifiedGallery',
105
- HAPPY_ADDONS_ASSETS . 'vendor/justifiedGallery/css/justifiedGallery.min.css',
106
- null,
107
- HAPPY_ADDONS_VERSION
108
- );
109
-
110
- wp_register_script(
111
- 'jquery-justifiedGallery',
112
- HAPPY_ADDONS_ASSETS . 'vendor/justifiedGallery/js/jquery.justifiedGallery.min.js',
113
- [ 'jquery' ],
114
- HAPPY_ADDONS_VERSION,
115
- true
116
- );
117
-
118
- /**
119
- * Carousel and Slider
120
- */
121
- wp_register_style(
122
- 'slick',
123
- HAPPY_ADDONS_ASSETS . 'vendor/slick/slick.css',
124
- null,
125
- HAPPY_ADDONS_VERSION
126
- );
127
-
128
- wp_register_style(
129
- 'slick-theme',
130
- HAPPY_ADDONS_ASSETS . 'vendor/slick/slick-theme.css',
131
- null,
132
- HAPPY_ADDONS_VERSION
133
- );
134
-
135
- wp_register_script(
136
- 'jquery-slick',
137
- HAPPY_ADDONS_ASSETS . 'vendor/slick/slick.min.js',
138
- [ 'jquery' ],
139
- HAPPY_ADDONS_VERSION,
140
- true
141
- );
142
-
143
- /**
144
- * Masonry grid
145
- */
146
- wp_register_script(
147
- 'jquery-isotope',
148
- HAPPY_ADDONS_ASSETS . 'vendor/jquery.isotope.js',
149
- [ 'jquery' ],
150
- HAPPY_ADDONS_VERSION,
151
- true
152
- );
153
-
154
- /**
155
- * Number animation
156
- */
157
- wp_register_script(
158
- 'jquery-numerator',
159
- HAPPY_ADDONS_ASSETS . 'vendor/jquery-numerator/jquery-numerator.min.js',
160
- [ 'jquery' ],
161
- HAPPY_ADDONS_VERSION,
162
- true
163
- );
164
-
165
- /**
166
- * Magnific popup
167
- */
168
- wp_register_style(
169
- 'magnific-popup',
170
- HAPPY_ADDONS_ASSETS . 'vendor/magnific-popup/magnific-popup.css',
171
- null,
172
- HAPPY_ADDONS_VERSION
173
- );
174
-
175
- wp_register_script(
176
- 'jquery-magnific-popup',
177
- HAPPY_ADDONS_ASSETS . 'vendor/magnific-popup/jquery.magnific-popup.min.js',
178
- null,
179
- HAPPY_ADDONS_VERSION,
180
- true
181
- );
182
-
183
- /**
184
- * Floating effects
185
- */
186
- wp_register_script(
187
- 'anime',
188
- HAPPY_ADDONS_ASSETS . 'vendor/anime/lib/anime.min.js',
189
- null,
190
- HAPPY_ADDONS_VERSION,
191
- true
192
- );
193
-
194
- // keyframes
195
- wp_register_script(
196
- 'jquery-keyframes',
197
- HAPPY_ADDONS_ASSETS . 'vendor/keyframes/jquery.keyframes.min.js',
198
- [ 'jquery' ],
199
- HAPPY_ADDONS_VERSION,
200
- true
201
- );
 
 
 
202
 
203
  // Chart.js
204
  wp_register_script(
@@ -235,9 +238,9 @@ class Assets_Manager {
235
  );
236
 
237
  //Localize scripts
238
- wp_localize_script('happy-elementor-addons', 'HappyTwitterLocalize', [
239
  'ajax_url' => admin_url('admin-ajax.php'),
240
- 'nonce' => wp_create_nonce('happy_addons_twitter_nonce'),
241
  ]);
242
  }
243
 
@@ -246,10 +249,10 @@ class Assets_Manager {
246
  *
247
  * @param Post_CSS $file
248
  */
249
- public static function frontend_enqueue_exceptions(Post_CSS $file) {
250
- if (get_queried_object_id() !== $file->get_post_id()) {
251
- if (Cache_Manager::should_enqueue($file->get_post_id())) {
252
- Cache_Manager::enqueue($file->get_post_id());
253
  } else {
254
  Cache_Manager::enqueue_without_cache();
255
  }
@@ -257,12 +260,12 @@ class Assets_Manager {
257
  }
258
 
259
  public static function frontend_enqueue() {
260
- if (!is_singular()) {
261
  return;
262
  }
263
 
264
- if (Cache_Manager::should_enqueue(get_the_ID())) {
265
- Cache_Manager::enqueue(get_the_ID());
266
  } else {
267
  Cache_Manager::enqueue_without_cache();
268
  }
@@ -291,15 +294,27 @@ class Assets_Manager {
291
  true
292
  );
293
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
294
  wp_localize_script(
295
  'happy-elementor-addons-editor',
296
  'HappyAddonsEditor',
297
- [
298
- 'editorPanelHomeLinkURL' => ha_get_dashboard_link(),
299
- 'editorPanelHomeLinkTitle' => __('HappyAddons - Home', 'happy-elementor-addons'),
300
- 'editorPanelWidgetsLinkURL' => ha_get_dashboard_link('#widgets'),
301
- 'editorPanelWidgetsLinkTitle' => __('HappyAddons - Widgets', 'happy-elementor-addons'),
302
- ]
303
  );
304
  }
305
 
7
 
8
  class Assets_Manager {
9
 
10
+ /**
11
+ * Bind hook and run internal methods here
12
+ */
13
+ public static function init() {
14
+ // Frontend scripts
15
+ add_action( 'wp_enqueue_scripts', [ __CLASS__, 'frontend_register' ] );
16
+ add_action( 'wp_enqueue_scripts', [ __CLASS__, 'frontend_enqueue' ], 99 );
17
+ add_action( 'elementor/css-file/post/enqueue', [ __CLASS__, 'frontend_enqueue_exceptions' ] );
18
+
19
+ // Edit and preview enqueue
20
+ add_action( 'elementor/preview/enqueue_styles', [ __CLASS__, 'enqueue_preview_style' ] );
21
+
22
+ // Enqueue editor scripts
23
+ add_action( 'elementor/editor/after_enqueue_scripts', [ __CLASS__, 'enqueue_editor_scripts' ] );
24
+
25
+ // Placeholder image replacement
26
+ add_filter( 'elementor/utils/get_placeholder_image_src', [ __CLASS__, 'set_placeholder_image' ] );
27
+
28
+ // Paragraph toolbar registration
29
+ add_filter( 'elementor/editor/localize_settings', [ __CLASS__, 'add_inline_editing_intermediate_toolbar' ] );
30
+ }
31
+
32
+ /**
33
+ * Register inline editing paragraph toolbar
34
+ *
35
+ * @param array $config
36
+ * @return array
37
+ */
38
+ public static function add_inline_editing_intermediate_toolbar( $config ) {
39
+ if ( ! isset( $config['inlineEditing'] ) ) {
40
+ return $config;
41
+ }
42
+
43
+ $tools = [
44
+ 'bold',
45
+ 'underline',
46
+ 'italic',
47
+ 'createlink',
48
+ ];
49
+
50
+ if ( isset( $config['inlineEditing']['toolbar'] ) ) {
51
+ $config['inlineEditing']['toolbar']['intermediate'] = $tools;
52
+ } else {
53
+ $config['inlineEditing'] = [
54
+ 'toolbar' => [
55
+ 'intermediate' => $tools,
56
+ ],
57
+ ];
58
+ }
59
+
60
+ return $config;
61
+ }
62
+
63
+ public static function set_placeholder_image() {
64
+ return HAPPY_ADDONS_ASSETS . 'imgs/placeholder.jpg';
65
+ }
66
+
67
+ public static function frontend_register() {
68
+ $suffix = ha_is_script_debug_enabled() ? '.' : '.min.';
69
+
70
+ wp_register_style(
71
+ 'happy-icons',
72
+ HAPPY_ADDONS_ASSETS . 'fonts/style.min.css',
73
+ null,
74
+ HAPPY_ADDONS_VERSION
75
+ );
76
+
77
+ /**
78
+ * Image comparasion
79
+ */
80
+ wp_register_style(
81
+ 'twentytwenty',
82
+ HAPPY_ADDONS_ASSETS . 'vendor/twentytwenty/css/twentytwenty.css',
83
+ null,
84
+ HAPPY_ADDONS_VERSION
85
+ );
86
+
87
+ wp_register_script(
88
+ 'jquery-event-move',
89
+ HAPPY_ADDONS_ASSETS . 'vendor/twentytwenty/js/jquery.event.move.js',
90
+ [ 'jquery' ],
91
+ HAPPY_ADDONS_VERSION,
92
+ true
93
+ );
94
+
95
+ wp_register_script(
96
+ 'jquery-twentytwenty',
97
+ HAPPY_ADDONS_ASSETS . 'vendor/twentytwenty/js/jquery.twentytwenty.js',
98
+ [ 'jquery-event-move' ],
99
+ HAPPY_ADDONS_VERSION,
100
+ true
101
+ );
102
+
103
+ /**
104
+ * Justified Grid
105
+ */
106
+ wp_register_style(
107
+ 'justifiedGallery',
108
+ HAPPY_ADDONS_ASSETS . 'vendor/justifiedGallery/css/justifiedGallery.min.css',
109
+ null,
110
+ HAPPY_ADDONS_VERSION
111
+ );
112
+
113
+ wp_register_script(
114
+ 'jquery-justifiedGallery',
115
+ HAPPY_ADDONS_ASSETS . 'vendor/justifiedGallery/js/jquery.justifiedGallery.min.js',
116
+ [ 'jquery' ],
117
+ HAPPY_ADDONS_VERSION,
118
+ true
119
+ );
120
+
121
+ /**
122
+ * Carousel and Slider
123
+ */
124
+ wp_register_style(
125
+ 'slick',
126
+ HAPPY_ADDONS_ASSETS . 'vendor/slick/slick.css',
127
+ null,
128
+ HAPPY_ADDONS_VERSION
129
+ );
130
+
131
+ wp_register_style(
132
+ 'slick-theme',
133
+ HAPPY_ADDONS_ASSETS . 'vendor/slick/slick-theme.css',
134
+ null,
135
+ HAPPY_ADDONS_VERSION
136
+ );
137
+
138
+ wp_register_script(
139
+ 'jquery-slick',
140
+ HAPPY_ADDONS_ASSETS . 'vendor/slick/slick.min.js',
141
+ [ 'jquery' ],
142
+ HAPPY_ADDONS_VERSION,
143
+ true
144
+ );
145
+
146
+ /**
147
+ * Masonry grid
148
+ */
149
+ wp_register_script(
150
+ 'jquery-isotope',
151
+ HAPPY_ADDONS_ASSETS . 'vendor/jquery.isotope.js',
152
+ [ 'jquery' ],
153
+ HAPPY_ADDONS_VERSION,
154
+ true
155
+ );
156
+
157
+ /**
158
+ * Number animation
159
+ */
160
+ wp_register_script(
161
+ 'jquery-numerator',
162
+ HAPPY_ADDONS_ASSETS . 'vendor/jquery-numerator/jquery-numerator.min.js',
163
+ [ 'jquery' ],
164
+ HAPPY_ADDONS_VERSION,
165
+ true
166
+ );
167
+
168
+ /**
169
+ * Magnific popup
170
+ */
171
+ wp_register_style(
172
+ 'magnific-popup',
173
+ HAPPY_ADDONS_ASSETS . 'vendor/magnific-popup/magnific-popup.css',
174
+ null,
175
+ HAPPY_ADDONS_VERSION
176
+ );
177
+
178
+ wp_register_script(
179
+ 'jquery-magnific-popup',
180
+ HAPPY_ADDONS_ASSETS . 'vendor/magnific-popup/jquery.magnific-popup.min.js',
181
+ null,
182
+ HAPPY_ADDONS_VERSION,
183
+ true
184
+ );
185
+
186
+ /**
187
+ * Floating effects
188
+ */
189
+ wp_register_script(
190
+ 'anime',
191
+ HAPPY_ADDONS_ASSETS . 'vendor/anime/lib/anime.min.js',
192
+ null,
193
+ HAPPY_ADDONS_VERSION,
194
+ true
195
+ );
196
+
197
+ // keyframes
198
+ wp_register_script(
199
+ 'jquery-keyframes',
200
+ HAPPY_ADDONS_ASSETS . 'vendor/keyframes/jquery.keyframes.min.js',
201
+ [ 'jquery' ],
202
+ HAPPY_ADDONS_VERSION,
203
+ true
204
+ );
205
 
206
  // Chart.js
207
  wp_register_script(
238
  );
239
 
240
  //Localize scripts
241
+ wp_localize_script('happy-elementor-addons', 'HappyLocalize', [
242
  'ajax_url' => admin_url('admin-ajax.php'),
243
+ 'nonce' => wp_create_nonce('happy_addons_nonce'),
244
  ]);
245
  }
246
 
249
  *
250
  * @param Post_CSS $file
251
  */
252
+ public static function frontend_enqueue_exceptions( Post_CSS $file ) {
253
+ if ( get_queried_object_id() !== $file->get_post_id() ) {
254
+ if ( Cache_Manager::should_enqueue( $file->get_post_id() ) ) {
255
+ Cache_Manager::enqueue( $file->get_post_id() );
256
  } else {
257
  Cache_Manager::enqueue_without_cache();
258
  }
260
  }
261
 
262
  public static function frontend_enqueue() {
263
+ if ( ! is_singular() ) {
264
  return;
265
  }
266
 
267
+ if ( Cache_Manager::should_enqueue( get_the_ID() ) ) {
268
+ Cache_Manager::enqueue( get_the_ID() );
269
  } else {
270
  Cache_Manager::enqueue_without_cache();
271
  }
294
  true
295
  );
296
 
297
+ $localize_data = [
298
+ 'editorPanelHomeLinkURL' => ha_get_dashboard_link(),
299
+ 'editorPanelWidgetsLinkURL' => ha_get_dashboard_link('#widgets'),
300
+ 'i18n' => [
301
+ 'editorPanelHomeLinkTitle' => esc_html__( 'HappyAddons - Home', 'happy-elementor-addons' ),
302
+ 'editorPanelWidgetsLinkTitle' => esc_html__( 'HappyAddons - Widgets', 'happy-elementor-addons' ),
303
+ 'promotionDialogHeader' => esc_html__( '%s Widget', 'happy-elementor-addons' ),
304
+ 'promotionDialogMessage' => esc_html__( 'Use %s widget with other exclusive pro widgets and 100% unique features to extend your toolbox and build sites faster and better.', 'happy-elementor-addons' ),
305
+ ],
306
+ 'proWidgets' => [],
307
+ 'hasPro' => ha_has_pro(),
308
+ ];
309
+
310
+ if ( ! ha_has_pro() && ha_is_elementor_version( '>=', '2.9.0' ) ) {
311
+ $localize_data['proWidgets'] = Widgets_Manager::get_pro_widget_map();
312
+ }
313
+
314
  wp_localize_script(
315
  'happy-elementor-addons-editor',
316
  'HappyAddonsEditor',
317
+ $localize_data
 
 
 
 
 
318
  );
319
  }
320
 
classes/cache-manager.php CHANGED
@@ -91,6 +91,10 @@ class Cache_Manager {
91
  }
92
 
93
  public static function enqueue_without_cache() {
 
 
 
 
94
  $widgets_map = Widgets_Manager::get_widgets_map();
95
  $inactive_widgets = Widgets_Manager::get_inactive_widgets();
96
 
91
  }
92
 
93
  public static function enqueue_without_cache() {
94
+ if ( ! self::is_editing_mode() ) {
95
+ return;
96
+ }
97
+
98
  $widgets_map = Widgets_Manager::get_widgets_map();
99
  $inactive_widgets = Widgets_Manager::get_inactive_widgets();
100
 
classes/clone-handler.php CHANGED
@@ -1,6 +1,8 @@
1
  <?php
2
  namespace Happy_Addons\Elementor;
3
 
 
 
4
  class Clone_Handler {
5
 
6
  /**
@@ -92,7 +94,10 @@ class Clone_Handler {
92
 
93
  if ( ! is_wp_error( $duplicated_post_id ) ) {
94
  self::duplicate_taxonomies( $post, $duplicated_post_id );
95
- self::duplicate_meta_entries( $post, $duplicated_post_id );
 
 
 
96
 
97
  if ( $ref === 'editor' ) {
98
  $document = ha_elementor()->documents->get( $duplicated_post_id );
@@ -189,7 +194,7 @@ class Clone_Handler {
189
  $_value = wp_slash( $entry->meta_value );
190
  $_records[] = "( $duplicated_post_id, '{$entry->meta_key}', '{$_value}' )";
191
  }
192
- $query .= implode( ', ', $_records ) . ';';
193
  $wpdb->query( $query );
194
  }
195
  }
1
  <?php
2
  namespace Happy_Addons\Elementor;
3
 
4
+ use Elementor\Core\Files\CSS\Post as Post_CSS;
5
+
6
  class Clone_Handler {
7
 
8
  /**
94
 
95
  if ( ! is_wp_error( $duplicated_post_id ) ) {
96
  self::duplicate_taxonomies( $post, $duplicated_post_id );
97
+ self::duplicate_meta_entries( $post, $duplicated_post_id );
98
+
99
+ $css = Post_CSS::create( $duplicated_post_id );
100
+ $css->update();
101
 
102
  if ( $ref === 'editor' ) {
103
  $document = ha_elementor()->documents->get( $duplicated_post_id );
194
  $_value = wp_slash( $entry->meta_value );
195
  $_records[] = "( $duplicated_post_id, '{$entry->meta_key}', '{$_value}' )";
196
  }
197
+ $query .= implode( ', ', $_records ) . ';';
198
  $wpdb->query( $query );
199
  }
200
  }
extensions/wrapper-link.php CHANGED
@@ -35,7 +35,7 @@ class Wrapper_Link {
35
  'ha_element_link',
36
  [
37
  'label' => __( 'Link', 'happy-elementor-addons' ),
38
- 'type' => Controls_Manager::URL,
39
  'dynamic' => [
40
  'active' => true,
41
  ],
35
  'ha_element_link',
36
  [
37
  'label' => __( 'Link', 'happy-elementor-addons' ),
38
+ 'type' => Controls_Manager::URL,
39
  'dynamic' => [
40
  'active' => true,
41
  ],
inc/functions.php CHANGED
@@ -304,18 +304,16 @@ function ha_get_current_user_display_name() {
304
  */
305
  function ha_twitter_feed_ajax() {
306
 
307
- define( 'HA_TWEETS_TOKEN', '_tweet_token' );
308
- define( 'HA_TWEETS_CASH', '_tweet_cash' );
309
-
310
- $security = check_ajax_referer('happy_addons_twitter_nonce', 'security');
311
 
312
  if ( true == $security && isset( $_POST['query_settings'] ) ) :
313
  $settings = $_POST['query_settings'];
314
  $loaded_item = $_POST['loaded_item'];
315
 
316
  $user_name = trim($settings['user_name']);
 
317
 
318
- $transient_key = $settings['id'] . '_' . $user_name . HA_TWEETS_CASH;
319
  $twitter_data = get_transient($transient_key);
320
  $credentials = $settings['credentials'];
321
 
@@ -343,7 +341,7 @@ function ha_twitter_feed_ajax() {
343
 
344
  if ( !is_wp_error( $tweets_response ) ) {
345
  $twitter_data = json_decode( wp_remote_retrieve_body( $tweets_response ), true );
346
- set_transient($settings['id'] . '_' . $settings['user_name'] . HA_TWEETS_CASH, $twitter_data, 0); // 2 * MINUTE_IN_SECONDS
347
  }
348
 
349
  switch ($settings['sort_by']) {
@@ -372,6 +370,19 @@ function ha_twitter_feed_ajax() {
372
  $items = array_splice($twitter_data, $loaded_item, $settings['tweets_limit'] );
373
 
374
  foreach ($items as $item) :
 
 
 
 
 
 
 
 
 
 
 
 
 
375
  ?>
376
  <div class="ha-tweet-item">
377
 
@@ -410,11 +421,19 @@ function ha_twitter_feed_ajax() {
410
  </div>
411
 
412
  <div class="ha-tweet-content">
413
- <p><?php echo esc_html( $item['full_text'] ); ?></p>
 
 
 
 
 
 
 
 
414
 
415
  <?php if ( $settings['show_date'] == 'yes' ) : ?>
416
  <div class="ha-tweet-date">
417
- <?php echo esc_html( date("M d Y", strtotime( $item['created_at'] ) ) );?>
418
  </div>
419
  <?php endif; ?>
420
  </div>
304
  */
305
  function ha_twitter_feed_ajax() {
306
 
307
+ $security = check_ajax_referer('happy_addons_nonce', 'security');
 
 
 
308
 
309
  if ( true == $security && isset( $_POST['query_settings'] ) ) :
310
  $settings = $_POST['query_settings'];
311
  $loaded_item = $_POST['loaded_item'];
312
 
313
  $user_name = trim($settings['user_name']);
314
+ $ha_tweets_cash = '_' . $settings['id'] . '_tweet_cash';
315
 
316
+ $transient_key = $user_name . $ha_tweets_cash;
317
  $twitter_data = get_transient($transient_key);
318
  $credentials = $settings['credentials'];
319
 
341
 
342
  if ( !is_wp_error( $tweets_response ) ) {
343
  $twitter_data = json_decode( wp_remote_retrieve_body( $tweets_response ), true );
344
+ set_transient( $transient_key, $twitter_data, 2 * MINUTE_IN_SECONDS );
345
  }
346
 
347
  switch ($settings['sort_by']) {
370
  $items = array_splice($twitter_data, $loaded_item, $settings['tweets_limit'] );
371
 
372
  foreach ($items as $item) :
373
+ if ( !empty( $item['entities']['urls'] ) ) {
374
+ $content = str_replace( $item['entities']['urls'][0]['url'], '', $item['full_text'] );
375
+ } else {
376
+ $content = $item['full_text'];
377
+ }
378
+
379
+ $description = explode( ' ', $content );
380
+ if ( !empty( $settings['content_word_count'] ) && count( $description ) > $settings['content_word_count'] ) {
381
+ $description_shorten = array_slice( $description, 0, $settings['content_word_count'] );
382
+ $description = implode( ' ', $description_shorten ) . '...';
383
+ } else {
384
+ $description = $content;
385
+ }
386
  ?>
387
  <div class="ha-tweet-item">
388
 
421
  </div>
422
 
423
  <div class="ha-tweet-content">
424
+ <p>
425
+ <?php echo esc_html( $description ); ?>
426
+
427
+ <?php if ( $settings['read_more'] == 'yes' ) : ?>
428
+ <a href="<?php echo esc_url( '//twitter.com/' . $item['user']['screen_name'] . '/status/' . $item['id'] ); ?>" target="_blank">
429
+ <?php echo esc_html( $settings['read_more_text'] ); ?>
430
+ </a>
431
+ <?php endif; ?>
432
+ </p>
433
 
434
  <?php if ( $settings['show_date'] == 'yes' ) : ?>
435
  <div class="ha-tweet-date">
436
+ <?php echo esc_html( date("M d Y", strtotime( $item['created_at'] ) ) ); ?>
437
  </div>
438
  <?php endif; ?>
439
  </div>
plugin.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Happy Elementor Addons
4
  * Plugin URI: https://happyaddons.com/
5
  * Description: <a href="https://happyaddons.com/">HappyAddons</a> is a collection of slick, powerful widgets that works seamlessly with Elementor page builder. It’s trendy look with detail customization features allows to create extraordinary designs instantly. <a href="https://happyaddons.com/">HappyAddons</a> is free, rapidly growing and comes with great support.
6
- * Version: 2.7.2
7
  * Author: weDevs
8
  * Author URI: https://happyaddons.com/
9
  * License: GPLv2
@@ -34,7 +34,7 @@ Copyright 2019 HappyMonster <http://happymonster.me>
34
 
35
  defined( 'ABSPATH' ) || die();
36
 
37
- define( 'HAPPY_ADDONS_VERSION', '2.7.2' );
38
  define( 'HAPPY_ADDONS__FILE__', __FILE__ );
39
  define( 'HAPPY_ADDONS_DIR_PATH', plugin_dir_path( HAPPY_ADDONS__FILE__ ) );
40
  define( 'HAPPY_ADDONS_DIR_URL', plugin_dir_url( HAPPY_ADDONS__FILE__ ) );
3
  * Plugin Name: Happy Elementor Addons
4
  * Plugin URI: https://happyaddons.com/
5
  * Description: <a href="https://happyaddons.com/">HappyAddons</a> is a collection of slick, powerful widgets that works seamlessly with Elementor page builder. It’s trendy look with detail customization features allows to create extraordinary designs instantly. <a href="https://happyaddons.com/">HappyAddons</a> is free, rapidly growing and comes with great support.
6
+ * Version: 2.7.3
7
  * Author: weDevs
8
  * Author URI: https://happyaddons.com/
9
  * License: GPLv2
34
 
35
  defined( 'ABSPATH' ) || die();
36
 
37
+ define( 'HAPPY_ADDONS_VERSION', '2.7.3' );
38
  define( 'HAPPY_ADDONS__FILE__', __FILE__ );
39
  define( 'HAPPY_ADDONS_DIR_PATH', plugin_dir_path( HAPPY_ADDONS__FILE__ ) );
40
  define( 'HAPPY_ADDONS_DIR_URL', plugin_dir_url( HAPPY_ADDONS__FILE__ ) );
readme.txt CHANGED
@@ -1,6 +1,6 @@
1
  === Happy Elementor Addons ===
2
  Plugin Name: Happy Elementor Addons
3
- Version: 2.7.2
4
  Author: weDevs
5
  Author URI: https://happyaddons.com/
6
  Contributors: thehappymonster, happyaddons, hasinhayder, mosaddek73, tareq1988, sourav926, wedevs, iqbalrony, mrokon, obiplabon
@@ -276,6 +276,14 @@ It's really easy and super simple to install **Happy Elementor Addons** plugin b
276
 
277
  == Changelog ==
278
 
 
 
 
 
 
 
 
 
279
  = 2.7.2 - 2 March 2020 =
280
 
281
  - Fix: Dual Button space between buttons issue
1
  === Happy Elementor Addons ===
2
  Plugin Name: Happy Elementor Addons
3
+ Version: 2.7.3
4
  Author: weDevs
5
  Author URI: https://happyaddons.com/
6
  Contributors: thehappymonster, happyaddons, hasinhayder, mosaddek73, tareq1988, sourav926, wedevs, iqbalrony, mrokon, obiplabon
276
 
277
  == Changelog ==
278
 
279
+ = 2.7.3 - 31 March 2020 =
280
+
281
+ - Tweak: Custom attribute output support for all links
282
+ - Tweak: Added pro widgets awarness panel
283
+ - Fix: Missing styles issue on page/post clone
284
+ - Fix: Popup link not working with link issue
285
+ - Fix: Twitter feed issue
286
+
287
  = 2.7.2 - 2 March 2020 =
288
 
289
  - Fix: Dual Button space between buttons issue
widgets/bar-chart/widget.php CHANGED
@@ -27,10 +27,6 @@ class Bar_Chart extends Base {
27
  return __( 'Bar Chart', 'happy-elementor-addons' );
28
  }
29
 
30
- // public function get_custom_help_url() {
31
- // return '';
32
- // }
33
-
34
  /**
35
  * Get widget icon.
36
  *
27
  return __( 'Bar Chart', 'happy-elementor-addons' );
28
  }
29
 
 
 
 
 
30
  /**
31
  * Get widget icon.
32
  *
widgets/card/widget.php CHANGED
@@ -1043,14 +1043,9 @@ class Card extends Base {
1043
  $this->add_inline_editing_attributes( 'button_text', 'none' );
1044
  $this->add_render_attribute( 'button_text', 'class', 'ha-btn-text' );
1045
 
1046
- $this->add_render_attribute( 'button', 'class', 'ha-btn' );
1047
- $this->add_render_attribute( 'button', 'href', esc_url( $settings['button_link']['url'] ) );
1048
- if ( ! empty( $settings['button_link']['is_external'] ) ) {
1049
- $this->add_render_attribute( 'button', 'target', '_blank' );
1050
- }
1051
- if ( ! empty( $settings['button_link']['nofollow'] ) ) {
1052
- $this->add_render_attribute( 'button', 'rel', 'nofollow' );
1053
- }
1054
  ?>
1055
 
1056
  <?php if ( $settings['image']['url'] || $settings['image']['id'] ) :
1043
  $this->add_inline_editing_attributes( 'button_text', 'none' );
1044
  $this->add_render_attribute( 'button_text', 'class', 'ha-btn-text' );
1045
 
1046
+ $this->add_render_attribute( 'button', 'class', 'ha-btn' );
1047
+
1048
+ $this->add_link_attributes( 'button', $settings['button_link'] );
 
 
 
 
 
1049
  ?>
1050
 
1051
  <?php if ( $settings['image']['url'] || $settings['image']['id'] ) :
widgets/dual-button/widget.php CHANGED
@@ -806,13 +806,7 @@ class Dual_Button extends Base {
806
 
807
  // Left button
808
  $this->add_render_attribute( 'left_button', 'class', 'ha-dual-btn ha-dual-btn--left' );
809
- $this->add_render_attribute( 'left_button', 'href', esc_url( $settings['left_button_link']['url'] ) );
810
- if ( ! empty( $settings['left_button_link']['is_external'] ) ) {
811
- $this->add_render_attribute( 'left_button', 'target', '_blank' );
812
- }
813
- if ( ! empty( $settings['left_button_link']['nofollow'] ) ) {
814
- $this->add_render_attribute( 'left_button', 'rel', 'nofollow' );
815
- }
816
  $this->add_inline_editing_attributes( 'left_button_text', 'none' );
817
 
818
  if ( ! empty( $settings['left_button_icon'] ) || ! empty( $settings['left_button_selected_icon'] ) ) {
@@ -833,13 +827,7 @@ class Dual_Button extends Base {
833
 
834
  // Right button
835
  $this->add_render_attribute( 'right_button', 'class', 'ha-dual-btn ha-dual-btn--right' );
836
- $this->add_render_attribute( 'right_button', 'href', esc_url( $settings['right_button_link']['url'] ) );
837
- if ( ! empty( $settings['right_button_link']['is_external'] ) ) {
838
- $this->add_render_attribute( 'right_button', 'target', '_blank' );
839
- }
840
- if ( ! empty( $settings['right_button_link']['nofollow'] ) ) {
841
- $this->add_render_attribute( 'right_button', 'rel', 'nofollow' );
842
- }
843
  $this->add_inline_editing_attributes( 'right_button_text', 'none' );
844
 
845
  if ( ! empty( $settings['right_button_icon'] ) || ! empty( $settings['right_button_selected_icon'] ) ) {
806
 
807
  // Left button
808
  $this->add_render_attribute( 'left_button', 'class', 'ha-dual-btn ha-dual-btn--left' );
809
+ $this->add_link_attributes( 'left_button', $settings['left_button_link'] );
 
 
 
 
 
 
810
  $this->add_inline_editing_attributes( 'left_button_text', 'none' );
811
 
812
  if ( ! empty( $settings['left_button_icon'] ) || ! empty( $settings['left_button_selected_icon'] ) ) {
827
 
828
  // Right button
829
  $this->add_render_attribute( 'right_button', 'class', 'ha-dual-btn ha-dual-btn--right' );
830
+ $this->add_link_attributes( 'right_button', $settings['right_button_link'] );
 
 
 
 
 
 
831
  $this->add_inline_editing_attributes( 'right_button_text', 'none' );
832
 
833
  if ( ! empty( $settings['right_button_icon'] ) || ! empty( $settings['right_button_selected_icon'] ) ) {
widgets/gradient-heading/widget.php CHANGED
@@ -222,16 +222,9 @@ class Gradient_Heading extends Base {
222
  $title = ha_kses_basic( $settings['title' ] );
223
 
224
  if ( ! empty( $settings['link']['url'] ) ) {
225
- $this->add_render_attribute( 'link', 'href', esc_url( $settings['link']['url'] ) );
226
- if ( ! empty( $settings['link']['is_external'] ) ) {
227
- $this->add_render_attribute( 'link', 'target', '_blank' );
228
- }
229
 
230
- if ( ! empty( $settings['link']['nofollow'] ) ) {
231
- $this->set_render_attribute( 'link', 'rel', 'nofollow' );
232
- }
233
-
234
- $title = sprintf( '<a %s>%s</a>',
235
  $this->get_render_attribute_string( 'link' ),
236
  $title
237
  );
222
  $title = ha_kses_basic( $settings['title' ] );
223
 
224
  if ( ! empty( $settings['link']['url'] ) ) {
225
+ $this->add_link_attributes( 'link', $settings['link'] );
 
 
 
226
 
227
+ $title = sprintf( '<a %1$s>%2$s</a>',
 
 
 
 
228
  $this->get_render_attribute_string( 'link' ),
229
  $title
230
  );
widgets/icon-box/widget.php CHANGED
@@ -692,13 +692,7 @@ class Icon_Box extends Base {
692
  if ( ! empty( $link['url'] ) ) {
693
  $tag = 'a';
694
  $this->add_render_attribute( 'icon_box', 'class', 'ha-icon-box-link' );
695
- $this->add_render_attribute( 'icon_box', 'href', esc_url( $link['url'] ) );
696
- if ( ! empty ( $link['is_external'] ) ) {
697
- $this->add_render_attribute( 'icon_box', 'target', '_blank' );
698
- }
699
- if ( ! empty( $link['nofollow'] ) ) {
700
- $this->set_render_attribute( 'icon_box', 'rel', 'nofollow' );
701
- }
702
  }
703
  ?>
704
  <<?php echo $tag; ?> <?php echo $this->get_render_attribute_string( 'icon_box' ); ?>>
692
  if ( ! empty( $link['url'] ) ) {
693
  $tag = 'a';
694
  $this->add_render_attribute( 'icon_box', 'class', 'ha-icon-box-link' );
695
+ $this->add_link_attributes( 'icon_box', $link );
 
 
 
 
 
 
696
  }
697
  ?>
698
  <<?php echo $tag; ?> <?php echo $this->get_render_attribute_string( 'icon_box' ); ?>>
widgets/infobox/widget.php CHANGED
@@ -914,13 +914,7 @@ class InfoBox extends Base {
914
  $this->add_render_attribute( 'button_text', 'class', 'ha-btn-text' );
915
 
916
  $this->add_render_attribute( 'button', 'class', 'ha-btn ha-btn--link' );
917
- $this->add_render_attribute( 'button', 'href', esc_url( $settings['button_link']['url'] ) );
918
- if ( ! empty( $settings['button_link']['is_external'] ) ) {
919
- $this->add_render_attribute( 'button', 'target', '_blank' );
920
- }
921
- if ( ! empty( $settings['button_link']['nofollow'] ) ) {
922
- $this->set_render_attribute( 'button', 'rel', 'nofollow' );
923
- }
924
  ?>
925
 
926
  <?php if ( $settings['type'] === 'image' && ( $settings['image']['url'] || $settings['image']['id'] ) ) :
914
  $this->add_render_attribute( 'button_text', 'class', 'ha-btn-text' );
915
 
916
  $this->add_render_attribute( 'button', 'class', 'ha-btn ha-btn--link' );
917
+ $this->add_link_attributes( 'button', $settings['button_link'] );
 
 
 
 
 
 
918
  ?>
919
 
920
  <?php if ( $settings['type'] === 'image' && ( $settings['image']['url'] || $settings['image']['id'] ) ) :
widgets/logo-grid/widget.php CHANGED
@@ -536,10 +536,11 @@ class Logo_Grid extends Base {
536
 
537
  if ( $item['link']['url'] ) {
538
  $tag = 'a';
539
- $this->add_render_attribute( $repeater_key, 'class', 'ha-logo-grid-link' );
 
540
  $this->add_render_attribute( $repeater_key, 'target', '_blank' );
541
  $this->add_render_attribute( $repeater_key, 'rel', 'noopener' );
542
- $this->add_render_attribute( $repeater_key, 'href', esc_url( $item['link']['url'] ) );
543
  }
544
  ?>
545
  <<?php echo $tag; ?> <?php $this->print_render_attribute_string( $repeater_key ); ?>>
536
 
537
  if ( $item['link']['url'] ) {
538
  $tag = 'a';
539
+ $this->add_render_attribute( $repeater_key, 'class', 'ha-logo-grid-link' );
540
+
541
  $this->add_render_attribute( $repeater_key, 'target', '_blank' );
542
  $this->add_render_attribute( $repeater_key, 'rel', 'noopener' );
543
+ $this->add_render_attribute( $repeater_key, 'href', $item['link']['url'] );
544
  }
545
  ?>
546
  <<?php echo $tag; ?> <?php $this->print_render_attribute_string( $repeater_key ); ?>>
widgets/member/widget.php CHANGED
@@ -919,7 +919,7 @@ class Member extends Base {
919
  <?php
920
  foreach ( $settings['profiles'] as $profile ) :
921
  $icon = $profile['name'];
922
- $url = esc_url( $profile['link']['url'] );
923
 
924
  if ($profile['name'] === 'website') {
925
  $icon = 'globe';
919
  <?php
920
  foreach ( $settings['profiles'] as $profile ) :
921
  $icon = $profile['name'];
922
+ $url = $profile['link']['url'];
923
 
924
  if ($profile['name'] === 'website') {
925
  $icon = 'globe';
widgets/pricing-table/widget.php CHANGED
@@ -958,13 +958,7 @@ class Pricing_Table extends Base {
958
  $this->add_inline_editing_attributes( 'button_text', 'none' );
959
  $this->add_render_attribute( 'button_text', 'class', 'ha-pricing-table-btn' );
960
 
961
- $this->add_render_attribute( 'button_text', 'href', esc_url( $settings['button_link']['url'] ) );
962
- if ( ! empty( $settings['button_link']['is_external'] ) ) {
963
- $this->add_render_attribute( 'button_text', 'target', '_blank' );
964
- }
965
- if ( ! empty( $settings['button_link']['nofollow'] ) ) {
966
- $this->add_render_attribute( 'button_text', 'rel', 'nofollow' );
967
- }
968
 
969
  if ( $settings['currency'] === 'custom' ) {
970
  $currency = $settings['currency_custom'];
958
  $this->add_inline_editing_attributes( 'button_text', 'none' );
959
  $this->add_render_attribute( 'button_text', 'class', 'ha-pricing-table-btn' );
960
 
961
+ $this->add_link_attributes( 'button_text', $settings['button_link'] );
 
 
 
 
 
 
962
 
963
  if ( $settings['currency'] === 'custom' ) {
964
  $currency = $settings['currency_custom'];
widgets/social-icons/widget.php CHANGED
@@ -879,7 +879,6 @@ class Social_Icons extends Base {
879
  <?php
880
  foreach ($social_list as $key => $icons) {
881
  $icon = $icons['ha_social_icon']['value'];
882
- $url = esc_url($icons['ha_social_link']['url']);
883
  $social_title = esc_html($icons['ha_social_icon_title']);
884
  $link_attr = 'link_' . $key;
885
 
@@ -887,14 +886,12 @@ class Social_Icons extends Base {
887
  $social_name = str_replace(['fa fa-', 'fab fa-', 'far fa-'], '', $icon);
888
  }
889
 
890
- $this->add_render_attribute($link_attr, 'href', $url);
891
 
892
  $this->add_render_attribute($link_attr, 'class', [
893
  'ha-social-icon',
894
  'elementor-repeater-item-' . $icons['_id'] . ' ' . $hover_css_animation,
895
  'elementor-social-icon-' . ($icon ? $social_name : 'label'),
896
-
897
-
898
  ]);
899
 
900
  if (!empty($icon)) {
@@ -902,15 +899,6 @@ class Social_Icons extends Base {
902
  } else {
903
  $this->add_render_attribute($link_attr, 'class', 'ha-social-icon--custom-label');
904
  }
905
-
906
- if ($icons['ha_social_link']['is_external']) {
907
- $this->add_render_attribute($link_attr, 'target', '_blank');
908
- }
909
-
910
- if ($icons['ha_social_link']['nofollow']) {
911
- $this->add_render_attribute($link_attr, 'rel', 'nofollow');
912
- }
913
-
914
  ?>
915
  <a <?php echo $this->get_render_attribute_string($link_attr); ?>>
916
  <?php
879
  <?php
880
  foreach ($social_list as $key => $icons) {
881
  $icon = $icons['ha_social_icon']['value'];
 
882
  $social_title = esc_html($icons['ha_social_icon_title']);
883
  $link_attr = 'link_' . $key;
884
 
886
  $social_name = str_replace(['fa fa-', 'fab fa-', 'far fa-'], '', $icon);
887
  }
888
 
889
+ $this->add_link_attributes( $link_attr, $icons['ha_social_link'] );
890
 
891
  $this->add_render_attribute($link_attr, 'class', [
892
  'ha-social-icon',
893
  'elementor-repeater-item-' . $icons['_id'] . ' ' . $hover_css_animation,
894
  'elementor-social-icon-' . ($icon ? $social_name : 'label'),
 
 
895
  ]);
896
 
897
  if (!empty($icon)) {
899
  } else {
900
  $this->add_render_attribute($link_attr, 'class', 'ha-social-icon--custom-label');
901
  }
 
 
 
 
 
 
 
 
 
902
  ?>
903
  <a <?php echo $this->get_render_attribute_string($link_attr); ?>>
904
  <?php
widgets/twitter-feed/widget.php CHANGED
@@ -251,6 +251,18 @@ class Twitter_Feed extends Base {
251
  ]
252
  );
253
 
 
 
 
 
 
 
 
 
 
 
 
 
254
  $this->add_control(
255
  'load_more',
256
  [
@@ -1230,7 +1242,7 @@ class Twitter_Feed extends Base {
1230
 
1231
  $twitter_data = json_decode( wp_remote_retrieve_body( $tweets_response ), true );
1232
 
1233
- set_transient($user_name . $ha_tweets_cash, $twitter_data, 5 * MINUTE_IN_SECONDS );
1234
 
1235
  }
1236
 
@@ -1250,18 +1262,21 @@ class Twitter_Feed extends Base {
1250
  }
1251
 
1252
  $query_settings = [
1253
- 'credentials' => $credentials,
1254
- 'id' => $id,
1255
- 'user_name' => $user_name,
1256
- 'sort_by' => $settings['sort_by'],
1257
- 'show_twitter_logo' => $settings['show_twitter_logo'],
1258
- 'tweets_limit' => $settings['tweets_limit'],
1259
- 'show_user_image' => $settings['show_user_image'],
1260
- 'show_name' => $settings['show_name'],
1261
- 'show_user_name' => $settings['show_user_name'],
1262
- 'show_date' => $settings['show_date'],
1263
- 'show_favorite' => $settings['show_favorite'],
1264
- 'show_retweet' => $settings['show_retweet'],
 
 
 
1265
  ];
1266
  $query_settings = json_encode($query_settings, true);
1267
 
@@ -1296,7 +1311,22 @@ class Twitter_Feed extends Base {
1296
  }
1297
  ?>
1298
  <div class="ha-tweet-items">
1299
- <?php foreach ( $items as $item ) : ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1300
  <div class="ha-tweet-item">
1301
 
1302
  <?php if ( $settings['show_twitter_logo'] == 'yes' ) : ?>
@@ -1334,9 +1364,8 @@ class Twitter_Feed extends Base {
1334
  </div>
1335
 
1336
  <div class="ha-tweet-content">
1337
- <?php $content = str_replace( $item['entities']['urls'][0]['url'], '', $item['full_text'] ); ?>
1338
  <p>
1339
- <?php echo esc_html( $content ); ?>
1340
 
1341
  <?php if ( $settings['read_more'] == 'yes' ) : ?>
1342
  <a href="<?php echo esc_url( '//twitter.com/' . $item['user']['screen_name'] . '/status/' . $item['id'] ); ?>" target="_blank">
251
  ]
252
  );
253
 
254
+ $this->add_control(
255
+ 'content_word_count',
256
+ [
257
+ 'label' => __( 'Content Word Count', 'happy-elementor-addons' ),
258
+ 'type' => Controls_Manager::NUMBER,
259
+ 'min' => 0,
260
+ 'step' => 1,
261
+ 'max' => 500,
262
+ 'default' => 15,
263
+ ]
264
+ );
265
+
266
  $this->add_control(
267
  'load_more',
268
  [
1242
 
1243
  $twitter_data = json_decode( wp_remote_retrieve_body( $tweets_response ), true );
1244
 
1245
+ set_transient( $transient_key, $twitter_data, 2 * MINUTE_IN_SECONDS );
1246
 
1247
  }
1248
 
1262
  }
1263
 
1264
  $query_settings = [
1265
+ 'credentials' => $credentials,
1266
+ 'id' => $id,
1267
+ 'user_name' => $user_name,
1268
+ 'sort_by' => $settings['sort_by'],
1269
+ 'show_twitter_logo' => $settings['show_twitter_logo'],
1270
+ 'tweets_limit' => $settings['tweets_limit'],
1271
+ 'show_user_image' => $settings['show_user_image'],
1272
+ 'show_name' => $settings['show_name'],
1273
+ 'show_user_name' => $settings['show_user_name'],
1274
+ 'show_date' => $settings['show_date'],
1275
+ 'show_favorite' => $settings['show_favorite'],
1276
+ 'show_retweet' => $settings['show_retweet'],
1277
+ 'read_more' => $settings['read_more'],
1278
+ 'read_more_text' => $settings['read_more_text'],
1279
+ 'content_word_count' => $settings['content_word_count'],
1280
  ];
1281
  $query_settings = json_encode($query_settings, true);
1282
 
1311
  }
1312
  ?>
1313
  <div class="ha-tweet-items">
1314
+ <?php
1315
+ foreach ( $items as $item ) :
1316
+ if ( !empty( $item['entities']['urls'] ) ) {
1317
+ $content = str_replace( $item['entities']['urls'][0]['url'], '', $item['full_text'] );
1318
+ } else {
1319
+ $content = $item['full_text'];
1320
+ }
1321
+
1322
+ $description = explode( ' ', $content );
1323
+ if ( !empty( $settings['content_word_count'] ) && count( $description ) > $settings['content_word_count'] ) {
1324
+ $description_shorten = array_slice( $description, 0, $settings['content_word_count'] );
1325
+ $description = implode( ' ', $description_shorten ) . '...';
1326
+ } else {
1327
+ $description = $content;
1328
+ }
1329
+ ?>
1330
  <div class="ha-tweet-item">
1331
 
1332
  <?php if ( $settings['show_twitter_logo'] == 'yes' ) : ?>
1364
  </div>
1365
 
1366
  <div class="ha-tweet-content">
 
1367
  <p>
1368
+ <?php echo esc_html( $description ); ?>
1369
 
1370
  <?php if ( $settings['read_more'] == 'yes' ) : ?>
1371
  <a href="<?php echo esc_url( '//twitter.com/' . $item['user']['screen_name'] . '/status/' . $item['id'] ); ?>" target="_blank">