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

Version Description

  • 8 June 2020 =

  • New: Happy Templates Library

  • New: WP Fluent Forms widget

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.12.0
Comparing to
See all releases

Code changes from version 2.11.1 to 2.12.0

assets/admin/css/template-library.css ADDED
@@ -0,0 +1,292 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .haTemplateLibrary__preview {
2
+ overflow: hidden;
3
+ margin: auto;
4
+ width: 100%;
5
+ height: 100%;
6
+ -webkit-transition: width .2s, height .2s;
7
+ transition: width .2s, height .2s;
8
+ }
9
+
10
+ .haTemplateLibrary__preview > iframe {
11
+ width: 150%;
12
+ height: 150%;
13
+ -webkit-transform: scale(.666) translateX(-25%) translateY(-25%);
14
+ -ms-transform: scale(.666) translateX(-25%) translateY(-25%);
15
+ transform: scale(.666) translateX(-25%) translateY(-25%);
16
+ }
17
+
18
+ .haTemplateLibrary__logo-wrap {
19
+ display: inline-block;
20
+ margin-right: 10px;
21
+ width: 30px;
22
+ height: 30px;
23
+ border-radius: 100%;
24
+ background-color: #562dd4;
25
+ color: #fff;
26
+ text-align: center;
27
+ line-height: 30px;
28
+ }
29
+
30
+ .haTemplateLibrary__logo-wrap > i {
31
+ position: relative;
32
+ top: 1px;
33
+ }
34
+
35
+ .haTemplateLibrary__logo-title {
36
+ padding-top: 2px;
37
+ }
38
+
39
+ .haTemplateLibrary__responsive-menu-item {
40
+ display: inline-block;
41
+ padding: 15px 0;
42
+ width: 40px;
43
+ cursor: pointer;
44
+ }
45
+ .haTemplateLibrary__responsive-menu-item.elementor-active {
46
+ border-bottom: 3px solid #562dd4;
47
+ background-image: -webkit-linear-gradient(top, #f1f3f5, #fff);
48
+ background-image: linear-gradient(to bottom, #f1f3f5, #fff);
49
+ }
50
+
51
+ #haTemplateLibrary__toolbar {
52
+ display: -webkit-box;
53
+ display: -webkit-flex;
54
+ display: -ms-flexbox;
55
+ display: flex;
56
+ -webkit-box-align: center;
57
+ -webkit-align-items: center;
58
+ align-items: center;
59
+ -ms-flex-align: center;
60
+ -webkit-box-pack: justify;
61
+ -ms-flex-pack: justify;
62
+ -webkit-justify-content: space-between;
63
+ justify-content: space-between;
64
+ }
65
+
66
+ #haTemplateLibrary__toolbar-search,
67
+ #haTemplateLibrary__toolbar-filter {
68
+ position: relative;
69
+ width: 200px;
70
+ }
71
+
72
+ #haTemplateLibrary__toolbar-search i,
73
+ .haTemplateLibrary__filter-btn i {
74
+ position: absolute;
75
+ top: 50%;
76
+ right: 0;
77
+ -webkit-transform: translateY(-50%);
78
+ -ms-transform: translateY(-50%);
79
+ transform: translateY(-50%);
80
+ }
81
+
82
+ .haTemplateLibrary__filter-btn {
83
+ display: block;
84
+ text-align: left;
85
+ cursor: pointer;
86
+ }
87
+
88
+ #haTemplateLibrary__search {
89
+ border: none;
90
+ }
91
+
92
+ #haTemplateLibrary__search,
93
+ .haTemplateLibrary__filter-btn {
94
+ padding: 8px 15px 8px 0;
95
+ border-bottom: 1px solid #d5dadf;
96
+ border-radius: 0;
97
+ text-transform: uppercase;
98
+ font-size: 11px;
99
+ }
100
+
101
+ #haTemplateLibrary__filter-tags {
102
+ position: absolute;
103
+ top: 100%;
104
+ left: 0;
105
+ z-index: 999;
106
+ display: none;
107
+ margin-top: 10px;
108
+ padding: 10px;
109
+ width: 270%;
110
+ border-radius: 0 2px 2px;
111
+ background-color: #fff;
112
+ box-shadow: 0 4px 8px rgba(0, 0, 0, .05);
113
+ }
114
+ #haTemplateLibrary__filter-tags > li {
115
+ float: left;
116
+ padding: 10px;
117
+ width: calc(100% / 4);
118
+ text-align: left;
119
+ text-transform: capitalize;
120
+ cursor: pointer;
121
+ }
122
+ #haTemplateLibrary__filter-tags > li:hover,
123
+ #haTemplateLibrary__filter-tags > li.active {
124
+ color: #e8357c;
125
+ }
126
+ #haTemplateLibrary__filter-tags:before {
127
+ position: absolute;
128
+ bottom: 100%;
129
+ left: 0;
130
+ width: 0;
131
+ height: 0;
132
+ border: solid transparent;
133
+ border-width: 0 10px 10px 0;
134
+ border-bottom-color: #fff;
135
+ content: " ";
136
+ pointer-events: none;
137
+ }
138
+
139
+ #haTemplateLibrary__templates {
140
+ height: calc(100% + 30px);
141
+ }
142
+
143
+ .haTemplateLibrary__templates-window {
144
+ position: relative;
145
+ overflow-y: auto;
146
+ margin: 10px -15px 0;
147
+ height: calc(100% - 45px);
148
+ }
149
+
150
+ #haTemplateLibrary__templates-list {
151
+ display: -webkit-box;
152
+ display: -webkit-flex;
153
+ display: -ms-flexbox;
154
+ display: flex;
155
+ -webkit-box-align: start;
156
+ -webkit-align-items: flex-start;
157
+ align-items: flex-start;
158
+ -ms-flex-align: start;
159
+ -webkit-flex-wrap: wrap;
160
+ -ms-flex-wrap: wrap;
161
+ flex-wrap: wrap;
162
+ }
163
+
164
+ .haTemplateLibrary__template {
165
+ position: relative;
166
+ overflow: hidden;
167
+ margin: 15px;
168
+ width: calc(33.333% - 30px);
169
+ border-radius: 2px;
170
+ background-color: #fff;
171
+ box-shadow: 0 1px 20px 0 rgba(0, 0, 0, .07);
172
+ }
173
+ .haTemplateLibrary__template-body {
174
+ position: relative;
175
+ }
176
+ .haTemplateLibrary__template-preview {
177
+ position: absolute;
178
+ top: 0;
179
+ left: 0;
180
+ width: 100%;
181
+ height: 100%;
182
+ background-color: rgba(0, 0, 0, .5);
183
+ opacity: 0;
184
+ cursor: pointer;
185
+ -webkit-transition: opacity .5s;
186
+ transition: opacity .5s;
187
+ }
188
+ .haTemplateLibrary__template-preview i {
189
+ position: absolute;
190
+ top: 50%;
191
+ left: 50%;
192
+ color: #d5dadf;
193
+ font-size: 20px;
194
+ -webkit-transform: translate(-50%, -50%);
195
+ -ms-transform: translate(-50%, -50%);
196
+ transform: translate(-50%, -50%);
197
+ }
198
+ .haTemplateLibrary__template-badge {
199
+ position: absolute;
200
+ top: 10px;
201
+ right: 10px;
202
+ display: inline-block;
203
+ padding: 2px 4px;
204
+ border-radius: 2px;
205
+ background-color: #e8357c;
206
+ color: #fff;
207
+ text-transform: uppercase;
208
+ letter-spacing: .5px;
209
+ font-size: 10px;
210
+ }
211
+ .haTemplateLibrary__template:hover .haTemplateLibrary__template-preview {
212
+ opacity: 1;
213
+ }
214
+ .haTemplateLibrary__template-thumbnail {
215
+ display: block;
216
+ width: 100%;
217
+ }
218
+ .haTemplateLibrary__template-footer {
219
+ position: absolute;
220
+ bottom: 0;
221
+ left: 0;
222
+ display: -webkit-box;
223
+ display: -webkit-flex;
224
+ display: -ms-flexbox;
225
+ display: flex;
226
+ -webkit-box-align: center;
227
+ -webkit-align-items: center;
228
+ align-items: center;
229
+ -ms-flex-align: center;
230
+ -webkit-box-pack: justify;
231
+ -ms-flex-pack: justify;
232
+ -webkit-justify-content: space-between;
233
+ justify-content: space-between;
234
+ padding: 10px;
235
+ width: 100%;
236
+ background-color: #fff;
237
+ font-size: 11px;
238
+ line-height: 1;
239
+ -webkit-transition: -webkit-transform .5s;
240
+ transition: -webkit-transform .5s;
241
+ transition: transform .5s;
242
+ transition: transform .5s, -webkit-transform .5s;
243
+ -webkit-transform: translateY(100%);
244
+ -ms-transform: translateY(100%);
245
+ transform: translateY(100%);
246
+ }
247
+ .haTemplateLibrary__template:hover .haTemplateLibrary__template-footer {
248
+ -webkit-transform: translateY(0);
249
+ -ms-transform: translateY(0);
250
+ transform: translateY(0);
251
+ }
252
+ .haTemplateLibrary__template .haTemplateLibrary__pro-button {
253
+ color: #e8357c;
254
+ }
255
+ .haTemplateLibrary__template .haTemplateLibrary__pro-button:hover,
256
+ .haTemplateLibrary__template .haTemplateLibrary__pro-button:focus {
257
+ color: #ed639a;
258
+ }
259
+ .haTemplateLibrary__template .haTemplateLibrary__insert-button {
260
+ color: #562dd4;
261
+ }
262
+ .haTemplateLibrary__template .haTemplateLibrary__insert-button:hover,
263
+ .haTemplateLibrary__template .haTemplateLibrary__insert-button:focus {
264
+ color: #7857dd;
265
+ }
266
+ .haTemplateLibrary__template .haTemplateLibrary__preview-button {
267
+ color: #495157;
268
+ }
269
+ .haTemplateLibrary__template .haTemplateLibrary__preview-button:hover,
270
+ .haTemplateLibrary__template .haTemplateLibrary__preview-button:focus {
271
+ color: #606b73;
272
+ }
273
+
274
+ #elementor-template-library-header-preview .haTemplateLibrary__pro-button {
275
+ background-color: #e8357c;
276
+ color: #fff;
277
+ }
278
+ #elementor-template-library-header-preview .haTemplateLibrary__pro-button:hover,
279
+ #elementor-template-library-header-preview .haTemplateLibrary__pro-button:focus {
280
+ background-color: #ed639a;
281
+ color: #fff;
282
+ }
283
+
284
+ #elementor-template-library-header-preview .haTemplateLibrary__insert-button {
285
+ background-color: #562dd4;
286
+ color: #fff;
287
+ }
288
+ #elementor-template-library-header-preview .haTemplateLibrary__insert-button:hover,
289
+ #elementor-template-library-header-preview .haTemplateLibrary__insert-button:focus {
290
+ background-color: #7857dd;
291
+ color: #fff;
292
+ }
assets/admin/css/template-library.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .haTemplateLibrary__preview{overflow:hidden;margin:auto;width:100%;height:100%;-webkit-transition:width .2s,height .2s;transition:width .2s,height .2s}.haTemplateLibrary__preview>iframe{width:150%;height:150%;-webkit-transform:scale(.666) translateX(-25%) translateY(-25%);-ms-transform:scale(.666) translateX(-25%) translateY(-25%);transform:scale(.666) translateX(-25%) translateY(-25%)}.haTemplateLibrary__logo-wrap{display:inline-block;margin-right:10px;width:30px;height:30px;border-radius:100%;background-color:#562dd4;color:#fff;text-align:center;line-height:30px}.haTemplateLibrary__logo-wrap>i{position:relative;top:1px}.haTemplateLibrary__logo-title{padding-top:2px}.haTemplateLibrary__responsive-menu-item{display:inline-block;padding:15px 0;width:40px;cursor:pointer}.haTemplateLibrary__responsive-menu-item.elementor-active{border-bottom:3px solid #562dd4;background-image:-webkit-linear-gradient(top,#f1f3f5,#fff);background-image:linear-gradient(to bottom,#f1f3f5,#fff)}#haTemplateLibrary__toolbar{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-ms-flex-align:center;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between}#haTemplateLibrary__toolbar-filter,#haTemplateLibrary__toolbar-search{position:relative;width:200px}#haTemplateLibrary__toolbar-search i,.haTemplateLibrary__filter-btn i{position:absolute;top:50%;right:0;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%)}.haTemplateLibrary__filter-btn{display:block;text-align:left;cursor:pointer}#haTemplateLibrary__search{border:none}#haTemplateLibrary__search,.haTemplateLibrary__filter-btn{padding:8px 15px 8px 0;border-bottom:1px solid #d5dadf;border-radius:0;text-transform:uppercase;font-size:11px}#haTemplateLibrary__filter-tags{position:absolute;top:100%;left:0;z-index:999;display:none;margin-top:10px;padding:10px;width:270%;border-radius:0 2px 2px;background-color:#fff;box-shadow:0 4px 8px rgba(0,0,0,.05)}#haTemplateLibrary__filter-tags>li{float:left;padding:10px;width:calc(100%/4);text-align:left;text-transform:capitalize;cursor:pointer}#haTemplateLibrary__filter-tags>li.active,#haTemplateLibrary__filter-tags>li:hover,.haTemplateLibrary__template .haTemplateLibrary__pro-button{color:#e8357c}#haTemplateLibrary__filter-tags:before{position:absolute;bottom:100%;left:0;width:0;height:0;border:solid transparent;border-width:0 10px 10px 0;border-bottom-color:#fff;content:" ";pointer-events:none}#haTemplateLibrary__templates{height:calc(100% + 30px)}.haTemplateLibrary__templates-window{position:relative;overflow-y:auto;margin:10px -15px 0;height:calc(100% - 45px)}#haTemplateLibrary__templates-list{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:start;-webkit-align-items:flex-start;align-items:flex-start;-ms-flex-align:start;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.haTemplateLibrary__template{position:relative;overflow:hidden;margin:15px;width:calc(33.333% - 30px);border-radius:2px;background-color:#fff;box-shadow:0 1px 20px 0 rgba(0,0,0,.07)}.haTemplateLibrary__template-body{position:relative}.haTemplateLibrary__template-preview{position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.5);opacity:0;cursor:pointer;-webkit-transition:opacity .5s;transition:opacity .5s}.haTemplateLibrary__template-preview i{position:absolute;top:50%;left:50%;color:#d5dadf;font-size:20px;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.haTemplateLibrary__template-badge{position:absolute;top:10px;right:10px;display:inline-block;padding:2px 4px;border-radius:2px;background-color:#e8357c;color:#fff;text-transform:uppercase;letter-spacing:.5px;font-size:10px}.haTemplateLibrary__template:hover .haTemplateLibrary__template-preview{opacity:1}.haTemplateLibrary__template-thumbnail{display:block;width:100%}.haTemplateLibrary__template-footer{position:absolute;bottom:0;left:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-ms-flex-align:center;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;padding:10px;width:100%;background-color:#fff;font-size:11px;line-height:1;-webkit-transition:-webkit-transform .5s;transition:transform .5s;transition:transform .5s,-webkit-transform .5s;-webkit-transform:translateY(100%);-ms-transform:translateY(100%);transform:translateY(100%)}.haTemplateLibrary__template:hover .haTemplateLibrary__template-footer{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}.haTemplateLibrary__template .haTemplateLibrary__pro-button:focus,.haTemplateLibrary__template .haTemplateLibrary__pro-button:hover{color:#ed639a}.haTemplateLibrary__template .haTemplateLibrary__insert-button{color:#562dd4}.haTemplateLibrary__template .haTemplateLibrary__insert-button:focus,.haTemplateLibrary__template .haTemplateLibrary__insert-button:hover{color:#7857dd}.haTemplateLibrary__template .haTemplateLibrary__preview-button{color:#495157}.haTemplateLibrary__template .haTemplateLibrary__preview-button:focus,.haTemplateLibrary__template .haTemplateLibrary__preview-button:hover{color:#606b73}#elementor-template-library-header-preview .haTemplateLibrary__pro-button{background-color:#e8357c;color:#fff}#elementor-template-library-header-preview .haTemplateLibrary__pro-button:focus,#elementor-template-library-header-preview .haTemplateLibrary__pro-button:hover{background-color:#ed639a;color:#fff}#elementor-template-library-header-preview .haTemplateLibrary__insert-button{background-color:#562dd4;color:#fff}#elementor-template-library-header-preview .haTemplateLibrary__insert-button:focus,#elementor-template-library-header-preview .haTemplateLibrary__insert-button:hover{background-color:#7857dd;color:#fff}
assets/admin/js/admin.js DELETED
@@ -1,34 +0,0 @@
1
- ;(function($) {
2
- $(function() {
3
- var $clearCache = $('.hajs-clear-cache'),
4
- $haMenu = $('#toplevel_page_happy-addons .toplevel_page_happy-addons .wp-menu-name'),
5
- menuText = $haMenu.text();
6
-
7
- $haMenu.text(menuText.replace(/\s/, ''));
8
-
9
- $clearCache.on('click', 'a', function(e) {
10
- e.preventDefault();
11
-
12
- var type = 'all',
13
- $m = $(e.delegateTarget);
14
-
15
- if ($m.hasClass('ha-clear-page-cache')) {
16
- type = 'page';
17
- }
18
-
19
- $m.addClass('ha-clear-cache--init');
20
-
21
- $.post(
22
- HappyAdmin.ajax_url,
23
- {
24
- action: 'ha_clear_cache',
25
- type: type,
26
- nonce: HappyAdmin.nonce,
27
- post_id: HappyAdmin.post_id
28
- }
29
- ).done(function(res) {
30
- $m.removeClass('ha-clear-cache--init').addClass('ha-clear-cache--done');
31
- });
32
- });
33
- })
34
- }(jQuery));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/admin/js/dashboard.js DELETED
@@ -1,152 +0,0 @@
1
- ;(function($, HappyDashboard) {
2
- 'use strict';
3
-
4
- $(function() {
5
-
6
- var $tabsWrapper = $('.ha-dashboard-tabs'),
7
- $tabsNav = $tabsWrapper.find('.ha-dashboard-tabs__nav'),
8
- $tabsContent = $tabsWrapper.find('.ha-dashboard-tabs__content'),
9
- $sidebarMenuWrapper = $('#toplevel_page_happy-addons'),
10
- $sidebarSubmenu = $sidebarMenuWrapper.find('.wp-submenu');
11
-
12
- $tabsNav.on('click', '.ha-dashboard-tabs__nav-item', function(event) {
13
- var $currentTab = $(event.currentTarget),
14
- tabTargetHash = event.currentTarget.hash,
15
- tabIdSelector = '#tab-content-' + tabTargetHash.substring(1),
16
- $currentTabContent = $tabsContent.find(tabIdSelector);
17
-
18
- if ( $currentTab.is( '.nav-item-is--link' ) ) {
19
- return true;
20
- }
21
-
22
- event.preventDefault();
23
-
24
- $currentTab
25
- .addClass('tab--is-active')
26
- .siblings()
27
- .removeClass('tab--is-active');
28
-
29
- $currentTabContent
30
- .addClass('tab--is-active')
31
- .siblings()
32
- .removeClass('tab--is-active');
33
-
34
- window.location.hash = tabTargetHash;
35
- $sidebarSubmenu.find('a').filter(function(i, a) {
36
- return tabTargetHash === a.hash;
37
- }).parent().addClass('current').siblings().removeClass('current');
38
- });
39
-
40
- if (window.location.hash) {
41
- $tabsNav.find('a[href="'+window.location.hash+'"]').click();
42
- $sidebarSubmenu.find('a').filter(function(i, a) {
43
- return window.location.hash === a.hash;
44
- }).parent().addClass('current').siblings().removeClass('current');
45
- }
46
-
47
- $sidebarSubmenu.on('click', 'a', function(event) {
48
- if ( ! event.currentTarget.hash) {
49
- return true;
50
- }
51
- event.preventDefault();
52
-
53
- window.location.hash = event.currentTarget.hash;
54
-
55
- var $currentItem = $(event.currentTarget);
56
- $currentItem.parent().addClass('current').siblings().removeClass('current');
57
-
58
- $tabsNav.find('a[href="'+event.currentTarget.hash+'"]').click();
59
- });
60
-
61
- var $dashboardForm = $('#ha-dashboard-form'),
62
- $widgetsList = $dashboardForm.find('.ha-dashboard-widgets'),
63
- $saveButton = $dashboardForm.find('.ha-dashboard-btn--save');
64
-
65
- $dashboardForm.on('submit', function(event) {
66
- event.preventDefault();
67
-
68
- $.post({
69
- url: HappyDashboard.ajaxUrl,
70
- data: {
71
- nonce: HappyDashboard.nonce,
72
- action: HappyDashboard.action,
73
- data: $dashboardForm.serialize()
74
- },
75
- beforeSend: function() {
76
- $saveButton
77
- .text('.....')
78
- .css('animation', 'animateTextIndent infinite 2.5s');
79
- },
80
- success: function(response) {
81
- if ( response.success ) {
82
- var t = setTimeout(function () {
83
- $saveButton
84
- .css('animation', '')
85
- .attr('disabled', true)
86
- .text(HappyDashboard.savedLabel);
87
- clearTimeout(t);
88
- }, 500);
89
- }
90
- }
91
- });
92
- });
93
-
94
- $dashboardForm.on('change', ':checkbox, :radio', function() {
95
- $saveButton.attr('disabled', false).text(HappyDashboard.saveChangesLabel);
96
- });
97
-
98
- $('.ha-action--btn').on('click', function(event) {
99
- event.preventDefault();
100
-
101
- var $currentAction = $(this),
102
- filter = $currentAction.data('filter'),
103
- action = $currentAction.data('action'),
104
- $all = $widgetsList.find('.ha-dashboard-widgets__item'),
105
- $free = $all.not('.item--is-pro'),
106
- $pro = $all.filter('.item--is-pro'),
107
- $toggle = $all.not('.item--is-placeholder').find(':checkbox');
108
-
109
- if ( filter ) {
110
- switch ( filter ) {
111
- case 'free':
112
- $free.show();
113
- $pro.hide();
114
- break;
115
- case 'pro':
116
- $free.hide();
117
- $pro.show();
118
- break;
119
- case '*':
120
- default:
121
- $all.show();
122
- break;
123
- }
124
- }
125
-
126
- if ( action ) {
127
- if ('enable' === action) {
128
- $toggle.prop('checked', true);
129
- } else if ( 'disable' === action ) {
130
- $toggle.prop('checked', false);
131
- }
132
- $toggle.trigger('change');
133
- }
134
- });
135
-
136
-
137
- $('.ha-feature-sub-title-a').magnificPopup({
138
- disableOn: 700,
139
- type: 'iframe',
140
- mainClass: 'mfp-fade',
141
- removalDelay: 160,
142
- preloader: false,
143
-
144
- fixedContentPos: false
145
- });
146
-
147
- $('.btn-how-to-contribute').on('click', function(event) {
148
- event.preventDefault();
149
- $(this).next().show();
150
- });
151
- });
152
- }(jQuery, window.HappyDashboard));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/admin/js/editor.js DELETED
@@ -1,349 +0,0 @@
1
- ;(function($) {
2
- 'use strict';
3
-
4
- window.ha = window.ha || {};
5
-
6
- ha.hasIconLibrary = function() {
7
- return ( elementor.helpers && elementor.helpers.renderIcon );
8
- };
9
-
10
- ha.getFeatureLabel = function( text ) {
11
- var div = document.createElement('DIV');
12
-
13
- div.innerHTML = text;
14
- text = div.textContent || div.innerText || text;
15
-
16
- return text.length > 20 ? text.substring(0, 20) + '...' : text;
17
- };
18
-
19
- ha.translate = function(stringKey, templateArgs) {
20
- return elementorCommon.translate(stringKey, null, templateArgs, HappyAddonsEditor.i18n);
21
- };
22
-
23
- // For BC
24
- window.ha_get_feature_label = ha.getFeatureLabel;
25
- window.ha_has_icon_library = ha.hasIconLibrary;
26
- window.ha_translate = ha.hasIconLibrary;
27
-
28
- ha.getButtonWithIcon = function(view, args) {
29
- var buttonMarkup = [],
30
- settings = {},
31
- btnIconHTML,
32
- btnMigrated,
33
- btnIcon,
34
- buttonBefore,
35
- buttonAfter;
36
-
37
- args = args || {};
38
- args = _.defaults( args, {
39
- oldIcon: 'button_icon',
40
- iconPos: 'button_icon_position',
41
- newIcon: 'button_selected_icon',
42
- text: 'button_text',
43
- link: 'button_link',
44
- class: 'ha-btn ha-btn--link',
45
- textClass: 'ha-btn-text',
46
- } );
47
-
48
- if (!_.isObject(view) || _.isUndefined(view['getContainer']) ) {
49
- return '';
50
- }
51
-
52
- settings = view.getContainer().settings.toJSON();
53
-
54
- if ( ha.hasIconLibrary() ) {
55
- btnIconHTML = elementor.helpers.renderIcon( view, settings[args.newIcon], { 'aria-hidden': true, 'class': 'ha-btn-icon' }, 'i' , 'object' ),
56
- btnMigrated = elementor.helpers.isIconMigrated( settings, args.newIcon );
57
- }
58
-
59
- view.addInlineEditingAttributes( args.text, 'none' );
60
- view.addRenderAttribute( args.text, 'class', args.textClass );
61
-
62
- view.addRenderAttribute( 'button', 'class', args.class );
63
- view.addRenderAttribute( 'button', 'href', settings[args.link].url );
64
-
65
- if ( ( settings[args.newIcon] && settings[args.newIcon].value ) || settings[args.oldIcon] ) {
66
- if ( ha.hasIconLibrary() && btnIconHTML && btnIconHTML.rendered && ( ! settings[args.oldIcon] || btnMigrated ) ) {
67
- if ( settings[args.newIcon].library === 'svg' ) {
68
- btnIcon = '<span class="ha-btn-icon ha-btn-icon--svg">' + btnIconHTML.value + '</span>';
69
- } else {
70
- btnIcon = btnIconHTML.value;
71
- }
72
- } else if ( settings[args.oldIcon] ) {
73
- btnIcon = '<i class="ha-btn-icon ' + args.oldIcon + '" aria-hidden="true"></i>';
74
- }
75
- }
76
-
77
- if ( settings[args.text] && ( ! settings[args.newIcon] && ! settings[args.oldIcon] ) ) {
78
- buttonMarkup = [
79
- '<a ' + view.getRenderAttributeString( 'button' ) + '>',
80
- '<span ' + view.getRenderAttributeString( args.text ) + '>',
81
- settings[args.text],
82
- '</span>',
83
- '</a>',
84
- ];
85
- } else if ( ! settings[args.text] && ( settings[args.newIcon] || settings[args.oldIcon] ) ) {
86
- buttonMarkup = [
87
- '<a ' + view.getRenderAttributeString( 'button' ) + '>',
88
- btnIcon,
89
- '</a>',
90
- ];
91
- } else if ( settings[args.text] && ( settings[args.newIcon] || settings[args.oldIcon] ) ) {
92
- if ( settings[args.iconPos] === 'before' ) {
93
- view.addRenderAttribute( 'button', 'class', 'ha-btn--icon-before' );
94
- buttonBefore = btnIcon;
95
- buttonAfter = '<span ' + view.getRenderAttributeString( args.text ) + '>' + settings[args.text] + '</span>';
96
- } else {
97
- view.addRenderAttribute( 'button', 'class', 'ha-btn--icon-after' );
98
- buttonAfter = btnIcon;
99
- buttonBefore = '<span ' + view.getRenderAttributeString( args.text ) + '>' + settings[args.text] + '</span>';
100
- }
101
- buttonMarkup = [
102
- '<a ' + view.getRenderAttributeString( 'button' ) + '>',
103
- buttonBefore,
104
- buttonAfter,
105
- '</a>',
106
- ];
107
- }
108
-
109
- return buttonMarkup.join('');
110
- }
111
-
112
- elementor.on('panel:init', function() {
113
- $('#elementor-panel-elements-search-input').on('keyup', _.debounce(function() {
114
- $('#elementor-panel-elements')
115
- .find('.hm')
116
- .parents('.elementor-element')
117
- .addClass('is-ha-widget');
118
- }, 100));
119
- //Happy Grid Layer Shortcut Register
120
- if ( typeof $e !== 'undefined' || $e !== null ) {
121
- var option = {
122
- callback: function() {
123
- var ha_grid = elementor.settings.page.model.attributes.ha_grid;
124
- if ( '' === ha_grid ) {
125
- elementor.settings.page.model.setExternalChange( 'ha_grid', 'yes' );
126
- } else if ( 'yes' === ha_grid ) {
127
- elementor.settings.page.model.setExternalChange( 'ha_grid', '' );
128
- }
129
- }
130
- };
131
- $e.shortcuts.register( 'ctrl+shift+g', option);
132
- $e.shortcuts.register( 'cmd+shift+g', option);
133
- }
134
- });
135
-
136
- function getCssEffectsControlsMap() {
137
- return {
138
- 'translate' : ['x', 'y', 'x_tablet', 'y_tablet', 'x_mobile', 'y_mobile'],
139
- 'skew' : ['x', 'y', 'x_tablet', 'y_tablet', 'x_mobile', 'y_mobile'],
140
- 'scale': ['x', 'y', 'x_tablet', 'y_tablet', 'x_mobile', 'y_mobile'],
141
- 'rotate' : ['x', 'y', 'z', 'x_tablet', 'y_tablet', 'z_tablet', 'x_mobile', 'y_mobile', 'z_mobile']
142
- };
143
- }
144
-
145
- function bindCssTransformControls(effectSwitch, effectControl, widgetModel) {
146
- var settingPrefix = 'ha_transform_fx_';
147
- effectSwitch = settingPrefix + effectSwitch;
148
- effectControl = settingPrefix + effectControl;
149
-
150
- widgetModel.on('change:'+ effectSwitch, function(model, isActive) {
151
- if (!isActive) {
152
- var controlView = elementor.getPanelView().getCurrentPageView().children.find(function(view) {
153
- return view.model.get('name') === effectControl;
154
- });
155
- widgetModel.set(effectControl, _.extend({}, widgetModel.defaults[effectControl]));
156
- controlView && controlView.render();
157
- }
158
- });
159
- }
160
-
161
- function initCssTransformEffects(model) {
162
- var widgetModel = elementorFrontend.config.elements.data[model.cid];
163
- _.each(getCssEffectsControlsMap(), function(effectProps, effectKey) {
164
- _.each(effectProps, function(effectProp) {
165
- bindCssTransformControls(
166
- effectKey + '_toggle',
167
- effectKey + '_' + effectProp,
168
- widgetModel
169
- );
170
- })
171
- });
172
-
173
- // Event bindings cleanup
174
- elementor.getPanelView().getCurrentPageView().model.on('editor:close', function() {
175
- _.each(getCssEffectsControlsMap(), function(effectConfig, effectKey) {
176
- widgetModel.off('change:ha_transform_fx_'+effectKey+'_toggle');
177
- });
178
- });
179
- }
180
-
181
- elementor.hooks.addAction('panel/open_editor/widget', function(panel, model) {
182
- initCssTransformEffects(model);
183
- });
184
-
185
- if ( elementor.modules.controls.Icons ) {
186
- var WithHappyIcons = elementor.modules.controls.Icons.extend({
187
- getControlValue: function() {
188
- var controlValue = this.constructor.__super__.getControlValue.call(this),
189
- model = this.model,
190
- valueToMigrate = this.getValueToMigrate(),
191
- newValue = { value: '', library: 'happy-icons' },
192
- elementSettingsModel = ( this.container && this.container.settings ) || this.elementSettingsModel;
193
-
194
- if ( _.isObject( controlValue ) &&
195
- !_.isEmpty( controlValue ) &&
196
- controlValue.library !== 'svg' &&
197
- controlValue.value.indexOf( 'fashm' ) === 0
198
- ) {
199
- newValue.value = controlValue.value.substr( controlValue.value.indexOf( 'hm hm-' ) );
200
- elementSettingsModel.set( model.get( 'name' ), newValue );
201
- return newValue;
202
- }
203
-
204
- if ( ! _.isObject( controlValue ) && valueToMigrate && valueToMigrate.indexOf( 'hm hm-' ) === 0 ) {
205
- newValue.value = valueToMigrate;
206
- elementSettingsModel.set( model.get( 'name' ), newValue );
207
- return newValue;
208
- }
209
-
210
- if ( ! this.isMigrationAllowed() ) {
211
- return valueToMigrate;
212
- }
213
-
214
- // Bail if no migration flag or no value to migrate
215
- if ( ! valueToMigrate ) {
216
- return controlValue;
217
- }
218
-
219
- var didMigration = elementSettingsModel.get( this.dataKeys.migratedKey ),
220
- controlName = model.get( 'name' );
221
-
222
- // Check if migration had been done and is stored locally
223
- if ( this.cache.migratedFlag[ controlName ] ) {
224
- return this.cache.migratedFlag[ controlName ];
225
- }
226
- // Check if already migrated
227
- if ( didMigration && didMigration[ controlName ] ) {
228
- return controlValue;
229
- }
230
-
231
- // Do migration
232
- return this.migrateFa4toFa5( valueToMigrate );
233
- }
234
- });
235
-
236
- elementor.addControlView( 'icons', WithHappyIcons );
237
- }
238
-
239
- elementor.modules.layouts.panel.pages.menu.Menu.addItem({
240
- name: 'happyaddons-home',
241
- icon: 'hm hm-happyaddons',
242
- title: ha.translate( 'editorPanelHomeLinkTitle' ),
243
- type: 'link',
244
- link: HappyAddonsEditor.editorPanelHomeLinkURL,
245
- newTab: true
246
- }, 'settings');
247
-
248
- elementor.modules.layouts.panel.pages.menu.Menu.addItem({
249
- name: 'happyaddons-widgets',
250
- icon: 'hm hm-cross-game',
251
- title: ha.translate( 'editorPanelWidgetsLinkTitle' ),
252
- type: 'link',
253
- link: HappyAddonsEditor.editorPanelWidgetsLinkURL,
254
- newTab: true
255
- }, 'settings');
256
-
257
- /**
258
- * Add pro widgets placeholder
259
- */
260
- elementor.hooks.addFilter( 'panel/elements/regionViews', function( regionViews ) {
261
- if ( HappyAddonsEditor.hasPro || _.isEmpty( HappyAddonsEditor.proWidgets ) ) {
262
- return regionViews;
263
- }
264
-
265
- var CATEGOERY_NAME = 'happy_addons_pro',
266
- elementsView = regionViews.elements.view,
267
- categoriesView = regionViews.categories.view,
268
- elementsCollection = regionViews.elements.options.collection,
269
- categoriesCollection = regionViews.categories.options.collection,
270
- proWidgets = [],
271
- ElementView,
272
- freeCategoryIndex;
273
-
274
- _.each( HappyAddonsEditor.proWidgets, function( widget, name ) {
275
- elementsCollection.add({
276
- name: 'ha-' + name,
277
- title: widget.title,
278
- icon: widget.icon,
279
- categories: [ CATEGOERY_NAME ],
280
- editable: false,
281
- });
282
- });
283
-
284
- elementsCollection.each( function( element ) {
285
- if ( element.get( 'categories' )[0] === CATEGOERY_NAME ) {
286
- proWidgets.push( element );
287
- }
288
- } );
289
-
290
- freeCategoryIndex = categoriesCollection.findIndex({ name:'happy_addons_category' });
291
-
292
- if ( freeCategoryIndex ) {
293
- categoriesCollection.add( {
294
- name: 'happy_addons_pro_category',
295
- title: 'Happy Addons Pro',
296
- icon: 'hm hm-happyaddons',
297
- defaultActive: false,
298
- items: proWidgets,
299
- }, {
300
- at: freeCategoryIndex + 1
301
- });
302
- }
303
-
304
- ElementView = {
305
- className: function() {
306
- var className = this.constructor.__super__.className.call(this);
307
- if ( ! this.isEditable() && this.isHappyWidget() ) {
308
- className += ' ha-element--promotion';
309
- }
310
-
311
- return className;
312
- },
313
-
314
- isHappyWidget: function() {
315
- return this.model.get('name').indexOf('ha-') === 0;
316
- },
317
-
318
- onMouseDown: function() {
319
- if ( ! this.isHappyWidget() ) {
320
- elementor.promotion.dialog.buttons[0].removeClass('ha-btn--promotion');
321
- this.constructor.__super__.onMouseDown.call(this);
322
- return;
323
- }
324
-
325
- elementor.promotion.dialog.buttons[0].addClass('ha-btn--promotion');
326
-
327
- elementor.promotion.showDialog( {
328
- headerMessage: ha.translate( 'promotionDialogHeader', [ this.model.get( 'title' ) ] ),
329
- message: ha.translate( 'promotionDialogMessage', [ this.model.get( 'title' ) ] ),
330
- top: '-7',
331
- element: this.el,
332
- actionURL: 'https://demo.happyaddons.com/',
333
- } );
334
- }
335
- };
336
-
337
- regionViews.elements.view = elementsView.extend({
338
- childView: elementsView.prototype.childView.extend(ElementView)
339
- });
340
-
341
- regionViews.categories.view = categoriesView.extend({
342
- childView: categoriesView.prototype.childView.extend({
343
- childView: categoriesView.prototype.childView.prototype.childView.extend(ElementView)
344
- })
345
- });
346
-
347
- return regionViews;
348
- });
349
- }(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,o){if(!o){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 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")})})}if(window.ha=window.ha||{},ha.hasIconLibrary=function(){return elementor.helpers&&elementor.helpers.renderIcon},ha.getFeatureLabel=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},ha.translate=function(e,t){return elementorCommon.translate(e,null,t,HappyAddonsEditor.i18n)},window.ha_get_feature_label=ha.getFeatureLabel,window.ha_has_icon_library=ha.hasIconLibrary,window.ha_translate=ha.hasIconLibrary,ha.getButtonWithIcon=function(e,t){var n,o,a,i,r,s=[],l={};return t=t||{},t=_.defaults(t,{oldIcon:"button_icon",iconPos:"button_icon_position",newIcon:"button_selected_icon",text:"button_text",link:"button_link",class:"ha-btn ha-btn--link",textClass:"ha-btn-text"}),!_.isObject(e)||_.isUndefined(e.getContainer)?"":(l=e.getContainer().settings.toJSON(),ha.hasIconLibrary()&&(n=elementor.helpers.renderIcon(e,l[t.newIcon],{"aria-hidden":!0,class:"ha-btn-icon"},"i","object"),o=elementor.helpers.isIconMigrated(l,t.newIcon)),e.addInlineEditingAttributes(t.text,"none"),e.addRenderAttribute(t.text,"class",t.textClass),e.addRenderAttribute("button","class",t.class),e.addRenderAttribute("button","href",l[t.link].url),(l[t.newIcon]&&l[t.newIcon].value||l[t.oldIcon])&&(ha.hasIconLibrary()&&n&&n.rendered&&(!l[t.oldIcon]||o)?a="svg"===l[t.newIcon].library?'<span class="ha-btn-icon ha-btn-icon--svg">'+n.value+"</span>":n.value:l[t.oldIcon]&&(a='<i class="ha-btn-icon '+t.oldIcon+'" aria-hidden="true"></i>')),!l[t.text]||l[t.newIcon]||l[t.oldIcon]?l[t.text]||!l[t.newIcon]&&!l[t.oldIcon]?l[t.text]&&(l[t.newIcon]||l[t.oldIcon])&&("before"===l[t.iconPos]?(e.addRenderAttribute("button","class","ha-btn--icon-before"),i=a,r="<span "+e.getRenderAttributeString(t.text)+">"+l[t.text]+"</span>"):(e.addRenderAttribute("button","class","ha-btn--icon-after"),r=a,i="<span "+e.getRenderAttributeString(t.text)+">"+l[t.text]+"</span>"),s=["<a "+e.getRenderAttributeString("button")+">",i,r,"</a>"]):s=["<a "+e.getRenderAttributeString("button")+">",a,"</a>"]:s=["<a "+e.getRenderAttributeString("button")+">","<span "+e.getRenderAttributeString(t.text)+">",l[t.text],"</span>","</a>"],s.join(""))},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"},a=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-")),a.set(t.get("name"),o),o;if(!_.isObject(e)&&n&&0===n.indexOf("hm hm-"))return o.value=n,a.set(t.get("name"),o),o;if(!this.isMigrationAllowed())return n;if(!n)return e;var i=a.get(this.dataKeys.migratedKey),r=t.get("name");return this.cache.migratedFlag[r]?this.cache.migratedFlag[r]:i&&i[r]?e:this.migrateFa4toFa5(n)}});elementor.addControlView("icons",a)}elementor.modules.layouts.panel.pages.menu.Menu.addItem({name:"happyaddons-home",icon:"hm hm-happyaddons",title:ha.translate("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:ha.translate("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,i=e.elements.options.collection,r=e.categories.options.collection,s=[];return _.each(HappyAddonsEditor.proWidgets,function(e,t){i.add({name:"ha-"+t,title:e.title,icon:e.icon,categories:["happy_addons_pro"],editable:!1})}),i.each(function(e){"happy_addons_pro"===e.get("categories")[0]&&s.push(e)}),n=r.findIndex({name:"happy_addons_category"}),n&&r.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:ha.translate("promotionDialogHeader",[this.model.get("title")]),message:ha.translate("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);
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 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 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")})})}if(window.ha=window.ha||{},ha.hasIconLibrary=function(){return elementor.helpers&&elementor.helpers.renderIcon},ha.getFeatureLabel=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},ha.translate=function(e,t){return elementorCommon.translate(e,null,t,HappyAddonsEditor.i18n)},window.ha_get_feature_label=ha.getFeatureLabel,window.ha_has_icon_library=ha.hasIconLibrary,window.ha_translate=ha.translate,ha.getButtonWithIcon=function(e,t){var n,o,a,i,r,s=[],l={};return t=t||{},t=_.defaults(t,{oldIcon:"button_icon",iconPos:"button_icon_position",newIcon:"button_selected_icon",text:"button_text",link:"button_link",class:"ha-btn ha-btn--link",textClass:"ha-btn-text"}),!_.isObject(e)||_.isUndefined(e.getContainer)?"":(l=e.getContainer().settings.toJSON(),ha.hasIconLibrary()&&(n=elementor.helpers.renderIcon(e,l[t.newIcon],{"aria-hidden":!0,class:"ha-btn-icon"},"i","object"),o=elementor.helpers.isIconMigrated(l,t.newIcon)),e.addInlineEditingAttributes(t.text,"none"),e.addRenderAttribute(t.text,"class",t.textClass),e.addRenderAttribute("button","class",t.class),e.addRenderAttribute("button","href",l[t.link].url),(l[t.newIcon]&&l[t.newIcon].value||l[t.oldIcon])&&(ha.hasIconLibrary()&&n&&n.rendered&&(!l[t.oldIcon]||o)?a="svg"===l[t.newIcon].library?'<span class="ha-btn-icon ha-btn-icon--svg">'+n.value+"</span>":n.value:l[t.oldIcon]&&(a='<i class="ha-btn-icon '+t.oldIcon+'" aria-hidden="true"></i>')),!l[t.text]||l[t.newIcon]||l[t.oldIcon]?l[t.text]||!l[t.newIcon]&&!l[t.oldIcon]?l[t.text]&&(l[t.newIcon]||l[t.oldIcon])&&("before"===l[t.iconPos]?(e.addRenderAttribute("button","class","ha-btn--icon-before"),i=a,r="<span "+e.getRenderAttributeString(t.text)+">"+l[t.text]+"</span>"):(e.addRenderAttribute("button","class","ha-btn--icon-after"),r=a,i="<span "+e.getRenderAttributeString(t.text)+">"+l[t.text]+"</span>"),s=["<a "+e.getRenderAttributeString("button")+">",i,r,"</a>"]):s=["<a "+e.getRenderAttributeString("button")+">",a,"</a>"]:s=["<a "+e.getRenderAttributeString("button")+">","<span "+e.getRenderAttributeString(t.text)+">",l[t.text],"</span>","</a>"],s.join(""))},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"},a=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-")),a.set(t.get("name"),o),o;if(!_.isObject(e)&&n&&0===n.indexOf("hm hm-"))return o.value=n,a.set(t.get("name"),o),o;if(!this.isMigrationAllowed())return n;if(!n)return e;var i=a.get(this.dataKeys.migratedKey),r=t.get("name");return this.cache.migratedFlag[r]?this.cache.migratedFlag[r]:i&&i[r]?e:this.migrateFa4toFa5(n)}});elementor.addControlView("icons",a)}elementor.modules.layouts.panel.pages.menu.Menu.addItem({name:"happyaddons-home",icon:"hm hm-happyaddons",title:ha.translate("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:ha.translate("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,i=e.elements.options.collection,r=e.categories.options.collection,s=[];return _.each(HappyAddonsEditor.proWidgets,function(e,t){i.add({name:"ha-"+t,title:e.title,icon:e.icon,categories:["happy_addons_pro"],editable:!1})}),i.each(function(e){"happy_addons_pro"===e.get("categories")[0]&&s.push(e)}),n=r.findIndex({name:"happy_addons_category"}),n&&r.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:ha.translate("promotionDialogHeader",[this.model.get("title")]),message:ha.translate("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/admin/js/select2.js DELETED
@@ -1,104 +0,0 @@
1
- (function ($) {
2
- "use strict";
3
- jQuery(window).on('elementor:init', function () {
4
- var ControlQueryPostSearch = elementor.modules.controls.BaseData.extend({
5
-
6
- isPostSearchReady: false,
7
- dataQueryOption: function(){
8
- var self = this;
9
- var data_options = self.model.get('data_options');
10
- if( !data_options && typeof data_options !== "object"){
11
- return false;
12
- }else{
13
- return data_options;
14
- }
15
- },
16
- getPostTitlesbyID: function () {
17
- var self = this,
18
- dataQueryOption = this.dataQueryOption(),
19
- ids = this.getControlValue();
20
-
21
- if (!ids || 0 === ids.length) {
22
- return;
23
- }
24
-
25
- if (!_.isArray(ids)) {
26
- ids = [ids];
27
- }
28
- var default_value = {
29
- security: HappyAddonsEditor.select2Secret,
30
- select_type: 'selected',
31
- id: ids
32
- };
33
- $.ajax({
34
- url: ajaxurl,
35
- type: 'POST',
36
- data: $.extend( {}, default_value, dataQueryOption ),
37
- before: self.addControlSpinner(),
38
- success: function (results) {
39
-
40
- self.isPostSearchReady = true;
41
- self.model.set('options', results);
42
- self.render();
43
- }
44
- });
45
- },
46
- addControlSpinner: function () {
47
- this.ui.select.prop('disabled', true);
48
- this.$el.find('.elementor-control-title').after('<span class="elementor-control-spinner">&nbsp;<i class="eicon-spinner eicon-animation-spin"></i>&nbsp;</span>');
49
- },
50
- onReady: function () {
51
- var self = this,
52
- dataQueryOption = this.dataQueryOption();
53
-
54
- if( !dataQueryOption ){
55
- return;
56
- }
57
- this.ui.select.select2({
58
- placeholder: self.model.get('placeholder') ? self.model.get('placeholder') : 'Search',
59
- minimumInputLength: self.model.get('mininput') ? self.model.get('mininput') : 0,
60
- allowClear: true,
61
- ajax: {
62
- url: ajaxurl,
63
- dataType: 'json',
64
- method: 'post',
65
- delay: 250,
66
- data: function (params) {
67
- var default_value = {
68
- security: HappyAddonsEditor.select2Secret,
69
- select_type: 'choose',
70
- q: params.term,
71
- };
72
- var data_options = self.model.get('data_options');
73
- return $.extend( {}, default_value, data_options );
74
- },
75
- processResults: function (data) {
76
- // parse the results into the format expected by Select2.
77
- // since we are using custom formatting functions we do not need to
78
- // alter the remote JSON data
79
- var notFound = [{
80
- "id": -1,
81
- "text": "No results found",
82
- "disabled": true
83
- }];
84
- return {
85
- results: data !== null ? data : notFound
86
- }
87
- },
88
- cache: true
89
- }
90
- });
91
- if (!this.isPostSearchReady) {
92
- this.getPostTitlesbyID();
93
- }
94
- },
95
- onBeforeDestroy: function () {
96
- if (this.ui.select.data('select2')) {
97
- this.ui.select.select2('destroy');
98
- }
99
- this.$el.remove();
100
- }
101
- });
102
- elementor.addControlView('ha-select2', ControlQueryPostSearch);
103
- });
104
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/admin/js/template-library.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e,t){window.ha=window.ha||{};var i={Views:{},Models:{},Collections:{},Behaviors:{},Layout:null,Manager:null};i.Models.Template=Backbone.Model.extend({defaults:{template_id:0,title:"",type:"",thumbnail:"",url:"",tags:[],isPro:!1}}),i.Collections.Template=Backbone.Collection.extend({model:i.Models.Template}),i.Behaviors.InsertTemplate=Marionette.Behavior.extend({ui:{insertButton:".haTemplateLibrary__insert-button"},events:{"click @ui.insertButton":"onInsertButtonClick"},onInsertButtonClick:function(){ha.library.insertTemplate({model:this.view.model})}}),i.Views.EmptyTemplateCollection=Marionette.ItemView.extend({id:"elementor-template-library-templates-empty",template:"#tmpl-haTemplateLibrary__empty",ui:{title:".elementor-template-library-blank-title",message:".elementor-template-library-blank-message"},modesStrings:{empty:{title:ha.translate("templatesEmptyTitle"),message:ha.translate("templatesEmptyMessage")},noResults:{title:ha.translate("templatesNoResultsTitle"),message:ha.translate("templatesNoResultsMessage")}},getCurrentMode:function(){return ha.library.getFilter("text")?"noResults":"empty"},onRender:function(){var e=this.modesStrings[this.getCurrentMode()];this.ui.title.html(e.title),this.ui.message.html(e.message)}}),i.Views.Loading=Marionette.ItemView.extend({template:"#tmpl-haTemplateLibrary__loading",id:"haTemplateLibrary__loading"}),i.Views.Logo=Marionette.ItemView.extend({template:"#tmpl-haTemplateLibrary__header-logo",className:"haTemplateLibrary__header-logo",templateHelpers:function(){return{title:this.getOption("title")}}}),i.Views.BackButton=Marionette.ItemView.extend({template:"#tmpl-haTemplateLibrary__header-back",id:"elementor-template-library-header-preview-back",className:"haTemplateLibrary__header-back",events:function(){return{click:"onClick"}},onClick:function(){ha.library.showBlocksView()}}),i.Views.Menu=Marionette.ItemView.extend({template:"#tmpl-haTemplateLibrary__header-menu",id:"elementor-template-library-header-menu",className:"haTemplateLibrary__header-menu",templateHelpers:function(){return ha.library.getTabs()}}),i.Views.ResponsiveMenu=Marionette.ItemView.extend({template:"#tmpl-haTemplateLibrary__header-menu-responsive",id:"elementor-template-library-header-menu-responsive",className:"haTemplateLibrary__header-menu-responsive",ui:{items:"> .elementor-component-tab"},events:{"click @ui.items":"onTabItemClick"},onTabItemClick:function(t){var i=e(t.currentTarget),a=i.data("tab");ha.library.channels.tabs.trigger("change:device",a,i)}}),i.Views.Actions=Marionette.ItemView.extend({template:"#tmpl-haTemplateLibrary__header-actions",id:"elementor-template-library-header-actions",ui:{sync:"#haTemplateLibrary__header-sync i"},events:{"click @ui.sync":"onSyncClick"},onSyncClick:function(){var e=this;e.ui.sync.addClass("eicon-animation-spin"),ha.library.requestLibraryData({onUpdate:function(){e.ui.sync.removeClass("eicon-animation-spin"),ha.library.updateBlocksView()},forceUpdate:!0,forceSync:!0})}}),i.Views.InsertWrapper=Marionette.ItemView.extend({template:"#tmpl-haTemplateLibrary__header-insert",id:"elementor-template-library-header-preview",behaviors:{insertTemplate:{behaviorClass:i.Behaviors.InsertTemplate}}}),i.Views.Preview=Marionette.ItemView.extend({template:"#tmpl-haTemplateLibrary__preview",className:"haTemplateLibrary__preview",ui:function(){return{iframe:"> iframe"}},onRender:function(){this.ui.iframe.attr("src",this.getOption("url")).hide();var e=this,t=(new i.Views.Loading).render();this.$el.append(t.el),this.ui.iframe.on("load",function(){e.$el.find("#haTemplateLibrary__loading").remove(),e.ui.iframe.show()})}}),i.Views.TemplateCollection=Marionette.CompositeView.extend({template:"#tmpl-haTemplateLibrary__templates",id:"haTemplateLibrary__templates",childViewContainer:"#haTemplateLibrary__templates-list",emptyView:function(){return new i.Views.EmptyTemplateCollection},ui:{templatesWindow:".haTemplateLibrary__templates-window",textFilter:"#haTemplateLibrary__search",tagsFilter:"#haTemplateLibrary__filter-tags",filterBar:"#haTemplateLibrary__toolbar-filter"},events:{"input @ui.textFilter":"onTextFilterInput","click @ui.tagsFilter li":"onTagsFilterClick"},getChildView:function(e){return i.Views.Template},initialize:function(){this.listenTo(ha.library.channels.templates,"filter:change",this._renderChildren)},filter:function(e){var t=ha.library.getFilterTerms(),i=!0;return _.each(t,function(t,a){var n=ha.library.getFilter(a);if(n&&t.callback){var r=t.callback.call(e,n);return r||(i=!1),r}}),i},setMasonrySkin:function(){var e=new elementorModules.utils.Masonry({container:this.$childViewContainer,items:this.$childViewContainer.children()});this.$childViewContainer.imagesLoaded(e.run.bind(e))},onRenderCollection:function(){this.setMasonrySkin(),this.updatePerfectScrollbar()},onTextFilterInput:function(){var e=this;_.defer(function(){ha.library.setFilter("text",e.ui.textFilter.val())})},onTagsFilterClick:function(t){var i=e(t.currentTarget),a=i.data("tag");ha.library.setFilter("tags",a),i.addClass("active").siblings().removeClass("active"),a=a?ha.library.getTags()[a]:"Filter",this.ui.filterBar.find(".haTemplateLibrary__filter-btn").html(a)},updatePerfectScrollbar:function(){this.perfectScrollbar||(this.perfectScrollbar=new PerfectScrollbar(this.ui.templatesWindow[0],{suppressScrollX:!0})),this.perfectScrollbar.isRtl=!1,this.perfectScrollbar.update()},setTagsFilterHover:function(){var e=this;e.ui.filterBar.hoverIntent(function(){e.ui.tagsFilter.css("display","block"),e.ui.filterBar.find(".haTemplateLibrary__filter-btn i").addClass("eicon-caret-down").removeClass("eicon-caret-right")},function(){e.ui.tagsFilter.css("display","none"),e.ui.filterBar.find(".haTemplateLibrary__filter-btn i").addClass("eicon-caret-right").removeClass("eicon-caret-down")},{sensitivity:50,interval:150,timeout:100})},onRender:function(){this.setTagsFilterHover(),this.updatePerfectScrollbar()}}),i.Views.Template=Marionette.ItemView.extend({template:"#tmpl-haTemplateLibrary__template",className:"haTemplateLibrary__template",ui:{previewButton:".haTemplateLibrary__preview-button, .haTemplateLibrary__template-preview"},events:{"click @ui.previewButton":"onPreviewButtonClick"},behaviors:{insertTemplate:{behaviorClass:i.Behaviors.InsertTemplate}},onPreviewButtonClick:function(){ha.library.showPreviewView(this.model)}}),i.Modal=elementorModules.common.views.modal.Layout.extend({getModalOptions:function(){return{id:"haTemplateLibrary__modal",hide:{onOutsideClick:!1,onEscKeyPress:!0,onBackgroundClick:!1}}},getTemplateActionButton:function(e){var t=e.isPro&&!HappyAddonsEditor.hasPro?"pro-button":"insert-button";return viewId="#tmpl-haTemplateLibrary__"+t,template=Marionette.TemplateCache.get(viewId),Marionette.Renderer.render(template)},showLogo:function(e){this.getHeaderView().logoArea.show(new i.Views.Logo(e))},showDefaultHeader:function(){this.showLogo({title:"HAPPY LIBRARY"});var e=this.getHeaderView();e.tools.show(new i.Views.Actions),e.menuArea.reset()},showPreviewView:function(e){var t=this.getHeaderView();t.menuArea.show(new i.Views.ResponsiveMenu),t.logoArea.show(new i.Views.BackButton),t.tools.show(new i.Views.InsertWrapper({model:e})),this.modalContent.show(new i.Views.Preview({url:e.get("url")}))},showBlocksView:function(e){this.modalContent.show(new i.Views.TemplateCollection({collection:e}))}}),i.Manager=function(){function a(){var t=e(this).closest(".elementor-top-section"),i=t.data("model-cid"),a=window.elementor.sections;a.currentView.collection.length&&_.each(a.currentView.collection.models,function(e,t){i===e.cid&&(m.atIndex=t)}),t.prev(".elementor-add-section").find(FIND_SELECTOR).before($openLibraryButton)}function n(e){var t=e.find(FIND_SELECTOR);t.length&&t.before($openLibraryButton),e.on("click.onAddElement",".elementor-editor-section-settings .elementor-editor-element-add",a)}function r(t,i){i.addClass("elementor-active").siblings().removeClass("elementor-active");var a=devicesResponsiveMap[t]||devicesResponsiveMap.desktop;e(".haTemplateLibrary__preview").css("width",a)}function o(){var e=window.elementor.$previewContents,t=setInterval(function(){n(e),e.find(".elementor-add-new-section").length>0&&clearInterval(t)},100);e.on("click.onAddTemplateButton",".elementor-add-ha-button",m.showModal.bind(m)),this.channels.tabs.on("change:device",r)}var l,s,d,c,m=this;FIND_SELECTOR=".elementor-add-new-section .elementor-add-section-drag-title",$openLibraryButton='<div class="elementor-add-section-area-button elementor-add-ha-button"> <i class="hm hm-happyaddons"></i> </div>',devicesResponsiveMap={desktop:"100%",tab:"768px",mobile:"360px"},this.atIndex=-1,this.channels={tabs:Backbone.Radio.channel("tabs"),templates:Backbone.Radio.channel("templates")},this.updateBlocksView=function(){m.setFilter("tags","",!0),m.setFilter("text","",!0),m.getModal().showBlocksView(d)},this.setFilter=function(e,t,i){m.channels.templates.reply("filter:"+e,t),i||m.channels.templates.trigger("filter:change")},this.getFilter=function(e){return m.channels.templates.request("filter:"+e)},this.getFilterTerms=function(){return{tags:{callback:function(e){return _.any(this.get("tags"),function(t){return t.indexOf(e)>=0})}},text:{callback:function(e){return e=e.toLowerCase(),this.get("title").toLowerCase().indexOf(e)>=0||_.any(this.get("tags"),function(t){return t.indexOf(e)>=0})}}}},this.showModal=function(){m.getModal().showModal(),m.showBlocksView()},this.closeModal=function(){this.getModal().hideModal()},this.getModal=function(){return l||(l=new i.Modal),l},this.init=function(){t.on("preview:loaded",o.bind(this))},this.getTabs=function(){return{tabs:{blocks:{title:"Blocks",active:!0}}}},this.getTags=function(){return s},this.showBlocksView=function(){m.getModal().showDefaultHeader(),m.setFilter("tags","",!0),m.setFilter("text","",!0),m.loadTemplates(function(){m.getModal().showBlocksView(d)})},this.showPreviewView=function(e){m.getModal().showPreviewView(e)},this.loadTemplates=function(e){m.requestLibraryData({onBeforeUpdate:m.getModal().showLoadingView.bind(m.getModal()),onUpdate:function(){m.getModal().hideLoadingView(),e&&e()}})},this.requestLibraryData=function(e){if(d&&!e.forceUpdate)return void(e.onUpdate&&e.onUpdate());e.onBeforeUpdate&&e.onBeforeUpdate();var t={data:{},success:function(t){d=new i.Collections.Template(t.templates),t.tags&&(s=t.tags),e.onUpdate&&e.onUpdate()}};e.forceSync&&(t.data.sync=!0),elementorCommon.ajax.addRequest("get_ha_library_data",t)},this.requestTemplateData=function(e,t){var i={unique_id:e,data:{edit_mode:!0,display:!0,template_id:e}};t&&jQuery.extend(!0,i,t),elementorCommon.ajax.addRequest("get_ha_template_data",i)},this.insertTemplate=function(e){var t=e.model,i=this;i.getModal().showLoadingView(),i.requestTemplateData(t.get("template_id"),{success:function(e){i.getModal().hideLoadingView(),i.getModal().hideModal();var a={};-1!==i.atIndex&&(a.at=i.atIndex),$e.run("document/elements/import",{model:t,data:e,options:a}),i.atIndex=-1},error:function(e){i.showErrorDialog(e)},complete:function(e){i.getModal().hideLoadingView()}})},this.showErrorDialog=function(e){if("object"==typeof e){var t="";_.each(e,function(e){t+="<div>"+e.message+".</div>"}),e=t}else e?e+=".":e="<i>&#60;The error message is empty&#62;</i>";m.getErrorDialog().setMessage('The following error(s) occurred while processing the request:<div id="elementor-template-library-error-info">'+e+"</div>").show()},this.getErrorDialog=function(){return c||(c=elementorCommon.dialogsManager.createWidget("alert",{id:"elementor-template-library-error-dialog",headerMessage:"An error occurred"})),c}},window.ha.library=new i.Manager,window.ha.library.init()}(jQuery,window.elementor);
base.php CHANGED
@@ -54,16 +54,17 @@ class Base {
54
  Select2_Handler::init();
55
  WPML_Manager::init();
56
 
57
- $this->init_appsero_tracking();
58
 
59
  if ( is_user_logged_in() ) {
60
- Admin_Bar::init();
 
61
  }
62
 
63
  if ( is_admin() ) {
64
  Updater::init();
65
  Dashboard::init();
66
- Attention_Seeker::init();
67
  }
68
 
69
  do_action( 'happyaddons_loaded' );
@@ -116,7 +117,9 @@ class Base {
116
 
117
  if ( is_user_logged_in() ) {
118
  include_once( HAPPY_ADDONS_DIR_PATH . 'classes/admin-bar.php' );
119
- include_once( HAPPY_ADDONS_DIR_PATH . 'classes/clone-handler.php' );
 
 
120
  }
121
  }
122
 
54
  Select2_Handler::init();
55
  WPML_Manager::init();
56
 
57
+ $this->init_appsero_tracking();
58
 
59
  if ( is_user_logged_in() ) {
60
+ Admin_Bar::init();
61
+ Library_Manager::init();
62
  }
63
 
64
  if ( is_admin() ) {
65
  Updater::init();
66
  Dashboard::init();
67
+ Attention_Seeker::init();
68
  }
69
 
70
  do_action( 'happyaddons_loaded' );
117
 
118
  if ( is_user_logged_in() ) {
119
  include_once( HAPPY_ADDONS_DIR_PATH . 'classes/admin-bar.php' );
120
+ include_once( HAPPY_ADDONS_DIR_PATH . 'classes/clone-handler.php' );
121
+ include_once( HAPPY_ADDONS_DIR_PATH . 'classes/library-manager.php' );
122
+ include_once( HAPPY_ADDONS_DIR_PATH . 'classes/library-source.php' );
123
  }
124
  }
125
 
changelog.txt CHANGED
@@ -1,3 +1,8 @@
 
 
 
 
 
1
  = 2.11.1 - 4 June 2020 =
2
 
3
  - Fix: JS function backward compatibility issue
1
+ = 2.12.0 - 8 June 2020 =
2
+
3
+ - New: Happy Templates Library
4
+ - New: WP Fluent Forms widget
5
+
6
  = 2.11.1 - 4 June 2020 =
7
 
8
  - Fix: JS function backward compatibility issue
classes/assets-manager.php CHANGED
@@ -304,6 +304,24 @@ class Assets_Manager {
304
  true
305
  );
306
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
307
  $localize_data = [
308
  'editorPanelHomeLinkURL' => ha_get_dashboard_link(),
309
  'editorPanelWidgetsLinkURL' => ha_get_dashboard_link('#widgets'),
@@ -312,6 +330,11 @@ class Assets_Manager {
312
  'editorPanelWidgetsLinkTitle' => esc_html__( 'HappyAddons - Widgets', 'happy-elementor-addons' ),
313
  'promotionDialogHeader' => esc_html__( '%s Widget', 'happy-elementor-addons' ),
314
  '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' ),
 
 
 
 
 
315
  ],
316
  'proWidgets' => [],
317
  'hasPro' => ha_has_pro(),
@@ -366,5 +389,14 @@ class Assets_Manager {
366
  );
367
  }
368
 
 
 
 
 
 
 
 
 
 
369
  }
370
  }
304
  true
305
  );
306
 
307
+ wp_enqueue_style(
308
+ 'happy-elementor-addons-templates',
309
+ HAPPY_ADDONS_ASSETS . 'admin/css/template-library.min.css',
310
+ null,
311
+ HAPPY_ADDONS_VERSION
312
+ );
313
+
314
+ wp_enqueue_script(
315
+ 'happy-elementor-addons-templates',
316
+ HAPPY_ADDONS_ASSETS . 'admin/js/template-library.min.js',
317
+ [
318
+ 'elementor-editor',
319
+ 'jquery-hover-intent',
320
+ ],
321
+ HAPPY_ADDONS_VERSION,
322
+ true
323
+ );
324
+
325
  $localize_data = [
326
  'editorPanelHomeLinkURL' => ha_get_dashboard_link(),
327
  'editorPanelWidgetsLinkURL' => ha_get_dashboard_link('#widgets'),
330
  'editorPanelWidgetsLinkTitle' => esc_html__( 'HappyAddons - Widgets', 'happy-elementor-addons' ),
331
  'promotionDialogHeader' => esc_html__( '%s Widget', 'happy-elementor-addons' ),
332
  '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' ),
333
+
334
+ 'templatesEmptyTitle' => esc_html__( 'No Templates Found', 'happy-elementor-addons' ),
335
+ 'templatesEmptyMessage' => esc_html__( 'Try different category or sync for new templates.', 'happy-elementor-addons' ),
336
+ 'templatesNoResultsTitle' => esc_html__( 'No Results Found', 'happy-elementor-addons' ),
337
+ 'templatesNoResultsMessage' => esc_html__( 'Please make sure your search is spelled correctly or try a different words.', 'happy-elementor-addons' ),
338
  ],
339
  'proWidgets' => [],
340
  'hasPro' => ha_has_pro(),
389
  );
390
  }
391
 
392
+ $data = '
393
+ .elementor-add-new-section .elementor-add-ha-button {
394
+ background-color: #5636d1;
395
+ margin-left: 5px;
396
+ font-size: 18px;
397
+ vertical-align: bottom;
398
+ }
399
+ ';
400
+ wp_add_inline_style( 'happy-elementor-addons', $data );
401
  }
402
  }
classes/library-manager.php ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Happy_Addons\Elementor;
3
+
4
+ use Elementor\Core\Common\Modules\Ajax\Module as Ajax;
5
+
6
+ defined('ABSPATH') || die();
7
+
8
+ class Library_Manager {
9
+
10
+ protected static $source = null;
11
+
12
+ public static function init() {
13
+ add_action( 'elementor/editor/footer', [ __CLASS__, 'print_template_views' ] );
14
+ add_action( 'elementor/ajax/register_actions', [ __CLASS__, 'register_ajax_actions' ] );
15
+ }
16
+
17
+ public static function print_template_views() {
18
+ include_once HAPPY_ADDONS_DIR_PATH . 'templates/template-library/templates.php';
19
+ }
20
+
21
+ /**
22
+ * Undocumented function
23
+ *
24
+ * @return Library_Source
25
+ */
26
+ public static function get_source() {
27
+ if ( is_null( self::$source ) ) {
28
+ self::$source = new Library_Source();
29
+ }
30
+
31
+ return self::$source;
32
+ }
33
+
34
+ public static function register_ajax_actions( Ajax $ajax ) {
35
+ $ajax->register_ajax_action( 'get_ha_library_data', function( $data ) {
36
+ if ( ! current_user_can( 'edit_posts' ) ) {
37
+ throw new \Exception( 'Access Denied' );
38
+ }
39
+
40
+ if ( ! empty( $data['editor_post_id'] ) ) {
41
+ $editor_post_id = absint( $data['editor_post_id'] );
42
+
43
+ if ( ! get_post( $editor_post_id ) ) {
44
+ throw new \Exception( __( 'Post not found.', 'happy-elementor-addons' ) );
45
+ }
46
+
47
+ ha_elementor()->db->switch_to_post( $editor_post_id );
48
+ }
49
+
50
+ $result = self::get_library_data( $data );
51
+
52
+ return $result;
53
+ } );
54
+
55
+ $ajax->register_ajax_action( 'get_ha_template_data', function( $data ) {
56
+ if ( ! current_user_can( 'edit_posts' ) ) {
57
+ throw new \Exception( 'Access Denied' );
58
+ }
59
+
60
+ if ( ! empty( $data['editor_post_id'] ) ) {
61
+ $editor_post_id = absint( $data['editor_post_id'] );
62
+
63
+ if ( ! get_post( $editor_post_id ) ) {
64
+ throw new \Exception( __( 'Post not found', 'happy-elementor-addons' ) );
65
+ }
66
+
67
+ ha_elementor()->db->switch_to_post( $editor_post_id );
68
+ }
69
+
70
+ if ( empty( $data['template_id'] ) ) {
71
+ throw new \Exception( __( 'Template id missing', 'happy-elementor-addons' ) );
72
+ }
73
+
74
+ $result = self::get_template_data( $data );
75
+
76
+ return $result;
77
+ } );
78
+ }
79
+
80
+ public static function get_template_data( array $args ) {
81
+ $source = self::get_source();
82
+ $data = $source->get_data( $args );
83
+ return $data;
84
+ }
85
+
86
+ public static function get_library_data( array $args ) {
87
+ $source = self::get_source();
88
+
89
+ if ( ! empty( $args['sync'] ) ) {
90
+ Library_Source::get_library_data( true );
91
+ }
92
+
93
+ return [
94
+ 'templates' => $source->get_items(),
95
+ 'tags' => $source->get_tags(),
96
+ ];
97
+ }
98
+ }
classes/library-source.php ADDED
@@ -0,0 +1,217 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Library api class
4
+ *
5
+ * @package HappyAddons
6
+ * @author HappyMonster
7
+ */
8
+ namespace Happy_Addons\Elementor;
9
+
10
+ use Elementor\TemplateLibrary\Source_Base;
11
+
12
+ defined( 'ABSPATH' ) || die();
13
+
14
+ class Library_Source extends Source_Base {
15
+
16
+ /**
17
+ * Template library data cache
18
+ */
19
+ const LIBRARY_CACHE_KEY = 'ha_library_cache';
20
+
21
+ /**
22
+ * Template info api url
23
+ */
24
+ const API_TEMPLATES_INFO_URL = 'https://templates.happyaddons.com/wp-json/ha/v1/templates-info';
25
+
26
+ /**
27
+ * Template data api url
28
+ */
29
+ const API_TEMPLATE_DATA_URL = 'https://templates.happyaddons.com/wp-json/ha/v1/templates/';
30
+
31
+ public function get_id() {
32
+ return 'happy-library';
33
+ }
34
+
35
+ public function get_title() {
36
+ return __( 'Happy Library', 'happy-elementor-addons' );
37
+ }
38
+
39
+ public function register_data() {}
40
+
41
+ public function save_item( $template_data ) {
42
+ return new \WP_Error( 'invalid_request', 'Cannot save template to a happpy library' );
43
+ }
44
+
45
+ public function update_item( $new_data ) {
46
+ return new \WP_Error( 'invalid_request', 'Cannot update template to a happpy library' );
47
+ }
48
+
49
+ public function delete_template( $template_id ) {
50
+ return new \WP_Error( 'invalid_request', 'Cannot delete template from a happpy library' );
51
+ }
52
+
53
+ public function export_template( $template_id ) {
54
+ return new \WP_Error( 'invalid_request', 'Cannot export template from a happpy library' );
55
+ }
56
+
57
+ public function get_items( $args = [] ) {
58
+ $library_data = self::get_library_data();
59
+
60
+ $templates = [];
61
+
62
+ if ( ! empty( $library_data['templates'] ) ) {
63
+ foreach ( $library_data['templates'] as $template_data ) {
64
+ $templates[] = $this->prepare_template( $template_data );
65
+ }
66
+ }
67
+
68
+ return $templates;
69
+ }
70
+
71
+ public function get_tags() {
72
+ $library_data = self::get_library_data();
73
+
74
+ return ( ! empty( $library_data['tags'] ) ? $library_data['tags'] : [] );
75
+ }
76
+
77
+ /**
78
+ * Prepare template items to match model
79
+ *
80
+ * @param array $template_data
81
+ * @return array
82
+ */
83
+ private function prepare_template( array $template_data ) {
84
+ return [
85
+ 'template_id' => $template_data['id'],
86
+ 'title' => $template_data['title'],
87
+ 'type' => $template_data['type'],
88
+ 'thumbnail' => $template_data['thumbnail'],
89
+ 'date' => $template_data['created_at'],
90
+ 'tags' => $template_data['tags'],
91
+ 'isPro' => $template_data['is_pro'],
92
+ 'url' => $template_data['url'],
93
+ ];
94
+ }
95
+
96
+ /**
97
+ * Get library data from remote source and cache
98
+ *
99
+ * @param boolean $force_update
100
+ * @return array
101
+ */
102
+ private static function request_library_data( $force_update = false ) {
103
+ $data = get_option( self::LIBRARY_CACHE_KEY );
104
+
105
+ if ( $force_update || false === $data ) {
106
+ $timeout = ( $force_update ) ? 25 : 8;
107
+
108
+ $response = wp_remote_get( self::API_TEMPLATES_INFO_URL, [
109
+ 'timeout' => $timeout,
110
+ ] );
111
+
112
+ if ( is_wp_error( $response ) || 200 !== (int) wp_remote_retrieve_response_code( $response ) ) {
113
+ update_option( self::LIBRARY_CACHE_KEY, [] );
114
+ return false;
115
+ }
116
+
117
+ $data = json_decode( wp_remote_retrieve_body( $response ), true );
118
+
119
+ if ( empty( $data ) || ! is_array( $data ) ) {
120
+ update_option( self::LIBRARY_CACHE_KEY, [] );
121
+ return false;
122
+ }
123
+
124
+ update_option( self::LIBRARY_CACHE_KEY, $data, 'no' );
125
+ }
126
+
127
+ return $data;
128
+ }
129
+
130
+ /**
131
+ * Get library data
132
+ *
133
+ * @param boolean $force_update
134
+ * @return array
135
+ */
136
+ public static function get_library_data( $force_update = false ) {
137
+ self::request_library_data( $force_update );
138
+
139
+ $data = get_option( self::LIBRARY_CACHE_KEY );
140
+
141
+ if ( empty( $data ) ) {
142
+ return [];
143
+ }
144
+
145
+ return $data;
146
+ }
147
+
148
+ /**
149
+ * Get remote template.
150
+ *
151
+ * Retrieve a single remote template from Elementor.com servers.
152
+ *
153
+ * @param int $template_id The template ID.
154
+ *
155
+ * @return array Remote template.
156
+ */
157
+ public function get_item( $template_id ) {
158
+ $templates = $this->get_items();
159
+
160
+ return $templates[ $template_id ];
161
+ }
162
+
163
+ public static function request_template_data( $template_id ) {
164
+ if ( empty( $template_id ) ) {
165
+ return;
166
+ }
167
+
168
+ $body = [
169
+ 'home_url' => trailingslashit( home_url() ),
170
+ 'version' => HAPPY_ADDONS_VERSION,
171
+ ];
172
+
173
+ if ( ha_has_pro() ) {
174
+ $body['has_pro'] = 1;
175
+ $body['pro_version'] = HAPPY_ADDONS_PRO_VERSION;
176
+ }
177
+
178
+ $response = wp_remote_get(
179
+ self::API_TEMPLATE_DATA_URL . $template_id,
180
+ [
181
+ 'body' => $body,
182
+ 'timeout' => 25
183
+ ]
184
+ );
185
+
186
+ return wp_remote_retrieve_body( $response );
187
+ }
188
+
189
+ /**
190
+ * Get remote template data.
191
+ *
192
+ * Retrieve the data of a single remote template from Elementor.com servers.
193
+ *
194
+ * @return array|\WP_Error Remote Template data.
195
+ */
196
+ public function get_data( array $args, $context = 'display' ) {
197
+ $data = self::request_template_data( $args['template_id'] );
198
+
199
+ $data = json_decode( $data, true );
200
+
201
+ if ( empty( $data ) || empty( $data['content'] ) ) {
202
+ throw new \Exception( __( 'Template does not have any content', 'happy-elementor-addons' ) );
203
+ }
204
+
205
+ $data['content'] = $this->replace_elements_ids( $data['content'] );
206
+ $data['content'] = $this->process_export_import_content( $data['content'], 'on_import' );
207
+
208
+ $post_id = $args['editor_post_id'];
209
+ $document = ha_elementor()->documents->get( $post_id );
210
+
211
+ if ( $document ) {
212
+ $data['content'] = $document->get_elements_raw_data( $data['content'], true );
213
+ }
214
+
215
+ return $data;
216
+ }
217
+ }
classes/widgets-manager.php CHANGED
@@ -548,7 +548,17 @@ class Widgets_Manager {
548
  'css' => [],
549
  'js' => ['circlr','ha-simple-magnify'],
550
  ],
551
- ]
 
 
 
 
 
 
 
 
 
 
552
  ];
553
  }
554
 
548
  'css' => [],
549
  'js' => ['circlr','ha-simple-magnify'],
550
  ],
551
+ ],
552
+ 'fluent-form' => [
553
+ 'title' => __( 'Fluent Form', 'happy-elementor-addons' ),
554
+ 'icon' => 'hm hm-form',
555
+ 'css' => [],
556
+ 'js' => [],
557
+ 'vendor' => [
558
+ 'css' => [],
559
+ 'js' => [],
560
+ ],
561
+ ],
562
  ];
563
  }
564
 
controls/select2.php CHANGED
@@ -30,7 +30,7 @@ class Select2 extends Base_Data_Control {
30
  public function enqueue() {
31
  wp_enqueue_script(
32
  'ha-select2',
33
- HAPPY_ADDONS_ASSETS.'/admin/js/select2.js',
34
  ['jquery'],
35
  HAPPY_ADDONS_VERSION
36
  );
30
  public function enqueue() {
31
  wp_enqueue_script(
32
  'ha-select2',
33
+ HAPPY_ADDONS_ASSETS . 'admin/js/select2.min.js',
34
  ['jquery'],
35
  HAPPY_ADDONS_VERSION
36
  );
inc/functions-forms.php CHANGED
@@ -13,7 +13,7 @@ defined( 'ABSPATH' ) || die();
13
  * @return bool
14
  */
15
  function ha_is_cf7_activated() {
16
- return class_exists( 'WPCF7' );
17
  }
18
 
19
  /**
@@ -31,7 +31,7 @@ function ha_is_wpforms_activated() {
31
  * @return bool
32
  */
33
  function ha_is_ninjaforms_activated() {
34
- return class_exists( 'Ninja_Forms' );
35
  }
36
 
37
  /**
@@ -40,7 +40,7 @@ function ha_is_ninjaforms_activated() {
40
  * @return bool
41
  */
42
  function ha_is_calderaforms_activated() {
43
- return class_exists( 'Caldera_Forms' );
44
  }
45
 
46
  /**
@@ -49,7 +49,7 @@ function ha_is_calderaforms_activated() {
49
  * @return bool
50
  */
51
  function ha_is_weforms_activated() {
52
- return class_exists( 'WeForms' );
53
  }
54
 
55
  /**
@@ -58,7 +58,16 @@ function ha_is_weforms_activated() {
58
  * @return bool
59
  */
60
  function ha_is_gravityforms_activated() {
61
- return class_exists( 'GFForms' );
 
 
 
 
 
 
 
 
 
62
  }
63
 
64
  /**
@@ -184,5 +193,29 @@ function ha_get_gravity_forms() {
184
  }
185
  }
186
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
  return $forms;
188
  }
13
  * @return bool
14
  */
15
  function ha_is_cf7_activated() {
16
+ return class_exists( '\WPCF7' );
17
  }
18
 
19
  /**
31
  * @return bool
32
  */
33
  function ha_is_ninjaforms_activated() {
34
+ return class_exists( '\Ninja_Forms' );
35
  }
36
 
37
  /**
40
  * @return bool
41
  */
42
  function ha_is_calderaforms_activated() {
43
+ return class_exists( '\Caldera_Forms' );
44
  }
45
 
46
  /**
49
  * @return bool
50
  */
51
  function ha_is_weforms_activated() {
52
+ return class_exists( '\WeForms' );
53
  }
54
 
55
  /**
58
  * @return bool
59
  */
60
  function ha_is_gravityforms_activated() {
61
+ return class_exists( '\GFForms' );
62
+ }
63
+
64
+ /*
65
+ * Check if Fluent Form is activated
66
+ *
67
+ * @return bool
68
+ */
69
+ function ha_is_fluent_form_activated() {
70
+ return defined( 'FLUENTFORM' );
71
  }
72
 
73
  /**
193
  }
194
  }
195
  }
196
+ }
197
+
198
+ /*
199
+ * Get a list of all Fluent Forms
200
+ *
201
+ * @return array
202
+ */
203
+ function ha_get_fluent_forms() {
204
+ $forms = [];
205
+
206
+ if ( ha_is_fluent_form_activated() ) {
207
+ global $wpdb;
208
+
209
+ $table = $wpdb->prefix . 'fluentform_forms';
210
+ $query = "SELECT * FROM {$table}";
211
+ $fluent_forms = $wpdb->get_results( $query );
212
+
213
+ if ( $fluent_forms ) {
214
+ foreach( $fluent_forms as $form ) {
215
+ $forms[ $form->id ] = $form->title;
216
+ }
217
+ }
218
+ }
219
+
220
  return $forms;
221
  }
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.11.1
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.11.1' );
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.12.0
7
  * Author: weDevs
8
  * Author URI: https://happyaddons.com/
9
  * License: GPLv2
34
 
35
  defined( 'ABSPATH' ) || die();
36
 
37
+ define( 'HAPPY_ADDONS_VERSION', '2.12.0' );
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 Addons for Elementor ===
2
  Plugin Name: Happy Addons for Elementor
3
- Version: 2.11.1
4
  Author: weDevs
5
  Author URI: https://happyaddons.com/
6
  Contributors: thehappymonster, happyaddons, hasinhayder, mosaddek73, tareq1988, sourav926, wedevs, iqbalrony, mrokon, obiplabon
@@ -24,7 +24,7 @@ This Elementor based plugin is the latest addition in the list of [weDevs](https
24
 
25
  Officially recommended by Elementor Page Builder! We are now listed on their [official addons page](https://elementor.com/addons/).
26
 
27
- ### **34+ FREE PREMIUM-LIKE WIDGETS AND MORE ON ITS WAY**
28
 
29
  Unlike most other Elementor addons, Happy Addons offers itself with many robust free widgets. These free yet important widgets would surely give you a feel of premium widgets making you wonder how come these widgets are free. Let's explore all the magical free widgets of Happy Addons:
30
 
@@ -62,10 +62,15 @@ Unlike most other Elementor addons, Happy Addons offers itself with many robust
62
  - [**Post List**](https://demo.happyaddons.com/elementor-post-list-widget-demo/) – List any post elegantly using this widget displaying them in a creative and innovative manner with multiple options to play with.
63
  - [**360° Rotation**](https://happyaddons.com/docs/happy-addons-for-elementor/widgets/360-degree-rotation/) - Create 360 Degree rotated images for your Products with this widget. Flexibility to add auto-rotate or click to the rotation functionality. Also, you can add Magnify Button to Zoom-in your pictures.
64
  - [**Taxonomy List**](https://happyaddons.com/docs/happy-addons-for-elementor/widgets/taxonomy/) - This widget will help you to create a list of posts by sorting categories, tags, post formats.
 
65
 
66
  New free widgets or features are added every month. With all these awesome free widgets, this nifty plugin, not just aims to the trendy and sophisticated WordPress website design philosophy but also effortlessly aligns with any Elementor powered WordPress website design requirements.
67
 
68
 
 
 
 
 
69
  ### **FREE BUILT-IN EXTENSIONS FOR AN UNPRECEDENTED WEB-PAGE DESIGNING EXPERIENCE**
70
 
71
  _Happy Addons Extensions comprise with free extensions augmenting the features of the Elementor page builder to add additional customizations. These effects are novel and exclusive that is only available in Happy Addons._
@@ -253,6 +258,11 @@ For a more detailed explanation check out the following documentation
253
 
254
  == Changelog ==
255
 
 
 
 
 
 
256
  = 2.11.1 - 4 June 2020 =
257
 
258
  - Fix: JS function backward compatibility issue
1
  === Happy Addons for Elementor ===
2
  Plugin Name: Happy Addons for Elementor
3
+ Version: 2.12.0
4
  Author: weDevs
5
  Author URI: https://happyaddons.com/
6
  Contributors: thehappymonster, happyaddons, hasinhayder, mosaddek73, tareq1988, sourav926, wedevs, iqbalrony, mrokon, obiplabon
24
 
25
  Officially recommended by Elementor Page Builder! We are now listed on their [official addons page](https://elementor.com/addons/).
26
 
27
+ ### **35+ FREE PREMIUM-LIKE WIDGETS AND MORE ON ITS WAY**
28
 
29
  Unlike most other Elementor addons, Happy Addons offers itself with many robust free widgets. These free yet important widgets would surely give you a feel of premium widgets making you wonder how come these widgets are free. Let's explore all the magical free widgets of Happy Addons:
30
 
62
  - [**Post List**](https://demo.happyaddons.com/elementor-post-list-widget-demo/) – List any post elegantly using this widget displaying them in a creative and innovative manner with multiple options to play with.
63
  - [**360° Rotation**](https://happyaddons.com/docs/happy-addons-for-elementor/widgets/360-degree-rotation/) - Create 360 Degree rotated images for your Products with this widget. Flexibility to add auto-rotate or click to the rotation functionality. Also, you can add Magnify Button to Zoom-in your pictures.
64
  - [**Taxonomy List**](https://happyaddons.com/docs/happy-addons-for-elementor/widgets/taxonomy/) - This widget will help you to create a list of posts by sorting categories, tags, post formats.
65
+ - [**WP Fluent Forms**](https://happyaddons.com/) - Easliy customize and use Fluent Forms using this super intuitive widget.
66
 
67
  New free widgets or features are added every month. With all these awesome free widgets, this nifty plugin, not just aims to the trendy and sophisticated WordPress website design philosophy but also effortlessly aligns with any Elementor powered WordPress website design requirements.
68
 
69
 
70
+ ### **Happy Templates**
71
+ Finally, we are happy to announce that we are introducing the Happy Template import feature within our HappyAddons. Initially, it comes with almost 400 readymade templates. We will continuously improve our template library. Both of our Free and Pro users can use happy templates. Templates are labeled in two tags, Pro and Free. To import premium templates you will need the [HappyAddons Pro](https://happyaddons.com/). Template import feature works as like Elementor Template importing feature. Additionally, you can check the previews in three device viewport; Desktop, Tab, Mobile.
72
+
73
+
74
  ### **FREE BUILT-IN EXTENSIONS FOR AN UNPRECEDENTED WEB-PAGE DESIGNING EXPERIENCE**
75
 
76
  _Happy Addons Extensions comprise with free extensions augmenting the features of the Elementor page builder to add additional customizations. These effects are novel and exclusive that is only available in Happy Addons._
258
 
259
  == Changelog ==
260
 
261
+ = 2.12.0 - 8 June 2020 =
262
+
263
+ - New: Happy Templates Library
264
+ - New: WP Fluent Forms widget
265
+
266
  = 2.11.1 - 4 June 2020 =
267
 
268
  - Fix: JS function backward compatibility issue
templates/template-library/templates.php ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template library templates
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ ?>
9
+ <script type="text/template" id="tmpl-haTemplateLibrary__header-logo">
10
+ <span class="haTemplateLibrary__logo-wrap">
11
+ <i class="hm hm-happyaddons"></i>
12
+ </span>
13
+ <span class="haTemplateLibrary__logo-title">{{{ title }}}</span>
14
+ </script>
15
+
16
+ <script type="text/template" id="tmpl-haTemplateLibrary__header-back">
17
+ <i class="eicon-" aria-hidden="true"></i>
18
+ <span><?php echo __( 'Back to Library', 'happy-elementor-addons' ); ?></span>
19
+ </script>
20
+
21
+ <script type="text/template" id="tmpl-haTemplateLibrary__header-menu">
22
+ <# _.each( tabs, function( args, tab ) { var activeClass = args.active ? 'elementor-active' : ''; #>
23
+ <div class="elementor-component-tab elementor-template-library-menu-item {{activeClass}}" data-tab="{{{ tab }}}">{{{ args.title }}}</div>
24
+ <# } ); #>
25
+ </script>
26
+
27
+ <script type="text/template" id="tmpl-haTemplateLibrary__header-menu-responsive">
28
+ <div class="elementor-component-tab haTemplateLibrary__responsive-menu-item elementor-active" data-tab="desktop">
29
+ <i class="eicon-device-desktop" aria-hidden="true" title="<?php esc_attr_e( 'Desktop view', 'happy-elementor-addons' ); ?>"></i>
30
+ <span class="elementor-screen-only"><?php esc_html_e( 'Desktop view', 'happy-elementor-addons' ); ?></span>
31
+ </div>
32
+ <div class="elementor-component-tab haTemplateLibrary__responsive-menu-item" data-tab="tab">
33
+ <i class="eicon-device-tablet" aria-hidden="true" title="<?php esc_attr_e( 'Tab view', 'happy-elementor-addons' ); ?>"></i>
34
+ <span class="elementor-screen-only"><?php esc_html_e( 'Tab view', 'happy-elementor-addons' ); ?></span>
35
+ </div>
36
+ <div class="elementor-component-tab haTemplateLibrary__responsive-menu-item" data-tab="mobile">
37
+ <i class="eicon-device-mobile" aria-hidden="true" title="<?php esc_attr_e( 'Mobile view', 'happy-elementor-addons' ); ?>"></i>
38
+ <span class="elementor-screen-only"><?php esc_html_e( 'Mobile view', 'happy-elementor-addons' ); ?></span>
39
+ </div>
40
+ </script>
41
+
42
+ <script type="text/template" id="tmpl-haTemplateLibrary__header-actions">
43
+ <div id="haTemplateLibrary__header-sync" class="elementor-templates-modal__header__item">
44
+ <i class="eicon-sync" aria-hidden="true" title="<?php esc_attr_e( 'Sync Library', 'happy-elementor-addons' ); ?>"></i>
45
+ <span class="elementor-screen-only"><?php esc_html_e( 'Sync Library', 'happy-elementor-addons' ); ?></span>
46
+ </div>
47
+ </script>
48
+
49
+ <script type="text/template" id="tmpl-haTemplateLibrary__preview">
50
+ <iframe></iframe>
51
+ </script>
52
+
53
+ <script type="text/template" id="tmpl-haTemplateLibrary__header-insert">
54
+ <div id="elementor-template-library-header-preview-insert-wrapper" class="elementor-templates-modal__header__item">
55
+ {{{ ha.library.getModal().getTemplateActionButton( obj ) }}}
56
+ </div>
57
+ </script>
58
+
59
+ <script type="text/template" id="tmpl-haTemplateLibrary__insert-button">
60
+ <a class="elementor-template-library-template-action elementor-button haTemplateLibrary__insert-button">
61
+ <i class="eicon-file-download" aria-hidden="true"></i>
62
+ <span class="elementor-button-title"><?php esc_html_e( 'Insert', 'happy-elementor-addons' ); ?></span>
63
+ </a>
64
+ </script>
65
+
66
+ <script type="text/template" id="tmpl-haTemplateLibrary__pro-button">
67
+ <a class="elementor-template-library-template-action elementor-button haTemplateLibrary__pro-button" href="https://happyaddons.com/pricing/" target="_blank">
68
+ <i class="eicon-external-link-square" aria-hidden="true"></i>
69
+ <span class="elementor-button-title"><?php esc_html_e( 'Get Pro', 'happy-elementor-addons' ); ?></span>
70
+ </a>
71
+ </script>
72
+
73
+ <script type="text/template" id="tmpl-haTemplateLibrary__loading">
74
+ <div class="elementor-loader-wrapper">
75
+ <div class="elementor-loader">
76
+ <div class="elementor-loader-boxes">
77
+ <div class="elementor-loader-box"></div>
78
+ <div class="elementor-loader-box"></div>
79
+ <div class="elementor-loader-box"></div>
80
+ <div class="elementor-loader-box"></div>
81
+ </div>
82
+ </div>
83
+ <div class="elementor-loading-title"><?php esc_html_e( 'Loading', 'happy-elementor-addons' ); ?></div>
84
+ </div>
85
+ </script>
86
+
87
+ <script type="text/template" id="tmpl-haTemplateLibrary__templates">
88
+ <div id="haTemplateLibrary__toolbar">
89
+ <div id="haTemplateLibrary__toolbar-filter" class="haTemplateLibrary__toolbar-filter">
90
+ <# if ( ha.library.getTags() ) { var selectedTag = ha.library.getFilter( 'tags' ); #>
91
+ <# if ( selectedTag ) { #>
92
+ <span class="haTemplateLibrary__filter-btn">{{{ ha.library.getTags()[selectedTag] }}} <i class="eicon-caret-right"></i></span>
93
+ <# } else { #>
94
+ <span class="haTemplateLibrary__filter-btn"><?php esc_html_e( 'Filter', 'happy-elementor-addons' ); ?> <i class="eicon-caret-right"></i></span>
95
+ <# } #>
96
+ <ul id="haTemplateLibrary__filter-tags" class="haTemplateLibrary__filter-tags">
97
+ <li data-tag="">All</li>
98
+ <# _.each( ha.library.getTags(), function( name, slug ) {
99
+ var selected = selectedTag === slug ? 'active' : '';
100
+ #>
101
+ <li data-tag="{{ slug }}" class="{{ selected }}">{{{ name }}}</li>
102
+ <# } ); #>
103
+ </ul>
104
+ <# } #>
105
+ </div>
106
+
107
+ <div id="haTemplateLibrary__toolbar-search">
108
+ <label for="haTemplateLibrary__search" class="elementor-screen-only"><?php esc_html_e( 'Search Templates:', 'happy-elementor-addons' ); ?></label>
109
+ <input id="haTemplateLibrary__search" placeholder="<?php esc_attr_e( 'Search', 'happy-elementor-addons' ); ?>">
110
+ <i class="eicon-search"></i>
111
+ </div>
112
+ </div>
113
+
114
+ <div class="haTemplateLibrary__templates-window">
115
+ <div id="haTemplateLibrary__templates-list"></div>
116
+ </div>
117
+ </script>
118
+
119
+ <script type="text/template" id="tmpl-haTemplateLibrary__template">
120
+ <div class="haTemplateLibrary__template-body" id="haTemplate-{{ template_id }}">
121
+ <div class="haTemplateLibrary__template-preview">
122
+ <i class="eicon-zoom-in-bold" aria-hidden="true"></i>
123
+ </div>
124
+ <img class="haTemplateLibrary__template-thumbnail" src="{{ thumbnail }}">
125
+ <# if ( obj.isPro ) { #>
126
+ <span class="haTemplateLibrary__template-badge"><?php esc_html_e( 'Pro', 'happy-elementor-addons' ); ?></span>
127
+ <# } #>
128
+ </div>
129
+ <div class="haTemplateLibrary__template-footer">
130
+ {{{ ha.library.getModal().getTemplateActionButton( obj ) }}}
131
+ <a href="#" class="elementor-button haTemplateLibrary__preview-button">
132
+ <i class="eicon-device-desktop" aria-hidden="true"></i>
133
+ <?php esc_html_e( 'Preview', 'happy-elementor-addons' ); ?>
134
+ </a>
135
+ </div>
136
+ </script>
137
+
138
+ <script type="text/template" id="tmpl-haTemplateLibrary__empty">
139
+ <div class="elementor-template-library-blank-icon">
140
+ <img src="<?php echo ELEMENTOR_ASSETS_URL . 'images/no-search-results.svg'; ?>" class="elementor-template-library-no-results" />
141
+ </div>
142
+ <div class="elementor-template-library-blank-title"></div>
143
+ <div class="elementor-template-library-blank-message"></div>
144
+ <div class="elementor-template-library-blank-footer">
145
+ <?php esc_html_e( 'Want to learn more about the Happy Library?', 'happy-elementor-addons' ); ?>
146
+ <a class="elementor-template-library-blank-footer-link" href="https://happyaddons.com/docs/happy-addons-for-elementor/happy-features/happy-templates/" target="_blank"><?php echo __( 'Click here', 'happy-elementor-addons' ); ?></a>
147
+ </div>
148
+ </script>
widgets/fluent-form/widget.php ADDED
@@ -0,0 +1,692 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Fluent Form widget class
4
+ *
5
+ * @package Happy_Addons
6
+ */
7
+ namespace Happy_Addons\Elementor\Widget;
8
+
9
+ use Elementor\Controls_Manager;
10
+ use Elementor\Group_Control_Border;
11
+ use Elementor\Group_Control_Box_Shadow;
12
+ use Elementor\Group_Control_Typography;
13
+ use Elementor\Scheme_Typography;
14
+
15
+ defined( 'ABSPATH' ) || die();
16
+
17
+ class Fluent_Form extends Base {
18
+
19
+ /**
20
+ * Get widget title.
21
+ *
22
+ * @since 1.0.0
23
+ * @access public
24
+ *
25
+ * @return string Widget title.
26
+ */
27
+ public function get_title() {
28
+ return __( 'Fluent Form', 'happy-elementor-addons' );
29
+ }
30
+
31
+ /**
32
+ * Get widget icon.
33
+ *
34
+ * @since 1.0.0
35
+ * @access public
36
+ *
37
+ * @return string Widget icon.
38
+ */
39
+ public function get_icon() {
40
+ return 'hm hm-form';
41
+ }
42
+
43
+ public function get_keywords() {
44
+ return [ 'fluent-form', 'form', 'contact', 'contact form' ];
45
+ }
46
+
47
+ protected function register_content_controls() {
48
+ $this->start_controls_section(
49
+ '_section_fluent_form',
50
+ [
51
+ 'label' => ha_is_fluent_form_activated() ? __( 'Fluent Form', 'happy-elementor-addons' ) : __( 'Missing Notice', 'happy-elementor-addons' ),
52
+ 'tab' => Controls_Manager::TAB_CONTENT,
53
+ ]
54
+ );
55
+
56
+ if ( ! ha_is_fluent_form_activated() ) {
57
+ $this->add_control(
58
+ '_fluent_form_missing_notice',
59
+ [
60
+ 'type' => Controls_Manager::RAW_HTML,
61
+ 'raw' => sprintf(
62
+ __( 'Hello %2$s, looks like %1$s is missing in your site. Please click on the link below and install/activate %1$s. Make sure to refresh this page after installation or activation.', 'happy-elementor-addons' ),
63
+ '<a href="'.esc_url( admin_url( 'plugin-install.php?s=fluentform&tab=search&type=term' ) )
64
+ .'" target="_blank" rel="noopener">Fluent Form</a>',
65
+ ha_get_current_user_display_name()
66
+ ),
67
+ 'content_classes' => 'elementor-panel-alert elementor-panel-alert-danger',
68
+ ]
69
+ );
70
+
71
+ $this->add_control(
72
+ '_fluent_form_install',
73
+ [
74
+ 'type' => Controls_Manager::RAW_HTML,
75
+ 'raw' => '<a href="'.esc_url( admin_url( 'plugin-install.php?s=fluentform+7&tab=search&type=term' ) ).'" target="_blank" rel="noopener">Click to install or activate Fluent Form</a>',
76
+ ]
77
+ );
78
+ $this->end_controls_section();
79
+ return;
80
+ }
81
+
82
+ $this->add_control(
83
+ 'form_id',
84
+ [
85
+ 'label' => __( 'Select Your Form', 'happy-elementor-addons' ),
86
+ 'type' => Controls_Manager::SELECT,
87
+ 'label_block' => true,
88
+ 'options' => ['' => __( 'Select a Form', 'happy-elementor-addons' ) ] + \ha_get_fluent_forms(),
89
+ ]
90
+ );
91
+
92
+ $this->end_controls_section();
93
+ }
94
+
95
+ protected function register_style_controls() {
96
+ $this->start_controls_section(
97
+ '_section_fields_style',
98
+ [
99
+ 'label' => __( 'Form Fields', 'happy-elementor-addons' ),
100
+ 'tab' => Controls_Manager::TAB_STYLE,
101
+ ]
102
+ );
103
+
104
+ $this->add_responsive_control(
105
+ 'field_margin',
106
+ [
107
+ 'label' => __( 'Spacing Bottom', 'happy-elementor-addons' ),
108
+ 'type' => Controls_Manager::SLIDER,
109
+ 'size_units' => [ 'px' ],
110
+ 'range' => [
111
+ 'px' => [
112
+ 'min' => 0,
113
+ 'max' => 100,
114
+ ],
115
+ ],
116
+ 'selectors' => [
117
+ '{{WRAPPER}} .ff-el-group:not(.ff_submit_btn_wrapper)' => 'margin-bottom: {{SIZE}}{{UNIT}};',
118
+ ],
119
+ ]
120
+ );
121
+
122
+ $this->add_responsive_control(
123
+ 'field_padding',
124
+ [
125
+ 'label' => __( 'Padding', 'happy-elementor-addons' ),
126
+ 'type' => Controls_Manager::DIMENSIONS,
127
+ 'size_units' => [ 'px', '%' ],
128
+ 'selectors' => [
129
+ '{{WRAPPER}} .ff-el-form-control:not(select)' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
130
+ ],
131
+ ]
132
+ );
133
+
134
+ $this->add_responsive_control(
135
+ 'field_border_radius',
136
+ [
137
+ 'label' => __( 'Border Radius', 'happy-elementor-addons' ),
138
+ 'type' => Controls_Manager::DIMENSIONS,
139
+ 'size_units' => [ 'px', '%' ],
140
+ 'selectors' => [
141
+ '{{WRAPPER}} .ff-el-form-control' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
142
+ ],
143
+ ]
144
+ );
145
+
146
+ $this->add_control(
147
+ 'hr',
148
+ [
149
+ 'type' => Controls_Manager::DIVIDER,
150
+ 'style' => 'thick',
151
+ ]
152
+ );
153
+
154
+ $this->add_group_control(
155
+ Group_Control_Typography::get_type(),
156
+ [
157
+ 'name' => 'field_typography',
158
+ 'label' => __( 'Typography', 'happy-elementor-addons' ),
159
+ 'selector' => '{{WRAPPER}} .ff-el-form-control',
160
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_3
161
+ ]
162
+ );
163
+
164
+ $this->add_control(
165
+ 'field_color',
166
+ [
167
+ 'label' => __( 'Text Color', 'happy-elementor-addons' ),
168
+ 'type' => Controls_Manager::COLOR,
169
+ 'selectors' => [
170
+ '{{WRAPPER}} .ff-el-form-control' => 'color: {{VALUE}}',
171
+ ],
172
+ ]
173
+ );
174
+
175
+ $this->add_control(
176
+ 'field_placeholder_color',
177
+ [
178
+ 'label' => __( 'Placeholder Text Color', 'happy-elementor-addons' ),
179
+ 'type' => Controls_Manager::COLOR,
180
+ 'selectors' => [
181
+ '{{WRAPPER}} ::-webkit-input-placeholder' => 'color: {{VALUE}};',
182
+ '{{WRAPPER}} ::-moz-placeholder' => 'color: {{VALUE}};',
183
+ '{{WRAPPER}} ::-ms-input-placeholder' => 'color: {{VALUE}};',
184
+ ],
185
+ ]
186
+ );
187
+
188
+ $this->start_controls_tabs( 'tabs_field_state' );
189
+
190
+ $this->start_controls_tab(
191
+ 'tab_field_normal',
192
+ [
193
+ 'label' => __( 'Normal', 'happy-elementor-addons' ),
194
+ ]
195
+ );
196
+
197
+ $this->add_group_control(
198
+ Group_Control_Border::get_type(),
199
+ [
200
+ 'name' => 'field_border',
201
+ 'selector' => '{{WRAPPER}} .ff-el-form-control',
202
+ ]
203
+ );
204
+
205
+ $this->add_group_control(
206
+ Group_Control_Box_Shadow::get_type(),
207
+ [
208
+ 'name' => 'field_box_shadow',
209
+ 'selector' => '{{WRAPPER}} .ff-el-form-control:not(select)',
210
+ ]
211
+ );
212
+
213
+ $this->add_control(
214
+ 'field_bg_color',
215
+ [
216
+ 'label' => __( 'Background Color', 'happy-elementor-addons' ),
217
+ 'type' => Controls_Manager::COLOR,
218
+ 'selectors' => [
219
+ '{{WRAPPER}} .ff-el-form-control' => 'background-color: {{VALUE}}',
220
+ ],
221
+ ]
222
+ );
223
+
224
+ $this->end_controls_tab();
225
+
226
+ $this->start_controls_tab(
227
+ 'tab_field_focus',
228
+ [
229
+ 'label' => __( 'Focus', 'happy-elementor-addons' ),
230
+ ]
231
+ );
232
+
233
+ $this->add_group_control(
234
+ Group_Control_Border::get_type(),
235
+ [
236
+ 'name' => 'field_focus_border',
237
+ 'selector' => '{{WRAPPER}} .ff-el-form-control:focus',
238
+ ]
239
+ );
240
+
241
+ $this->add_group_control(
242
+ Group_Control_Box_Shadow::get_type(),
243
+ [
244
+ 'name' => 'field_focus_box_shadow',
245
+ 'exclude' => [
246
+ 'box_shadow_position',
247
+ ],
248
+ 'selector' => '{{WRAPPER}} .ff-el-form-control:not(select):focus',
249
+ ]
250
+ );
251
+
252
+ $this->add_control(
253
+ 'field_focus_bg_color',
254
+ [
255
+ 'label' => __( 'Background Color', 'happy-elementor-addons' ),
256
+ 'type' => Controls_Manager::COLOR,
257
+ 'selectors' => [
258
+ '{{WRAPPER}} .ff-el-form-control:focus' => 'background-color: {{VALUE}}',
259
+ ],
260
+ ]
261
+ );
262
+
263
+ $this->end_controls_tab();
264
+ $this->end_controls_tabs();
265
+
266
+ $this->end_controls_section();
267
+
268
+
269
+ $this->start_controls_section(
270
+ 'form-label',
271
+ [
272
+ 'label' => __( 'Form Fields Label', 'happy-elementor-addons' ),
273
+ 'tab' => Controls_Manager::TAB_STYLE,
274
+ ]
275
+ );
276
+
277
+ $this->add_responsive_control(
278
+ 'label_margin',
279
+ [
280
+ 'label' => __( 'Spacing Bottom', 'happy-elementor-addons' ),
281
+ 'type' => Controls_Manager::SLIDER,
282
+ 'size_units' => [ 'px' ],
283
+ 'range' => [
284
+ 'px' => [
285
+ 'min' => 0,
286
+ 'max' => 100,
287
+ ],
288
+ ],
289
+ 'selectors' => [
290
+ '{{WRAPPER}} .ff-el-input--label' => 'margin-bottom: {{SIZE}}{{UNIT}};',
291
+ ],
292
+ ]
293
+ );
294
+
295
+ $this->add_control(
296
+ 'hr3',
297
+ [
298
+ 'type' => Controls_Manager::DIVIDER,
299
+ 'style' => 'thick',
300
+ ]
301
+ );
302
+
303
+ $this->add_group_control(
304
+ Group_Control_Typography::get_type(),
305
+ [
306
+ 'name' => 'label_typography',
307
+ 'label' => __( 'Typography', 'happy-elementor-addons' ),
308
+ 'selector' => '{{WRAPPER}} .ff-el-input--label label',
309
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_3
310
+ ]
311
+ );
312
+
313
+ $this->add_control(
314
+ 'label_color',
315
+ [
316
+ 'label' => __( 'Text Color', 'happy-elementor-addons' ),
317
+ 'type' => Controls_Manager::COLOR,
318
+ 'selectors' => [
319
+ '{{WRAPPER}} .ff-el-input--label label' => 'color: {{VALUE}}',
320
+ ],
321
+ ]
322
+ );
323
+
324
+ $this->add_control(
325
+ 'check_box_label_color',
326
+ [
327
+ 'label' => __( 'Check Box Label Color', 'happy-elementor-addons' ),
328
+ 'type' => Controls_Manager::COLOR,
329
+ 'selectors' => [
330
+ '{{WRAPPER}} .ff-el-form-check .ff-el-form-check-label' => 'color: {{VALUE}}',
331
+ ],
332
+ ]
333
+ );
334
+
335
+ $this->add_control(
336
+ 'required_label_color',
337
+ [
338
+ 'label' => __( 'Required Label Color', 'happy-elementor-addons' ),
339
+ 'type' => Controls_Manager::COLOR,
340
+ 'selectors' => [
341
+ '{{WRAPPER}} .ff-el-input--label label:before' => 'color: {{VALUE}}',
342
+ ],
343
+ ]
344
+ );
345
+
346
+ $this->add_control(
347
+ 'help_text_heading',
348
+ [
349
+ 'label' => __( 'Help Text', 'happy-elementor-addons' ),
350
+ 'type' => Controls_Manager::HEADING,
351
+ 'separator' => 'before',
352
+ ]
353
+ );
354
+
355
+ $this->add_responsive_control(
356
+ 'help_text_padding',
357
+ [
358
+ 'label' => __( 'Padding', 'happy-elementor-addons' ),
359
+ 'type' => Controls_Manager::DIMENSIONS,
360
+ 'size_units' => [ 'px', '%' ],
361
+ 'selectors' => [
362
+ '{{WRAPPER}} .ff-el-tooltip:before' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
363
+ ],
364
+ ]
365
+ );
366
+
367
+ $this->add_group_control(
368
+ Group_Control_Border::get_type(),
369
+ [
370
+ 'name' => 'help_text_border',
371
+ 'selector' => '{{WRAPPER}} .ff-el-tooltip:before',
372
+ ]
373
+ );
374
+
375
+ $this->add_control(
376
+ 'help_text_border_radius',
377
+ [
378
+ 'label' => __( 'Border Radius', 'happy-elementor-addons' ),
379
+ 'type' => Controls_Manager::DIMENSIONS,
380
+ 'size_units' => [ 'px', '%' ],
381
+ 'selectors' => [
382
+ '{{WRAPPER}} .ff-el-tooltip:before' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
383
+ ],
384
+ ]
385
+ );
386
+
387
+ $this->add_group_control(
388
+ Group_Control_Typography::get_type(),
389
+ [
390
+ 'name' => 'help_text_typography',
391
+ 'label' => __( 'Typography', 'happy-elementor-addons' ),
392
+ 'selector' => '{{WRAPPER}} .ff-el-tooltip:before',
393
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
394
+ ]
395
+ );
396
+
397
+ $this->add_control(
398
+ 'help_text_icon_color',
399
+ [
400
+ 'label' => __( 'Icon Color', 'happy-elementor-addons' ),
401
+ 'type' => Controls_Manager::COLOR,
402
+ 'selectors' => [
403
+ '{{WRAPPER}} .ff-el-tooltip' => 'color: {{VALUE}}',
404
+ ],
405
+ ]
406
+ );
407
+
408
+ $this->add_control(
409
+ 'help_text_color',
410
+ [
411
+ 'label' => __( 'Color', 'happy-elementor-addons' ),
412
+ 'type' => Controls_Manager::COLOR,
413
+ 'selectors' => [
414
+ '{{WRAPPER}} .ff-el-tooltip:before' => 'color: {{VALUE}}',
415
+ ],
416
+ ]
417
+ );
418
+
419
+ $this->add_control(
420
+ 'help_text_arrow_color',
421
+ [
422
+ 'label' => __( 'Arrow Color', 'happy-elementor-addons' ),
423
+ 'type' => Controls_Manager::COLOR,
424
+ 'selectors' => [
425
+ '{{WRAPPER}} .ff-el-tooltip:after' => 'border-top-color: {{VALUE}}',
426
+ ],
427
+ ]
428
+ );
429
+
430
+ $this->add_control(
431
+ 'help_text_background_color',
432
+ [
433
+ 'label' => __( 'Background Color', 'happy-elementor-addons' ),
434
+ 'type' => Controls_Manager::COLOR,
435
+ 'selectors' => [
436
+ '{{WRAPPER}} .ff-el-tooltip:before' => 'background-color: {{VALUE}}',
437
+ ],
438
+ ]
439
+ );
440
+
441
+ $this->end_controls_section();
442
+
443
+ $this->start_controls_section(
444
+ 'submit',
445
+ [
446
+ 'label' => __( 'Submit Button', 'happy-elementor-addons' ),
447
+ 'tab' => Controls_Manager::TAB_STYLE,
448
+ ]
449
+ );
450
+
451
+ $this->add_responsive_control(
452
+ 'submit_margin',
453
+ [
454
+ 'label' => __( 'Margin', 'happy-elementor-addons' ),
455
+ 'type' => Controls_Manager::DIMENSIONS,
456
+ 'size_units' => [ 'px', '%' ],
457
+ 'selectors' => [
458
+ '{{WRAPPER}} .ff-btn-submit' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
459
+ ],
460
+ ]
461
+ );
462
+
463
+ $this->add_responsive_control(
464
+ 'submit_padding',
465
+ [
466
+ 'label' => __( 'Padding', 'happy-elementor-addons' ),
467
+ 'type' => Controls_Manager::DIMENSIONS,
468
+ 'size_units' => [ 'px', '%' ],
469
+ 'selectors' => [
470
+ '{{WRAPPER}} .ff-btn-submit' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
471
+ ],
472
+ ]
473
+ );
474
+
475
+ $this->add_group_control(
476
+ Group_Control_Typography::get_type(),
477
+ [
478
+ 'name' => 'submit_typography',
479
+ 'selector' => '{{WRAPPER}} .ff-btn-submit',
480
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_4
481
+ ]
482
+ );
483
+
484
+ $this->add_group_control(
485
+ Group_Control_Border::get_type(),
486
+ [
487
+ 'name' => 'submit_border',
488
+ 'selector' => '{{WRAPPER}} .ff-btn-submit',
489
+ ]
490
+ );
491
+
492
+ $this->add_control(
493
+ 'submit_border_radius',
494
+ [
495
+ 'label' => __( 'Border Radius', 'happy-elementor-addons' ),
496
+ 'type' => Controls_Manager::DIMENSIONS,
497
+ 'size_units' => [ 'px', '%' ],
498
+ 'selectors' => [
499
+ '{{WRAPPER}} .ff-btn-submit' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
500
+ ],
501
+ ]
502
+ );
503
+
504
+ $this->add_group_control(
505
+ Group_Control_Box_Shadow::get_type(),
506
+ [
507
+ 'name' => 'submit_box_shadow',
508
+ 'selector' => '{{WRAPPER}} .ff-btn-submit',
509
+ ]
510
+ );
511
+
512
+ $this->add_control(
513
+ 'hr4',
514
+ [
515
+ 'type' => Controls_Manager::DIVIDER,
516
+ 'style' => 'thick',
517
+ ]
518
+ );
519
+
520
+ $this->start_controls_tabs( 'tabs_button_style' );
521
+
522
+ $this->start_controls_tab(
523
+ 'tab_button_normal',
524
+ [
525
+ 'label' => __( 'Normal', 'happy-elementor-addons' ),
526
+ ]
527
+ );
528
+
529
+ $this->add_control(
530
+ 'submit_color',
531
+ [
532
+ 'label' => __( 'Text Color', 'happy-elementor-addons' ),
533
+ 'type' => Controls_Manager::COLOR,
534
+ 'default' => '',
535
+ 'selectors' => [
536
+ '{{WRAPPER}} .ff-btn-submit' => 'color: {{VALUE}};',
537
+ ],
538
+ ]
539
+ );
540
+
541
+ $this->add_control(
542
+ 'submit_bg_color',
543
+ [
544
+ 'label' => __( 'Background Color', 'happy-elementor-addons' ),
545
+ 'type' => Controls_Manager::COLOR,
546
+ 'selectors' => [
547
+ '{{WRAPPER}} .ff-btn-submit' => 'background-color: {{VALUE}};',
548
+ ],
549
+ ]
550
+ );
551
+
552
+ $this->end_controls_tab();
553
+
554
+ $this->start_controls_tab(
555
+ 'tab_button_hover',
556
+ [
557
+ 'label' => __( 'Hover', 'happy-elementor-addons' ),
558
+ ]
559
+ );
560
+
561
+ $this->add_control(
562
+ 'submit_hover_color',
563
+ [
564
+ 'label' => __( 'Text Color', 'happy-elementor-addons' ),
565
+ 'type' => Controls_Manager::COLOR,
566
+ 'selectors' => [
567
+ '{{WRAPPER}} .ff-btn-submit:hover, {{WRAPPER}} .wpcf7-submit:focus' => 'color: {{VALUE}};',
568
+ ],
569
+ ]
570
+ );
571
+
572
+ $this->add_control(
573
+ 'submit_hover_bg_color',
574
+ [
575
+ 'label' => __( 'Background Color', 'happy-elementor-addons' ),
576
+ 'type' => Controls_Manager::COLOR,
577
+ 'selectors' => [
578
+ '{{WRAPPER}} .ff-btn-submit:hover, {{WRAPPER}} .ff-btn-submit:focus' => 'background-color: {{VALUE}};',
579
+ ],
580
+ ]
581
+ );
582
+
583
+ $this->add_control(
584
+ 'submit_hover_border_color',
585
+ [
586
+ 'label' => __( 'Border Color', 'happy-elementor-addons' ),
587
+ 'type' => Controls_Manager::COLOR,
588
+ 'selectors' => [
589
+ '{{WRAPPER}} .ff-btn-submit:hover, {{WRAPPER}} .ff-btn-submit:focus' => 'border-color: {{VALUE}};',
590
+ ],
591
+ ]
592
+ );
593
+
594
+ $this->end_controls_tab();
595
+ $this->end_controls_tabs();
596
+
597
+ $this->end_controls_section();
598
+
599
+ $this->start_controls_section(
600
+ '_break',
601
+ [
602
+ 'label' => __( 'Break', 'happy-elementor-addons' ),
603
+ 'tab' => Controls_Manager::TAB_STYLE,
604
+ ]
605
+ );
606
+
607
+ $this->add_control(
608
+ 'section_break',
609
+ [
610
+ 'label' => __( 'Section Break', 'happy-elementor-addons' ),
611
+ 'type' => Controls_Manager::HEADING,
612
+ ]
613
+ );
614
+
615
+ $this->add_group_control(
616
+ Group_Control_Typography::get_type(),
617
+ [
618
+ 'name' => 'section_break_title_typography',
619
+ 'label' => __( 'Title Typography', 'happy-elementor-addons' ),
620
+ 'selector' => '{{WRAPPER}} .ff-el-section-break .ff-el-section-title',
621
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_3
622
+ ]
623
+ );
624
+
625
+ $this->add_group_control(
626
+ Group_Control_Typography::get_type(),
627
+ [
628
+ 'name' => 'section_break_description_typography',
629
+ 'label' => __( 'Description Typography', 'happy-elementor-addons' ),
630
+ 'selector' => '{{WRAPPER}} .ff-el-section-break .ff-section_break_desk',
631
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_4
632
+ ]
633
+ );
634
+
635
+ $this->start_controls_tabs( 'tabs_section_break_style' );
636
+
637
+ $this->start_controls_tab(
638
+ 'section_break__title',
639
+ [
640
+ 'label' => __( 'Title', 'happy-elementor-addons' ),
641
+ ]
642
+ );
643
+
644
+ $this->add_control(
645
+ 'section_break_title_color',
646
+ [
647
+ 'label' => __( 'Color', 'happy-elementor-addons' ),
648
+ 'type' => Controls_Manager::COLOR,
649
+ 'selectors' => [
650
+ '{{WRAPPER}} .ff-el-section-break .ff-el-section-title' => 'color: {{VALUE}};',
651
+ ],
652
+ ]
653
+ );
654
+
655
+ $this->end_controls_tab();
656
+
657
+ $this->start_controls_tab(
658
+ 'section_break_tab_description',
659
+ [
660
+ 'label' => __( 'Description', 'happy-elementor-addons' ),
661
+ ]
662
+ );
663
+
664
+ $this->add_control(
665
+ 'section_break_description_color',
666
+ [
667
+ 'label' => __( 'Color', 'happy-elementor-addons' ),
668
+ 'type' => Controls_Manager::COLOR,
669
+ 'selectors' => [
670
+ '{{WRAPPER}} .ff-el-section-break .ff-section_break_desk' => 'color: {{VALUE}};',
671
+ ],
672
+ ]
673
+ );
674
+
675
+ $this->end_controls_tab();
676
+ $this->end_controls_tabs();
677
+ }
678
+
679
+ protected function render() {
680
+ if ( ! ha_is_fluent_form_activated() ) {
681
+ return;
682
+ }
683
+
684
+ $settings = $this->get_settings_for_display();
685
+
686
+ if ( ! empty( $settings['form_id'] ) ) {
687
+ echo ha_do_shortcode( 'fluentform', [
688
+ 'id' => $settings['form_id'],
689
+ ] );
690
+ }
691
+ }
692
+ }