Version Description
- New: Added Version Control tab to plugin settings including Version Rollback option and an option to enable beta versions updates.
- Tweak: Added Custom/Existing page link option for Premium Dual Heading Widget.
- Tweak: Changed Addons icons hover color.
Download this release
Release Info
Developer | leap13 |
Plugin | ![]() |
Version | 2.1.3 |
Comparing to | |
See all releases |
Code changes from version 2.1.2 to 2.1.3
- admin/assets/admin.css +75 -3
- admin/assets/admin.js +22 -1
- admin/assets/js/dialog/dialog.js +830 -0
- admin/assets/pa-elements-font/css/pa-elements.css +3 -0
- admin/settings-page.php +63 -17
- assets/images/premium-addons-logo.png +0 -0
- assets/js/lib/jquery.waypoints.js +502 -0
- includes/beta-testers.php +59 -0
- includes/maintenance.php +29 -0
- includes/rollback.php +80 -0
- premium-addons-for-elementor.php +15 -8
- readme.txt +6 -0
- widgets/premium-blog.php +1 -1
- widgets/premium-carousel.php +1 -1
- widgets/premium-countdown.php +1 -1
- widgets/premium-dual-header.php +74 -0
- widgets/premium-image-button.php +1 -1
- widgets/premium-imageseparator.php +1 -1
- widgets/premium-modalbox.php +1 -1
- widgets/premium-person.php +1 -1
- widgets/premium-pricing-table.php +1 -1
- widgets/premium-testimonials.php +1 -1
- widgets/premium-title.php +1 -1
- widgets/premium-videobox.php +1 -1
admin/assets/admin.css
CHANGED
@@ -190,7 +190,7 @@ li.ui-state-active a{
|
|
190 |
left: 0px;
|
191 |
bottom: 1.1px;
|
192 |
background: radial-gradient(farthest-corner at 14px 0px,
|
193 |
-
rgb(240,240,240) 50%, rgb(202,202,202) 100%)
|
194 |
-webkit-transition: .4s;
|
195 |
transition: .4s;
|
196 |
padding: 0;
|
@@ -233,10 +233,12 @@ input:checked + .slider:before {
|
|
233 |
display: inline-block;
|
234 |
margin: 0;
|
235 |
}
|
236 |
-
.pa-api-disable-title label
|
|
|
237 |
margin-right: 15px;
|
238 |
}
|
239 |
-
.pa-api-disable-title span
|
|
|
240 |
font-weight: normal;
|
241 |
}
|
242 |
.pa-maps-api-notice {
|
@@ -249,3 +251,73 @@ input:checked + .slider:before {
|
|
249 |
width: 400px;
|
250 |
margin-left: 30px;
|
251 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
left: 0px;
|
191 |
bottom: 1.1px;
|
192 |
background: radial-gradient(farthest-corner at 14px 0px,
|
193 |
+
rgb(240,240,240) 50%, rgb(202,202,202) 100%);
|
194 |
-webkit-transition: .4s;
|
195 |
transition: .4s;
|
196 |
padding: 0;
|
233 |
display: inline-block;
|
234 |
margin: 0;
|
235 |
}
|
236 |
+
.pa-api-disable-title label,
|
237 |
+
.pa-is-beta label{
|
238 |
margin-right: 15px;
|
239 |
}
|
240 |
+
.pa-api-disable-title span,
|
241 |
+
.pa-is-beta span{
|
242 |
font-weight: normal;
|
243 |
}
|
244 |
.pa-maps-api-notice {
|
251 |
width: 400px;
|
252 |
margin-left: 30px;
|
253 |
}
|
254 |
+
|
255 |
+
#pa-maintenance {
|
256 |
+
margin-top: 30px;
|
257 |
+
}
|
258 |
+
.pa-beta-table tr {
|
259 |
+
text-align: left;
|
260 |
+
}
|
261 |
+
.pa-roll-back,
|
262 |
+
.pa-beta-test{
|
263 |
+
text-align: left;
|
264 |
+
font-size: 20px;
|
265 |
+
font-weight: normal;
|
266 |
+
margin-top: 15px;
|
267 |
+
margin-bottom: 10px;
|
268 |
+
}
|
269 |
+
.pa-beta-test {
|
270 |
+
margin-top: 0;
|
271 |
+
}
|
272 |
+
.pa-roll-back-span,
|
273 |
+
.pa-beta-test-span{
|
274 |
+
line-height: 22px;
|
275 |
+
color: #444;
|
276 |
+
font-size: 13px;
|
277 |
+
margin: 0;
|
278 |
+
font-weight: normal;
|
279 |
+
}
|
280 |
+
.pa-roll-row,
|
281 |
+
.pa-beta-row{
|
282 |
+
float: left;
|
283 |
+
}
|
284 |
+
.pa-beta-row{
|
285 |
+
margin-top: 13px;
|
286 |
+
}
|
287 |
+
.pa-roll-row th,
|
288 |
+
.pa-beta-row th{
|
289 |
+
vertical-align: top;
|
290 |
+
text-align: left;
|
291 |
+
padding: 20px 10px 20px 0;
|
292 |
+
width: 200px;
|
293 |
+
line-height: 1.3;
|
294 |
+
}
|
295 |
+
.pa-roll-row td{
|
296 |
+
padding: 15px 10px;
|
297 |
+
}
|
298 |
+
.pa-beta-row td{
|
299 |
+
padding: 22px 10px;
|
300 |
+
}
|
301 |
+
.pa-roll-row .pa-rollback-button {
|
302 |
+
box-shadow: 0 1px 0 #ccc;
|
303 |
+
color: #555;
|
304 |
+
border: 1px solid #ccc;
|
305 |
+
background: #f7f7f7;
|
306 |
+
vertical-align: top;
|
307 |
+
margin: 0;
|
308 |
+
padding: 0 10px 1px;
|
309 |
+
}
|
310 |
+
.pa-roll-row .pa-rollback-button:hover {
|
311 |
+
background: #fafafa;
|
312 |
+
border-color: #999;
|
313 |
+
color: #23282d;
|
314 |
+
}
|
315 |
+
.pa-roll-row .pa-roll-desc{
|
316 |
+
font-style: italic;
|
317 |
+
color: red;
|
318 |
+
margin-top: 4px;
|
319 |
+
}
|
320 |
+
.pa-beta-row .pa-beta-desc{
|
321 |
+
font-style: italic;
|
322 |
+
margin-top: 4px;
|
323 |
+
}
|
admin/assets/admin.js
CHANGED
@@ -18,7 +18,6 @@
|
|
18 |
}
|
19 |
});
|
20 |
|
21 |
-
|
22 |
$( 'form#pa-settings' ).on( 'submit', function(e) {
|
23 |
e.preventDefault();
|
24 |
$.ajax( {
|
@@ -45,4 +44,26 @@
|
|
45 |
|
46 |
} );
|
47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
} )(jQuery);
|
18 |
}
|
19 |
});
|
20 |
|
|
|
21 |
$( 'form#pa-settings' ).on( 'submit', function(e) {
|
22 |
e.preventDefault();
|
23 |
$.ajax( {
|
44 |
|
45 |
} );
|
46 |
|
47 |
+
|
48 |
+
$( '.pa-rollback-button' ).on( 'click', function( event ) {
|
49 |
+
event.preventDefault();
|
50 |
+
|
51 |
+
var $this = $( this ),
|
52 |
+
dialogsManager = new DialogsManager.Instance();
|
53 |
+
|
54 |
+
dialogsManager.createWidget( 'confirm', {
|
55 |
+
headerMessage: premiumRollBackConfirm.i18n.rollback_to_previous_version,
|
56 |
+
message: premiumRollBackConfirm.i18n.rollback_confirm,
|
57 |
+
strings: {
|
58 |
+
cancel: premiumRollBackConfirm.i18n.cancel,
|
59 |
+
confirm: premiumRollBackConfirm.i18n.yes,
|
60 |
+
},
|
61 |
+
onConfirm: function() {
|
62 |
+
$this.addClass( 'loading' );
|
63 |
+
|
64 |
+
location.href = $this.attr( 'href' );
|
65 |
+
}
|
66 |
+
} ).show();
|
67 |
+
} );
|
68 |
+
|
69 |
} )(jQuery);
|
admin/assets/js/dialog/dialog.js
ADDED
@@ -0,0 +1,830 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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+
* Released under the MIT license
|
7 |
+
* https://github.com/kobizz/dialogs-manager/blob/master/LICENSE.txt
|
8 |
+
*/
|
9 |
+
|
10 |
+
(function ($, global) {
|
11 |
+
'use strict';
|
12 |
+
|
13 |
+
/*
|
14 |
+
* Dialog Manager
|
15 |
+
*/
|
16 |
+
var DialogsManager = {
|
17 |
+
widgetsTypes: {},
|
18 |
+
createWidgetType: function (typeName, properties, Parent) {
|
19 |
+
|
20 |
+
if (!Parent) {
|
21 |
+
Parent = this.Widget;
|
22 |
+
}
|
23 |
+
|
24 |
+
var WidgetType = function () {
|
25 |
+
|
26 |
+
Parent.apply(this, arguments);
|
27 |
+
};
|
28 |
+
|
29 |
+
var prototype = WidgetType.prototype = new Parent(typeName);
|
30 |
+
|
31 |
+
prototype.types = prototype.types.concat([typeName]);
|
32 |
+
|
33 |
+
$.extend(prototype, properties);
|
34 |
+
|
35 |
+
prototype.constructor = WidgetType;
|
36 |
+
|
37 |
+
WidgetType.extend = function (typeName, properties) {
|
38 |
+
|
39 |
+
return DialogsManager.createWidgetType(typeName, properties, WidgetType);
|
40 |
+
};
|
41 |
+
|
42 |
+
return WidgetType;
|
43 |
+
},
|
44 |
+
addWidgetType: function (typeName, properties, Parent) {
|
45 |
+
|
46 |
+
if (properties && properties.prototype instanceof this.Widget) {
|
47 |
+
return this.widgetsTypes[typeName] = properties;
|
48 |
+
}
|
49 |
+
|
50 |
+
return this.widgetsTypes[typeName] = this.createWidgetType(typeName, properties, Parent);
|
51 |
+
},
|
52 |
+
getWidgetType: function (widgetType) {
|
53 |
+
|
54 |
+
return this.widgetsTypes[widgetType];
|
55 |
+
}
|
56 |
+
};
|
57 |
+
|
58 |
+
/*
|
59 |
+
* Dialog Manager instances constructor
|
60 |
+
*/
|
61 |
+
DialogsManager.Instance = function () {
|
62 |
+
|
63 |
+
var self = this,
|
64 |
+
elements = {},
|
65 |
+
settings = {};
|
66 |
+
|
67 |
+
var initElements = function () {
|
68 |
+
|
69 |
+
elements.body = $('body');
|
70 |
+
};
|
71 |
+
|
72 |
+
var initSettings = function (options) {
|
73 |
+
|
74 |
+
var defaultSettings = {
|
75 |
+
classPrefix: 'dialog',
|
76 |
+
effects: {
|
77 |
+
show: 'fadeIn',
|
78 |
+
hide: 'fadeOut'
|
79 |
+
}
|
80 |
+
};
|
81 |
+
|
82 |
+
$.extend(settings, defaultSettings, options);
|
83 |
+
};
|
84 |
+
|
85 |
+
this.createWidget = function (widgetType, properties) {
|
86 |
+
|
87 |
+
var WidgetTypeConstructor = DialogsManager.getWidgetType(widgetType),
|
88 |
+
widget = new WidgetTypeConstructor(widgetType);
|
89 |
+
|
90 |
+
properties = properties || {};
|
91 |
+
|
92 |
+
widget.init(self, properties);
|
93 |
+
|
94 |
+
widget.setMessage(properties.message);
|
95 |
+
|
96 |
+
return widget;
|
97 |
+
};
|
98 |
+
|
99 |
+
this.getSettings = function (property) {
|
100 |
+
|
101 |
+
if (property) {
|
102 |
+
return settings[property];
|
103 |
+
}
|
104 |
+
|
105 |
+
return Object.create(settings);
|
106 |
+
};
|
107 |
+
|
108 |
+
this.init = function (settings) {
|
109 |
+
|
110 |
+
initSettings(settings);
|
111 |
+
|
112 |
+
initElements();
|
113 |
+
|
114 |
+
return self;
|
115 |
+
};
|
116 |
+
|
117 |
+
self.init();
|
118 |
+
};
|
119 |
+
|
120 |
+
/*
|
121 |
+
* Widget types constructor
|
122 |
+
*/
|
123 |
+
DialogsManager.Widget = function (widgetName) {
|
124 |
+
|
125 |
+
var self = this,
|
126 |
+
settings = {},
|
127 |
+
events = {},
|
128 |
+
elements = {},
|
129 |
+
hideTimeOut = 0,
|
130 |
+
baseClosureMethods = ['refreshPosition'];
|
131 |
+
|
132 |
+
var bindEvents = function () {
|
133 |
+
|
134 |
+
elements.window.on('keyup', onWindowKeyUp);
|
135 |
+
|
136 |
+
if (settings.hide.onOutsideClick) {
|
137 |
+
elements.window[0].addEventListener('click', hideOnOutsideClick, true);
|
138 |
+
}
|
139 |
+
|
140 |
+
if (settings.hide.onClick || settings.hide.onBackgroundClick) {
|
141 |
+
elements.widget.on('click', hideOnClick);
|
142 |
+
}
|
143 |
+
|
144 |
+
if (settings.position.autoRefresh) {
|
145 |
+
elements.window.on('resize', self.refreshPosition);
|
146 |
+
}
|
147 |
+
};
|
148 |
+
|
149 |
+
var callEffect = function (intent, params) {
|
150 |
+
|
151 |
+
var effect = settings.effects[intent],
|
152 |
+
$widget = elements.widget;
|
153 |
+
|
154 |
+
if ($.isFunction(effect)) {
|
155 |
+
effect.apply($widget, params);
|
156 |
+
}
|
157 |
+
else {
|
158 |
+
|
159 |
+
if ($widget[effect]) {
|
160 |
+
$widget[effect].apply($widget, params);
|
161 |
+
}
|
162 |
+
else {
|
163 |
+
throw 'Reference Error: The effect ' + effect + ' not found';
|
164 |
+
}
|
165 |
+
}
|
166 |
+
};
|
167 |
+
|
168 |
+
var ensureClosureMethods = function() {
|
169 |
+
|
170 |
+
var closureMethodsNames = baseClosureMethods.concat(self.getClosureMethods());
|
171 |
+
|
172 |
+
$.each(closureMethodsNames, function () {
|
173 |
+
|
174 |
+
var methodName = this,
|
175 |
+
oldMethod = self[methodName];
|
176 |
+
|
177 |
+
self[methodName] = function () {
|
178 |
+
|
179 |
+
oldMethod.apply(self, arguments);
|
180 |
+
};
|
181 |
+
});
|
182 |
+
};
|
183 |
+
|
184 |
+
var initElements = function () {
|
185 |
+
|
186 |
+
self.addElement('widget');
|
187 |
+
|
188 |
+
self.addElement('message');
|
189 |
+
|
190 |
+
self.addElement('window', window);
|
191 |
+
|
192 |
+
self.addElement('container', settings.container);
|
193 |
+
|
194 |
+
var id = self.getSettings('id');
|
195 |
+
|
196 |
+
if (id) {
|
197 |
+
self.setID(id);
|
198 |
+
}
|
199 |
+
|
200 |
+
var classes = [];
|
201 |
+
|
202 |
+
$.each(self.types, function() {
|
203 |
+
classes.push(settings.classes.globalPrefix + '-type-' + this);
|
204 |
+
});
|
205 |
+
|
206 |
+
classes.push(self.getSettings('className'));
|
207 |
+
|
208 |
+
self.getElements('widget').addClass(classes.join(' '));
|
209 |
+
};
|
210 |
+
|
211 |
+
var initSettings = function (parent, userSettings) {
|
212 |
+
|
213 |
+
var parentSettings = $.extend(true, {}, parent.getSettings());
|
214 |
+
|
215 |
+
settings = {
|
216 |
+
effects: parentSettings.effects,
|
217 |
+
classes: {
|
218 |
+
globalPrefix: parentSettings.classPrefix,
|
219 |
+
prefix: parentSettings.classPrefix + '-' + widgetName
|
220 |
+
},
|
221 |
+
selectors: {
|
222 |
+
preventClose: '.' + parentSettings.classPrefix + '-prevent-close'
|
223 |
+
},
|
224 |
+
container: 'body',
|
225 |
+
position: {
|
226 |
+
element: 'widget',
|
227 |
+
my: 'center',
|
228 |
+
at: 'center',
|
229 |
+
of: 'container',
|
230 |
+
enable: true,
|
231 |
+
autoRefresh: false
|
232 |
+
},
|
233 |
+
hide: {
|
234 |
+
auto: false,
|
235 |
+
autoDelay: 5000,
|
236 |
+
onClick: false,
|
237 |
+
onOutsideClick: true,
|
238 |
+
onBackgroundClick: true
|
239 |
+
}
|
240 |
+
};
|
241 |
+
|
242 |
+
$.extend(true, settings, self.getDefaultSettings(), userSettings);
|
243 |
+
|
244 |
+
initSettingsEvents();
|
245 |
+
};
|
246 |
+
|
247 |
+
var initSettingsEvents = function () {
|
248 |
+
|
249 |
+
$.each(settings, function (settingKey) {
|
250 |
+
|
251 |
+
var eventName = settingKey.match(/^on([A-Z].*)/);
|
252 |
+
|
253 |
+
if (!eventName) {
|
254 |
+
return;
|
255 |
+
}
|
256 |
+
|
257 |
+
eventName = eventName[1].charAt(0).toLowerCase() + eventName[1].slice(1);
|
258 |
+
|
259 |
+
self.on(eventName, this);
|
260 |
+
});
|
261 |
+
};
|
262 |
+
|
263 |
+
var normalizeClassName = function (name) {
|
264 |
+
|
265 |
+
return name.replace(/([a-z])([A-Z])/g, function () {
|
266 |
+
|
267 |
+
return arguments[1] + '-' + arguments[2].toLowerCase();
|
268 |
+
});
|
269 |
+
};
|
270 |
+
|
271 |
+
var hideOnClick = function(event) {
|
272 |
+
|
273 |
+
if (settings.hide.onClick) {
|
274 |
+
|
275 |
+
if ($(event.target).closest(settings.selectors.preventClose).length) {
|
276 |
+
return;
|
277 |
+
}
|
278 |
+
} else if (event.target !== this) {
|
279 |
+
return;
|
280 |
+
}
|
281 |
+
|
282 |
+
self.hide();
|
283 |
+
};
|
284 |
+
|
285 |
+
var hideOnOutsideClick = function(event) {
|
286 |
+
if ($(event.target).closest(elements.widget).length) {
|
287 |
+
return;
|
288 |
+
}
|
289 |
+
|
290 |
+
self.hide();
|
291 |
+
};
|
292 |
+
|
293 |
+
var onWindowKeyUp = function(event) {
|
294 |
+
var ESC_KEY = 27,
|
295 |
+
keyCode = event.which;
|
296 |
+
|
297 |
+
if (ESC_KEY === keyCode) {
|
298 |
+
self.hide();
|
299 |
+
}
|
300 |
+
};
|
301 |
+
|
302 |
+
var unbindEvents = function() {
|
303 |
+
|
304 |
+
elements.window.off('keyup', onWindowKeyUp);
|
305 |
+
|
306 |
+
if (settings.hide.onOutsideClick) {
|
307 |
+
elements.window[0].removeEventListener('click', hideOnOutsideClick, true);
|
308 |
+
}
|
309 |
+
|
310 |
+
if (settings.hide.onClick || settings.hide.onBackgroundClick) {
|
311 |
+
elements.widget.off('click', hideOnClick);
|
312 |
+
}
|
313 |
+
|
314 |
+
if (settings.position.autoRefresh) {
|
315 |
+
elements.window.off('resize', self.refreshPosition);
|
316 |
+
}
|
317 |
+
};
|
318 |
+
|
319 |
+
this.addElement = function (name, element, type) {
|
320 |
+
|
321 |
+
var $newElement = elements[name] = $(element || '<div>'),
|
322 |
+
normalizedName = normalizeClassName(name),
|
323 |
+
className = [];
|
324 |
+
|
325 |
+
if (type) {
|
326 |
+
className.push(settings.classes.globalPrefix + '-' + type);
|
327 |
+
}
|
328 |
+
|
329 |
+
className.push(settings.classes.globalPrefix + '-' + normalizedName);
|
330 |
+
|
331 |
+
className.push(settings.classes.prefix + '-' + normalizedName);
|
332 |
+
|
333 |
+
$newElement.addClass(className.join(' '));
|
334 |
+
|
335 |
+
return $newElement;
|
336 |
+
};
|
337 |
+
|
338 |
+
this.getSettings = function (setting) {
|
339 |
+
|
340 |
+
var copy = Object.create(settings);
|
341 |
+
|
342 |
+
if (setting) {
|
343 |
+
return copy[setting];
|
344 |
+
}
|
345 |
+
|
346 |
+
return copy;
|
347 |
+
};
|
348 |
+
|
349 |
+
this.init = function (parent, properties) {
|
350 |
+
|
351 |
+
if (!(parent instanceof DialogsManager.Instance)) {
|
352 |
+
throw 'The ' + self.widgetName + ' must to be initialized from an instance of DialogsManager.Instance';
|
353 |
+
}
|
354 |
+
|
355 |
+
ensureClosureMethods();
|
356 |
+
|
357 |
+
self.trigger('init', properties);
|
358 |
+
|
359 |
+
initSettings(parent, properties);
|
360 |
+
|
361 |
+
initElements();
|
362 |
+
|
363 |
+
self.buildWidget();
|
364 |
+
|
365 |
+
if (self.attachEvents) {
|
366 |
+
self.attachEvents();
|
367 |
+
}
|
368 |
+
|
369 |
+
self.trigger('ready');
|
370 |
+
|
371 |
+
return self;
|
372 |
+
};
|
373 |
+
|
374 |
+
this.getElements = function (item) {
|
375 |
+
|
376 |
+
return item ? elements[item] : elements;
|
377 |
+
};
|
378 |
+
|
379 |
+
this.hide = function () {
|
380 |
+
|
381 |
+
clearTimeout(hideTimeOut);
|
382 |
+
|
383 |
+
callEffect('hide', arguments);
|
384 |
+
|
385 |
+
unbindEvents();
|
386 |
+
|
387 |
+
self.trigger('hide');
|
388 |
+
|
389 |
+
return self;
|
390 |
+
};
|
391 |
+
|
392 |
+
this.isVisible = function() {
|
393 |
+
|
394 |
+
return elements.widget.is(':visible');
|
395 |
+
};
|
396 |
+
|
397 |
+
this.on = function (eventName, callback) {
|
398 |
+
|
399 |
+
if ('object' === typeof eventName) {
|
400 |
+
$.each(eventName, function(singleEventName) {
|
401 |
+
self.on(singleEventName, this);
|
402 |
+
});
|
403 |
+
|
404 |
+
return self;
|
405 |
+
}
|
406 |
+
|
407 |
+
var eventNames = eventName.split(' ');
|
408 |
+
|
409 |
+
eventNames.forEach(function(singleEventName) {
|
410 |
+
if (! events[singleEventName]) {
|
411 |
+
events[singleEventName] = [];
|
412 |
+
}
|
413 |
+
|
414 |
+
events[singleEventName].push(callback);
|
415 |
+
});
|
416 |
+
|
417 |
+
return self;
|
418 |
+
};
|
419 |
+
|
420 |
+
this.setMessage = function (message) {
|
421 |
+
|
422 |
+
elements.message.html(message);
|
423 |
+
|
424 |
+
return self;
|
425 |
+
};
|
426 |
+
|
427 |
+
this.setID = function (id) {
|
428 |
+
|
429 |
+
self.getElements('widget').attr('id', id);
|
430 |
+
|
431 |
+
return self;
|
432 |
+
};
|
433 |
+
|
434 |
+
this.setSettings = function(key, value) {
|
435 |
+
|
436 |
+
if ('object' === typeof value) {
|
437 |
+
$.extend(true, settings[key], value);
|
438 |
+
} else {
|
439 |
+
settings[key] = value;
|
440 |
+
}
|
441 |
+
|
442 |
+
return self;
|
443 |
+
};
|
444 |
+
|
445 |
+
this.show = function () {
|
446 |
+
|
447 |
+
clearTimeout(hideTimeOut);
|
448 |
+
|
449 |
+
elements.widget.appendTo(elements.container).hide();
|
450 |
+
|
451 |
+
callEffect('show', arguments);
|
452 |
+
|
453 |
+
self.refreshPosition();
|
454 |
+
|
455 |
+
if (settings.hide.auto) {
|
456 |
+
hideTimeOut = setTimeout(self.hide, settings.hide.autoDelay);
|
457 |
+
}
|
458 |
+
|
459 |
+
bindEvents();
|
460 |
+
|
461 |
+
self.trigger('show');
|
462 |
+
|
463 |
+
return self;
|
464 |
+
};
|
465 |
+
|
466 |
+
this.refreshPosition = function () {
|
467 |
+
|
468 |
+
if (! settings.position.enable) {
|
469 |
+
return;
|
470 |
+
}
|
471 |
+
|
472 |
+
var position = $.extend({}, settings.position);
|
473 |
+
|
474 |
+
if (elements[position.of]) {
|
475 |
+
position.of = elements[position.of];
|
476 |
+
}
|
477 |
+
|
478 |
+
elements[position.element].position(position);
|
479 |
+
};
|
480 |
+
|
481 |
+
this.trigger = function (eventName, params) {
|
482 |
+
|
483 |
+
var methodName = 'on' + eventName[0].toUpperCase() + eventName.slice(1);
|
484 |
+
|
485 |
+
if (self[methodName]) {
|
486 |
+
self[methodName](params);
|
487 |
+
}
|
488 |
+
|
489 |
+
var callbacks = events[eventName];
|
490 |
+
|
491 |
+
if (!callbacks) {
|
492 |
+
return;
|
493 |
+
}
|
494 |
+
|
495 |
+
$.each(callbacks, function (index, callback) {
|
496 |
+
|
497 |
+
callback.call(self, params);
|
498 |
+
});
|
499 |
+
|
500 |
+
return self;
|
501 |
+
};
|
502 |
+
|
503 |
+
this.destroy = function() {
|
504 |
+
|
505 |
+
unbindEvents();
|
506 |
+
|
507 |
+
elements.widget.remove();
|
508 |
+
|
509 |
+
self.trigger('destroy');
|
510 |
+
|
511 |
+
return self;
|
512 |
+
};
|
513 |
+
};
|
514 |
+
|
515 |
+
DialogsManager.Widget.prototype.types = [];
|
516 |
+
|
517 |
+
// Inheritable widget methods
|
518 |
+
DialogsManager.Widget.prototype.buildWidget = function () {
|
519 |
+
|
520 |
+
var elements = this.getElements();
|
521 |
+
|
522 |
+
elements.widget.html(elements.message);
|
523 |
+
};
|
524 |
+
|
525 |
+
DialogsManager.Widget.prototype.getDefaultSettings = function () {
|
526 |
+
|
527 |
+
return {};
|
528 |
+
};
|
529 |
+
|
530 |
+
DialogsManager.Widget.prototype.getClosureMethods = function() {
|
531 |
+
|
532 |
+
return [];
|
533 |
+
};
|
534 |
+
|
535 |
+
DialogsManager.Widget.prototype.onHide = function () {
|
536 |
+
};
|
537 |
+
|
538 |
+
DialogsManager.Widget.prototype.onShow = function () {
|
539 |
+
};
|
540 |
+
|
541 |
+
DialogsManager.Widget.prototype.onInit = function () {
|
542 |
+
};
|
543 |
+
|
544 |
+
DialogsManager.Widget.prototype.onReady = function () {
|
545 |
+
};
|
546 |
+
|
547 |
+
DialogsManager.widgetsTypes.simple = DialogsManager.Widget;
|
548 |
+
|
549 |
+
DialogsManager.addWidgetType('buttons', {
|
550 |
+
activeKeyUp: function (event) {
|
551 |
+
|
552 |
+
var TAB_KEY = 9;
|
553 |
+
|
554 |
+
if (event.which === TAB_KEY) {
|
555 |
+
event.preventDefault();
|
556 |
+
}
|
557 |
+
|
558 |
+
if (this.hotKeys[event.which]) {
|
559 |
+
this.hotKeys[event.which](this);
|
560 |
+
}
|
561 |
+
},
|
562 |
+
activeKeyDown: function (event) {
|
563 |
+
|
564 |
+
var TAB_KEY = 9;
|
565 |
+
|
566 |
+
if (event.which === TAB_KEY) {
|
567 |
+
event.preventDefault();
|
568 |
+
|
569 |
+
var currentButtonIndex = this.focusedButton.index(),
|
570 |
+
nextButtonIndex;
|
571 |
+
|
572 |
+
if (event.shiftKey) {
|
573 |
+
|
574 |
+
nextButtonIndex = currentButtonIndex - 1;
|
575 |
+
|
576 |
+
if (nextButtonIndex < 0) {
|
577 |
+
nextButtonIndex = this.buttons.length - 1;
|
578 |
+
}
|
579 |
+
} else {
|
580 |
+
|
581 |
+
nextButtonIndex = currentButtonIndex + 1;
|
582 |
+
|
583 |
+
if (nextButtonIndex >= this.buttons.length) {
|
584 |
+
nextButtonIndex = 0;
|
585 |
+
}
|
586 |
+
}
|
587 |
+
|
588 |
+
this.focusedButton = this.buttons[nextButtonIndex].focus();
|
589 |
+
}
|
590 |
+
},
|
591 |
+
addButton: function (options) {
|
592 |
+
|
593 |
+
var self = this,
|
594 |
+
$button = self.addElement(options.name, $('<' + this.getSettings('buttonTag') + '>').text(options.text), 'button');
|
595 |
+
|
596 |
+
self.buttons.push($button);
|
597 |
+
|
598 |
+
var buttonFn = function () {
|
599 |
+
|
600 |
+
if (self.getSettings('hide').onButtonClick) {
|
601 |
+
self.hide();
|
602 |
+
}
|
603 |
+
|
604 |
+
if ($.isFunction(options.callback)) {
|
605 |
+
options.callback.call(this, self);
|
606 |
+
}
|
607 |
+
};
|
608 |
+
|
609 |
+
$button.on('click', buttonFn);
|
610 |
+
|
611 |
+
if (options.hotKey) {
|
612 |
+
this.hotKeys[options.hotKey] = buttonFn;
|
613 |
+
}
|
614 |
+
|
615 |
+
this.getElements('buttonsWrapper').append($button);
|
616 |
+
|
617 |
+
if (options.focus) {
|
618 |
+
this.focusedButton = $button;
|
619 |
+
}
|
620 |
+
|
621 |
+
return self;
|
622 |
+
},
|
623 |
+
bindHotKeys: function () {
|
624 |
+
|
625 |
+
this.getElements('window').on({
|
626 |
+
keyup: this.activeKeyUp,
|
627 |
+
keydown: this.activeKeyDown
|
628 |
+
});
|
629 |
+
},
|
630 |
+
buildWidget: function () {
|
631 |
+
|
632 |
+
DialogsManager.Widget.prototype.buildWidget.apply(this, arguments);
|
633 |
+
|
634 |
+
var $buttonsWrapper = this.addElement('buttonsWrapper');
|
635 |
+
|
636 |
+
this.getElements('widget').append($buttonsWrapper);
|
637 |
+
},
|
638 |
+
getClosureMethods: function () {
|
639 |
+
|
640 |
+
return [
|
641 |
+
'activeKeyUp',
|
642 |
+
'activeKeyDown'
|
643 |
+
];
|
644 |
+
},
|
645 |
+
getDefaultSettings: function () {
|
646 |
+
|
647 |
+
return {
|
648 |
+
hide: {
|
649 |
+
onButtonClick: true
|
650 |
+
},
|
651 |
+
buttonTag: 'button'
|
652 |
+
};
|
653 |
+
},
|
654 |
+
onHide: function () {
|
655 |
+
|
656 |
+
this.unbindHotKeys();
|
657 |
+
},
|
658 |
+
onInit: function () {
|
659 |
+
|
660 |
+
this.buttons = [];
|
661 |
+
|
662 |
+
this.hotKeys = {};
|
663 |
+
|
664 |
+
this.focusedButton = null;
|
665 |
+
},
|
666 |
+
onShow: function () {
|
667 |
+
|
668 |
+
this.bindHotKeys();
|
669 |
+
|
670 |
+
if (!this.focusedButton) {
|
671 |
+
this.focusedButton = this.buttons[0];
|
672 |
+
}
|
673 |
+
|
674 |
+
if (this.focusedButton) {
|
675 |
+
this.focusedButton.focus();
|
676 |
+
}
|
677 |
+
},
|
678 |
+
unbindHotKeys: function () {
|
679 |
+
|
680 |
+
this.getElements('window').off({
|
681 |
+
keyup: this.activeKeyUp,
|
682 |
+
keydown: this.activeKeyDown
|
683 |
+
});
|
684 |
+
}
|
685 |
+
});
|
686 |
+
|
687 |
+
DialogsManager.addWidgetType('lightbox', DialogsManager.getWidgetType('buttons').extend('lightbox', {
|
688 |
+
getDefaultSettings: function () {
|
689 |
+
|
690 |
+
var settings = DialogsManager.getWidgetType('buttons').prototype.getDefaultSettings.apply(this, arguments);
|
691 |
+
|
692 |
+
return $.extend(true, settings, {
|
693 |
+
headerMessage: '',
|
694 |
+
contentWidth: 'auto',
|
695 |
+
contentHeight: 'auto',
|
696 |
+
closeButton: false,
|
697 |
+
closeButtonClass: 'fa fa-times',
|
698 |
+
position: {
|
699 |
+
element: 'widgetContent',
|
700 |
+
of: 'widget',
|
701 |
+
autoRefresh: true
|
702 |
+
}
|
703 |
+
});
|
704 |
+
},
|
705 |
+
buildWidget: function () {
|
706 |
+
|
707 |
+
DialogsManager.getWidgetType('buttons').prototype.buildWidget.apply(this, arguments);
|
708 |
+
|
709 |
+
var $widgetHeader = this.addElement('widgetHeader'),
|
710 |
+
$widgetContent = this.addElement('widgetContent');
|
711 |
+
|
712 |
+
var elements = this.getElements();
|
713 |
+
|
714 |
+
$widgetContent.append($widgetHeader, elements.message, elements.buttonsWrapper);
|
715 |
+
|
716 |
+
elements.widget.html($widgetContent);
|
717 |
+
|
718 |
+
if (! this.getSettings('closeButton')) {
|
719 |
+
return;
|
720 |
+
}
|
721 |
+
|
722 |
+
var $closeButton = this.addElement('closeButton', '<div><i class="' + this.getSettings('closeButtonClass') + '"></i></div>');
|
723 |
+
|
724 |
+
$widgetContent.prepend($closeButton);
|
725 |
+
},
|
726 |
+
attachEvents: function() {
|
727 |
+
if (this.getSettings('closeButton')) {
|
728 |
+
this.getElements('closeButton').on('click', this.hide);
|
729 |
+
}
|
730 |
+
},
|
731 |
+
onReady: function(){
|
732 |
+
|
733 |
+
var elements = this.getElements(),
|
734 |
+
settings = this.getSettings();
|
735 |
+
|
736 |
+
if ('auto' !== settings.contentWidth) {
|
737 |
+
elements.message.width(settings.contentWidth);
|
738 |
+
}
|
739 |
+
|
740 |
+
if ('auto' !== settings.contentHeight) {
|
741 |
+
elements.message.height(settings.contentHeight);
|
742 |
+
}
|
743 |
+
|
744 |
+
this.setHeaderMessage(settings.headerMessage);
|
745 |
+
},
|
746 |
+
setHeaderMessage: function (message) {
|
747 |
+
|
748 |
+
this.getElements('widgetHeader').html(message);
|
749 |
+
|
750 |
+
return this;
|
751 |
+
}
|
752 |
+
}));
|
753 |
+
|
754 |
+
DialogsManager.addWidgetType('confirm', DialogsManager.getWidgetType('lightbox').extend('confirm', {
|
755 |
+
onReady: function () {
|
756 |
+
|
757 |
+
DialogsManager.getWidgetType('lightbox').prototype.onReady.apply(this, arguments);
|
758 |
+
|
759 |
+
var strings = this.getSettings('strings'),
|
760 |
+
isDefaultCancel = this.getSettings('defaultOption') === 'cancel';
|
761 |
+
|
762 |
+
this.addButton({
|
763 |
+
name: 'cancel',
|
764 |
+
text: strings.cancel,
|
765 |
+
callback: function (widget) {
|
766 |
+
|
767 |
+
widget.trigger('cancel');
|
768 |
+
},
|
769 |
+
focus: isDefaultCancel
|
770 |
+
});
|
771 |
+
|
772 |
+
this.addButton({
|
773 |
+
name: 'ok',
|
774 |
+
text: strings.confirm,
|
775 |
+
callback: function (widget) {
|
776 |
+
|
777 |
+
widget.trigger('confirm');
|
778 |
+
},
|
779 |
+
focus: !isDefaultCancel
|
780 |
+
});
|
781 |
+
},
|
782 |
+
getDefaultSettings: function () {
|
783 |
+
|
784 |
+
var settings = DialogsManager.getWidgetType('lightbox').prototype.getDefaultSettings.apply(this, arguments);
|
785 |
+
|
786 |
+
settings.strings = {
|
787 |
+
confirm: 'OK',
|
788 |
+
cancel: 'Cancel'
|
789 |
+
};
|
790 |
+
|
791 |
+
settings.defaultOption = 'cancel';
|
792 |
+
|
793 |
+
return settings;
|
794 |
+
}
|
795 |
+
}));
|
796 |
+
|
797 |
+
DialogsManager.addWidgetType('alert', DialogsManager.getWidgetType('lightbox').extend('alert', {
|
798 |
+
onReady: function () {
|
799 |
+
|
800 |
+
DialogsManager.getWidgetType('lightbox').prototype.onReady.apply(this, arguments);
|
801 |
+
|
802 |
+
var strings = this.getSettings('strings');
|
803 |
+
|
804 |
+
this.addButton({
|
805 |
+
name: 'ok',
|
806 |
+
text: strings.confirm,
|
807 |
+
callback: function (widget) {
|
808 |
+
|
809 |
+
widget.trigger('confirm');
|
810 |
+
}
|
811 |
+
});
|
812 |
+
},
|
813 |
+
getDefaultSettings: function () {
|
814 |
+
|
815 |
+
var settings = DialogsManager.getWidgetType('lightbox').prototype.getDefaultSettings.apply(this, arguments);
|
816 |
+
|
817 |
+
settings.strings = {
|
818 |
+
confirm: 'OK'
|
819 |
+
};
|
820 |
+
|
821 |
+
return settings;
|
822 |
+
}
|
823 |
+
}));
|
824 |
+
|
825 |
+
// Exporting the DialogsManager variable to global
|
826 |
+
global.DialogsManager = DialogsManager;
|
827 |
+
})(
|
828 |
+
typeof jQuery !== 'undefined' ? jQuery : typeof require === 'function' && require('jquery'),
|
829 |
+
typeof module !== 'undefined' ? module.exports : window
|
830 |
+
);
|
admin/assets/pa-elements-font/css/pa-elements.css
CHANGED
@@ -23,6 +23,9 @@
|
|
23 |
-webkit-font-smoothing: antialiased;
|
24 |
-moz-osx-font-smoothing: grayscale;
|
25 |
}
|
|
|
|
|
|
|
26 |
.pa-grid-icon:before {
|
27 |
content: "\e906";
|
28 |
}
|
23 |
-webkit-font-smoothing: antialiased;
|
24 |
-moz-osx-font-smoothing: grayscale;
|
25 |
}
|
26 |
+
.elementor-element-wrapper:hover [class^="pa-"], .elementor-element-wrapper:hover [class*=" pa-"]{
|
27 |
+
color: #b7084e;
|
28 |
+
}
|
29 |
.pa-grid-icon:before {
|
30 |
content: "\e906";
|
31 |
}
|
admin/settings-page.php
CHANGED
@@ -4,7 +4,7 @@ if( ! defined( 'ABSPATH' ) ) exit(); // Exit if accessed directly
|
|
4 |
|
5 |
class PA_admin_settings {
|
6 |
|
7 |
-
public $pa_elements_keys = ['premium-banner', 'premium-blog','premium-carousel', 'premium-countdown','premium-counter','premium-dual-header','premium-fancytext','premium-image-separator','premium-maps','premium-modalbox','premium-person','premium-progressbar','premium-testimonials','premium-title','premium-videobox','premium-pricing-table','premium-button','premium-contactform', 'premium-image-button', 'premium-map-api', 'premium-map-disable-api','premium-grid'];
|
8 |
|
9 |
private $pa_default_settings;
|
10 |
|
@@ -16,17 +16,35 @@ class PA_admin_settings {
|
|
16 |
add_action( 'admin_menu', array( $this,'pa_admin_menu') );
|
17 |
add_action('init', array( $this, 'pa_admin_page_scripts' ) );
|
18 |
add_action( 'wp_ajax_pa_save_admin_addons_settings', array( $this, 'pa_save_settings_with_ajax' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
}
|
20 |
|
21 |
public function pa_admin_page_scripts () {
|
22 |
wp_enqueue_style( 'pa_admin_icon', plugins_url( '/', __FILE__ ).'assets/pa-elements-font/css/pafont.css' );
|
23 |
if( isset( $_GET['page'] ) && $_GET['page'] == 'pa-settings-page' ) {
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
|
|
28 |
wp_enqueue_script( 'premium_addons_sweetalert2-js', plugins_url( '/', __FILE__ ).'assets/js/sweetalert2/js/sweetalert2.min.js', array( 'jquery', 'premium_addons_sweet-js' ), '1.0', true );
|
29 |
-
|
30 |
}
|
31 |
|
32 |
public function pa_admin_menu() {
|
@@ -39,18 +57,17 @@ class PA_admin_settings {
|
|
39 |
);
|
40 |
wp_localize_script( 'pa-addons-elementor-admin-js', 'settings', $js_info );
|
41 |
|
42 |
-
|
43 |
-
|
44 |
-
$this->pa_get_settings = get_option( 'pa_save_settings', $this->pa_default_settings );
|
45 |
|
46 |
-
|
47 |
|
48 |
-
|
49 |
-
$pa_updated_settings = array_merge( $this->pa_get_settings, $pa_new_settings );
|
50 |
-
update_option( 'pa_save_settings', $pa_updated_settings );
|
51 |
-
}
|
52 |
-
$this->pa_get_settings = get_option( 'pa_save_settings', $this->pa_default_settings );
|
53 |
|
|
|
|
|
|
|
|
|
|
|
54 |
|
55 |
?>
|
56 |
<div class="wrap">
|
@@ -71,6 +88,7 @@ class PA_admin_settings {
|
|
71 |
<li><a class="pa-tab-list-item" href="#pa-about">About</a></li>
|
72 |
<li><a class="pa-tab-list-item" href="#pa-modules">Elements</a></li>
|
73 |
<li><a class="pa-tab-list-item" href="#pa-maps-api">Google Maps API</a></li>
|
|
|
74 |
<li><a class="pa-tab-list-item" href="#pa-system">System Info</a></li>
|
75 |
</ul>
|
76 |
<div id="pa-about" class="pa-settings-tab">
|
@@ -82,7 +100,7 @@ class PA_admin_settings {
|
|
82 |
</div>
|
83 |
<div class="pa-text-container">
|
84 |
<h4>What is Premium Addons?</h4>
|
85 |
-
<p>Premium Addons for Elementor that extends Elementor Page Builder capabilities with
|
86 |
</div>
|
87 |
</div>
|
88 |
</div>
|
@@ -329,16 +347,43 @@ class PA_admin_settings {
|
|
329 |
<input type="submit" value="Save Settings" class="button pa-btn pa-save-button">
|
330 |
</div>
|
331 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
332 |
<div id="pa-system" class="pa-settings-tab">
|
333 |
<div class="pa-row">
|
|
|
334 |
<h3><?php echo esc_html__('System setup information useful for debugging purposes.','premium-addons-for-elementor');?></h3>
|
335 |
<div class="pa-system-info-container">
|
336 |
<?php
|
337 |
echo nl2br(pa_get_sysinfo());
|
338 |
?>
|
339 |
-
|
340 |
</div>
|
341 |
</div>
|
|
|
342 |
<div>
|
343 |
<p>Did you like Premium Addons for Elementor Plugin? Please<a href="https://wordpress.org/support/plugin/premium-addons-for-elementor/reviews/#new-post" target="_blank"> Click Here to Rate it ★★★★★</a></p>
|
344 |
</div>
|
@@ -380,6 +425,7 @@ class PA_admin_settings {
|
|
380 |
'premium-grid' => intval( $settings['premium-grid'] ? 1 : 0),
|
381 |
'premium-map-api' => $settings['premium-map-api'],
|
382 |
'premium-map-disable-api' => intval( $settings['premium-map-disable-api'] ? 1 : 0),
|
|
|
383 |
);
|
384 |
update_option( 'pa_save_settings', $this->pa_settings );
|
385 |
|
4 |
|
5 |
class PA_admin_settings {
|
6 |
|
7 |
+
public $pa_elements_keys = ['premium-banner', 'premium-blog','premium-carousel', 'premium-countdown','premium-counter','premium-dual-header','premium-fancytext','premium-image-separator','premium-maps','premium-modalbox','premium-person','premium-progressbar','premium-testimonials','premium-title','premium-videobox','premium-pricing-table','premium-button','premium-contactform', 'premium-image-button', 'premium-map-api', 'premium-map-disable-api','premium-grid', 'is-beta-tester'];
|
8 |
|
9 |
private $pa_default_settings;
|
10 |
|
16 |
add_action( 'admin_menu', array( $this,'pa_admin_menu') );
|
17 |
add_action('init', array( $this, 'pa_admin_page_scripts' ) );
|
18 |
add_action( 'wp_ajax_pa_save_admin_addons_settings', array( $this, 'pa_save_settings_with_ajax' ) );
|
19 |
+
add_action('admin_enqueue_scripts',array( $this, 'localize_js_script' ) );
|
20 |
+
}
|
21 |
+
|
22 |
+
public function localize_js_script(){
|
23 |
+
wp_localize_script(
|
24 |
+
'pa-addons-elementor-admin-js',
|
25 |
+
'premiumRollBackConfirm',
|
26 |
+
[
|
27 |
+
'home_url' => home_url(),
|
28 |
+
'i18n' => [
|
29 |
+
'rollback_confirm' => __( 'Are you sure you want to reinstall version ' . PREMIUM_ADDONS_STABLE_VERSION . ' ?', 'premium-addons-for-elementor' ),
|
30 |
+
'rollback_to_previous_version' => __( 'Rollback to Previous Version', 'premium-addons-for-elementor' ),
|
31 |
+
'yes' => __( 'Yes', 'premium-addons-for-elementor' ),
|
32 |
+
'cancel' => __( 'Cancel', 'premium-addons-for-elementor' ),
|
33 |
+
],
|
34 |
+
]
|
35 |
+
);
|
36 |
}
|
37 |
|
38 |
public function pa_admin_page_scripts () {
|
39 |
wp_enqueue_style( 'pa_admin_icon', plugins_url( '/', __FILE__ ).'assets/pa-elements-font/css/pafont.css' );
|
40 |
if( isset( $_GET['page'] ) && $_GET['page'] == 'pa-settings-page' ) {
|
41 |
+
wp_enqueue_style( 'premium_addons_elementor-css', plugins_url( '/', __FILE__ ).'assets/admin.css' );
|
42 |
+
wp_enqueue_style( 'premium_addons-sweetalert2-css', plugins_url( '/', __FILE__ ).'assets/js/sweetalert2/css/sweetalert2.min.css' );
|
43 |
+
wp_enqueue_script('pa-addons-elementor-admin-js', plugins_url( '/' , __FILE__ ).'assets/admin.js' , array('jquery','jquery-ui-tabs'), '1.0' , true );
|
44 |
+
wp_enqueue_script('pa-dialog',PREMIUM_ADDONS_URL . 'admin/assets/js/dialog/dialog.js',array('jquery-ui-position'),'4.2.1',true);
|
45 |
+
wp_enqueue_script( 'premium_addons_sweet-js', plugins_url( '/', __FILE__ ).'assets/js/sweetalert2/js/core.js', array( 'jquery' ), '1.0', true );
|
46 |
wp_enqueue_script( 'premium_addons_sweetalert2-js', plugins_url( '/', __FILE__ ).'assets/js/sweetalert2/js/sweetalert2.min.js', array( 'jquery', 'premium_addons_sweet-js' ), '1.0', true );
|
47 |
+
}
|
48 |
}
|
49 |
|
50 |
public function pa_admin_menu() {
|
57 |
);
|
58 |
wp_localize_script( 'pa-addons-elementor-admin-js', 'settings', $js_info );
|
59 |
|
60 |
+
$this->pa_default_settings = array_fill_keys( $this->pa_elements_keys, true );
|
|
|
|
|
61 |
|
62 |
+
$this->pa_get_settings = get_option( 'pa_save_settings', $this->pa_default_settings );
|
63 |
|
64 |
+
$pa_new_settings = array_diff_key( $this->pa_default_settings, $this->pa_get_settings );
|
|
|
|
|
|
|
|
|
65 |
|
66 |
+
if( ! empty( $pa_new_settings ) ) {
|
67 |
+
$pa_updated_settings = array_merge( $this->pa_get_settings, $pa_new_settings );
|
68 |
+
update_option( 'pa_save_settings', $pa_updated_settings );
|
69 |
+
}
|
70 |
+
$this->pa_get_settings = get_option( 'pa_save_settings', $this->pa_default_settings );
|
71 |
|
72 |
?>
|
73 |
<div class="wrap">
|
88 |
<li><a class="pa-tab-list-item" href="#pa-about">About</a></li>
|
89 |
<li><a class="pa-tab-list-item" href="#pa-modules">Elements</a></li>
|
90 |
<li><a class="pa-tab-list-item" href="#pa-maps-api">Google Maps API</a></li>
|
91 |
+
<li><a class="pa-tab-list-item" href="#pa-maintenance">Version Control</a></li>
|
92 |
<li><a class="pa-tab-list-item" href="#pa-system">System Info</a></li>
|
93 |
</ul>
|
94 |
<div id="pa-about" class="pa-settings-tab">
|
100 |
</div>
|
101 |
<div class="pa-text-container">
|
102 |
<h4>What is Premium Addons?</h4>
|
103 |
+
<p>Premium Addons for Elementor that extends Elementor Page Builder capabilities with 20 fully customizable elements that helps you build impressive websites with no coding required.</p>
|
104 |
</div>
|
105 |
</div>
|
106 |
</div>
|
347 |
<input type="submit" value="Save Settings" class="button pa-btn pa-save-button">
|
348 |
</div>
|
349 |
</div>
|
350 |
+
<div id="pa-maintenance" class="pa-settings-tab">
|
351 |
+
<div class="pa-row">
|
352 |
+
<table class="pa-beta-table">
|
353 |
+
<tr>
|
354 |
+
<th><h4 class="pa-roll-back">Rollback to Previous Version</h4><span class="pa-roll-back-span"><?php echo sprintf('Experiencing an issue with Premium Addons for Elementor version %s? Rollback to a previous version before the issue appeared.',PREMIUM_ADDONS_VERSION); ?></span></th>
|
355 |
+
</tr>
|
356 |
+
|
357 |
+
<tr class="pa-roll-row">
|
358 |
+
<th>Rollback Version</th>
|
359 |
+
<td><div><?php echo sprintf( '<a target="_blank" href="%s" class="button pa-btn pa-rollback-button elementor-button-spinner">Reinstall Version 2.1.2</a>', wp_nonce_url( admin_url( 'admin-post.php?action=premium_addons_rollback' ), 'premium_addons_rollback' ) ); ?> </div><p class="pa-roll-desc"><span>Warning: Please backup your database before making the rollback.</span></p></td>
|
360 |
+
</tr>
|
361 |
+
<tr>
|
362 |
+
<th><h4 class="pa-beta-test">Become a Beta Tester</h4><span class="pa-beta-test-span">Turn-on Beta Tester, to get notified when a new beta version of Premium Addons for Elementor. The Beta version will not install automatically. You always have the option to ignore it.</span></th>
|
363 |
+
</tr>
|
364 |
+
<tr class="pa-beta-row">
|
365 |
+
<th><?php echo esc_html__('Beta Tester','premium-addons-for-elementor');?></th>
|
366 |
+
<td><div><input name="is-beta-tester" id="is-beta-tester" type="checkbox" <?php checked(0, $this->pa_get_settings['is-beta-tester'], true) ?>><span><?php echo esc_html__('Check this box to get updates for beta versions','premium-addons-for-elementor'); ?></span></div><p class="pa-beta-desc"><span>Please Note: We do not recommend updating to a beta version on production sites.</span></p></td>
|
367 |
+
</tr>
|
368 |
+
|
369 |
+
</table>
|
370 |
+
|
371 |
+
<input type="submit" value="Save Settings" class="button pa-btn pa-save-button">
|
372 |
+
|
373 |
+
</div>
|
374 |
+
</div>
|
375 |
<div id="pa-system" class="pa-settings-tab">
|
376 |
<div class="pa-row">
|
377 |
+
|
378 |
<h3><?php echo esc_html__('System setup information useful for debugging purposes.','premium-addons-for-elementor');?></h3>
|
379 |
<div class="pa-system-info-container">
|
380 |
<?php
|
381 |
echo nl2br(pa_get_sysinfo());
|
382 |
?>
|
383 |
+
</div>
|
384 |
</div>
|
385 |
</div>
|
386 |
+
|
387 |
<div>
|
388 |
<p>Did you like Premium Addons for Elementor Plugin? Please<a href="https://wordpress.org/support/plugin/premium-addons-for-elementor/reviews/#new-post" target="_blank"> Click Here to Rate it ★★★★★</a></p>
|
389 |
</div>
|
425 |
'premium-grid' => intval( $settings['premium-grid'] ? 1 : 0),
|
426 |
'premium-map-api' => $settings['premium-map-api'],
|
427 |
'premium-map-disable-api' => intval( $settings['premium-map-disable-api'] ? 1 : 0),
|
428 |
+
'is-beta-tester' => intval( $settings['is-beta-tester'] ? 0 : 1),
|
429 |
);
|
430 |
update_option( 'pa_save_settings', $this->pa_settings );
|
431 |
|
assets/images/premium-addons-logo.png
ADDED
Binary file
|
assets/js/lib/jqu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