PopBox For Elementor - Version 0.1.5

Version Description

  • Plugin initial release
Download this release

Release Info

Developer LuisBeOnline
Plugin Icon wp plugin PopBox For Elementor
Version 0.1.5
Comparing to
See all releases

Version 0.1.5

css/bootstrap.css ADDED
@@ -0,0 +1,192 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Bootstrap v3.3.6 (http://getbootstrap.com)
3
+ * Copyright 2011-2015 Twitter, Inc.
4
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5
+ */
6
+ /*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
7
+
8
+
9
+ .fade {
10
+ opacity: 0;
11
+ -webkit-transition: opacity .15s linear;
12
+ -o-transition: opacity .15s linear;
13
+ transition: opacity .15s linear;
14
+ }
15
+ .fade.in {
16
+ opacity: 1;
17
+ }
18
+
19
+ [data-toggle="buttons"] > .btn input[type="radio"],
20
+ [data-toggle="buttons"] > .btn-group > .btn input[type="radio"],
21
+ [data-toggle="buttons"] > .btn input[type="checkbox"],
22
+ [data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"] {
23
+ position: absolute;
24
+ clip: rect(0, 0, 0, 0);
25
+ pointer-events: none;
26
+ }
27
+
28
+ .close {
29
+ float: right;
30
+ font-size: 21px;
31
+ font-weight: bold;
32
+ line-height: 1;
33
+ color: #000;
34
+ text-shadow: 0 1px 0 #fff;
35
+ }
36
+ .close:hover,
37
+ .close:focus {
38
+ color: #000;
39
+ text-decoration: none;
40
+ cursor: pointer;
41
+
42
+ }
43
+ .modal-content .close {
44
+ background-color: transparent !important;
45
+ }
46
+
47
+ button.close:hover {
48
+ filter: alpha(opacity=50);
49
+ opacity: .5;
50
+ }
51
+
52
+
53
+ button.close {
54
+ -webkit-appearance: none;
55
+ padding: 5px;
56
+ cursor: pointer;
57
+ border: 0;
58
+ position: inherit;
59
+ z-index: 999999999;
60
+ display: none;
61
+ }
62
+ .modal-open {
63
+ overflow: hidden;
64
+ }
65
+ .modal {
66
+ position: fixed;
67
+ top: 0;
68
+ right: 0;
69
+ bottom: 0;
70
+ left: 0;
71
+ z-index: 1050;
72
+ display: none;
73
+ overflow: hidden;
74
+ -webkit-overflow-scrolling: touch;
75
+ outline: 0;
76
+ }
77
+ .modal.fade .modal-dialog {
78
+ -webkit-transition: -webkit-transform .3s ease-out;
79
+ -o-transition: -o-transform .3s ease-out;
80
+ transition: transform .3s ease-out;
81
+ -webkit-transform: translate(0, -25%);
82
+ -ms-transform: translate(0, -25%);
83
+ -o-transform: translate(0, -25%);
84
+ transform: translate(0, -25%);
85
+ }
86
+ .modal.in .modal-dialog {
87
+ -webkit-transform: translate(0, 0);
88
+ -ms-transform: translate(0, 0);
89
+ -o-transform: translate(0, 0);
90
+ transform: translate(0, 0);
91
+ }
92
+ .modal-open .modal {
93
+ overflow-x: hidden;
94
+ overflow-y: auto;
95
+ }
96
+ .modal-dialog {
97
+ position: relative;
98
+ margin: 10px;
99
+ }
100
+ .modal-content {
101
+ position: relative;
102
+ margin: 0 auto;
103
+ background-color: #fff;
104
+ -webkit-background-clip: padding-box;
105
+ background-clip: padding-box;
106
+ border: 1px solid #999;
107
+ border: 1px solid rgba(0, 0, 0, .2);
108
+ border-radius: 6px;
109
+ outline: 0;
110
+ -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, .5);
111
+ box-shadow: 0 3px 9px rgba(0, 0, 0, .5);
112
+ }
113
+ .modal-backdrop {
114
+ position: fixed;
115
+ top: 0;
116
+ right: 0;
117
+ bottom: 0;
118
+ left: 0;
119
+ z-index: 1040;
120
+ background-color: #000;
121
+ }
122
+ .modal-backdrop.fade {
123
+ filter: alpha(opacity=0);
124
+ opacity: 0;
125
+ }
126
+ .modal-backdrop.in {
127
+ filter: alpha(opacity=50);
128
+ opacity: .5;
129
+ }
130
+ .modal-header {
131
+ padding: 15px;
132
+ border-bottom: 1px solid #e5e5e5;
133
+ display: none;
134
+ }
135
+ .modal-header .close {
136
+ margin-top: -2px;
137
+ }
138
+ /*.modal-title {
139
+ margin: 0;
140
+ line-height: 1.42857143;
141
+ }*/
142
+ .modal-body {
143
+ position: relative;
144
+ /*padding: 15px;*/
145
+ }
146
+ .modal-footer {
147
+ padding: 15px;
148
+ text-align: right;
149
+ border-top: 1px solid #e5e5e5;
150
+ }
151
+ .modal-footer .btn + .btn {
152
+ margin-bottom: 0;
153
+ margin-left: 5px;
154
+ }
155
+ .modal-footer .btn-group .btn + .btn {
156
+ margin-left: -1px;
157
+ }
158
+ .modal-footer .btn-block + .btn-block {
159
+ margin-left: 0;
160
+ }
161
+ .modal-scrollbar-measure {
162
+ position: absolute;
163
+ top: -9999px;
164
+ width: 50px;
165
+ height: 50px;
166
+ overflow: scroll;
167
+ }
168
+ @media (min-width: 768px) {
169
+ .modal-dialog {
170
+ margin: 30px auto;
171
+ }
172
+ .modal-content {
173
+ -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
174
+ box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
175
+ }
176
+ .modal-sm {
177
+ width: 300px;
178
+ }
179
+ }
180
+ @media (min-width: 992px) {
181
+ .modal-lg {
182
+ width: 900px;
183
+ }
184
+ }
185
+
186
+ .hide {
187
+ display: none !important;
188
+ }
189
+ .show {
190
+ display: block !important;
191
+ }
192
+
css/popup.css ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @media screen and (min-width: 750px) {
2
+ .modal {
3
+ text-align: center;
4
+ padding: 0 !important;
5
+ }
6
+
7
+ .modal-dialog {
8
+ display: inline-block;
9
+ vertical-align: middle;
10
+ width: 100%;
11
+ margin: 0 0;
12
+ }
13
+
14
+ .modal-content {
15
+ padding: 0px 0px 0px 0px;
16
+ }
17
+
18
+ .model-body {
19
+ overflow-y: scroll !important;
20
+ overflow-x: hidden !important;
21
+ }
22
+ }
23
+
24
+ .modal-body {
25
+ padding: 0px !important;
26
+ }
27
+
28
+ body{padding:0 !important}
29
+
30
+ .modal-dialog {
31
+ text-align: left;
32
+ }
33
+
34
+ .modal-title {
35
+ text-align: center;
36
+ }
37
+
38
+ body.modal-open .elementor-widget-wrap {
39
+ z-index: auto;
40
+ }
41
+
42
+ .modal-popup {
43
+ cursor: pointer;
44
+ }
45
+
46
+ .modal.fade.in {
47
+ background: rgba(0,0,0,0.6);
48
+ }
css/rtl.popup.css ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ .modal-dialog {
2
+ text-align: right;
3
+ }
js/bootstrap.js ADDED
@@ -0,0 +1,387 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Bootstrap v3.3.6 (http://getbootstrap.com)
3
+ * Copyright 2011-2015 Twitter, Inc.
4
+ * Licensed under the MIT license
5
+ */
6
+ // Code extracted from Bootstrap and refactored for our needs
7
+
8
+ +function ($) {
9
+ 'use strict';
10
+
11
+ // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
12
+ // ============================================================
13
+
14
+ function transitionEnd() {
15
+ var el = document.createElement('bootstrap')
16
+
17
+ var transEndEventNames = {
18
+ WebkitTransition : 'webkitTransitionEnd',
19
+ MozTransition : 'transitionend',
20
+ OTransition : 'oTransitionEnd otransitionend',
21
+ transition : 'transitionend'
22
+ }
23
+
24
+ for (var name in transEndEventNames) {
25
+ if (el.style[name] !== undefined) {
26
+ return { end: transEndEventNames[name] }
27
+ }
28
+ }
29
+
30
+ return false // explicit for ie8 ( ._.)
31
+ }
32
+
33
+ // http://blog.alexmaccaw.com/css-transitions
34
+ $.fn.emulateTransitionEnd = function (duration) {
35
+ var called = false
36
+ var $el = this
37
+ $(this).one('bsTransitionEnd', function () { called = true })
38
+ var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
39
+ setTimeout(callback, duration)
40
+ return this
41
+ }
42
+
43
+ $(function () {
44
+ $.support.transition = transitionEnd()
45
+
46
+ if (!$.support.transition) return
47
+
48
+ $.event.special.bsTransitionEnd = {
49
+ bindType: $.support.transition.end,
50
+ delegateType: $.support.transition.end,
51
+ handle: function (e) {
52
+ if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
53
+ }
54
+ }
55
+ })
56
+
57
+ }(jQuery);
58
+
59
+
60
+ +function ($) {
61
+ 'use strict';
62
+
63
+ // MODAL CLASS DEFINITION
64
+ // ======================
65
+
66
+ var Modal = function (element, options) {
67
+ this.options = options
68
+ this.$body = $(document.body)
69
+ this.$element = $(element)
70
+ this.$dialog = this.$element.find('.modal-dialog')
71
+ this.$backdrop = null
72
+ this.isShown = null
73
+ this.originalBodyPad = null
74
+ this.scrollbarWidth = 0
75
+ this.ignoreBackdropClick = false
76
+
77
+ if (this.options.remote) {
78
+ this.$element
79
+ .find('.modal-content')
80
+ .load(this.options.remote, $.proxy(function () {
81
+ this.$element.trigger('loaded.bs.modal')
82
+ }, this))
83
+ }
84
+ }
85
+
86
+ Modal.VERSION = '3.3.6'
87
+
88
+ Modal.TRANSITION_DURATION = 300
89
+ Modal.BACKDROP_TRANSITION_DURATION = 150
90
+
91
+ Modal.DEFAULTS = {
92
+ backdrop: true,
93
+ keyboard: true,
94
+ show: true
95
+ }
96
+
97
+ Modal.prototype.toggle = function (_relatedTarget) {
98
+ return this.isShown ? this.hide() : this.show(_relatedTarget)
99
+ }
100
+
101
+ Modal.prototype.show = function (_relatedTarget) {
102
+ var that = this
103
+ var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
104
+
105
+ this.$element.trigger(e)
106
+
107
+ if (this.isShown || e.isDefaultPrevented()) return
108
+
109
+ this.isShown = true
110
+
111
+ this.checkScrollbar()
112
+ this.setScrollbar()
113
+ this.$body.addClass('modal-open')
114
+
115
+ this.escape()
116
+ this.resize()
117
+
118
+ this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
119
+
120
+ this.$dialog.on('mousedown.dismiss.bs.modal', function () {
121
+ that.$element.one('mouseup.dismiss.bs.modal', function (e) {
122
+ if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true
123
+ })
124
+ })
125
+
126
+ this.backdrop(function () {
127
+ var transition = $.support.transition && that.$element.hasClass('fade')
128
+
129
+ if (!that.$element.parent().length) {
130
+ that.$element.appendTo(that.$body) // don't move modals dom position
131
+ }
132
+
133
+ that.$element
134
+ .show()
135
+ .scrollTop(0)
136
+
137
+ that.adjustDialog()
138
+
139
+ if (transition) {
140
+ that.$element[0].offsetWidth // force reflow
141
+ }
142
+
143
+ that.$element.addClass('in')
144
+
145
+ that.enforceFocus()
146
+
147
+ var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
148
+
149
+ transition ?
150
+ that.$dialog // wait for modal to slide in
151
+ .one('bsTransitionEnd', function () {
152
+ that.$element.trigger('focus').trigger(e)
153
+ })
154
+ .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
155
+ that.$element.trigger('focus').trigger(e)
156
+ })
157
+ }
158
+
159
+ Modal.prototype.hide = function (e) {
160
+ if (e) e.preventDefault()
161
+
162
+ e = $.Event('hide.bs.modal')
163
+
164
+ this.$element.trigger(e)
165
+
166
+ if (!this.isShown || e.isDefaultPrevented()) return
167
+
168
+ this.isShown = false
169
+
170
+ this.escape()
171
+ this.resize()
172
+
173
+ $(document).off('focusin.bs.modal')
174
+
175
+ this.$element
176
+ .removeClass('in')
177
+ .off('click.dismiss.bs.modal')
178
+ .off('mouseup.dismiss.bs.modal')
179
+
180
+ this.$dialog.off('mousedown.dismiss.bs.modal')
181
+
182
+ $.support.transition && this.$element.hasClass('fade') ?
183
+ this.$element
184
+ .one('bsTransitionEnd', $.proxy(this.hideModal, this))
185
+ .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
186
+ this.hideModal()
187
+ }
188
+
189
+ Modal.prototype.enforceFocus = function () {
190
+ $(document)
191
+ .off('focusin.bs.modal') // guard against infinite focus loop
192
+ .on('focusin.bs.modal', $.proxy(function (e) {
193
+ if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
194
+ this.$element.trigger('focus')
195
+ }
196
+ }, this))
197
+ }
198
+
199
+ Modal.prototype.escape = function () {
200
+ if (this.isShown && this.options.keyboard) {
201
+ this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
202
+ e.which == 27 && this.hide()
203
+ }, this))
204
+ } else if (!this.isShown) {
205
+ this.$element.off('keydown.dismiss.bs.modal')
206
+ }
207
+ }
208
+
209
+ Modal.prototype.resize = function () {
210
+ if (this.isShown) {
211
+ $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
212
+ } else {
213
+ $(window).off('resize.bs.modal')
214
+ }
215
+ }
216
+
217
+ Modal.prototype.hideModal = function () {
218
+ var that = this
219
+ this.$element.hide()
220
+ this.backdrop(function () {
221
+ that.$body.removeClass('modal-open')
222
+ that.resetAdjustments()
223
+ that.resetScrollbar()
224
+ that.$element.trigger('hidden.bs.modal')
225
+ })
226
+ }
227
+
228
+ Modal.prototype.removeBackdrop = function () {
229
+ this.$backdrop && this.$backdrop.remove()
230
+ this.$backdrop = null
231
+ }
232
+
233
+ Modal.prototype.backdrop = function (callback) {
234
+ var that = this
235
+ var animate = this.$element.hasClass('fade') ? 'fade' : ''
236
+
237
+ if (this.isShown && this.options.backdrop) {
238
+ var doAnimate = $.support.transition && animate
239
+
240
+ this.$backdrop = $(document.createElement('div'))
241
+ .addClass('modal-backdrop ' + animate)
242
+ .appendTo(this.$body)
243
+
244
+ this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
245
+ if (this.ignoreBackdropClick) {
246
+ this.ignoreBackdropClick = false
247
+ return
248
+ }
249
+ if (e.target !== e.currentTarget) return
250
+ this.options.backdrop == 'static'
251
+ ? this.$element[0].focus()
252
+ : this.hide()
253
+ }, this))
254
+
255
+ if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
256
+
257
+ this.$backdrop.addClass('in')
258
+
259
+ if (!callback) return
260
+
261
+ doAnimate ?
262
+ this.$backdrop
263
+ .one('bsTransitionEnd', callback)
264
+ .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
265
+ callback()
266
+
267
+ } else if (!this.isShown && this.$backdrop) {
268
+ this.$backdrop.removeClass('in')
269
+
270
+ var callbackRemove = function () {
271
+ that.removeBackdrop()
272
+ callback && callback()
273
+ }
274
+ $.support.transition && this.$element.hasClass('fade') ?
275
+ this.$backdrop
276
+ .one('bsTransitionEnd', callbackRemove)
277
+ .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
278
+ callbackRemove()
279
+
280
+ } else if (callback) {
281
+ callback()
282
+ }
283
+ }
284
+
285
+ // these following methods are used to handle overflowing modals
286
+
287
+ Modal.prototype.handleUpdate = function () {
288
+ this.adjustDialog()
289
+ }
290
+
291
+ Modal.prototype.adjustDialog = function () {
292
+ var lmmodalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
293
+
294
+ this.$element.css({
295
+ paddingLeft: !this.bodyIsOverflowing && lmmodalIsOverflowing ? this.scrollbarWidth : '',
296
+ paddingRight: this.bodyIsOverflowing && !lmmodalIsOverflowing ? this.scrollbarWidth : ''
297
+ })
298
+ }
299
+
300
+ Modal.prototype.resetAdjustments = function () {
301
+ this.$element.css({
302
+ paddingLeft: '',
303
+ paddingRight: ''
304
+ })
305
+ }
306
+
307
+ Modal.prototype.checkScrollbar = function () {
308
+ var fullWindowWidth = window.innerWidth
309
+ if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
310
+ var documentElementRect = document.documentElement.getBoundingClientRect()
311
+ fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)
312
+ }
313
+ this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth
314
+ this.scrollbarWidth = this.measureScrollbar()
315
+ }
316
+
317
+ Modal.prototype.setScrollbar = function () {
318
+ var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
319
+ this.originalBodyPad = document.body.style.paddingRight || ''
320
+ if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
321
+ }
322
+
323
+ Modal.prototype.resetScrollbar = function () {
324
+ this.$body.css('padding-right', this.originalBodyPad)
325
+ }
326
+
327
+ Modal.prototype.measureScrollbar = function () { // thx walsh
328
+ var scrollDiv = document.createElement('div')
329
+ scrollDiv.className = 'modal-scrollbar-measure'
330
+ this.$body.append(scrollDiv)
331
+ var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
332
+ this.$body[0].removeChild(scrollDiv)
333
+ return scrollbarWidth
334
+ }
335
+
336
+
337
+ // MODAL PLUGIN DEFINITION
338
+ // =======================
339
+
340
+ function Plugin(option, _relatedTarget) {
341
+ return this.each(function () {
342
+ var $this = $(this)
343
+ var data = $this.data('bs.modal')
344
+ var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
345
+
346
+ if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
347
+ if (typeof option == 'string') data[option](_relatedTarget)
348
+ else if (options.show) data.show(_relatedTarget)
349
+ })
350
+ }
351
+
352
+ var old = $.fn.modal
353
+
354
+ $.fn.modal = Plugin
355
+ $.fn.modal.Constructor = Modal
356
+
357
+
358
+ // MODAL NO CONFLICT
359
+ // =================
360
+
361
+ $.fn.modal.noConflict = function () {
362
+ $.fn.modal = old
363
+ return this
364
+ }
365
+
366
+
367
+ // MODAL DATA-API
368
+ // ==============
369
+
370
+ $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
371
+ var $this = $(this)
372
+ var href = $this.attr('href')
373
+ var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
374
+ var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
375
+
376
+ if ($this.is('a')) e.preventDefault()
377
+
378
+ $target.one('show.bs.modal', function (showEvent) {
379
+ if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
380
+ $target.one('hidden.bs.modal', function () {
381
+ $this.is(':visible') && $this.trigger('focus')
382
+ })
383
+ })
384
+ Plugin.call($target, option, this)
385
+ })
386
+
387
+ }(jQuery);
js/popup.js ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function($){
2
+ $('.modal-popup').click(function(){
3
+ var popup_id = $(this).attr('data-target');
4
+ $(popup_id).modal('show');
5
+ $('.modal-backdrop').hide();
6
+ });
7
+ });
languages/lm-modal-he_IL.mo ADDED
Binary file
languages/lm-modal-he_IL.po ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Elementor Popups\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2016-10-18 22:29+0000\n"
6
+ "PO-Revision-Date: 2016-10-18 23:43+0000\n"
7
+ "Last-Translator: avix <luikroizer+wp@gmail.com>\n"
8
+ "Language-Team: Hebrew\n"
9
+ "Language: he-IL\n"
10
+ "Plural-Forms: nplurals=2; plural=n != 1\n"
11
+ "MIME-Version: 1.0\n"
12
+ "Content-Type: text/plain; charset=UTF-8\n"
13
+ "Content-Transfer-Encoding: 8bit\n"
14
+ "X-Generator: Loco - https://localise.biz/"
15
+
16
+ #. Author URI of the plugin
17
+ msgid "https://facebook.com/bashari10"
18
+ msgstr "https://facebook.com/bashari10"
19
+
20
+ #: LM-popup.php:36
21
+ msgid "Popups"
22
+ msgstr "פופאפים"
23
+
24
+ #: LM-popup.php:37 LM-popup.php:105
25
+ msgid "Popup"
26
+ msgstr "פופאפ"
27
+
28
+ #: LM-popup.php:38
29
+ msgid "All Popups"
30
+ msgstr "כל הפופאפים"
31
+
32
+ #: LM-popup.php:39 LM-popup.php:40 LM-popup.php:41
33
+ msgid "Add New Popup"
34
+ msgstr "הוספת פופאפ חדש"
35
+
36
+ #: LM-popup.php:42
37
+ msgid "Edit Popup"
38
+ msgstr "עריכת פופאפ"
39
+
40
+ #: LM-popup.php:111
41
+ msgid "Choose Popup"
42
+ msgstr "בחר פופאפ"
43
+
44
+ #. Name of the plugin
45
+ msgid "Elementor Popups"
46
+ msgstr "פופאפים לאלמנטור"
47
+
48
+ #. Description of the plugin
49
+ msgid "Popup element for Elementor Page Builder"
50
+ msgstr "פופאפ לאלמנטור"
51
+
52
+ #. Author of the plugin
53
+ msgid "Avi Bashari"
54
+ msgstr "אבי בשארי"
languages/lm-modal.pot ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #, fuzzy
2
+ msgid ""
3
+ msgstr ""
4
+ "Project-Id-Version: PACKAGE VERSION\n"
5
+ "Report-Msgid-Bugs-To: \n"
6
+ "POT-Creation-Date: 2016-10-18 22:20+0000\n"
7
+ "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
8
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
9
+ "Language-Team: \n"
10
+ "Language: \n"
11
+ "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
12
+ "MIME-Version: 1.0\n"
13
+ "Content-Type: text/plain; charset=UTF-8\n"
14
+ "Content-Transfer-Encoding: 8bit\n"
15
+ "X-Generator: Loco https://localise.biz/"
16
+
17
+ #: LM-popup.php:36
18
+ msgid "Popups"
19
+ msgstr ""
20
+
21
+ #: LM-popup.php:37 LM-popup.php:105
22
+ msgid "Popup"
23
+ msgstr ""
24
+
25
+ #: LM-popup.php:38
26
+ msgid "All Popups"
27
+ msgstr ""
28
+
29
+ #: LM-popup.php:39 LM-popup.php:40 LM-popup.php:41
30
+ msgid "Add New Popup"
31
+ msgstr ""
32
+
33
+ #: LM-popup.php:42
34
+ msgid "Edit Popup"
35
+ msgstr ""
36
+
37
+ #: LM-popup.php:111
38
+ msgid "Choose Popup"
39
+ msgstr ""
40
+
41
+ #. Name of the plugin
42
+ msgid "Elementor Popups"
43
+ msgstr ""
44
+
45
+ #. Description of the plugin
46
+ msgid "Popup element for Elementor Page Builder"
47
+ msgstr ""
48
+
49
+ #. Author of the plugin
50
+ msgid "Avi Bashari"
51
+ msgstr ""
52
+
53
+ #. Author URI of the plugin
54
+ msgid "https://facebook.com/bashari10"
55
+ msgstr ""
modal-for-elementor.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugin Name: Modal For Elementor
4
+ * Description: Modal plugin for Elementor Page Builder
5
+ * Version: 0.1.5
6
+ * Author: Luis Marques
7
+ * Author URI: https://facebook.com/Luisbeonline
8
+ * Text Domain: modal-for-elementor
9
+ * License: GPLv3
10
+ */
11
+
12
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
13
+
14
+ // Load the plugin after Elementor (and other plugins) are loaded
15
+ add_action( 'plugins_loaded', function() {
16
+ // Load localization file
17
+ load_plugin_textdomain( 'modal-popup', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' );
18
+
19
+ // Notice if the Elementor is not active
20
+ if ( ! did_action( 'elementor/loaded' ) ) {
21
+ add_action( 'admin_notices', 'hello_world_fail_load' );
22
+ return;
23
+ }
24
+
25
+ // Check version required
26
+ $elementor_version_required = '1.0.0';
27
+ if ( ! version_compare( ELEMENTOR_VERSION, $elementor_version_required, '>=' ) ) {
28
+ add_action( 'admin_notices', 'hello_world_fail_load_out_of_date' );
29
+ return;
30
+ }
31
+
32
+ // Require the main plugin file
33
+ require( __DIR__ . '/plugin.php' );
34
+ } );
35
+
36
+
37
+
38
+
39
+ add_action( 'wp_enqueue_scripts', 'register_popup_style' );
40
+ function register_popup_style() {
41
+ wp_enqueue_style( 'bootstrap', plugin_dir_url( __FILE__ ) . 'css/bootstrap.css' );
42
+ wp_enqueue_style( 'modal-popup', plugin_dir_url( __FILE__ ) . 'css/popup.css', array( 'bootstrap' ) );
43
+
44
+ if ( is_rtl() ) {
45
+ wp_enqueue_style(
46
+ 'modal-popup-rtl',
47
+ plugin_dir_url( __FILE__ ) . 'css/rtl.popup.css',
48
+ array ( 'modal-popup' )
49
+ );
50
+ }
51
+
52
+ wp_enqueue_script( 'bootstrap', plugin_dir_url( __FILE__ ) . 'js/bootstrap.js', array( 'jquery' ), null, true );
53
+ wp_enqueue_script( 'modal-popup-js', plugin_dir_url( __FILE__ ) . 'js/popup.js', array( 'jquery', 'bootstrap' ), null, true );
54
+ }
55
+
56
+ /* create new custom post type named popup */
57
+ add_action( 'init', 'create_popup_post_type' );
58
+
59
+ function create_popup_post_type() {
60
+ register_post_type( 'elementor-popup',
61
+ array(
62
+ 'labels' => array(
63
+ 'name' => __( 'Elementor Popups', 'modal-popup'),
64
+ 'singular_name' => __( 'Popup', 'modal-popup'),
65
+ 'all_items' => __( 'All Popups', 'modal-popup'),
66
+ 'add_new_item' => __( 'Add New Popup', 'modal-popup'),
67
+ 'new_item' => __( 'Add New Popup', 'modal-popup'),
68
+ 'add_new' => __( 'Add New Popup', 'modal-popup'),
69
+ 'edit_item' => __( 'Edit Popup', 'modal-popup'),
70
+ ),
71
+ 'has_archive' => false,
72
+ 'rewrite' => array('slug' => 'elementor-popup'),
73
+ 'public' => true,
74
+ 'exclude_from_search' => true,
75
+ )
76
+ );
77
+ add_post_type_support( 'elementor-popup', 'elementor' );
78
+ }
plugin.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace ElementorModal;
3
+
4
+ use ElementorModal\Widgets\ElementorModal;
5
+
6
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
7
+
8
+ class ElementorModalPlugin {
9
+
10
+ /**
11
+ * Plugin constructor.
12
+ */
13
+ public function __construct() {
14
+ $this->add_actions();
15
+ }
16
+
17
+ private function add_actions() {
18
+ add_action( 'elementor/widgets/widgets_registered', [ $this, 'on_widgets_registered' ] );
19
+ }
20
+
21
+ public function on_widgets_registered() {
22
+ $this->includes();
23
+ $this->register_widget();
24
+ }
25
+
26
+ private function includes() {
27
+ require __DIR__ . '/widgets/popup.php';
28
+ }
29
+
30
+ private function register_widget() {
31
+ \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new ElementorModal() );
32
+ \Elementor\Plugin::instance()->elements_manager->add_category(
33
+ 'beonline-elements',
34
+ [
35
+ 'title' => 'BEONLINE PORWER TOOLS',
36
+ 'icon' => 'fa fa-plug'
37
+ ],
38
+ 1
39
+ );
40
+ }
41
+ }
42
+
43
+ new ElementorModalPlugin();
readme.txt ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Modal For Elementor ===
2
+ Tags: Modal, Popup, elementor
3
+ Requires at least: 4.4
4
+ Tested up to: 4.7
5
+ Stable tag: 4.7
6
+ License: GPLv2 or later
7
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+
9
+ Add a modal widget for Elementor Page Builder.
10
+
11
+ == Description ==
12
+
13
+ This plugin allows to create beautiful templates with and for Elementor Page Builder.
14
+
15
+ It will add a menu on your Wordpress Dashboard called Elementor Popups. There you can create
16
+ your popups using Elementor Pagebuilder.
17
+
18
+ It will also add a Widget in Elementor Pagebuilder to add a customizable button in your page.
19
+ Select the popup you want to show when button is clicked.
20
+
21
+
22
+ == Installation ==
23
+
24
+ 1. Upload the plugin files to the `/wp-content/plugins/` directory, or install the plugin through the WordPress plugins screen directly.
25
+ 2. Activate the plugin through the 'Plugins' screen in WordPress
26
+
27
+
28
+ == Changelog ==
29
+
30
+ = 0.1.5 =
31
+ * Plugin initial release
widgets/popup.php ADDED
@@ -0,0 +1,597 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace ElementorModal\Widgets;
3
+
4
+ use Elementor\Widget_Base;
5
+ use Elementor\Controls_Manager;
6
+ use Elementor\Group_Control_Typography;
7
+ use Elementor\Scheme_Typography;
8
+ use Elementor\Scheme_Color;
9
+ use Elementor\Group_Control_Border;
10
+ use Elementor\Group_Control_Background;
11
+ use Elementor\Group_Control_Box_Shadow;
12
+ use Elementor\Frontend;
13
+ use WP_Query;
14
+
15
+
16
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
17
+
18
+ class ElementorModal extends Widget_Base {
19
+
20
+ public function get_name() {
21
+ return 'popup';
22
+ }
23
+ public function get_title() {
24
+ return __( 'Popup', 'modal-popup' );
25
+ }
26
+ public function get_icon() {
27
+ return 'eicon-button';
28
+ }
29
+ public function get_categories() {
30
+ return [ 'beonline-elements' ];
31
+ }
32
+ public static function get_button_sizes() {
33
+ return [
34
+ 'xs' => __( 'Extra Small', 'elementor' ),
35
+ 'sm' => __( 'Small', 'elementor' ),
36
+ 'md' => __( 'Medium', 'elementor' ),
37
+ 'lg' => __( 'Large', 'elementor' ),
38
+ 'xl' => __( 'Extra Large', 'elementor' ),
39
+ ];
40
+ }
41
+ protected function get_popups() {
42
+ $popups_query = new WP_Query( array(
43
+ 'post_type' => 'elementor-popup',
44
+ 'posts_per_page' => -1,
45
+ ) );
46
+
47
+ if ( $popups_query->have_posts() ) {
48
+ $popups_array = array();
49
+ $popups = $popups_query->get_posts();
50
+
51
+ $i = 0;
52
+ foreach( $popups as $popap ) {
53
+ $popups_array[$popap->ID] = $popap->post_title;
54
+ if($i === 0)
55
+ $selected = $popap->ID;
56
+ $i++;
57
+ }
58
+
59
+ $popups = array(
60
+ 'first_popup' => $selected,
61
+ 'popups' => $popups_array,
62
+ );
63
+ return $popups;
64
+ }
65
+ }
66
+ protected function _register_controls() {
67
+ $this->start_controls_section(
68
+ 'section_popup',
69
+ [
70
+ 'label' => __( 'Popup', 'modal-popup' ),
71
+ ]
72
+ );
73
+ $this->add_control(
74
+ 'popup',
75
+ [
76
+ 'label' => __( 'Choose Popup', 'modal-popup' ),
77
+ 'type' => Controls_Manager::SELECT,
78
+ 'default' => $this->get_popups()['first_popup'],
79
+ 'options' => $this->get_popups()['popups'],
80
+ ]
81
+ );
82
+
83
+ $this->add_control(
84
+ 'Close Button',
85
+ [
86
+ 'label' => __( 'Show Close Button', 'modal-popup' ),
87
+ 'type' => Controls_Manager::SWITCHER,
88
+ 'label_off' => __( 'Hide', 'modal-popup' ),
89
+ 'label_on' => __( 'Show', 'modal-popup' ),
90
+ 'default' => 'yes',
91
+
92
+
93
+ 'selectors' => [
94
+ '{{WRAPPER}} button.close' => 'display: inherit;',
95
+ ],
96
+ ]
97
+ );
98
+
99
+ $this->add_control(
100
+ 'button_close_text_color',
101
+ [
102
+ 'label' => __( 'Close Button Color', 'modal-popup' ),
103
+ 'type' => Controls_Manager::COLOR,
104
+ 'default' => '',
105
+ 'selectors' => [
106
+ '{{WRAPPER}} button.close' => 'color: {{VALUE}};',
107
+ ],
108
+ ]
109
+ );
110
+
111
+
112
+ $this->end_controls_section();
113
+
114
+ $this->start_controls_section(
115
+ 'section_button',
116
+ [
117
+ 'label' => __( 'Button', 'elementor' ),
118
+ ]
119
+ );
120
+ $this->add_control(
121
+ 'button_type',
122
+ [
123
+ 'label' => __( 'Type', 'elementor' ),
124
+ 'type' => Controls_Manager::SELECT,
125
+ 'default' => '',
126
+ 'options' => [
127
+ '' => __( 'Default', 'elementor' ),
128
+ 'info' => __( 'Info', 'elementor' ),
129
+ 'success' => __( 'Success', 'elementor' ),
130
+ 'warning' => __( 'Warning', 'elementor' ),
131
+ 'danger' => __( 'Danger', 'elementor' ),
132
+ ],
133
+ ]
134
+ );
135
+ $this->add_control(
136
+ 'text',
137
+ [
138
+ 'label' => __( 'Text', 'elementor' ),
139
+ 'type' => Controls_Manager::TEXT,
140
+ 'default' => __( 'Click me', 'elementor' ),
141
+ 'placeholder' => __( 'Click me', 'elementor' ),
142
+ ]
143
+ );
144
+ $this->add_responsive_control(
145
+ 'align',
146
+ [
147
+ 'label' => __( 'Alignment', 'elementor' ),
148
+ 'type' => Controls_Manager::CHOOSE,
149
+ 'options' => [
150
+ 'left' => [
151
+ 'title' => __( 'Left', 'elementor' ),
152
+ 'icon' => 'fa fa-align-left',
153
+ ],
154
+ 'center' => [
155
+ 'title' => __( 'Center', 'elementor' ),
156
+ 'icon' => 'fa fa-align-center',
157
+ ],
158
+ 'right' => [
159
+ 'title' => __( 'Right', 'elementor' ),
160
+ 'icon' => 'fa fa-align-right',
161
+ ],
162
+ 'justify' => [
163
+ 'title' => __( 'Justified', 'elementor' ),
164
+ 'icon' => 'fa fa-align-justify',
165
+ ],
166
+ ],
167
+ 'prefix_class' => 'elementor%s-align-',
168
+ 'default' => '',
169
+ ]
170
+ );
171
+ $this->add_control(
172
+ 'size',
173
+ [
174
+ 'label' => __( 'Size', 'elementor' ),
175
+ 'type' => Controls_Manager::SELECT,
176
+ 'default' => 'sm',
177
+ 'options' => self::get_button_sizes(),
178
+ ]
179
+ );
180
+ $this->add_control(
181
+ 'icon',
182
+ [
183
+ 'label' => __( 'Icon', 'elementor' ),
184
+ 'type' => Controls_Manager::ICON,
185
+ 'label_block' => true,
186
+ 'default' => '',
187
+ ]
188
+ );
189
+ $this->add_control(
190
+ 'icon_align',
191
+ [
192
+ 'label' => __( 'Icon Position', 'elementor' ),
193
+ 'type' => Controls_Manager::SELECT,
194
+ 'default' => 'left',
195
+ 'options' => [
196
+ 'left' => __( 'Before', 'elementor' ),
197
+ 'right' => __( 'After', 'elementor' ),
198
+ ],
199
+ 'condition' => [
200
+ 'icon!' => '',
201
+ ],
202
+ ]
203
+ );
204
+ $this->add_control(
205
+ 'icon_indent',
206
+ [
207
+ 'label' => __( 'Icon Spacing', 'elementor' ),
208
+ 'type' => Controls_Manager::SLIDER,
209
+ 'range' => [
210
+ 'px' => [
211
+ 'max' => 50,
212
+ ],
213
+ ],
214
+ 'condition' => [
215
+ 'icon!' => '',
216
+ ],
217
+ 'selectors' => [
218
+ '{{WRAPPER}} .elementor-button .elementor-align-icon-right' => 'margin-left: {{SIZE}}{{UNIT}};',
219
+ '{{WRAPPER}} .elementor-button .elementor-align-icon-left' => 'margin-right: {{SIZE}}{{UNIT}};',
220
+ ],
221
+ ]
222
+ );
223
+ $this->add_control(
224
+ 'view',
225
+ [
226
+ 'label' => __( 'View', 'elementor' ),
227
+ 'type' => Controls_Manager::HIDDEN,
228
+ 'default' => 'traditional',
229
+ ]
230
+ );
231
+ $this->end_controls_section();
232
+ $this->start_controls_section(
233
+ 'section_style',
234
+ [
235
+ 'label' => __( 'Button', 'elementor' ),
236
+ 'tab' => Controls_Manager::TAB_STYLE,
237
+ ]
238
+ );
239
+
240
+ $this->add_group_control(
241
+ Group_Control_Typography::get_type(),
242
+ [
243
+ 'name' => 'typography',
244
+ 'label' => __( 'Typography', 'elementor' ),
245
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
246
+ 'selector' => '{{WRAPPER}} a.elementor-button',
247
+ ]
248
+ );
249
+
250
+ $this->start_controls_tabs( 'tabs_button_style' );
251
+
252
+ $this->start_controls_tab(
253
+ 'tab_button_normal',
254
+ [
255
+ 'label' => __( 'Normal', 'elementor' ),
256
+ ]
257
+ );
258
+
259
+ $this->add_control(
260
+ 'button_text_color',
261
+ [
262
+ 'label' => __( 'Text Color', 'elementor' ),
263
+ 'type' => Controls_Manager::COLOR,
264
+ 'default' => '',
265
+ 'selectors' => [
266
+ '{{WRAPPER}} a.elementor-button' => 'color: {{VALUE}};',
267
+ ],
268
+ ]
269
+ );
270
+
271
+ $this->add_control(
272
+ 'background_color',
273
+ [
274
+ 'label' => __( 'Background Color', 'elementor' ),
275
+ 'type' => Controls_Manager::COLOR,
276
+ 'scheme' => [
277
+ 'type' => Scheme_Color::get_type(),
278
+ 'value' => Scheme_Color::COLOR_4,
279
+ ],
280
+ 'selectors' => [
281
+ '{{WRAPPER}} a.elementor-button' => 'background-color: {{VALUE}};',
282
+ ],
283
+ ]
284
+ );
285
+
286
+ $this->end_controls_tab();
287
+
288
+ $this->start_controls_tab(
289
+ 'tab_button_hover',
290
+ [
291
+ 'label' => __( 'Hover', 'elementor' ),
292
+ ]
293
+ );
294
+
295
+ $this->add_control(
296
+ 'hover_color',
297
+ [
298
+ 'label' => __( 'Text Color', 'elementor' ),
299
+ 'type' => Controls_Manager::COLOR,
300
+ 'selectors' => [
301
+ '{{WRAPPER}} a.elementor-button:hover' => 'color: {{VALUE}};',
302
+ ],
303
+ ]
304
+ );
305
+
306
+ $this->add_control(
307
+ 'button_background_hover_color',
308
+ [
309
+ 'label' => __( 'Background Color', 'elementor' ),
310
+ 'type' => Controls_Manager::COLOR,
311
+ 'selectors' => [
312
+ '{{WRAPPER}} a.elementor-button:hover' => 'background-color: {{VALUE}};',
313
+ ],
314
+ ]
315
+ );
316
+
317
+ $this->add_control(
318
+ 'button_hover_border_color',
319
+ [
320
+ 'label' => __( 'Border Color', 'elementor' ),
321
+ 'type' => Controls_Manager::COLOR,
322
+ 'condition' => [
323
+ 'border_border!' => '',
324
+ ],
325
+ 'selectors' => [
326
+ '{{WRAPPER}} a.elementor-button:hover' => 'border-color: {{VALUE}};',
327
+ ],
328
+ ]
329
+ );
330
+
331
+ $this->add_control(
332
+ 'hover_animation',
333
+ [
334
+ 'label' => __( 'Animation', 'elementor' ),
335
+ 'type' => Controls_Manager::HOVER_ANIMATION,
336
+ ]
337
+ );
338
+
339
+ $this->end_controls_tab();
340
+
341
+ $this->add_group_control(
342
+ Group_Control_Border::get_type(),
343
+ [
344
+ 'name' => 'border',
345
+ 'label' => __( 'Border', 'elementor' ),
346
+ 'placeholder' => '1px',
347
+ 'default' => '1px',
348
+ 'selector' => '{{WRAPPER}} .elementor-button',
349
+ ]
350
+ );
351
+
352
+ $this->add_control(
353
+ 'border_radius',
354
+ [
355
+ 'label' => __( 'Border Radius', 'elementor' ),
356
+ 'type' => Controls_Manager::DIMENSIONS,
357
+ 'size_units' => [ 'px', '%' ],
358
+ 'selectors' => [
359
+ '{{WRAPPER}} a.elementor-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
360
+ ],
361
+ ]
362
+ );
363
+
364
+ $this->add_group_control(
365
+ Group_Control_Box_Shadow::get_type(),
366
+ [
367
+ 'name' => 'button_box_shadow',
368
+ 'selector' => '{{WRAPPER}} .elementor-button',
369
+ ]
370
+ );
371
+
372
+ $this->add_control(
373
+ 'text_padding',
374
+ [
375
+ 'label' => __( 'Text Padding', 'elementor' ),
376
+ 'type' => Controls_Manager::DIMENSIONS,
377
+ 'size_units' => [ 'px', 'em', '%' ],
378
+ 'selectors' => [
379
+ '{{WRAPPER}} a.elementor-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
380
+ ],
381
+ 'separator' => 'before',
382
+ ]
383
+ );
384
+
385
+ $this->end_controls_section();
386
+
387
+ //Modal Container Optins Start Here
388
+ $this->start_controls_section(
389
+ 'modalstyle',
390
+ [
391
+ 'label' => __( 'Modal Container', 'elementor' ),
392
+ 'tab' => Controls_Manager::TAB_STYLE,
393
+ ]
394
+ );
395
+
396
+ $this->add_group_control(
397
+ Group_Control_Background::get_type(),
398
+ [
399
+ 'name' => 'modal_bgcolor',
400
+ 'types' => [ 'classic', 'gradient' ],
401
+ 'default' => 'rgba(0,0,0,0.7)',
402
+ 'selector' => '{{WRAPPER}} .modal',
403
+ ]
404
+ );
405
+
406
+ $this->end_controls_section();
407
+
408
+ $this->start_controls_section(
409
+ 'modalcontentstyle',
410
+ [
411
+ 'label' => __( 'Modal Content', 'elementor' ),
412
+ 'tab' => Controls_Manager::TAB_STYLE,
413
+ ]
414
+ );
415
+
416
+ $this->add_responsive_control(
417
+ 'modal_content_width',
418
+ [
419
+ 'label' => __( 'Modal Width', 'elementor' ),
420
+ 'type' => Controls_Manager::SLIDER,
421
+ 'default' => [
422
+ 'size' => 60,
423
+ 'unit' => '%',
424
+ ],
425
+ 'range' => [
426
+ 'px' => [
427
+ 'min' => 0,
428
+ 'max' => 1920,
429
+ 'step' => 1,
430
+ ],
431
+ '%' => [
432
+ 'min' => 25,
433
+ 'max' => 100,
434
+ ],
435
+ ],
436
+ 'size_units' => [ '%', 'px' ],
437
+ 'selectors' => [
438
+ '{{WRAPPER}} .modal-content' => 'width: {{SIZE}}{{UNIT}} !important;',
439
+ ],
440
+ ]
441
+ );
442
+
443
+ $this->add_responsive_control(
444
+ 'modal_content_max_width',
445
+ [
446
+ 'label' => __( 'Modal Max-Width', 'elementor' ),
447
+ 'type' => Controls_Manager::SLIDER,
448
+ 'default' => [
449
+ 'size' => 720,
450
+ 'unit' => 'px',
451
+ ],
452
+ 'range' => [
453
+ 'px' => [
454
+ 'min' => 0,
455
+ 'max' => 1920,
456
+ 'step' => 1,
457
+ ],
458
+ '%' => [
459
+ 'min' => 5,
460
+ 'max' => 100,
461
+ ],
462
+ ],
463
+ 'size_units' => [ '%', 'px' ],
464
+ 'selectors' => [
465
+ '{{WRAPPER}} .modal-content' => 'max-width: {{SIZE}}{{UNIT}} !important;',
466
+ ],
467
+ ]
468
+ );
469
+
470
+ $this->add_responsive_control(
471
+ 'modal_content_top',
472
+ [
473
+ 'label' => __( 'Top Distance', 'elementor' ),
474
+ 'type' => Controls_Manager::SLIDER,
475
+ 'default' => [
476
+ 'size' => 5,
477
+ 'unit' => '%',
478
+ ],
479
+ 'range' => [
480
+ 'px' => [
481
+ 'min' => 0,
482
+ 'max' => 1000,
483
+ 'step' => 1,
484
+ ],
485
+ '%' => [
486
+ 'min' => 0,
487
+ 'max' => 100,
488
+ ],
489
+ ],
490
+ 'size_units' => [ '%', 'px' ],
491
+ 'selectors' => [
492
+ '{{WRAPPER}} .modal-content' => 'margin-top: {{SIZE}}{{UNIT}};',
493
+ ],
494
+ ]
495
+ );
496
+
497
+ $this->add_responsive_control(
498
+ 'modal_content_padding',
499
+ [
500
+ 'label' => __( 'Padding', 'elementor' ),
501
+ 'type' => Controls_Manager::DIMENSIONS,
502
+ 'size_units' => [ 'px', '%', 'em' ],
503
+ 'default' => [
504
+ 'top' => 0,
505
+ 'left' => 0,
506
+ 'right' => 0,
507
+ 'bottom' => 0,
508
+ ],
509
+ 'selectors' => [
510
+ '{{WRAPPER}} .modal-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
511
+ ],
512
+ ]
513
+ );
514
+
515
+ $this->end_controls_section();
516
+
517
+
518
+
519
+ }
520
+ protected function render() {
521
+ $settings = $this->get_settings();
522
+
523
+ $selectedPopup = new WP_Query( array( 'p' => $settings['popup'], 'post_type' => 'elementor-popup' ) );
524
+ if ( $selectedPopup->have_posts() ) {
525
+
526
+ $selectedPopup->the_post();
527
+
528
+ $this->add_render_attribute( 'wrapper', 'class', 'elementor-button-wrapper' );
529
+ $this->add_render_attribute( 'button', 'class', 'elementor-button' );
530
+ if ( ! empty( $settings['size'] ) ) {
531
+ $this->add_render_attribute( 'button', 'class', 'elementor-size-' . $settings['size'] );
532
+ }
533
+ if ( ! empty( $settings['button_type'] ) ) {
534
+ $this->add_render_attribute( 'button', 'class', 'elementor-button-' . $settings['button_type'] );
535
+ }
536
+ if ( $settings['hover_animation'] ) {
537
+ $this->add_render_attribute( 'button', 'class', 'elementor-animation-' . $settings['hover_animation'] );
538
+ }
539
+ if ( ! empty( $selectedPopup->post->ID ) ) {
540
+ $this->add_render_attribute( 'button', 'data-target', '#popup-' . esc_attr($selectedPopup->post->ID) );
541
+ }
542
+ $this->add_render_attribute( 'button', 'class', 'modal-popup' );
543
+ $this->add_render_attribute( 'content-wrapper', 'class', 'elementor-button-content-wrapper' );
544
+ $this->add_render_attribute( 'icon-align', 'class', 'elementor-align-icon-' . $settings['icon_align'] );
545
+ $this->add_render_attribute( 'icon-align', 'class', 'elementor-button-icon' );
546
+ ?>
547
+ <!-- Popup trigger button -->
548
+ <div <?php echo $this->get_render_attribute_string( 'wrapper' ); ?>>
549
+ <a <?php echo $this->get_render_attribute_string( 'button' ); ?>>
550
+ <span <?php echo $this->get_render_attribute_string( 'content-wrapper' ); ?>>
551
+ <?php if ( ! empty( $settings['icon'] ) ) : ?>
552
+ <span <?php echo $this->get_render_attribute_string( 'icon-align' ); ?>>
553
+ <i class="<?php echo esc_attr( $settings['icon'] ); ?>"></i>
554
+ </span>
555
+ <?php endif; ?>
556
+ <span class="elementor-button-text"><?php echo $settings['text']; ?></span>
557
+ </span>
558
+ </a>
559
+ </div>
560
+ <!-- /Popup trigger button -->
561
+ <!-- Popup -->
562
+ <div class="modal fade" id="popup-<?php echo $selectedPopup->post->ID; ?>" tabindex="-1" role="dialog" aria-labelledby="popup-<?php echo $selectedPopup->post->ID; ?>-label">
563
+ <div class="modal-dialog" role="document">
564
+ <div class="modal-content">
565
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
566
+ <div class="modal-body">
567
+ <?php
568
+ $frontend = new Frontend;
569
+ echo $frontend->get_builder_content($selectedPopup->post->ID, true);
570
+ ?>
571
+ </div>
572
+ </div>
573
+ </div>
574
+ </div>
575
+ <?php
576
+ wp_reset_postdata();
577
+
578
+ }
579
+ }
580
+ protected function _content_template() {
581
+ ?>
582
+ <div class="elementor-button-wrapper">
583
+ <a class="elementor-button elementor-button-{{ settings.button_type }} elementor-size-{{ settings.size }} elementor-animation-{{ settings.hover_animation }}" href="#">
584
+ <span class="elementor-button-content-wrapper">
585
+ <# if ( settings.icon ) { #>
586
+ <span class="elementor-button-icon elementor-align-icon-{{ settings.icon_align }}">
587
+ <i class="{{ settings.icon }}"></i>
588
+ </span>
589
+ <# } #>
590
+ <span class="elementor-button-text">{{{ settings.text }}}</span>
591
+ </span>
592
+ </a>
593
+ </div>
594
+ <?php
595
+ }
596
+
597
+ }